Commit Graph

120 Commits

Author SHA1 Message Date
gsxdsm
70d7dcaa6c FN-7290: skip unchanged plugin builds
Add a git-backed plugin build cache to make root workspace builds skip safe unchanged plugin packages.

- Route root pnpm build through a workspace build planner that always builds non-plugin packages and selectively skips cached plugin packages.
- Hash plugin inputs with declared local workspace dependencies plus root build tooling/config and require dist outputs before skipping.
- Cover cache planning and invalidation behavior with script tests and document the operator-facing build behavior.

Files changed:
 .changeset/fn-7290-plugin-build-cache.md   |   7 +
 docs/testing.md                            |   5 +-
 package.json                               |   2 +-
 scripts/__tests__/build-workspace.test.mjs | 253 +++++++++++++++++
 scripts/build-workspace.mjs                | 427 +++++++++++++++++++++++++++++
 5 files changed, 692 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-7290

Fusion-Task-Lineage: a91861c7-385d-4e9c-bc43-11ed0ff188c8

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-30 11:08:55 -07:00
gsxdsm
94ddfe1064 FN-7274: document workflow tools in Fusion skill
Document the workflow-authoring tool surface in the packaged Fusion skill references.

- Add workflow tools to the generated Fusion skill category and capability tables.
- Teach the skill sync script to read workflow tool specs from extension and engine agent tool sources.
- Cover workflow tool documentation and cache inputs with sync tests.
- Add a changeset for the published CLI skill update.

Files changed:
 .changeset/fn-7274-workflow-skill-tools.md         |   7 +
 packages/cli/skill/fusion/SKILL.md                 |   1 +
 .../cli/skill/fusion/references/engine-tools.md    |   4 +-
 .../cli/skill/fusion/references/extension-tools.md |  83 +++++++++-
 .../skill/fusion/references/fusion-capabilities.md |   8 +
 packages/cli/src/__tests__/skill-sync.test.ts      |  60 ++++++-
 scripts/__tests__/skill-sync-cache.test.mjs        |   5 +
 scripts/sync-fusion-skill-tools.mjs                | 172 ++++++++++++++++++---
 8 files changed, 312 insertions(+), 28 deletions(-)

Fusion-Task-Id: FN-7274

Fusion-Task-Lineage: e1cd6bd8-aecc-49ca-96ed-a937a15a18a4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-30 08:04:12 -07:00
gsxdsm
f42b49ab2d FN-7105: add CI print-mode regression guard
Add regression coverage ensuring CI=true no longer forces test-changed into full-suite mode.

- Add a reusable --print-mode subprocess helper for synthetic test-changed repositories.
- Seed the synthetic repo with changeset config so mode decisions match workspace expectations.
- Assert CI=true stays in gate or changed mode while --full and FUSION_TEST_FULL still select full mode.

Files changed:
 scripts/__tests__/test-changed.test.mjs | 54 +++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Fusion-Task-Id: FN-7105

Fusion-Task-Lineage: f4a26d96-3992-4f25-a456-04f2b9b8a4dc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 09:28:30 -07:00
gsxdsm
af8cc7b29c FN-7079: Correct quarantine baseline reporting
Correct the velocity baseline to reflect an empty quarantine ledger and cover that report-only path.

- Update the published test velocity baseline quarantine totals, buckets, trend row, and #leads summary to zero.
- Add a regression test that regenerates the report from an empty live quarantine ledger without measuring lanes.
- Assert deletion-due and bucket rows stay zero and stale nonzero quarantine text is removed.

Files changed:
 docs/test-velocity-baseline.md                    | 10 ++--
 scripts/__tests__/test-velocity-baseline.test.mjs | 72 ++++++++++++++++++++++-
 2 files changed, 76 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-7079

Fusion-Task-Lineage: d641adc3-f991-4d95-bcb2-7b20bbfeb0bb
2026-06-26 15:50:40 -07:00
gsxdsm
29aee2196a FN-7051: restore verify:fast prerequisite builds
Restore verify:fast so fresh worktrees prepare required artifacts before boot smoke.\n\n- Bootstrap missing or stale workspace dist artifacts before scoped verification.\n- Always build @runfusion/fusion for source-checkout boot smoke, even when no package diff maps to the CLI.\n- Update verify:fast tests and docs to capture the prerequisite build flow.\n\nFiles changed:\n AGENTS.md                              |  4 +-\n docs/testing.md                        |  5 +-\n scripts/__tests__/verify-fast.test.mjs | 29 +++++++++--\n scripts/verify-fast.mjs                | 92 ++++++++++++++++++++++++++--------\n 4 files changed, 101 insertions(+), 29 deletions(-)

Fusion-Task-Id: FN-7051

Fusion-Task-Lineage: b8980f15-0103-4f40-9f8d-83907461988a
2026-06-26 01:10:00 -07:00
gsxdsm
1699c60033 fix: anchor rootDir at the git toplevel so subdir runs don't skip tests (#1785)
greptile: my earlier existence-check anchor was necessary but insufficient.
`rootDir` (= process.cwd() when FUSION_PROJECT_DIR is unset) drives ALL workspace
discovery (readWorkspacePatterns / listWorkspacePackageInfos /
packageHasVitestConfig). Launched from a package subdir, cwd-based discovery
found no packages, so decideExecutionPlan saw "no affected package", ran only the
gate, and exited successfully WITHOUT running the live changed package tests.

