Skip to content

fix(typescript): read a jest projects array of inline objects instead of refusing the snapshot (#10139) - #10158

Merged
EffortlessSteven merged 16 commits into
mainfrom
claude/ts-inline-jest-projects-10139
Oct 25, 2026
Merged

EffortlessSteven merged 16 commits into
mainfrom
claude/ts-inline-jest-projects-10139

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 25, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Spec: RIPR-SPEC-0258 (rule text, example 8 and Test Mapping amended)
Governing issue or accepted claim: #10139
Acceptance delta (one sentence): An inline-only projects config reads the committed snapshot instead of refusing.

Candidate Relationships

Stack parent or prerequisite PR (if any): none (#10138 merged)

Scope

  • One analyzer helper, one unit test, spec text, one corpus case and subject.

Scope Classification

  • One production behavior

Production delta:

  • committed_snapshot.rs: without_plain_inline_projects, preset_may_name_a_file, delegates_beyond_plain_projects, used in the config-directory scan for Jest files.

Evidence/support delta:

  • Unit test plain_inline_projects_keep_the_credit_and_every_other_spelling_refuses (about 24 spellings).
  • Corpus case jest-spec0258-ex08-inline-projects, subject authored-ts-jest-snapshot-inline-projects. Real run (node 22.22.0, jest 30.5.2, ts-jest 29.4.14): passes on the unedited package and fails on the edited one. ripr: exposed, outcome ideal. TypeScript false verdicts stay 9 (now over 354 cases).

Single acceptance criterion:

  • exposed for the inline-projects case, weakly_exposed still for path, resolver and relocation spellings.

Non-goals:

  • Evaluating project configs by path, workspace, or Vitest.

Support-tier Impact

  • none

Policy Impact

  • none

Proof

cargo clippy -p ripr --all-targets -- -D warnings
cargo test -p ripr --lib committed_snapshot       # 45 passed
cargo test -p xtask --bin xtask verdict_corpus
cargo xtask verdict-corpus check --language typescript
cargo xtask precommit                              # exit 0 on 1ae5e0e9

Claim Boundary

Claims: inline-only Jest projects arrays read. Does not claim other delegating spellings read. Known limits: computed keys built from expressions, and a string-concatenated preset path.

Rollback

Revert the commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP

…cts key)

Adds authored-ts-jest-snapshot-projects and the case jest-spec0258-ex08-projects-key:
jest.config.js holds only projects, the project config relocates snapshots, and a
real jest run passes the edited package. TypeScript spec examples 152/153 -> 153/153,
floor 153; no new false verdict (ripr reports weakly_exposed, the ideal gap).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP
… of refusing the snapshot (#10139)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP
@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!

@EffortlessSteven EffortlessSteven self-assigned this Oct 25, 2026
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 44 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 169 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 822f3659-c100-4ed9-bb4c-e6ad779a83fa
Commits

Reviewing files that changed from the base of the PR and between feea378 and 23e9474.

Files ignored due to path filters: 1
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects/test/__snapshots__/priceSnapInline.test.ts.snap is excluded by !**/*.snap
Files selected for processing: 16
  • changelog.d/10139-ts-inline-jest-projects.md
  • changelog.d/10158-ts-corpus-inline-projects.md
  • crates/ripr/src/analysis/language/typescript/committed_snapshot.rs
  • crates/ripr/src/analysis/language/typescript/tests/committed_snapshot_tests.rs
  • docs/specs/RIPR-SPEC-0258-typescript-committed-snapshot.md
  • fixtures/typescript-verdict-corpus/SPEC.md
  • fixtures/typescript-verdict-corpus/cases/jest-spec0258-ex08-inline-projects.diff
  • fixtures/typescript-verdict-corpus/cases/jest-spec0258-ex08-inline-projects.json
  • fixtures/typescript-verdict-corpus/expected/rows/jest-spec0258-ex08-inline-projects.json
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects.json
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects/jest.config.js
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects/package.json
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects/ripr.toml
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects/src/priceSnapInline.ts
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects/test/priceSnapInline.test.ts
  • fixtures/typescript-verdict-corpus/subjects/authored-ts-jest-snapshot-inline-projects/tsconfig.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Base automatically changed from claude/project-thread-kem7sn to main October 25, 2026 01:46
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP

# Conflicts:
#	fixtures/typescript-verdict-corpus/spec-coverage.toml
…lled or preset by path (#10139)

Review of record findings on #10158: .concat/.map after the array, spread or call inside a
project, and a path preset all fed config this walk never read. Adds root/workspace-inside-
project and concat/spread/call/preset rows to the unit test, fixes the corpus case's
labeling commit, and updates the corpus SPEC subject list.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP
…ne project (#10139)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP

Copy link
Copy Markdown
Member Author

Review of record — head 1ae5e0e95d1fda6c8a0a3c09df720c9d52513d5a

Angles (independent reviewer passes, each on a committed head of this branch):

  1. Parser fail-closed behaviour of without_plain_inline_projects / preset_may_name_a_file.
  2. Tests, spec 0258 and verdict corpus parity.

Findings and resolutions:

  • .concat/.map after the array, spread, call, path/identifier preset: fixed, each now refuses (medium) and has a test row.
  • Computed-key and shorthand preset: fixed in the head commit, with test rows.
  • root/workspace inside an inline project: covered by a test, refuses.
  • Corpus ripr_commit wrong, SPEC.md stale, changelog bullet missing: fixed.

Local proof on this head: cargo test -p ripr --lib committed_snapshot (45 passed), clippy clean, cargo xtask precommit exit 0. The ex08 inline-projects case reads exposed / outcome ideal.

Known limits, recorded and not fixed: computed keys built from expressions (['root'+'Dir']) and preset: 'ts-jest' + '/../../p.js'. These match the existing top-level scanner limits.

Nothing blocking remains from my side.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 25, 2026 03:34
@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!

@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 verification checks before upstream.

Verification questions

  • Confirm unscanned JavaScript expression forms remain a verification boundary rather than evidence of another implementation path.
  • Confirm the strongest remaining concern is that the lexical scanner may misclassify an unusual but valid inline project object, rather than delegating safely.

Refuted

  • without_plain_inline_projects may return borrowed references whose lifetimes are tied to a temporary reconstructed String.; refuted because: The helper returns Option by value. It performs borrowed slicing only while building that owned String and exposes no reference into it; the caller immediately passes the owned value by reference for the duration of delegates_to_other_config.
  • The inline-projects change could introduce a stale length snapshot or resize/detach/transfer hazard.; refuted because: The helper reads immutable Rust strings and returns another immutable String; it neither exposes nor mutates a buffer whose visible length could become stale.
  • Removing the inline projects array could expose snapshot data across a JavaScript runtime or worker-handoff boundary.; refuted because: The change is a synchronous text-analysis rule with no worker, channel, shared-memory, async, GC, detach, or transfer operation. It only removes a statically recognized array after rejecting dynamic or delegating spellings.
  • The new corpus row only repeats the fixture's expected classification and does not establish that the changed analyzer route produces it.; refuted because: The corpus case invokes npm test on the whole package and the prior review reports the runtime mutant kill; however, this lane did not execute it, so no independent verdict is claimed.
  • The fix broadens behavior beyond the stated production delta or duplicates the delegation rule in a fragile place.; refuted because: The behavior is isolated in two private helpers at the existing config-directory delegation boundary, reused by one call site, and backed by a focused unit test plus a corpus case; no public API or unrelated analysis path is changed.
  • The new inline-projects exception could execute or trust delegated configuration content and expose secrets.; refuted because: The change only changes static source classification. It does not execute JavaScript, load referenced files, read credentials, or emit source contents; unsupported delegation forms remain refused.

Evidence gaps

  • Automated repository-wide test confirmation is pending the scheduled cargo-test receipt.
  • Model proof intent was rejected by deterministic validation.
  • The corpus assertion exercises a runtime-discriminating committed snapshot, but its expected corpus result is represented by checked-in metadata rather than independently executed evidence in this lane.

@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.

Scoped independent review for #10139: REPAIR_REQUIRED at 1ae5e0e95d1fda6c8a0a3c09df720c9d52513d5a.

The existing writer and branch claude/ts-inline-jest-projects-10139 retain custody. No competing implementation, candidate edit, build, CI request, readiness change, or merge was made by this review.

  1. [P1] A bare package preset still delegates to unread configuration. preset_may_name_a_file (lines 432–436) treats every literal without a leading dot/slash or listed extension as safe. Thus module.exports = { projects: [{ preset: "review-snapshot-preset" }] }; passes the new exception. But a package preset is precisely an external config: Jest resolves review-snapshot-preset/jest-preset.js and merges its properties into the project. That file can export snapshotResolver or roots, and the directory walk does not inspect it. Removing the array then hides the only delegation marker and allows strong credit for a default-location snapshot the runner need not use. This is a new admission through the inline-project exception, distinct from the already-recorded computed-key/string-concatenation limitations. Jest preset contract; Jest resolver and merge implementation.

    Fix direction: keep unevaluated package presets fail closed, or restrict any supported exception to a deliberately established non-relocating preset contract. Do not equate package-name syntax with known config contents. Keep the direct non-relocating inline positive and rootDir / roots / snapshotResolver negatives. Confidence: high from exact source and Jest's loader; this lane did not execute the Rust/analyzer reproduction.

  2. [P1] Ordinary literal spellings retain the false-actionable path. without_plain_inline_projects (lines 449–463) searches raw text and requires : immediately after trivia following the word. Both "projects": [{ displayName: "unit" }] and 'projects': [...] therefore miss the exception; a harmless // unit projects comment also makes found.next().is_some() reject the same object. Fallback delegates_to_other_config recognizes the real key and returns medium. The existing classifier then follows the weak-oracle gap route for the same otherwise-discriminating test. These are valid, non-relocating inline configurations, not unknown external configs. This leaves #10139's false-actionable behavior for common spelling-only variants. An executed Node control confirms the three variants evaluate to the same object as the bare-key positive.

    Fix direction: admit equivalent literal keys and ignore comment occurrences when recognizing the bounded inline object, or expose an honest limitation instead of an actionable weak gap when recognition is deliberately unsupported. The proposed test below uses strong admission; an explicit limited-classification control is also consistent with the issue's accepted fallback. Confidence: high for the source path and JavaScript equivalence; rendered ripr output remains unexecuted here.

Exact subject / basis:

head: 1ae5e0e95d1fda6c8a0a3c09df720c9d52513d5a
head tree: 96398466144f7fac5115f0bb9121aa3c19089b15
merge-base with fetched origin/main: 45bd4f9a5904812b9f91f0dfa425a7e791e3b469
merge-base tree: 7db2a869c000f29b4415960a0e708cc833657980
merge-base is the verified squash landing of prerequisite #10138
PR API base snapshot: 07e5959d4b848c90a6f1b1df3936ce380146b2a6
fetched main: 1818f481c279b84634c32ee19e9c23d199459967
fetched main tree: 83621868be9c417527d2bc79d7d1f52769abe566
bounded candidate diff: 17 files, +459/-5 (production: one config owner)

Inspected: complete 17-file change, config directory scan, delegation/key/preset helpers, snapshot promotion, classifier strong/weak consumers, SPEC-0258, new case/subject/expected row, all current Conversation comments and inline threads. Issue comments were empty on both custody reads; #10158 already owns the exact scope. Oracle extraction, skipped-describe, loop bounds, and the protected sibling work were left untouched. No schema/API/workflow/permission change is proposed.

Observed independent fixture checks (Node v24.19.0, native exit 0): all seven retained-file SHA-256 entries match the exact Git object; the new corpus source returns 140, its specified mutant returns 130, and the committed snapshot is 140; all three lexical variants evaluate to the same config object; explicit relocation controls parse as JavaScript. This is a source/fixture audit, not a run of Jest or ripr. Exact audit script and raw output follow below.

Other observed commands:

git diff --check 45bd4f9a5904812b9f91f0dfa425a7e791e3b469 1ae5e0e95d1fda6c8a0a3c09df720c9d52513d5a
# native exit 0; no output
git apply --check regressions.patch
# native exit 0 against an extracted exact-head test file; candidate unchanged

The proposed regression delta is test-only, 50 added lines, and has not been compiled or run. There is no installed cargo/rustc in this saved environment; existing older target binaries were not substituted for the candidate. Intended focused owner commands after applying the tests: cargo test -p ripr --lib inline_project and cargo test -p ripr --lib committed_snapshot. The first new external-preset assertion is source-predicted to find Strong instead of Medium; the quoted/comment positive assertions are source-predicted to find Medium instead of Strong. Those are predictions, not claimed red-run receipts.

Hosted proof observed: existing merge-ready run 40158714499, Rust job 121065637575, had successful policy/evidence-honesty/dependency/process/network/all-target/all-feature/Clippy steps; required tests were running and doctests/goldens/fixtures/verdict steps were pending when inspected. No new request was made. PR-reported 45 focused passes and earlier Jest runtime results remain reported evidence, not this review's execution.

Next obligation stays with this candidate: repair/dispose both findings, run the focused regressions (including positive and relocating negative controls), refresh substantive review for affected dimensions, and inspect all required checks/current conversations on the final published head before any ready/merge decision. Existing CI in flight is not merge clearance. Unrelated main movement alone is not a request to restack or repeat unaffected proof.

Storage/proof handling: review-only scratch, no worktree/target/binary allocation; scratch outputs budgeted under 1 MiB peak against 32.0 GB observed free and a retained 5 GB floor. Existing targets/witnesses were preserved. The regression patch and audit are included here so another environment can inspect them without this scratch directory.

Reproduce the fixture audit by saving the attached audit.cjs outside the candidate and running node /path/to/audit.cjs from the repository root. The portable path placeholder is deliberate; Git reads are bound to the full head SHA in the script. No software installation is needed.

Proposed regression patch (unexecuted)
--- a/crates/ripr/src/analysis/language/typescript/tests/committed_snapshot_tests.rs
+++ b/crates/ripr/src/analysis/language/typescript/tests/committed_snapshot_tests.rs
@@ -1787,3 +1787,53 @@
     }
     Ok(())
 }
+
+/// A package preset is another configuration source even when its name
+/// has no file suffix. Its contents are outside the config-directory walk.
+#[test]
+fn inline_project_unknown_package_preset_stays_medium() -> Result<(), String> {
+    let jest = jest_snap(&[("price 1", "140")]);
+    assert_eq!(
+        strengths(
+            "snap-inline-external-preset",
+            PRICE_TEST,
+            &[
+                (SNAP_PATH, &jest),
+                (
+                    "jest.config.js",
+                    "module.exports = { projects: [{ preset: \"review-snapshot-preset\" }] };",
+                ),
+                (
+                    "node_modules/review-snapshot-preset/jest-preset.js",
+                    "module.exports = { snapshotResolver: '<rootDir>/moved.cjs' };",
+                ),
+            ],
+        )?,
+        vec![OracleStrength::Medium],
+    );
+    Ok(())
+}
+
+/// Quotes and comments do not turn a plain inline project into another
+/// configuration source. Keep a nonempty exact oracle-strength assertion.
+#[test]
+fn inline_project_literal_key_spellings_keep_snapshot_credit() -> Result<(), String> {
+    let jest = jest_snap(&[("price 1", "140")]);
+    for text in [
+        "module.exports = { projects: [{ displayName: \"unit\" }] };",
+        "module.exports = { \"projects\": [{ displayName: \"unit\" }] };",
+        "module.exports = { 'projects': [{ displayName: \"unit\" }] };",
+        "// unit projects\nmodule.exports = { projects: [{ displayName: \"unit\" }] };",
+    ] {
+        assert_eq!(
+            strengths(
+                "snap-inline-literal-keys",
+                PRICE_TEST,
+                &[(SNAP_PATH, &jest), ("jest.config.js", text)],
+            )?,
+            vec![OracleStrength::Strong],
+            "{text}",
+        );
+    }
+    Ok(())
+}
Independent source/fixture audit
// Source/fixture audit only. This does not execute ripr or Jest.
const assert = require('node:assert/strict');
const {execFileSync} = require('node:child_process');
const {createHash} = require('node:crypto');
const vm = require('node:vm');
const {stripTypeScriptTypes} = require('node:module');
const head = '1ae5e0e95d1fda6c8a0a3c09df720c9d52513d5a';
const root = process.cwd();
const read = path => execFileSync('git', ['show', `${head}:${path}`], {cwd: root, encoding: 'utf8'});
const prefix = 'fixtures/typescript-verdict-corpus/';
const id = 'authored-ts-jest-snapshot-inline-projects';
const manifest = JSON.parse(read(`${prefix}subjects/${id}.json`));
assert.equal(manifest.subject_id, id);
for (const row of manifest.retained_files) {
  const bytes = read(`${prefix}subjects/${id}/${row.path}`);
  assert.equal(createHash('sha256').update(bytes).digest('hex'), row.sha256, row.path);
}
console.log(`retained-file hashes: ${manifest.retained_files.length}/${manifest.retained_files.length} match exact head`);

const casePath = `${prefix}cases/jest-spec0258-ex08-inline-projects.json`;
const row = JSON.parse(read(casePath));
assert.equal(row.subject_id, id);
const source = read(`${prefix}subjects/${id}/src/priceSnapInline.ts`);
const snapshot = read(`${prefix}subjects/${id}/test/__snapshots__/priceSnapInline.test.ts.snap`);
const snapshotMatch = snapshot.match(/exports\[`priceSnapInline 1`\] = `([0-9]+)`;/g);
assert.equal(snapshotMatch?.length, 1);
const expected = Number(snapshotMatch[0].match(/= `([0-9]+)`;/)[1]);
const replacement = row.truth.mutants[0].replacement;
assert.equal(source.split('return amount - 10;').length, 2);
const mutant = source.replace('return amount - 10;', replacement);
const diff = read(`${prefix}${row.diff}`);
assert.ok(diff.includes('-    return amount - 10;\n+    return amount - 20;'));
const run = text => vm.runInNewContext(`${stripTypeScriptTypes(text).replace('export ', '')}\npriceSnapInline(150);`);
const baseline = run(source);
const edited = run(mutant);
assert.equal(baseline, expected);
assert.notEqual(edited, expected);
console.log(`independent snapshot-value witness: baseline=${baseline}, edited=${edited}, committed=${expected}; baseline matches, edit differs`);

const evaluate = text => {
  const context = {module: {exports: {}}};
  vm.runInNewContext(text, context);
  return JSON.parse(JSON.stringify(context.module.exports));
};
const canonical = evaluate('module.exports = { projects: [{ displayName: "unit" }] };');
const positives = [
  'module.exports = { "projects": [{ displayName: "unit" }] };',
  "module.exports = { 'projects': [{ displayName: \"unit\" }] };",
  '// unit projects\nmodule.exports = { projects: [{ displayName: "unit" }] };',
];
for (const text of positives) assert.deepEqual(evaluate(text), canonical);
console.log(`plain-inline lexical variants: ${positives.length}/${positives.length} evaluate to the same object as the bare-key control`);

for (const [key, value] of [
  ['rootDir', 'pkg'], ['roots', ['<rootDir>/pkg']], ['snapshotResolver', '<rootDir>/moved.cjs'],
]) {
  const text = `module.exports = { projects: [{ ${key}: ${JSON.stringify(value)} }] };`;
  assert.deepEqual(evaluate(text).projects[0][key], value);
}
console.log('relocating inline controls: rootDir, roots, snapshotResolver are valid JavaScript config objects');

const external = evaluate('module.exports = { projects: [{ preset: "review-snapshot-preset" }] };');
assert.equal(external.projects[0].preset, 'review-snapshot-preset');
console.log('external preset control: bare package name is a valid inline preset value (Jest resolution semantics established separately from upstream source)');
console.log('PASS: 7 hashes, one baseline/edit value pair, 3 equivalent inline variants, 3 relocation controls, 1 external preset input');
console.log('NOT RUN: Rust regression tests, ripr CLI, Jest runtime; this audit is not analyzer qualification');
Raw audit output (exit 0)
retained-file hashes: 7/7 match exact head
independent snapshot-value witness: baseline=140, edited=130, committed=140; baseline matches, edit differs
plain-inline lexical variants: 3/3 evaluate to the same object as the bare-key control
relocating inline controls: rootDir, roots, snapshotResolver are valid JavaScript config objects
external preset control: bare package name is a valid inline preset value (Jest resolution semantics established separately from upstream source)
PASS: 7 hashes, one baseline/edit value pair, 3 equivalent inline variants, 3 relocation controls, 1 external preset input
NOT RUN: Rust regression tests, ripr CLI, Jest runtime; this audit is not analyzer qualification
(node:1027) ExperimentalWarning: stripTypeScriptTypes is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)

Copy link
Copy Markdown
Member Author

Additional independent boundary review: REPAIR_REQUIRED at head 1ae5e0e95d1fda6c8a0a3c09df720c9d52513d5a, tree 96398466144f7fac5115f0bb9121aa3c19089b15, PR API base 07e5959d4b848c90a6f1b1df3936ce380146b2a6.

[P1] A regex grouping parenthesis preserves the false actionable path. In without_plain_inline_projects, every ( refuses, including regex contents. Add only this property to the existing corpus fixture's inline project:

globals: { tag: /a(b)/ },

The exact production helper refuses this nondelegating config; changing the regex to /ab/ makes it accept. The config-directory refusal prevents snapshot promotion, retaining the medium / #10139 false actionable route. This is a remaining acceptance gap, not a regression over the base, which refused every projects array.

Observed: With that property and the fixture's original test selection, npm test -- --runInBand --ci passes (1 test, 1 snapshot). Changing return amount - 10 to return amount - 20 fails specifically on snapshot 140 versus received 130. Environment: Node 24.19.0, Jest 30.5.2, ts-jest 29.4.15. A preliminary regex-valued testRegex example failed Jest validation and is excluded from this finding.

Additional local proof: cargo test -p ripr --lib review_10158_expression_boundaries -- --nocapture passed (1 test containing 17 assertions; 14,114 unrelated tests filtered out). These reviewer-only assertions exercised real snapshot promotion for nested arrays/objects, quoted delimiters, static templates, comments, delegation before/after the array, computed roots, Vitest, calls and conditional/member/boolean suffixes. A separate exact-helper nondelegation assertion for the valid regex fixture failed as expected (exit 101). Exact regex-variant rendered CLI/promotion output was not separately executed; its refusal and downstream route were checked independently. No hosted qualification is claimed.

Repair direction: In the existing candidate, distinguish regex contents from call/delimiter tokens, or represent unsupported expressions without an actionable weak gap. Add the regex fixture as a promotion/corpus regression and reconcile SPEC-0258's inline-object claim. Confidence: high for helper refusal and runtime discrimination.

The concurrent independent review separately reports package-preset and literal-key gaps; this comment neither duplicates nor clears them. Earlier author-reported 45 passes remain separate evidence.

All experiments were isolated, labeled, reverted and unpublished as implementation; the review tree is clean. The test-only experimental patch SHA-256 was 672e30ed7697f94a7bad053e859e816c54bff564489d9a70e15eff7f21384589. No author-branch edits, hosted requests, review resolutions, Ready changes or merge occurred. Next: the canonical writer reconciles these findings in this candidate, then affected evidence is refreshed at the resulting head.

…r commented projects keys (#10139)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP

Copy link
Copy Markdown
Member Author

Repairs for both REPAIR_REQUIRED reviews — head af467373d8f28c2f6feb7f7d63291ef124b87c66

All three P1 findings were reproduced against the helper and repaired in this candidate:

  1. Bare package preset (review 5641458418, P1 deps(deps-dev): bump @types/vscode from 1.118.0 to 1.120.0 in /editors/vscode in the vscode-dev-tools group #1). preset_may_name_a_file now refuses every preset except ts-jest and ts-jest/presets/<name> (no .., no nested path). Those presets set transform/testMatch only. "review-snapshot-preset", "@scope/jest-preset" and "ts-jest/../evil" read medium.
  2. Quoted key and comment mention (P1 deps(deps): bump dtolnay/rust-toolchain from 1.95 to 1.100 in the github-actions-minor-patch group #2). without_plain_inline_projects now blanks comments first, so // unit projects no longer counts as a second occurrence, and accepts "projects": and 'projects':. "projects": ["<rootDir>/pkg"] and a comment-hidden projects: [..] followed by a real path entry still read medium.
  3. Regex grouping parenthesis (comment 6393352944). A regex literal in value position inside a project (globals: { tag: /a(b)/ }) is skipped as a value, including character classes (/a(b)[)/]/i). An unterminated regex, a regex followed by rootDir, and a real call (f(/a/)) still read medium.

Evidence at this head:

  • cargo test -p ripr --lib committed_snapshot: 45 passed, with the new rows added to the existing spelling test.
  • The corpus subject authored-ts-jest-snapshot-inline-projects now carries your exact globals: { tag: /a(b)/ } property in its inline project. Real run (jest 30.5.2, ts-jest 29.4.x): the unedited package passes and amount - 10 → amount - 20 fails the snapshot. verdict-corpus check --language typescript still reads the row exposed / ideal, with 9/353 false verdicts.
  • clippy -D warnings clean; cargo xtask precommit exit 0.
  • SPEC-0258 and the typescript: a jest.config.js with projects makes a snapshot test that does catch the edit read weakly_exposed (false actionable) #10139 changelog fragment are reconciled with the new rule text.

Known limits, unchanged and recorded: computed keys built from expressions (['root'+'Dir']) and a regex written after a non-: token. Both refuse, so they keep the old medium reading.

I'm re-applying merge-ready for the required check on this head.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Same-lane repair verification: REPAIR_REQUIRED remains, for a new regression in comment blanking. The original regex finding is repaired.

Subject: head af467373d8f28c2f6feb7f7d63291ef124b87c66, tree d19eef0509ea7fe5c0496f4a0e97276be716abb7; PR API base 07e5959d4b848c90a6f1b1df3936ce380146b2a6; actual merge-base 45bd4f9a5904812b9f91f0dfa425a7e791e3b469. Inspected the six-file repair delta from the previously reviewed 1ae5e0e9, including production, test, spec and fixture changes.

[P1] CR/Unicode line terminators hide a real second delegating projects key. blank_comments, lines 469–477 ends // only at LF. For this valid JavaScript (replace <CR> with byte 0x0D):

module.exports = { projects: [{}], // first<CR> projects: ["./other.config.js"] };

JavaScript uses the second key, but the new blanking pass erases it. The helper strips the first array and admits the config. Executed exact-head CLI: the corpus source edit receives one exposed finding with a strong snapshot oracle for CR, U+2028 and U+2029. All three should retain delegation refusal. The identical LF control correctly gives one weakly_exposed / medium finding. Node evaluates all four to projects: ["./other.config.js"]; Jest 30.5.2 --showConfig on the CR case actually loads that file and resolves its rootDir: "./pkg" to the pkg directory. This is false strong credit for a default-location snapshot, introduced by the repair.

Fix direction: make blank_comments recognize LF, CR, U+2028 and U+2029, preserving the logical end of the comment as the existing skip_trivia already does. Add these delegated-config negatives through promotion/CLI tests. Confidence: high; actual CLI and Jest resolver observed.

Passed missing acceptance: the unmodified current corpus config, containing the exact globals: { tag: /a(b)/ }, now gives exposed, strong snapshot, and explicit why_not_actionable output. Also passed: both quoted keys, LF comment mentions, regex character classes, and medium refusal for rootDir, roots, a path project, unknown/scoped package presets and the LF second-project control. Thus 11/14 CLI assertions passed; the three terminator negatives failed. The quoted-key and tested package-preset examples from review 5641458418 are repaired; that is scoped reconciliation, not blanket JavaScript/configuration clearance.

Local build: cargo build --locked --offline -p ripr --bin ripr, exit 0. Executed ripr check --root <isolated-subject> --diff <ex08-diff> --json for each case (all exited 0; findings and oracle strengths were asserted). Each subject tracked its snapshot/config before the source-only mutant. Executable SHA-256: c8277ac5f83ec596ea8f3ad2174b1d1402b663948ddb414d2d136b90bcb6200c. Previous Jest baseline/mutant discrimination evidence is reused.

Hosted run 40164647045 was already executing required tests when inspected; no duplicate request or all-green claim. No implementation edits, canonical branch changes, review resolutions, Ready changes or merge. Next stays with the canonical writer: repair these terminator negatives, then refresh affected exact-head proof/review.

…s when blanking (#10139)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP

Copy link
Copy Markdown
Member Author

Line-terminator repair — head 1368e92eeca55c68dedee5d8d2ea12c52ea3d8cb

Your P1 on af467373 reproduced by reading blank_comments: it ended a // comment only at LF, so a CR, U+2028 or U+2029 after // first swallowed the real second projects: key.

Repair: one is_line_terminator helper (LF, CR, U+2028, U+2029, the same set skip_trivia uses) now ends line comments in blank_comments and the regex-literal scan, and block comments keep their terminators. The spelling test gained the three delegated-config negatives (CR, U+2028, U+2029 after // first, followed by projects: ["./other.config.js"]), each expected medium, plus a regex that runs into a CR. They run through the same strengths(...) promotion path as the other rows.

Proof at this head: cargo test -p ripr --lib committed_snapshot 45 passed, clippy -D warnings clean, cargo xtask precommit exit 0. I did not re-run the CLI controls you ran; the corpus subject is unchanged since af467373.

Re-applying merge-ready for the required check on this head.


Generated by Claude Code

@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.

Verification questions

  • Confirm the Rust spelling test is implementation-coupled and can remain green if the helper and its expected labels drift together.
  • Confirm the new scanner duplicates lexical parsing already available in skip_trivia and related helpers, increasing maintenance cost and the chance that comment, regex, and delimiter handling diverge.
  • Confirm the acceptance helper is placed at the configuration-delegation boundary, but its name and implementation model the entire projects array rather than only the accepted plain inline-object subset.
  • Confirm the corpus subject demonstrates the claimed runtime route: an inline Jest project, committed snapshot, and behavior-changing edit labeled credited/exposed.
  • Confirm the implementation uses lexical scanning rather than parsing JavaScript, so unusual valid object syntax may still be misclassified even after the listed repair cases.

Refuted

  • The documented inline-project exception says projects have no projects key, but delegates_to_other_config may also reject nested project arrays and the unit test explicitly expects medium for that spelling.
  • The unit table is only reach-only because every case resolves to a snapshot oracle.; refuted because: The table varies delegation-sensitive spellings and asserts Strong versus Medium, so it checks the analyzer's oracle-strength classification rather than merely proving code paths execute. Its limitation is independent semantic validation, not reachability.
  • The inline-projects parser could expose stale or transferred JavaScript-owned memory across an async or worker boundary.; refuted because: The changed code only scans Rust string slices, constructs owned Strings, and returns immutable owned values; no JavaScript-backed memory or concurrency handoff is involved.
  • The scanner may create a stale length snapshot, resize, detach, or transfer hazard while consuming comments and arrays.; refuted because: The implementation reads immutable Rust strings and builds a separate owned output String; it does not expose or mutate a buffer whose visible length can become stale.
  • The change could resize, detach, transfer, or otherwise invalidate an active view over the scanned buffer.; refuted because: Rejected because the implementation contains no mutable buffer, TypedArray, ArrayBuffer, unsafe pointer, resize, detach, or transfer operation; it only borrows &str slices and builds fresh owned Strings.

Evidence gaps

  • The new corpus case has a discriminating runtime oracle, but its mutant-kill evidence is supplied as fixture metadata rather than a checked-in execution trace.
  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

The required check on 1368e92e failed in cargo xtask goldens check, not in anything this PR touches. Main carries 14 fixture goldens (13 Python, rust_qualified_foreign_receiver) that lack the RIPR-SPEC-0319 Next: lines; filed as #10272 with the re-bless in #10273 (additions only). Once #10273 lands I'll merge main here and re-run the required check once.


Generated by Claude Code

@devin-ai-integration devin-ai-integration 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.

Devin Review found 2 potential issues.

Devin Review

…nts as ts-jest (#10139)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AoapkiftDmzBaXiATmb2KP

@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.

Verification questions

  • Confirm accepted inline projects may still affect snapshot resolution without containing a prohibited delegation key.
  • Confirm the corpus subject exercises the claimed runtime route: an inline Jest project, committed snapshot, and behavior-changing edit that fails the edited package.
  • Confirm the spelling unit test is implementation-coupled: helper and expected labels can drift together.
  • Confirm the implementation uses a hand-written lexical scanner for valid JavaScript objects; unusual syntax not represented in the table may be misclassified.

Refuted

  • The helper might retain borrowed references tied to a temporary reconstructed String and expose a stale-length or buffer-transfer hazard.; refuted because: All borrowed slices are local to string construction; no reference or mutable buffer escapes. The function returns an owned String, and the change contains no detach, resize, transfer, unsafe, or concurrency operation.
  • The new scanner could expose snapshot data across a runtime or worker-handoff boundary through stale or aliased native state.; refuted because: The changed seam performs ordinary owned string manipulation and returns plain Rust values; it neither shares buffers between threads nor crosses a runtime boundary with borrowed state.
  • The quoted displayName value "projects" is a newly introduced false-positive requiring a fix in this PR.; refuted because: The seeded thread records that the shared mentions_named_key behavior predates this change, and #10295 owns that separate scanner improvement; broadening this PR to rewrite shared key recognition would exceed its one-production-behavior scope.
  • The scanner may return borrowed references tied to a temporary reconstructed String.; refuted because: The implementation returns Option by value. Borrowed slices are temporary inputs to formatting and never escape; there is no live mutable backing store whose size could later become stale.

Evidence gaps

  • A base-plus-tests control is not evidenced for the new corpus case.
  • Model proof intent was rejected by deterministic validation.

Parked follow-ups

  • The quoted-value false-positive such as displayName: "projects" affects shared key scanners beyond this PR's new helper; the seeded thread records it as known behavior owned by #10295.
  • The implementation duplicates lexical responsibilities already present in nearby trivia, comment, string, and delimiter handling, creating a maintenance divergence risk.

Copy link
Copy Markdown
Member Author

Review of record — head 23e94744140e0406e77245c6df4e6223f93056b1

Angles: parser fail-closed behaviour (preset, key spelling, comments, regex, line terminators); tests, SPEC-0258 and corpus parity; hosted proof.

Findings and resolutions across the PR's life:

  • Steven's reviews on 1ae5e0e9 and af467373 (bare package preset, quoted key and comment mention, regex with parentheses, CR/U+2028/U+2029 ending a // comment): all repaired, each with test rows, and answered on the PR.
  • Devin on acb56721 (red: preset: "ts-jest" && "./custom.js" read as ts-jest): repaired in 23e94744, with test rows; thread answered and resolved.
  • Devin (yellow: a displayName: "projects" label refuses to medium): fail-closed and shared with mentions_named_key; filed as typescript: key scanner reads the word projects/root/workspace inside a string value as a delegating key #10295, thread answered and resolved.
  • github-actions and Gemini reviews: verification questions and rate-limit notices only; nothing blocking. CodeRabbit was rate-limited, so it gave no review; that is not a clean review.

Proof at this head: required Ripr Rust Small Result succeeded (run 40178994966, includes the goldens check against current main feea3789); cargo test -p ripr --lib committed_snapshot 45 passed, clippy -D warnings clean and cargo xtask precommit exit 0 on the code at this head; the corpus subject reads exposed / ideal and the real jest run fails on the edited package. All review threads are resolved.

Known limits, recorded: computed keys built from expressions (['root'+'Dir']), and #10295 (the word projects inside a string value).

Disposition: nothing blocking. Merging by squash on this exact head.


Generated by Claude Code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

typescript: a jest.config.js with projects makes a snapshot test that does catch the edit read weakly_exposed (false actionable)

2 participants