Commit Graph

82 Commits

Author SHA1 Message Date
gsxdsm
74b4de3d19 FN-8883: migrate executor tests to StepSessionExecutor seam
Route executor lifecycle tests through graph-owned StepSessionExecutor fixtures.

- Add reusable workflow routing, worktree refresh, and implementation-session test helpers
- Update executor prompt, step-session, pause, and completion assertions for graph-owned sessions
- Document the graph executor fixture seams for focused verification

Files changed:
 docs/testing.md                                    |   3 +
 .../__tests__/ephemeral-task-create-gate.test.ts   |  29 +-
 .../engine/src/__tests__/executor-prompt.test.ts   | 417 ++++++++++++---------
 .../src/__tests__/executor-review-verdicts.test.ts |   2 +-
 .../executor-step-numbering-zero-based.test.ts     |  23 +-
 .../src/__tests__/executor-step-session.test.ts    | 152 ++++++--
 .../executor-task-done-summary.test.ts             |  14 +-
 .../engine/src/__tests__/executor-test-helpers.ts  |  65 +++-
 8 files changed, 468 insertions(+), 237 deletions(-)

Fusion-Task-Id: FN-8883

Fusion-Task-Lineage: 7ebbee52-fe43-4e18-b0e9-2253911a0acb

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 04:59:15 -07:00
gsxdsm
cf171bc4b2 FN-8900: rescue deterministic Kimi K3 catalog test
Rescue Kimi K3 route coverage with a deterministic bundled-catalog registry seam.

- Use pi-ai's real Kimi catalog without live registry refresh.
- Restore route merge and deduplication coverage and remove the paired quarantine records.
- Document the measured refresh stall and preserve the existing timeout budget.

Files changed:
 docs/testing.md                                    |  3 +-
 packages/dashboard/package.json                    |  1 +
 .../src/__tests__/_kimi-model-catalog-fixture.ts   | 40 +++++++++
 ...ister-model-routes-kimi-k3-supplemental.test.ts | 75 ++++++-----------
 packages/dashboard/vitest.config.ts                | 19 ++---
 pnpm-lock.yaml                                     | 98 +++++++++++++++++-----
 scripts/lib/test-quarantine.json                   |  5 --
 7 files changed, 153 insertions(+), 88 deletions(-)

Fusion-Task-Id: FN-8900

Fusion-Task-Lineage: 6d4986ed-bc93-479f-85fb-510d17ced4b5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 03:47:56 -07:00
gsxdsm
ef99dcd1b0 FN-8894: model advancing clocks in oversight tests
Ensure TaskDetailModal mutation fixtures mirror server update timestamps.

- Add an advancing-clock task fixture helper for mutation responses
- Update desktop and mobile oversight control mocks to use newer task snapshots
- Cover equal-clock merge behavior and document the fixture contract

Files changed:
 docs/testing.md                                    |  6 ++
 .../TaskDetailModal.oversight-controls.test.tsx    | 74 +++++++++++++++++++++-
 .../TaskDetailModal.oversight-mobile.test.tsx      |  3 +-
 .../__tests__/TaskDetailModal.test-helpers.ts      | 15 +++++
 4 files changed, 94 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-8894

Fusion-Task-Lineage: 614eb85a-0fbf-4f44-a08d-347f2511499b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 02:23:54 -07:00
gsxdsm
750b4bedbc FN-8788: retain Kimi K3 quarantine through deadline
Document the decision to preserve Kimi K3 quarantine coverage until its deletion-ratchet deadline.

- Retain the supplemental route test, Vitest exclusion, and ledger entry through 2026-08-15.
- Clarify that early removal requires regression evidence and a root-cause fix.

Files changed:
 docs/testing.md | 3 +++
 1 file changed, 3 insertions(+)

Fusion-Task-Id: FN-8788

Fusion-Task-Lineage: e1644a4b-1632-4cf7-a0a9-42ecc2b027a9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-04 11:45:20 -07:00
gsxdsm
07dccbe2bd FN-8783: parallelize static merge-gate validators
Run independent static merge-gate policy validators concurrently without weakening gate ordering.

- Add a fail-closed concurrent static-validator runner with coverage for inventory and failures.
- Preserve curated engine, PostgreSQL, unit, and CI-shape gate contracts.
- Document the gate composition and warm-cache performance policy.

Files changed:
 docs/testing.md                                    |  13 ++-
 package.json                                       |   3 +-
 packages/cli/src/__tests__/ci-workflow.test.ts     |  21 ++--
 packages/engine/vitest.config.ts                   |  36 +++++--
 .../__tests__/engine-vitest-gate-policy.test.mjs   |  90 +++++++++++++----
 scripts/__tests__/run-static-gate-checks.test.mjs  | 100 +++++++++++++++++++
 scripts/run-static-gate-checks.mjs                 | 106 +++++++++++++++++++++
 7 files changed, 332 insertions(+), 37 deletions(-)

Fusion-Task-Id: FN-8783

Fusion-Task-Lineage: d5d3c9e1-b3c4-45ff-a3e7-f9555585cd70

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-04 09:21:07 -07:00
gsxdsm
6d176a9372 FN-8721: reconcile census, delegation routing, and archive repair
Align lifecycle census coverage while routing delegated work to workflow-ready lanes and safely repairing archived tasks.

- Route delegated tasks through the selected workflow's hold or entry column.
- Scope soft-deleted archive repairs by project and protect them with compare-and-set updates.
- Refresh lifecycle-column census detection, baseline, documentation, and coverage.

Files changed:
 docs/testing.md                                    | 21 +++---
 .../u15-engine-dashboard-consumers.test.ts         | 31 ++++++++-
 .../core/src/task-store/archive-lifecycle-2.ts     |  5 ++
 .../core/src/task-store/async-archive-lineage.ts   |  5 ++
 packages/core/src/task-store/async-persistence.ts  | 11 ++++
 packages/core/src/task-store/async-self-healing.ts | 76 +++++++++++++++-------
 .../src/__tests__/agent-tools-delegation.test.ts   | 43 +++++++++++-
 .../__tests__/lifecycle-column-census-ast.test.ts  | 20 ++++++
 .../src/__tests__/lifecycle-column-census.test.ts  | 29 ++++++---
 packages/engine/src/agent-tools.ts                 | 29 +++++++--
 scripts/lib/lifecycle-column-census-ast.mjs        | 21 +++++-
 scripts/lib/lifecycle-column-census-baseline.json  | 17 ++---
 scripts/lifecycle-column-census.mjs                |  3 +-
 13 files changed, 245 insertions(+), 66 deletions(-)

