Skip to content

fix(typescript): discover active Jest/Vitest test modifiers - #3506

Merged
EffortlessSteven merged 13 commits into
mainfrom
fix/typescript-active-test-modifiers-3500
Aug 29, 2026
Merged

EffortlessSteven merged 13 commits into
mainfrom
fix/typescript-active-test-modifiers-3500

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Aug 28, 2026 •

Copy link
Copy Markdown
Member

Summary

Closes #3500.

The TypeScript preview adapter now recognizes a bounded active Jest/Vitest property vocabulary before related-test and oracle analysis:

  • active tests: bare test / it, plus .only, .concurrent, and .sequential chains;
  • active suites: bare describe, the same active modifiers, and array-form .each(table)(...);
  • active modifiers may appear in either order, repeat, combine, and precede .each.

The boundary is the accepted property vocabulary, not an invented runner-precedence model. Vitest-style chainable APIs accumulate modifier flags, so extraction preserves repeated and mixed active chains while leaving their runtime precedence to the runner.

Disabled, conditional, expected-failure, and unknown declarations remain fail-closed: skip, todo, skipIf, runIf, fails, unknown roots, and unknown modifiers are not indexed as ordinary executable related tests.

Implementation

tests_extract.rs now owns one shared recursive declaration recognizer used by both test extraction and suite recursion. It accepts only the known active roots and active property names, extends the existing OXC AST path, and does not add a parallel parser or change relation/oracle authority.

The duplicated direct-vs-.each assertion extraction was collapsed into one retained callback/assertion path. Focused proof lives in the sibling tests_extract_tests.rs module, registered test-only from mod.rs, so the production parser remains bounded. No scoring, oracle-strength, actionability, output-schema, support-tier, runner-precedence, or runner-inference behavior changes.

Proof added

Focused tests pin:

  • direct active test modifiers and assertion extraction;
  • direct active suite modifiers and qualified names;
  • bare and modified parameterized suites;
  • active modifier chains in both orders before .each;
  • repeated and mixed active chains remain discoverable without precedence inference;
  • zero discovery for skipped, conditional, expected-failure, and unknown forms;
  • production-path reachability from an extracted test.only declaration to DirectOwnerCall through related_test_candidates.

Review map

  • Semantic owner: crates/ripr/src/analysis/language/typescript/tests_extract.rs
  • Focused proof: crates/ripr/src/analysis/language/typescript/tests_extract_tests.rs
  • Test-only registration: crates/ripr/src/analysis/language/typescript/mod.rs
  • Downstream consumer exercised: related_test_candidates / owner_call_relation
  • Primary false-positive risk: treating a disabled, conditional, expected-failure, or unrelated member chain as an ordinary executable test; the negative corpus rejects those forms.
  • Primary false-negative risk: active member wrappers disappearing before relation analysis; positive tests cover each accepted grammar branch, order, repetition, and active-property combination.

Verification

The connector execution environment does not expose the repository Rust toolchain, so hosted verification is authoritative for compilation, formatting, and repository gates.

Current exact-head state (5b9fa56):

Expected lanes after the mainline repair lands:

cargo test -p ripr analysis::language::typescript::tests_extract_tests -- --test-threads=1
cargo test -p ripr analysis::language::typescript -- --test-threads=1
cargo xtask check-static-language
cargo xtask check-evidence-promotion-honesty
cargo xtask goldens check
cargo fmt --check
git diff --check

Non-goals

  • tagged-template .each tables;
  • imported or renamed test API aliases;
  • conditional-execution evaluation;
  • expected-failure oracle inversion;
  • runner-specific precedence among accumulated active flags;
  • runtime proof that a focused declaration ran;
  • broad Jest/Vitest API coverage.

Claim boundary

This prevents active, statically explicit declarations from disappearing at the TypeScript extraction boundary without crediting disabled or semantically inverted wrappers. It does not establish runtime execution, coverage, mutation adequacy, runner-precedence semantics, or stronger evidence than the existing relation and oracle producers earn.

Current exact-head state

