23 lines
2.0 KiB
Markdown
23 lines
2.0 KiB
Markdown
|
|
# 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 variants `Stage::MergeFailureFinal`, `Stage::Frozen { resume_to }`, `Stage::ReviewHold { resume_to, reason }` in `pipeline_state/types.rs` — DONE. Auto-assigner, watchdog, unblock/freeze/unfreeze, merge pipeline all `match` on Stage — DONE.
|
||
|
|
- AC 3 (no Option<bool> flag-poking): grep for `set_blocked|set_review_hold|set_frozen|set_mergemaster_attempted` returns no results — DONE.
|
||
|
|
- AC 4 (cargo check/clippy/test pass): `run_check` clean, `run_tests` reports 2908 passed / 0 failed — DONE.
|
||
|
|
|
||
|
|
## Decisions
|
||
|
|
- Resume target for `Frozen`/`ReviewHold`: stored as a sibling `resume_to: LwwRegisterCrdt<String>` on `PipelineItemCrdt` rather 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_frozen` legacy migration: rewrites stage to `"frozen"` and sets `resume_to = "backlog"`, restoring `Stage::Frozen { resume_to: Backlog }` on read. The defensive projection fallback still maps raw `7_frozen` → `Backlog` for un-migrated reads.
|
||
|
|
|
||
|
|
## Current state
|
||
|
|
All flag fields removed; all 47 modified files compile; 2908 tests pass; doc coverage clean.
|
||
|
|
|
||
|
|
## What's left
|
||
|
|
- [x] Commit changes
|