Skip to content

fix(cli): compose PR summaries from the selected root (#4387) - #4408

Merged
EffortlessSteven merged 5 commits into
mainfrom
codex/4387-pr-summary-root
Sep 28, 2026
Merged

EffortlessSteven merged 5 commits into
mainfrom
codex/4387-pr-summary-root

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Summary

ripr pr-summary --root <path> composes artifacts and writes all three summaries in the selected repository from a foreign working directory. A relative --baseline is anchored there. Missing, blank, flag-like and partially qualified Windows path values fail before writing outputs. Ordinary relative paths and fully qualified drive/UNC/verbatim paths remain accepted; the Windows restriction does not affect colon-containing filenames on other systems.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Governing issue: #4387 and its accepted scope interpretation.
Acceptance delta: selected-root summary inputs, baseline and outputs compose from a foreign CWD; help and docs describe the contract.
Proposal/spec/ADR/plan: existing issue contract; no new architecture or summary schema.

Candidate Relationships

Candidate branch: codex/4387-pr-summary-root.
Integration basis: a608fafa0093d988d785856bdd074883c933c38e.
No stack, replacement or duplicate candidate. All-state #4387 search returned unrelated merged #3487, inspected as lexical alias work under #3413.

Scope

  • app/pr_summary/mod.rs: root selection, shared expect_value, path validation and root help.
  • cli/mod.rs: shared value parser facade.
  • tests/cli_smoke.rs: selected-root inputs/writes and baseline discriminator, malformed flags, rendered help and RAII cleanup.
  • docs/CI.md: common repository-identity meaning and existing fixed versus explicit artifact-path conventions.

Scope Classification

  • One production behavior

Production delta: pr-summary resolves the selected root once; all existing composition paths consume it.
Evidence delta: unit controls and real CLI foreign-CWD controls, including spaces and Unicode.
Single acceptance criterion: summary composition reads/writes the selected repository from another directory.
Non-goals: summary content/schema changes, analysis, xtask summary behavior, sibling parser migration, packaging or publication.

Support-tier Impact

  • none

The command still composes retained artifacts; no new analysis or release qualification is established. Sibling composition commands retain CWD-relative explicit artifact/output paths, documented accurately.

Policy Impact

  • none

No new dependency, process-spawn surface, source exception or policy waiver.

Proof

Check Result
Pre-fix foreign-CWD summary control 1 executed; failed because --root was rejected
Published-head Windows path control before repair 1 executed; native join premise passed, then failed because --root C:repo was accepted; no pre-fix public IO
Summary library controls at ef4fdda2b 36 passed on Windows; native join premise, partial-path rejection and full drive/UNC/verbatim parser positives included
Public summary controls at ef4fdda2b 8 passed on Windows; safe early Windows path validation, selected artifacts/baseline, absolute and relative root, malformed flags/no writes, rendered help and retained CWD/no-Cargo behavior
Candidate-local check-fast at current head pass: stable 4-file selector; 10 gates ran, including fmt, Clippy, no-panic and file policy; fixture contracts skipped by selector
Candidate-local check-local-context pass at current head using the owning-tree rebuilt tool
Existing help/parser parity gate at ef4fdda2b 1 executed, passed
Modified Windows premise/rejection unit at current head 1 executed, passed on Windows; full-path positives explicitly verified absolute

Commands: cargo test -p ripr --lib --test cli_smoke pr_summary -- --nocapture for the broader unchanged-production controls; cargo test -p ripr --lib app::pr_summary::tests::parse_rejects_windows_partially_qualified_paths -- --exact --nocapture for the current modified unit; cargo xtask check-local-context and cargo xtask check-fast through the owning-tree rebuilt tool (serialized shared target for local reuse).
Exact candidate: 760add61856c0bd275c1e0971cb9dd03b4be4295. The last two commits change only the Windows unit table/portable fixture construction; production and public controls are unchanged from ef4fdda2b4c4ce20edf3ea7c81973ff125ce60b8.
Baseline package compile and six-gate policy floor reused for the same exact source object a608fafa; this is source-object evidence, not candidate-local gate execution.
The first candidate-local check-fast failed on Clippy cmp_owned in the new unit comparison; the test-only correction is committed and the Windows repair reran 44 focused controls at ef4fdda2b. Clippy then flagged the intentional literal root-relative join in the native test; the final table-only correction retains both native premise cases and adds no lint exception. The modified unit and gates are refreshed at the final candidate head. Hosted run 36421615122 at prior head db47718a6 failed check-local-context on three generic absolute fixture literals; required tests, doctests, golden and fixture checks were skipped afterward. The portable fixture correction follows existing repo conventions by constructing the same generic paths at runtime and explicitly requiring full-path positives to be absolute; it changes no checker or policy exception. All three lane-owned fixture roots now use exclusive directory creation before installing their cleanup guards. Full local precommit and full workspace tests are not run; hosted checks own the required remote matrix. Prior-head hosted passes do not establish repaired-head proof. Current Linux hosted proof includes the non-Windows colon-path control. Installed/package/release qualification remains unclaimed. UNC/verbatim evidence is parser acceptance, not a network-share execution claim. Candidate review is REVIEW_READY at exact760add after the full source review, terminal current hosted proof and zero unresolved threads were inspected.

Claim Boundary

Selected-root artifact summary composition only. --root names repository identity on all four documented composition commands; this PR preserves explicit artifact/output path semantics on the three siblings.

Rollback

Revert these scoped commits. No stored schema, generated golden or migration changes.

Spec-Test-Code Traceability

Static Language Check

  • Static output keeps conservative evidence language.
  • Unknown artifact states are preserved.

CI Economics

n/a. No workflow, required check, budget or lane behavior changes.

Engineering Check

  • No new panic-family shortcuts in production or tests.
  • No new non-Rust implementation files, dependencies, process/network or retained exceptions.
  • Malformed path errors identify the flag.
  • No public JSON/schema change.

Gates

  • cargo fmt --check
  • candidate-local cargo xtask check-fast (current selector, owning-tree rebuilt executable)
  • candidate-local cargo xtask precommit (not run locally; hosted precommit passed)
  • focused committed summary tests
  • local full workspace, installed package and release qualification (not claimed)

Extension changes: none.

Current hosted proof: run36432068646/job108960594006 and required Rust Result SUCCESS at760add. Actual tested merge c3ea411 into e3f13af has treebb29134aaac37fcd18f893588e92e2aa7a504b21. Hosted precommit, workspace/all-target check, strict Clippy, policy/honesty, 8806/8806 nextest tests (zero skipped), doctests2passed1ignored, goldens/fixtures and PR evidence passed. Package/install, release admission and network-share runtime are not established.

@coderabbitai

coderabbitai Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ce0ff4c3-ce48-423e-89cd-4643512229f6

📥 Commits

Reviewing files that changed from the base of the PR and between 6de3ae5 and 760add6.

📒 Files selected for processing (4)
  • crates/ripr/src/app/pr_summary/mod.rs
  • crates/ripr/src/cli/mod.rs
  • crates/ripr/tests/cli_smoke.rs
  • docs/CI.md
 ___________________________________________________________________________
< This code is one line away from greatness-and 40 lines away from clarity. >
 ---------------------------------------------------------------------------
  \
   \   (\__/)
       (•ㅅ•)
       /   づ
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

gemini-code-assist[bot]

This comment was marked as resolved.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Disposition: REVIEW_INCOMPLETE

Reviewed published head: 18ed5b462e4f468231cd5b7f1fe69fd2ce9fcbc2; integration basis a608fafa; current main inspected 6de3ae58.

Substantive inspection covers the full production/CLI/tests/docs diff, the accepted #4387 interpretation and default/sibling consumers. The allocation-free test correction was inspected separately. The selected-root public control discriminates conflicting inputs and baselines in two directories, checks selected-only outputs, then exercises relative-root --check. Invalid-value controls check no writes. Existing default behavior and rendered help/parser parity are retained. Observed current-head proof: 35 library, seven CLI and one help/parity tests passed; own-root check-fast ran ten gates and passed, with fixture-contracts skipped by selector. Full local precommit is not claimed; hosted Rust proof is still in flight.

One Windows counter-read remains under investigation before a ready disposition: repo_root uses is_absolute() followed by cwd.join(root). Rust's documented Windows prefix-without-root behavior replaces the existing path, so a drive-relative selection such as C:repo can remain relative rather than resolving once. A drive-relative --baseline can similarly replace the selected root in load_json. This needs either verified handling or explicit refusal with focused Windows controls; ordinary relative and absolute selections must retain their existing behavior. The writer is investigating within this claim.

Remaining review evidence: reconcile that path counter-read, inspect the resulting exact head if changed, then current required hosted results and threads. This inspection does not establish package qualification, support promotion or release selection. No merge arm.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

REVIEW_READY at exact published head 760add6. Full four-file semantic review, root/parser/helper/IO consumers, discriminating foreign-CWD and Windows controls, and the fixture-only successor inspected; no blocking findings. Exclusive scratch ownership precedes deleting guards. Existing artifact/schema semantics and sibling path contracts remain intact.

Current hosted run36432068646 and required Rust Result succeeded: precommit, workspace/all-target check, strict Clippy, policy/honesty, 8806/8806 nextest tests (zero skipped), doctests2passed1ignored, goldens/fixtures/PR evidence. Actual tested merge c3ea411 includes current main e3f13af; its treebb29134aaac37fcd18f893588e92e2aa7a504b21 matches the current nonmutating combined-tree check. Prior db477 policy failure and skipped tests remain predecessor evidence. Current760 Windows unit/localcontext/ten gates PASS inspected in retained writer logs; no reviewer native rerun.

Exact published head and zero unresolved threads rechecked. No installed-package, network-share execution, governed-case or release qualification claim. Ordinary protected convergence may proceed.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review September 28, 2026 14:28
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven
EffortlessSteven merged commit eede4a0 into main Sep 28, 2026
26 of 27 checks passed
@EffortlessSteven
EffortlessSteven deleted the codex/4387-pr-summary-root branch September 28, 2026 14:28
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-28T14:31:26.915079Z 760add6 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Devin Review found 4 potential issues.

Devin Review

}
let options = parse_options(args)?;
let repo = repo_root()?;
let repo = repo_root(&options.root)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Reproduction commands target the wrong repository