Fusion-Task-Id: FN-8721
Fusion-Task-Lineage: ff78481f-5ecb-4d9b-b21a-a095682372ed
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 16:57:49 -07:00
gsxdsm
0512334e86 FN-8714: fix quality runner CLI argument passthrough
Allow dashboard aggregate quality commands through the pnpm script boundary.

- Normalize pnpm’s leading argument separator before validating runner options
- Add end-to-end aggregate and fail-fast quality-runner coverage with a deterministic fixture
- Document aggregate quality-runner invocation and failure reporting

Files changed:
 docs/testing.md                                    | 15 ++++
 packages/dashboard/scripts/__tests__/quality-runner-fixture.mjs | 18 +++++
 packages/dashboard/scripts/__tests__/run-quality-tests.test.ts | 88 ++++++++++++++++++++++
 packages/dashboard/scripts/run-quality-tests.mjs   | 23 ++++--
 4 files changed, 139 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-8714

Fusion-Task-Lineage: 48dbd434-a9e6-4283-8658-cbaa254a7dc7

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 12:13:52 -07:00
gsxdsm
13f7266b67 FN-8670: reuse model runtime fixtures in engine tests
Share a warmed Pi model runtime across engine catalog tests.

- Add an isolated in-memory model registry fixture backed by a per-file shared runtime.
- Warm the runtime before catalog tests and verify custom-provider registry isolation.
- Document the required fixture pattern for real Pi SDK catalog tests.

Files changed:
 docs/testing.md                                    |  1 +
 .../engine/src/__tests__/_model-runtime-fixture.ts | 40 ++++++++++++++++++++++
 .../custom-providers-openai-completions.test.ts    | 15 +++-----
 .../custom-providers-openai-responses.test.ts      | 15 +++-----
 .../src/__tests__/provider-registration.test.ts    | 33 ++++++++++++------
 5 files changed, 73 insertions(+), 31 deletions(-)

Fusion-Task-Id: FN-8670

Fusion-Task-Lineage: 7410d114-1853-44cc-a09b-a997fbc7f119

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 01:34:43 -07:00
gsxdsm
cced31208e FN-8672: document observed suite-only flakes
Record first-sighting evidence for three suite-only flakes while preserving their substantial test coverage.

- Define the narrow first-sighting observed-register exception and second-sighting quarantine escalation.
- Add reproduction data for the core and engine PostgreSQL-adjacent flakes.
- Validate register metadata, paths, hierarchy segments, and escalation guidance.

Files changed:
 AGENTS.md                                          |  4 ++
 .../suite-only-flakes-observed-register.md         | 74 ++++++++++++++++++++++
 docs/testing.md                                    |  4 ++
 scripts/__tests__/observed-flake-register.test.mjs | 61 ++++++++++++++++++
 4 files changed, 143 insertions(+)

Fusion-Task-Id: FN-8672

Fusion-Task-Lineage: b52c74fb-aa7b-49e3-9f1d-a2c8c577f9c7

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 00:21:14 -07:00
gsxdsm
dd569395e8 FN-8671: isolate triage admission state in tests
Prevent leaked singleton admission state from affecting later triage polling tests.

- Add test-only coordinator reset and inspection seams for all admission categories.
- Stop tracked triage processors before clearing shared reservation and pre-held-slot state.
- Cover teardown behavior and document singleton-state isolation guidance.

Files changed:
 docs/testing.md                                   |  6 ++
 packages/engine/src/__tests__/concurrency.test.ts | 56 ++++++++++++++++
 packages/engine/src/__tests__/triage.test.ts      | 82 ++++++++++++++++++++---
 packages/engine/src/concurrency.ts                | 30 +++++++++
 4 files changed, 166 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-8671

Fusion-Task-Lineage: 41217db4-1fd6-45d6-a846-c57fc3c7052e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 00:14:32 -07:00
gsxdsm
5596d915ab FN-8647: quarantine flaky Kimi K3 catalog test
Quarantine the timing-sensitive Kimi K3 SDK catalog test without changing timeout budgets.

- Reuse the native model registry once per test file.
- Add the observed CI timeout to the dashboard quarantine ledger and config.
- Document validation and timeout-budget preservation requirements.

Files changed:
 docs/testing.md                                    |  8 ++++++++
 ...ister-model-routes-kimi-k3-supplemental.test.ts | 23 ++++++++++++++++++++--
 packages/dashboard/vitest.config.ts                |  8 ++++++++
 scripts/lib/test-quarantine.json                   |  5 +++++
 4 files changed, 42 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-8647

Fusion-Task-Lineage: 31e79677-d923-4003-a8e8-082159334e65

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-31 22:32:18 -07:00
gsxdsm
dfe050e8d4 FN-8640: add FNXC stamp anomaly advisory
Add a non-blocking census for implausible future-dated FNXC stamps.

- Classify tolerated future stamps by timezone plausibility and report notable anomalies.
- Add injectable gate seams and coverage for advisory, report, baseline, and discovery behavior.
- Document the advisory and preserve read-only check-mode baseline handling.

Files changed:
 docs/testing.md                                    |   4 +
 scripts/__tests__/check-fnxc-future-dates.test.mjs | 185 ++++++++
 scripts/check-fnxc-future-dates.mjs                | 495 +++++++++++----------
 3 files changed, 439 insertions(+), 245 deletions(-)

Fusion-Task-Id: FN-8640

