Skip to content

Add --timeout, keep sandbox writes out of the real node_modules, release 0.1.1 - #3

Merged
flipcyde101 merged 6 commits into
mainfrom
work/killdiff-timeout-20261129
Nov 29, 2026
Merged

flipcyde101 merged 6 commits into
mainfrom
work/killdiff-timeout-20261129

Conversation

@flipcyde101

@flipcyde101 flipcyde101 commented Nov 29, 2026 •

Copy link
Copy Markdown
Owner

Changes

  • --timeout <ms> (CLI) and timeoutMs (MCP verify_diff_tests) set the limit for the baseline run and each mutant run, 1000 to 86400000 ms. A baseline timeout now reports the limit and names the option. Defaults are unchanged.
  • pnpm projects: a run could rewrite the clone's workspace links through the linked node_modules, leaving them dangling after the sandbox was deleted. Each pnpm sandbox now has its own node_modules structure, pnpm's install-before-run check is off, and links are removed without following them. npm and Yarn layouts link node_modules as before.
  • Rust and Maven: target folders are no longer shared, CARGO_TARGET_DIR is always inside the sandbox, and mutants run one at a time because every sandbox builds from scratch.
  • Sandboxes are built and removed asynchronously.
  • SARIF output reports the released version. Version 0.1.1.

Still shared (documented in the README)

Package contents are links to the real install. Outside pnpm, tool caches such as node_modules/.vite are shared and npm or Yarn workspace packages imported through node_modules resolve to unmutated originals. In pnpm, a stored dependency that loads a workspace package gets the original.

Tests

  • npm test: 37 of 37 on Windows with Node 24.19; tsc --noEmit clean.
  • Local reproductions: a pnpm 12.21 workspace (clone node_modules unchanged), Cargo crates with a plain and a configured target directory (both unchanged, no false timeouts), and a 600-package pnpm layout (no false timeouts).
  • Two independent review passes covered commits through 3e080e2. The three later commits (test path fixes, the Cargo fixes, version strings) have not had an independent review.

flipcyde101 and others added 6 commits November 29, 2026 12:25
--timeout <ms> sets the limit for the baseline run and each mutant run
(1000..86400000 ms). A baseline timeout now reports the limit and names
the option instead of a generic baseline failure.

Sandboxes used to link the whole node_modules directory. In a pnpm
workspace, pnpm's pre-run install inside the sandbox rewrote the real
tree through that link: workspace links were re-pointed into the
sandbox, which killdiff then deleted, leaving the clone's links
dangling. pnpm 12 also refuses to run under a linked node_modules, and
workspace links kept pointing at the unmutated original packages.

Each sandbox now rebuilds node_modules (and .pnpm, scopes and nested
node_modules) as its own directories, links package contents, copies
pnpm state directories, and re-points links that target the repository
at the sandbox copy. Cleanup unlinks every link before removing the
sandbox, so it never follows a link.

Reproduced on a disposable pnpm 12.21 workspace: before, the clone's
packages/app/node_modules/@fx/core pointed into a deleted sandbox and
its tests failed; after, node_modules is unchanged and the workspace
mutant is killed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
verify_diff_tests takes timeoutMs with the same 1000..86400000 bounds
as --timeout, shared from the runner. Version 0.1.1 and changelog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nously

From independent review of the 0.1.1 candidate:

- Rust and Maven target directories are no longer linked into sandboxes,
  so binaries built from a mutant cannot stay in the real target/. A
  CARGO_TARGET_DIR from the environment is redirected into the sandbox.
- Only pnpm projects get a rebuilt node_modules (one link per .pnpm
  store entry, empty tool caches). npm and Yarn layouts link
  node_modules as before.
- pnpm's install-before-run check is off for sandbox runs.
- Sandbox creation and removal are asynchronous, so one worker's setup
  cannot push another worker into a false timeout.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rially

From the re-review:

- A target-dir in a Cargo config file still pointed sandboxes at a shared
  directory. CARGO_TARGET_DIR is now always set inside the sandbox.
- Parallel from-scratch builds could exceed 2.5x the solo baseline and
  report TIMEOUT as a kill. Rust and Maven projects run one mutant at a
  time.
- README and CHANGELOG state what is still shared, including the pnpm
  case where a stored dependency loads the original workspace package.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@sonarqubecloud

Copy link
Copy Markdown

@flipcyde101
flipcyde101 merged commit 8114f79 into main Nov 29, 2026
5 checks passed
@flipcyde101 flipcyde101 mentioned this pull request Nov 30, 2026
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