When --root selects another repository, build_pr_evidence_summary still generates reproduction commands targeting the invocation directory. Running those commands from there analyzes the wrong repository.

Learn more

The summary JSON and Markdown include local_reproduction_commands intended to replay analysis. derive_local_reproduction_commands emits ripr check without --root and ripr first-pr --root .; both therefore select the process working directory rather than the new selected root. Commands copied from start-here can have the same issue if their relative paths assume execution from the selected root.

Example: Run ripr pr-summary --root /work/project from /tmp/other. The report under /work/project offers ripr check and ripr first-pr --root . --head HEAD; executed from /tmp/other, they inspect /tmp/other.

Recommended fix: Pass the bound selected root into reproduction-command generation and render it as a safely quoted argument for generated ripr commands. For carried commands, either document the required working directory beside the commands or ensure their root-relative arguments remain valid from the invocation directory. Add a foreign-CWD test asserting the generated commands select the intended repository.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

}
let options = parse_options(args)?;
let repo = repo_root()?;
let repo = repo_root(&options.root)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Missing roots produce misleading successful summaries

For a nonexistent --root, repo_root accepts the path and input reads report missing artifacts. Output creation then makes the directory, and the command succeeds with a summary for a repository that never existed.

Learn more

The new root option can point at a nonexistent directory. load_json treats failed reads as missing inputs, and write_parented_file creates parent directories before writing. Thus the CLI silently creates a typo path rather than reporting that the selected repository is absent.

