Repository navigation
fix(mcp): ripr_refresh base argument, Git precondition in status, accurate attempt_not_found - #9075
Conversation
…urate attempt_not_found (#9018) ripr_refresh gains an optional `base` revision so a repository whose default branch is not main/master has a recovery route reachable from MCP; failure recovery names it. Status reports root.git_work_tree and the requested base, attempt_not_found no longer implies a durable store held session transactions, and the target/ripr cache location is documented. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZHDKLVQqArSZrUFKSkREo
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 50 minutes. View limit details
Comment |
|
Independent fresh-agent source review of head Optional items I'm leaving for a follow-up:
The branch currently conflicts with main. I'm resolving that with a merge commit before applying Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZHDKLVQqArSZrUFKSkREo
There was a problem hiding this comment.
Confirmed findings
- A failed explicit-base refresh overwrites current_desired_input while the retained snapshot remains the previous default-base analysis.
- analyzed_label interpolates the user-supplied base into a human-facing string without sanitization. The 256-byte cap and the JSON encoding make this safe on the wire, but a base containing backticks or unusual characters produces an awkward
committed diff against base \weird`` label. Not a security or schema issue; cosmetic only. - crates/ripr/src/mcp/protocol.rs:66 — Update STATUS_TOOL_DESCRIPTION to state that current desired input uses the resolved default branch or the explicit refresh base, including base_revision when present. The current description contradicts the new explicit-base status document.
- The workspace-status tool description remains stale for explicit-base sessions: it says current desired input is a diff against the default branch, while runtime can report base=explicit and base_revision=.
Verification questions
- Confirm explicit unresolvable bases are tested for a failed attempt and retained last-known-good snapshot, but not for the specific recovery text expected by the implementation.
- Confirm no wire test exercises the 256-byte upper bound on
base; only minLength=1, wrong type, and unknown-property negative paths are covered. - Confirm the explicit-base wire test verifies status runtime fields but not that STATUS_TOOL_DESCRIPTION remains consistent with those fields.
- Confirm the max 256-byte base limit is implemented but the added wire test covers empty, numeric, and unknown arguments only; no over-limit argument is sent.
- Confirm a repository-wide sweep for remaining default-branch-only MCP wording is still warranted; this packet only exposes the changed protocol, workspace, tests, and documentation surfaces.
Refuted
- The missing-Git status probe is an authoritative runtime check and therefore portable across all Git layouts.; refuted because: That stronger claim was not needed: the code explicitly presents it as a marker probe that may under-report exotic GIT_DIR layouts, while refresh remains authoritative.
- The missing-Git-work-tree helper needs a broader unsafe/native helper-path review for this change.; refuted because: The helper only performs a bounded ancestor existence probe and does not invoke native code or alter memory ownership; unsafe-review reported no new gaps, while refresh remains authoritative.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
… wire Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZHDKLVQqArSZrUFKSkREo
…llers, number changelog fragment (#9018) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZHDKLVQqArSZrUFKSkREo
Resolve workspace.rs and mcp_stdio.rs conflicts preserving both sides. Harden git_work_tree_for: reject non-regular .git markers before opening and require the space in 'gitdir: '. Mention root.git_work_tree in the status tool description. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZHDKLVQqArSZrUFKSkREo
There was a problem hiding this comment.
Confirmed findings
- scope_disclosure's analyzed_label interpolates the user-supplied base into 'committed diff against base
<X>' without sanitization; 256-byte cap + JSON encoding make this wire-safe but unusual characters produce awkward labels. - analyzed_label interpolates the user base into 'committed diff against base
...' without escaping backticks; cosmetic only and downstream of a 256-byte cap and JSON encoding. - No wire test asserts that a 257-byte
basereturns -32602 with the exact MAX_BASE_REVISION_BYTES message; the bad-args loop in refresh_base_argument_... uses 257 chars and expects -32602, but the assertion is at -32602 only — wording drift in server.rs is not pinned.
Verification questions
- Confirm github-actions review flagged 'failed explicit-base refresh overwrites current_desired_input while retained snapshot stays default-base'; tests/mcp_stdio.rs only assert last_known_good persists for hostile bases, not the desired_input-base invariant.
- Confirm refresh_base_argument_recovers... asserts hostile
--output=...fails closed AND inspects the filesystem for the probe path, producing a non-discriminating oracle for option-shaped refs. - Confirm scope_disclosure schema pattern is loosened from const to pattern '^committed (default-branch diff|diff against base .+)$', so a base with regex-meaningful chars could produce a non-matching label.
Refuted
- The new active-view surface introduces resize, detach, transfer, or stale-length hazards.; refuted because: The patch contains no ArrayBuffer/TypedArray or unsafe memory-view operations. Session and snapshot publication uses owned values; the only bounded read is Vec::take/read_to_end and is local to marker validation.
- snapshot.base is initialized in Snapshot::from_output_admitted to None and overwritten in run_check via snapshot.base = base.map(str::to_string); callers reading base see analyzed_label produce 'committed diff against base
X' verbatim into scope disclosure strings, which can contain backticks or quotes supplied in the base arg (cosmetics, not injection). - git_work_tree_for probes .git via std::fs::metadata and a 4096-byte bounded File::open read, rejecting FIFO/block devices with metadata.is_file(); the new MarkerInvalid variant closes the prior devin finding (950828e follow-up).
Evidence gaps
- The requested cargo-test execution has not produced a receipt yet; authored tests are present, but execution status remains unverified in this lane.
- The new wire tests cover explicit-base recovery, option-shaped refs, no-Git status, marker behavior, and not-found wording, but the sensor packet's ripr run failed before producing complete planned proof.
- Model proof intent was rejected by deterministic validation.
|
Post-merge integration regression from #9075 on current main: #9156 required run 39625893339 checked out merge Please carry a bounded follow-up through the existing #9075 owner/normal review path: preserve the FIFO non-regular-marker negative behavior while preparing it through an approved process abstraction or another policy-compliant test method. Verify a negative control reproducing the current process-policy failure, then a corrected current-main |
|
Additional bounded source review for the #9156 prerequisite failure: this is a test-only FIFO constructor, not a production Git process call. Current |
Post-merge note: main-repair in flightThis merge left Repair: #9201 allowlists the test-only spawn (same class as the |
#9075's cfg(unix) test proves the git-marker probe rejects a non-regular .git entry without opening it; the mkfifo fixture spawn is test-only but check-process-policy counts it against the un-allowlisted file, leaving main red on the repository policy preflight and blocking every routed gate (first seen on the #9079 gate, run 39624620211).
…y created (#9224) mkfifo failure or a non-FIFO marker now fails the test instead of letting MarkerInvalid pass for the wrong reason. Follow-up from #9075 review. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019ZHDKLVQqArSZrUFKSkREo Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steven · project thread
Governing issue or accepted claim: #9018
Acceptance delta (one sentence): An MCP agent on a non-main-default-branch repository can recover
ripr_refreshthrough a workingbaseargument, and status/not-found/cache wording no longer overstates what the server can do.What changed
ripr_refreshaccepts optionalbase(non-empty, <=256 bytes; validated by the shared base resolver, so--prefixed or unresolvable bases fail the attempt closed). Failure recovery forbase_unresolvablenow names thebaseargument instead of an unreachable CLI--base; the check failure stays typed through a newcheck_workspace_with_config_typed. Each refresh states its own base (omitted = default branch). Surfaced asrequested_baseon the refresh document,current_desired_input.base/base_revisionin status, andscope.analyzed("committed diff against baseX"). Noripr mcp --baseflag: a launch-time base would be a second, unchangeable source of truth.workspace.root.git_work_tree(detected/not_detected) plus a limitation;workspace_statekeeps meaning "root discovered". Refresh on such a root recovers with a restart-inside-a-Git-work-tree route..gitignore; the cache lives undertarget/ripr/. Documented in the refresh tool description,ripr mcp --helpanddocs/interop/mcp.md.attempt_not_foundwording says session transactions are in-memory and never in the durable store.Not changed: a
failedrefresh still returnsisError:false(existing documented typed-document design).Verification
crates/ripr/tests/mcp_stdio.rs): trunk journey (fail -> recovery namesbase->base:"trunk"completes with findings, status shows explicit base;--output=...and unknown refs fail closed without reaching Git as an option; bad argument shapes are -32602), no-Git-work-tree status, not-found wording. Existing scope/pre-call contract tests updated for the new schema. The tests could not pass onmainby construction (argument rejected, nogit_work_tree).cargo test -p ripr --test mcp_stdio: 25 passed;cargo test -p ripr --lib mcp::: 169 passed;workspace_statuslib tests: 25 passed.cargo xtask precommit: first run failed only on a missing issue pointer in the changelog fragment (fixed) and acheck-file-policycovered_by instrument timeout under shared-cargo-lock contention (infrastructure, not source); rerun result in a follow-up comment.Generated by Claude Code