fix(queue): route publish method reads through the no-mistakes alias - #78
Merged
Merged
Conversation
…-publish `queue.sh check` compared a record's publish method against PUBLISH_METHODS directly, so every task recorded before #74 renamed `no-mistakes` to `attested` failed the control plane's gate for good. Two other readers had the same drift: `task_publish` let such a record fall back to the operator's default (a silent downgrade to `pr` on a fresh clone), and `add --publish no-mistakes` was refused by argparse. All three now go through publish_method(), which stays the one owner of the alias. Claude-Session: https://claude.ai/code/session_01Hfb2qxCc8oS1bdcmAXgyBs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Fleet task queue-check-alias/01-01-accept-legacy-alias.
./scripts/queue.sh checkrejected every task record whose publish method isno-mistakes— the method #74 renamed toattested— even though AGENTS.md's contract is thatno-mistakesis still accepted wherever a method is read and meansattested. Archived records are never rewritten, so the control plane's gate stayed red for good (23 problems on the live queue). Goal: make check accept the alias by normalising it to attested, and still reject a genuinely invalid method. Hard constraints from the brief: fix the validator, never rewrite the operator's gitignored records; do not widen the accepted set beyond attested, pr, push plus the no-mistakes alias; keep the alias in ONE place (PUBLISH_ALIASES / publish_method() in scripts/lib/queue.py) rather than a second spelling in the validator — that drift is the bug. Tests written first in scripts/queue-selftest.sh and seen failing on the old code for exactly that reason. Decision: an aliased method passes SILENTLY, not with a notice — the contract says it is accepted, nothing writes the old word any more, and the records carrying it are archived history nobody can or should edit, so a notice would be permanent noise with no action to take. Deliberate scope extension within the same bug class: two more readers bypassed publish_method() the same way and were fixed with tests that failed first — task_publish() let a no-mistakes record fall back to the operator default (a silent downgrade to pr on a fresh clone), andqueue.sh add --publish no-mistakeswas refused by argparse choices despite the code comment saying it works (fixed with type=publish_method, which argparse applies before choices, so the record stores attested). Reach: queue_root() anchors to the checkout the script lives in, so a worker worktree, a pipeline worktree or CI validates its own empty queue — this bug only turned check.sh red on the control-plane checkout itself, not in worker gates.What Changed
cmd_check()inscripts/lib/queue.pynow normalizes a record'spublish.methodthroughpublish_method()before validating it againstPUBLISH_METHODS, so archived records still carrying the retiredno-mistakesword passqueue.sh checkinstead of being flagged as invalid, while a genuinely unknown method is still rejected.task_publish()normalizes the task's declared publish method throughpublish_method()before checking membership inPUBLISH_METHODS, so a record written asno-mistakesresolves toattestedinstead of silently falling back to the operator's default publish method.queue.sh add --publishnow usestype=publish_methodon the argparse argument (applied beforechoices), so passing--publish no-mistakesis accepted and stored asattestedinstead of being rejected by argparse.scripts/queue-selftest.shadds test coverage for all three fixes:checkaccepting theno-mistakesalias while still rejecting an unknown method,add --publish no-mistakessucceeding and recordingattested, andtask_publish/showresolving ano-mistakes-tagged record toattestedrather than falling back topr.Risk Assessment
✅ Low: Small, well-scoped fix: all three readers of the publish method (cmd_check, task_publish, --publish argparse) now route through the single publish_method()/PUBLISH_ALIASES normalisation, the validator still rejects genuinely unknown methods, the alias is accepted silently as required, no records are rewritten, and new tests reproduce the original failure (red check on an aliased record) and pass after the fix.
Testing
Baseline
./scripts/check.shhad already passed on the target commit. To directly test the user intent, I ran the fullscripts/queue-selftest.shon the target commit (9e359dc) and confirmed all six new alias-regression assertions pass:checksilently accepts a task record carrying the retiredno-mistakesmethod (normalizing it toattestedwith no notice, as the intent specifies), still rejects a genuinely bogus method (carrier-pigeon) without also flagging the alias,queue.sh add --publish no-mistakessucceeds and persistsattested(never the old word), andtask_publish/showread ano-mistakes-tagged record asattestedrather than silently downgrading to the clone'sprdefault. To prove this is a real regression test and not a tautology, I copied that same test file into a throwaway worktree checked out at the pre-fix base commit (a81bf77) and reran it: it failed for exactly the reasons described in the brief —checkreportedpublish method 'no-mistakes' is not one of attested, pr, push,add --publish no-mistakeswas refused by argparse'schoices, andshowreported the record as verifiedprinstead ofattested. This end-to-end before/after comparison demonstrates the fix resolves the reported control-plane gate failure without widening the accepted method set or duplicating the alias spelling outsidescripts/lib/queue.py. The worktree was left clean; the temporary comparison worktree was removed.Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
./scripts/check.sh./scripts/queue-selftest.shon target commit 9e359dc (full pass, ~147s)./scripts/queue-selftest.sh(target's version of the file) run against pre-fix queue.py at base commit a81bf77 in a temporary worktree — reproduced the exact 5 reported failures, confirming the regression test is genuineManual inspection ofPUBLISH_ALIASES/publish_method()in scripts/lib/queue.py:388-395 confirming the alias is defined once and routed through bycmd_check,task_publish(), and the--publishargparsetype=✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.