Commit Graph

168 Commits

Author SHA1 Message Date
gsxdsm
3e69d3990d FN-6244: protect active AI merge worktrees
Ensure AI merge cleanup only reaps stale, inactive temp worktrees.

- Register live AI merge clean-room paths in the active session registry while merges run.
- Add a minimum temp-worktree reap age and conservative lookup-error handling to sweep and prune paths.
- Expand cleanup tests and release the repaired AI merge cleanup test from quarantine.

Files changed:
 docs/architecture.md                               |  2 +-
 .../engine/src/__tests__/merger-ai-cleanup.test.ts | 38 ++++++++++++++--
 .../__tests__/self-healing-tempdir-sweep.test.ts   | 52 +++++++++++++++++++---
 packages/engine/src/active-session-registry.ts     |  2 +-
 packages/engine/src/merger-ai.ts                   | 29 +++++++++++-
 packages/engine/src/self-healing.ts                | 28 +++++++++---
 packages/engine/vitest.config.ts                   |  1 -
 scripts/lib/test-quarantine.json                   |  5 ---
 8 files changed, 132 insertions(+), 25 deletions(-)

Fusion-Task-Id: FN-6244

Fusion-Task-Lineage: 5c8ced12-d38f-4e45-9ea0-119b3236a2cb
2026-06-11 15:54:49 -07:00
gsxdsm
bdf813654e fix: resolve botched stash-pop conflict from 245e1280e
- scripts/lib/test-quarantine.json: remove stray <<<<<<< / ======= / >>>>>>> stash markers that broke JSON parsing
- packages/core/src/__test-utils__/vitest-setup.ts: restore \r?\n regex and \n template escapes; drop stray extra brace
2026-06-11 12:24:16 -07:00
gsxdsm
245e1280ed Fix agents 2026-06-11 12:22:02 -07:00
gsxdsm
2add48c8b6 FN-6255: redirect tmpdir mkdtemp calls in tests
Keep test-created temp directories under the Fusion worker root.

- Redirect fs.mkdtemp and fs.promises.mkdtemp prefixes rooted at the OS temp dir into per-process worker sinks.
- Sweep stale redirect sinks and clean current-process sinks on exit.
- Add regression coverage for sync, async, realpath, nested, and Buffer prefix behavior.
- Remove the restored merger file-scope invariant test from quarantine.

Files changed:
 packages/core/src/__test-utils__/vitest-setup.ts   | 119 +++++++++++++++++++--
 .../__tests__/vitest-setup-tmp-redirect.test.ts    |  68 ++++++++++++
 scripts/lib/test-quarantine.json                   |   5 -
 3 files changed, 181 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-6255

Fusion-Task-Lineage: 4cc855c6-37dd-4dfb-a545-1fd1885779c4
2026-06-11 12:18:09 -07:00
gsxdsm
36f5ecdaba FN-6226: skip fast-mode workflow graph validation nodes
Fast execution mode now bypasses custom pre-merge workflow graph validation consistently.

- Skip custom graph prompt, script, and gate nodes for fast-mode tasks while preserving human waits and CLI-agent work.
- Add regression coverage for fast-mode custom workflow behavior and standard-mode/null-mode validation.
- Document fast-mode workflow graph bypass behavior and record the published package changeset.
- Quarantine the unrelated self-healing real-git flake from the engine core gate.

Files changed:
 .changeset/FN-6226-fast-mode-workflows.md          |   5 +
 docs/task-management.md                            |   6 +-
 docs/workflow-steps.md                             |   2 +-
 .../__tests__/executor-fast-mode-workflows.test.ts | 280 +++++++++++++++++++++
 packages/engine/src/executor.ts                    |  16 ++
 packages/engine/vitest.config.ts                   |   1 +
 scripts/lib/test-quarantine.json                   |   5 +
 7 files changed, 313 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6226

Fusion-Task-Lineage: 68d88a7a-e157-4d18-a2c2-9065946066de
2026-06-11 09:21:23 -07:00
gsxdsm
648d3598e0 FN-6206: quarantine flaky engine tests
Move undocumented flaky engine tests into the formal quarantine path.

- add quarantine ledger entries for flaky engine test files observed under concurrent/full-suite load
- exclude the quarantined engine test files from vitest projects so they no longer run in gate and reliability pools
- remove the undocumented it.skip markers by quarantining at the file/config level instead

Files changed:
 .../__tests__/merger-file-scope-invariant.test.ts  |  4 ++--
 .../src/__tests__/project-engine-manager.test.ts   |  2 +-
 packages/engine/vitest.config.ts                   | 10 ++++++++--
 scripts/lib/test-quarantine.json                   | 23 +++++++++++++++++++++-
 4 files changed, 33 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-6206

Fusion-Task-Lineage: 8d88725e-1e92-4a06-aaa6-be34287e613a
2026-06-11 09:21:23 -07:00
gsxdsm
5c42ff1314 FN-6198: unquarantine self-healing db corruption test
Restore the self-healing DB corruption test to the default engine suite.

