Repository navigation
test(cb-pkd4): the give-back guard's branches are unit tests where they are decided - #535
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKf2BPq4snBsCf41FST1
…gers.rs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKf2BPq4snBsCf41FST1
…nned in app.rs Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKf2BPq4snBsCf41FST1
The elsewhere case's branches now live in app.rs and triggers.rs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WCDKf2BPq4snBsCf41FST1
|
Review (cold read, No findings. What the reviewer checked:
|
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 changes are limited to adding and relocating focused unit tests (removing only a redundant integration-style test) without altering production logic, and the review evidence notes no active issues remaining.
No open issues 🎉
What changed in this PR
Adds focused unit tests for the cb-4yj4 give-back guard behavior in fleet-view, moving branch coverage from an integration-style main.rs test into the modules where the decisions are made, without changing production logic.
Changes:
- Add
triggersunit tests coveringStartLedger::settle_given_backgive-back note retention/absorption/drop and related behaviors. - Add a
lifecycleunit test ensuringstill_heldchecks bothbeing_plannedandclaimedbuckets. - Add an
appunit test asserting onlyReleaseOutcome::Returnedis recorded as returned, and remove a now-redundantmain.rstest while keeping the wiring-level test.
| File | Description |
|---|---|
| fleet-view/src/triggers.rs | Adds a give_back unit-test module that exercises StartLedger::settle_given_back behavior across still-held, settled, unlisted, replacement, and reset-on-start scenarios. |
| fleet-view/src/main.rs | Removes a redundant integration-style test now covered by unit tests and keeps/updates the remaining wiring-level test documentation. |
| fleet-view/src/lifecycle.rs | Adds a unit test verifying still_held correctly recognizes holders in both the being_planned and claimed buckets. |
| fleet-view/src/app.rs | Adds a unit test ensuring only ReleaseOutcome::Returned is tracked as a returned give-back in application state. |
Review effort: Balanced
Bead: cb-pkd4: the give-back guard that let cb-4yj4 reach main had no unit test, only pty tests in main.rs.
Tests only; no production code changes.
lifecycle::tests::still_held_reads_the_holder_from_either_bucket: true for NAME inbeing_plannedorclaimed; false for another assignee, another bead, an empty board.triggers::tests::give_back::*(6 cases): a give-back still held is kept and absorbs nothing; a settled one absorbs only its own bead's revision into theUxfingerprint and is dropped; an unlisted one is dropped and cannot swallow a later return; a non-UX or missing fingerprint is untouched; one note per name (the later give-back wins);note_startedforgets the note.app::tests::only_a_returned_give_back_is_noted_as_returned: onlyReleaseOutcome::Returnedreachesapp.returned.main.rs:a_give_back_answered_elsewhere_does_not_swallow_a_later_returnremoved. Its branches now live in the app.rs and triggers.rs cases.the_views_own_give_back_does_not_restart_the_ux_agent_on_the_same_beadstays as the one wiring test.Validation
disk-preflight --workload rust: 862 GB free.claimedchain, still_held's assignee match, the still-held retain, the revision write, the bead-id match, retaining unlisted notes,note_started's remove, and insert-replaces. The same goes for anElsewherepush in app.rs.cargo test --workspace --all-targets --locked: green (772 lib tests).bash tests/gate: the cargo and web-console legs were green on both runs. Under load average ~13 from other sessions, pty-driven suites timed out:fleet-keyson the first run, andfleet-view-restart,fleet-board,fleet-keysandfleet-launchon the second. All of them were "timed out waiting for" failures. Each one passes when run alone on this head. This diff touches no code they run.No deviation from the plan.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WCDKf2BPq4snBsCf41FST1