Skip to content

automation: issue #30 resume visibility + ledger PR-summary formatter - #55

Merged
wren-nutthouse merged 3 commits into
mainfrom
wren/issue-30-resume-ledger-summary
Mar 16, 2026
Merged

automation: issue #30 resume visibility + ledger PR-summary formatter#55
wren-nutthouse merged 3 commits into
mainfrom
wren/issue-30-resume-ledger-summary

Conversation

@nutt-adam

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

Copy link
Copy Markdown
Contributor

Summary

  • print SDLC ledger summary when running tt run --resume <run_id> if a ledger exists
  • add sdlc_pr_comment_summary helper to render ledger transitions as reusable PR-comment text
  • add regression test for summary rendering output
  • add rustdoc for SDLC ledger summary structs/helpers to improve doc coverage

Validation

  • cargo fmt
  • cargo test -q sdlc_pr_comment_summary_renders_transitions
  • cargo test -q serialize_dry_run_contains_prompt_and_command_steps

Versioning

  • Patch (backward-compatible bug fix / docs)
  • Minor (new backward-compatible feature)
  • Major (breaking change)
  • SemVer choice: Patch
  • Version target: next patch release
  • CI validation required before merge
  • Tagging handled by release workflow (no manual tag in this PR)

Refs #30

Summary by CodeRabbit

  • New Features
    • After running, the tool prints an SDLC run summary (run ID, state, timestamps, actor and transition history) when tracking data exists.
  • Bug Fixes
    • Failures to load or format the SDLC summary now emit clear warnings instead of silent errors.
  • Tests
    • Added unit test coverage ensuring transition history and summary rendering are correct.

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4880fe4e-c872-455e-9225-3156ae689210

📥 Commits

Reviewing files that changed from the base of the PR and between acf7735 and b90afb2.

📒 Files selected for processing (1)
  • src/state/mod.rs

📝 Walkthrough

Walkthrough

Loads the SDLC run ledger after computing the resume plan in the CLI run command and prints a formatted PR-comment summary to stderr; the state module adds SDLC ledger types, a fallible sdlc_pr_comment_summary (returns Result<String>), and a unit test for transition rendering.

Changes

Cohort / File(s) Summary
CLI Integration
src/cli/run.rs
Import load_sdlc_run_ledger and sdlc_pr_comment_summary; after computing/printing the resume plan, attempt to load the SDLC ledger for ctx.run_id and, if present, render and print the PR-comment summary to stderr. Emit warnings on load or format errors.
State Module & Tests
src/state/mod.rs
Add public SDLC ledger types (SdlcTransitionRecord, SdlcRunLedgerRecord), implement pub fn sdlc_pr_comment_summary(ledger: &SdlcRunLedgerRecord) -> Result<String>, and add unit test sdlc_pr_comment_summary_renders_transitions validating rendered transitions and metadata.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Poem

