Repository navigation
fix(cli): compose PR summaries from the selected root (#4387) - #4408
Conversation
|
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 configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
|
Disposition: REVIEW_INCOMPLETE Reviewed published head: 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 One Windows counter-read remains under investigation before a ready disposition: 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
left a comment
There was a problem hiding this comment.
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.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Codex Review SummaryThis 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. |
| } | ||
| let options = parse_options(args)?; | ||
| let repo = repo_root()?; | ||
| let repo = repo_root(&options.root)?; |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| } | ||
| let options = parse_options(args)?; | ||
| let repo = repo_root()?; | ||
| let repo = repo_root(&options.root)?; |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| } | ||
| let options = parse_options(args)?; | ||
| let repo = repo_root()?; | ||
| let repo = repo_root(&options.root)?; |
There was a problem hiding this comment.
🟡 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.
Was this helpful? React with 👍 or 👎 to provide feedback.
| } | ||
| let options = parse_options(args)?; | ||
| let repo = repo_root()?; | ||
| let repo = repo_root(&options.root)?; |
There was a problem hiding this comment.
There was a problem hiding this comment.
💡 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)?; |
There was a problem hiding this comment.
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>] |
There was a problem hiding this comment.
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 👍 / 👎.
…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
Summary
ripr pr-summary --root <path>composes artifacts and writes all three summaries in the selected repository from a foreign working directory. A relative--baselineis 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
ripr-swarmSource-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, sharedexpect_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
Production delta:
pr-summaryresolves 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
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
No new dependency, process-spawn surface, source exception or policy waiver.
Proof
--rootwas rejected--root C:repowas accepted; no pre-fix public IOef4fdda2bef4fdda2bef4fdda2bCommands:
cargo test -p ripr --lib --test cli_smoke pr_summary -- --nocapturefor the broader unchanged-production controls;cargo test -p ripr --lib app::pr_summary::tests::parse_rejects_windows_partially_qualified_paths -- --exact --nocapturefor the current modified unit;cargo xtask check-local-contextandcargo xtask check-fastthrough 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 fromef4fdda2b4c4ce20edf3ea7c81973ff125ce60b8.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_ownedin the new unit comparison; the test-only correction is committed and the Windows repair reran 44 focused controls atef4fdda2b. 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 run36421615122at prior headdb47718a6failedcheck-local-contexton 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 isREVIEW_READYat exact760add after the full source review, terminal current hosted proof and zero unresolved threads were inspected.Claim Boundary
Selected-root artifact summary composition only.
--rootnames 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
app::pr_summary::tests;cli_smoke::pr_summary_root_from_foreign_cwd_anchors_artifacts_and_baseline, malformed-path and rendered-help controls.app::pr_summary::run_pr_summary,parse_options,repo_root.Static Language Check
CI Economics
n/a. No workflow, required check, budget or lane behavior changes.
Engineering Check
Gates
cargo fmt --checkcargo xtask check-fast(current selector, owning-tree rebuilt executable)cargo xtask precommit(not run locally; hosted precommit passed)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.