Commit Graph

295 Commits

Author SHA1 Message Date
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
eb763e8bc3 chore: test value audit (deletion-candidate evidence base) (#1776)
## What

A **test value audit**: a heuristic that scores every test file under
`packages/*/src/**/__tests__/**` and
`packages/dashboard/app/**/__tests__/**` by how much real regression
signal it has encoded over its git history, then ranks **slow AND
low-value** files first as deletion candidates. This is the **evidence
base** for a human/follow-up deletion decision — **the script deletes
nothing**.

Motivated by AGENTS.md "Do Not Add Slow Tests" (FN-5048) + the
quarantine deletion ratchet: we want data on which slow tests are also
low-signal so they can be cut without losing coverage.

## How it scores (HEURISTIC, not ground truth)

Single whole-history `git log --name-status` pass; per-commit
classification (renames followed backward):

- **Positive** — `fix(...)`/`fix:` with sibling source change (+3), fix
alone (+2), `## Symptom Verification` regression marker (+3, FN-5893),
test added-with-source (+2)/alone (+1), plain test+source co-change
(+1.5).
- **Negative** — subject/body churn keywords
`flake/flaky/deflake/quarantine/stabiliz/appease/timeout/retry` (−3),
test-only modify with no source (−1), quarantine-ledger membership
current+historical (−5).

`valueScore` = sum of weights. `deletionPriority = durationMs / (1 +
max(0, valueScore))` (+ small net-negative boost), joined with
`scripts/test-timings.json` so slow + low-value surfaces first.
Recommendation: `delete` (≤0) / `review` (≤3) / `keep` (>3). A
`safeDelete` flag marks files meeting the ratchet's churn/quarantine
bar.

## Deliverables

- `scripts/test-value-audit.mjs` — runner (git IO + report generation)
- `scripts/lib/test-value-audit-lib.mjs` — pure, unit-tested scoring
logic
- `scripts/__tests__/test-value-audit.test.mjs` — 15 synthetic-record
unit tests
- `docs/test-value-audit.json` + `docs/test-value-audit.md` — generated
artifacts (top 40 + methodology + honest caveats: heuristic limits,
git-follow/squash-merge blind spots, lying subjects, timing snapshot)

## Verification

- `node scripts/test-value-audit.mjs` runs end-to-end (~1s), 2051 files
analyzed, writes both artifacts.
- `node --test scripts/__tests__/test-value-audit.test.mjs` → 15/15
pass.
- `eslint` clean on all three new source files.

No changeset (scripts + docs only; `@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/1776">
  <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:23:03 -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
gsxdsm
5ce577842e test: quarantine 3 failing CI full-suite tests
Quarantine three test files consistently failing on the non-blocking
full-suite CI on main, per the AGENTS.md deletion-ratchet policy:

- engine self-healing-fn-5488-fast-path-regressions.test.ts (shard 1)
- engine in-review-merge-stall-deadlock-recovery.test.ts (shard 2)
- dashboard DevServerView.mobile.test.tsx (shard 4)

Each has a matching entry in scripts/lib/test-quarantine.json with
the failing CI run link and quarantinedAt date. Tests will be deleted
after 14 days unless rescued with a root-cause fix.
2026-06-25 17:02:29 -07:00
gsxdsm
0f95f6d1c1 FN-7013: refresh line-count guard baseline
Refresh the opt-in line-count guard so current files match the recorded baseline.

- Document why the guard remains outside the default test gate.
- Re-ratchet current line-count violations after organic growth.
- Tighten or prune stale baseline entries and grandfather two long-existing over-cap files.

Files changed:
 scripts/check-file-line-count.mjs |   3 +
 scripts/line-count-baseline.json  | 133 +++++++++++++++++++-------------------
 2 files changed, 69 insertions(+), 67 deletions(-)

Fusion-Task-Id: FN-7013

Fusion-Task-Lineage: bd770058-5b42-4d63-a18d-bf46b7b957e0
2026-06-25 16:17:46 -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
193532bd2b FN-6968: refresh test timing snapshots
Refresh the weekly test velocity baseline with current timing evidence.

- Update the rendered baseline report with the latest capture timestamps and velocity deltas.
- Replace stale slowest-file timing rows with the refreshed snapshot entries.
- Append the latest velocity history sample used by the weekly report.

Files changed:
 docs/test-velocity-baseline.md     |   61 +-
 scripts/test-timings.json          | 1772 +++++++++++++++++++++++++++++-------
 scripts/test-velocity-history.json |  112 +++
 3 files changed, 1580 insertions(+), 365 deletions(-)

Fusion-Task-Id: FN-6968

Fusion-Task-Lineage: 940f3581-3650-4feb-8730-d6dbb760e30c
2026-06-24 23:32:52 -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
fd63260962 Merge branch 'main' into feature/refactor-apptsx 2026-06-24 20:31:59 -07:00
gsxdsm
2019e5a30f feat(changelog): U6 — docs, agent guidance, and structured changeset
Update AGENTS.md, RELEASING.md, contributing.md with the structured
changeset format guide. Add .changeset/README.md template. Add changeset
for this change. Update distill-release-notes.mjs with final version.
2026-06-24 19:25:51 -07:00
gsxdsm
51d1cc521c feat(changelog): U5 — CI workflow distillation integration
Chain distillation into release:version so both local and CI versioning
flows get distilled notes. Update release.yml to use curated CHANGELOG
notes instead of GitHub's auto-generated release notes.
2026-06-24 19:25:44 -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
8d394cd898 refactor(dashboard): graduate App.tsx off the line-count ratchet baseline
App.tsx dropped from 2,729 to 1,636 lines through the module-breakup refactor
(U1-U7), now well under the 2,000-line cap. Remove its grandfathered entry
from scripts/line-count-baseline.json so the file is subject to the cap going
forward and can never regress above 2,000. Scoped change: only the App.tsx
entry is removed; every other ceiling is untouched (a full `--update` would
have re-derived the whole baseline and re-raised ceilings for unrelated
grown files, which AGENTS.md forbids).

U8 (App.tsx module-breakup plan).
2026-06-23 22:15:56 -07:00
gsxdsm
58630683e1 FN-6948: refresh weekly test velocity baseline
Refresh the weekly test velocity report with the latest captured baseline.

- Update the latest baseline timestamp, metric deltas, quarantine counts, and #leads posting text.
- Append the 2026-06-23 test velocity history row with wall times and slowest test files.

Files changed:
 docs/test-velocity-baseline.md     |  20 +++----
 scripts/test-velocity-history.json | 111 +++++++++++++++++++++++++++++++++++++
 2 files changed, 121 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-6948

Fusion-Task-Lineage: 7b2d265a-b6c9-494c-aa87-31ae2c71c5f0
2026-06-23 01:22:54 -07:00
gsxdsm
8dc9973997 FN-6937: remove stale session cross-tab quarantine
Remove the orphaned session-cross-tab quarantine ledger entry after confirming the test remains active and rescued.

- Document FN-6937's rescue proof and ledger/config lockstep expectation in testing guidance.
- Keep the dashboard Vitest quarantine list empty with a note explaining the stale ledger-only cleanup.
- Remove the session-cross-tab row from the flaky-test quarantine ledger.

Files changed:
 docs/testing.md                     | 8 ++++++--
 packages/dashboard/vitest.config.ts | 3 +++
 scripts/lib/test-quarantine.json    | 8 +-------
 3 files changed, 10 insertions(+), 9 deletions(-)

Fusion-Task-Id: FN-6937
Fusion-Task-Lineage: 34a67bf3-2a7f-49ea-93ab-68fadc81f893
2026-06-23 00:26:16 -07:00
gsxdsm
9b440c3b35 FN-6917: re-ratchet line-count baseline
Re-ratchet the opt-in line-count audit baseline so current oversized files no longer fail the ceiling check.

- Document that the pnpm test blocker premise is stale because the guard is opt-in.
- Refresh grandfathered line-count ceilings to the current merged tree.
- Add TerminalModal.tsx to the grandfathered oversized-file baseline and drop entries that no longer need it.

Files changed:
 scripts/check-file-line-count.mjs |  3 ++
 scripts/line-count-baseline.json  | 80 +++++++++++++++++++--------------------
 2 files changed, 42 insertions(+), 41 deletions(-)

Fusion-Task-Id: FN-6917

Fusion-Task-Lineage: aaa018d8-f1a3-47a5-b63b-f18bac87b910
2026-06-22 19:42:38 -07:00
gsxdsm
ff06443bd7 FN-6921: refresh test velocity baseline
Refresh the weekly test velocity report with the latest measured results.

- Update the baseline capture timestamp, deltas, quarantine count, and #leads summary text.
- Record the latest velocity measurement row in the historical JSON log.
- Preserve already-landed branch changes by applying only the remaining FN-6921 measurement update after duplicate-commit detection.

Files changed:
 docs/test-velocity-baseline.md     |  22 ++++----
 scripts/test-velocity-history.json | 111 +++++++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-6921

Fusion-Task-Lineage: e0f08944-0709-43de-ba25-57903c4a58b6
2026-06-22 17:52:26 -07:00
gsxdsm
af06170a51 FN-6778: add agent artifact registry tools
Adds engine and chat tools for registering, discovering, and viewing artifacts with inbox notifications.

- Add fn_artifact_register, fn_artifact_list, and fn_artifact_view tools for heartbeat, executor, and chat sessions.
- Send best-effort dashboard system inbox notifications when artifacts are registered.
- Classify artifact tools for action gating and coordination exemptions, with coverage for executor, heartbeat, permanent agent, and chat flows.
- Document the artifact registry behavior and update package metadata, quarantine ledger, and line-count baseline.

Files changed:
 .changeset/fn-6778-artifact-agent-tools.md         |   5 +
 CONCEPTS.md                                        |   3 +
 docs/agents.md                                     |   1 +
 packages/core/src/db.ts                            |   1 +
 .../src/__tests__/session-error-recovery.test.ts   |   1 +
 .../session-persistence-roundtrip.test.ts          |   1 +
 .../src/__tests__/session-reconnect.test.ts        |   1 +
 .../src/__tests__/session-resume-history.test.ts   |   1 +
 packages/dashboard/src/chat.ts                     |   6 +-
 packages/dashboard/src/planning.ts                 |   4 +
 packages/dashboard/src/test/mockCoreEngine.ts      |   1 +
 .../engine/src/__tests__/agent-action-gate.test.ts |   3 +
 .../src/__tests__/agent-artifact-tools.test.ts     | 458 +++++++++++++++++++++
 .../src/__tests__/executor-step-session.test.ts    |  48 +++
 .../src/__tests__/gating-classifications.test.ts   |   3 +
 .../src/__tests__/heartbeat-executor.test.ts       |  40 +-
 .../src/__tests__/heartbeat-session-prompt.test.ts |  25 +-
 .../src/__tests__/permanent-agent-gating.test.ts   |   6 +
 packages/engine/src/agent-heartbeat.ts             |   6 +-
 packages/engine/src/agent-tools.ts                 | 288 ++++++++++++-
 packages/engine/src/executor.ts                    |  25 ++
 packages/engine/src/gating-classifications.ts      |   7 +
 packages/engine/src/index.ts                       |   9 +
 scripts/lib/test-quarantine.json                   |   8 +-
 scripts/line-count-baseline.json                   |  54 +--
 25 files changed, 945 insertions(+), 60 deletions(-)

Fusion-Task-Id: FN-6778
Fusion-Task-Lineage: 7eb4afcb-8140-4f86-9540-eb3b83e64148
2026-06-22 03:34:14 -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
3817ada788 FN-6901: refresh weekly test velocity baseline
Refresh the weekly test velocity report with the latest captured baseline data.

- Advance the documented baseline from 2026-W25 to 2026-W26.
- Record the latest gate, changed-only test, quarantine, and boot-smoke measurement status.
- Append the new measurement row to the persisted test velocity history.

Files changed:
 docs/test-velocity-baseline.md     |  22 +++----
 scripts/test-velocity-history.json | 116 +++++++++++++++++++++++++++++++++++++
 2 files changed, 127 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-6901

Fusion-Task-Lineage: 06f42104-b3c5-4a26-86ee-fb2791f7006d
2026-06-21 21:48:40 -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
ef4889585f FN-6779: add artifacts gallery to Documents
Adds a Documents-view artifact gallery backed by dashboard artifact registry APIs.

- Add artifact listing and media-serving endpoints with project scoping, validation, and safe artifact path resolution.
- Add client artifact API helpers, SWR caching, and a useArtifacts hook for background-refresh gallery data.
- Extend Documents view with an Artifacts tab, media previews, localized labels, documentation, tests, and a published package changeset.

Files changed:
 .changeset/fn-6779-artifacts-gallery.md            |   5 +
 docs/dashboard-guide.md                            |   6 +-
 packages/dashboard/app/api/legacy.ts               |  34 ++++
 .../dashboard/app/components/DocumentsView.css     | 142 ++++++++++++++++
 .../dashboard/app/components/DocumentsView.tsx     | 178 ++++++++++++++++++--
 .../components/__tests__/DocumentsView.test.tsx    | 163 +++++++++++++++++-
 .../app/hooks/__tests__/useArtifacts.test.ts       | 136 +++++++++++++++
 packages/dashboard/app/hooks/useArtifacts.ts       | 145 ++++++++++++++++
 packages/dashboard/app/utils/swrCache.ts           |   1 +
 .../src/routes/__tests__/artifacts-routes.test.ts  | 182 +++++++++++++++++++++
 .../src/routes/register-task-workflow-routes.ts    | 125 ++++++++++++++
 packages/i18n/locales/en/app.json                  |  22 ++-
 packages/i18n/locales/es/app.json                  |  27 ++-
 packages/i18n/locales/fr/app.json                  |  27 ++-
 packages/i18n/locales/ko/app.json                  |  27 ++-
 packages/i18n/locales/zh-CN/app.json               |  27 ++-
 packages/i18n/locales/zh-TW/app.json               |  27 ++-
 scripts/line-count-baseline.json                   |  16 +-
 18 files changed, 1255 insertions(+), 35 deletions(-)

Fusion-Task-Id: FN-6779

Fusion-Task-Lineage: 1d71e4be-4bfc-4706-9cbf-7214f91a79d1
2026-06-21 16:01:07 -07:00
gsxdsm
2ecf78af28 FN-6860: rescue dashboard quarantine coverage
Rescue dashboard process lifecycle coverage and clear stale quarantine state.

- Track dev server lifecycle work so stale probes and output parsing cannot race cleanup.
- Assert duplicate URL detection suppression and fallback probe cleanup across failure, restart, stop, and cleanup paths.
- Remove rescued dashboard tests from quarantine config and ledger, and document the loaded-shard proof.

Files changed:
 docs/testing.md                                    |  4 ++
 .../src/__tests__/dev-server-process.test.ts       | 28 +++++++-
 packages/dashboard/src/dev-server-process.ts       | 74 +++++++++++++++++-----
 packages/dashboard/vitest.config.ts                |  5 +-
 scripts/lib/test-quarantine.json                   | 13 +---
 5 files changed, 95 insertions(+), 29 deletions(-)

Fusion-Task-Id: FN-6860

Fusion-Task-Lineage: abd22a00-e08e-4f65-bebc-c663c715b40e
2026-06-21 13:25:41 -07:00
gsxdsm
ef44f6357f FN-6871: re-ratchet line-count baselines
Refresh the line-count audit baseline to match current repository drift.

- Update the grandfathered large-file baseline counts for current source and test files.
- Document that the line-count guard is now an opt-in audit rather than a pretest blocker.

Files changed:
 scripts/check-file-line-count.mjs |  3 +++
 scripts/line-count-baseline.json  | 22 +++++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-6871

Fusion-Task-Lineage: d2fcf11e-2959-45a0-9bd1-1dc33b591ccf
2026-06-21 13:25:41 -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
9d31e88eca FN-6849: refresh line-count guardrail baseline
Refresh the line-count guardrail baseline so pretest accepts the current grandfathered source sizes.

- Document the FN-6849 maintenance re-ratchet in the line-count guard script.
- Regenerate the grandfathered line-count baseline for current oversized source and test files.
- Keep the guardrail active while unblocking unrelated pretest runs.

Files changed:
 scripts/check-file-line-count.mjs |  7 ++++
 scripts/line-count-baseline.json  | 74 +++++++++++++++++++--------------------
 2 files changed, 44 insertions(+), 37 deletions(-)

Fusion-Task-Id: FN-6849

Fusion-Task-Lineage: 07c04c2a-535c-43b0-9dd5-700ead4e06f0
2026-06-21 13:25:40 -07:00
gsxdsm
21df96cfbb fix(FN-5048): address PR feedback on test verification
Fusion-Task-Id: FN-5048
2026-06-21 10:53:08 -07:00
gsxdsm
ce90cc9b62 fix(FN-5048): keep Fusion test verification bounded 2026-06-21 10:05:12 -07:00
gsxdsm
f13aaa1a99 FN-6722: expose resolved GitHub issues
Expose resolved GitHub issue details in Command Center analytics and exports.

- Add resolved issue rows to local GitHub issue analytics with exact-vs-approximate timestamp metadata.
- Render a resolved issues table in the Command Center GitHub area without empty links when issue URLs are missing.
- Include resolved issue details in CSV export, route coverage, dashboard tests, docs, and the release changeset.
- Quarantine the unrelated dashboard dev-server process timer flake observed during workspace verification under the deletion ratchet.

Files changed:
 ...fn-6722-command-center-resolved-issue-detail.md |   5 +
 docs/dashboard-guide.md                            |   3 +-
 .../src/__tests__/github-issue-analytics.test.ts   | 109 +++++++++++++++++++--
 packages/core/src/github-issue-analytics.ts        |  45 ++++++++-
 packages/core/src/index.ts                         |   1 +
 .../__tests__/CommandCenter.mobile-scroll.test.tsx |   4 +-
 .../__tests__/CommandCenter.test.tsx               |   1 +
 .../components/command-center/areas/GithubArea.tsx |  67 +++++++++++++
 .../command-center/areas/__tests__/areas.test.tsx  |  55 +++++++++++
 .../register-command-center-routes.test.ts         |  61 +++++++++++-
 packages/dashboard/src/command-center-csv.ts       |  39 +++++++-
 packages/dashboard/vitest.config.ts                |   7 +-
 scripts/lib/test-quarantine.json                   |   5 +
 13 files changed, 382 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-6722
Fusion-Task-Lineage: 9fcbd8c2-f1bc-4b86-b5f5-593e5fd0e675
2026-06-21 09:00:40 -07:00
gsxdsm
c18e827b90 FN-6839: await CLI cached store shutdown
Rescue the retained CLI quarantine by making TaskStore shutdown deterministic before fixture cleanup.

- Await cached extension TaskStore closes and clear the cache before asynchronous shutdown drains.
- Update CLI fixtures to await direct and cached store closure, with a regression proving cached close is awaited.
- Remove rescued CLI quarantine entries/excludes and document the loaded-suite rescue with a patch changeset.

Files changed:
 .changeset/fn-6839-close-cached-stores.md          |  5 ++
 CLAUDE.md                                          |  1 +
 docs/testing.md                                    |  4 ++
 .../extension-agent-set-instructions.test.ts       |  2 +-
 .../__tests__/extension-goal-tools-audit.test.ts   |  2 +-
 .../cli/src/__tests__/extension-goal-tools.test.ts |  2 +-
 .../cli/src/__tests__/extension-insights.test.ts   |  6 +--
 .../__tests__/extension-mission-goal-tools.test.ts |  2 +-
 .../cli/src/__tests__/extension-task-tools.test.ts | 16 ++++---
 packages/cli/src/__tests__/extension.test.ts       | 56 +++++++++++-----------
 .../src/__tests__/research-extension-tools.test.ts |  4 +-
 packages/cli/src/extension.ts                      | 16 +++----
 packages/cli/vitest.config.ts                      |  6 +--
 scripts/lib/test-quarantine.json                   | 15 ------
 14 files changed, 68 insertions(+), 69 deletions(-)

Fusion-Task-Id: FN-6839

Fusion-Task-Lineage: ea0c7c77-bb59-4db4-931d-5e052a1043e5
2026-06-21 09:00:40 -07:00
gsxdsm
275e97edc1 Merge pull request #1699 from Runfusion/codex/start-engines-by-default
[codex] Start Fusion engines by default
2026-06-21 02:35:13 -07:00
gsxdsm
5de224e51e Merge pull request #1698 from Runfusion/gsxdsm/smaller-files
chore(ci): add file line-count guardrail to pretest
2026-06-21 02:23:47 -07:00
gsxdsm
40cea655b8 Merge main into validator behavioral verification
Resolve conflicts from main's analytics schema additions (plugin
activations, per-model token buckets) against the PR's contract-assertion
type column:
- db.ts: renumber behavioral-verification migration 124 -> 126, bump
  SCHEMA_VERSION to 126 so it follows main's migrations 124/125
- core/roadmap tests: adopt main's SCHEMA_VERSION-constant assertions
  instead of stale literal 124
- test-quarantine.json: keep all four quarantine entries from both sides

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 00:22:19 -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
7ef381762a feat: start engines by default 2026-06-20 23:57:37 -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
c0d78f19c5 FN-6795: update quarantine ledger after rescue triage
Refresh the test quarantine records after loaded-lane rescue verification.

- document the FN-6795 CLI and core quarantine triage outcomes
- rescue passing core and CLI test files by removing their ledger/config excludes
- retain CLI package-lane-only timeout quarantines and add the newly observed bin test flake

Files changed:
 docs/testing.md                  |  4 ++++
 packages/cli/vitest.config.ts    | 10 +++++++---
 packages/core/vitest.config.ts   |  4 +++-
 scripts/lib/test-quarantine.json | 25 +++++--------------------
 4 files changed, 19 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-6795
Fusion-Task-Lineage: b4460fc7-848f-4d54-89b4-cfd4d4533d57
2026-06-20 10:28:25 -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
6e2e5c6b62 WIP: scope affected test runs to changed-related tests (vitest --changed)
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>
2026-06-19 22:05:09 -07:00
gsxdsm
8b5b9a75ad Build Compound Engineering plugin dist before its tests
dist-freshness.test.ts reads the plugin's compiled dist/settings.js and
dist/session/orchestrator.js to guard against stale dist (FN-6596), but the
plugin had no pretest build and was missing from ensure-test-artifacts.mjs.
On a fresh CI checkout dist/ does not exist, so the guard threw "dist/ is
missing" — failing the non-blocking Full Suite on every main commit.

Register the plugin's required artifacts in ensure-test-artifacts.mjs and add
a `pretest` hook that builds them, matching the dependency-graph / hermes /
openclaw plugins. Verified locally: with dist/ absent, `pnpm --filter
@fusion-plugin-examples/compound-engineering test` now builds dist via the
pretest and all 192 plugin tests pass (incl. the two dist-freshness cases).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-19 20:47:32 -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
1a565a368b FN-6744: rescue WorkflowNodeEditor merge seam guard
Rescue the WorkflowNodeEditor quarantine by making duplicate merge seam detection reliable during initial canvas load.

- Derive fragment seam conflicts from the loaded workflow IR until React Flow nodes materialize.
- Treat IR merge nodes as merge seams so duplicate merge fragments are rejected consistently.
- Cover desktop and mobile duplicate merge fragment insertion paths and remove the test from quarantine.
- Document the FN-6744 rescue evidence and deletion-ratchet update.

Files changed:
 docs/testing.md                                    |  6 +++-
 .../app/components/WorkflowNodeEditor.tsx          | 11 +++++--
 .../__tests__/WorkflowNodeEditor.test.tsx          | 34 ++++++++++++++++------
 .../app/components/workflow-flow-mapping.ts        | 10 +++++++
 packages/dashboard/vitest.config.ts                |  8 +++--
 scripts/lib/test-quarantine.json                   |  5 ----
 6 files changed, 54 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-6744

Fusion-Task-Lineage: 0f5b167a-8efc-4458-ac9d-e719320b751f
2026-06-19 18:38:17 -07:00