Repository navigation
Conversation
Consumer shims scaffolded by `board init` always append `--backlog-file`, and `bin/add-backlog` understands no flags at all -- it resolves its targets from BACKLOG_STAGE_BACKLOG / BACKLOG_STAGE_STAGING with a cwd-derived fallback. `promote` forwarded argv verbatim, which broke twice over. The flag reached the engine's int() selection parse, so every `promote <n>` and `promote reject <n>` died with a usage message about candidate numbers. `list` returns before that parse and `all` short-circuits past it, so those two kept working -- the worst shape this failure could take, since the only surviving path is the one that promotes everything, and promote is documented as the human review gate. Separately the operator's explicit target was discarded, so promote resolved its write target from cwd. Running repoA's shim from inside repoB promoted repoB's staged candidate into repoB's board while repoA's was untouched. In the cross-repo cockpit this kit exists to provide, that is a silent write to the wrong board. cmd_sync already documents and handles this exact shim behaviour; promote now gets the same translation. Defence in depth: add-backlog names an unrecognised flag instead of feeding it to int() and reporting a selection error. The fix is deliberately kit-side, so shims already scaffolded in consumer repos are corrected without those repos regenerating anything. Proof of done, including the negative control and an honest note on which two of the five new assertions do not discriminate this defect: docs/verification/board-promote-backlog-file.md Fixes #443 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GnGEYYtrsV3iTY1VXc7tvW
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.
Fixes #443.
What was broken
Consumer shims scaffolded by
board initalways append--backlog-file, andbin/add-backlogunderstands no flags at all — it resolves its targets fromBACKLOG_STAGE_BACKLOG/BACKLOG_STAGE_STAGINGwith a cwd-derived fallback.promoteforwarded argv verbatim, and that broke twice over.1. Numeric selection always failed. The flag reached the engine's
int(x)selection parse, soint("--backlog-file")raised and everypromote <n>/promote reject <n>exited 2 with a usage message about candidate numbers — pointing the operator at the wrong thing entirely.listreturns before that parse andallshort-circuits past it, so exactly those two kept working. That is the worst shape this failure could take: the only surviving path is the one that promotes everything, andpromoteis documented as "the human gate". Someone wanting 2 of 5 candidates had no working way to say so, and the obvious workaround promotes the three they meant to leave staged.2. The addressed board was ignored. The operator's explicit
--backlog-filewas discarded, so promote resolved its write target from cwd:repoA's shim, repoA's flag, repoB's board. In the cross-repo cockpit this kit exists to provide (
boards.txt,board all,board mirror), that is a silent write to the wrong repo.The fix
cmd_syncalready documents and handles this exact shim behaviour — "Consumer shims append--backlog-file; translate it to the engine's--backlog".promotenow gets the same treatment: acmd_promotethat parses the flag out, exportsBACKLOG_STAGE_BACKLOG, derivesBACKLOG_STAGE_STAGINGas its sibling (both are scaffolded into_meta/bycmd_init, so deriving beats adding a second flag to every shim), and execs the engine with the remaining args.Defence in depth:
add-backlognow names an unrecognised flag explicitly instead of feeding it toint()and reporting a selection error. That misdirection is most of why #443 was hard to read.Kit-side on purpose. Shims already scaffolded in consumer repos are fixed without those repos regenerating anything.
Verification
bash tests/test-board.sh→ TOTAL 42, PASS 41, FAIL 0, SKIP 1. The skip is the pre-existing NC-e ops-toolkit render comparison, absent on this machine.Five new assertions, run from inside repoB while addressing repoA's board:
Negative control: fix stashed, same suite re-run → FAIL 3, sources restored and byte-compared.
Honest limit, worth a reviewer's attention: AC7b and AC7d pass on the unfixed code too. When
promote <n>dies at the usage error nothing is written anywhere, so "repoB gained no rows" and "A-second is still staged" are vacuously true. They do not discriminate this defect. They are kept because they do discriminate a plausible wrong fix — one that makes selection work but still resolves the target from cwd, or that promotes the whole staging file. AC7a, AC7c and NC-f are the three that actually go red.Proof-of-done with both runs:
docs/verification/board-promote-backlog-file.md.Rollback
Revert the commit. Confined to a dispatch branch, a new
cmd_promote, and a flag guard — no state, no migration, no on-disk format change.🤖 Generated with Claude Code
https://claude.ai/code/session_01GnGEYYtrsV3iTY1VXc7tvW