Fusion-Task-Lineage: 7e57feb0-95e2-46b9-a1cf-9bd93c40d8e0

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-31 19:03:08 -07:00
gsxdsm
7927c7b58a docs(testing): probe the DOM before theorising about a missing element (#2850)
Earned the hard way this week: three separate causes in `App.test.tsx`
and `board-mobile-view-switch.test.tsx` all presented **identically** as
a missing element, each with a DOM that looked healthy.

| what the test said | what was actually wrong |
|---|---|
| `Unable to find "+ New Task"` | `ListView` rendered its workflow
**skeleton**, which carries the same `list-view` class as the real body
— so the preceding `waitFor(".list-view")` passed |
| `Unable to find role="heading" "New Task"` | `NewTaskModal` **threw**
— an incomplete `vi.mock` was missing `isShortViewport` — and an
`ErrorBoundary` swallowed it |
| `Unable to find [data-testid="switch-to-board"]` | an uncaught render
error **unmounted the entire React root**; the DOM was already empty
three lines earlier |

The part worth recording is the hit rate. **Three theories were offered
before any probe — "the board renders nothing", "i18n is returning
keys", "the FloatingWindow rework" — and all three were wrong.** Three
probes each landed the cause on the first try. Those wrong theories cost
days; the probe is four lines.

The doc records the snippet, what each signal means (`error-boundary` in
the DOM = a swallowed throw, and its text names a missing mock export
exactly; empty DOM with no boundary = unmounted root, so trust the
*first* failing assertion not the reported one; container present but
contents absent = a skeleton standing in), and the corollary for writing
assertions:

> Wait on a marker only the real thing has.

A class shared with a loading or empty state turns *"the list rendered"*
into *"something rendered"*, and the test then fails one line later
against a DOM that looks fine. That is why `list-view-body` exists
(#2834).

Placed under the dashboard testing sections in `docs/testing.md`. Docs
only — no changeset.

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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 15:07:34 -07:00
gsxdsm
bb3bdab999 The ratchet follows the count down — a drop tightens instead of reddening the gate (coordinator item 2) (#2679)
Taken after asking twice for reassignment with no reply, and after the
same failure bit a **third** time. No open PR touches the census CLI, so
this is unowned in practice — **U12, say so if you have started and I
will close this in favour of yours.**

## What changed

A **drop** now tightens the baseline instead of failing. Failing hard
was defensible in isolation — a stale allowance is a hole, since those
guards can return up to the old count while the check stays green. What
it missed:

**The drop is almost never the failing author's to fix.** Eleven files
dropped during one merge wave, none of those PRs re-recorded, and none
of their authors did anything wrong. Measured three times since CI began
gating this: `columnRoles.ts` 0 → 1, then `executor.ts` twice.

A permanently-red gate is a bigger hole than a stale allowance, because
it gets ignored and then nothing is guarded at all. **The rise check —
the ratchet's actual purpose — is untouched and still fails hard.**

## The residual, named rather than glossed

In CI the write is discarded with the runner, so the committed baseline
stays stale until someone commits a tightened one. The exposure is
bounded (regrowth only up to the old count), printed on every run, and
strictly smaller than the exposure from a check people route around.
`--strict --exact` restores hard failure for the pinned end state.

**One writer:** the write is now a named `writeBaseline()` shared by the
tighten path and `--update-baseline`, rather than a second
`writeFileSync`. Two writers for one artifact is how they drift — a
lesson this file already learned once.

## Exercised end to end

| scenario | result |
|---|---|
| drop, `--strict` | exit **0**, `TIGHTENED`, allowance rewritten 9 → 6
|
| drop, `--strict --exact` | exit **1**, baseline untouched |
| rise, `--strict` | exit **1** |
| clean | exit **0** |

Pinned through the real CLI with an isolated baseline. Revert proof:
restoring the hard failure fails **1 of 32**.

## Two of my own mistakes, recorded

**A vacuous assertion, in the case that guards against vacuity.** I
first wrote `expect(allowedAfter).toBeLessThan(4 + allowedAfter)` — true
for every number. Replaced with a comparison against the inflated value
the fixture started from. This file documents that trap repeatedly and I
still walked into it, which is the argument for the mechanical revert
check over careful reading.

**The env override is `FUSION_CENSUS_BASELINE_PATH`**, not the
`FUSION_CENSUS_BASELINE` I used in the first draft — so the first
version of these cases silently ran against the **real** baseline and
passed for the wrong reason. A test whose fixture never took effect is
the same failure as a test whose fixture can't fail.

## Verification

32/32 census suites, `pnpm test:gate` **71/71**, `--strict` exits 0,
`pnpm lint` clean, `docs/testing.md` updated.

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

---

## Update — the base-ref ratchet (review round 2, commit `4895845579`)

The first version of this PR shipped a **named residual**: the
tightening write dies with the CI runner, so the committed allowance
stays high and a later PR can regrow guards up to it while `--strict`
prints green. I called the exposure bounded and moved on. Greptile
flagged it P1 and was right — naming a hole is not closing one.

`--strict` now stops trusting the committed number for files the branch
touched. It measures each **changed** file at the base commit
(`FUSION_CENSUS_BASE_REF`, else the PR base branch, else `origin/main`)
and fails if the file carries more guards than the base ref has. **The
enforced ceiling is what main has today**, so a stale, missing, or
long-unrecorded baseline no longer opens a window.

| decision | why |
|---|---|
| changed files only, `<ref>...HEAD` | untouched files have main's
counts by construction; censusing all ~400 at the base ref is ~400 `git
show` calls to re-derive numbers that cannot have moved. Three-dot also
stops charging this branch for guards that landed on main after the
fork. |
| a new file's base allowance is **0** | "absent at the base ref" as
unbounded would make a new file the cheapest place to hide a fresh guard
|
| fails **open** on an unresolvable ref, printing `SKIPPED` | a shallow
clone cannot produce an honest comparison; a degraded run must not read
as a clean one. The baseline comparison still applies. |
| merged into the existing `regressions` list | one failure per file,
and `--update-baseline` keeps working as the deliberate escape hatch. No
new exit path. |

**Revert proof, measured both ways.** With the base-ref block removed,
the regrowth fixture — base commit 2 guards, HEAD 5, baseline allowing 9
— exits **0** with `TIGHTENED`, which is precisely the reported
scenario. With it: exit **1**, `column-guard count ROSE`, `above its
count on the base ref`, baseline left at 9. **3 of the 4** end-to-end
cases go red on revert. The fourth passes without the fix by design — it
is the genuine-conversion case the auto-tighten exists to keep green,
and a case that reddens either way proves nothing.

The end-to-end suite builds a throwaway two-commit `git init` repo under
the temp dir, because this exploit is a property of the **plumbing**,
not of the comparison: resolving a ref, working out the changed set,
reading base source through `git show`. The comparator itself is pure
with the reader injected (`findRegrowthAgainstBase`), with its own cases
in `lifecycle-column-census-ast.test.ts` — including the one that would
silently pass everything, looking up the wrong key in
`summarize().byFile`.

**Rebased onto `origin/main` @ bc782d8d92** (the branch was forked
before the recent merge wave; its baseline read 746 against a tree of
722).

Verification on the rebased branch: census **722** / `--strict` exit 0 ·
**70/70** across both census suites · `pnpm test:gate` **71/71** · `pnpm
lint` clean.

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-30 02:56:08 -07:00
gsxdsm
8e211d1870 TAKING scripts/: parse instead of grep — an AST classifier for the lifecycle-column bar, cross-checked by a second implementation (#2633)
The program's completion bar is "`column === "triage"` reaches zero".
This measures what that bar actually covers, and checks the measurement
in so it cannot drift.

## The number, measured by the checked-in tool

```
lifecycle-column-census: scanned 1956 source files

  COLUMN guards (the backlog):   1031
  ROLE comparisons (not guards):   10
  DELIBERATE-LITERAL (reviewed):    4

  by column id:
     313  done
     217  in-review
     201  in-progress
     177  archived
      83  todo
      40  triage

  top files:
     151  packages/engine/src/executor.ts
     136  packages/engine/src/self-healing.ts
      50  packages/dashboard/app/components/TaskCard.tsx
      44  packages/core/src/task-store/moves.ts
      34  packages/dashboard/app/components/TaskDetailModal.tsx
```

**`triage` is under 4% of the class.** Every one of those 1031 sites is
the same defect: a lifecycle decision made by column NAME, which stops
matching the moment a board renames a column. The bar can be met in full
while 991 identical guards remain — and two files hold a quarter of
them.

## The tracked count is wrong in three directions at once

Each of these cost real work this week, which is why this is a PR and
not a comment.

1. **Vocabulary.** It measures one of six legacy ids.
2. **Receiver.** It is anchored on locals named
`column`/`toColumn`/`fromColumn`, so it never saw the three real guards
in `executor.ts` written against `from` and `originColumn`. One of those
meant completed-but-stranded work was never recovered on a renamed
board, with nothing else owning that state (converted in #2628).
3. **Collision.** `role === "triage"`, `agentType === "triage"`,
`entry.agent === "triage"` compare an **AGENT ROLE**. The planner *lane*
is named `triage` and keeps that name — U11 removed the *column*. Ten
such sites were counted as backlog, and the "obvious" fix (renaming the
role) silently empties the planner's prompt template and mis-binds its
model markers.

A count that is too high and too low simultaneously sends work to the
wrong files while hiding the files that need it. So the census reports
**three separate numbers** and never nets them.

## Proven to fail on the original defect

Not asserted — exercised:

```
$ # reintroduce `task.column === "triage" || task.column === "todo"` into live-agent-count.ts
$ node scripts/lifecycle-column-census.mjs --strict; echo "exit=$?"
  packages/core/src/live-agent-count.ts: 10 -> 12
exit=1
$ # restore the file
$ node scripts/lifecycle-column-census.mjs --strict >/dev/null; echo "exit=$?"
exit=0
```

The CLI also exits 1 when its own file list comes back empty — a guard
that reports success without checking anything is worse than no guard.

## 12 regression cases, split by what they defend

Must catch: all six ids; a guard on a local named `from`/`originColumn`
(verbatim the executor.ts shape); single quotes; negation; several
comparisons on one line.

Must **not** catch: role comparisons; comment prose (two tracked
"guards" in `replan-target.ts` were prose about a filter that lives in
another file); a trailing `// … === "triage"` on a code line; sites
carrying a `DELIBERATE-LITERAL` marker.

Plus: **one marker cannot launder a distant guard in the same file** —
that is how allowlists rot.

## Report-only, deliberately

`--strict` compares per-file counts against
`scripts/lib/lifecycle-column-census-baseline.json` and fails when any
file's count **rises**. It is **not** wired into the merge gate: a
thousand-site backlog cannot be a blocking check the day it is first
measured, and a guard nobody can pass is a guard everyone disables.
Owners tightening their own area re-record the baseline in the PR that
lowers it. This is the ratchet shape the `DELIBERATE-LITERAL` markers
scattered through the program already anticipate.

## Stated limitation

Classification is by receiver **name**, so a future field named `agent`
that holds a column would be misclassified as a role comparison.
Recorded at the site, and it is precisely why the two classes are
reported separately instead of netted into one figure.

## Verification

- 12/12 new cases
(`packages/engine/src/__tests__/lifecycle-column-census.test.ts`)
- `pnpm test:gate` **71/71**; `pnpm lint` clean
- `pnpm census:lifecycle-columns`, `--json`, and `--strict` all
exercised end to end
- documented in `docs/testing.md`; no production code touched

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

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-29 22:52:18 -07:00
gsxdsm
034827f251 FN-8623: restore CDP touch geometry test lane
Restore a dedicated Chromium CDP lane for dashboard touch-geometry coverage.

- Add an opt-in touch-geometry test command and isolated Vitest project.
- Keep the browser-dependent spec out of deep and quality backfill collection.
- Document browser discovery, port, and single-collection requirements.

Files changed:
 docs/testing.md                                    | 10 ++-
 packages/dashboard/package.json                    |  1 +
 .../__tests__/dashboard-test-config-guard.test.ts  | 71 +++++++++++++++++++++-
 .../task-modal-touch-resize-browser.test.ts        |  5 ++
 packages/dashboard/vitest.config.ts                | 28 ++++++++-
 scripts/lib/test-inventory-spec.json               |  3 +-
 6 files changed, 114 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-8623

Fusion-Task-Lineage: eafd7497-9302-49a4-8e9e-aa93c9f56a6f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-26 18:04:28 -07:00
gsxdsm
47087342fc FN-8605: harden tablet touch window controls
Make shared floating dashboard windows reliably movable and resizable on tablet touch viewports.

- Apply a tablet-aware 44px drag and resize hit-target contract to FloatingWindow.
- Preserve phone full-screen sheets below 768px while retaining desktop-hybrid geometry.
- Add geometry, browser touch, and viewport boundary coverage with captured visual evidence.
- Document the shared modal touch contract and release the dashboard fix.

Files changed:
 .changeset/fn-8605-floating-window-touch.md        |   7 ++
 docs/dashboard-guide.md                            |   5 +
 docs/testing.md                                    |   2 +-
 .../dashboard/app/components/FloatingWindow.css    | 116 ++++++++++++++----
 .../dashboard/app/components/FloatingWindow.tsx    |  56 ++++++++-
 .../components/__tests__/FloatingWindow.test.tsx   |  80 +++---------
 .../FloatingWindow.touch-geometry.test.tsx         | 136 +++++++++++++++++++++
 .../FloatingWindowStack.cross-type.test.tsx        |   2 +-
 .../app/hooks/__tests__/useViewportMode.test.ts    |  18 ++-
 packages/dashboard/app/hooks/useViewportMode.ts    |   7 +-
 .../app/task-modal-touch-resize-e2e-fixture.tsx    |  39 +++++-
 .../__screenshots__/fn-8605/phone-fullscreen.png   | Bin 0 -> 11393 bytes
 .../e2e/__screenshots__/fn-8605/tablet-after.png   | Bin 0 -> 14275 bytes
 .../e2e/__screenshots__/fn-8605/tablet-before.png  | Bin 0 -> 14308 bytes
 .../task-modal-touch-resize-browser.test.ts        |  83 +++++++++++++
 15 files changed, 453 insertions(+), 98 deletions(-)

Fusion-Task-Id: FN-8605

Fusion-Task-Lineage: 993c7ed8-c3e9-4673-b0b7-5c50746991a7

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-26 12:51:39 -07:00
gsxdsm
fde3b76a8c FN-8602: enable tablet touch resizing for task modals
Enable touch-driven resizing for task modals on tablet viewports.

- Add tablet touch resize handles and pointer interactions for task and new-task modals.
- Preserve responsive modal sizing while keeping phone layouts fullscreen.
- Add unit, browser, and visual regression coverage with updated documentation.

Files changed:
 .changeset/fn-8602-tablet-touch-resize.md          |   7 +
 docs/dashboard-guide.md                            |   6 +-
 docs/testing.md                                    |   4 +
 packages/dashboard/app/components/NewTaskModal.css |  70 ++++++++++
 packages/dashboard/app/components/NewTaskModal.tsx |  19 ++-
 .../dashboard/app/components/TaskDetailModal.css   |  12 ++
 .../dashboard/app/components/TaskDetailModal.tsx   |   7 +-
 .../app/components/__tests__/NewTaskModal.test.tsx |   4 +
 ...etailModal.responsive-and-dependencies.test.tsx |   1 +
 .../hooks/__tests__/useModalResizePersist.test.tsx |  10 +-
 .../app/hooks/__tests__/useViewportMode.test.ts    |  26 +++-
 .../dashboard/app/hooks/useModalResizePersist.ts   |  26 +++-
 packages/dashboard/app/hooks/useViewportMode.ts    |  13 ++
 packages/dashboard/app/styles.css                  |  16 +++
 .../app/task-modal-touch-resize-e2e-fixture.html   |   5 +
 .../app/task-modal-touch-resize-e2e-fixture.tsx    |  60 ++++++++
 .../__screenshots__/fn-8602/phone-fullscreen.png   | Bin 0 -> 43987 bytes
 .../e2e/__screenshots__/fn-8602/tablet-after.png   | Bin 0 -> 52549 bytes
 .../e2e/__screenshots__/fn-8602/tablet-before.png  | Bin 0 -> 11500 bytes
 .../task-modal-touch-resize-browser.test.ts        | 154 +++++++++++++++++++++
 20 files changed, 424 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-8602

Fusion-Task-Lineage: f07ce22f-f529-4be3-ba1b-04063154a1b0

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-26 12:12:35 -07:00
gsxdsm
2a2b157cb9 FN-8585: fix dashboard composer test source reads
Stabilize dashboard composer tests when Vitest launches from the workspace root.

- Resolve dashboard test source fixtures relative to the app directory.
- Migrate affected component tests away from cwd-relative CSS reads.
- Enforce the fixture convention in test hooks and document it.

Files changed:
 docs/testing.md                                    |  4 +++
 package.json                                       |  6 ++--
 .../__tests__/AuthTokenRecoveryDialog.test.tsx     |  3 +-
 .../components/__tests__/ChatView.mobile.test.tsx  |  5 +--
 .../__tests__/EngineControlMenu.test.tsx           | 11 ++----
 .../components/__tests__/FloatingWindow.test.tsx   |  5 +--
 .../app/components/__tests__/ListView.test.tsx     |  5 +--
 .../__tests__/MissionInterviewModal.test.tsx       |  3 +-
 .../app/components/__tests__/MobileNavBar.test.tsx |  3 +-
 .../app/components/__tests__/NewTaskModal.test.tsx |  3 +-
 .../__tests__/PlanningModeModal.initial.test.tsx   |  3 +-
 .../PlanningModeModal.ui-interactions.test.tsx     |  7 ++--
 .../components/__tests__/PrCreateModal.test.tsx    |  3 +-
 .../__tests__/QuickChat.persist.test.tsx           |  3 +-
 .../components/__tests__/QuickEntryBox.test.tsx    |  3 +-
 .../components/__tests__/ReportActionMenu.test.tsx |  9 ++---
 .../app/components/__tests__/ReportModal.test.tsx  |  3 +-
 .../__tests__/ShadcnColorPicker.test.tsx           |  3 +-
 .../components/__tests__/TerminalModal.test.tsx    |  3 +-
 .../components/__tests__/ThemeDropdown.test.tsx    |  9 ++---
 .../__tests__/WorkflowNodeEditor.test.tsx          |  5 +--
 .../WorkflowOptionalStepsDropdown.test.tsx         |  3 +-
 .../components/__tests__/WorkflowSwitcher.test.tsx |  5 +--
 .../app/components/__tests__/board-mobile.test.tsx |  4 +--
 .../__tests__/CommandCenterControls.test.tsx       |  6 ++--
 .../__tests__/SystemControlsArea.test.tsx          |  5 +--
 .../__tests__/SystemStatsArea.test.tsx             |  3 +-
 .../command-center/areas/__tests__/areas.test.tsx  |  3 +-
 .../__tests__/KeyboardShortcutsSection.test.tsx    |  3 +-
 .../app/test/__tests__/cssFixture.test.ts          | 35 +++++++++++++++++++
 packages/dashboard/app/test/cssFixture.ts          | 12 +++++++
 .../check-no-cwd-relative-dashboard-test-reads.mjs | 39 ++++++++++++++++++++++
 32 files changed, 162 insertions(+), 55 deletions(-)

Fusion-Task-Id: FN-8585

Fusion-Task-Lineage: 83a35fb6-a29d-4e97-b282-1054c68b8cc9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-25 06:22:23 -07:00
gsxdsm
c5a8421533 FN-8560: forward desktop test telemetry flags
Desktop test execution now preserves CI reporter and JSON output flags.

- Forward caller-selected Vitest reporters and output files through the desktop test wrapper.
- Add coverage for reporter syntax and shard timing command forwarding.
- Document desktop timing artifact requirements.

Files changed:
 docs/testing.md                                    |  7 ++++-
 packages/desktop/scripts/__tests__/test-args.test.ts | 36 ++++++++++++++++++++++
 packages/desktop/scripts/test-args.ts              | 13 ++++++++
 packages/desktop/scripts/test.ts                   |  3 +-
 scripts/__tests__/ci-test-shard.test.mjs           |  9 ++++++
 5 files changed, 66 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-8560

Fusion-Task-Lineage: 2a89b28d-39f6-4949-aec2-1123c36126cf

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-24 05:30:45 -07:00
gsxdsm
f120e6c879 FN-8506: run static checks in verify:fast
Run canonical pretest validators before test-free verification work.

- Derive read-only static check steps from the root pretest script.
- Test fail-fast static-check planning and execution.
- Document the expanded verify:fast gate and correct changeset metadata.

Files changed:
 .changeset/mobile-board-pointercancel-settle.md |   2 +-
 docs/testing.md                                 |   5 +-
 scripts/__tests__/verify-fast.test.mjs          | 105 ++++++++++++++++++++++--
 scripts/verify-fast.mjs                         |  86 ++++++++++++++++---
 4 files changed, 174 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-8506

Fusion-Task-Lineage: 87f74fda-1fd0-4e08-9bfe-51e0c4c9a31d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-22 18:26:33 -07:00
gsxdsm
9002fca9de FN-8497: reduce merge gate wall time
Keep merge-gate coverage focused while running its independent test lanes concurrently.

- Limit PostgreSQL gate coverage to lifecycle and transactional-handoff canaries.
- Run engine and PostgreSQL gate lanes concurrently while preserving failure propagation.
- Enforce canary coverage policy and refresh velocity documentation and history.

Files changed:
 docs/test-velocity-baseline.md                     |  16 +--
 docs/testing.md                                    |   5 +-
 package.json                                       |   2 +-
 packages/core/package.json                         |   2 +-
 .../__tests__/engine-vitest-gate-policy.test.mjs   |  79 +++++++++++++-
 scripts/test-velocity-history.json                 | 115 +++++++++++++++++++++
 6 files changed, 204 insertions(+), 15 deletions(-)

Fusion-Task-Id: FN-8497
Fusion-Task-Lineage: 8777959c-6d8c-4686-a975-d91af2c169ea
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-22 15:47:24 -07:00
gsxdsm
875d057d16 FN-8495: refresh W29 test velocity baseline
Refresh the weekly test velocity publication with the latest measurements.

- Record updated gate, boot smoke, and changed-only test timings.
- Append the W29 velocity history entry and update the published summary.
- Point testing guidance to the canonical weekly velocity workflow.

Files changed:
 docs/test-velocity-baseline.md     |  16 +++---
 docs/testing.md                    |  10 +---
 scripts/test-velocity-history.json | 115 +++++++++++++++++++++++++++++++++++++
 3 files changed, 124 insertions(+), 17 deletions(-)

Fusion-Task-Id: FN-8495

Fusion-Task-Lineage: db432471-13a2-41b1-a951-f735c96456e9

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-22 15:14:34 -07:00
gsxdsm
b85a6b8663 FN-7912: add quarantine-ledger deadline visibility check
Add a report-only script that surfaces flaky-test quarantine entries approaching their 14-day deletion clock, so maintainers can make deliberate rescue-or-expire decisions before entries silently expire.

- Add scripts/check-quarantine-ledger.mjs: reads scripts/lib/test-quarantine.json, computes days-remaining against the existing 14-day deletion clock (shared DELETION_CLOCK_DAYS from scripts/test-velocity-baseline.mjs), and buckets each entry as expired/near/healthy/unknown
- Support --warn-within=<days> (default 5) to tune the near-deadline window, --json for machine-readable output, and --strict as an opt-in local/CI gate (exits 1 on expired/near entries) while default mode stays exit-0 and non-blocking
- Wire pnpm check:quarantine-ledger script in package.json
- Add scripts/__tests__/check-quarantine-ledger.test.mjs covering deadline bucketing/sorting, empty/missing ledger handling, --strict behavior, and --json output shape
- Document the new command and its flags in docs/testing.md under the quarantine ledger/deletion ratchet section

Files changed:
 docs/testing.md                                    |  10 +
 package.json                                       |   1 +
 scripts/__tests__/check-quarantine-ledger.test.mjs | 159 ++++++++++++++++
 scripts/check-quarantine-ledger.mjs                | 202 +++++++++++++++++++++
 4 files changed, 372 insertions(+)

Fusion-Task-Id: FN-7912

Fusion-Task-Lineage: c08e2e09-473a-4ad0-8c27-43cbc3355168

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-12 21:21:10 -07:00
gsxdsm
ad9a72176c FN-7669: pre-bundle @fusion/core gate-safe barrel to cut engine-core gate import-phase cost
Prototype and land a rebuilt-every-run esbuild bundle of the @fusion/core gate-safe barrel closure, collapsing the engine-core gate's per-fork Vite SSR import-phase cost (18 forks x ~430-file closure re-resolved from scratch) into a single file load per fork.

- Add scripts/build-engine-core-gate-bundle.mjs: esbuild-bundles packages/core/src/index.gate.ts (220 first-party files, packages:"external" so third-party/node: imports stay external, treeShaking:false to preserve side effects) into packages/core/.gate-bundle/core.mjs + core.meta.json
- Wire the builder into packages/engine/vitest.config.ts's engine-core project globalSetup (alongside the existing vitest-teardown hook) so the bundle is rebuilt fresh before every gate invocation, and repoint the @fusion/core resolve.alias at the bundled output instead of index.gate.ts source
- Place the bundle output at packages/core/.gate-bundle/ as a sibling of packages/core/node_modules/ (not nested inside it) to avoid Vite SSR's external-dep heuristic, which would otherwise silently defeat vi.mock interception for imports nested in the bundle
- Gitignore packages/core/.gate-bundle/ and add a matching ESLint ignore entry so the generated bundle text is never linted or committed
- Add esbuild ^0.25.12 as a root devDependency (pnpm-lock.yaml updated accordingly)
- Document the pre-bundling rationale, placement constraints, and measured A/B wall-time results in docs/testing.md

Verified: pnpm test:gate passes (335/335 engine-core tests, 63/63 CLI ci-shape tests), engine package typecheck clean, eslint clean on touched files.

Files changed:
 .gitignore                                |  11 ++
 docs/testing.md                           |   3 +
 eslint.config.mjs                         |  10 ++
 package.json                              |   1 +
 packages/engine/vitest.config.ts          |  50 ++++++++-
 pnpm-lock.yaml                            |   3 +
 scripts/build-engine-core-gate-bundle.mjs | 174 ++++++++++++++++++++++++++++++
 7 files changed, 247 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-7669

Fusion-Task-Lineage: 62b06b2a-4ac6-45ae-ac79-9771132bc303

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-08 04:24:30 -07:00
gsxdsm
6902077972 FN-7667: add gate-scoped @fusion/core barrel to decouple engine-core gate from full barrel growth
Introduces a project-scoped @fusion/core barrel used only by the engine-core
gate project, so new feature modules added to the full barrel don't silently
inflate the gate's transform/import cost.

- Add packages/core/src/index.gate.ts, a copy of the full @fusion/core barrel
  minus export statements for modules added since the last re-audit baseline
  (i.e. it still re-exports everything the full barrel does except newly
  added, gate-irrelevant feature modules).
- Update packages/engine/vitest.config.ts to add a project-scoped
  resolve.alias mapping @fusion/core -> packages/core/src/index.gate.ts for
  the engine-core project only; engine-default/engine-reliability/engine-slow
  and @fusion/engine continue to resolve the full barrel.
- Document the gate-safe barrel and its audit procedure in docs/testing.md.

Files changed:
 docs/testing.md                  |    3 +
 packages/core/src/index.gate.ts  | 2102 ++++++++++++++++++++++++++++++++++++++
 packages/engine/vitest.config.ts |   17 +
 3 files changed, 2122 insertions(+)

Fusion-Task-Id: FN-7667

Fusion-Task-Lineage: 054ec89a-d973-44dd-b9ac-ad266f553f01

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-08 03:28:37 -07:00
Phil Larson
9432339363 fix: keep dashboard available after planning failures 2026-06-30 23:35:27 -07:00
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
5ab4a5961c FN-7119: rescue quarantined engine and CLI tests
Restore quarantined scheduler/reliability coverage while preserving override column-agent model selection.

- remove rescued engine and CLI tests from quarantine configs and the ledger
- add scheduler fake updateSettings coverage so heartbeat writes do not skew call-count assertions
- preserve override column-agent runtime models during initial execution and mid-flight task edits
- update the stale user-configured command guard registry and add a patch changeset

Files changed:
 .changeset/fn-7119-column-agent-model.md           |  7 +++
 docs/testing.md                                    |  2 +
 packages/cli/vitest.config.ts                      |  6 +-
 .../executor-column-agent-principal.test.ts        | 34 +++++++++-
 .../lease-recovery-central-claim.test.ts           |  5 ++
 .../owning-node-unavailable-interactions.test.ts   |  5 ++
 .../todo-inprogress-flapping.test.ts               |  5 ++
 .../src/__tests__/restart.integration.test.ts      |  8 +++
 .../__tests__/scheduler-ephemeral-toggle.test.ts   |  5 ++
 .../scheduler-node-unreachable-audit.test.ts       |  5 ++
 .../__tests__/scheduler-overlap-starvation.test.ts |  5 ++
 .../user-configured-command-no-execsync.test.ts    | 12 +---
 packages/engine/src/executor.ts                    | 18 ++++--
 packages/engine/vitest.config.ts                   | 26 +++-----
 scripts/lib/test-quarantine.json                   | 73 +---------------------
 15 files changed, 106 insertions(+), 110 deletions(-)

Fusion-Task-Id: FN-7119
Fusion-Task-Lineage: 7dc033c8-29d1-4c0e-bfc1-b0ff0d325f43
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 10:50:33 -07:00
gsxdsm
2b554142f5 FN-7056: guard configured commands against execSync
Add a focused engine regression guard for user-configured command paths.

- Add a static Vitest registry that slices protected configured-command helpers and fails on execSync usage.
- Assert each protected command path keeps bounded async safeguards such as timeout, maxBuffer, or maxLifetimeMs.
- Document the guard and its deliberate git-plumbing exclusions in the testing guide.

Files changed:
 docs/testing.md                                    |   5 +
 .../user-configured-command-no-execsync.test.ts    | 288 +++++++++++++++++++++
 2 files changed, 293 insertions(+)

Fusion-Task-Id: FN-7056

Fusion-Task-Lineage: b92f19cf-526e-4345-b18e-869a278e0e10
2026-06-26 04:11:04 -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
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
a9193df997 docs(verification): instruct agents not to use allowFullSuite unless necessary
Strengthen the fn_run_verification allowFullSuite parameter description, add an
AGENTS.md standing rule, and update docs/testing.md so agents default to a
file-scoped verification command and reserve allowFullSuite for genuinely full
runs with no targetable test set. allowFullSuite is the main way verification
balloons past its budget; the thin merge gate is the cross-cutting safety net.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 16:22:40 -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
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
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
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
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
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
254f31ebb6 FN-6790: quiesce deferred task-created writes on close
Rescue task-document coverage by making TaskStore teardown stop late deferred task-created filesystem work.

- Track deferred title write and task-created hook phases so close can drain active work.
- Skip late deferred task-created work once a store is closing to avoid recreating removed fixture roots.
- Update task-document regression coverage, harness teardown awaiting, and rescue documentation while keeping task-documents loaded.

Files changed:
 docs/testing.md                                    |  4 ++
 packages/core/src/__tests__/store-test-helpers.ts  |  2 +-
 packages/core/src/__tests__/task-documents.test.ts | 39 ++++++++++-
 packages/core/src/store.ts                         | 75 +++++++++++++++-------
 packages/core/vitest.config.ts                     |  3 +
 5 files changed, 96 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-6790

Fusion-Task-Lineage: c458fc4a-b2b4-4cc4-9d88-da8c43f6916d
2026-06-20 05:53:46 -07:00
gsxdsm
24fd4952bb FN-6753: isolate routes-auth from dashboard backfill
Preserve auth route coverage by moving the suite out of the contended API backfill shard.\n\n- Add routes-auth to the curated dashboard API quality shard.\n- Document the FN-6753 suite-load coupling classification and shard-isolation remedy.\n\nFiles changed:\n docs/testing.md                     | 4 ++++\n packages/dashboard/vitest.config.ts | 7 ++++++-\n 2 files changed, 10 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6753

Fusion-Task-Lineage: 4da2f45f-87ba-4b80-baed-68dbde93a09e
2026-06-20 00:30:54 -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
gsxdsm
f01ede2523 FN-6742: rescue session cross-tab tests
Rescue the dashboard session cross-tab test before its deletion-ratchet deadline.

- Dispose the API router and session cleanup scheduler before closing test stores.
- Hide unused TaskStore EventEmitter hooks in the route-only harness to avoid background route subscribers reopening temp fixtures.
- Remove the session-cross-tab quarantine ledger entry and dashboard Vitest exclude in lockstep.
- Document the rescue evidence and teardown pattern for future dashboard session tests.

Files changed:
 docs/testing.md                                    |  6 ++++-
 .../src/__tests__/session-cross-tab.test.ts        | 30 +++++++++++++++++++---
 packages/dashboard/vitest.config.ts                |  5 +++-
 scripts/lib/test-quarantine.json                   |  5 ----
 4 files changed, 36 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-6742

Fusion-Task-Lineage: e26d70eb-f139-45f7-8ddd-bde2d172c291
2026-06-19 16:47:34 -07:00
gsxdsm
8d2b396e85 FN-6741: rescue core quarantine entries
Rescue the loaded @fusion/core quarantine batch while keeping the remaining lock flake quarantined.

- Remove rescued core test files from the quarantine ledger and Vitest exclude list.
- Close the settings-export TaskStore before fixture cleanup to release resources deterministically.
- Re-quarantine the store-concurrent-writes broad-lane SQLite lock flake observed during merge verification.
- Document the rescue evidence and remaining deletion-ratchet follow-up.

Files changed:
 docs/testing.md                                    |  8 ++++++-
 .../core/src/__tests__/settings-export.test.ts     |  5 ++++
 packages/core/vitest.config.ts                     | 11 +++++----
 scripts/lib/test-quarantine.json                   | 27 +---------------------
 4 files changed, 19 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-6741

Fusion-Task-Lineage: 064367a6-f1c4-4685-a766-37bf2204a42c
2026-06-19 16:47:34 -07:00
gsxdsm
2da55a8994 FN-6740: document quarantine ratchet follow-ups
Document the same-day flaky-test quarantine audit and ownership plan.\n\n- Record the 2026-06-19 quarantine batch expiration date and ledger/config lockstep status.\n- Split follow-up ownership across CLI, core, and dashboard quarantine rescue/delete work.\n- Add an FNXC comment explaining why the coordinated audit should stay scoped by subsystem.\n\nFiles changed:\n docs/testing.md | 4 ++++\n 1 file changed, 4 insertions(+)

Fusion-Task-Id: FN-6740

Fusion-Task-Lineage: eba08900-18d6-4768-ac8a-c673f89537ca
2026-06-19 16:47:33 -07:00
gsxdsm
259cdfb531 FN-6734: stabilize CLI extension test cleanup
Stabilize the CLI extension regression lane by closing cached stores before temp fixture removal.

- Close extension store caches and manually created TaskStore/AgentStore handles before deleting per-test fixture roots.
- Add a regression guard for the cached TaskStore close-before-remove invariant.
- Reduce oversized task-list truncation fixtures while preserving bounded-output assertions.
- Document the CLI affected-lane rescue pattern for store leaks, fixture sizing, and runtime-dist mocking order.

Files changed:
 docs/testing.md                                    |   4 +
 .../extension-agent-set-instructions.test.ts       |   3 +-
 .../__tests__/extension-goal-tools-audit.test.ts   |   3 +-
 .../cli/src/__tests__/extension-goal-tools.test.ts |   3 +-
 .../cli/src/__tests__/extension-insights.test.ts   |   3 +-
 .../__tests__/extension-mission-goal-tools.test.ts |   3 +-
 packages/cli/src/__tests__/extension.test.ts       | 221 +++++++++++++--------
 .../src/__tests__/research-extension-tools.test.ts |  40 +++-
 8 files changed, 186 insertions(+), 94 deletions(-)

Fusion-Task-Id: FN-6734

Fusion-Task-Lineage: efe91c0f-f84c-471c-8067-65a244b2aec7
2026-06-19 16:47:33 -07:00