- remove the engine vitest exclude for self-healing-db-corruption.test.ts
- clear the quarantine ledger entry for the restored test

Files changed:
 packages/engine/vitest.config.ts | 1 -
 scripts/lib/test-quarantine.json | 8 +-------
 2 files changed, 1 insertion(+), 8 deletions(-)

Fusion-Task-Id: FN-6198

Fusion-Task-Lineage: 2466b040-956d-4138-89d5-137d1721081c
2026-06-10 10:00:21 -07:00
gsxdsm
ae63cd9008 FN-6195: isolate and quarantine flaky db-corruption test
Stop the self-healing DB corruption test from leaking into unrelated tmpdir state while quarantining the known flake.

- mock node:os tmpdir usage so the test runs inside a per-test sandbox and cleans it up after each case
- add the flaky self-healing DB corruption test to the engine default exclude list
- record the quarantine entry and failure context in scripts/lib/test-quarantine.json

Files changed:
 .../__tests__/self-healing-db-corruption.test.ts   | 22 ++++++++++++++++++++++
 packages/engine/vitest.config.ts                   |  1 +
 scripts/lib/test-quarantine.json                   |  8 +++++++-
 3 files changed, 30 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6195

Fusion-Task-Lineage: 60f7f6ca-d14d-42b4-b47e-0644a25e64ae
2026-06-10 08:25:31 -07:00
gsxdsm
529851a8fe FN-6191: unquarantine WorkflowNodeEditor inspector test
Rescue the WorkflowNodeEditor quarantine by waiting for inspector fields before asserting.

- make the foreach inspector Mode assertion wait for the panel to finish rendering
- wait for the code node Source and Timeout inputs before editing them to avoid the inspector race
- remove WorkflowNodeEditor.test.tsx from the dashboard quarantine config and ledger

Files changed:
 .../app/components/__tests__/WorkflowNodeEditor.test.tsx          | 6 +++---
 packages/dashboard/vitest.config.ts                               | 4 +---
 scripts/lib/test-quarantine.json                                  | 8 +-------
 3 files changed, 5 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-6191

Fusion-Task-Lineage: 57fb1dcc-3e50-4ba1-8488-fcff204c1d76
2026-06-10 07:11:19 -07:00
gsxdsm
235ad8f9ad FN-6156: rescue board workflow toolbar test
Rescue the dashboard board workflow toolbar coverage and rotate the active quarantine.

- wait for the workflow toolbar itself before asserting board workflow actions in Board.test.tsx
- remove Board.test.tsx from the dashboard vitest quarantine list
- quarantine WorkflowNodeEditor.test.tsx with an updated ledger entry for the newly observed flake

Files changed:
 packages/dashboard/app/components/__tests__/Board.test.tsx | 4 ++--
 packages/dashboard/vitest.config.ts                        | 4 +++-
 scripts/lib/test-quarantine.json                           | 4 ++--
 3 files changed, 7 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-6156

Fusion-Task-Lineage: c91c3542-fdec-426a-8e63-3edb3f5d34e5
2026-06-09 20:55:22 -07:00
gsxdsm
7901607b68 FN-6154: let the mobile node editor fill the screen
Let the mobile workflow node editor inspector use the full available height.

- remove the mobile inspector max-height cap so the editor stage can expand full screen
- update the WorkflowNodeEditor mobile CSS contract test to assert the new max-height rule
- quarantine the unrelated flaky dashboard Board test and record it in the quarantine ledger

Files changed:
 packages/dashboard/app/components/WorkflowNodeEditor.css          | 1 +
 .../app/components/__tests__/WorkflowNodeEditor.css.test.ts       | 1 +
 packages/dashboard/vitest.config.ts                               | 2 +-
 scripts/lib/test-quarantine.json                                  | 8 +++++++-
 4 files changed, 10 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6154

Fusion-Task-Lineage: 14928ad1-dc84-461b-9adf-b5ee079e3b0d
2026-06-09 20:21:58 -07:00
gsxdsm
cca7a61c4f FN-6142: fix mobile visibility restore scroll anchoring
Restore pinned mobile chat scroll position when visibility-driven refetch hooks fire.

- re-anchor mobile chat to the bottom during visibility/pageshow refetch capture when the user was pinned
- tighten ChatView visibility restore regression tests to assert the synchronous re-anchor path directly
- remove the ChatView rooms test quarantine and restore the dashboard include list entry

Files changed:
 packages/dashboard/app/components/ChatView.tsx          |  6 +++++-
 .../app/components/__tests__/ChatView.rooms.test.tsx    | 17 ++++++++---------
 .../app/components/__tests__/ChatView.test.tsx          |  7 ++++---
 packages/dashboard/vitest.config.ts                     |  2 +-
 scripts/lib/test-quarantine.json                        |  8 +-------
 5 files changed, 19 insertions(+), 21 deletions(-)

Fusion-Task-Id: FN-6142

