Stabilize changed-test runs by giving the engine affected Vitest lane its own memory envelope.
- Split @fusion/engine out from other scoped affected-package Vitest runs.
- Apply a capped heap and single-worker settings to the isolated engine lane while preserving watchdog timing.
- Cover the partitioning and environment behavior with script tests and document the envelope.
Files changed:
docs/testing.md | 3 +++
scripts/__tests__/test-changed.test.mjs | 45 +++++++++++++++++++++++++++++++++
scripts/test-changed.mjs | 40 ++++++++++++++++++++++++++---
3 files changed, 84 insertions(+), 4 deletions(-)
Fusion-Task-Id: FN-6854
Fusion-Task-Lineage: 144acf15-4ccb-4974-b06c-99cdcc2814dd
Affected packages with a vitest config now run `vitest run --changed <base>`
(only tests in the changed files' module graph) under the tight "changed"
watchdog, instead of each package's ENTIRE suite under a 60-min backstop.
Packages without a vitest config fall back to their full `test` script. The
curated gate suite still runs as the cross-cutting safety net.
Measured: a dashboard hub-component change drops from 822 files (5-8min) to
40 files (~98s wall incl. gate). Common/leaf changes scope to far fewer.
NOT yet <60s for hub-component changes — the fixed jsdom/setup floor still
dominates (needs the overhead-reduction follow-up), and one scoped-run test
failure needs isolation triage before this gates verification.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
scripts/lib/test-quarantine.json is runtime data (which tests are
quarantined), not executable test infra, but it tripped the shared-infra
catch-all in isSharedInfraChange. That forced mode=gate, which runs only
the fixed engine-core + cli-shape gate suite and returns before the
affected packages -- so a dev's real changes (e.g. @fusion/core,
@fusion/dashboard) got zero coverage whenever they also touched the
quarantine list. Classify the file as test-irrelevant so the diff stays
in changed mode and the affected packages run.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Normalize spawned Vitest processes to NODE_ENV=test so React/jsdom lanes do not inherit release-shell production mode. Split the compound-engineering plugin Vitest projects so Node-only setup and teardown only run in Node lanes, and quarantine the remaining broad-lane CE timeout flakes under the deletion ratchet.
- watchdog: escalate forwarded SIGINT/SIGTERM/SIGHUP to SIGKILL after grace so
external cancellation can't hang for the full budget (coderabbit major)
- watchdog: route onProcExit through signalGroup for injection consistency (greptile)
- watchdog: add cwd option; test-changed passes rootDir so pnpm runs from repo
root regardless of invocation cwd (coderabbit major — preserved original run() cwd)
- dashboard runner: validate/clamp FUSION_RUN_VITEST_* env so a malformed value
can't NaN-disable the watchdog (coderabbit)
- tests: verify exit-listener cleanup, forwarded-signal escalation, cwd passthrough
- plan doc: per-class-ceiling fallback wording (not median); label Output Structure fence
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Adds bounded retry handling so stale Fusion test temp roots are reclaimed instead of leaking after transient removal failures.
- Share prefix-scoped pruning between isolated HOME and worker temp roots.
- Retry rm-rf on transient busy/non-empty failures and treat ENOENT as successful cleanup.
- Warn once with bounded child diagnostics after persistent prune failures.
- Cover worker and home pruning retry, failure, and ENOENT behavior in script tests.
Files changed:
scripts/__tests__/test-changed.test.mjs | 118 ++++++++++++++++++++++++++++++++
scripts/test-changed.mjs | 84 ++++++++++++++---------
2 files changed, 168 insertions(+), 34 deletions(-)
Fusion-Task-Id: FN-6371
Fusion-Task-Lineage: a81e6849-5eb0-4bc0-8030-9f8eaed4e35a
Convert test-changed.mjs's invocation path from blocking spawnSync to async
spawn through the shared watchdog. runWatchedTest throws on failure/timeout with
.exitCode so the existing catch and the runMaybeIsolated finally (prune +
isolation post-check) still run — a watchdog kill reaps any leaked isolated HOME
instead of leaving it for the guard to flag. Full/affected runs use a generous
60min backstop (dashboard lanes are already inner-watchdog'd); the quick gate
uses the changed-class ceiling.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
- boot-smoke: shutdown verdict now requires SIGTERM actually delivered and a
clean exit (code 0 or SIGTERM); EADDRINUSE port race retries with a fresh
port (3 attempts)
- test-changed: rename shouldForceFullSuite -> isSharedInfraChange (it routes
to gate mode, not full); run the changed-mode gate under the isolation guard
- workflows: least-privilege permissions (contents: read) on pr-checks and
full-suite
- decideExecutionPlan: implicit wide-blast reasons (missing base, diff failed,
no changes, shared infra, unmapped package) route to new gate mode instead of full
- CI===true force-full branch removed (CI no longer calls test-changed.mjs)
- changed mode runs pnpm test:gate before the affected set
- full suite reachable only via explicit --full / FUSION_TEST_FULL=1
- characterization tests updated + new only-explicit-full invariant test
- content-hash: createRepoContentSnapshot — 2 repo-wide git spawns shared across all hash computations (was ~2 spawns x N packages x 2 passes, ~0.6-1.6s per cache-miss run); snapshot-equivalence test pins zero-spawn path
- test-changed: one hash memo + snapshot shared between applyCacheToPlan and recordCachePass (record pass now re-hashes nothing)
- ci-test-shard: listPackageTestFiles single source of truth for the test-file glob (was triplicated)
- check-test-inventory: curatedProjects defaults to projects (removes duplicated 11-entry list in spec)
- ensure-test-artifacts: drop detectMissingArtifacts passthrough alias
- drop dead statSync re-export; cross-reference comments on the two shared-input path lists
Skipped deliberately: --cold-start-probe/--check-timings-staleness removal (plan artifacts for U8 re-eval + scheduled refresh), best-fit dedup + threshold² (behavior-preserving refactor of verified shard math — follow-up), worker-budget duplication (pre-existing on main)
Added GitHub create-PR metadata and preflight routes to the dashboard, wiring up `submit-github.pr-options-preflight-metadata` contract and integration tests for the new preflight/confirm flow alongside supporting test configuration updates.
Fusion-Task-Id: FN-5144
Adds a regression test for FN-5124 covering soft-delete QA boundary cases, targeting the engine reliability interaction suite. The single new test file exercises edge conditions in the soft-delete path to guard against future regressions.
Fusion-Task-Id: FN-5124
Fusion-Task-Lineage: 7166e252-9c98-4f51-956a-1402dae6f402
- Harden test isolation cleanup retries and allow-list behavior in scripts/test-changed.mjs
- Expand test coverage for cleanup retry logic and allow-list handling in scripts/__tests__/test-changed.test.mjs
- Add shell-native connection status plumbing and UI coverage across dashboard, desktop preload/types, and mobile typings
- Add ShellConnectionStatus and mobile nav wiring plus related app/component test coverage
- Document shell connection contracts and add FN-3568 diagnosis/recovery notes
Fusion-Task-Id: FN-3723
Adds a `--accent-text` CSS token defined per theme for consistent chat text readability, and highlights the fast mode bolt icon in the task detail modal, with corresponding theme-color and rendering tests.
Fusion-Task-Id: FN-3725
Adds a new `useShellContext` hook with tests to the dashboard, integrated into `App.tsx` and `Header.tsx` to provide shell context plumbing throughout the UI.
Fusion-Task-Id: FN-3406
The leak guard in scripts/check-test-isolation.mjs reported
fusion-test-home-root-* dirs created by scripts/test-changed.mjs as
leaks when transient EBUSY on /var/folders prevented cleanup or the
baseline file got rotated. Track every HOME basename the script mints
and pass it via FUSION_TEST_ISOLATION_IGNORE_NAMES so the check
allow-lists them unconditionally. Surface cleanup rm failures via
console.warn instead of swallowing.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Adds a native shell integration guide (FN-3577) with fusionShell bridge contract documentation, wired into the docs navigation, plus a regression test; also hardens the dependency graph's task filtering (FN-3085) to include in-review tasks and handle orphan edges, with corresponding test coverage ac
Fusion-Task-Id: FN-3577
Removes the `QuickEntryBox` component and its styles as part of FN-3632 cleanup, with its tests refactored accordingly. Also updates the test-changed script and fixes an isolated test home cleanup ordering issue.
Fusion-Task-Id: FN-3632
Implements a distributed task-ID allocator with mesh networking endpoints for multi-project coordination (FN-3449), alongside substantial ChatView and GitManager mobile polish including improved iOS keyboard handling, rubber-band containment, scroll-drift fixes, and visual viewport stabilization. In
Fusion-Task-Id: FN-3449
- Create a disposable HOME/USERPROFILE env for scripts/test-changed.mjs execution
- Run isolation guard checks with the same isolated env, including cache-hit no-op paths
- Clean up temp HOME after test execution to avoid residue
- Update test coverage and contributing docs for the shared isolation behavior
Fusion-Task-Id: FN-3610
- Expand test-changed coverage and shard selection assertions for CI workflows
- Improve vitest worker temp-directory utilities and related core/CLI tests
- Refine test isolation guardrails and runtime ignore handling for live .fusion noise
- Update contributing guidance and root test script usage for the verified workflow
Fusion-Task-Id: FN-3607
Documents the live reviewer override behavior in the settings reference and task management guides, adding two lines to each file for a total of 4 lines of documentation.
Fusion-Task-Id: FN-3595
This merge lands five FN-3593 commits establishing a test isolation contract with a new `scripts/check-test-isolation.mjs` guard that scans for accidental `beforeEach`/`afterEach`/`beforeAll`/`afterAll` in setup helpers, plus per-package `setup-test-isolation.ts` bootstraps that canonicalize the pat
Fusion-Task-Id: FN-3593
Merges FN-3470 in two steps: first, runtime plugins now prefer source path aliases over build artifacts, with hardening tests for vitest alias resolution and plugin view registry updates; second, a new `ensure-test-artifacts.mjs` bootstrap script guarantees required test files exist before test runs
Fusion-Task-Id: FN-3470
This merge refactors the test-changed script and adds new CLI tests (FN-3234), keeping automation on the full-suite path. It includes a new test file for the root test command, updates to the CI workflow, and documentation improvements.
Fusion-Task-Id: FN-3234