Repository navigation
feat(fleet-queue): CLI-01 V2 lifecycle state + loss-aware queue crosswalk (#9501) - #12883
Merged
Merged
Conversation
…walk (#9501) New pure model in work/lifecycle.rs: the eight V2 workflow states from the #9206 design §3, the candidate transition table (validated, terminal-safe, no self-transitions), and the loss-aware projection of every stored queue tasks.status value (queued, claimed, parked, blocked, handed_off, done, cancelled, failed) onto the workflow dimension. Each projection preserves its source state verbatim and declares its fidelity: exact, lossy with named losses, or conditional on named evidence. Queue `done` projects to workflow `completed` only with a verified completion receipt and is explicitly unmapped without one; no stored value is renamed and no queue state projects to `completing`. work/mod.rs gains the one-line module registration. Oracle: lifecycle_queue_state_mapping_preserves_source_state plus three companion tests (crosswalk never projects completing, stored spellings exact and closed, transition table closed/terminal-safe).
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 3 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #9501 (slice CLI-01 under #9206; program #9196).
What
pkgs/fleet/crates/fleet-queue/src/work/lifecycle.rs(new) — a pure, persistence-free model:open,active,parked,blocked,completing,completed,cancelled,failed, with terminal-state marking.TRANSITIONS+is_valid_transition: validated transitions only, no self-transitions, terminal states admit nothing, lifecycle-skipping edges (e.g.open -> completed) rejected.tasks.statusvalues (queued,claimed,parked,blocked,handed_off,done,cancelled,failed). Every mapping preserves its source state verbatim and declares a fidelity:parked/cancelled/failed→ exact;queued -> open,claimed -> active,handed_off -> active,blocked -> blocked→ lossy, each with its losses named (e.g. a claim is ownership, not proof a session started; the blocker source — hard dependency vs manual — is not distinguished by the workflow state alone);done -> completed→ conditional on a verified completion receipt, per the design §3; without the receipt the state is explicitly unmapped with the reason recorded, never guessed.completing(entered only via theactive -> completingtransition), and unratified proposal spellings (in_progress,available, …) never parse into the stored set — no silent rename.work/mod.rsgains the one-linepub mod lifecycle;registration (the export the slice's sibling slices also needed; noted per the #10257 precedent).Verification
Done check from the issue, run in a laptop worktree off origin/main:
cargo test --manifest-path pkgs/fleet/Cargo.toml -p fleet-queue --lib --features client,queue-broker lifecycle_queue_state_mapping_preserves_source_state -- --list→ exactly 1 test with the exact name.lifecycle_crosswalk_never_projects_completing,lifecycle_stored_spellings_are_exact_and_closed,lifecycle_transition_table_is_closed_and_terminal_safe) also pass.fleet-queuelib suite withclient,queue-broker: see issue comment for the recorded result.rustfmt --checkon the new file: clean (pre-existing fmt drift in sibling files untouched).Scope discipline
Design-model slice only, per the issue body: no status schema rename, no stored-value change, no runtime adoption, no new queue/service/executable. Production adoption remains a separately authorized stage.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.