Skip to content

test(cb-7iv1): one epic-family table holds the event-bead rule in all four implementations - #533

Merged
rmstdope merged 4 commits into
mainfrom
cb-7iv1-testing-the-an-event-bead-is-not-an-epic
Nov 10, 2026
Merged

rmstdope merged 4 commits into
mainfrom
cb-7iv1-testing-the-an-event-bead-is-not-an-epic

Conversation

@rmstdope

Copy link
Copy Markdown
Owner

Bead: cb-7iv1. An epic's event beads (the audit records bd set-state files under the bead it changed) reached main counted as the epic's children three times. Each time only one implementation was fixed (cb-z330, cb-cng9, cb-u64g). This PR holds all four implementations to one table.

What changes

  • tests/lib/epic-family.json (new): seven rows. Each gives an epic, everything bd children returns under it (events included), and three stated expectations: family, family_closed, last_child_closed_at.
  • tests/work-beads.sh: the epic stays on the list exactly while its family is empty. Each row runs twice, once through the bd children fallback and once through the id-prefix prefilter. The table replaces the two hand-written cb-cng9 cases.
  • tests/verifier-epic-candidates.sh: the epic is listed exactly when family_closed.
  • tests/sweep-epics.sh (new, the script's first suite): it refuses a call without --json, prints [] when nothing is eligible, and checks minutes_since_last_child_closed against each row's last_child_closed_at.
  • scripts/sweep-epics.sh (the fix): it drops event beads before taking the newest closed_at. Before this, a state change after an epic's last real child closed made the close look fresh, so the close offer was held back. The new suite was red on four rows before the fix.
  • fleet-view/src/model.rs: the_epic_family_table_is_answered runs each row through partition_beads. It checks three things: whether the epic is in epics, whether an open epic is unplanned work, and whether a closed epic reaches Merged.
  • CLAUDE.md: names the table among the shared tables and beside scripts/work-beads.

Not done: a shared jq helper for the three scripts' one-line select. The table is what the bead asks for, and a helper would add a fifth place to read.

Validation

  • disk-preflight --workload rust: ok
  • bash tests/sweep-epics.sh, bash tests/work-beads.sh, bash tests/verifier-epic-candidates.sh: all pass
  • cargo test --workspace --locked the_epic_family_table_is_answered: ok
  • Mutation checks: with the event filter removed from work-beads' bd children count, from verifier-epic-candidates, or from model.rs's parent_ids, each suite goes red on the table's rows.
  • bash tests/gate: every suite and the Rust and UI legs passed except tests/fleet-keys.sh, which timed out waiting for its stub agent to start under the parallel run. It passes when run alone, and it reads none of the changed files.

No deviation from the plan.

🤖 Generated with Claude Code

https://claude.ai/code/session_01WCDKexPTFG3ToWSiTPBiiX

rmstdope and others added 3 commits November 10, 2026 17:40
…c-family table

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCDKexPTFG3ToWSiTPBiiX
…t child's, held by its own suite

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCDKexPTFG3ToWSiTPBiiX
…le; CLAUDE.md names it

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCDKexPTFG3ToWSiTPBiiX
@rmstdope

Copy link
Copy Markdown
Owner Author

Review (cold read, reviewed_head: c7d809c189b65d7a4eb5abc2eaadfeea3b7be6c1): reviewed before merge under the producer's review practice, by an agent given the diff and the bead but not the producer's reasoning.

  1. Merge condition, not a code defect: the gate is not shown green. tests/fleet-keys.sh timed out under the parallel run and passed alone, and the branch has no CI checks yet. Nothing merges red, so get a green full gate or CI run before merging. If fleet-keys.sh keeps timing out under load, raise it separately.
  2. Non-blocking: every reader checks only whether tests/lib/epic-family.json's family is empty, never which ids it lists. A row naming the wrong members would still pass. Either have the comment say that only emptiness is read, or assert the membership somewhere (e.g. in the Rust test).

Verified by the reviewer: all three suites and the Rust test pass. Removing the event filter from sweep-epics.sh or from work-beads' bd children count turns the table red. Reverting is_event in parent_ids or closed_parent_ids fails rows ef-a and ef-d.

…her a family is empty

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WCDKexPTFG3ToWSiTPBiiX
@rmstdope

Copy link
Copy Markdown
Owner Author

Answers to the review:

  1. Agreed. This PR merges only once CI on the current head is green, and tests/fleet-keys.sh is part of CI. If it times out again there, I'll raise it with the navigator rather than re-run it past the budget.
  2. Fixed in the head after c7d809c: the table's comment now says that every reader checks only whether family is empty, and that the ids are there for whoever reads a row. I didn't add a membership assertion. No implementation exposes membership, so the assertion would have to restate the event rule inside the test, and that is the copy this table exists to remove. No follow-up review: the change is a single comment string in a JSON file.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.

🟢 Approval recommended

The change consolidates epic-family expectations into a shared fixture and updates bash/Rust tests plus the sweep script to enforce the same event-bead exclusion behavior across implementations, with no review evidence indicating unresolved problems.

No open issues 🎉

What changed in this PR

Centralizes the “epic family excludes event beads” rule into a single shared fixture table and updates bash + Rust implementations to validate against it, ensuring last_child_closed_at ignores event beads consistently.

Changes:

  • Added tests/lib/epic-family.json as the canonical epic-family expectation table (family, family_closed, last_child_closed_at).
  • Refactored/added bash test suites to be table-driven (work-beads, verifier-epic-candidates, new sweep-epics).
  • Fixed scripts/sweep-epics.sh to drop event beads before computing the newest child closed_at.
  • Added a fleet-view Rust test to assert partition_beads answers the same table.
  • Documented the shared table in CLAUDE.md.
File Description
tests/​work-beads.sh Replaces bespoke cases with table-driven checks over epic-family.json, exercising both the bd children fallback and the id-prefix prefilter paths.
tests/​verifier-epic-candidates.sh Updates the suite to validate epic-candidate listing behavior against the shared family_closed expectations from epic-family.json.
tests/​sweep-epics.sh Introduces a new table-driven suite that enforces --json behavior and validates minutes_since_last_child_closed against last_child_closed_at expectations.
tests/​lib/​epic-family.json Adds a shared fixture table defining epic/under/family expectations and derived closure fields used across implementations.
scripts/​sweep-epics.sh Fixes last-child-close computation by excluding event beads before selecting the newest closed_at timestamp.
fleet-view/​src/​model.rs Adds a Rust test that runs partition_beads against the shared epic-family table and asserts expected epic/unplanned/merged outcomes.
CLAUDE.md Documents tests/lib/epic-family.json as a shared table and notes the scripts/tests that consume it.

Review effort: Balanced

@rmstdope
rmstdope merged commit bd3d051 into main Nov 10, 2026
4 checks passed
@rmstdope
rmstdope deleted the cb-7iv1-testing-the-an-event-bead-is-not-an-epic branch November 10, 2026 17:00
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.

2 participants