Skip to content

[P0] Stabilize the complete Vitest suite and protected CI merge gate #654

Description

@mohanagy

Parent: #649
Blocks merge of: every roadmap implementation issue

Outcome

Make the complete test suite a reliable, reproducible merge gate on supported environments.

No roadmap PR may be described as merge-ready while the complete suite can time out, fail to start workers, or fail to terminate for unexplained reasons.

Verified baseline evidence

At 06b373a447acfce895412ac10eb4e5228c5df0b7:

  • build passed;
  • typecheck passed;
  • 206 focused tests passed;
  • a broader run under Node 22.22.3 ended with one timeout and worker-start failures;
  • 530 tests passed before the run ended;
  • the timed-out benchmark test passed alone with --maxWorkers=1 in roughly three seconds.

Observed affected tests included:

  • tests/unit/compare-native-agent.test.ts near the previously identified timeout;
  • tests/unit/extract-frameworks.test.ts worker startup;
  • tests/unit/retrieve.test.ts worker startup;
  • tests/unit/stdio-server.test.ts worker startup.

This points to suite-level resource pressure, worker scheduling, ordering/global state, filesystem/process contention, or a lingering handle. It is not yet proof of any one cause.

Reference environment

Use and record:

  • Node 22.22.3 or a repository-supported equivalent recent Node 20/22 patch line;
  • npm 12.0.1 or the lock-compatible package manager version;
  • exact package-lock.json;
  • audited lock SHA-256: 0144eb0ddf92f78c69f10089d0e0414485594966ff5be4f36f655c7aa5cff53e.

Node 22.9.0 is not an acceptable qualification environment because locked tooling requires a newer patch line.

Scope

  1. Reproduce the failure on a clean checkout with exact logs, environment, process/memory observations, and test ordering.
  2. Determine whether the cause is:
    • four-worker resource pressure;
    • worker startup starvation;
    • global state or ordering interaction;
    • filesystem/process contention;
    • lingering handles or child processes;
    • benchmark harness behavior;
    • platform-specific behavior;
    • another evidenced cause.
  3. Add the smallest safe correction.
  4. Preserve or improve parallelism rather than hiding the defect globally.
  5. Add diagnostic output sufficient to identify future worker-start or nontermination failures.
  6. Verify protected CI on the supported Node/OS matrix.

Explicit non-goals

  • Do not increase global timeouts merely to hide contention.
  • Do not permanently force the entire suite to --maxWorkers=1 without evidence that this is the correct supported policy.
  • Do not skip, quarantine, or weaken assertions for the affected tests merely to produce green output.
  • Do not retry until a run happens to pass and call the issue resolved.
  • Do not mix graph, retrieval, Pack, extraction, or product behavior changes into this issue.
  • Do not expand the supported Node claim beyond what the locked toolchain actually supports.

Investigation requirements

Capture for every failed attempt:

  • exact commit;
  • OS/architecture;
  • Node/npm versions;
  • lock checksum;
  • command and Vitest options;
  • worker count;
  • peak memory/process observations where practical;
  • full stderr/stdout;
  • failed or unstarted test files;
  • whether affected tests pass independently;
  • whether order changes the result;
  • whether the process exits cleanly.

Use binary-search or grouped test runs where useful. Any suspected open handle must be demonstrated rather than inferred from nontermination alone.

Acceptance criteria

  • Root cause is documented with reproducible evidence.
  • The correction is narrowly scoped and does not weaken test semantics.
  • Three consecutive complete local runs succeed under the pinned reference environment, or a documented local-resource distinction is established and the complete protected CI matrix succeeds repeatedly.
  • No worker-start errors occur.
  • No unexplained timeout or nontermination remains.
  • Focused affected tests still pass independently and as part of the full suite.
  • Exact failing logs from the original and corrected runs are retained in the issue/PR artifacts.
  • Supported Node documentation and package/tooling constraints agree.
  • The repository has one authoritative complete-suite command used by protected CI.

Validation

At minimum run:

npm ci
npm run typecheck
npm run build
npm run test:run
npm run test:coverage
npm run verify:pack-parity
npm pack --dry-run
npm run registry:validate
npm run release:verify

Also run the affected files alone and in the grouping that originally reproduced the failure.

Agent execution contract

  • Begin from a clean supported environment.
  • Do not modify product semantics.
  • Stop and report when the evidence contradicts the working hypothesis.
  • Return exact commands, logs, files changed, before/after behavior, and remaining uncertainty.

Closure rule

Close only when the complete suite is a trustworthy protected merge gate, not merely when one local run passes.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions