Skip to content

Run released work-boards with the current board run, GC, compact and readers (#271) - #313

Merged
memtomem merged 1 commit into
mainfrom
test/frozen-board2-271
Nov 15, 2026
Merged

memtomem merged 1 commit into
mainfrom
test/frozen-board2-271

Conversation

@memtomem

Copy link
Copy Markdown
Owner

Refs #271. This is the second half of the Board family. The issue stays open: the Memory backends, TUI jobs and Run envelope families remain.

The first half (#312) froze the board databases v0.1.2, v0.2.0 and v0.3.0 wrote, and covered HEAD's readers and the human update path. This half adds no fixtures and no src/ change. It runs HEAD's operational paths over copies of the same databases.

What

tests/test_frozen_board_ops.py (110 cases). Expected values come from the release's own reads in bindings.json, from the raw cells, or from literals. A HEAD function is never its own oracle.

  • board run (Supervisor.run_item, fake agent and memory, real Board on the copy):
    • FIFO dispatch of the released items: bare-done-refused, annotated, human-cleared, needs-done, then nothing. Skipped: human-required, a missing dependency, a planned dependency, and everything not planned. Skipped rows are unchanged cell by cell.
    • A human sign-off of the shared dependency releases needs-planned, then needs-two.
    • --goal backend reaches the reclaimed released item ahead of an older one.
    • --id on released items: the handoff, the five inputs and the active backend decisions reach the prompt; superseded and other-scope decisions do not. The run's outcome is added to the released row (outputs appended, evidence and history kept).
    • An agent's done on a row whose released evidence already holds a passing gate: done with a passing gate from this run, clamped to review without one.
  • A released running lease:
    • Reclaimed exactly at claimed_at + lease (one ulp before, at, after). The ledger's reclaimed_at is stamped, on v0.1.2 in the column HEAD added. Redispatch is counted.
    • apply_update, the crash block (transition(run_id=)) and renew_claim are fenced by the released lease. The wrong lease is tried first, while the released one still owns the row. A renewal is observed at a later clock, since the fixture was frozen at the claim.
  • Scratch GC over the released ledger: purged runs are never collected, a live lease never is, and a reclaimed run is collected only after one lease timeout of grace. A failed purge is scheduled and then cleared by a successful one, in the columns HEAD added. With memory unavailable the ledger is left alone.
  • board compact of released history: the rows removed (at < cutoff), the rollups and counters added to, stats unchanged at the fresh and aged clocks, and a second compaction a no-op. A cutoff between one item's two claims keeps both halves, and board show keeps only the later history.
  • Readers: the gateway board_list (default, limited, per state, per goal), board_get and board_stats; dashboard.take_snapshot; the TUI board tab (row keys and cells, the status line, each item's detail, read from the displayed widgets).
  • Lessons: a lesson promoted onto a released board leaves every released decision unbound. A project sees the released decisions plus its own lesson, and another project sees only the released ones. A lesson cannot supersede a released decision: a same-scope attempt is refused as another project's, and a cross-scope attempt is refused on scope first.

docs/architecture/persisted-contracts.md: the Board row names these. Not covered:

  • A run v0.1.2 reclaimed but never purged. Its reclaimed_at is NULL, so HEAD collects it with no grace. v0.1.2 had no grace either, and its own GC purged every such run in the fixtures, so this is recorded rather than called a defect.
  • room promote onto a released board. It needs a room; test_lessons.py covers the CLI.
  • The memory a released board run wrote, which is outside board.db.

No current path mishandled a released row.

Verification

  • suite-run is CLEAN, ruff check . is clean and git diff --check passes. The fixture directory is unchanged by the tests.

  • 38 injected regressions across board.py, supervisor.py, dashboard.py, tui.py and gateway.py. Each is injected exactly once and restored from a byte copy, and each fails a test with an assertion. They cover:

    • dispatch: the human-required filter, dependencies, order, goal;
    • stale recovery: the boundary, the reclaimed_at stamp, and the Supervisor's recovery call;
    • the lease fences of renew_claim, apply_update and transition;
    • outputs and evidence kept on apply;
    • the prompt's handoff, decisions and inputs, and unbound decisions included;
    • GC grace, purged, backoff, live lease, the reset and the first delay;
    • compaction's rollup and counter accumulation and its strict cutoff;
    • newest-first listing in list_recent and the gateway;
    • the supersede project fence and check order, the lesson scope, and provenance read;
    • the dashboard decision count, and the TUI status, cells and widget update.

    The repeated compaction is checked by a direct comparison of every cell. No single-site change alters only a second compaction.

  • Codex review.

    • Design: two rounds, both NEEDS-FIX, every finding adopted.
    • Implementation round 1: NEEDS-FIX. Four oracle gaps, each shown by a runtime probe. Fixed.
    • Round 2: SHIP.
    • A final unprimed round: SHIP.

🤖 Generated with Claude Code

…readers (#271)

The second half of the Board family of the persisted-contracts D rows.
No fixture is added: tests/test_frozen_board_ops.py drives HEAD's
operational paths over copies of the databases v0.1.2, v0.2.0 and
v0.3.0 wrote (tests/fixtures/persisted/board, frozen by the first half).
Expected values come from the release's own reads in bindings.json, the
raw cells or literals, never from the HEAD function under test.

- board run (Supervisor.run_item with a fake agent and memory): FIFO
  dispatch skipping human-required items and unmet or missing
  dependencies, a dependency released once a human signs it off, --goal
  and --id; the released handoff, inputs and active decisions in the
  prompt (retired and other-scope decisions absent); the outcome added
  to the released row; an agent's done counted only with this run's
  gate, not the released one;
- a released running lease: reclaimed exactly at claimed_at + lease
  (one ulp before, at, after), the ledger's reclaimed_at stamped (on
  v0.1.2 in the column HEAD added), redispatch counted; apply_update,
  the crash block and renew_claim fenced by the released lease, the
  wrong lease tried first;
- the scratch GC over the released ledger: purged runs never collected,
  a live lease never, a reclaimed run only after one lease timeout of
  grace; a failed purge scheduled, then cleared by a successful one, in
  the columns HEAD added; memory unavailable leaves the ledger alone;
- board compact of released history: the rows removed, rollups and
  counters added to, stats unchanged, a second compaction a no-op, and
  a cutoff between one item's two claims keeping both halves;
- the gateway board_list / board_get / board_stats, dashboard
  take_snapshot and the TUI board tab, row by row from released values;
- a lesson promoted onto a released board leaves the released decisions
  unbound, and cannot supersede one (the scope is refused before the
  project).

docs/architecture/persisted-contracts.md: the Board row now names these.
Not covered: a run v0.1.2 reclaimed but never purged (reclaimed_at NULL,
so HEAD collects it without grace; v0.1.2 had none, and its own GC purged
every such run in the fixtures), room promote onto a released board, and
the memory a released board run wrote.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@memtomem
memtomem merged commit f778075 into main Nov 15, 2026
12 checks passed
@memtomem
memtomem deleted the test/frozen-board2-271 branch November 15, 2026 02:25
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