Commit Graph

325 Commits

Author SHA1 Message Date
gsxdsm
7ecf5e2b9c fix: resolve main-branch CI test failures
Two failures surfaced in the full-suite run on main (28697507894):

1. dashboard session-reconnect.test.ts — real bug. The planning
   "replays buffered events" test hung at the 15s timeout because
   FN-7444 (planning summary deepening checkpoint) now holds the
   completed summary behind a mandatory checkpoint question instead
   of finalizing on the agent's "complete" payload. The stream route
   never observed session.summary and subscribed forever. Fix: respond
   to the deepening checkpoint with the reserved proceed option so
   finalizePendingSummary runs, session.summary is set, and the
   summary/complete events are buffered for SSE replay. Reproduced
   locally (15s hang) and verified green (4/4).

2. cli extension.test.ts — loaded-lane CI flake. The built-dist-barrel
   fn_task_list test timed out at 5000ms under 4-shard contention while
   passing locally (~1.2s body) and in 3 of the 4 surrounding runs.
   Root cause is in-test dist-barrel recompilation inside the default
   5s timeout (vi.resetModules + vi.importActual of the full core dist
   + fresh dynamic import), the same signature rescued in
   FN-6483/FN-6705/FN-6795/FN-6839. Quarantined on sight per the
   flaky-test rule (ledger + matching vitest exclude) rather than
   widening the timeout or loosening assertions; the sibling
   source-@fusion/core test covers the identical truncation invariant.
2026-07-04 00:26:49 -07:00
gsxdsm
20184acdfd FN-7486: fix no-diff merge recovery ownership checks
Fix no-op task branch recovery by recognizing canonical branches with no unique diff before rejecting inherited foreign trailers.

- Add no-diff ownership classification for already-merged detection when canonical task branches inherit another task's landed commit.
- Teach self-healing and branch-misbound recovery to ignore foreign branch-tip trailers only for branches proven to have no unique task diff.
- Skip synthetic verify:fast typechecks for JavaScript alias packages without tsconfig files and cover the behavior with tests.
- Add regression coverage and a patch changeset for the recovery fix.

Files changed:
 .changeset/fn-7486-merge-recovery-noop-ownership.md       |  7 ++
 .../already-merged-detector.real-git.test.ts       | 68 +++++++++++++++++
 .../self-healing-already-merged.real-git.test.ts   | 89 ++++++++++++++++++++--
 packages/engine/src/already-merged-detector.ts     | 88 +++++++++++++++------
 packages/engine/src/self-healing.ts                | 61 +++++++++++++--
 scripts/__tests__/verify-fast.test.mjs             | 16 +++-
 scripts/verify-fast.mjs                            | 15 +++-
 7 files changed, 303 insertions(+), 41 deletions(-)

Fusion-Task-Id: FN-7486

Fusion-Task-Lineage: 4185c6ed-9731-4ffc-b033-34bf0c3a83ad

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-03 22:04:45 -07:00
gsxdsm
4be9275747 FN-7463: refresh test feedback baseline docs
Refresh the weekly test feedback-loop baseline and carry operator notes through the reporting helper.

- Add the 2026-W27 baseline snapshot with updated gate, pnpm test, quarantine, and slowest-test data.
- Refresh the published Markdown summary and trend table for #leads.
- Preserve operator notes in Markdown and printed leads summaries, with regression coverage for notes and empty live quarantine ledgers.

Files changed:
 docs/test-feedback-loop-baseline.md               |  52 +++++-----
 docs/test-feedback-loop-baselines.json            | 113 ++++++++++++++++++++++
 scripts/__tests__/test-feedback-baseline.test.mjs |  72 +++++++++++++-
 scripts/test-feedback-baseline.mjs                |  10 +-
 4 files changed, 219 insertions(+), 28 deletions(-)

Fusion-Task-Id: FN-7463

Fusion-Task-Lineage: 2279c412-5371-41dd-81d1-7fc397bb349a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-03 07:47:03 -07:00
gsxdsm
bd24bd4c82 fix(build): make root workspace build run on Windows
Two Windows-only breakages in the build path:

- scripts/build-workspace.mjs: the "run as main" guard compared import.meta.url
  to `file://${process.argv[1]}`, which never matches on Windows (import.meta.url
  is file:///C:/… with forward slashes and a triple slash; argv[1] is C:\… with
  backslashes and no scheme). So `pnpm build` at the repo root silently no-opped
  (exit 0, no output, no dist) and packaging shipped empty/stale dist. Compare
  against pathToFileURL(process.argv[1]).href instead.

- scripts/build-workspace.mjs runPlannedBuilds and packages/cli/tsup.config.ts
  runWorkspaceCommand spawned `pnpm` without shell:true; on Windows pnpm is a
  .cmd shim Node refuses to spawn without a shell (ENOENT/EINVAL, CVE-2024-27980),
  failing with `spawn pnpm ENOENT`. Pass shell on win32 (args are fixed repo build
  invocations with no shell metacharacters).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-02 15:20:17 -07:00
