Planner moves cards by the board status rule, with a written reason
Back to our planProblem
In plain words: the board status rule now exists and reports what each card should be, but nothing uses it yet. The planner still moves cards on single events with its own older logic, so the board keeps drifting, and the same constants and checks live in two scripts. This piece makes the planner's event moves use the one rule, and writes the reason for each move on the task.
Summary of the owner's decision (2026-11-22, Claude session, voice; recorded on #890): cards are derived from facts by one rule, started work stays In progress until it is resolved or dropped, no card moves without a written reason, and only provable cases are corrected automatically. #1425 delivered the rule in report-only mode; its first full read found a meaningful share of cards that differ, so the first cleanup of existing cards is confirmed by the owner card by card, not swept automatically.
Proposed fix
- Event moves use the rule. When an event concerns an issue,
scripts/planner-board.mjsgathers that issue's facts and sets its card to whatboardStatusreturns. Its own status logic is removed, so one function decides everywhere. - Only the issue the event concerns moves. No full sweep and no schedule in this issue: those follow once the owner has gone through the existing differences.
- Every planner move has a reason. The planner keeps one "Board status" comment per issue and edits it in place with the new status and the rule's reason sentence, so the task stays short. Moves GitHub's built-in board workflows make (In review, Done) need none.
- "Started" recognizes work that predates claim comments. Decided here by the chief of staff as a routine choice, in line with the owner's rule that started work stays In progress: an issue counts as started when a claim comment names a branch, or a pull request in any state closes it or says it does, or a branch that follows the claim naming pattern for that issue exists on the remote. Assignment alone is still not a start.
- Two open rule questions, decided the same way: an open pull request on an upper stack layer that closes the issue counts as In review, like any other;
needs ownerdoes not pull a claimed issue out of In progress, it shows as a flag beside it. - Flags stay flags. Never started, merged but still open, an epic whose children are all closed, an open child of a closed parent: reported in the comment and the report, never acted on by this change.
- Shared pieces defined once (guard rail 1), carried over from the reviews of #1428:
- status names in
planner-board.mjsandplanner-rules.mjscome from the sharedSTATUS; - the Status field name and the card-status query fragment live in
planner-config.mjsand both scripts use them; - the "skip reason, else issue problems" step is one shared function;
- the ready label and the ready blockers move out of
planner-board.mjsinto a rules module, with no script importing the other in both directions.
- status names in
- Rule gaps found by the first read:
- a sub-issue that is not on the board counts for its epic as Backlog; sub-issues and cards are keyed by repository and number;
- the branch form
claimBranchaccepts and the Branch line of the dispatch brief agree, with a test that reads the brief template; - the built-in "item reopened" board workflow is checked against the rule and recorded: either the rule agrees with it, or the page says which one wins.
- Workflow upkeep: the app-token step uses
client-idin place of the deprecatedapp-id, and the checkout and app-token steps repeated across the planner jobs are defined once if GitHub Actions offers a native way that stays readable (record what was found either way). - Docs: the rule page and the board section of how we work describe the live behavior; the two facts dropped earlier are restored (App Check writes to the test issue's card; a manual run catches up anything an event missed).
- Native first: GitHub's built-in workflows keep setting In review and Done. No new dependency.
Existing work compared
Searched open and closed issues on 2026-11-23 for board, planner, card, status rule, reconcile and drift. #890 holds the approved pattern. #1425 (closed) built the rule and the report this issue switches on. #1429 (open, in review) removes sprint logic from the same two scripts, so this issue starts only after it merges. #941 and #1089 (closed) built the event moves this replaces. Nothing else changes how the planner decides a status.
Acceptance criteria
- Not done: A failing test first for each: an event sets the card to the rule's status; the planner's old status logic is gone; an event for one issue writes to no other card
- Not done: A claimed issue with no activity for any length of time stays In progress after any event
- Not done: An issue with real work but no claim comment (a pull request that closes it, or a remote branch in the claim naming pattern) is treated as started, with tests for each form and for assignment alone not counting
- Not done: Each planner move leaves exactly one "Board status" comment on the issue, edited in place, carrying the status and the reason; a move by a built-in workflow adds none
- Not done: No flag causes a move, a label change or an assignee change
- Not done: Status names, the Status field name and the query fragment each have one definition used by every planner script; the duplicate-code check passes
- Not done: The report run from
mainstill works and agrees with what an event would set for the same issue - Not done: A dry run against the live board (report mode) is attached to the pull request, showing what the next event would change for each differing card, with nothing written
- Not done: The rule page and how we work describe the live behavior, including the three decisions above and the restored facts
Files likely touched
scripts/planner-board.mjs, scripts/planner-rules.mjs, scripts/planner-status.mjs, scripts/planner-report.mjs, scripts/planner-config.mjs, their tests, .github/workflows/planner-board.yml, docs/process/board-status-rule.md, docs/process/project-management.md, .agents/skills/chief-of-staff/SKILL.md (brief template, only if the Branch line must change)
Must not touch
src/, .github/workflows/ci.yml, .github/workflows/deploy.yml, any card other than through the planner's own tested path
Open questions
None for this issue. What follows it, each as its own issue under #890 once this merges: the owner confirms the first cleanup card by card from the report; then the scheduled full check with a snapshot any session can read, and the card's column copied onto the issue as a native field.
Area
tooling, ci
Priority
priority: high
Blocked by #1429 (same scripts).
Generated by Claude Code, opens in a new tab