Fusion-Task-Lineage: 2974cf0d-5512-4b24-ab0c-2d2fb63fd41a
2026-06-09 15:52:34 -07:00
gsxdsm
21f7a47c29 FN-6103: align chat stop button sizing with composer height
Align the regular chat stop button with the composer control sizing while quarantining an unrelated flaky room test.

- define a shared chat input control size variable and apply it to send/stop buttons for consistent width and minimum height
- update the chat input autosize CSS test to assert the shared control size contract and textarea minimum height
- quarantine the unrelated flaky ChatView rooms test in the dashboard Vitest config and quarantine ledger per policy

Files changed:
 packages/dashboard/app/components/ChatView.css       | 20 +++++++++++++-------
 .../__tests__/ChatView.chat-input-autosize.test.tsx  | 16 +++++++++++-----
 packages/dashboard/vitest.config.ts                  |  3 ++-
 scripts/lib/test-quarantine.json                     |  8 +++++++-
 4 files changed, 33 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-6103

Fusion-Task-Lineage: 3efc95ba-9369-4022-aa6e-f1981485caea
2026-06-09 12:51:20 -07:00
gsxdsm
02df5d1c62 FN-6069: restore chat manager test to dashboard quality gate
Restore the chat manager API suite to the dashboard curated quality gate.

- move `chat-manager.test.ts` back into the curated dashboard API quality project
- remove the temporary chat-manager quarantine and broad vitest excludes that kept it out of coverage
- stabilize chat-manager timing/subscriber tests with fake timers and explicit unsubscribe cleanup
- align the agent import route mock so the rescued suite uses the expected CLI settings stub

Files changed:
 $(git diff --cached --stat)

Fusion-Task-Id: FN-6069

Fusion-Task-Lineage: e70e7817-9fe6-4e80-8b53-8f99c6214941
2026-06-09 02:30:30 -07:00
gsxdsm
615d744c8a FN-6066: fix dashboard curated inventory guard
Keep the dashboard curated inventory guard aligned with the current dashboard test surface.

- add the newly required @fusion/core exports to the agent import route test mock
- teach the test inventory script to request file-only vitest listings for dashboard curated checks
- extend the dashboard curated skiplist with the pre-existing chat manager exclusion

Files changed:
 packages/dashboard/src/__tests__/routes-agent-import.test.ts | 3 +++
 scripts/check-test-inventory.mjs                             | 5 +++--
 scripts/lib/dashboard-curated-skiplist.json                  | 4 ++++
 3 files changed, 10 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6066

Fusion-Task-Lineage: 51e3c42c-d642-4873-8201-636a420d0991
2026-06-09 02:23:35 -07:00
gsxdsm
8bc3d7b0a5 FN-6042: raise dependency security floors
Harden dependency floors and update the Vitest toolchain to patched releases.

- upgrade workspace vitest and @vitest/coverage-v8 dependencies to the 4.1 line across packages and plugins
- pin transitive protobufjs via pnpm overrides and lockfile updates to patched versions
- adapt Vitest configs, engine test helpers, and security-floor coverage for the new dependency baselines
- add the published CLI changeset and related workspace/package metadata updates included in the task branch

Files changed:
 .changeset/fn-6042-security-dependencies.md        |   5 +
 AGENTS.md                                          |   4 +
 Dockerfile                                         |   3 +
 docs/PLUGIN_AUTHORING.md                           |   2 -
 package.json                                       |   3 +-
 packages/cli/package.json                          |   4 +-
 packages/cli/vitest.config.ts                      |   2 +-
 packages/core/package.json                         |   4 +-
 packages/core/vitest.config.ts                     |   2 +-
 packages/dashboard/app/test/mockApi.ts             |   4 +-
 packages/dashboard/package.json                    |   4 +-
 packages/dashboard/vitest.config.ts                |   2 +-
 packages/desktop/package.json                      |   4 +-
 packages/desktop/vitest.config.ts                  |   2 +-
 packages/droid-cli/package.json                    |   2 +-
 packages/droid-cli/vitest.config.ts                |   2 +-
 packages/engine/package.json                       |   4 +-
 .../engine/src/__tests__/executor-test-helpers.ts  |  29 +-
 .../engine/src/__tests__/gridlock-detector.test.ts |   5 +-
 .../src/__tests__/heartbeat-scheduler.test.ts      |   3 +-
 packages/engine/src/__tests__/scheduler.test.ts    |  24 +-
 packages/engine/src/__tests__/self-healing.test.ts |   5 +
 packages/engine/tsconfig.json                      |   3 +-
 packages/engine/vitest.config.ts                   |  10 +-
 packages/i18n/package.json                         |   2 +-
 packages/i18n/vitest.config.ts                     |   7 +
 packages/mobile/package.json                       |   2 +-
 packages/mobile/vitest.config.ts                   |   2 +-
 packages/pi-claude-cli/package.json                |   2 +-
 packages/pi-claude-cli/vitest.config.ts            |   2 +-
 packages/pi-llama-cpp/package.json                 |   2 +-
 packages/pi-llama-cpp/vitest.config.ts             |   2 +-
 packages/plugin-sdk/package.json                   |   2 +-
 packages/plugin-sdk/vitest.config.ts               |   2 +-
 .../examples/fusion-plugin-auto-label/package.json |   2 +-
 .../fusion-plugin-auto-label/vitest.config.ts      |   2 +-
 .../examples/fusion-plugin-ci-status/package.json  |   2 +-
 .../fusion-plugin-ci-status/vitest.config.ts       |   2 +-
 .../fusion-plugin-notification/package.json        |   2 +-
 .../fusion-plugin-notification/vitest.config.ts    |   2 +-
 .../fusion-plugin-settings-demo/package.json       |   2 +-
 .../fusion-plugin-settings-demo/vitest.config.ts   |   2 +-
 plugins/fusion-plugin-acp-runtime/package.json     |   2 +-
 plugins/fusion-plugin-acp-runtime/vitest.config.ts |   2 +-
 plugins/fusion-plugin-agent-browser/package.json   |   2 +-
 .../fusion-plugin-agent-browser/vitest.config.ts   |   2 +-
 .../fusion-plugin-cli-printing-press/package.json  |   2 +-
 .../vitest.config.ts                               |   2 +-
 .../package.json                                   |   2 +-
 .../src/__tests__/orchestrator-live-output.test.ts |   4 +-
 .../vitest.config.ts                               |   2 +-
 plugins/fusion-plugin-cursor-runtime/package.json  |   4 +-
 .../fusion-plugin-dependency-graph/package.json    |   4 +-
 .../vitest.config.ts                               |   2 +-
 plugins/fusion-plugin-droid-runtime/package.json   |   2 +-
 .../fusion-plugin-droid-runtime/vitest.config.ts   |   2 +-
 plugins/fusion-plugin-even-cards/package.json      |   2 +-
 plugins/fusion-plugin-even-cards/vitest.config.ts  |   2 +-
 .../package.json                                   |   2 +-
 .../vitest.config.ts                               |   2 +-
 plugins/fusion-plugin-hermes-runtime/package.json  |   2 +-
 .../fusion-plugin-hermes-runtime/vitest.config.ts  |   2 +-
 .../fusion-plugin-openclaw-runtime/package.json    |   2 +-
 .../vitest.config.ts                               |   2 +-
 .../fusion-plugin-paperclip-runtime/package.json   |   2 +-
 .../vitest.config.ts                               |   2 +-
 plugins/fusion-plugin-reports/package.json         |   2 +-
 .../src/__tests__/review-panel.test.ts             |   6 +-
 plugins/fusion-plugin-reports/vitest.config.ts     |   2 +-
 plugins/fusion-plugin-roadmap/package.json         |   2 +-
 plugins/fusion-plugin-roadmap/vitest.config.ts     |   2 +-
 plugins/fusion-plugin-whatsapp-chat/package.json   |   2 +-
 .../fusion-plugin-whatsapp-chat/vitest.config.ts   |   2 +-
 pnpm-lock.yaml                                     | 626 ++++++++-------------
 .../__tests__/dependency-security-floor.test.mjs   |  95 ++++
 75 files changed, 475 insertions(+), 491 deletions(-)

Fusion-Task-Id: FN-6042

Fusion-Task-Lineage: fff6a1cb-8937-435c-9a91-b7c7a59cc80e
2026-06-08 15:19:27 -07:00
gsxdsm
f7daa6e347 FN-6012: quarantine flaky dashboard chat manager test
Quarantine the flaky dashboard chat manager test and keep it out of active API lanes.

- record packages/dashboard/src/__tests__/chat-manager.test.ts in the quarantine ledger with the current failure context and quarantine date
- exclude the quarantined chat-manager test from dashboard API backfill coverage so existing missions surface an explicit no-backfill decision
- exclude the quarantined chat-manager test from the broad dashboard API project so its status stays visible without destabilizing the suite

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

Fusion-Task-Id: FN-6012

Fusion-Task-Lineage: 34014c45-486e-443d-ae47-a1d301a396e1
2026-06-08 14:09:23 -07:00
gsxdsm
53ab22449f FN-6017: fix chat generation-slot race and restore dashboard test
Fix the chat-manager race so the rescued dashboard test can run reliably again.

- wait for the first hanging prompt to be created before asserting generation-slot state in the chat-manager isolation test
- remove the dashboard chat-manager test from Vitest excludes so it runs in both backfill and default dashboard API projects
- clear the chat-manager entry from the flaky-test quarantine ledger after rescuing the test

Files changed:
 packages/dashboard/src/__tests__/chat-manager.test.ts | 16 +++++++++++-----
 packages/dashboard/vitest.config.ts                   |  3 +--
 scripts/lib/test-quarantine.json                      |  8 +-------
 3 files changed, 13 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-6017

Fusion-Task-Lineage: 5e3bd9ad-3502-4956-bab2-fa7b36f8bcab
2026-06-08 13:32:58 -07:00
gsxdsm
84330f7dc9 FN-6016: quarantine flaky chat-manager generation-slot test
Quarantine the flaky dashboard chat-manager generation-slot test until the underlying race is fixed.