Fix the root cause: resolveRepoRoot() resolves the git toplevel as the fallback
(FUSION_PROJECT_DIR still the explicit override; cwd only when git can't report a
toplevel). This is correct from any cwd inside the repo, including a git worktree
(how the engine runs per-task verification). repoRootForExistence is now
redundant and removed; the existence check defaults back to rootDir.

Demonstrated: resolveRepoRoot() from packages/core (no FUSION_PROJECT_DIR) now
resolves the repo root and finds the workspace. +1 regression test. 121/121.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:56:10 -07:00
gsxdsm
e29954e50d Merge remote-tracking branch 'origin/main' into feature/tasks-take-too-long
# Conflicts:
#	scripts/__tests__/test-changed.test.mjs
2026-06-25 22:41:18 -07:00
gsxdsm
c36f234da2 Address PR review feedback (#1785)
- P2 (greptile): anchor the changed-test existence check at the git repo root
  (repoRootForExistence via `git rev-parse --show-toplevel`) instead of rootDir,
  so a script run from a package subdir without FUSION_PROJECT_DIR no longer
  forms a doubled path and silently drops live tests into the delegate path.
  +1 regression test (default root resolves to repo root).
- coderabbit: fix stale "1-worker lane" wording in the delegation log (now
  "heavy memory-envelope lane") and the "single-worker envelope" test title,
  both stale after the 1->4 worker change.

test-changed 118/118, eslint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 22:30:57 -07:00
gsxdsm
2cff1864c9 fix: bound @fusion/core affected lane + tighten changed watchdog under engine kill
Three changes to make `pnpm test` reliably minimal and fail gracefully:

- @fusion/core is now a memory-envelope/wide-fan-out package (was unguarded).
  It's the hub nearly everything imports (~354 test files), so a core source
  edit made `vitest --changed` expand to ~the whole core suite and blow past the
  engine's 15-min verification kill -> SIGKILL + task restart. Adding it to
  SCOPED_AFFECTED_MEMORY_ENVELOPES applies the wide-fan-out guard (run only
  directly-changed core tests, else delegate) and the bounded env. core is NOT
  gate-covered, so delegation warns loudly rather than false-greens.

- Lower CLASS_BUDGET_BANDS.changed ceiling 20min -> 13min so the script watchdog
  fails a runaway local lane itself (exit 124, no restart) BEFORE the engine's
  15-min kill restarts the whole task. A tightening, not a timeout-widening.
  Guard test pins ceiling < 900_000ms.

- Raise scoped-affected worker fan-out 1 -> 4 (operator decision). Was 1 only
  for OOM safety (FN-6854/FN-6874); the fan-out guard now bounds the set so the
  hundreds-of-files OOM driver no longer reaches these workers. Heap stays
  6144MB/worker (~4x6GB on the lane) — revisit if a RAM-constrained CI runner
  OOMs. Trades FN-5048 worker-knob guidance for throughput, scoped to the
  bounded affected lanes only.

Tests: test-changed 117/117, watchdog 15/15, eslint clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:42:22 -07:00
gsxdsm
8297762eeb Address PR review feedback (#1780)
- P2: filter directly-changed test files to paths that still exist on disk
  (existingChangedTestFilesInPackage) so deleted/renamed .test paths from
  `git diff` never reach `vitest run` positionally; all-deletions diff falls
  into the delegate-to-gate path.
- P1: make heavy-package delegation gate-coverage-aware
  (GATE_COVERED_MEMORY_ENVELOPE_PACKAGES). Engine delegation keeps the accurate
  "curated engine-core subset ran above" note; dashboard delegation now warns
  that the gate runs no dashboard tests and names the CI full-suite backstop,
  so the coverage gap is loud instead of a silent false-green.
- +4 regression tests (115/115).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:17:56 -07:00
gsxdsm
8754e28868 FN-7026: cap scoped affected test watchdogs
Keep changed-only affected test lanes from outliving the workspace verification timeout.

- Add a scoped affected watchdog ceiling below the default executor timeout.
- Use the ceiling for scoped dashboard and engine affected Vitest lanes while leaving full fallback budget unchanged.
- Cover the timeout derivation and dashboard-only package selection in script tests.
- Document the changed-only watchdog behavior for future test infrastructure changes.

Files changed:
 docs/testing.md                         |  6 +++--
 scripts/__tests__/test-changed.test.mjs | 48 +++++++++++++++++++++++++++++++++
 scripts/test-changed.mjs                | 18 ++++++++++---
 3 files changed, 66 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-7026

Fusion-Task-Lineage: 774519e0-505b-4e40-8309-5d2250da1eba
2026-06-25 19:35:46 -07:00
gsxdsm
c5fbe08c00 fix: bound changed-affected test lane to avoid vitest --changed graph blowup
`pnpm test`'s changed-affected lane ran `vitest run --changed <base>` for the
heavy packages (@fusion/engine, @fusion/dashboard). `vitest --changed` does
unbounded transitive module-graph expansion: one changed hub source file
selects ~8,393 test entries (79s just to list), which at the OOM-pinned
workers=1 exceeds the engine's 15-min VERIFICATION_TIMEOUT_WORKSPACE_MS. The
engine SIGKILLs and restarts the task, producing the observed loop of nine
15-min verification timeouts (~2.8h) on a single task.

Guard the lane with a git-only predictor: when a heavy package has changed
non-test source in its graph, run only the directly-changed test files;
when no test files changed, delegate cross-cutting coverage to the merge gate
(already run in changed mode). Test-only diffs keep normal --changed.
Mirrors the existing reverse-dependent blast cap one level down. No widened
timeouts, retries, or worker bumps. test:full remains the explicit full sweep.

Bounded engine run: 2.79s vs 79s. Regression suite 111/111.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 19:28:15 -07:00
gsxdsm
65a2b3bc72 feat: add test-free verify:fast (typecheck + build + boot-smoke) (#1777)
## What this adds

A **test-free verification command** — `pnpm verify:fast`
(`scripts/verify-fast.mjs`) — that gives deterministic, flake-free
signal without running the test suite. It is fully **additive**: `pnpm
test`, the merge gate (`test:gate`), and CI are untouched.

`docs/testing.md` observes the broad test gate "caught no recalled real
bugs while consuming ~70% of shipping time in flake triage."
`verify:fast` is the opt-in path for non-test verification, suitable as
a project `testCommand`/verification command.

## What verify:fast runs

1. **typecheck — scoped to the changed packages** (each package's
`typecheck` script, or `pnpm --filter <pkg> exec tsc --noEmit -p .` when
none exists).
2. **build — scoped to the changed packages** (`pnpm --filter <pkg>
build`, only for packages that declare a build script).
3. **boot smoke once** (`scripts/boot-smoke.mjs`: CLI `--help` + a real
`fn serve` answering `GET /api/health`), after builds so it runs against
fresh artifacts.

Change-detection **reuses `scripts/test-changed.mjs`** (`getBaseBranch`
/ `detectComparisonBase` / `changedFilesSince` /
`resolveAffectedPackages` / workspace resolution — newly `export`ed)
instead of reinventing git-diff, so it scopes to exactly the packages a
changed-only test run would. With no affected package (root/docs-only
diff) it runs the boot smoke only. Each step is bounded by the existing
`runWithWatchdog` (class `changed`) so a hung tsc/build/serve fails
fast; it streams progress and exits nonzero on the first failing step.
`@fusion/desktop` and `@fusion/mobile` are skipped, mirroring the root
`build`/`typecheck` exclusions.

## Measured wall-time

On this branch's diff (which resolves to the heaviest package,
`@fusion/dashboard`), end-to-end:

```
[verify:fast] plan: typecheck:@fusion/dashboard -> build:@fusion/dashboard -> boot-smoke
[verify:fast]    OK typecheck @fusion/dashboard (~44s)
[verify:fast]    OK build @fusion/dashboard (26.2s)
[verify:fast]    OK boot smoke (CLI --help + real serve /api/health) (19.6s)
[verify:fast] PASS — 3 step(s) green in 90.3s (no tests run).
```

**~90s total**, deterministic and flake-free. By contrast a typical
**scoped test run for the same package** is far heavier and flake-prone:
`docs/testing.md` notes a dashboard task "otherwise re-ran all 822
dashboard test files (~5-8 min)", and `pnpm test` additionally runs the
merge-gate suite first. verify:fast trades that test-suite cost (and its
flake-triage tax) for a typecheck+build+boot signal in ~1.5 min.

## Doc additions

- `AGENTS.md` + `docs/testing.md` testing-commands lists now include
`pnpm verify:fast`, described as the recommended **test-free
verification** (typecheck + build + boot-smoke), suitable as a project
`testCommand`/verification command; the full suite stays available and
runs non-blocking.

## Tests / verification

- New `scripts/__tests__/verify-fast.test.mjs` (11 tests) pins the pure
planning / arg-construction logic — scoped typecheck/build selection,
build-script gating, desktop/mobile exclusion, boot-smoke-only fallback,
and reuse of `resolveAffectedPackages`. It never spawns real
tsc/build/vitest.
- `pnpm verify:fast` runs end-to-end and exits 0 (output above).
- Lint clean on all new/changed files; `agents-md-invariants`,
`check-test-inventory`, `verify-fast`, and `test-changed` script tests
all green (132 tests).

No changeset (scripts + docs + CI-tooling, behavior-additive;
`@runfusion/fusion` runtime unaffected).

🤖 Generated with [Claude Code](https://claude.com/claude-code)


<!-- stage-review-badge-begin -->

---

<a href="https://stagereview.app/Runfusion/Fusion/pull/1777">
  <picture>
<source media="(prefers-color-scheme: dark)"
srcset="https://stagereview.app/assets/gh-open-in-stage-dark.svg">
<img src="https://stagereview.app/assets/gh-open-in-stage-light.svg"
alt="Open in Stage">
  </picture>
</a>

<!-- stage-review-badge-end -->
2026-06-25 17:24:25 -07:00
gsxdsm
f342761f1b feat: add test-free verify:fast (typecheck + build + boot-smoke)
Adds scripts/verify-fast.mjs + root `pnpm verify:fast`, an opt-in, flake-free
verification path that runs typecheck + build scoped to the changed packages
(reusing test-changed.mjs git-diff / changed-package resolution) plus the
existing boot smoke once, with no test suite. Each step is bounded by the
shared runWithWatchdog (class "changed"); exits nonzero on the first failure.
No default changed: pnpm test, the merge gate, and CI are untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 17:06:08 -07:00
gsxdsm
4426a9ae75 chore: add test value audit (deletion-candidate evidence base)
Add scripts/test-value-audit.mjs + scripts/lib/test-value-audit-lib.mjs:
a heuristic that scores every test file under packages/*/src/**/__tests__/**
and packages/dashboard/app/**/__tests__/** from git history, classifying
commits as positive (fix+source co-change, Symptom Verification regressions,
added-with-source) vs negative (flake/quarantine/timeout churn, test-only
modifies, quarantine-ledger membership). Joins per-file durations from
scripts/test-timings.json so SLOW + LOW-VALUE files rank first as deletion
candidates. Emits docs/test-value-audit.json + docs/test-value-audit.md
(top 40 + methodology + caveats). Pure scoring logic is unit-tested with
synthetic commit records. The script never deletes tests — evidence only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 17:04:30 -07:00
Phil Larson
b62b4b0e30 fix(FN-798): scope engine vitest fork pool
Fusion-Task-Id: FN-798
2026-06-25 11:21:46 -07:00
Phil Larson
fa8e9fa817 fix(FN-798): stabilize engine vitest gate pool
Fusion-Task-Id: FN-798

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-25 10:56:43 -07:00
gsxdsm
f955606106 FN-6966: flag stale timing metadata in velocity reports
Add stale timing context to the weekly test velocity baseline so W26 regressions are not misattributed.

- Report timing snapshot age and missing slowest-file paths before the slow-file table.
- Persist timing metadata notes in velocity history and regenerate the W26 baseline report.
- Cover stale and missing timing metadata warnings with node:test assertions.

Files changed:
 docs/test-velocity-baseline.md                    |  23 ++-
 scripts/__tests__/test-velocity-baseline.test.mjs |  26 +++
 scripts/test-velocity-baseline.mjs                |  65 +++++-
 scripts/test-velocity-history.json                | 231 ++++++++++++++++++++++
 4 files changed, 330 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-6966

Fusion-Task-Lineage: bccac6c2-11c1-4295-b3af-b77dab1748dc
2026-06-24 23:32:52 -07:00
gsxdsm
901f7124f3 feat(changelog): U4 — wire distillation into local release path
Capture changeset entries before 'changeset version' deletes them,
distill deterministic notes post-version, and replace the version's
section in the root CHANGELOG with curated end-user notes.
2026-06-24 19:25:38 -07:00
gsxdsm
5b0180023c feat(changelog): U3 — deterministic release-notes distiller
Add scripts/lib/distill-release-notes.mjs with:
- distillDeterministic(): groups parsed changesets by category,
  renders clean markdown release notes (Keep a Changelog headings)
- buildDistillationPrompt(): builds the context input for AI mode
- DISTILLATION_SYSTEM_PROMPT: system prompt for AI distillation
- Category display order: New → Fixed → Breaking → Security →
  Performance → Internal; empty categories omitted

The AI mode (createFnAgent integration) is deferred to U4 where the
engine runtime is available. The deterministic mode is the fallback
contract: it always produces valid output regardless of model access.

14 tests covering category grouping, ordering, empty/edge cases,
prompt building, and legacy entry handling.
2026-06-23 23:33:47 -07:00
gsxdsm
8317684aff feat(changelog): U2 — changeset format linter + CI wiring
Add scripts/check-changeset-format.mjs:
- Validates structured changeset schema across .changeset/*.md
- Legacy changesets warn (exit 0) in transition mode
- Structured changesets with missing/invalid fields error (exit 1)
- --strict flag fails on legacy changesets

Wire into package.json (check:changesets, pretest, test:gate) and
pr-checks.yml lint job. Fix parser to not default category on
structured changesets missing the field.

10 linter tests + 18 schema tests all passing.
2026-06-23 23:30:32 -07:00
gsxdsm
5676d95fd0 feat(changelog): U1 — structured changeset parser + schema
Add scripts/lib/changeset-schema.mjs with:
- Labeled-field body format (summary, category, dev)
- Legacy freeform detection with graceful fallback
- Validation for required fields, category enum, summary length
- Full file parser (frontmatter + body)

18 tests covering structured parsing, legacy fallback, validation,
edge cases (empty body, boundary length, multi-line dev).
2026-06-23 23:25:48 -07:00
gsxdsm
8f4897d3aa FN-6905: add build preflight to velocity measurement
Add a non-measured build setup step so velocity baselines do not misclassify missing dist artifacts as lane time.

- Run a default `pnpm build` preflight before measured test velocity lanes, with an explicit skip flag for pre-built CI.
- Add injectable command-runner coverage for preflight ordering, failure reporting, and skip behavior.
- Document the preflight behavior in the generated baseline report and testing docs.

Files changed:
 docs/test-velocity-baseline.md                    |   2 +
 docs/testing.md                                   |   4 +-
 scripts/__tests__/test-velocity-baseline.test.mjs | 159 ++++++++++++++++++++++
 scripts/test-velocity-baseline.mjs                |  38 +++++-
 4 files changed, 195 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6905

Fusion-Task-Lineage: 3016a542-4395-4d06-9f2e-1a91f4939e07
2026-06-21 22:29:13 -07:00
gsxdsm
1e81f99f72 FN-6877: stabilize dashboard changed-mode affected runs
Stabilize changed-mode affected runs by giving dashboard its own memory envelope.

- Generalize scoped affected memory-envelope handling beyond the engine lane.
- Run @fusion/dashboard changed-mode Vitest scopes in a 6144 MB, single-worker envelope.
- Cover dashboard and engine scoped partitioning/env contracts with script tests.
- Document the dashboard changed-mode OOM/SIGKILL guard and remeasurement expectations.

Files changed:
 docs/testing.md                         |   6 +-
 scripts/__tests__/test-changed.test.mjs | 112 +++++++++++++++++++++++++++-----
 scripts/test-changed.mjs                |  67 +++++++++++++++----
 3 files changed, 155 insertions(+), 30 deletions(-)

Fusion-Task-Id: FN-6877

Fusion-Task-Lineage: 084df464-ebda-4578-bfac-305800da5b6c
2026-06-21 16:48:20 -07:00
gsxdsm
d57538581d FN-6854: isolate engine affected tests
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
2026-06-21 13:25:41 -07:00
gsxdsm
ce90cc9b62 fix(FN-5048): keep Fusion test verification bounded 2026-06-21 10:05:12 -07:00
gsxdsm
b7182da349 Address PR review feedback (#1698)
- Import URL from node:url to clear ESLint no-undef (coderabbit)
- Throw on unreadable tracked files instead of silently skipping, so a
  file can't evade the cap and false-pass (coderabbit)
- Emit the "baseline can be tightened" note for deleted-only stale entries
  too, with a correct count (greptile)
- Add FNXC:CI comments to the guard and its test per AGENTS.md (greptile)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 00:05:41 -07:00
gsxdsm
2d6ba99caf chore(ci): add file line-count guardrail to pretest
Add a pretest guard that caps new source files at 2,000 lines to stop
god-files from being born, following the existing check-no-* guard pattern.

Existing oversized files (106 of them) are grandfathered via a ratchet
baseline (scripts/line-count-baseline.json): each is pinned to its current
line count and may shrink but never grow. Files refactored under the cap
drop out of the baseline and cannot regress. Generated, lock, locale, and
.d.ts files are out of scope via the source-extension filter.

Wired into pretest and pretest:full; covered by 11 unit tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 23:57:59 -07:00
gsxdsm
fdccca9d27 fix(review): apply autofix feedback
- Reformat shard-floor justification as an FNXC:TestInfrastructure comment
  (project-standards: AGENTS.md FNXC_LOG convention).
- Clarify that the shard and dashboard-lane 15min floors are not coupled and
  may diverge (maintainability: avoid implying an unenforced contract).
- Add a regression-guard test pinning shard.floor=15min and asserting a 525s
  derived budget clamps up to the floor, so an accidental revert to the old
  5min floor fails loudly (correctness + testing + project-standards).
2026-06-20 21:53:31 -07:00
gsxdsm
74e056ed99 fix(ci): raise shard watchdog floor to 15min to stop false-kills
The Full Suite (non-blocking) workflow has been red for 30+ runs on main.
Diagnosis: the @fusion/engine [1/2], [2/2] and @fusion/core [2/2] shard
slices were SIGKILLed at their watchdog budgets (405s/405s/338s), not because
they hang but because those budgets are too tight for current wall-clock.

Local baselines (this machine, all pass, exit 0):
  - engine [2/2]: 145s wall / 309 files
  - core   [2/2]: 283s wall / 172 files  (old budget was only 338s!)

deriveBudgetMs tightens the budget to expected*3.5 whenever the committed
scripts/test-timings.json is <30d old. The snapshot (2026-06-03) undercounts
the import- and real-git-subprocess overhead of these heavy slices, so the
'fresh' snapshot produced a too-tight, false-kill budget on slower CI runners
-- the exact failure mode the floor/ceiling band exists to prevent.

Fix (plan KTD-2): raise the shard band floor 5min -> 15min so the heaviest
slices can't be tightened into a false-kill, while a true hang is still bounded
far under the job's 60min ceiling. Mirrors the dashboard-lane heavy-lane floor.
Follow-up: refresh scripts/test-timings.json from a default-branch CI run.
2026-06-20 21:48:14 -07:00
gsxdsm
3bda46dbd5 FN-6775: ignore synced mobile assets in lint
Keep generated Capacitor Android web assets out of ESLint while preserving source lint coverage.

- Add an ESLint flat-config ignore for Capacitor-synced Android public assets.
- Add a node:test regression guard proving synced mobile assets are ignored and real package source remains linted.

Files changed:
 eslint.config.mjs                                  |  6 ++++
 .../eslint-ignores-mobile-synced-assets.test.mjs   | 39 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

Fusion-Task-Id: FN-6775

Fusion-Task-Lineage: 4bab7695-70b5-4a8c-b7de-6e0055ff4b9f
2026-06-20 04:11:33 -07:00
gsxdsm
24ff12471f Stop quarantine-list edits from forcing pnpm test into gate mode
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>
2026-06-19 19:05:49 -07:00
gsxdsm
3383a095b7 FN-6694: add workflow reliability release-check harness
Add an on-demand executable release-check lane for custom workflow reliability signoff.

- Add a manifest-backed release-check runner with dry-run, JSON output, validation, and targeted Vitest command planning.
- Define the custom workflow reliability checklist seams and cover runner validation, planning, reporting, and failure behavior with node tests.
- Document the QA signoff command and manifest mapping while keeping the lane out of the merge gate.

Files changed:
 docs/custom-workflow-reliability-acceptance-map.md |  29 +-
 docs/testing.md                                    |   3 +
 package.json                                       |   1 +
 .../workflow-reliability-release-check.test.mjs    | 138 +++++++++
 .../lib/workflow-reliability-release-check.json    | 102 +++++++
 scripts/workflow-reliability-release-check.mjs     | 312 +++++++++++++++++++++
 6 files changed, 579 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-6694

Fusion-Task-Lineage: 21d45bb5-6c45-4cb7-8b29-9eaea8b29ad4
2026-06-19 05:13:39 -07:00
gsxdsm
deb1717812 FN-6667: add real iOS Safari acceptance harness
Add a real iOS Safari acceptance harness and documentation for terminal verification gates.

- Add an `ios:acceptance` script with check, dry-run, and real WebDriver session modes.
- Support BrowserStack, Sauce Labs, and LambdaTest credential discovery with redacted capability planning.
- Document the real-iOS provisioning workflow and link it from testing docs.
- Cover credential selection, URL validation, capability shaping, and CLI behavior with node tests.

Files changed:
 docs/README.md                            |   1 +
 docs/ios-acceptance.md                    | 144 ++++++++++++++++
 docs/testing.md                           |   3 +
 package.json                              |   1 +
 scripts/__tests__/ios-acceptance.test.mjs | 131 +++++++++++++++
 scripts/ios-acceptance.mjs                | 264 ++++++++++++++++++++++++++++++
 scripts/lib/ios-acceptance.mjs            | 243 +++++++++++++++++++++++++++
 7 files changed, 787 insertions(+)

Fusion-Task-Id: FN-6667

Fusion-Task-Lineage: 9eee6dbe-646e-4fff-a1da-fd59cdd2cb59
2026-06-18 16:47:09 -07:00
gsxdsm
538bf42e32 fix(dev): rebuild core+engine+dashboard on dev/local startup + stale-dist check
pnpm dev/local dashboard prebuild now rebuilds @fusion/core and @fusion/engine alongside the dashboard UI (was client-only), and startup warns loudly when built dist/ is older than src/. Prevents the FN-6638 class where landed engine fixes silently never run because the process loads stale dist.
2026-06-18 13:41:37 -07:00
gsxdsm
fbd9ad2f3b FN-6617: add weekly test velocity baseline
Adds a report-only weekly baseline for test feedback-loop velocity.

- Add a test:velocity script that measures gate, boot smoke, and changed-only test durations and regenerates a #leads-ready report.
- Track committed baseline history, slowest-file summaries, and quarantine deletion-clock counts.
- Document the weekly refresh workflow in testing guidance and agent instructions.

Files changed:
 AGENTS.md                                         |   4 +-
 docs/test-velocity-baseline.md                    |  92 ++++++
 docs/testing.md                                   |  18 ++
 package.json                                      |   1 +
 scripts/__tests__/test-velocity-baseline.test.mjs | 121 ++++++++
 scripts/test-velocity-baseline.mjs                | 339 ++++++++++++++++++++++
 scripts/test-velocity-history.json                | 231 +++++++++++++++
 7 files changed, 805 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6617

Fusion-Task-Lineage: 50a07298-74ec-4481-b288-4fadb7d3d29b
2026-06-17 20:09:05 -07:00
gsxdsm
f150a176b4 FN-6612: add test feedback-loop baseline reporting
Add a weekly baseline workflow for tracking test feedback-loop speed and flake pressure.

- Add a stdlib-only script to record gate and pnpm test timings alongside slowest test files and quarantine counts.
- Publish generated markdown and JSON baseline artifacts for #leads reporting.
- Document the weekly refresh process and add package scripts plus coverage for the baseline helper.

Files changed:
 docs/test-feedback-loop-baseline.md               |  48 ++++++
 docs/test-feedback-loop-baselines.json            | 122 ++++++++++++++
 docs/testing.md                                   |  12 ++
 package.json                                      |   1 +
 scripts/__tests__/test-feedback-baseline.test.mjs |  90 ++++++++++
 scripts/test-feedback-baseline.mjs                | 192 ++++++++++++++++++++++
 6 files changed, 465 insertions(+)

Fusion-Task-Id: FN-6612

Fusion-Task-Lineage: 72bdc070-50e3-4e6b-a07d-3b8aeb9c2e92
2026-06-17 19:25:06 -07:00
gsxdsm
81188f1996 FN-6480: require operator authorization for releases
Require an out-of-repository operator signal before the release script can mutate version, publish, push, or tag.

- Add a reusable release authorization gate that allows dry-runs and blocks real releases without FUSION_RELEASE_AUTHORIZED.
- Invoke the gate in scripts/release.mjs before the first release mutation while preserving dry-run behavior.
- Cover blocked, authorized, dry-run, whitespace, TTY, and call-order behavior with script tests.

Files changed:
 .../__tests__/release-authorization-gate.test.mjs  | 70 ++++++++++++++++++++++
 scripts/lib/release-authorization-gate.mjs         | 30 ++++++++++
 scripts/release.mjs                                | 26 +++++++-
 3 files changed, 123 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-6480

Fusion-Task-Lineage: 5347552c-e395-4852-b389-6bbdba0e044e
2026-06-16 15:08:24 -07:00
gsxdsm
2bffad1784 Merge remote-tracking branch 'origin/main' into fix/test-timeout-failures
# Conflicts:
#	scripts/test-changed.mjs
2026-06-15 12:13:40 -07:00
gsxdsm
d8fe994ca7 FN-6472: make release dry-runs non-interactive by default
Make dry-run release previews skip stdin prompts unless explicitly requested.

- Add a release prompt gate that suppresses version prompts for default dry-runs and honors --interactive as an opt-in.
- Update release CLI usage text and argument parsing for dry-run interactivity.
- Cover dry-run, --yes, real-release, and release.mjs ordering behavior with script tests.

Files changed:
 scripts/__tests__/release-prompt-gate.test.mjs | 72 ++++++++++++++++++++++++++
 scripts/lib/release-prompt-gate.mjs            | 13 +++++
 scripts/release.mjs                            | 16 ++++--
 3 files changed, 97 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-6472

Fusion-Task-Lineage: 07bfd944-f4a0-454a-883f-dadf1aa0b7d4
2026-06-15 02:30:41 -07:00
gsxdsm
12efd3fd3f FN-6445: reject quality skip-list overlaps
Prevent dashboard curated skip-list entries from masking tests already covered by quality projects.

- Add validation that flags skip-list files included by quality lanes.
- Cover overlap, empty-reason overlap, and genuine orphan cases in inventory tests.
- Document that skip-lists are only for genuinely non-executed dashboard tests.

Files changed:
 docs/testing.md                                 |  1 +
 scripts/__tests__/check-test-inventory.test.mjs | 29 ++++++++++++++++++++++---
 scripts/check-test-inventory.mjs                |  9 ++++++++
 3 files changed, 36 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-6445

Fusion-Task-Lineage: 1741f684-8dfc-41fc-8f30-baa3700ac11b
2026-06-14 15:29:35 -07:00
gsxdsm
175aab15ac FN-6441: rescue and quarantine dashboard component tests
Rescue passing dashboard component tests and move still-failing orphaned tests under the quarantine ratchet.

- Remove the FN-6441 dashboard component batch from the curated skip-list.
- Keep passing PlanningModeModal, TaskReviewTab, and TerminalModal coverage documented in app backfill.
- Register remaining failing dashboard component/CSS tests in the dated quarantine ledger and Vitest excludes.
- Teach the dashboard curated inventory guard to accept dated quarantine entries without returning them to the skip-list.

Files changed:
 .../PlanningModeModal.ui-interactions.test.tsx     |  9 ++-
 .../components/__tests__/TaskReviewTab.test.tsx    |  4 ++
 .../components/__tests__/TerminalModal.test.tsx    |  4 ++
 packages/dashboard/vitest.config.ts                | 14 +++++
 scripts/__tests__/check-test-inventory.test.mjs    | 32 +++++++++++
 scripts/check-test-inventory.mjs                   | 67 +++++++++++++++++-----
 scripts/lib/dashboard-curated-skiplist.json        | 56 ------------------
 scripts/lib/test-quarantine.json                   | 58 ++++++++++++++++++-
 8 files changed, 172 insertions(+), 72 deletions(-)

Fusion-Task-Id: FN-6441

Fusion-Task-Lineage: 19065d1f-31eb-45fc-a6ce-083773b094e4
2026-06-14 15:29:35 -07:00
gsxdsm
1f660f3e8a FN-6434: block Vitest timeout appeasement
Add a fast guard that rejects Vitest timeout bumps in tracked test files.

- Add a test-timeout appeasement scanner with a temporary allowlist for legacy exemptions.
- Run the scanner in pretest, pretest:full, and test:gate so merge gates catch timeout bumps.
- Cover the scanner behavior with node:test cases and document the policy/remediation path.

Files changed:
 docs/testing.md                                    |   6 ++
 package.json                                       |   6 +-
 .../check-no-test-timeout-appeasement.test.mjs     |  49 +++++++++
 scripts/check-no-test-timeout-appeasement.mjs      | 119 +++++++++++++++++++++
 .../lib/test-timeout-appeasement-allowlist.json    |  10 ++
 5 files changed, 187 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-6434

Fusion-Task-Lineage: deb46a27-b0c9-4644-b8bb-34ce98e7acde
2026-06-14 15:29:35 -07:00
gsxdsm
066c919ace test: quarantine slow and flaky test lanes
Move observed load-sensitive and slow tests out of the default lanes per the deletion-ratchet policy, keep the quarantine ledger in sync, and preserve corrupt databases when recovery fails during verification.
2026-06-13 19:22:00 -07:00
gsxdsm
80fbcdd5a3 FN-6396: harden test worker temp cleanup
Prevent stale Fusion test worker roots from leaking across merge-gate runs.

- Add per-run tokens to worker-root owner markers and pruning checks.
- Remove self-minted fallback worker roots during Vitest exit cleanup.
- Cover stale pid reuse, markerless redir roots, and SIGKILL-style orphan pruning with regression tests.

Files changed:
 packages/core/src/__test-utils__/vitest-setup.ts   | 83 +++++++++++++++++++---
 .../core/src/__test-utils__/vitest-teardown.ts     |  8 ++-
 .../vitest-teardown-worker-root-cleanup.test.ts    | 19 ++++-
 scripts/__tests__/test-changed.test.mjs            | 74 ++++++++++++++++++-
 scripts/test-changed.mjs                           | 76 ++++++++++++++++----
 5 files changed, 233 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-6396

Fusion-Task-Lineage: 711d966d-c70e-4cd7-81cd-accd18f17202
2026-06-13 16:30:28 -07:00
gsxdsm
7fa8c4e5f4 FN-6397: fix mobile workflow board fill chain
Ensure workflow-mode boards fill the mobile viewport while preserving internal column scrolling.

- Reassert the mobile flex fill chain for project content, workflow board wrappers, and workflow columns.
- Extend mobile board regression coverage across empty/populated workflow states with and without the toolbar.
- Document the workflow board collapse root cause and add a transient temp-dir isolation guard test.

Files changed:
 docs/dashboard-guide.md                            |   1 +
 .../ui-bugs/mobile-workflow-board-fill-chain.md    |  61 +++++++++++++
 .../__tests__/board-mobile-initial-render.test.tsx | 101 +++++++++++++++++++++
 packages/dashboard/app/styles.css                  |  52 +++++++++++
 scripts/__tests__/check-test-isolation.test.mjs    |  23 +++++
 scripts/check-test-isolation.mjs                   |  12 ++-
 6 files changed, 249 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6397
Fusion-Task-Lineage: ddee773d-6d3a-46d1-b1c7-f601a961365e
2026-06-13 16:30:28 -07:00
gsxdsm
e51d05bf1d Merge remote-tracking branch 'origin/main' into fix/test-timeout-failures
# Conflicts:
#	scripts/test-changed.mjs
2026-06-13 15:44:28 -07:00
gsxdsm
a49450ef5e Address PR review feedback (#1669)
- 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>
2026-06-13 15:21:00 -07:00
gsxdsm
97a49ac196 FN-6382: unquarantine stabilized flaky tests
Restore quarantined tests by fixing their flaky harness seams instead of extending the deletion ratchet.

- Mark active Vitest worker roots and skip live worker roots during prune cleanup.
- Make bubblewrap backend coverage deterministic with an injectable runner and restore it to the engine gate.
- Remove rescued core and bubblewrap tests from the quarantine ledger and Vitest excludes.

Files changed:
 .../core/src/__test-utils__/vitest-teardown.ts     | 10 +++++-
 packages/core/vitest.config.ts                     |  8 +----
 .../__tests__/sandbox/bubblewrap-backend.test.ts   | 29 +++++++++------
 packages/engine/src/sandbox/bubblewrap-backend.ts  |  9 +++--
 packages/engine/vitest.config.ts                   |  1 -
 scripts/__tests__/test-changed.test.mjs            | 23 ++++++++++++
 scripts/lib/test-quarantine.json                   | 34 ++----------------
 scripts/test-changed.mjs                           | 41 ++++++++++++++++++++++
 8 files changed, 102 insertions(+), 53 deletions(-)

Fusion-Task-Id: FN-6382

Fusion-Task-Lineage: 018dc7ac-1ef1-495e-a5fd-96ea44fcd43b
2026-06-13 11:39:37 -07:00
gsxdsm
1fddc7ace7 FN-6373: fix script test lane enumeration
Align script-test infrastructure with the current quality-test runner and AGENTS invariants.

- Expand run-quality-tests delegator scripts to concrete package quality lanes for dashboard shard planning.
- Cover grouped delegator expansion and non-delegating fallback behavior in ci-test-shard tests.
- Remove obsolete AGENTS button-freeze anchors from the invariant test.

Files changed:
 scripts/__tests__/agents-md-invariants.test.mjs |  2 --
 scripts/__tests__/ci-test-shard.test.mjs        | 32 +++++++++++++++++++++++++
 scripts/ci-test-shard.mjs                       | 28 ++++++++++++++++++++++
 3 files changed, 60 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6373

Fusion-Task-Lineage: 5d833e17-c483-4a5b-818d-ae2f86a45084
2026-06-13 10:01:01 -07:00