gsxdsm
9d89cb8d32 FN-7420: fix test velocity quarantine reporting
Refresh the test velocity baseline and coverage so quarantine counts come from the live ledger.\n\n- Update the weekly baseline report to show zero active quarantines and a neutral delta.\n- Strengthen the report-only regression test to cover stale report and history quarantine values.\n- Document the FN-7420 requirement near the regression scenario.\n\nFiles changed:\n docs/test-velocity-baseline.md                    | 10 +++++-----\n scripts/__tests__/test-velocity-baseline.test.mjs | 10 +++++++---\n 2 files changed, 12 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-7420

Fusion-Task-Lineage: 9144ddb5-3a72-4a37-a1d1-471871f3cbc4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-02 11:38:32 -07:00
gsxdsm
4178e7d325 FN-7415: Delete stale executor pause quarantine
Delete the expired executor pause quarantine and its stale direct-dispatch coverage.

- Remove the obsolete executor-pause test suite after the graph runtime cutover.
- Clear the matching Vitest exclude and quarantine-ledger entry.
- Refresh test audit, timing, line-count, and planning references for the deleted suite.

Files changed:
 ...7-001-refactor-workflow-runtime-cutover-plan.md |    2 +-
 docs/test-value-audit.json                         |  102 -
 .../engine/src/__tests__/executor-pause.test.ts    | 3061 --------------------
 packages/engine/vitest.config.ts                   |    5 -
 scripts/__tests__/test-velocity-baseline.test.mjs  |    2 +-
 scripts/lib/test-quarantine.json                   |    8 +-
 scripts/line-count-baseline.json                   |    1 -
 scripts/test-timings.json                          |    1 -
 8 files changed, 3 insertions(+), 3179 deletions(-)

Fusion-Task-Id: FN-7415
Fusion-Task-Lineage: 3d1551c8-1353-47cb-a70f-d88e733a6652
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-02 11:38:31 -07:00
gsxdsm
00ce5d6a27 FN-7414: refresh test velocity quarantine baseline
Refresh the velocity baseline artifacts so live quarantine counts are reflected consistently.

- Add regression coverage for live quarantine ledger counts overriding stale report and history values.
- Update the weekly velocity baseline report to show the current quarantine count and deltas.
- Append the latest measured velocity history row with quarantine count one.

Files changed:
 docs/test-velocity-baseline.md                    |  22 ++---
 scripts/__tests__/test-velocity-baseline.test.mjs |  75 +++++++++++++++
 scripts/test-velocity-history.json                | 112 ++++++++++++++++++++++
 3 files changed, 198 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-7414

Fusion-Task-Lineage: 7c6cd47c-482d-426c-a714-79da33d4591d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-02 11:38:31 -07:00
gsxdsm
627c5fb0bd FN-7371: clarify CI mode regression guard
Clarifies the test-infrastructure regression guard for CI mode selection.\n\n- Update the FNXC rationale for the CI=true --print-mode subprocess test.\n- Document that full-suite mode remains an explicit opt-in via --full or FUSION_TEST_FULL.\n\nFiles changed:\n scripts/__tests__/test-changed.test.mjs | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-7371

Fusion-Task-Lineage: b7482ef1-4db7-4003-85f7-3466470d3dff

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-01 10:04:55 -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
94ddfe1064 FN-7274: document workflow tools in Fusion skill
Document the workflow-authoring tool surface in the packaged Fusion skill references.

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

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

Fusion-Task-Id: FN-7274

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

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-30 08:04:12 -07:00
gsxdsm
a766813ed9 FN-7239: scope executor prompts and quarantine stale pause test
Scope missing executor prompts safely while keeping graph coverage aligned with the post-cutover workflow route.

- Treat absent executor prompts as empty before worktree path scoping.
- Update graph retry, parity, and smoke expectations for plan review, completion summary, and post-merge traversal.
- Quarantine only the stale executor-pause direct-dispatch suite with a ledger entry and engine-default exclude.

Files changed:
 .changeset/fn-7239-scope-prompt-guard.md           |  7 ++++
 .../engine/src/__tests__/executor-pause.test.ts    | 10 +++++
 .../src/__tests__/task-pipeline-smoke.test.ts      |  7 ++++
 .../workflow-graph-executor-parity.test.ts         | 15 ++++++-
 ...ow-graph-executor-retry-coding-workflow.test.ts | 48 +++++++++++++++++-----
 packages/engine/src/executor.ts                    | 15 ++++---
 packages/engine/vitest.config.ts                   |  5 +++
 scripts/lib/test-quarantine.json                   |  8 +++-
 8 files changed, 97 insertions(+), 18 deletions(-)

