Repository navigation
fix(lsp): withhold gap artifacts computed for other source contents (#4544) - #4709
Conversation
…4544) `ripr lsp` projected gap diagnostics from gap-decision-ledger.json (and read actionable-gaps.json) without knowing which source state they were computed from, so after a branch switch, edit, or commit it placed the old gaps at their old lines on the new files and presented them as current. Producers now stamp a top-level `source_subject` (sha256 content digest of every file the records name: ledger anchor, repair-route target and related test; packet source, primary anchor and related test). `ripr reports gap-ledger` and `ripr first-pr --check-output` stamp the ledger from the selected root (a re-rendered ledger keeps its original stamp); `cargo xtask lane1-evidence-audit` stamps actionable-gaps.json. The shared validator `lsp::gap_artifacts::validate_gap_artifact` recomputes the digests and rejects the whole artifact as `stale_subject` (changed, deleted, or newly created file) or `unverifiable_subject` (missing, malformed, incomplete, or unreadable stamp, including artifacts from older builds). Rejections flow through the existing routes: run status stale/cache_limited, typed cache and gap_ledger component outcomes naming the regeneration command, workspace-status repair rows, and typed sentinels from the repair-packet and gap-context commands. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
…-2rk3d2-ledger-subject # Conflicts: # CHANGELOG.md # crates/ripr/src/lsp/backend.rs
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Important Review skippedToo many files! This PR contains 312 files, which is 212 over the limit of 100. To get a review, reduce the PR to 100 files or fewer by splitting it into smaller PRs or changing its base branch. Upgrade to a paid plan to raise the limit. Usage-priced reviews support at most 300 files. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (312)
You can disable this status message by setting the 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 |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f027d8c4b0
ℹ️ 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".
|
The "Rust-only feature lane" failure is this PR's. Generated by Claude Code |
Address review on #4709: - ripr check JSON and repo-exposure JSON stamp the files they name in the analysis run; the gap ledger and xtask actionable-gaps writers copy those digests via derive_source_subject and never hash the workspace. Without a usable input stamp they write source_subject_unavailable, which the LSP reports as unverifiable_subject. Re-rendering an unstamped ledger through --records stays unstamped. - One definition of the files a packet names (source_file, target_test, target_file, primary_anchor.file, related_test_or_observer as string, object or array), shared with xtask through a #[path] module so the writer and the LSP validator cannot drift. - Absolute record paths resolve against an absolutized root. - The limited scorecard fallback also carries the stamp disclosure. - The LSP source_subject test uses a Rust fixture so it holds in the lang-rust-only lane. - check.schema.json gains source_subject; 145 check.json goldens blessed; unchanged-after-attempt repo-exposure snapshots and their dependent verify/receipt digests refreshed. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
…-2rk3d2-ledger-subject # Conflicts: # CHANGELOG.md # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/after.repo-exposure.json # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-receipt.json # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-verify.json # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/before.repo-exposure.json # fixtures/mixed_rust_typescript_preview/expected/CHANGELOG.md # fixtures/python_adversarial_changed_sink_non_delta_operand/expected/CHANGELOG.md # fixtures/python_dynamic_route_registration_limit/expected/CHANGELOG.md # fixtures/python_local_callable_binding/expected/CHANGELOG.md # fixtures/python_mixed_language_no_cross_route/expected/CHANGELOG.md # fixtures/python_ranking_noise_control/expected/CHANGELOG.md # fixtures/python_same_stem_sibling_owner_not_related/expected/CHANGELOG.md # fixtures/python_src_layout_package_import/expected/CHANGELOG.md # fixtures/python_test_placement_verify/expected/CHANGELOG.md # fixtures/python_unittest_basic/expected/CHANGELOG.md # fixtures/python_unittest_oracle_shapes/expected/CHANGELOG.md # fixtures/python_unrelated_test_mention/expected/CHANGELOG.md # fixtures/ts_boundary_named_constant_test/expected/CHANGELOG.md # fixtures/ts_cross_language_bridge_limit/expected/CHANGELOG.md # fixtures/ts_cross_package_test/expected/CHANGELOG.md # fixtures/ts_domock_relation_gate/expected/CHANGELOG.md # fixtures/ts_dynamic_oracle/expected/CHANGELOG.md # fixtures/ts_heuristic_relation/expected/CHANGELOG.md # fixtures/ts_mock_forms_owner_module/expected/CHANGELOG.md # fixtures/ts_no_verify_command/expected/CHANGELOG.md # fixtures/ts_parse_depth_budget/expected/CHANGELOG.md # fixtures/ts_pkg_discovery_no_package/expected/CHANGELOG.md # fixtures/ts_predicate_boundary_optional_chaining/expected/CHANGELOG.md # fixtures/ts_predicate_boundary_overcredit/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_constant_first/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_constant_resolved/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_constant_unresolved/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_literal_derived/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_literal_guarded/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_unreachable/expected/CHANGELOG.md # fixtures/ts_repair_packet_complete/expected/CHANGELOG.md # fixtures/ts_repair_packet_wrong_family_oracle/expected/CHANGELOG.md # fixtures/typescript_adversarial_hoc_wrapped_owner/expected/CHANGELOG.md # fixtures/typescript_adversarial_mocked_barrel/expected/CHANGELOG.md # fixtures/typescript_adversarial_owner_identity_after_insertion/expected/CHANGELOG.md # fixtures/typescript_adversarial_owner_module_mock/expected/CHANGELOG.md # fixtures/typescript_adversarial_render_unobserved_sink/expected/CHANGELOG.md # fixtures/typescript_adversarial_same_method_other_class/expected/CHANGELOG.md # fixtures/typescript_adversarial_token_substring/expected/CHANGELOG.md # fixtures/typescript_awaited_promise_reject/expected/CHANGELOG.md # fixtures/typescript_boundary_gap/expected/CHANGELOG.md # fixtures/typescript_broad_tothrow/expected/CHANGELOG.md # fixtures/typescript_commonjs_require/expected/CHANGELOG.md # fixtures/typescript_dynamic_assertion_unresolved/expected/CHANGELOG.md # fixtures/typescript_effect_probe_shapes/expected/CHANGELOG.md # fixtures/typescript_jest_vitest_assertion_facts/expected/CHANGELOG.md # fixtures/typescript_limitation_custom_matcher/expected/CHANGELOG.md # fixtures/typescript_mocked_module_limit/expected/CHANGELOG.md # fixtures/typescript_monorepo_package_local/expected/CHANGELOG.md # fixtures/typescript_negated_t_oracle/expected/CHANGELOG.md # fixtures/typescript_oracle_helper_gated/expected/CHANGELOG.md # fixtures/typescript_owner_file_match/expected/CHANGELOG.md # fixtures/typescript_owner_kinds/expected/CHANGELOG.md # fixtures/typescript_probe_facts/expected/CHANGELOG.md # fixtures/typescript_reexport_barrel_other_name/expected/CHANGELOG.md # fixtures/typescript_reexport_no_false_credit/expected/CHANGELOG.md # fixtures/typescript_related_test_name_proximity/expected/CHANGELOG.md # fixtures/typescript_return_value_shape/expected/CHANGELOG.md # fixtures/typescript_static_limit_taxonomy/expected/CHANGELOG.md # fixtures/typescript_strict_actionability/expected/CHANGELOG.md # fixtures/typescript_strong_oracle/expected/CHANGELOG.md # fixtures/typescript_t_truthy_oracle/expected/CHANGELOG.md # fixtures/typescript_t_unknown_method_no_oracle/expected/CHANGELOG.md # fixtures/typescript_t_wrong_receiver_no_oracle/expected/CHANGELOG.md # fixtures/typescript_tothrow_exact_oracle/expected/CHANGELOG.md # fixtures/typescript_tsx_preview/expected/CHANGELOG.md # fixtures/typescript_witness_dead_argument/expected/CHANGELOG.md # fixtures/typescript_witness_dead_expected/expected/CHANGELOG.md # fixtures/typescript_witness_local_shadow/expected/CHANGELOG.md # fixtures/typescript_witness_nested_expression/expected/CHANGELOG.md # fixtures/typescript_witness_receiver_qualified/expected/CHANGELOG.md
… main Main reworded the related-test recommendation (#4520) and this branch adds source_subject to repo-exposure JSON, so the portable snapshots, their content_sha256, and the file digests agent-verify and agent-receipt pin are recomputed from production output. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
…-2rk3d2-ledger-subject # Conflicts: # CHANGELOG.md
…-2rk3d2-ledger-subject # Conflicts: # CHANGELOG.md # fixtures/python_adversarial_changed_sink_non_delta_operand/expected/CHANGELOG.md # fixtures/ts_cross_language_bridge_limit/expected/CHANGELOG.md # fixtures/ts_cross_package_test/expected/CHANGELOG.md # fixtures/ts_domock_relation_gate/expected/CHANGELOG.md # fixtures/ts_dynamic_oracle/expected/CHANGELOG.md # fixtures/ts_mock_forms_owner_module/expected/CHANGELOG.md # fixtures/ts_no_verify_command/expected/CHANGELOG.md # fixtures/ts_predicate_boundary_overcredit/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_constant_resolved/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_constant_unresolved/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_literal_derived/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_literal_guarded/expected/CHANGELOG.md # fixtures/ts_repair_packet_boundary_unreachable/expected/CHANGELOG.md # fixtures/ts_repair_packet_complete/expected/CHANGELOG.md # fixtures/typescript_adversarial_hoc_wrapped_owner/expected/CHANGELOG.md # fixtures/typescript_adversarial_mocked_barrel/expected/CHANGELOG.md # fixtures/typescript_adversarial_owner_module_mock/expected/CHANGELOG.md # fixtures/typescript_adversarial_render_unobserved_sink/expected/CHANGELOG.md # fixtures/typescript_adversarial_same_method_other_class/expected/CHANGELOG.md # fixtures/typescript_adversarial_token_substring/expected/CHANGELOG.md # fixtures/typescript_boundary_gap/expected/CHANGELOG.md # fixtures/typescript_broad_tothrow/expected/CHANGELOG.md # fixtures/typescript_commonjs_require/expected/CHANGELOG.md # fixtures/typescript_dynamic_assertion_unresolved/expected/CHANGELOG.md # fixtures/typescript_limitation_custom_matcher/expected/CHANGELOG.md # fixtures/typescript_mocked_module_limit/expected/CHANGELOG.md # fixtures/typescript_monorepo_package_local/expected/CHANGELOG.md # fixtures/typescript_negated_t_oracle/expected/CHANGELOG.md # fixtures/typescript_oracle_helper_gated/expected/CHANGELOG.md # fixtures/typescript_owner_file_match/expected/CHANGELOG.md # fixtures/typescript_reexport_barrel_other_name/expected/CHANGELOG.md # fixtures/typescript_reexport_no_false_credit/expected/CHANGELOG.md # fixtures/typescript_related_test_name_proximity/expected/CHANGELOG.md # fixtures/typescript_return_value_shape/expected/CHANGELOG.md # fixtures/typescript_strong_oracle/expected/CHANGELOG.md # fixtures/typescript_t_truthy_oracle/expected/CHANGELOG.md # fixtures/typescript_t_unknown_method_no_oracle/expected/CHANGELOG.md # fixtures/typescript_t_wrong_receiver_no_oracle/expected/CHANGELOG.md # fixtures/typescript_tothrow_exact_oracle/expected/CHANGELOG.md # fixtures/typescript_tsx_preview/expected/CHANGELOG.md # fixtures/typescript_witness_dead_argument/expected/CHANGELOG.md # fixtures/typescript_witness_dead_expected/expected/CHANGELOG.md # fixtures/typescript_witness_local_shadow/expected/CHANGELOG.md # fixtures/typescript_witness_nested_expression/expected/CHANGELOG.md # fixtures/typescript_witness_receiver_qualified/expected/CHANGELOG.md
… the stale-subject test) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head self-review of 7e9e9b4. No blocking findings.
Design (round 2).
- Producers (
ripr checkJSON and repo-exposure JSON) stampsource_subjectwhen they render. Repo-exposure computes it before the two-pass writer, socontent_sha256covers it. - The ledger,
first-prand xtask actionable-gaps writers copy the input stamp and never hash the workspace. A missing, malformed, unsupported or incomplete stamp becomes a typedsource_subject_unavailable. - The LSP re-hashes the named files. A mismatch withholds the gap as
stale_subject, and a stamp it cannot use withholds it asunverifiable_subject. Both come with the regeneration command. - One path extractor (
actionable_packet_named_paths) is shared with xtask through#[path], so the two cannot drift.
Oracle grip. Negative experiments are recorded in the PR body: re-hashing the workspace, hashing when the stamp is absent, a narrowed extractor and a raw strip_prefix each fail named tests.
Latest delta. It is a main merge. It resolves a lsp/tests.rs conflict by keeping both #4588's never_substitutes_another_gaps_packet test and this PR's discloses_stale_actionable_gaps_subject test. Local runs on the merged tree:
lsp::+ subject + ledger: 921 passed;cli_smokefirst_useful_action/unchanged/assistant: 10 passed;goldens check: exit 0;- clippy
-p ripr -p xtask --all-targets -D warnings: clean.
Hosted CI on this head. Rust gates, the Rust-only feature lane, ub-review, cargo-deny and dependency-review all passed.
Missing reviews, not clean. CodeRabbit skipped the PR (312 files, over its limit), Gemini is out of quota and droid-review is queued.
Generated by Claude Code
#4709 made ripr lsp withhold a gap ledger whose source_subject is missing or stale. The smoke wrote an unstamped ledger and then edited pricing.ts, so the preview diagnostic never appeared. Write the ledger after the save, stamped with the digests of the files its record names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx
… (#4903) * test(vscode): stamp the preview gap smoke ledger after the save (#4902) #4709 made ripr lsp withhold a gap ledger whose source_subject is missing or stale. The smoke wrote an unstamped ledger and then edited pricing.ts, so the preview diagnostic never appeared. Write the ledger after the save, stamped with the digests of the files its record names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx * test(vscode): derive the smoke ledger stamp from the records it names (#4902 review) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx --------- Co-authored-by: Claude <noreply@anthropic.com>
…ch changes (#4896) (#4904) * fix(lsp): refresh diagnostics when the gap ledger or checked-out branch changes (#4896) Watch the root gap decision ledger and root .git/HEAD (root-anchored RelativePattern when the client supports it) and schedule one watched_input refresh that bypasses input-identity dedup, without reloading config or invalidating the workspace graph. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx * fix(lsp): re-anchor diagnostics-input watchers on root transitions (#4896) Register the root gap ledger and root .git/HEAD watchers under their own registration and resync it after every workspace-root transition, so a root switch unregisters the old-root watchers and anchors new ones. Without relativePatternSupport, register absolute string globs instead of bare relative strings, skipping roots with glob metacharacters. Disclose watched_files_relative_pattern_support in the client-feature status projection and trace the new tests under RIPR-SPEC-0143. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx * test(vscode): stamp the preview gap smoke ledger after the save (#4902) #4709 made ripr lsp withhold a gap ledger whose source_subject is missing or stale. The smoke wrote an unstamped ledger and then edited pricing.ts, so the preview diagnostic never appeared. Write the ledger after the save, stamped with the digests of the files its record names. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx * test(vscode): derive the smoke ledger stamp from the records it names (#4902 review) Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steven · project thread
Summary
Before:
ripr lspprojected gap diagnostics, hovers and repair packets fromgap-decision-ledger.jsonandactionable-gaps.jsonwithout checking that they were computed for the current source. After a checkout, an edit or a branch switch, the editor showed gaps and line positions from other source contents as current. The ledger writers also could not say which source they were derived from.After:
ripr checkJSON and repo-exposure JSON carry a top-levelsource_subject: the sha256 of each file a derived ledger or packet names, read when the output is rendered.reports gap-ledger,first-pr) and the actionable-gaps writer copy those digests from their input and never hash the workspace. With no usable input stamp they writesource_subject_unavailable: input_source_subject_{missing|malformed|unsupported_digest|incomplete}.stale_subjectand a missing or unusable stamp isunverifiable_subject. Either one withholds the gap projection and says why, rather than showing it as current.Fixes #4544.
Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: RIPR-SPEC-0046, RIPR-SPEC-0047 (check JSON goldens gain the field)
ADR: n/a
Plan item: 0.11 shared-state hunt
Governing issue or accepted claim: #4544
Acceptance delta (one sentence): the LSP never presents a gap artifact computed for other source contents as current.
Candidate Relationships
Candidate branch:
claude/project-thread-2rk3d2-ledger-subjectStack parent or prerequisite PR: none
Scope
output/gap_source_subject.rsandgap_source_subject/shared.rsdefine the subject contract. There is one packet-path extractor,actionable_packet_named_paths, coveringsource_file,target_test,target_file,primary_anchor.file, andrelated_test_or_observeras a string, an object or a nested array. xtask compilesshared.rsthrough#[path].output/render.rs(check JSON) andoutput/repo_exposure.rs(computed before the two-pass writer, socontent_sha256covers it) are the producers.output/gap_decision_ledger.rs,output/first_pr.rs,cli/commands.rsandxtask/src/{evidence_audit,evidence_quality}.rsare the copying writers. Paths are rebased from the input root onto--root, and absolute paths are resolved against the absolutized or canonical root.lsp/{gap_artifacts,diagnostics,backend}.rsdo the validation and withholding.schemas/ripr/check.schema.jsonanddocs/OUTPUT_SCHEMA.mddocument the fields.check.jsongoldens are blessed (the only change is the addedsource_subjectline). Theunchanged-after-attemptsnapshots and their digests are regenerated from production output.Scope Classification
Non-goals:
Support-tier Impact
Policy Impact
Proof
Negative checks (logic reverted, then restored):
reports_gap_ledger_after_an_edit_keeps_the_analysis_time_stamp,..._copies_the_input_stamp_...and..._without_an_input_stamp_...fail.reports_gap_ledger_without_an_input_stamp_is_unavailable_and_stays_sofails.source_subject_covers_every_packet_related_test_shape, the extractor unit test, and the xtask all-shapes test fail.strip_prefix(root).absolute_paths_resolve_against_a_relative_rootand the CLI relative-root test fail.The Rust-only feature lane test now uses a Rust-context ledger fixture: 12
source_subjecttests pass under--no-default-features --features lang-rust.Local
cargo test -p xtaskhas 8 failures, all from this environment:python_judged_panel_replaytests expect<worktree>/target/debug/ripr, but the build used a sharedCARGO_TARGET_DIR.Claim Boundary
Rollback
Revert the squash commit. Artifacts carrying
source_subjectstay readable by older builds, which ignore the field. The check schema'sadditionalProperties: falsemeans older schema validators reject new check JSON.Static Language Check
killed,survived,untested,proven, andadequate.Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.Gates
cargo fmt --checkcargo xtask precommitcargo xtask goldens checkReview
Round-1 findings (Codex P1/P2, Devin ×4) are addressed, answered and resolved. CodeRabbit skipped (312 files over its limit), Gemini is out of quota, and droid-review is queued. Those reviews are missing, not clean.
🤖 Generated with Claude Code
https://claude.ai/code/session_014WDSj54AyARNwy6oUuYXnx