7fcd7d7469
Six fixes for the bot review comments landed on PR #2864 head
649d3990. See phase2-playbook.md §7 for the triage rationale.
* persistence.rs: oversized state file now surfaces an InvalidData
error instead of silently returning a default. The old behaviour
would let the next save overwrite the oversized file and destroy
the user's data. Test updated to expect the error.
* persistence.rs: PersistedDelegation gains a `status` field so
in-flight `InProgress` delegations aren't silently demoted to
`Pending` on restart. The snapshot now writes the live status
and restore_from_snapshot honours it. Adds a regression test.
* mention.rs: resolve_tab_mention no longer sorts its input — tab
mentions (@Tab2) must map to the visual order in the tab bar,
not to an arbitrary ID sort. Test updated.
* manager.rs: `pending_tasks` renamed to `completed_delegations`
because the getter returns completed DelegationResults, not
in-flight tasks. Docstring points to the in-flight getter
`pending_delegations` to avoid the same confusion recurring.
* manager.rs: delegate_task and start_meeting now validate that
the from/to tab IDs (or all participant IDs) currently exist
in the manager. Returns `None` on any unknown ID, preventing
orphaned tasks / meetings with stale tab references. Two new
regression tests cover both methods.
Local CI matrix (Windows runner, flags matching ci.yml):
- cargo fmt --all -- --check: exit 0
- cargo clippy --workspace --all-features --locked -- -D warnings: exit 0
- cargo test --workspace --all-features --locked: 4282 pass, 6 fail
(the 6 failures are pre-existing on the baseline; not caused
by this PR)
- git diff --exit-code -- Cargo.lock: exit 0
The three deferred threads (#1 close_tab cleanup, #5 cross_tab_links
snapshot, #8 TabGroup::new collision risk) are explicitly out of
scope here; they belong to the follow-up collab/UI PR per the
narrow-harvest promise to Hmbown.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>