Skip to content

fix(oracle-gaps): scope mutant anchors to declarations outside statement range - #196

Open
schiller-manuel wants to merge 1 commit into
mainfrom
fix/oracle-gaps-anchor-params
Open

schiller-manuel wants to merge 1 commit into
mainfrom
fix/oracle-gaps-anchor-params

Conversation

@schiller-manuel

Copy link
Copy Markdown

Summary

  • Fixes anchorOf in packages/oracles/oracle-gaps/schemata.mjs so mutants outside TypeScript's FirstStatement..LastStatement range no longer walk up to SourceFile and dump the entire file's tokens into mutant.anchor and mutant.key.
  • Stops at ts.isStatement (covering ExportAssignment alongside ordinary statements) and tight enclosing declarations: Parameter, PropertyDeclaration (including auto-accessors), EnumMember, Decorator, HeritageClause, ClassStaticBlockDeclaration, Accessor, and computed member names on class elements / methods / accessors.
  • Adds focused regression coverage in packages/oracles/tests/oracle-gaps-anchor.test.ts verifying tight, stable anchors for default parameters, class fields, decorators, heritage clauses, computed member names, enum members, and export default.

Validation

  • pnpm run build — passed
  • pnpm run typecheck — passed
  • pnpm run lint:check — passed
  • pnpm run format:check — passed
  • pnpm --filter @tanstack/oracles run test — 9 files, 120 tests passed
  • pnpm --filter @tanstack/oracles run test:oracle-gaps:fast — 5 files, 33,899 tests passed
  • pnpm --filter @tanstack/oracles run test:oracle-gaps:shards — 5 shards partitioned
  • pnpm --filter @tanstack/oracles run test:pr-shards — 7 partitions verified

…ent range

anchorOf() previously checked only FirstStatement..LastStatement, which
excludes Parameter, PropertyDeclaration, EnumMember, Decorator,
HeritageClause, ComputedPropertyName, and ExportAssignment. Mutants inside
default parameter initializers or class field initializers walked all the way
to SourceFile, dumping the entire file into mutant.anchor and mutant.key.

Stop at statements (via ts.isStatement) and small enclosing declarations
(parameters, property declarations, enum members, decorators, heritage
clauses, class static blocks, accessors, and computed member names), and add
regression tests covering tight anchors and edit stability.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Nov 23, 2026

Copy link
Copy Markdown

Warning

Review limit reached

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

Next included review available in 34 minutes.

Check out review usage here.

View limit details

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

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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c36e1736-24d0-4300-b806-f94a9632dfa0
Commits

Reviewing files that changed from the base of the PR and between 7b6bae1 and cbd90f0.

Files selected for processing: 3

  • packages/oracles/oracle-gaps/report.mjs
  • packages/oracles/oracle-gaps/schemata.mjs
  • packages/oracles/tests/oracle-gaps-anchor.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@changeset-bot

changeset-bot Bot commented Nov 23, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: cbd90f0

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

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.

1 participant