2.0 KiB
2.0 KiB
Plan: Story 945 — Delete WorkItem flag soup
Goal: Fold blocked, review_hold, frozen, and mergemaster_attempted
flag fields into Stage / ArchiveReason / ExecutionState variants so the
typed state machine is the single source of truth.
ACs → implementation locations
- AC 1 (delete flag fields):
server/src/crdt_state/types.rs(PipelineItemCrdt, WorkItem) — DONE;server/src/pipeline_state/types.rs(PipelineItem) — DONE. - AC 2 (variants +
match-based callers): New variantsStage::MergeFailureFinal,Stage::Frozen { resume_to },Stage::ReviewHold { resume_to, reason }inpipeline_state/types.rs— DONE. Auto-assigner, watchdog, unblock/freeze/unfreeze, merge pipeline allmatchon Stage — DONE. - AC 3 (no Option flag-poking): grep for
set_blocked|set_review_hold|set_frozen|set_mergemaster_attemptedreturns no results — DONE. - AC 4 (cargo check/clippy/test pass):
run_checkclean,run_testsreports 2908 passed / 0 failed — DONE.
Decisions
- Resume target for
Frozen/ReviewHold: stored as a siblingresume_to: LwwRegisterCrdt<String>onPipelineItemCrdtrather than encoded into the stage string. Rejected: encoding into stage register (would require parsing variants out of strings and lose round-trip cleanness). - Reason text for
Blocked/MergeFailure/MergeFailureFinal/ReviewHold: kept on the Stage variant in memory, but the wire-form stage register only carries the canonical dir name ("merge_failure_final","review_hold"). Reasons are reconstructed at read time from companion CRDT data (MergeJob.error) where needed. Acceptable because reason is human-text, not load-bearing for routing. - Pre-934
7_frozenlegacy migration: rewrites stage to"frozen"and setsresume_to = "backlog", restoringStage::Frozen { resume_to: Backlog }on read. The defensive projection fallback still maps raw7_frozen→Backlogfor un-migrated reads.
Current state
All flag fields removed; all 47 modified files compile; 2908 tests pass; doc coverage clean.
What's left
- Commit changes