Skip to content

fix(ci): isolate dependency diagnostic installations - #4038

Merged
schlessera merged 2 commits into
mainfrom
fix/1980-diagnostic-install-isolation
Nov 16, 2026
Merged

schlessera merged 2 commits into
mainfrom
fix/1980-diagnostic-install-isolation

Conversation

@schlessera

@schlessera schlessera commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Closes #1980

What changed

Dependency diagnostics now have a preparation command that refuses an existing installation, installs the unchanged lock through a fresh private cache with independent file copies, and cleans up only that cache. Contributor, experiment-tier and native-qualification recovery guidance use it. The guide preserves the reported modified/registry chunk, integrity and inode evidence with its historical limits.

Why this shape

A separate worktree and frozen lock do not isolate Bun hardlinks or establish installed-byte provenance. Copyfile from a modified cache preserves modified bytes. The command sets both the cache environment variable and flag because the inherited environment can override the flag. This is scoped repository tooling; package versions, locks, qualification pins, product behavior and offline gates are unchanged. No consumer-visible changeset is needed.

Proof

  • Bun 1.4.4 on Linux: actual loopback registry/archive/install fixture inside a verified separate network namespace. Unsafe hardlinks propagate a diagnostic write; a single-link copy still has wrong bytes. Two independent preparations download the trusted archive despite the deliberately modified cache, preserve package/lock inputs and isolate writes. A valid altered archive fails integrity verification. Existing-install refusal preserves evidence; temporary caches are removed on success and failure.
  • Failing-first/cache mutation: omitting BUN_INSTALL_CACHE_DIR from preparation fails the fresh-download assertion in diagnostic installs avoid modified cache bytes and isolate diagnostic edits. Restoring it passes. This reproduces the missing cache isolation of the earlier flag-only recovery under an inherited cache environment.
  • Refusal mutation: replacing the existing-install condition with false fails the same named test at assert.equal(refusedExit, 1) (actual 0); restoring it passes. The initial synchronous mutation probe deadlocked its loopback server and timed out; that is not claimed as mutation proof. The fixture now awaits the installer asynchronously and the receipt above fails on the intended assertion.
  • Restored focused proof: bun run test ./tests/diagnostic-install.test.ts ./tests/experiment-tier.test.ts ./tests/native-diagram-inputs.test.ts: 30 pass, 0 fail, 63,051 expectations. Frozen native qualification passes without changing its pins.
  • NODE_OPTIONS=--max-old-space-size=8192 bun run typecheck: passed. The initial default-heap run exhausted Node's 2 GiB heap; no source errors were reported.
  • The initial worktree had no dependencies. Initial preflight module-load failures are not regression evidence. A fresh full install encountered an extraction quota error and was preserved; preparing again with a workspace-backed temporary cache succeeded, followed by the restored focused proof above.
  • sh -n scripts/prepare-diagnostic-install.sh and git diff --check: passed.
{"version":1,"kind":"brain-check-pr-receipt","head":"1727dc77d5d70aa5ccc56759d14cc67dec205ce9","base":"origin/main","mode":"focused","startedAt":"2026-11-15T19:53:24.365Z","finishedAt":"2026-11-15T19:55:00.160Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":21475.891261},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":124.6983880000007},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":114.79039100000227},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":17.4739840000002},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":74041.653573}]}

Guard containment

Only preparation with an existing node_modules triggers the new refusal; it does not assert unknown bytes are clean or restrict other worktrees. In-place reuse cannot establish pristine inputs, so a restricted reuse mode would be misleading. The owner preserves evidence and moves aside only the owned installation, after which preparation proceeds automatically; no credential or human-only action is required. The cause and recovery are printed to stderr for the command receipt, and documented in the diagnostic guide. The fixture refuses one installation while preserving the independent second installation and shared fixture cache. Install failures propagate their exit code and remove only the invocation's cache.

Checklist

  • Focused local behavioral and restored mutation receipts recorded; hosted candidate confirmation belongs to the orchestrator.
  • Acceptance criteria are met locally.
  • Release milestone: 0.45.0 on PR and issue (read back before handoff).
  • No consumer-visible changeset or integration-contract change.
  • No personal data; local paths and diagnostic output remain outside public text.
  • Documentation and recovery guidance updated.
  • Guard containment answered above.
  • Provider history untouched.

Collision check

bun scripts/collisions.ts --json --pr 4038 at head 1727dc77d5d70aa5ccc56759d14cc67dec205ce9: graph built at 1727dc77d5d70aa5ccc56759d14cc67dec205ce9.

Shared proof closures are detection, not ownership. No competing implementation of #1980 was found. The orchestrator should reconcile overlapping paths if those candidates land first.

Anything left open

Hosted confirmation and landing are owned by the orchestrator. No follow-up issues filed; no historical browser/provider suite is requalified by this fixture.

@schlessera schlessera added this to the 0.45.0 milestone Nov 15, 2026
@schlessera schlessera added type: fix Something is broken and must behave the way it is documented. area: ci CI workflows, the gates they run, release scripts, packaging. labels Nov 15, 2026
This was referenced Nov 15, 2026
@schlessera
schlessera marked this pull request as ready for review November 16, 2026 02:57
@schlessera
schlessera merged commit bea505a into main Nov 16, 2026
51 of 52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, the gates they run, release scripts, packaging. type: fix Something is broken and must behave the way it is documented.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci: isolate diagnostic dependency edits from the shared install cache

1 participant