- exclude packages/dashboard/src/__tests__/chat-manager.test.ts from dashboard API Vitest projects
- record the quarantine entry with failure context, rescue requirements, and the 2026-06-08 quarantine date

Files changed:
 packages/dashboard/vitest.config.ts | 2 ++
 scripts/lib/test-quarantine.json    | 8 +++++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6016

Fusion-Task-Lineage: 2cd97f8e-db06-4e49-b437-66fee64fb3a9
2026-06-08 10:33:16 -07:00
gsxdsm
918da22bfe FN-5969: remove obsolete cwd fallback timing entry
Clean up stale test timing metadata after the cwd fallback test removal.

- remove the obsolete timing entry for cwd-integration-fallback-removed.test.ts
- keep scripts/test-timings.json aligned with the current reliability-interactions test set

Files changed:
 scripts/test-timings.json | 1 -
 1 file changed, 1 deletion(-)

Fusion-Task-Id: FN-5969

Fusion-Task-Lineage: 8e8541a6-6198-4472-a40a-1161cc8443bd
2026-06-07 18:51:46 -07:00
gsxdsm
5aa6cad168 Address PR review feedback (#1453)
- boot-smoke: shutdown verdict now requires SIGTERM actually delivered and a
  clean exit (code 0 or SIGTERM); EADDRINUSE port race retries with a fresh
  port (3 attempts)
- test-changed: rename shouldForceFullSuite -> isSharedInfraChange (it routes
  to gate mode, not full); run the changed-mode gate under the isolation guard
- workflows: least-privilege permissions (contents: read) on pr-checks and
  full-suite
2026-06-05 13:58:34 -07:00
gsxdsm
3387ac8096 fix(review): apply autofix feedback 2026-06-05 09:23:15 -07:00
gsxdsm
93b6a33c07 docs: add fast-trusted-test-gate brainstorm + plan; CONCEPTS entries for Merge Gate and Deletion Ratchet; lint fix in boot-smoke 2026-06-05 09:12:43 -07:00
gsxdsm
5a4bb9eeeb feat(test): pnpm test runs gate + affected set; remove implicit full-suite escalation (the local OOM path)
- decideExecutionPlan: implicit wide-blast reasons (missing base, diff failed,
  no changes, shared infra, unmapped package) route to new gate mode instead of full
- CI===true force-full branch removed (CI no longer calls test-changed.mjs)
- changed mode runs pnpm test:gate before the affected set
- full suite reachable only via explicit --full / FUSION_TEST_FULL=1
- characterization tests updated + new only-explicit-full invariant test
2026-06-05 09:08:20 -07:00
gsxdsm
bbeb86e8f9 feat(test): add flaky-test quarantine ledger with --diff ratchet exemption note 2026-06-05 09:03:22 -07:00
gsxdsm
9d00f533ea feat(ci): add boot smoke check (CLI --help + real serve /api/health) 2026-06-05 08:57:24 -07:00
gsxdsm
39cc659c71 perf(ci): cache built dist artifacts keyed by source content hash
Every shard + the curated-guard job paid ~71s rebuilding 8 packages' dist
from scratch. actions/cache now restores dist on exact content-hash match
(--print-source-hash; branch-switch stable, pure git-based), with a
--seed-artifact-cache step on cache-hit that defeats the mtime trap
(restored dist looks older than checkout-time src mtimes). No restore-keys
partial fallback: stale dist is a known failure mode here. node_modules is
never cached (Windows junction policy). ensure-test-artifacts still runs as
the authority and rebuilds anything genuinely missing or changed.
2026-06-03 21:03:38 -07:00
gsxdsm
de3156e4ad fix(ci): per-package timing files, acp flake timeout, 4040-guard marker
- ci-test-shard: timing outputFile is now RELATIVE — one pnpm invocation
  fans out to several packages whose vitests all received the same
  absolute path, so every package overwrote the same timings file (last
  writer wins). Each package now writes <pkgDir>/.timings/; discovery
  (discoverWorkspaceTimingFiles) and the CI artifact globs scan the tree
- acp event-bridge-bounds: 20s timeout on the CPU-bound plan-flood test
  (timed out at default 5s under loaded CI shard, passes in isolation)
- acp process-manager: port-4040-allowlist marker for its doc comments
  (main-side; local guard flagged it after merging main)
2026-06-03 20:34:51 -07:00
gsxdsm
5a72ac9475 fix(ci): honest shard weights + review autofixes
- laneShardFraction: chained --shard invocations sum to full project weight (api backfill was half-weighted)
- exclude *.slow.test.* from duration weighting (engine carried 75 phantom untimed files)
- remove dead ENGINE_PACKAGE_NAME export
- docs: --cold-start-probe, --inputs-dir (snapshot refresh now self-contained), --print-mode
2026-06-03 19:25:40 -07:00
gsxdsm
610d473e77 refactor(test): simplify-pass cleanups from 4-angle review
- content-hash: createRepoContentSnapshot — 2 repo-wide git spawns shared across all hash computations (was ~2 spawns x N packages x 2 passes, ~0.6-1.6s per cache-miss run); snapshot-equivalence test pins zero-spawn path
- test-changed: one hash memo + snapshot shared between applyCacheToPlan and recordCachePass (record pass now re-hashes nothing)
- ci-test-shard: listPackageTestFiles single source of truth for the test-file glob (was triplicated)
- check-test-inventory: curatedProjects defaults to projects (removes duplicated 11-entry list in spec)
- ensure-test-artifacts: drop detectMissingArtifacts passthrough alias
- drop dead statSync re-export; cross-reference comments on the two shared-input path lists

Skipped deliberately: --cold-start-probe/--check-timings-staleness removal (plan artifacts for U8 re-eval + scheduled refresh), best-fit dedup + threshold² (behavior-preserving refactor of verified shard math — follow-up), worker-budget duplication (pre-existing on main)
2026-06-03 19:12:28 -07:00
gsxdsm
5bebc3cfe0 perf(ci): duration-based shard balancing with dashboard lane distribution
- shards weighted by scripts/test-timings.json durations (median-duration fallback + warning for untimed)
- dashboard no longer --shard-sliced (broken across its script chain): 14 lanes enumerated from package.json and scheduled as separately-weighted units, each exactly once
- engine/core keep --shard slicing, duration-weighted
- estimated critical-path shard: ~235s -> ~159s (spread 96.7% -> 0.06%)
- 30-day staleness warning + --check-timings-staleness for a scheduled refresh job; --dry-run mode
2026-06-03 18:35:26 -07:00
gsxdsm
2c41695e1f fix(test): dependency-aware and dirty-aware test cache invalidation
- cache key v2 = own hash + sorted transitive workspace dep hashes + shared inputs (lockfile, tsconfig.base, core __test-utils__ tree)
- working-tree-dirty files hashed by content (fixes false cache HIT on unstaged edits)
- core __test-utils__ folded globally: 16+ packages import it without a workspace dep on core
- dep folding adds ~5ms to the inner loop (memoized own-hashes)
- docs: cache semantics, --no-cache / FUSION_TEST_NO_CACHE, TTL rationale
2026-06-03 18:06:05 -07:00
gsxdsm
211c0fd557 perf(test): cut inner-loop fixed overhead to sub-second on cache-fresh runs
- skill-sync check conditioned on content hash of its inputs (skips ~0.3s spawn)
- ensure-test-artifacts: git-blob content-hash staleness; branch switches no longer trigger spurious ~2.6s tsc rebuilds (mtime fallback when dirty)
- isolation guard: cheap --before-fast reusing prior post-run baseline (~2.1s -> ~0.07s); detection proven preserved via injected-leak failure test
- vitest-setup: CI skips 4040-4045 discovery probe unless FUSION_RESERVED_PORTS set; kill-guard wrapper untouched, asymmetry pinned by port-probe-policy tests
- cache-fresh fast path skips sync/artifacts/HOME-prune entirely (mode line: fast-path=cache-fresh)
2026-06-03 17:57:29 -07:00
gsxdsm
c9191b733c test: close dashboard curated-gate and engine-slow coverage holes; add inventory harness
- 427 orphaned dashboard test files ran in NO gate; 395 now gated via self-maintaining backfill lanes (glob minus curated minus skip-list), 31 pre-existing failures + build-output skip-listed with reasons
- settings -t name-filter lanes replaced by one unfiltered lane (describe blocks can no longer fall through filters)
- scripts/check-test-inventory.mjs: --capture/--diff superset harness + --dashboard-curated completeness guard
- pr-checks.yml: engine-slow CI gate (non-empty assertion) + inventory guard job
- docs/testing.md: guard, skip-list policy, harness usage
2026-06-03 17:36:35 -07:00
gsxdsm
c69d384e67 perf(test): add timing telemetry, cold-start probe, and baseline snapshot
- ci-test-shard.mjs: --write-timings aggregation into scripts/test-timings.json (bucketed, newer-snapshot-protected, corrupt-shard tolerant) and --cold-start-probe; CI shard invocations emit vitest json timings
- test-changed.mjs: structured mode/reason telemetry line (+ --print-mode)
- pr-checks.yml: upload per-shard timing artifacts
- baseline: docs/test-speed-baseline-2026-06-03.md (core 41s, engine 179s, cli 49s; cold-start ~1.3-1.8s/process => U8 gate: worthwhile-not-urgent)
2026-06-03 16:48:50 -07:00
gsxdsm
de7847c44d FN-5927: categorize pnpm build scripts for install
Document and enforce pnpm build-script review decisions to prevent ignored-script install warnings.

- add reviewed ignoredBuiltDependencies entries to the root pnpm config and mirror the effective policy in pnpm-workspace.yaml
- add a regression test that verifies reviewed dependencies are categorized exactly once and stay aligned across both config files
- document the pnpm build-script approval policy in contributing docs and link plugin authoring guidance from AGENTS.md and PLUGIN_AUTHORING.md

Files changed:
 AGENTS.md                                          |  5 ++
 docs/PLUGIN_AUTHORING.md                           |  3 +-
 docs/contributing.md                               | 14 ++++
 package.json                                       |  9 +++
 pnpm-workspace.yaml                                | 14 ++++
 scripts/__tests__/pnpm-build-scripts-config.test.mjs   | 74 ++++++++++++++++++++++
 6 files changed, 118 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-5927

Fusion-Task-Lineage: 192bbed9-c5ed-45cb-b4bd-fb18514e2783
2026-06-03 00:28:41 -07:00
gsxdsm
dae4c0ea5d FN-5696: backfill missing mission feature assertion links
Backfill and repair missing mission feature assertion links so validator coverage stays intact for legacy mission data.

- add MissionStore backfillFeatureAssertions with dry-run and mission-scoped repair support
- centralize feature assertion text derivation and reuse it for create/update/backfill flows
- add regression tests for repair behavior, idempotency, and dry-run semantics
- document the operator repair workflow and add a dedicated backfill script for FN-5696

Files changed:
 docs/missions.md                                  |   2 +
 packages/core/src/__tests__/mission-store.test.ts |  84 +++++++++++
 packages/core/src/mission-store.ts                | 116 ++++++++++++++-
 scripts/backfill-fn-5696-feature-assertions.mjs   | 174 ++++++++++++++++++++++
 4 files changed, 373 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-5696

Fusion-Task-Lineage: 483bf2cc-be03-4007-860b-66d841e6aa15
2026-05-29 13:58:13 -07:00
gsxdsm
009d569bdd Recovery: re-land fn goals CLI + pi tools onto main 2026-05-28 19:44:15 -07:00
gsxdsm
294efb02fd feat(FN-5605): add linux gpg signing for release artifacts
Implements Linux GPG signing for the release pipeline by adding a `sign-linux.sh` helper, wiring it into the release and test-release workflows, including `.asc` signature files in release collectors, and documenting the full signing workflow in CODE_SIGNING.md with a note in the desktop README.

Fusion-Task-Id: FN-5605

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5605
2026-05-27 21:31:12 -07:00
gsxdsm
88c465cfc0 fix(ci,engine): repair test sharding, case-variant ambiguity detection, post-merge CI
Test shards 3 and 4 were silently failing on every open PR because vitest's
CLI parser was treating `--shard X/Y` as positional file filters whenever the
arg arrived after a `--` separator. Removing the `--` in ci-test-shard.mjs
restores per-shard slicing; verified locally that shard 1/4 and 2/4 now run
distinct subsets.

The two consistently-failing engine tests:

1. self-healing in-review-branch-rebind ambiguous case-variant detection:
   dedup keyed on lowercase branch name collapsed two physically distinct
   refs (allowed on Linux ext4) into one candidate, so the "applied" path
   ran instead of "ambiguous-candidates". Dedup now keys on the resolved
   SHA — macOS APFS still collapses (same ref, same SHA), Linux keeps both
   (distinct SHAs) and the ambiguity skip path fires as designed.

2. worktree-acquisition resume-misbinding spy: the production
   verifyResumeBranchNotMisbound returns early when `git merge-base HEAD main`
   fails, which is exactly what happens on shallow checkouts. Bumping the
   test-shards checkout to fetch-depth: 0 makes CI mirror the local git
   state these engine tests rely on.

Also adds `push: branches: [main]` to PR Checks so regressions like this
(which slipped into v0.33.0 with no post-merge run) go red immediately
on landing instead of being discovered on the next PR.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 10:24:21 -07:00
gsxdsm
b8919b7bb4 chore(test-isolation): detect live engine lock + prune stale tests
Three coupled fixes to make `pnpm test:full` exit cleanly when the local
`fn` dashboard is running:

1. scripts/check-test-isolation.mjs — replace timing-based "is the
   engine writing?" heuristic with a deterministic check: if
   `.fusion/engine.lock.lock/` exists (proper-lockfile's held-lock
   marker), the dir is engine-active and auto-skipped from violation
   reporting. The 2-second mutability probe is retained as a backstop
   for dirs with another external writer but no live lock. Also adds
   `engine.lock` / `engine.lock.lock/` to RUNTIME_IGNORE_PATTERNS so
   a mid-test engine start/stop doesn't trip the signature compare.

2. packages/dashboard/.../__tests__/GitManagerModal.test.tsx — prune
   the Status-panel Sync button + Recent-advances-events describe
   blocks. Their UI was removed in 5d35b64bd ("remove duplicate
   integration-advances UI") but the tests stayed and were timing
   out at 1s each. The Remotes-panel Sync describe is kept because
   the `remotes-sync-integration-tip-btn` still exists.

3. packages/engine/.../merge-reuse-task-worktree.slow.test.ts —
   update the happy-path assertion to reflect 4c31e885b
   ("merger auto-syncs project-root checkout after ref advance").
   Before that change, the merger's `update-ref` advance left the
   project root's working tree stale, so `git status --porcelain`
   would differ after the merge. With auto-sync, the new file is
   tracked + clean at HEAD, so status doesn't change. Verify the
   file actually landed via `git ls-files` instead.

After this, `pnpm test:full` exits 0 with the local dashboard running.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 20:18:08 -07:00
gsxdsm
a6a57dc40a test: guard tests from killing the live dashboard port
Adds a static pretest check and a runtime vitest-setup wrapper that block
shell/process calls matching `kill|pkill|killall|fuser|lsof ... <port>` or
`.listen(<port>)` against reserved Fusion ports. Reserved set is dynamic:
default 4040 plus $PORT, $FUSION_SERVER_PORT, $FUSION_RESERVED_PORTS, and any
port responding to /api/health on 4040..4045 at worker startup.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 19:51:36 -07:00
gsxdsm
687237bd91 feat(FN-5411): add project identity recovery and identity-aware startup rea
Implements project identity tracking and recovery across the Fusion system (FN-5411), enabling persistent identity for projects across storage migrations, daemon reattaches, and CLI session management. Adds a project identity metadata API and central reattach ensure mechanism, wires identity stampin

Fusion-Task-Id: FN-5411

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5411
2026-05-23 04:18:55 -07:00
gsxdsm
d4ec82bf02 feat(FN-5528): add soft-delete exclusion to stale blocked-by recovery scrip
Adds `deletedAt` sweep guards to the engine's self-healing and merger to prevent recovery operations from processing soft-deleted tasks, filters deleted tasks in the `recover-stale-blocked-by` script, includes a new regression test for the deadlock-scan exclusion pattern, and updates the soft-delete

Fusion-Task-Id: FN-5528

Fusion-Task-Lineage: 5c9e45ca-49a8-47a0-a23d-6fe8e15e7e00

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5528
2026-05-23 03:33:53 -07:00
gsxdsm
2209c57dd6 chore(engine): remove workflow-step mock routing + stale FN-5482 docs
Drops the "workflow-step" MockSessionPurpose enum value and the
workflowStepId / workflowStepTemplateId plumbing through
agent-runtime, agent-session-helpers, mock-provider, executor, and
merger. The seeded-workflow-prompts script loses its FN-5205
rationale comment + test (no longer applicable now that workflow
steps run through the regular session purposes).

Also strips the stale FN-5482 architecture-invariant bullet from
AGENTS.md and the corresponding audit-event line from
docs/architecture.md (the self-healing reclaim invariant they
described no longer holds).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 03:09:00 -07:00
gsxdsm
76bd3a7d90 feat(FN-5205): add workflow-step test mode dispatch and routing for mock pr
Implements workflow step test mode (FN-5205) by wiring mock dispatch, context forwarding, and routing through executor, merger, and mock provider, plus adding corresponding tests and docs. Also adds broad-scope triage heuristics to improve task-scope detection, touching triage.ts, triage-broad-scope

Fusion-Task-Id: FN-5205

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5205
2026-05-23 02:25:00 -07:00
Fusion (runfusion.ai)
d04c7803e0 feat(FN-5339): trim AGENTS.md to essential rules, move detailed guidance to
Restructured AGENTS.md from a 588-line catch-all into a lean reference of essential rules by offloading deep guidance into five new/expanded doc files: agents.md, architecture.md, dashboard-guide.md, settings-reference.md, and testing.md. Also restored a missing FN-5345 lifecycle invariant in self-h

Fusion-Task-Id: FN-5339

Fusion-Task-Lineage: e1a2dc4f-ae50-46f4-acd3-8f2c3673feb4
2026-05-21 19:41:52 -07:00
gsxdsm
17b9d851c3 chore: add scripts/reimport-tasks.mjs recovery utility
One-off helper to re-import specific FN-* tasks from .fusion/tasks/<id>/task.json
back into the live SQLite DB after a restore. Mirrors the column list used by
db-migrate.ts:migrateTasks but uses INSERT OR IGNORE so existing rows are
never overwritten. Used to rebuild FN-5415..FN-5425 after the FN-5407 backup
corruption recovery.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-20 22:25:15 -07:00
Fusion (runfusion.ai)
c9fd41ef26 feat(FN-5175): thread soft-delete audit context and add reconciliation scri
Adds a reconcile script to recover leaked soft-deleted tasks, threads delete audit context through all callers, and records soft-delete audit events with archive column tracking across core/engine/cli/dashboard, with reliability backstop tests covering caller alignment.

Fusion-Task-Id: FN-5175
2026-05-20 02:46:49 -07:00
Fusion (runfusion.ai)
8c05682ab4 feat(FN-5189): complete Step 5 — guard against nohup regressions
Fusion-Task-Id: FN-5189
Fusion-Task-Lineage: 4caa3f0a-af81-4c60-88e8-de229ed72e08
2026-05-19 17:19:03 -07:00