Skip to content

[wip] #30 automation: orchestration state machine + run ledger for deterministic recovery - #52

Merged
nutt-adam merged 8 commits into
mainfrom
wren/issue-30-kickoff
Mar 16, 2026
Merged

[wip] #30 automation: orchestration state machine + run ledger for deterministic recovery#52
nutt-adam merged 8 commits into
mainfrom
wren/issue-30-kickoff

Conversation

@nutt-adam

@nutt-adam nutt-adam commented Mar 16, 2026

Copy link
Copy Markdown
Contributor

Kickoff implementation refresh for #30 with explicit state-machine and ledger slices.\n\nThis PR narrows the next code increments to transition validation + persistence scaffolding.\n\nFixes #30

Summary by CodeRabbit

  • Documentation
    • Revised planning doc to replace the old Goal/Plan layout with a problem-focused framing and clearer implementation slices.
    • Introduced explicit acceptance mapping and success criteria to ensure measurable outcomes.
    • Clarified next tasks and priorities, emphasizing persistence, recovery, and deterministic replay considerations.
    • Updated headings and scope to improve traceability of upcoming work.

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

Rewrote the plan for issue #30: replaced Goal/Plan with a Problem framing and Focused implementation slices (state model, persistent run ledger, recovery command path, reporting). Removed Blockers, added Acceptance mapping with explicit success criteria and updated next work items (enums, validators, persistence tests).

Changes

Cohort / File(s) Summary
Plan Documentation
plans/issue-kickoff/issue-30.md
Replaced Goal/Plan with Problem framing and Focused implementation slices: state model, persistent run ledger, recovery command path, reporting integration; removed Blockers, added Acceptance mapping with deterministic-replay and gap-handling criteria; updated forthcoming work items (state enum, transition validator, persistence tests).

Sequence Diagram(s)

sequenceDiagram
    participant Operator
    participant Orchestrator
    participant RunLedger
    participant RecoveryCmd
    participant Reporter

    Operator->>Orchestrator: start SDLC run (run_id)
    Orchestrator->>RunLedger: create run record (state: selected, meta)
    Orchestrator->>RunLedger: transition -> branched / implemented / ...
    RunLedger-->>Orchestrator: ack + canonical state
    Orchestrator->>Reporter: emit step outcome for PR summary

    alt interruption
        Operator->>RecoveryCmd: resume run (run_id)
        RecoveryCmd->>RunLedger: read last valid state
        RecoveryCmd->>Orchestrator: replay/resume from state
        Orchestrator->>RunLedger: append resumed transitions
        Orchestrator->>Reporter: update run report
    end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Poem

🐰 I hop from state to state, a ledger in my paw,
From selected to merged I trace the law,
If runs fall silent, I read the last line,
Replay the steps, make the whole thing align,
A carrot for progress, persistent and fine. 🥕

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is significantly incomplete. It lacks the required Versioning section (Cargo.toml update, CHANGELOG.md, SemVer choice, version number) and Validation/Release sections from the template. Add the missing sections from the description template: Versioning (with version bump justification or explicit reason for no bump), SemVer choice, and Validation/Release sections with appropriate checkboxes completed.
Linked Issues check ❓ Inconclusive The PR is a kickoff/planning document that refines issue #30 objectives and acceptance criteria but doesn't implement actual code changes. It's unclear whether the planning document alone constitutes fulfilling the linked issue requirements. Clarify whether this planning PR fully addresses issue #30's coding requirements or if this is preliminary work. If preliminary, scope future PRs explicitly to implementation tasks (state enum, transition validator, persistence tests).
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: implementing a state machine and run ledger for deterministic recovery, which aligns with the changeset's focus on problem framing and implementation slices.
Out of Scope Changes check ✅ Passed The changes are entirely focused on refining the problem statement and implementation plan for issue #30. The updated planning document aligns with the linked issue's objectives without introducing unrelated modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wren/issue-30-kickoff
📝 Coding Plan
  • Generate coding plan for human review comments

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@nutt-adam

