oracle-gaps: mutant copies resolve bare imports from --package, not from the original file (288 setup-errors)

Open
#68 1 comment 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
40/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Start at check.mjs near line 1007, where mutant copies are said to resolve imports like the original file, and at the wrapper plugin's resolveId and load hooks that serve those copies. Reproduce by running oracle-gaps against the tests/realtime-oracles oracle file, which should fail with 'Cannot find package fast-check'. Done means copies resolve bare imports from the original file's directory or baseline refuses early, and setup errors are excluded from the gap count and get their own directive.

Written by the indexing model from the issue text.

Description

Reported from an adopter's first session, at c58b0c2. Not yet reproduced here.

Problem. 288 of 388 mutants were setup-error: "Cannot find package 'fast-check' imported from tests/realtime-oracles/src/.oracle-gaps-5482-10-ordered-live-results.oracle.test.ts". The baseline loads the same import from tests/realtime-oracles/node_modules/fast-check. The comment at check.mjs:1007 says copies are placed beside the file "so that its imports resolve as the file's do". But the copy is virtual: the wrapper plugin serves it through resolveId and load. So its bare imports seem to resolve from --package, the repo root, which has no fast-check.

Two more problems follow from that:

  • setup errors count toward the headline gap count, which came out as 307 gaps;
  • they get the directive "Run an owner test that loads this module", which doesn't apply.

Proposal.

  • Resolve a copy's imports from the original file's directory. Alternatively, refuse at baseline when the oracle file's imports don't resolve from --package.
  • Either way, keep setup errors out of the gap count. A harness failure stops the run and is never charged to a mutant (decision LA-v20-1, cleanup plan Phase 2 A2). Give them their own directive.

This issue was written by Isaac.

Dominant language
JavaScript
Stars
5
Forks
1
Avg merge
6h
Merged PRs (30d)
56

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from TanStack/oracles

All issues in TanStack/oracles

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.