Fusion-Task-Id: FN-7239

Fusion-Task-Lineage: 9382e4e0-7cfc-416a-93e8-6ba1c7cd7879

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-29 14:17:29 -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
f42b49ab2d FN-7105: add CI print-mode regression guard
Add regression coverage ensuring CI=true no longer forces test-changed into full-suite mode.

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

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

Fusion-Task-Id: FN-7105

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

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 09:28:30 -07:00
gsxdsm
1f49cea6c0 FN-7092: refresh test velocity snapshots
Refresh the weekly test velocity baseline after the pnpm test lane recovered.

- Update the latest baseline with green gate, boot smoke, and pnpm test timings.
- Drop stale timing rows for removed or split test files.
- Append the new weekly history entry with current slowest-file data.

Files changed:
 docs/test-velocity-baseline.md     |  48 +++++++---------
 scripts/test-timings.json          |  14 +----
 scripts/test-velocity-history.json | 112 +++++++++++++++++++++++++++++++++++++
 3 files changed, 133 insertions(+), 41 deletions(-)

Fusion-Task-Id: FN-7092

Fusion-Task-Lineage: 0b2cfa7a-953b-4cf8-ac4b-c81a0580a4e0

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 09:28:29 -07:00
gsxdsm
9020f5774e test: quarantine 11 failing CI full-suite tests
Quarantine test files consistently failing on the non-blocking full-suite
CI on main, per the AGENTS.md deletion-ratchet policy:

Engine-default (shard 1-2): ce-workflow-step-conventions,
executor-column-agent-principal, restart.integration,
scheduler-node-unreachable-audit, scheduler-overlap-starvation,
scheduler-ephemeral-toggle, user-configured-command-no-execsync

Engine-reliability (shard 1): lease-recovery-central-claim,
owning-node-unavailable-interactions, todo-inprogress-flapping

CLI (shard 3): extension.test.ts

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-26 21:49:32 -07:00
gsxdsm
513882ecac FN-7087: speed up SettingsModal remote tests
Optimize the SettingsModal remote-notifications shard by rendering target sections directly.

- Add a section-targeted SettingsModal test harness helper.
- Reuse the no-delay shared user event instance across remote-notifications tests.
- Update velocity baseline documentation and history with the faster shard timing.

Files changed:
 docs/test-velocity-baseline.md                     |  72 +++---
 .../SettingsModal.remote-notifications.test.tsx    | 279 ++++++++-------------
 .../__tests__/SettingsModal.test-harness.tsx       |  16 ++
 scripts/test-velocity-history.json                 | 119 +++++++++
 4 files changed, 275 insertions(+), 211 deletions(-)

Fusion-Task-Id: FN-7087

Fusion-Task-Lineage: aec39ac9-dd6a-49b5-96c2-07a8d0a119b7

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

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

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

Fusion-Task-Id: FN-7079

Fusion-Task-Lineage: d641adc3-f991-4d95-bcb2-7b20bbfeb0bb
2026-06-26 15:50:40 -07:00
gsxdsm
0afc66b6be FN-7068: rescue quarantined flaky tests
Rescue quarantined dashboard and engine tests before the deletion deadline.

- Realign the DevServerView mobile CSS test with split mobile rules and balanced at-rule extraction.
- Complete FN-5488 self-healing TaskStore fakes for overlap-scope paths.
- Remove rescued dashboard and engine tests from quarantine configs and the ledger.

Files changed:
 .../__tests__/DevServerView.mobile.test.tsx        | 74 ++++++++++++++++++----
 packages/dashboard/vitest.config.ts                |  8 +--
 ...in-review-merge-stall-deadlock-recovery.test.ts |  7 ++
 ...f-healing-fn-5488-fast-path-regressions.test.ts |  6 ++
 packages/engine/vitest.config.ts                   |  8 +--
 scripts/lib/test-quarantine.json                   | 18 +-----
 6 files changed, 79 insertions(+), 42 deletions(-)

Fusion-Task-Id: FN-7068

Fusion-Task-Lineage: b40a551f-8981-49a1-86a3-660f08cceb94
2026-06-26 13:32:35 -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
3c66c33cd9 FN-7050: repair route and executor line ceilings
Repair the line-count ratchet baseline for focused route and executor drift.

- Add FN-7050 context to the line-count guardrail comments.
- Raise only the routes.ts and executor.ts grandfathered ceilings to match current drift.
- Preserve unrelated baseline entries for separate scoped repairs.

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

Fusion-Task-Id: FN-7050

Fusion-Task-Lineage: 8a57d331-4abf-42bd-a4c9-2f55607a6262
2026-06-25 23:34:08 -07:00
gsxdsm
cc67df9e61 FN-7046: re-ratchet core line-count baselines
Repair the scoped core store/type baseline drift without broadening unrelated line-count debt.