Copy link
Copy Markdown
Contributor Author

Synced this branch with latest main to clear merge conflicts (merged main into , resolved kickoff-plan conflict, pushed ). CI should re-run automatically.

@nutt-adam

Copy link
Copy Markdown
Contributor Author

Follow-up: branch is now synced with latest main via merge commit 0c1a64b; merge conflict in plans/issue-kickoff/issue-30.md was resolved and pushed.

coderabbitai[bot]
coderabbitai Bot previously requested changes Mar 16, 2026

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🧹 Nitpick comments (1)
plans/issue-kickoff/issue-30.md (1)

16-18: Clarify "valid transition" and "invalid transition gaps" semantics.

The document refers to "last valid transition" and "invalid transition gaps" without defining these terms. For implementation clarity, consider adding a brief note on:

  • What criteria make a transition "valid" vs "invalid"
  • What constitutes an "invalid transition gap" (e.g., missing intermediate states, corrupted records, etc.)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plans/issue-kickoff/issue-30.md` around lines 16 - 18, Under the "Recovery
command path" subsection add explicit definitions: define a "valid transition"
as a state change recorded with intact metadata (timestamp, sequence ID,
checksum/signature) and consistent predecessor/successor links, and define an
"invalid transition gap" as any missing or non-sequential transition (e.g.,
missing sequence IDs, timestamp regression, checksum/signature mismatch, or
corrupted record) that prevents deterministic replay; list concrete criteria to
check (presence of sequence ID, monotonic timestamp, checksum verification,
successor link consistency) and give two short examples (missing intermediate
state vs corrupted record) so implementers of ResumeFromLastValidTransition can
deterministically detect gaps and decide whether to roll back to the last valid
transition or abort with a report.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@plans/issue-kickoff/issue-30.md`:
- Around line 22-25: The three acceptance criteria lines ("Single canonical run
state record per SDLC run", "Recovery resumes from validated last state", "PR
summary derives from ledger") currently have checkmarks (✅) that imply
completion; either remove the checkmarks from those lines or add a brief
clarifying sentence under the "## Acceptance mapping" heading stating that the
checkmarks denote planned goals (WIP) rather than completed items so readers
aren’t misled about status.

---

Nitpick comments:
In `@plans/issue-kickoff/issue-30.md`:
- Around line 16-18: Under the "Recovery command path" subsection add explicit
definitions: define a "valid transition" as a state change recorded with intact
metadata (timestamp, sequence ID, checksum/signature) and consistent
predecessor/successor links, and define an "invalid transition gap" as any
missing or non-sequential transition (e.g., missing sequence IDs, timestamp
regression, checksum/signature mismatch, or corrupted record) that prevents
deterministic replay; list concrete criteria to check (presence of sequence ID,
monotonic timestamp, checksum verification, successor link consistency) and give
two short examples (missing intermediate state vs corrupted record) so
implementers of ResumeFromLastValidTransition can deterministically detect gaps
and decide whether to roll back to the last valid transition or abort with a
report.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 48a31c28-76f5-4061-8dfa-928e70d792cd

📥 Commits

Reviewing files that changed from the base of the PR and between 64ebcc3 and 0c1a64b.

📒 Files selected for processing (1)
  • plans/issue-kickoff/issue-30.md

Comment thread plans/issue-kickoff/issue-30.md Outdated
@nutt-adam

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit feedback in 5eacd51:\n- Defined valid transition vs invalid transition gap with concrete validation criteria (sequence continuity, monotonic timestamps, checksum/signature, link consistency).\n- Added deterministic recovery behavior (rollback vs abort/report).\n- Clarified Acceptance mapping bullets are planned goals (removed misleading completion checkmarks).

@nutt-adam

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nutt-adam

Copy link
Copy Markdown
Contributor Author

Addressed CodeRabbit CHANGES_REQUESTED in commit 5eacd51:\n- Defined valid transition and invalid transition gap semantics with concrete validation criteria.\n- Clarified acceptance mapping items are planned goals (not completed).\n\n@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown

@nutt-adam: Thanks for the follow-up — the additions to transition validation semantics (sequence continuity, monotonic timestamps, checksum/signature, link consistency) and the clarification that acceptance mapping items are planned goals look like solid improvements. Triggering an incremental review of commit 5eacd51 now.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@nutt-adam

Copy link
Copy Markdown
Contributor Author

Synced with latest main (merge commit efcf807) to remove the BEHIND blocker and rerun checks. Current remaining blocker is stale CHANGES_REQUESTED from CodeRabbit despite addressed note; requesting fresh re-review.

@nutt-adam

Copy link
Copy Markdown
Contributor Author

@coderabbitai please re-review — prior nits were addressed and the kickoff doc has been simplified to the current scope.

@nutt-adam
nutt-adam dismissed coderabbitai[bot]’s stale review March 16, 2026 13:50

Dismissing stale bot review: findings addressed/superseded by updated kickoff scope.

@nutt-adam

Copy link
Copy Markdown
Contributor Author

Resolved actionable blocker for this cycle: dismissed stale CodeRabbit CHANGES_REQUESTED review (findings were already addressed/superseded), so the PR is now back to REVIEW_REQUIRED with green checks.

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown

@nutt-adam: Acknowledged — triggering a fresh re-review of the current state of the PR, including the simplified kickoff doc and the addressed transition validation semantics.

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
plans/issue-kickoff/issue-30.md (1)

21-21: Consider defining “recoverable gap” with one normative rule or examples.

Line 21 references recoverable gaps, but the boundary between recoverable vs. integrity-fatal cases is still a bit interpretive. A one-line rule (or 2–3 examples) would reduce implementation drift between validator and recovery command.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@plans/issue-kickoff/issue-30.md` at line 21, Define a clear normative rule
(one sentence) for the term "recoverable gap" near the "Recovery behavior"
sentence so validators and the recovery command have the same boundary: for
example, state "A recoverable gap is any missing or out-of-order transition that
can be resolved solely by applying adjacent committed transitions without
requiring manual intervention or external state reconciliation" and follow with
2–3 brief examples (e.g., missing sequence N that can be reconstructed from N-1
and N+1; transient timestamp skew resolvable by reordering) and a counterexample
(e.g., conflicting forks requiring operator resolution) so implementers of the
rollback (referencing the rollback to the last valid transition) and
integrity-abort behavior know when to auto-recover versus abort with an explicit
report.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@plans/issue-kickoff/issue-30.md`:
- Line 21: Define a clear normative rule (one sentence) for the term
"recoverable gap" near the "Recovery behavior" sentence so validators and the
recovery command have the same boundary: for example, state "A recoverable gap
is any missing or out-of-order transition that can be resolved solely by
applying adjacent committed transitions without requiring manual intervention or
external state reconciliation" and follow with 2–3 brief examples (e.g., missing
sequence N that can be reconstructed from N-1 and N+1; transient timestamp skew
resolvable by reordering) and a counterexample (e.g., conflicting forks
requiring operator resolution) so implementers of the rollback (referencing the
rollback to the last valid transition) and integrity-abort behavior know when to
auto-recover versus abort with an explicit report.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: aba24fc1-ab48-4583-956b-190d2a7cd7bf

📥 Commits

Reviewing files that changed from the base of the PR and between 0c1a64b and 90ff68c.

📒 Files selected for processing (1)
  • plans/issue-kickoff/issue-30.md

@nutt-adam
nutt-adam merged commit d14dfd2 into main Mar 16, 2026
10 checks passed
@nutt-adam
nutt-adam deleted the wren/issue-30-kickoff branch March 16, 2026 13:59
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