Repository navigation
test(typescript): pin spy file checks to the committed test file under dirty-tree analysis - #8694
Conversation
#8636 and #8642 both implemented the generic-client window/showMessage disclosure for #8583 and both merged. On main the first failure fires both paths, so the shown-once test from #8642 fails. Keep the per-signature path from #8642 (it also covers initialize and config reload) and remove the per-transition path and tests from #8636. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DhLb2VKJXpSwarf9qNWkGb
…r dirty-tree analysis Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V
|
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 1 minute. View limit details
Comment |
…file test Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V
|
Review of record for head 6af41f8 (test-only; no production delta). Angles:
Findings: no blockers. Nit: the Test Mapping sentence read awkwardly; fixed in 6af41f8. Nit: doc comment says the file checks read the same text as test bodies; kept, since test bodies come from the committed view.
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_01DhLb2VKJXpSwarf9qNWkGb
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm the PR-body mutation check (reverting classifier to std::fs::read_to_string makes the test fail with 'left: WeaklyExposed right: Exposed') is asserted by the author and echoed by EffortlessSteven's review-of-record, but no independent reproducer command is included in the patch or receipts; cargo-test receipt is still pending and ripr sensor failed. Recommend a focused proof_intent to run the new test under a temporary classifier flip before final sign-off.
Refuted
- Doc comment claim that file checks read the same text as test bodies is overstated.; refuted because: EffortlessSteven explicitly retained this language with the rationale that test bodies also come from the committed view, so the statement is consistent with committed-history analysis; doc-only, non-blocking.
- Helper duplicates fixture-writing logic from sibling TypeScript spy tests and should be factored into a shared helper.; refuted because: Existing helpers (ts_write_file, ts_unique_tempdir, OWNER, LINE, changed_with_lines, CommittedSourceOverlay::from_entries, with_overlay) are reused; only the overlay-driven analyze call is new, which is intrinsic to the dirty-tree scenario. Single call site, no duplication risk.
- The new test passes vacuously because CLEAN_TEST and HOOK_TEST resolve to the same byte sequence.; refuted because: HOOK_TEST has an added beforeEach block and identical test body; CLEAN_TEST has only the test body. They differ on the hook boundary that drives verdict flip, and asset ordering matches asserted direction.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Pushed cbdf7f4 (a merge of #8693, the open fix for the main-wide red Generated by Claude Code |
|
Reproducer for the one verification question: in Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Net lifetime/ownership impact of this PR is a small reduction in the LSP backend (one AtomicBool field, one detached tokio task over an owned Client clone, one heap-allocating string helper all removed). The added TypeScript test exercises an already-existing Arc -> with_overlay scope pattern with no new raw/unsafe lifetime mechanics; no UB-relevant memory contract changes are introduced by the diff itself.
- Removed
refresh_failure_noticedeleted path-token redaction helper; bounded_failure_message still re-exports from component_outcome so no info-disclosure widening, but a regression removing the wrapper would lose the explicit 'ripr analysis failed:' prefix formatting previously pinned by the deleted test. Security-relevant only if future code reintroduces raw showMessage without redaction.
Verification questions
- Confirm github-actions[bot] review of record flagged that cargo-test receipt is still pending and ripr sensor failed. Author's reproducer (revert classifier read → std::fs::read_to_string) is documented in PR body and EffortlessSteven's comment but not captured in a receipt. cargo-test is the only open proof path; PR is test-only so failure is contained.
Refuted
- Hypothesis: Arc created in dirty_test_class could alias freed Bytes across concurrent threads if with_overlay installs a thread-local that another test's join observes, causing dangling references inside the closure.; refuted because: Refuted: existing sibling tests in the same file (e.g. spy_on_an_exported_module_object_the_changed_line_calls_is_credited, spy_on_a_module_object_refuses_every_other_path_to_the_spy) already construct overlay via from_entries + with_overlay with the same Arc pattern; both dirty_test_class invocations run sequentially in #[test] (no #[tokio::test], no rayon::join), overlay is constructed in-stack and dropped at the with_overlay closure boundary, so there is no cross-thread aliasing.
- Diff might desync OverlayKey byte length from the on-disk path length and let a stale slice reach the spy file checks under committed-history analysis.; refuted because: Overlay entries are built from the same PathBuf used by ts_write_file; the spy file checks call read_source_bytes on the overlay key without any resize/growth, and the assertions in both directions of the new test pass only when the overlay bytes are honored. Stale-length framing is not a surface this diff introduces.
- New test could pass vacuously if the announceMail finding is missing or if the overlay key does not match the analyzer path lookup.; refuted because: dirty_test_class uses .ok_or_else(label: expected a finding for announceMail), so missing finding fails the test. Overlay key tests/mail.test.ts matches the ts_write_file path root.join(tests/mail.test.ts). Two opposing worktree/committed assignments make vacuous pass impossible (both assertions would have to be empty or both Exposed).
Parked follow-ups
- EffortlessSteven already documented the reproducer and the mutation flip returns the documented failure mode, so the cargo-test receipt is the only outstanding piece.
- Deleting refresh_failure_show_message_tests.rs removes the only test coverage for the #8636 per-transition window/showMessage path; #8642 (per-signature) remains the retained disclosure and is unaffected by this PR's surface.
Evidence gaps
- cargo-test receipt is still pending (scheduled-late per packet); ripr sensor failed with exit code 2, so independent reproducer of the PR's mutation claim (revert classifier to std::fs::read_to_string → 'left: WeaklyExposed right: Exposed') is not yet a sensor-verified artifact.
- Model proof intent was rejected by deterministic validation.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013ajVbPgh9yZDQgaAHkZE8V
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm mutation check (revert committed_source::read_source_bytes -> std::fs::read_to_string) is documented in PR body and corroborated by EffortlessSteven's local reproducer; cargo-test receipt still pending.
Refuted
- The two opposing overlays could still both pass vacuously if the classifier key were asserted via the overlay map lookup rather than via the overlay redirect of the file read.; refuted because: Overlay key matches the written test path (tests/mail.test.ts); CommittedSourceOverlay::from_entries re-points the read at the committed bytes, so left/right discrimination is structural, not key-derived.
Evidence gaps
- Author did not include an in-PR independent reproducer for the mutation check; only PR-body and EffortlessSteven's comments assert it. cargo-test receipt pending and ripr sensor failed, so the proof is human-only at this gate.
- Cargo-test receipt is scheduled-late and ripr sensor failed; however the new test is scoped, the author's mutation reproducer is documented in PR body and EffortlessSteven's thread reply (revert committed_source::read_source_bytes → std::fs::read_to_string fails with left: WeaklyExposed right: Exposed). Independent focused-run remains desirable but not a blocker.
- Model proof intent was rejected by deterministic validation.
Summary
jest.spyOnmodule-object file checks (RIPR-SPEC-0247 rule 4) read the committed test file, not the dirty worktree copy, when committed-history analysis is active.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0247
Governing issue or accepted claim: #6654 follow-up (coordinator task: committed-history guard test)
Acceptance delta (one sentence): a dirty test file cannot change the spy verdict derived from the committed test body.
Candidate Relationships
Candidate branch: claude/project-thread-pwvs2k
Stack parent or prerequisite PR (if any): none (follow-up to merged #8646)
Scope
Scope Classification
Production delta:
Evidence/support delta:
spy_file_checks_read_the_committed_test_file: a dirty worktree hook test over a clean committed test readsexposed; a clean worktree over a committed hook test readsweakly_exposed.Single acceptance criterion:
Non-goals:
Support-tier Impact
Policy Impact
Proof
cargo xtask precommit # passMutation check: reverting the classifier's committed read to
std::fs::read_to_stringmakes the new test fail (left: WeaklyExposed right: Exposed).Claim Boundary
May claim: the committed-view read is pinned by a test. Must not claim: anything new about verdict coverage.
Rollback
Revert the commit; test-only.
Spec-Test-Code Traceability
Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Generated by Claude Code