Repository navigation
verify: feat/board-plan-sync (attempt att_03c805fb1df44db9) - #351
Conversation
mojomast
left a comment
There was a problem hiding this comment.
APPROVE (independent review — outside reviewer Claude, at owner Kyle's request) at 9506fad — merge-safe, with two contract gaps that must close before anything passes plan_path to the beat
Read-only review. git/gh reads only, plus a local test run in a throwaway worktree.
What checks out
- Head 9506fad: RED 3221e49 + 727d8a3 (frozen), implementation ee4965b, fix e897e36, and a plain merge of main e17df6b. lease-tamper class=slice TIER=T3, slop-lint, ci-gate and all four test shards are green.
- Scope: since the RED, only the three leased files changed (bundlebees_plugin/board_plan_orphans.py, bundlebees_plugin/beat.py, docs/heartbeat-lanes.md); everything else arrived through the main merge. The three RED test files are byte-identical to 727d8a3.
- tests/test_board_plan_orphans.py and the beat tests pass locally at this head.
- The logic matches AC-001 to AC-005 as tested:
- Terminal statuses are excluded, and card-only works only as a whole line.
- References come from slice id or board_card only.
- Flatten order is waves then the top-level list, with plan_invalid on bad shapes.
- Fold is a deep copy and idempotent, and the plan is written atomically with os.replace.
- The beat records a board_plan_orphans duty and stays unchanged without plan_path.
- An unreadable board or plan is a reason, not an exception (fail closed).
Contract gaps (not covered by the frozen tests; I checked each by hand)
G1. No default board reader. The contract's interfaces add read_board ("hermes kanban --board list --json") and DEFAULT_BOARD rizzstack-t1634. Neither exists, and check()'s board parameter is used as the payload, not a board name. check(plan) with no board_reader returns board_unreadable. So a beat called with plan_path but no board_reader (the production call) reports the duty as an error on every tick.
G2. parse_board_cards accepts only {"tasks": [...]}. The interface says a bare list or a mapping with tasks, cards, items or data. board_stock.read_ready_approved reads the same CLI and accepts a bare list. check() with a reader returning [{"id": "t1", "status": "ready"}] gives board_unreadable.
Both are inert today: nothing passes plan_path to the beat yet. Fixing them means new untested behaviour, so they belong in a follow-up slice with its own RED tests (bare-list payload, the default reader with an injected runner, DEFAULT_BOARD), not in a fix bee on this PR. Nothing should wire plan_path into the cron beat until that slice lands.
Non-blocking
N1. _write_plan writes through mkstemp, so os.replace leaves plan.json mode 0600 (a 0644 plan became 0600 in my check). It also re-serialises with sort_keys=True, which reorders the owner's keys on the first fold. Preserve the original mode and key order.
N2. The status is lower-cased and stripped but not hyphen-to-underscore as the interface notes say. Only the reported status string is affected.
N3. check()'s result lacks the interface's board, plan and at fields, and the now parameter is unused.
N4. beat.py labels any unexpected exception from the check as reason plan_invalid; a crash isn't an invalid plan.
N5. A new orphans wave takes max(numeric wave)+1, so plans with non-numeric wave ids get wave 1. The beat passes no repo, so folded slices carry repo "".
T3: merge needs Kyle's own yes.
Generated by Claude Code
Verified worker payload.
att_03c805fb1df44db9feat/board-plan-sync