fix(jobs): six shipped fix: lines told the reader to edit a field nothing reads - #224
Conversation
…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>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. 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:
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 You can also wait for the limit to reset, then comment 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 configurationConfiguration used: Path: .coderabbit.yml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (9)
Comment |
Refs #223 — the non-breaking half.
The defect
JobsConfig.driverhas no reader anywhere. Boot always buildscreatePgDriver:packages/jobs/src/driver.ts:5-9has said so since 2026-08:Six
fix:lines named that field as the repair regardless:fix:driver-redis.ts:25set jobs: { driver: 'postgres' } in app.config.ts, then: x jobs drain --to memory --jsondriver-nats.ts:22inspect.ts:94… then: x jobs ls --jsonerrors.ts:358… then: x jobs cancel <id> --jsonerrors.ts:375remove 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.tsandinspect.test.tseach held a literal copy of the wrong string and assertedexpect(ultimateError.fix).toBe(FIX). So the suite would have gone red on the repair and stayed green on the defect — the same shape as therelease.ts--helpbug earlier in this release. Updated to the corrected strings.The guard, shipped with the fix
The
errorsgate step could not see this and still cannot — by design. It checks that a fix names a command the build ships, andset jobs: { driver: 'postgres' } in app.config.tsnames 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.tsscans everyfix:string literal in the package and refuses one citingjobs.driver.Mutation-checked, because a scanner that matches nothing passes forever:
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.driveris breaking and waits for the next major — #223, which also records the alternative worth considering: wire it, sodriver: '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 afix:-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
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.