🐰 I hopped through logs and ledger light,
I stitched the run's tale into night.
Transitions hum, each reason shown,
A tiny summary, neatly sown.
📜✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: adding resume visibility (SDLC ledger summary when running resume) and a PR-comment summary formatter for ledger transitions.
Description check ✅ Passed The PR description covers the main objectives, validation steps, and versioning decision. However, it does not follow the repository's required template structure with explicit sections for manifest checks or complete SemVer documentation.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch wren/issue-30-resume-ledger-summary
📝 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.

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: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@src/cli/run.rs`:
- Around line 93-95: The current use of the `?` operator on
`load_sdlc_run_ledger(project_root, &ctx.run_id)?` causes `tt run --resume` to
abort on ledger-read errors; change this to a best-effort attempt that logs a
warning and continues on failure. Replace the `if let Some(ledger) =
load_sdlc_run_ledger(...)? { ... }` with code that calls
`load_sdlc_run_ledger(...)` and matches on the Result: on Ok(Some(ledger)) call
`eprintln!("{}", sdlc_pr_comment_summary(&ledger))`, on Ok(None) do nothing, and
on Err(err) print a warning (e.g., to stderr) that includes `err` and continue
without returning an error. Ensure you reference `load_sdlc_run_ledger` and
`sdlc_pr_comment_summary` so the change is applied around those symbols.

In `@src/state/mod.rs`:
- Around line 207-238: Change the public helper sdlc_pr_comment_summary to
return Result<String, TuttiError> instead of String: update its signature to pub
fn sdlc_pr_comment_summary(ledger: &SdlcRunLedgerRecord) -> Result<String,
TuttiError>, build the output as before but replace any direct returns of out
with Ok(out) (including the early "No transitions recorded yet." branch), and
return Ok(out.trim_end().to_string()) at the end; also update any callers to
handle the Result (propagate with ? or map_err to TuttiError as appropriate).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: a7f35598-5134-4b6a-a74b-9bd262750a3b

📥 Commits

Reviewing files that changed from the base of the PR and between d4aaf3d and 0a66986.

📒 Files selected for processing (2)
  • src/cli/run.rs
  • src/state/mod.rs

Comment thread src/cli/run.rs Outdated
Comment thread src/state/mod.rs Outdated
@nutt-adam

Copy link
Copy Markdown
Contributor Author

Addressed the two CodeRabbit blockers in commit acf7735.

  • tt run --resume now treats ledger load failures as best-effort (warns and continues instead of aborting).
  • sdlc_pr_comment_summary now returns Result<String, TuttiError>; caller handles format errors with warning output.
  • Updated summary test accordingly.

Validation: cargo test -q passed (247 unit tests + 1 integration test).

@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
nutt-adam dismissed coderabbitai[bot]’s stale review March 16, 2026 19:40

Dismissing stale bot CHANGES_REQUESTED after commit acf7735 and successful CodeRabbit/check suite.

@nutt-adam

Copy link
Copy Markdown
Contributor Author

Automation update: dismissed stale CodeRabbit CHANGES_REQUESTED review after commit acf7735 and green checks. Current merge blocker is branch protection requiring 1 approving review (required_approving_review_count=1).

@nutt-adam

Copy link
Copy Markdown
Contributor Author

Follow-up fix pushed in b90afb2:\n- added rustdoc for SDLC ledger summary public APIs to improve docstring coverage\n- updated PR description with explicit Versioning section and SemVer choice\n\n@coderabbitai review

@coderabbitai

coderabbitai Bot commented Mar 16, 2026

Copy link
Copy Markdown

@nutt-adam Sure! I'll kick off a review of the latest changes in commit b90afb2, including the rustdoc additions for the SDLC ledger summary public APIs and the versioning section update.

✅ 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

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

@wren-nutthouse
wren-nutthouse self-requested a review March 16, 2026 22:34

@wren-nutthouse wren-nutthouse left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed automation updates: ledger summary handling, error-tolerant resume path, and docs/versioning notes look good. Approving to unblock merge.

@wren-nutthouse

Copy link
Copy Markdown
Collaborator

Automation check (v0.3 readiness run): all checks green, reviewDecision=APPROVED, and no actionable CodeRabbit findings remain. Merge is still blocked by base-branch policy ( reports: "the base branch policy prohibits the merge`).

@wren-nutthouse
wren-nutthouse merged commit 7c76b20 into main Mar 16, 2026
10 checks passed
@wren-nutthouse
wren-nutthouse deleted the wren/issue-30-resume-ledger-summary branch March 16, 2026 22:42
nutt-adam added a commit that referenced this pull request Mar 19, 2026
…anges

Cover startup grace window (#67), persistent memory (#62/#63), merge gate
enforcement (#59), permissions suggest (#53), orchestration state machine
(#54/#55), and all fixes shipped since 0.2.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
nutt-adam added a commit that referenced this pull request Mar 19, 2026
…choir runs (#71)

* feat(health): add startup grace window to wait_for_agent_idle (#67)

Prevent fresh prompt steps from falsely completing before the agent
has consumed the prompt. The startup grace period (default 30s) gates
completion detection until real working activity is observed.

Key changes:
- wait_for_agent_idle accepts a startup_grace Duration parameter
- AgentStatus::Working counts as activity even without pane hash change,
  requiring 2+ consecutive polls to avoid flicker false positives
- First pane capture no longer counts as a hash "change"
- Completion signals before any activity are held until grace expires
- "Unravelling" added to claude-code working patterns
- startup_grace_secs field threaded through config and automation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* docs: add 0.3.0 changelog entry for issue #67 and prior unreleased changes

Cover startup grace window (#67), persistent memory (#62/#63), merge gate
enforcement (#59), permissions suggest (#53), orchestration state machine
(#54/#55), and all fixes shipped since 0.2.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: reduce startup grace to 10s and validate wait settings

- Reduce DEFAULT_STARTUP_GRACE_SECS from 30 to 10 so the
  completion-before-activity path fires before typical wait timeouts
- Validate that wait_timeout_secs/startup_grace_secs are only set when
  wait_for_idle is true, failing fast with actionable guidance

Addresses CodeRabbit feedback on PR #71.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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