Example: From /work, run ripr pr-summary --root ./projcet when only /work/project exists. The command creates /work/projcet/target/ripr/..., exits successfully, and reports missing artifacts rather than reading /work/project.

Recommended fix: Validate that the resolved selected root is an existing directory before rendering or writing. Keep the existing behavior that permits an existing repository with no RIPR artifacts; add a test distinguishing it from a nonexistent root.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

}
let options = parse_options(args)?;
let repo = repo_root()?;
let repo = repo_root(&options.root)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Stale check directs regeneration elsewhere

With --root set from a foreign directory, a stale --check tells users to rerun ripr pr-summary without --root. That regenerates the foreign directory's summary, leaving the selected summary stale.

Learn more

The new selected-root path flows into checking the summary, but check_summary still hardcodes an unrooted regeneration command. In the foreign-CWD use case, an unrooted rerun updates the invocation directory instead of the selected repository.

Example: From /tmp/foreign, run ripr pr-summary --root /work/project --check against an outdated /work/project/target/ripr/pr/summary.md. The error says run ripr pr-summary; running it writes to /tmp/foreign and does not make the check pass.

Recommended fix: Carry the requested root into the stale-check error and include a safely quoted --root option in its regeneration instruction. Test the error message from a foreign CWD with a stale selected summary.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

}
let options = parse_options(args)?;
let repo = repo_root()?;
let repo = repo_root(&options.root)?;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔍 Selected-root contract lacks spec traceability

