Skip to content

test(cb-pkd4): the give-back guard's branches are unit tests where they are decided - #535

Merged
rmstdope merged 4 commits into
mainfrom
cb-pkd4-testing-the-give-back-guard-that-let-cb
Nov 10, 2026
Merged

rmstdope merged 4 commits into
mainfrom
cb-pkd4-testing-the-give-back-guard-that-let-cb

Conversation

@rmstdope

Copy link
Copy Markdown
Owner

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 in being_planned or claimed; 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 the Ux fingerprint 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_started forgets the note.
  • app::tests::only_a_returned_give_back_is_noted_as_returned: only ReleaseOutcome::Returned reaches app.returned.
  • main.rs: a_give_back_answered_elsewhere_does_not_swallow_a_later_return removed. 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_bead stays as the one wiring test.

Validation

  • disk-preflight --workload rust: 862 GB free.
  • Mutation check: I broke each branch on purpose and ran the new cases. Every break turned at least one case red: still_held's claimed chain, 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 an Elsewhere push 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-keys on the first run, and fleet-view-restart, fleet-board, fleet-keys and fleet-launch on 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

rmstdope and others added 4 commits November 10, 2026 17:39
…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
@rmstdope

Copy link
Copy Markdown
Owner Author

Review (cold read, reviewed_head: c1a7e0d0acfbc70ceeb32158e882c2247e6ecca8): this review was done before merge, under the producer's review practice. The reviewer was an agent given the diff and the bead, and not the producer's reasoning.

No findings.

What the reviewer checked:

  • Plan match. The diff adds the six triggers::tests::give_back cases, lifecycle::tests::still_held_reads_the_holder_from_either_bucket and app::tests::only_a_returned_give_back_is_noted_as_returned. It deletes the Elsewhere pty test and keeps the one wiring test. No production code changed.
  • Each case fails if its branch breaks. The reviewer read every listed mutation against the code and confirmed it would turn a case red. The app.rs case walks every ReleaseOutcome.
  • Nothing lost by the deletion. What was distinct about the Elsewhere test is now covered by only_a_returned_give_back_is_noted_as_returned and a_give_back_not_listed_is_dropped_and_cannot_swallow_a_later_return. The wiring is still covered by the kept main.rs test.
  • Deterministic. The cases use fixed timestamps and plain data, with no clock, network or shared paths.
  • Ran. The 8 new cases and the kept wiring test pass at c1a7e0d.

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 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 triggers unit tests covering StartLedger::settle_given_back give-back note retention/absorption/drop and related behaviors.
  • Add a lifecycle unit test ensuring still_held checks both being_planned and claimed buckets.
  • Add an app unit test asserting only ReleaseOutcome::Returned is recorded as returned, and remove a now-redundant main.rs test 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

@rmstdope
rmstdope merged commit 221b77e into main Nov 10, 2026
5 checks passed
@rmstdope
rmstdope deleted the cb-pkd4-testing-the-give-back-guard-that-let-cb branch November 10, 2026 16:57
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