Repository navigation
fix(typescript): credit done-settled callbacks and old-value boundary pins (#9496) - #10145
Conversation
…raction A registration inside describe.skip/todo or a describe with a skip option never runs and is not a dropped one; stop disclosing it as language_scope_unsupported. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
… pins Rule 5 collects assertions of a callback that must call done() for a mocha test to pass. Rule 6 keeps the boundary witness when the expectation pins the unchanged value (fails against the changed code). Flips mocha-done-callback-value and mocha-nested-describe-boundary. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
…entries Removes mocha-done-callback-value and mocha-nested-describe-boundary (fixed here) and the six rows #9591 also removes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
… suites Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
…key voids skip:true Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
…r dropped registrations Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DYoh4Y4M2kQ1KXCn8TtBqE
Main landed the sibling #9496 rules (mocha hook = 7, counted loop = 8) in RIPR-SPEC-0246 while this branch still numbered the done-callback and boundary-pin rules 7 and 8. Union resolution: main's rules 7 and 8 keep their numbers; the done-callback rule is renumbered to 9 and the boundary rule to 10; acceptance examples renumber to 16 (hook), 17 (done) and 18 (boundary); corpus case citations and code comments follow. The spec-coverage floor keeps the branch's 134 (union coverage is 137). Local proof: cargo fmt --check; cargo clippy -p ripr --all-targets --locked -- -D warnings (with -A unused-mut for the inherited #[cfg(unix)]-only doctor.rs artifact identical to main); targeted tests for rules 7, 8, 9, 10 all pass; xtask policy cascade passes; verdict-corpus validate: 137/138 covered, above floor 134.
…d unterminated #8990 landed the 0288 entry without its outputs closing bracket and metrics list, so .ripr/traceability.toml fails to parse and check-traceability fails on every open merge ref (main heads 5950c91, ad1e3bb and 280e020 all ran red). Close the array and add the standard unit_test_pass_rate metrics list. cargo xtask check-traceability passes with this.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi
Perl case PRs landed after #9628 measured 21, so verdict-corpus check --language perl fails on main. Python and Rust fell; ceilings must equal the blessed count. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi
|
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 41 minutes. View limit details
Comment |
|
Required run Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Skipped describe detection does not recognize an aliased or indirect describe reference, so registrations inside such skipped suites may still be reported as partial extraction.
- Rule 9 can credit assertions when the test's done parameter is aliased and the callback calls the alias.
- Skipped-suite detection treats any receiver named describe as Mocha and can suppress genuine partial-extraction findings.
Verification questions
- Confirm rule 9 tests cover many refusal shapes, but do not prove that the callback cannot complete the test through an alternate execution path before its assertions.
- Confirm rule 9 credits assertions in any synchronous callback containing a bare done() call, even when the callee may never invoke that callback; a timeout then fails rather than allowing the test to pass, but the callback's assertions are not guaranteed to have run before settlement.
Refuted
- The receiver-name guard is insufficient because
donemay occur in unrelated source text.; refuted because: The implementation intentionally over-counts strings and comments, causing refusal rather than false credit; callback parameter and declaration shadowing are separately rejected.
Evidence gaps
- The PR body claims the TypeScript corpus check exits 0 and that precommit passes, but the shared packet records rip r failure and no completed cargo-test receipt.
- Model proof intent was rejected by deterministic validation.
- The required cargo-test receipt and the failed ripr diagnostic are needed to validate the new corpus rows and ceiling changes.
|
Response to the github-actions review on head 1237d72, checked against current source. Rule 9, aliased Rule 9, callee may never invoke the callback (documented, fail-safe). The rule 9 doc comment and RIPR-SPEC-0246 state this: a callback the callee never invokes times out and fails the test, it never passes it. The credited assertions are the ones that must hold for the test to pass, so no false credit follows. Skipped describe via alias or indirect reference, and any receiver named Evidence gaps. The ripr sensor failure and missing cargo-test receipt are runner artifacts of this lane. Local receipts on this head: Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Rule 9 credits assertions that may run after the test has already settled.
- Skipped-describe detection can suppress unrelated active registrations.
- Rule 9 treats any first test parameter as a Mocha-style done callback, without requiring the test framework or callback convention.
- Skipped-suite detection resolves
describeby identifier name, so an unrelated helper named describe can suppress partial-extraction findings. - The receiver_named_once guard counts
doneacross the entire test body, so a second occurrence in a comment, string, sibling scope, or unrelated code prevents all rule-9 credit. This is broader than the stated callback-settlement invariant and can create false negatives; consider restricting the guard to executable references relevant to alternate settlement paths, or explicitly documenting the conservative whole-body scope. (crates/ripr/src/analysis/language/typescript/oracle.rs:190).
Verification questions
- Confirm receiver_named_once counts identifiers in strings and comments, so a harmless mention of
donecan suppress valid callback assertion credit. - Confirm rule-9 credit is gated by whole-test-body identifier count, so an unrelated occurrence of the receiver name refuses otherwise valid callback assertions.
Refuted
- A callback passed to a call but never invoked by the callee can make the test pass without the assertions.; refuted because: Under the documented Mocha done contract, an uncalled callback leaves the test pending until timeout, which fails rather than passes; the callback assertions therefore do not create a passing-path false credit.
- The callback may never be invoked, so credited assertions are not necessarily part of test passage.; refuted because: Refuted by the rule-9 contract and implementation: a callback that never calls done() times out and fails rather than passing; aliased or indirect done calls are refused by the guard.
- Rule 9 could credit assertions in a callback that the callee never invokes, making a timeout look like a passing test.; refuted because: The documented oracle treats an uninvoked callback as timing out and failing rather than passing; the implementation also requires a top-level done() settlement path. Static evidence does not prove runtime runner behavior, so this is residual rather than a confirmed defect.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Response to the second github-actions review on #10145 (rule 9 and skipped describe), checked against Assertions run after the test settled (refuted). Only statements before the top-level Any first test parameter read as
Skipped describe resolved by name. Already answered above and tracked in #10169; it only affects an advisory partial-extraction notice. No code change for this review. Generated by Claude Code |
|
Review of record — head 2670866 (main 6212bda merged in).
Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfxntsP9VxYNTBs5FukBi
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm rule 9 can credit assertions from a callback even when the test body also contains a direct done() settlement path in a form not counted by the whole-body identifier guard.
- Confirm skipped-describe detection resolves describe by identifier name and does not recognize aliased or indirect references.
Parked follow-ups
- Skipped-suite recognition is intentionally syntactic and name-based, leaving a known false-negative surface for unrelated describe-shaped helpers.
Evidence gaps
- Fresh execution evidence for the changed Rust behavior and corpus acceptance remains trust-relevant because cargo-test is only scheduled-late.
- Model proof intent was rejected by deterministic validation.
- Skipped describe detection and its corpus relabeling are aligned with the stated acceptance delta, but the automated ripr sensor exited with code 2 and is not usable as positive proof.
|
Review of record, addendum — head 79b2f41. The review of record on 2670866 still holds for the production code; this head only merges main after #10156 landed.
Generated by Claude Code |
Summary
done()for a mocha test to pass as the test's own assertions (RIPR-SPEC-0246 rule 9) and keeps the boundary witness when the expectation pins the unchanged value (rule 10).mocha-done-callback-valueandmocha-nested-describe-boundaryfrom false actionable to credited. TypeScript false verdicts 9/351 to 7/351; floor 154.Swarm / Source Boundary
ripr-swarmSource-of-Truth Links
Spec: RIPR-SPEC-0246 (rules 9, 10; examples 17, 18)
Governing issue or accepted claim: #9496
Acceptance delta (one sentence): two TypeScript false-actionable corpus rows read
exposed.Candidate Relationships
Candidate branch: claude/project-thread-yr9dus-mocha
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): replaces #9627 (same commits plus a main merge); #9627 to be closed once this merges.
Acceptance retained from a replaced candidate (if any): all of #9627's review of record.
Scope
expected_side_is_live, oracle.rscollect_done_callback_assertions, tests_extract.rs skipped-describe finder, spec, corpus rows.Scope Classification
Production delta: rules 9 and 10 (fail closed on any shape that can skip the assertion).
Evidence/support delta: 2 rows blessed, 2 known-false entries removed, floor 154.
Single acceptance criterion:
verdict-corpus check --language typescriptshows the two rowsideal.Non-goals: #9667 rows, the mocha hook credit design.
Support-tier Impact
Policy Impact
Proof
Unit tests for rules 9 and 10 with 15 discriminating negatives are in the PR (inherited from #9627).
Claim Boundary
Static evidence only; no runtime mutation claim.
Rollback
Revert the squash commit and re-bless the two rows.
Static Language Check
killed,survived,untested,proven, andadequate.Generated by Claude Code