Rebased on current main (includes #3517's rustfmt baseline); the fmt failure described in earlier notes predates that basis and no longer applies.

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 24 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: ccb1a0cd-a48a-452c-892e-0f5ef0c17712

📥 Commits

Reviewing files that changed from the base of the PR and between c39f597 and 1b1fc1a.

📒 Files selected for processing (4)
  • crates/ripr/src/analysis/language/typescript/mod.rs
  • crates/ripr/src/analysis/language/typescript/static_limit.rs
  • crates/ripr/src/analysis/language/typescript/tests_extract.rs
  • crates/ripr/src/analysis/language/typescript/tests_extract_tests.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed_head_sha: 03b8035
integration_basis: main@61d460f39ee32ba6746d6725c595373a81296ab2
claim_boundary: Discover the bounded active Jest/Vitest test/suite declaration grammar at the existing TypeScript extraction boundary; do not claim runtime execution or change relation, oracle, actionability, schema, support-tier, or gate authority.
changed_surfaces_and_semantic_owners_inspected: tests_extract.rs declaration recognition and retained callback/assertion path; tests_extract_tests.rs positive, negative, order-symmetry, suite-recursion, and downstream relation proof; mod.rs test-only registration; related_test_candidates/owner_call_relation consumer path; issue #3500 and PR claim/proof/non-goal parity.
blocking_findings: none remaining on source semantics or test-oracle shape.
non_blocking_suggestions: none.
refuted_or_stale_findings: The first candidate accepted arbitrary repetitions and conflicting execution modes (for example test.only.only and test.concurrent.sequential). That was a real false-promotion defect, repaired by bounded modifier state in 26d10ca and adversarial fixtures in 2be3645; 03b8035 additionally proves valid focus/execution combinations in both orders.
proof_and_ci_observed: Exact-head source inspection; positive fixtures cover direct modifiers, suite modifiers, bare and modified array-form each, and both valid modifier orders; negative fixtures cover skipped, todo, conditional, expected-failure, unknown, duplicate, and conflicting forms; a retained extracted test reaches DirectOwnerCall through related_test_candidates. No review threads or submitted external reviews were present when inspected.
proof_or_review_missing: The available execution container has no Rust toolchain. Exact-head cargo test, cargo fmt --check, clippy/compile coverage through Routed Rust Small, xtask static-language/evidence-honesty/golden gates, hosted check artifacts, and external automated review remain unobserved. GitHub REST status reads are currently rate-limited; absence of a receipt is not a pass.
affected_currentness_dimensions: production implementation current at 03b8035; test stimulus current; test oracle current; public claim current; generated relationships not engaged; conflict resolution not engaged; integration basis recorded but hosted merge/check evidence missing; candidate head identity current.
residual_assumptions_and_non_claims: Existing global-name authority for test/it/describe is unchanged. Computed members, parenthesized roots, tagged-template each, imported aliases, suite alias, conditional evaluation, expected-failure inversion, runtime allowOnly behavior, coverage, and mutation adequacy remain outside this claim.
disposition: REVIEW_INCOMPLETE

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed_head_sha: 3c2f038
integration_basis: main@61d460f39ee32ba6746d6725c595373a81296ab2
claim_boundary: Discover test/it/describe declarations composed only from the known active property vocabulary only/concurrent/sequential, including array-form each, at the existing TypeScript extraction boundary. Preserve runner ownership of accumulated-property precedence and do not claim runtime execution or change relation, oracle, actionability, schema, support-tier, or gate authority.
changed_surfaces_and_semantic_owners_inspected: tests_extract.rs exact-head declaration recognition and retained callback/assertion path; tests_extract_tests.rs direct modifiers, suite recursion, bare and modified each, order, repetition, mixed active properties, negative declarations, and downstream relation proof; mod.rs test-only registration; related_test_candidates/owner_call_relation consumer path; issue #3500 and current PR claim/proof/non-goal parity; Vitest chainable-function implementation and API types as primary counterexample authority.
blocking_findings: none on current-head source semantics or test-oracle shape.
non_blocking_suggestions: none.
refuted_or_stale_findings: Review 5047540165 on head 03b8035 is superseded. Its finding that repeated or mixed active chains were invalid was incorrect: Vitest's chain builder recursively exposes known properties and accumulates context flags, so extraction must not invent invalidity or precedence. Commits 45cd2bd and 3c2f038 restore recursive active-property semantics and add discriminating proof. GitHub does not permit dismissal of a COMMENTED author review, so this current-head record is the durable correction.
proof_and_ci_observed: Exact-head source inspection; positive fixtures cover direct test and suite modifiers, bare and modified array-form each, both property orders, repetition, mixed active properties, qualified suite names, assertion retention, and DirectOwnerCall reachability through related_test_candidates. Negative fixtures cover skip, todo, runIf, skipIf, fails, unknown roots, and unknown properties. Source of Truth, Security, PR Plan, and the CodeRabbit status are green on this exact head; no inline review threads are present. CodeRabbit and Gemini comments report reviewer quota exhaustion rather than substantive review.
proof_or_review_missing: Routed Rust Small, Coverage, Test Analytics, ub-review, and Droid Auto Review are still running or pending. The available local execution container has no Rust toolchain, so cargo test, cargo fmt, compilation/clippy, xtask static-language/evidence-honesty/golden gates, and current hosted artifacts remain unobserved until those exact-head jobs complete. External reviewer quota exhaustion is missing review, not clean review.
affected_currentness_dimensions: production implementation current at 3c2f038; test stimulus current; test oracle current; public claim current; generated relationships not engaged; conflict resolution not engaged; integration basis recorded; candidate head identity current; exact-head CI and external-review dimensions incomplete.
residual_assumptions_and_non_claims: Existing global-name authority for test/it/describe is unchanged. Computed members, parenthesized roots, tagged-template each, imported aliases, suite alias, test.for, conditional evaluation, expected-failure inversion, runtime allowOnly behavior, runner-specific precedence, coverage, and mutation adequacy remain outside this claim. sequential is retained for documented/historical Vitest compatibility without claiming it is preferred by every current runner version.
disposition: REVIEW_INCOMPLETE

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

EffortlessSteven and others added 2 commits August 28, 2026 23:31
…ch producer reference

The review map names mixed chains as the primary false-positive risk;
pin test.only.skip / test.skip.only / describe.only.skip in the
fail-closed negative corpus so future grammar loosening cannot pass
silently. Also point the typescript_table_case_unresolved limitation
doc at call_callee_is_active_each_declaration, the successor of the
deleted test_callee_is_each helper.
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review August 29, 2026 04:43
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 29, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-08-29T04:46:57.610047Z 1b1fc1a Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@EffortlessSteven
EffortlessSteven merged commit 99514ed into main Aug 29, 2026
23 checks passed
@EffortlessSteven
EffortlessSteven deleted the fix/typescript-active-test-modifiers-3500 branch August 29, 2026 04:44

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b1fc1a824

ℹ️ 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".

Comment on lines +222 to +223
member.property.name.as_str() == "each"
&& expression_is_active_declaration(&member.object, root)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Preserve table-case limits for modified .each tests

Failure mode: when the new grammar extracts test.only.each(...) or it.concurrent.each(...) with a row-derived expected value, table_case_test in static_limit.rs still recognizes only bodies beginning with test.each( or it.each(. The test therefore receives the generic dynamic-assertion limitation but loses the more specific typescript_table_case_unresolved evidence, even though row binding remains unsupported. Fix direction: share the accepted .each grammar with table-case detection or store this fact during extraction, then add an output-level regression for a modified table test. Validation: run the focused TypeScript tests plus cargo xtask goldens check. Confidence: High, based on the direct predicate mismatch; compilation could not be run because the environment could not download oxc_allocator.

AGENTS.md reference: AGENTS.md:L262-L271

Useful? React with 👍 / 👎.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs reviewer attention before upstream: findings remain.

Confirmed findings

  • Tagged-template .each tables, imported/renamed test aliases, skipIf/runIf at suite level, and dynamic callees are out of scope per PR non-goals; the current recognizer returns false for these forms (fail-closed), which matches claim boundary.
  • static_limit.rs doc comment rename (test_callee_is_each -> call_callee_is_active_each_declaration) is correct but couples the limit doc to an internal helper name; if the helper is renamed again the doc will drift silently.

Verification questions

  • Confirm mod.rs registers tests_extract_tests behind cfg(test), so the focused proof module does not enlarge the production public surface; static_limit.rs docstring still points to the renamed callee.
  • Confirm sensors/artifact-verifier:0 — artifact-verifier failed exit 2 with no receipt in this packet. Until the receipt is captured we cannot confirm whether the failure originates in this PR's artifacts or in transitively merged mainline state (#3507 / #3517). Central proof broker should re-run artifact-verifier with receipt capture so the gate has auditable evidence rather than a status string.

Refuted

  • Active modifier chains may hide runtime precedence semantics not pinned by tests; refuted because: Claim boundary explicitly excludes runner-specific precedence; positive tests cover combined/ordered chains and reviewer refutes any precedence claim in claim_boundary. PR is scoped to discovery not precedence.

Evidence gaps

  • artifact-verifier failed with exit code 2 in current packet; this lane cannot confirm routed required-check status at exact head, only that #3517 is positioned as fmt-only fix-forward and PR body states required-check awareness.

EffortlessSteven added a commit that referenced this pull request Aug 30, 2026
…3594)

* docs(changelog): record the recent user-visible merges in Unreleased

Entries for the recent user-visible merges: test-case parameterized
test discovery (#3522), nonstandard test attributes (#3513), active
Jest/Vitest modifiers (#3506), the perl class-cap fix (#3583), Python
LSP config reload and auto-detection invalidation (#3503/#3576), policy
covered_by enumeration reliability (#3577), and front-panel movement
vocabulary (#3491). Entries state what the merged PR titles state — no
invented mechanism detail.

* docs(changelog): capitalize Perl in the class-cap entry (#3594 review)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

analysis(typescript): discover active Jest/Vitest modifiers and parameterized suites

1 participant