Skip to content

fix(jobs): six shipped fix: lines told the reader to edit a field nothing reads - #224

Merged
sebyx07 merged 1 commit into
mainfrom
fix/jobs-driver-fix-lines
Aug 20, 2026
Merged

fix(jobs): six shipped fix: lines told the reader to edit a field nothing reads#224
sebyx07 merged 1 commit into
mainfrom
fix/jobs-driver-fix-lines

Conversation

@sebyx07

@sebyx07 sebyx07 commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

Refs #223 — the non-breaking half.

The defect

JobsConfig.driver has no reader anywhere. Boot always builds createPgDriver:

// packages/cli/src/dev-queue.ts:132
const driver = overrides?.jobs ?? createPgDriver({ executor });

packages/jobs/src/driver.ts:5-9 has said so since 2026-08:

This header used to say "switching backends is a config line". There is no such config line: JobsConfig.driver has no reader anywhere and boot always builds createPgDriver.

Six fix: lines named that field as the repair regardless:

Site shipped fix:
driver-redis.ts:25 set jobs: { driver: 'postgres' } in app.config.ts, then: x jobs drain --to memory --json
driver-nats.ts:22 same
inspect.ts:94 … then: x jobs ls --json
errors.ts:358 … then: x jobs cancel <id> --json
errors.ts:375 remove concurrency from job(…), or set jobs: { driver: 'postgres' }…
outbox.ts:341 … or set jobs.driver in app.config.ts and run \x dev``

So six error paths hand an agent an instruction that changes nothing and returns it to the identical throw. Axiom 4 asks for the exact command that repairs the failure; a no-op is the one thing a fix: may never be.

Each now names setJobDriver(createPgDriver()) — the seam that actually swaps the driver, and what the interface buys — while keeping the runnable command for rows already queued.

The tests pinned the defect as a feature

driver-redis.test.ts, driver-nats.test.ts and inspect.test.ts each held a literal copy of the wrong string and asserted expect(ultimateError.fix).toBe(FIX). So the suite would have gone red on the repair and stayed green on the defect — the same shape as the release.ts --help bug earlier in this release. Updated to the corrected strings.

The guard, shipped with the fix

The errors gate step could not see this and still cannot — by design. It checks that a fix names a command the build ships, and set jobs: { driver: 'postgres' } in app.config.ts names no command at all, so it sailed through. That is the right scope for that step; this needs a different rule.

packages/jobs/src/fix-lines.test.ts scans every fix: string literal in the package and refuses one citing jobs.driver.

Mutation-checked, because a scanner that matches nothing passes forever:

$ # reintroduce the exact shipped string in inspect.ts
$ bun test packages/jobs/src/fix-lines.test.ts
+ [ "inspect.ts: set jobs: { driver: 'postgres' } in app.config.ts, then: x jobs ls --json" ]
(fail) fix lines > no fix: instructs the reader to edit jobs.driver, which selects nothing
 2 pass  1 fail

A second test pins the regex against that literal string and against the corrected one, so the rule cannot rot into a tautology.

Deliberately not fixed here

The field itself. Deleting JobsConfig.driver is breaking and waits for the next major — #223, which also records the alternative worth considering: wire it, so driver: 'redis' constructs the stub and throws honestly rather than silently giving you Postgres. That is the reading the docs assumed for three releases. Deleting fits axiom 1 better, but it is a real choice and shouldn't be made as a rider on a fix:-string change.

Docs for the same gap landed in #222 (Jobs-And-Workflows.md, Configuration.md, and a Known-Gaps Open row).


Gate: bun run verify — 14/18 green, 4 skipped (drift, contract-diff, budgets, seo).
Package: bun test packages/jobs/src/ — 567 pass, 0 fail.

Found by CodeRabbit on #222.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

…hing reads

`JobsConfig.driver` has no reader anywhere. Boot always builds
`createPgDriver` — `packages/jobs/src/driver.ts`'s own header has said so
since 2026-08, and `packages/cli/src/dev-queue.ts:132` is where it
happens. Six `fix:` lines named that field as the repair anyway:

  driver-redis.ts:25   set jobs: { driver: 'postgres' } in app.config.ts…
  driver-nats.ts:22    same
  inspect.ts:94        …then: x jobs ls --json
  errors.ts:358        …then: x jobs cancel <id> --json
  errors.ts:375        …or set jobs: { driver: 'postgres' }…
  outbox.ts:341        …or set jobs.driver in app.config.ts and run x dev

So six error paths handed an agent an instruction that changes nothing
and returns it to the identical throw. Axiom 4 asks for the exact command
that repairs the failure; a no-op is the one thing a fix: may never be.
Each now names `setJobDriver(createPgDriver())` — the seam that actually
swaps the driver — and keeps the runnable command for rows already queued.

Three tests pinned the wrong strings AS CORRECT (`expect(fix).toBe(FIX)`
against a literal copy), so the suite would have gone red on the repair
and stayed green on the defect. Updated.

The `errors` gate step could not see this and still cannot: it checks
that a fix NAMES a command that the build ships, and
`set jobs: { driver: 'postgres' } in app.config.ts` names no command at
all. So the guard ships with the fix — `fix-lines.test.ts` scans every
fix: literal in this package and refuses one citing `jobs.driver`.
Mutation-checked: reintroducing the exact shipped string turns it red,
and a second test pins the regex against that string so a rule that
matched nothing cannot pass forever.

Not fixed here: the field itself. Deleting `JobsConfig.driver` is
breaking and waits for the next major — #223, which also records the
alternative (wire it, so `driver: 'redis'` throws honestly instead of
silently giving you Postgres).

Refs #223

Gate: bun run verify — 14/18, 4 skipped. jobs: 567 pass, 0 fail.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your current included review allowance is based on your included PR review attempts over the past 7 days.

Next review available in: 30 minutes

Limit details: You’ve used the included review currently available. Your 75 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

You’re in a promotional period — use the checkbox below to run this review for free:

  • Run review for free

On-demand reviews are free for the next 31 days. After that, they cost $0.25 per reviewed file.

How can I continue?

Run this review now using the option above, or comment @coderabbitai review --use-credits.

You can also wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 14814231-4d26-4722-bffe-398ba1c92761

📥 Commits

Reviewing files that changed from the base of the PR and between b0853ed and 5215a19.

📒 Files selected for processing (9)
  • packages/jobs/src/driver-nats.test.ts
  • packages/jobs/src/driver-nats.ts
  • packages/jobs/src/driver-redis.test.ts
  • packages/jobs/src/driver-redis.ts
  • packages/jobs/src/errors.ts
  • packages/jobs/src/fix-lines.test.ts
  • packages/jobs/src/inspect.test.ts
  • packages/jobs/src/inspect.ts
  • packages/jobs/src/outbox.ts

Comment @coderabbitai help to get the list of available commands.

@sebyx07
sebyx07 merged commit 578dd20 into main Aug 20, 2026
37 checks passed
@sebyx07
sebyx07 deleted the fix/jobs-driver-fix-lines branch August 20, 2026 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant