Skip to content

fix(queue): route publish method reads through the no-mistakes alias - #78

Merged
LeTuR merged 1 commit into
mainfrom
fix/queue-check-alias
Sep 12, 2026
Merged

LeTuR merged 1 commit into
mainfrom
fix/queue-check-alias

Conversation

@LeTuR

@LeTuR LeTuR commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Intent

Fleet task queue-check-alias/01-01-accept-legacy-alias. ./scripts/queue.sh check rejected every task record whose publish method is no-mistakes — the method #74 renamed to attested — even though AGENTS.md's contract is that no-mistakes is still accepted wherever a method is read and means attested. 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), and queue.sh add --publish no-mistakes was 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() in scripts/lib/queue.py now normalizes a record's publish.method through publish_method() before validating it against PUBLISH_METHODS, so archived records still carrying the retired no-mistakes word pass queue.sh check instead of being flagged as invalid, while a genuinely unknown method is still rejected.
  • task_publish() normalizes the task's declared publish method through publish_method() before checking membership in PUBLISH_METHODS, so a record written as no-mistakes resolves to attested instead of silently falling back to the operator's default publish method.
  • queue.sh add --publish now uses type=publish_method on the argparse argument (applied before choices), so passing --publish no-mistakes is accepted and stored as attested instead of being rejected by argparse.
  • scripts/queue-selftest.sh adds test coverage for all three fixes: check accepting the no-mistakes alias while still rejecting an unknown method, add --publish no-mistakes succeeding and recording attested, and task_publish/show resolving a no-mistakes-tagged record to attested rather than falling back to pr.

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.sh had already passed on the target commit. To directly test the user intent, I ran the full scripts/queue-selftest.sh on the target commit (9e359dc) and confirmed all six new alias-regression assertions pass: check silently accepts a task record carrying the retired no-mistakes method (normalizing it to attested with no notice, as the intent specifies), still rejects a genuinely bogus method (carrier-pigeon) without also flagging the alias, queue.sh add --publish no-mistakes succeeds and persists attested (never the old word), and task_publish/show read a no-mistakes-tagged record as attested rather than silently downgrading to the clone's pr default. 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 — check reported publish method 'no-mistakes' is not one of attested, pr, push, add --publish no-mistakes was refused by argparse's choices, and show reported the record as verified pr instead of attested. 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 outside scripts/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.sh on 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 genuine
  • Manual inspection of PUBLISH_ALIASES/publish_method() in scripts/lib/queue.py:388-395 confirming the alias is defined once and routed through by cmd_check, task_publish(), and the --publish argparse type=
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

…-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
@LeTuR
LeTuR enabled auto-merge (squash) September 12, 2026 21:30
@LeTuR
LeTuR merged commit d30f2dd into main Sep 12, 2026
11 checks passed
@LeTuR
LeTuR deleted the fix/queue-check-alias branch September 12, 2026 21:32
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