- Add the FN-7046 CI note explaining the scoped re-ratchet for store.ts and types.ts.
- Raise only the core store.ts and types.ts grandfathered ceilings to their current generated sizes.

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

Fusion-Task-Id: FN-7046

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

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

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

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

test-changed 118/118, eslint clean.

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

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

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

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

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

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 21:42:22 -07:00
gsxdsm
b663eebcb3 FN-7035: split oversized test suites
Split oversized ChatView and notifier suites while updating the line-count baseline.

- Move ChatView core contract and interaction coverage into focused sibling test files.
- Move notifier runtime coverage into its own suite and share setup through a test harness.
- Document the line-count guard decision and ratchet baseline entries for existing growth.

Files changed:
 .../__tests__/ChatView.core-contracts.test.tsx     |  623 ++++++++
 .../__tests__/ChatView.core-interactions.test.tsx  | 1261 +++++++++++++++
 .../components/__tests__/ChatView.core.test.tsx    | 1652 +-------------------
 .../engine/src/__tests__/notifier.runtime.test.ts  |  810 ++++++++++
 .../engine/src/__tests__/notifier.test-harness.ts  |   71 +
 packages/engine/src/__tests__/notifier.test.ts     |  847 +---------
 scripts/check-file-line-count.mjs                  |    3 +
 scripts/line-count-baseline.json                   |   12 +-
 8 files changed, 2778 insertions(+), 2501 deletions(-)

Fusion-Task-Id: FN-7035
Fusion-Task-Lineage: 14cebb57-925b-41c7-9c8b-472f34b76fe2
2026-06-25 20:50:30 -07:00
gsxdsm
8297762eeb Address PR review feedback (#1780)
- P2: filter directly-changed test files to paths that still exist on disk
  (existingChangedTestFilesInPackage) so deleted/renamed .test paths from
  `git diff` never reach `vitest run` positionally; all-deletions diff falls
  into the delegate-to-gate path.
- P1: make heavy-package delegation gate-coverage-aware
  (GATE_COVERED_MEMORY_ENVELOPE_PACKAGES). Engine delegation keeps the accurate
  "curated engine-core subset ran above" note; dashboard delegation now warns
  that the gate runs no dashboard tests and names the CI full-suite backstop,
  so the coverage gap is loud instead of a silent false-green.
- +4 regression tests (115/115).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-25 20:17:56 -07:00
gsxdsm
c0958bfd4f FN-7029: split AI merge prompts and worktree helpers
Split the clean-room AI merger into smaller focused modules while preserving its public behavior.

- Extract prompt builders and review verdict parsing into merger-ai-prompts.
- Extract AI merge worktree lifecycle and cleanup helpers into merger-ai-worktree.
- Re-export the extracted APIs from merger-ai and cover prompt/verdict behavior with tests.
- Remove the merger-ai line-count baseline now that the file is under the guardrail.

Files changed:
 .../engine/src/__tests__/merger-ai-prompts.test.ts |  86 ++++
 packages/engine/src/merger-ai-prompts.ts           | 312 ++++++++++++
 packages/engine/src/merger-ai-worktree.ts          | 287 +++++++++++
 packages/engine/src/merger-ai.ts                   | 555 ++-------------------
 scripts/line-count-baseline.json                   |   1 -
 5 files changed, 723 insertions(+), 518 deletions(-)

Fusion-Task-Id: FN-7029

Fusion-Task-Lineage: 59adc31f-7386-4008-b74f-8fb9bbae078a
2026-06-25 20:12:20 -07:00
gsxdsm
e48f80b764 FN-7028: split AgentLogViewer tests by concern
Split the large AgentLogViewer suite into focused, line-count-friendly test files.

- Move header, layout, markdown, and rendering coverage into separate test modules.
- Add a shared AgentLogViewer test helper for reusable setup.
- Remove the oversized combined AgentLogViewer test and update the line-count baseline.

Files changed:
 .../__tests__/AgentLogViewer.header.test.tsx       |  490 +++++
 .../__tests__/AgentLogViewer.layout.test.tsx       |  367 ++++
 .../__tests__/AgentLogViewer.markdown.test.tsx     |  797 ++++++++
 .../__tests__/AgentLogViewer.rendering.test.tsx    |  410 ++++
 .../__tests__/AgentLogViewer.test-helpers.ts       |   16 +
 .../components/__tests__/AgentLogViewer.test.tsx   | 2010 --------------------
 scripts/line-count-baseline.json                   |    1 -
 7 files changed, 2080 insertions(+), 2011 deletions(-)

Fusion-Task-Id: FN-7028

Fusion-Task-Lineage: 5ef134c7-0969-4b9b-908c-9713daa9d0d2
2026-06-25 19:51:21 -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
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