The new public root behavior has CLI tests and CI documentation, but no updated spec or spec-test-code mapping. Check whether the existing PR evidence summary spec needs this contract.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 760add6185

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
let options = parse_options(args)?;
let repo = repo_root()?;
let repo = repo_root(&options.root)?;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve the selected root in stale-summary remediation

Failure mode: when ripr pr-summary --root /repo --check runs from a foreign directory and the selected summary is stale, this resolves /repo correctly but check_summary still tells the caller to run unqualified ripr pr-summary; following that instruction writes all three outputs under the foreign working directory instead of repairing /repo (and also drops any supplied baseline). Why here: selected-root operation must keep its human recovery guidance actionable and bound to the same repository. Fix direction: make the stale error preserve the root and baseline, or instruct callers to repeat the current invocation without --check. Validation: add a foreign-CWD stale-summary CLI test that verifies the suggested recovery updates only the selected root. Confidence: High.

AGENTS.md reference: AGENTS.md:L228-L230

Useful? React with 👍 / 👎.

/// suggestions; keep accepted flags on option-list lines.
pub(crate) const PR_SUMMARY_HELP: &str = "\
usage: ripr pr-summary [--check] [--baseline <before.json>]
usage: ripr pr-summary [--root <path>] [--check] [--baseline <before.json>]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add the root option to the top-level help synopsis

Failure mode: although this subcommand help now advertises --root, crates/ripr/src/cli/help/overview.rs still renders ripr pr-summary [--check] [--baseline <before.json>], so users consulting ripr --help cannot discover the new selected-root behavior and the two public help surfaces disagree. Fix direction: update the overview synopsis and extend the rendered-help test to inspect the top-level help as well as pr-summary --help. Validation: run the focused CLI help tests. Confidence: High.

AGENTS.md reference: AGENTS.md:L415-L420

Useful? React with 👍 / 👎.

EffortlessSteven added a commit that referenced this pull request Sep 28, 2026
…stale (#4437)

Records the J cutoff in the §0.6 ledger:
- FINAL_SWARM_CUT is 112a834;
- the J tree is 0be794e5, repinned from e9c1d0b8;
- 33 PRs landed between 2d3dfb9 and the cutoff.

Fixes the #4408, #4415 and #4419 non-claims that the cutoff made stale. Records #4263 as landed after the cutoff. Adds row 32 for TypeScript repair packets, owned by #4410.

Merged under Steven's standing swarm merge policy. The exact head 4258646 is green, has an exact-head COMMENT review with no blockers, has no open threads, and has no conflict. The CodeRabbit and Gemini reviews are missing (rate-limited and out of quota). Policy: cmsg_01PNTtQgh6otzUAgrEbiwJapLDNSeHy8MdztUC5UgRC71w, cmsg_01PNTtQgh6otzUAgrEbiwJapJ9t7fvZRC8p2kQ3xWU9c3m, cmsg_01PNTtQgh6otzUAgrEbiwJapXkeTSSUZZxybErtNj3dtgQ.

Refs #3921, #4410.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AYyUnjaq9zD4WsBujWEUpk
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.

1 participant