Repository navigation
fix(doctor): make packet refresh root-bound and runnable - #4991
Conversation
Narrow #4000 doctor refresh residual: bind and quote the selected root, reuse first-pr default-base resolution, and retain fail-closed recovery. Tree matches locally reviewed candidate 7ab28e07b5ec46bc6622c3adf3298bc38aff422a.
|
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 35 minutes. View limit detailsLimit details: You’ve used the included review currently available. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (6)
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 |
There was a problem hiding this comment.
Code Review
This pull request updates the ripr doctor command's packet-refresh behavior to bind the diagnosed repository to an absolute root path, ensuring the generated refresh command remains valid even when executed from a different working directory. It removes the --base <ref> placeholder from the default printed command, defaulting instead to the repository's default base and HEAD, and prints a PowerShell-compatible version of the command when necessary. Comprehensive integration tests and documentation updates are also included. There are no review comments, so I have no feedback to provide.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Substantive exact-head inspection: no blocking source or oracle findings. REVIEW_INCOMPLETE while hosted proof is pending.
Reviewed head: 276eaa5220a7f434b1aee5056f40f4db66f2cf5e; parent e729ca15124e78c43e9d2c6719d641ae72b7f9b0; tree 66234d6d7cd9e3f33e846d128f05d0f6b85ba917. GitHub and local Git independently confirm zero tree difference from the pre-publication reviewed candidate.
Inspected all six changed files and semantic consumers: current/stale/missing doctor branches, shared bound-root and shell/PowerShell functions, first-pr parsing/default-base authority and write ordering, generated-command replay helpers, user docs, spec and traceability. The ordinary recommendation/error paths remain unchanged. No parallel resolver, stale-packet authority, workflow, dependency or access change was added.
Observed proof: intended old-production Bash quote failure (1 test actually executed); repaired integration pass with four current/stale × relative/dot replays, a no-origin local-master selection, and missing-base refusal preserving JSON/Markdown bytes. Deleting Markdown before replay makes a no-op or wrong-root implementation fail. Twelve existing doctor smoke tests also passed. Check-fast ran 13 gates against the independently verified six changed paths; full precommit completed exit 0.
Additional published-head artifact proof: clean source-install of this exact SHA reports ripr 0.11.0 (276eaa5220a7f434b1aee5056f40f4db66f2cf5e), binary SHA-256 348259101dee1eed070b7df80b69cfa739b547f049beb0d9077c5fd132e1b886. Four literal Bash refresh replays from a foreign CWD passed for current/stale packets and relative/dot inputs, recreated the selected packet, retained selected root/default base/HEAD/current version, printed the documented scope, and created no foreign target tree.
Missing proof: hosted required/combined-tree matrix is running. CodeRabbit's green status is rate-limited and supplies no semantic review. Native PowerShell is not executed here; only shared translation wiring is asserted. No complete #4000, source integration, release qualification or publication claim. Keep draft until final current-head checks/review reconciliation.
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Stale-only PowerShell assertion leaves the current-packet PowerShell branch unverified in this PR; the shared powershell_form already covers it, but a parallel assert would harden the diff.
- Test gates on Bash exit success; does not assert the PowerShell form was exercised on Windows. PR body explicitly disclaims native PowerShell execution, but PowerShell line is only grep-asserted in stdout, never invoked.
Verification questions
- Confirm smoke test asserts the stale-print contains '--base ' is absent but does not pin ordering of --root vs --head; future reformat could still satisfy substring match while drifting from documented form.
- Confirm powerShell path uses powershell_form(&refresh) on a string already containing backticks/code-fences from elsewhere; the produced form is asserted in the integration test for the stale case only, not for the current packet case.
Refuted
- Smoke assertion is too loose to catch a regression that re-adds --base somewhere else in the line.; refuted because: The existing assertion already requires !stdout.contains("--base ") which would catch any reintroduction in this guidance line, and the printed refresh string is composed once in a let binding and reused, so partial regressions collapse to the same line.
- Doctor refresh handler duplicates shell-quoting/powershell-translation helpers and should be factored out.; refuted because: Diff reuses bound_root_path, root_path_display, shell_arg, and powershell_form via use-import. No new helper introduced; one call site does not justify a new abstraction now.
- PowerShell Form label spells the apostrophe path incorrectly (double-single-quote convention not used); refuted because: PowerShell spelling uses canonical
'{}''doubling identical to shell_arg; test asserts exact format and the PowerShell branch is only emitted when spelling differs from Bash.
Parked follow-ups
- Doctor refresh root-binding lives in the guidance function but the use-imports sit below an is_file check; PowerShell translation gating is duplicated against existing status-code patterns elsewhere in the codebase, suggesting an extracted translate-or-skip helper could eventually replace the inline if-let. Noted for parked follow-up; current duplication is one call site and scope-controlled.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Final exact-head disposition: REVIEW_READY
Head 276eaa5220a7f434b1aee5056f40f4db66f2cf5e, tree 66234d6d7cd9e3f33e846d128f05d0f6b85ba917; production/test/spec review remains unchanged from the substantive independent inspection. Hosted integration subject 2700a1a8c73dcbb4774b2a678b3eb455a3bef8b4 has exact parents 9cfc3de5891ba0c8a3121c99cd917f41fb307800 + this head, tree 9c12ef13da31420d833d0636c4d359e9ef19ad0e.
Observed terminal proof: required Rust result and Rust gates SUCCESS. Downloaded nextest artifact11211596629 (SHA-256 10096257ee1994abc6cff9fde860a467d3414dea6702bb443214426ff0a898ed) independently contains 10,629 executed testcases, 0 failures/errors/skips, including the new doctor packet-refresh replay and stale-packet smoke test. Its run-context binds the exact integration checkout above and nextest_exit=0. Doctests, goldens, fixture contracts, strict Clippy, policy and PR evidence steps passed. Rust-only, Windows advisory subset, Python wheel/clean pip/uv journeys, source-of-truth, dependency checks and ub-review are also success. Local installed-head replay and red/green evidence remain as recorded in the prior review.
ub-review reconciliation
- Refuted: “stale-only PowerShell assertion.” The exact test loop iterates
stale in [false, true]and both relative/dot roots; the PowerShell equality assertion is inside both loops. It therefore runs for all four cases, not only stale packets. - Refuted: translator might receive Markdown backticks/fences. Production lines205–224 construct one raw command string. Backticks exist only in the surrounding println templates;
powershell_form(&refresh)receives no presentation wrapper. - Refuted as a blocker: loose smoke ordering. The behavioral test executes the emitted Bash command and checks the newly produced root/base/head/version and no foreign writes; the exact PowerShell command string is also checked. A substring-only smoke assertion is not the production oracle.
- Retained non-claim: native PowerShell execution. This patch reuses the established translator and first-pr/root contract. Its new wiring is tested, but this Linux witness does not claim native PowerShell qualification. The limitation is explicit, not silently counted as a pass.
- Helper extraction remains optional; there is one shared command and one translation call, with no parallel quoting authority.
No blocking source/oracle finding remains and review threads are empty. CodeRabbit was rate-limited and Droid remains queued; neither is counted as completed semantic review. Repository-controlled CI contract names Ripr Rust Small Result as the required gate; the active ruleset requires PR/thread resolution with zero approving reviews. Classic protection read is unavailable to this connector, so final merge must use the normal protected API with this exact expected head, never bypass. No full #4000 completion, generated-file inclusion repair, source integration, package qualification or release claim.
There was a problem hiding this comment.
Reporter summary
All four contentful lanes (tests-red-green, source-route, architecture, opposition) failed at the model invocation layer with HTTP 529 overload, and cargo-test timed out after 900s with no receipt — so this review is operating on PR-body claims and the seeded thread only, not fresh independent evidence. The seeded thread already shows a prior substantive review by EffortlessSteven marking REVIEW_READY against the exact published head with hosted proof (10,629 tests, 0 failures) and an automated check noting only soft gaps (PowerShell current-branch not parallel-asserted, smoke substring-not-ordering). The diff itself is narrow: doctor refresh is root-bound via shared bound_root_path/shell_arg/powershell_form helpers, removes the --base placeholder, and adds a strong integration test that exercises foreign-cwd Bash replay including Unicode/apostrophe/dollar paths. Without working lanes I cannot independently confirm the refactor is regression-free, but nothing in the seeded evidence or the diff raises a blocking concern; recommend treating this as ready with the standing soft follow-ups already on record.
Summary
Fix the ordinary doctor packet-refresh command in #4000. The selected repository now survives a copy/paste from another directory, including spaces, Unicode, apostrophes and dollar signs. Both current and stale packets share one root-bound, shell-quoted command and the existing PowerShell translation.
Swarm / Source Boundary
Broader #4000 acceptance remains open. Source acceptance and integration remain owned by ripr #1760 and ripr #1768–#1773.
Source-of-truth Links
Candidate Relationships
Head:
276eaa5220a7f434b1aee5056f40f4db66f2cf5eBase:
e729ca15124e78c43e9d2c6719d641ae72b7f9b0Tree:
66234d6d7cd9e3f33e846d128f05d0f6b85ba917No stack, replacement or competing implementation. Ordinary Git push had no cloud HTTPS credentials, so the connected GitHub Git-data API published the exact verified tree. Local reviewed commit
7ab28e07b5ec46bc6622c3adf3298bc38aff422ahas identical tree and base but different commit metadata; published-head review must bind the SHA above.Scope
<ref>placeholder; first-pr's existing default-base resolver owns selectionProof actually observed
Linux/Bash, repository-pinned Rust 1.95.0, serial Cargo builds with jobs=2.
The first attempted RED run lost its cloud executor during compilation and is NOT counted as a test result. The resumed deterministic RED above completed normally.
RIPR self-dogfood feedback
The exact published diff was analyzed with the installed published-head binary using
check --mode instant --no-unchanged-tests --json: exit 0 in 24s, 19 findings, 0 exposed. analysis_complete=false / partial_with_limitations: the existinggenerated_*convention skips the hand-writtengenerated_review_workflow.rs, including this PR's executable regression. The output explicitly discloses that exclusion and uses weak same-file test relations for the private doctor helper. This limited run does not establish regression-test quality or closure; the observed old/new executable shell controls remain the independent oracle. The file convention is not changed by this doctor repair.Claim boundaries
The generic refresh uses the selected repository's default base and HEAD, not a prior packet's custom comparison. A missing-artifact packet can be refreshed truthfully without becoming complete analysis evidence. PowerShell translation wiring is asserted, but native PowerShell execution is not established. No full #4000 completion, full release qualification or source-product-fixed claim.
Rollback
Revert this narrow commit. No persisted schema, workflow, dependency or permission migration.