Repository navigation
test(cb-7iv1): one epic-family table holds the event-bead rule in all four implementations - #533
Conversation
…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
|
Review (cold read,
Verified by the reviewer: all three suites and the Rust test pass. Removing the event filter from |
…her a family is empty Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKexPTFG3ToWSiTPBiiX
|
Answers to the review:
|
There was a problem hiding this comment.
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.jsonas 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, newsweep-epics). - Fixed
scripts/sweep-epics.shto dropeventbeads before computing the newest childclosed_at. - Added a fleet-view Rust test to assert
partition_beadsanswers 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
Bead: cb-7iv1. An epic's event beads (the audit records
bd set-statefiles 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, everythingbd childrenreturns 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 thebd childrenfallback 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 whenfamily_closed.tests/sweep-epics.sh(new, the script's first suite): it refuses a call without--json, prints[]when nothing is eligible, and checksminutes_since_last_child_closedagainst each row'slast_child_closed_at.scripts/sweep-epics.sh(the fix): it dropseventbeads before taking the newestclosed_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_answeredruns each row throughpartition_beads. It checks three things: whether the epic is inepics, whether an open epic is unplanned work, and whether a closed epic reaches Merged.CLAUDE.md: names the table among the shared tables and besidescripts/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: okbash tests/sweep-epics.sh,bash tests/work-beads.sh,bash tests/verifier-epic-candidates.sh: all passcargo test --workspace --locked the_epic_family_table_is_answered: okwork-beads'bd childrencount, fromverifier-epic-candidates, or frommodel.rs'sparent_ids, each suite goes red on the table's rows.bash tests/gate: every suite and the Rust and UI legs passed excepttests/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