Commit Graph

683 Commits

Author SHA1 Message Date
Phil Larson
81b1860f95 fix(ci): correct future FNXC stamps (#3440)
## Summary
- replaces newly added future-dated FNXC metadata with the actual UTC
change time
- tightens the FNXC future-date baseline to zero known exceptions

## Test plan
- `pnpm check:fnxc-future-dates`
- `pnpm check:lifecycle-columns`
- `pnpm check:changesets`
- `pnpm --filter @runfusion/fusion exec vitest run
src/__tests__/staged-plugin-core-imports.test.ts --silent=passed-only
--reporter=dot`
- `pnpm --filter @fusion/engine typecheck`
- `pnpm lint`
2026-08-15 17:16:05 -07:00
gsxdsm
920bf8b022 FN-9105: document boot-smoke anomaly remeasurement
Confirm the W33 spike as cold-start variance and preserve a repeatable diagnosis protocol.

- Record five sequential phase-timed samples and the 20.5-second median threshold.
- Link the controlled remeasurement protocol from the testing guide.
- Explain the timing snapshot handoff and why incomplete CI artifacts were not published.
- Preserve the no-appeasement requirement beside boot-smoke phase timing.

Files changed:
 .../boot-smoke-w33-walltime-anomaly.md             | 100 +++++++++++++++++++++
 docs/testing.md                                    |   2 +-
 scripts/boot-smoke.mjs                             |   7 ++
 3 files changed, 108 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-9105

Fusion-Task-Lineage: 6956b037-db0f-4560-bb04-136080a975b5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-15 16:59:37 -07:00
gsxdsm
374ae08d56 test(engine): repoint source-scan contracts to the peeled module layout
Full-suite repair, engine source-scan cluster. The package code
organization waves moved ~30 engine modules into subdirectories
(plugins/, execution/, scheduling/, healing/, worktree/, executor/
peels); the log-severity manifest, prompt carve-out, emit-surface,
failure-lane, and worktree-invariant scanners now read the moved
locations, verified per file via git log --follow. Two scans caught
real drift rather than moves: the lifecycle census had 12 unexamined
column guards (resolved with DELIBERATE-LITERAL markers for the mailbox
archived tab, the FN-9059 lease-owner terminality check, and the FN-9056
legacy done fallback — baseline re-recorded with zero absorbed debt),
and planning-claim gained a genuine second writer in self-healing's
FN-8998 transport-failure recovery, admitted to the allowlist with its
CAS-guarded justification. 9 files / 119 tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-15 15:31:58 -07:00
gsxdsm
1d3f6c198c FN-9096: route CLI models through installed runtimes
Route every CLI-provider selection through an explicit installed-runtime policy.

- Centralize CLI provider classifications, runtime hints, fallback behavior, and actionable missing-runtime errors.
- Validate routing coverage statically and add conformance and integration tests for CLI runtime paths.
- Document runtime routing behavior and add a published CLI changeset.

Files changed: .changeset/fn-9096-cli-runtime-routing.md          |   7 +
 docs/settings-reference.md                         |  29 +++
 docs/testing.md                                    |   6 +-
 package.json                                       |   6 +-
 .../src/__tests__/cli-provider-routing.test.ts     |  74 ++++++++
 .../__tests__/cli-runtime-routing-check.test.ts    |  25 +++
 .../cli-runtime-routing-conformance.test.ts        | 210 +++++++++++++++++++++
 .../__tests__/hermes-runtime-integration.test.ts   |  28 +++
 .../engine/src/agents/agent-session-helpers.ts     | 166 ++++------------
 packages/engine/src/agents/cli-provider-routing.ts | 174 +++++++++++++++++
 scripts/check-cli-runtime-routing.mjs              |  26 +++
 scripts/lib/cli-runtime-routing-check.mjs          |  84 +++++++++
 12 files changed, 701 insertions(+), 134 deletions(-)

Fusion-Task-Id: FN-9096

Fusion-Task-Lineage: f9f6a434-b28d-4ebb-816a-53ca75efc2c4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-15 07:19:29 -07:00
gsxdsm
9c83812351 fix(ci): unblock check:lane-wiring for the task-recommendations read
check:lane-wiring runs in CI's Lint gate and has been failing on main since FN-9037 landed
`listTaskRecommendations`, so it blocks every PR in the repo, not just the one that hit it.

Recorded rather than rewired, because this is the false-positive shape the escape hatch exists
for. The guard catches a callee silently falling back to a LEGACY COLUMN LITERAL when a caller
omits the lane; `listTaskRecommendationsImpl` falls back to
`resolveProjectColumnsForRoles(store, ["complete"])`, which reads the board's own lanes. Real
callers already pass a resolved set — the dashboard route resolves `completeColumns` before
calling — so the fallback only serves the pass-through wrapper. Resolving again in the wrapper
would duplicate that query on every call for no behavioural difference.

The reason lives at the call site as well as in the baseline, since a bare count in a JSON file
is exactly the kind of entry that later reads as unexplained debt.

Baseline diff verified to be a single added entry (store.ts: 1) — nothing else raised or lowered.

Verified: check:lane-wiring exits 0, core typecheck clean, eslint clean, FNXC date check clean.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-13 23:46:57 -07:00
gsxdsm
6d2c1bf0c9 FN-9020: parallelize boot smoke preflights
Reduce durable boot-smoke latency while preserving its CLI, initialization, health, and shutdown assertions.

- Run independent help and init preflights concurrently with bounded async child processes.
- Add phase timing diagnostics and deterministic init failure classification.
- Cover phase scheduling and isolated environment behavior, and document the diagnostics flag.

Files changed:
 docs/testing.md                       |   4 +-
 scripts/__tests__/boot-smoke.test.mjs |  65 ++++++++++-
 scripts/boot-smoke.mjs                | 201 +++++++++++++++++++++++++---------
 3 files changed, 214 insertions(+), 56 deletions(-)

Fusion-Task-Id: FN-9020

Fusion-Task-Lineage: 1f5d3d7f-dc0c-4d16-a4ab-fd5e3952dbdf

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-12 19:45:40 -07:00
gsxdsm
f8f828357f FN-9018: refresh W33 test velocity baseline
Refresh the weekly test-velocity report with the latest captured measurements.

- Update baseline metrics, deltas, quarantine status, and #leads summary.
- Append the W33 measurement and slowest-test metadata to the velocity history.

Files changed:
 docs/test-velocity-baseline.md     |  24 ++++----
 scripts/test-velocity-history.json | 114 +++++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+), 12 deletions(-)

Fusion-Task-Id: FN-9018

Fusion-Task-Lineage: b4d91cfd-2d5d-4e5a-ac9a-e62c50915f49

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-12 19:10:03 -07:00
gsxdsm
c4467b0a5b FN-9007: upgrade Pi runtime to 0.84.1
Upgrade the bundled Pi runtime closure to version 0.84.1.

- Pin direct and transitive Pi runtime packages to a coherent 0.84.1 closure.
- Adapt runtime interfaces and test assertions for Pi 0.84.1 behavior.
- Guard the added Pi client, protocol, and telemetry packages in desktop packaging checks.

Files changed:
 .changeset/fn-9007-pi-0-84-1.md                    |   7 +
 packages/cli/package.json                          |   4 +-
 packages/cli/src/__tests__/package-config.test.ts  |   6 +-
 packages/cli/vitest.config.ts                      |   2 +-
 packages/core/package.json                         |   2 +-
 packages/dashboard/package.json                    |   4 +-
 packages/dashboard/src/routes.ts                   |   6 +-
 packages/engine/package.json                       |   4 +-
 packages/engine/src/__tests__/pi.test.ts           |  45 ++--
 .../src/__tests__/provider-registration.test.ts    |   4 +-
 packages/engine/src/auth/auth-storage.ts           |  20 +-
 packages/engine/src/pi.ts                          |   5 +
 packages/pi-claude-cli/package.json                |   8 +-
 pnpm-lock.yaml                                     | 283 ++++++++++++---------
 pnpm-workspace.yaml                                |  14 +-
 .../__tests__/check-pi-versions-pinned.test.mjs    |  27 +-
 scripts/check-pi-versions-pinned.mjs               |   8 +
 17 files changed, 279 insertions(+), 170 deletions(-)

Fusion-Task-Id: FN-9007

Fusion-Task-Lineage: 89045e86-d4c8-4fc3-bbf6-5ba38fc786e7

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-12 14:07:30 -07:00
gsxdsm
b095ddeb69 fix: exclude gitignored desktop deploy staging from workspace package-graph check
The check-workspace-package-graph validator globs the filesystem for package
manifests but only excluded node_modules/dist. On any machine that had run a
desktop packaging build (pnpm deploy), the gitignored electron-builder staging
dir packages/desktop/deploy/ carries a copy of desktop's package.json and
tripped the unglobbed-package violation, breaking pretest/gate locally while CI
(clean checkout, no deploy dir) stayed green. Exclude the staging path alongside
node_modules/dist since a gitignored dir is absent from the isolated worktree
this validator guards.
2026-08-11 17:04:28 -07:00
gsxdsm
f2c729bf77 FN-8994: add workspace package graph validation
Prevent cold workspace installs from failing on missing or unglobbed local packages.

- Validate workspace-protocol dependencies and overrides against glob-covered packages.
- Add static-gate coverage and regression tests for missing plugin packages.
- Document the workspace package graph check.

Files changed:
 docs/testing.md                                    |   4 +-
 package.json                                       |   9 +-
 scripts/__tests__/check-workspace-package-graph.test.mjs | 103 +++++++++++++++
 scripts/check-workspace-package-graph.mjs          | 138 +++++++++++++++++++++
 4 files changed, 249 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-8994

Fusion-Task-Lineage: 17dbe062-79aa-4417-ae38-43df881e9fa4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 14:56:14 -07:00
gsxdsm
778292b484 refactor: package code organization wave 19 (self-healing pure peels) (#3403)
## Summary
Starts **U5** of the package code-organization program after wave 18
(executor peels) landed.

Peels pure free-function clusters out of `self-healing.ts` into
`packages/engine/src/self-healing/` without behavior changes. Public
imports from `./self-healing.js` remain stable via re-exports.

### Peels
| Symbol | New home |
|--------|----------|
| `autoRecoverWorktreeSessionStartFailure` |
`self-healing/auto-recover-worktree-session.ts` |
| `archiveAsGhostBug` | `self-healing/archive-ghost-bug.ts` |
| `hasStepProgress` / work-complete helpers |
`self-healing/step-progress.ts` |

### Line count
- `self-healing.ts`: ~15456 → ~15231 (baseline ratcheted to post-peel
live; main had already drifted past the prior grandfathered ceiling via
organic growth)
- New modules each well under 2,000 lines

## Test plan
- [x] `pnpm --filter @fusion/engine exec tsc --noEmit`
- [x] `self-healing-trait-rekey.test.ts` (autoRecover requeue)
- [x] `self-healing-paused-abort-recovery.test.ts`
- [x] `self-healing-model-unavailable-recovery.test.ts`
- [ ] CI gate

## Follow-ups
U5 Slice B: domain method clusters (startup, in-review, merge-status,
workspace, surfacing) into additional `self-healing/*.ts` modules.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved automatic recovery when worktree sessions fail to start,
including stale or incomplete session data.
* Tasks can be safely requeued while preserving progress, or escalated
after retry limits are reached.
* Improved handling of completed work and failures where task completion
was not recorded.
* Preserved valid task branches during recovery and provided more
reliable fallback requeue behavior.
* Ghost bugs are automatically archived with recovery details and
activity history.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-11 11:29:30 -10:00
Phil Larson
210c22c485 fix(ci): classify workflowRole as role vocabulary (#3408)
## Summary
- Classify workflow work-item `workflowRole` comparisons as role
vocabulary in the lifecycle-column census.
- Add a regression test so triage role comparisons cannot raise a
phantom lifecycle-column guard.

## Test Plan
- `node --test scripts/__tests__/lifecycle-census*.test.mjs`
- `corepack pnpm check:lifecycle-columns`
- `corepack pnpm lint`
- `corepack pnpm check:changesets --strict`


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved classification of workflow role comparisons, including
`workflowRole === "triage"`, so they are recognized separately from
lifecycle-column comparisons.
* Ensured workflow role values are correctly identified as role
vocabulary rather than lifecycle-column values.

* **Tests**
* Added automated coverage to verify accurate workflow role and column
identification across comparison patterns.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-11 11:28:54 -10:00
Phil Larson
6cc15fd73d fix(ci): restore clean-main CLI and lifecycle gates (#3420)
## Summary
- Complete the isolated `@fusion/core` mock used by the
experiment-finalize extension suite
- Classify three intentional physical/synthetic lifecycle literals
introduced on current main
- Re-record the strict lifecycle census baseline with zero unexamined
guards

## Test plan
- `pnpm --filter @runfusion/fusion exec vitest run
src/__tests__/extension-experiment-finalize.test.ts --silent=passed-only
--reporter=dot`
- `pnpm --filter @fusion/core exec vitest run
src/__tests__/task-intake-owner-resolver.test.ts --silent=passed-only
--reporter=dot`
- `pnpm --filter @fusion/engine exec vitest run --project engine-default
src/__tests__/mission-feature-sync-lanes.test.ts --silent=passed-only
--reporter=dot`
- `pnpm check:lifecycle-columns`
- `node scripts/check-mock-completeness.mjs`


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Bug Fixes**
- Improved mission reconciliation previews for task links, specification
alignment, and lifecycle updates.
- Prevented stale or superseded validation runs from overwriting current
feature status or ownership.
- Improved blocked-feature diagnostics and archived-task handling across
workflow configurations.

- **Documentation**
- Clarified validation, assignment checks, and mission synchronization
behavior.

- **Tests**
- Expanded coverage for reconciliation previews and validator ownership
scenarios.

- **Chores**
  - Updated lifecycle baseline data for known archived-task cases.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-11 10:57:36 -10:00
gsxdsm
f1fe399184 FN-8991: add runtime skill-loader drift gate
Enforce the intentional Claude-to-Grok runtime skill-loader clone relationship across verification lanes.

- Add an exact rename-diff validator with fixture and live-loader coverage.
- Run the validator in pretest, fast verification, and static merge-gate checks.
- Document the loader duplication contract and expanded static-validator inventory.

Files changed:
 AGENTS.md                                          |   2 +
 docs/testing.md                                    |   4 +-
 package.json                                       |   7 +-
 .../check-runtime-skill-loader-drift.test.mjs      | 113 +++++++++++++++++++++
 scripts/__tests__/run-static-gate-checks.test.mjs  |   1 +
 scripts/__tests__/verify-fast.test.mjs             |   1 +
 scripts/check-runtime-skill-loader-drift.mjs       | 113 +++++++++++++++++++++
 7 files changed, 236 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-8991

Fusion-Task-Lineage: a3b67752-0043-4336-9a2a-ff391672b31f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 05:23:02 -07:00
gsxdsm
25e292d0e6 FN-8954: preserve CLI liveness during startup
Ensure CLI startup operations settle before process exit on supported Node runtimes.

- Keep awaited QMD probes and ephemeral port selection ref'd until completion.
- Add CLI process regressions for init persistence and exit code 13.
- Declare the Node 22.4 runtime floor and extend boot smoke coverage.

Files changed:
 .changeset/fn-8954-cli-exit-13.md                  |  7 ++
 docs/testing.md                                    |  4 +-
 package.json                                       |  3 +
 packages/cli/agent-browser.mjs                     |  6 ++
 packages/cli/bin.mjs                               |  7 ++
 packages/cli/package.json                          |  3 +
 packages/cli/src/__tests__/ci-workflow.test.ts     |  9 +++
 packages/cli/src/__tests__/cli-exit-code.test.ts   | 82 ++++++++++++++++++++++
 packages/cli/src/__tests__/package-config.test.ts  | 12 ++++
 packages/cli/src/bin.ts                            |  6 ++
 .../__tests__/postgres/embedded-free-port.test.ts  | 37 ++++++++++
 packages/core/src/memory/memory-backend.ts         | 17 +++--
 packages/core/src/postgres/embedded-lifecycle.ts   | 16 +++--
 scripts/boot-smoke.mjs                             | 62 +++++++++++-----
 14 files changed, 244 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-8954

Fusion-Task-Lineage: 05303d07-2662-48d5-a442-6d43fa0a4493

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 04:20:33 -07:00
gsxdsm
0eaa3c7b9a FN-8990: clean up plugin reload scratch files
Keep plugin hot-reload cache-busting copies ephemeral and remove legacy tracked artifacts.

- Delete tracked plugin reload scratch files.
- Remove temporary import copies after successful and failed reloads.
- Add cleanup and tracked-artifact regression coverage.

Files changed:
 .changeset/fn-8990-plugin-reload-scratch-cleanup.md       |   7 ++
 packages/core/src/__tests__/plugin-hot-reload.test.ts     |  25 ++++ -
 packages/core/src/plugins/plugin-loader.ts                |  16 ++-
 plugins/fusion-plugin-droid-runtime/src/.index.reload-1.ts |  84 ----------------
 plugins/fusion-plugin-droid-runtime/src/.index.reload-2.ts |  84 ----------------
 plugins/fusion-plugin-hermes-runtime/src/.index.reload-1.ts | 108 --------------------
 plugins/fusion-plugin-hermes-runtime/src/.index.reload-2.ts | 108 --------------------
 plugins/fusion-plugin-hermes-runtime/src/.index.reload-3.ts | 108 --------------------
 plugins/fusion-plugin-openclaw-runtime/src/.index.reload-1.ts |  95 -----------------
 plugins/fusion-plugin-paperclip-runtime/src/.index.reload-1.ts | 112 ---------------------
 scripts/__tests__/no-tracked-plugin-reload-artifacts.test.mjs |  27 +++++
 11 files changed, 72 insertions(+), 702 deletions(-)

Fusion-Task-Id: FN-8990

Fusion-Task-Lineage: 2221ebaf-b8ab-4a3c-8934-addfa348c98c

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-11 03:40:21 -07:00
gsxdsm
34e74d2fe4 perf(verify:fast): run independent steps concurrently
verify:fast ran every step serially, so its wall clock was the sum of steps with no
ordering relationship between them. Static checks and per-package typechecks are
each independent, so they now run as bounded-concurrency groups.

  static checks   ~6.0s -> ~1.6s   (11 validators, mostly node startup)
  typecheck       11.0s -> 7.4s    (engine + dashboard)
  no-change run   28.1s -> 22.3s

Ordering that matters is untouched: bootstrap, builds, and boot smoke stay serial
and in plan order, and each group is a barrier. A failing group awaits its in-flight
siblings before throwing rather than abandoning partial tsbuildinfo/dist state, and
reports the first failure in plan order so the message does not depend on which
sibling lost the race. FUSION_VERIFY_FAST_SERIAL=1 restores the old behavior when
interleaved child output makes a failure hard to read.

Boot smoke is now 84% of a no-change run (18.8s); it re-runs initdb into a throwaway
HOME every time. Left alone -- caching that would change what the gate proves.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-11 03:06:02 -07:00
ischindl
8cba8d3e92 fix(core): make TaskStore.emit override assignable to EventEmitter<TaskStoreEvents> signature (#3407)
## Problem
Dashboard typecheck fails with **TS2416** in `@fusion/core`'s
`TaskStore`:

```
Property 'emit' in type 'TaskStore' is not assignable to the same property in base type 'EventEmitter<TaskStoreEvents>'.
```

The `override emit<E extends string | symbol>(event, ...args)` generic
conflicts with the base class's generic `emit<K>(eventName: keyof
TaskStoreEvents | K, ...)`. This breaks the dashboard typecheck / CI
merge gate.

## Fix
Change the override to:

```ts
override emit(event: unknown, ...args: any[]): boolean {
  return EventEmitter.prototype.emit.call(this, event as string, ...args);
}
```

`event: unknown` remains assignable to the base's generic signature
while still forwarding non-typed runtime keys (`agent:log`,
`settings:updated`, …). Internal `EventEmitter.prototype.emit` calls
cast `event as string`. Behavior-preserving.

## Verification
- `@fusion/dashboard` `tsc --noEmit` → **PASS** (previously failed with
TS2416)
- `eslint` on touched file → clean
- Single-file change (`packages/core/src/store.ts`, +6/−3)

## Scope
No behavior change, no changesets required.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved task event handling to support a broader range of event
identifiers.
* Preserved cached-lane information for single-argument task update
events.
* Maintained support for custom and arbitrary event names without
disrupting existing behavior.
* Improved classification of workflow roles, session purposes, and
outcome-related status checks in lifecycle analysis, producing more
accurate findings and reducing misleading results.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-10 14:10:26 -10:00
gsxdsm
878db6dca7 FN-8951: repair script-test governance drift
Keep test-shard timing governance aligned with the current workspace and workflow seams.

- Add a safe timing-snapshot pruning mode with coverage.
- Align Todo plugin Vitest isolation and Docker dependency manifests.
- Refresh workflow reliability evidence and remove deleted test timings.

Files changed:
 Dockerfile                                         |  7 ++-
 docs/testing.md                                    |  9 ++-
 plugins/fusion-plugin-todos/vitest.config.ts       | 26 ++++++--
 scripts/__tests__/ci-test-shard-timings.test.mjs   | 71 ++++++++++++++++++++++
 scripts/ci-test-shard.mjs                          | 65 ++++++++++++++++++--
 .../lib/workflow-reliability-release-check.json    | 22 +++----
 scripts/test-timings.json                          | 21 -------
 7 files changed, 175 insertions(+), 46 deletions(-)

Fusion-Task-Id: FN-8951

Fusion-Task-Lineage: fbf7e79f-4cb2-43e2-9982-09f3f94de70d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 12:09:20 -07:00
gsxdsm
0fbeba50d1 FN-8937: rescue project engine test quarantine
Rescue the project engine suite by making subprocess watchdog behavior deterministic.

- Capture real timer APIs for subprocess watchdogs and isolate failure ownership.
- Mock integration-branch resolution to prevent host git during lifecycle tests.
- Add watchdog regression coverage and remove the expired quarantine exclusion.

Files changed:
 docs/testing.md                                    |   3 +
 packages/core/src/__test-utils__/vitest-setup.ts   |  74 ++++++++++-
 .../__tests__/subprocess-guard-fake-timers.test.ts | 140 +++++++++++++++++++++
 .../engine/src/__tests__/project-engine.test.ts    |  63 +++++++---
 packages/engine/vitest.config.ts                   |  12 +-
 scripts/lib/test-quarantine.json                   |   8 +-
 6 files changed, 265 insertions(+), 35 deletions(-)

Fusion-Task-Id: FN-8937

Fusion-Task-Lineage: 9fe166b5-b101-4683-bb2b-4855ee73df10

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 03:50:58 -07:00
gsxdsm
6cf95433bf FN-8928: evict flaky workflow IR PG gate canary
Remove the flaky sync-workflow-IR PostgreSQL canary from the blocking merge gate while preserving non-blocking coverage.

- Remove the default workflow-IR PostgreSQL test from the gate canary script.
- Update gate-policy coverage expectations and flake-eviction documentation.
- Record the observed setup-hook timeout and retained regression coverage.

Files changed:
 .../suite-only-flakes-observed-register.md         | 25 +++++++++++++--
 docs/testing.md                                    |  6 ++--
 packages/core/package.json                         |  2 +-
 .../sync-workflow-ir-is-always-default.pg.test.ts  |  6 ++++
 .../__tests__/engine-vitest-gate-policy.test.mjs   | 37 +++++++++++-----------
 5 files changed, 51 insertions(+), 25 deletions(-)

Fusion-Task-Id: FN-8928

Fusion-Task-Lineage: b725ba1a-fb33-4d49-89b4-277a64246cdd

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-10 02:32:24 -07:00
gsxdsm
e7a873c505 FN-8936: stabilize Planning Mode handoff tests
Stabilize live Proceed-action handoffs and re-admit the Planning Mode flow suite.

- Settle hydration and re-query the Proceed action before direct-create test clicks.
- Remove the Planning Mode test quarantine and record its rescue in the testing ledger.

Files changed:
 .../suite-only-flakes-observed-register.md           |  4 ++++
 docs/testing.md                                      |  3 +++
 .../PlanningModeModal.planning-flow.test.tsx         | 20 ++++++++++++++++----
 packages/dashboard/vitest.config.ts                  |  5 -----
 scripts/lib/test-quarantine.json                     |  5 -----
 5 files changed, 23 insertions(+), 14 deletions(-)

Fusion-Task-Id: FN-8936

Fusion-Task-Lineage: ed869b67-9394-458b-879c-54da0d7d327e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 23:08:11 -07:00
gsxdsm
1cf86baa1c refactor: package code organization wave 18 (executor pure peels) (#3317)
## Summary

Wave 18 continues the package code-organization program after wave 17
domain folders (U4 Slice A from
`docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`).

### What changed
Peel **pure, behavior-preserving** helpers out of
`packages/engine/src/executor.ts` into domain modules under
`packages/engine/src/executor/`, with **stable re-exports** from
`executor.ts` so deep imports and `vi.mock("../executor.js")` keep
working.

| New module | Symbols |
|------------|---------|
| `executor/task-done-refusal.ts` | `evaluateTaskDoneRefusal`,
`determineRevisionResetStart`, skip-bypass refusal helper |
| `executor/workflow-feedback-paths.ts` |
`extractReferencedPathsFromWorkflowFeedback`,
`isAlwaysAllowedScopeLeakPath`, `workflowPathMatchesDeclaredScope` |
| `executor/workflow-step-verdict.ts` |
`FUSION_WORKFLOW_STEP_CONVENTIONS_PREAMBLE`, `parseWorkflowStepVerdict`
/ `parseWorkflowStepOutput`, step outcome types |
| `executor/await-input-parse.ts` | `parseAwaitInputSentinel`,
`parseAwaitInputQuestionToolCall` |
| `executor/no-commit-eligibility.ts` | `getNoCommitEligibilityReason`
(+ prompt heuristics) |

`executor.ts` live LOC ~**22817 → ~22427** (first pure-peel batch; more
peels needed to approach the 2k cap).

### Shims
- `old path` `executor.ts` public exports → `new path` `executor/*.ts` →
delete-when consumer deep-imports are re-pointed (not this PR)

### Test plan
- [x] `@fusion/engine` typecheck
- [x] Oracle: task-done refusal, skip-bypass, workflow malformed
verdict, scope-leak allowlist, executor-step-session, executor-prompt
- [x] `vitest --project=engine-core` (merge-gate curated suite)
- [ ] CI merge gate

**Stack:** wave17 (merged) → **this PR**

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Improved recognition of workflow outcomes from structured and
conversational responses.
* Added support for extracting questions from await-input responses and
tool calls.
* Improved workflow feedback handling for referenced files and declared
scope patterns.
* Added clearer guidance for task execution, approvals, verification,
and available tools.

* **Bug Fixes**
* Prevented completion when required review approvals are missing or
revisions remain pending.
* Improved handling of workflows that legitimately require no code
changes.
  * Added clearer refusal messages and more reliable revision restarts.
  * Sanitized repository paths in Git remediation instructions.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-09 15:46:09 -10:00
gsxdsm
6bd8004ba1 FN-8915: document agent activity API contract
Publish an inspectable contract for durable agent-activity history and pagination.

- Define the route wire shape, cursor semantics, retention, and SSE recovery behavior.
- Add PostgreSQL and dashboard coverage for documented pagination and truncation guarantees.
- Link architecture and diagnostics guidance to the canonical contract and validate its prerequisite lineage.

Files changed:
 .changeset/fn-8864-agent-activity-events.md        |  2 +-
 AGENTS.md                                          |  1 +
 docs/agent-activity-contract.md                    | 94 ++++++++++++++++++++++
 docs/architecture.md                               |  2 +-
 docs/diagnostics.md                                |  2 +-
 .../agent-activity-cursor-contract.pg.test.ts      | 90 +++++++++++++++++++++
 .../src/__tests__/agent-activity-route.test.ts     | 10 +++
 .../src/__tests__/sse-agent-activity.test.ts       | 12 ++-
 scripts/check-fn-8864-ancestry.sh                  | 35 ++++++++
 9 files changed, 244 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-8915

Fusion-Task-Lineage: da3f8c96-3b58-4e6d-a413-c51bdd643f26

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 15:58:54 -07:00
gsxdsm
3d6a908b95 FN-8898: document inert prerebase settings
Clarify that legacy prerebase settings are inert on the production merge path.

- Mark retained prerebase configuration and audit events as legacy-only.
- Add a static validator and tests preventing new prerebase callers.
- Update merge architecture, testing, and settings documentation.

Files changed:
 AGENTS.md                                          |   2 +-
 docs/architecture.md                               |   3 +-
 docs/settings-reference.md                         |   6 +-
 docs/testing.md                                    |   2 +-
 package.json                                       |   6 +-
 packages/core/src/types/settings/settings-scope.ts |  32 +++--
 .../src/errors/transient-merge-error-classifier.ts |  12 +-
 packages/engine/src/merge/merger-auto-prerebase.ts |  12 +-
 packages/engine/src/util/run-audit.ts              |   2 +
 scripts/__tests__/check-prerebase-inert.test.mjs   |  73 +++++++++++
 scripts/__tests__/run-static-gate-checks.test.mjs  |   1 +
 scripts/__tests__/verify-fast.test.mjs             |   1 +
 scripts/check-prerebase-inert.mjs                  | 146 +++++++++++++++++++++
 scripts/lib/source-projection.mjs                  |  87 ++++++++++++
 14 files changed, 359 insertions(+), 26 deletions(-)

Fusion-Task-Id: FN-8898

Fusion-Task-Lineage: 9cfd836d-17c2-44a0-a076-56fef0917935

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 06:01:02 -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
b2f8b0d3fe test(quarantine): delete 27 permanently-broken quarantined tests per operator directive
Operator directed deletion of tests that test pre-refactor behavior no
longer in the codebase (removed APIs, mock shape drift, stale assertions
from the 2026-08-05 full-suite quarantine wave, run 30982276306).

All 27 entries were permanently red — not flaky — testing APIs removed
during the PG cutover and workflow peel refactors (getBuiltinWorkflow,
resolveWorkflowIrForTaskWithProvenance, layer.db.select mock shapes,
vi.mock hoist errors, stale serialization/count literals).

Kept 3 actionable entries that catch real issues:
- register-model-routes-kimi-k3-supplemental (real CI flake, rescue feature ready)
- project-engine.test.ts (catches real 60s→120s assertion drift)
- PlanningModeModal.planning-flow (second-sighting real race)

Vitest config exclusions and quarantine ledger updated in lockstep.
2026-08-08 20:51:19 -07:00
gsxdsm
de38ead4c9 fix(ci): restore main full-suite after path peel and suite drift (#3334)
## Summary
Restores the non-blocking full suite on `main` after consistent shard
failures (latest red: [run
30982276306](https://github.com/Runfusion/Fusion/actions/runs/30982276306);
all four shards failed on `@fusion/core`, `@fusion/engine`, and
`@fusion/plugin-sdk`).

### Fixes
- **Path / import drift** after code-organization peels: update
static-guard and integration tests to new module locations (`central/`,
`board/`, `execution/`, `merge/`, `worktree/`, `plugins/`, `types/*`
barrels, etc.).
- **Inventory re-pins**:
- SQLite production `DatabaseSync` allowlist
(`central/project-identity.ts`, `db/sqlite-validation.ts`)
- Engine blocking-shellout allowlist regenerated from live source (33
audited sites)
  - Core log-severity manifest paths for peeled modules
- **Partial protocol assert update** for `isPlanReviewSatisfied` (file
also quarantined until full rescue)

### Quarantine (deletion ratchet)
Remaining behavioral reds quarantined on sight — no
timeout/retry/assertion appeasement:
- **14 core** files (incomplete unit fakes for `layer.db.select`,
ledger/census drift, 15s wedge timeout, serialization protocol drift)
- **13 engine** files (mock-hoist errors, fake-store/census/behavior
drift under suite)

Paired updates: `scripts/lib/test-quarantine.json` + package vitest
excludes. Deletion clock starts `2026-08-05`.

### Local verification
- Path-fixed core scanners: 173 passed
- Path-fixed engine scanners: 58 passed
- `@fusion/plugin-sdk` full: 16 passed
- PG smokes: mission-autopilot, research-execution, satellite,
transition-pending, workflow-sync

## Test plan
- [ ] CI PR checks green (lint/typecheck/build/gate)
- [ ] Full suite on merge to main: all 4 shards green or only
intentional non-blocking signal
- [ ] Confirm quarantined files appear in ledger + vitest excludes and
are not executed

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Tests**
* Updated test coverage to reflect reorganized source locations and
module paths.
* Refreshed static checks, allowlists, and source-based assertions
without changing tested behavior.
* **Chores**
* Quarantined failing core and engine test suites with documented
tracking details.
* Updated test configuration and quarantine records to improve suite
stability and reporting.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-07 00:25:10 -07:00
gsxdsm
5532019fd3 FN-8816: make planning storage failures non-fatal
Keep Planning Mode running when browser storage writes fail.

- Retry failed project-scoped planning persistence after targeted eviction.
- Cover storage failure recovery and planning draft hand-off behavior.
- Quarantine the recurring planning-flow flake and add a patch changeset.

Files changed:
 .changeset/fn-8816-planning-storage-recovery.md    |   7 +
 .../app/hooks/__tests__/modalPersistence.test.ts   | 159 ++++++++++++++++++++-
 packages/dashboard/app/hooks/modalPersistence.ts   |  22 ++-
 packages/dashboard/vitest.config.ts                |   5 +
 scripts/lib/test-quarantine.json                   |   5 +
 5 files changed, 195 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-8816
Fusion-Task-Lineage: 929c3d96-3a28-49fa-8018-710fc75e3fcc
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-06 08:43:59 -07:00
gsxdsm
4f4aef7173 FN-8811: preserve explicit shared-member review holds
Keep shared branch-group integration moving unless an operator explicitly holds the task.

- Track auto-merge provenance and distinguish explicit user holds from inherited mission policy.
- Preserve manual holds across workflow recovery, merge coordination, API updates, and dashboard status.
- Add regression coverage, document the behavior, and quarantine the observed flaky test.

Files changed:
 .changeset/fn-8811-shared-member-review-hold.md    |   7 ++
 docs/architecture.md                               |   4 +-
 docs/dashboard-guide.md                            |   1 +
 .../mission-store.sync-auto-merge.test.ts          |   7 +-
 .../__tests__/postgres/mission-store.pg.test.ts    |   1 +
 .../__tests__/postgres/store-movement.pg.test.ts   |  20 ++++
 packages/core/src/__tests__/task-merge.test.ts     |  14 +++
 .../core/src/async-stores/async-mission-store.ts   |   6 +-
 packages/core/src/index.gate.ts                    |   1 +
 packages/core/src/index.ts                         |   1 +
 packages/core/src/merge/task-merge.ts              |  20 +++-
 packages/core/src/missions/mission-store.ts        |   6 +-
 packages/core/src/task-store/serialization.ts      |   2 +-
 packages/core/src/task-store/task-creation.ts      |   8 +-
 packages/core/src/types/task/task-core.ts          |  12 ++-
 .../components/__tests__/TaskDetailModal.test.tsx  |  63 ++++++++++++
 .../dashboard/src/__tests__/routes-tasks.test.ts   |  47 +++++++++
 .../src/routes/register-task-workflow-routes.ts    |  15 ++-
 ...cutor-live-branch-group-auto-merge-hold.test.ts |  87 +++++++++++++++++
 .../src/__tests__/group-merge-coordinator.test.ts  |  99 ++++++++++++++++++-
 .../engine/src/__tests__/project-engine.test.ts    |  57 ++++++++++-
 .../self-healing-paused-abort-recovery.test.ts     |  52 +++++++++-
 packages/engine/src/__tests__/self-healing.test.ts | 106 +++++++++++++++++++++
 .../workflow-graph-executor-handlers.test.ts       |  23 +++++
 packages/engine/src/executor.ts                    |  37 ++++++-
 packages/engine/src/project-engine.ts              |  25 +++--
 packages/engine/src/self-healing.ts                |  71 ++++++++++++--
 .../src/workflow-node-runners/merge-runner.ts      |  24 ++++-
 .../src/workflows/workflow-graph-executor.ts       |   4 +
 .../src/workflows/workflow-graph-task-runner.ts    |   6 ++
 .../engine/src/workflows/workflow-node-handlers.ts |   5 +-
 packages/engine/vitest.config.ts                   |  11 ++-
 scripts/lib/test-quarantine.json                   |   5 +
 33 files changed, 789 insertions(+), 58 deletions(-)

Fusion-Task-Id: FN-8811

Fusion-Task-Lineage: 5c1609bf-3132-4988-a254-fedec6c0e33d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-05 17:39:15 -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
9e4a0817db feat: restart the development engine on source changes (#3329)
## Summary

Add an opt-in source-development loop that restarts the dashboard and
engine when runtime TypeScript or JSON changes. Use `pnpm dev:watch`;
`pnpm dev:hmr` now combines Vite UI HMR with the same supervised
API/engine restart path.

The watcher filters tests, fixtures, generated declarations, build
output, and task state. It coalesces bursts with a two-second maximum
wait, waits for the child to acknowledge its IPC listener, and rebuilds
runtime dist artifacts before a source-triggered respawn.

## Safety model

- Close scheduler, triage, heartbeat, mission, routine, self-healing,
and merge admission before checking for active work.
- Let already-running agents reach a safe boundary; do not mutate
durable pause settings.
- Enter the existing graceful exit-code-86 shutdown and supervised
respawn path.
- Retry failed liveness reads and declined restart requests instead of
dropping the pending change.
- Keep ordinary `pnpm dev` behavior unchanged; inherited watch state
does not break nested non-dashboard development commands.

A development restart intentionally replaces the dashboard process, so
transient dashboard connections and project dev-server children
reconnect or restart with it. Agent work is the protected boundary.

## Validation

- `pnpm lint`
- `pnpm test:gate` (753 tests passed across engine, core, PostgreSQL
gate, and CI-shape suites)
- Focused CLI watcher/restart/supervision suites: 40 tests passed
- Focused engine drain/manager suites: 52 tests passed
- `pnpm --filter @runfusion/fusion typecheck`
- `pnpm --filter @fusion/engine typecheck`
- `pnpm verify:fast` (13 steps passed, including CLI build and real
health boot smoke)
- Manual unsupported-command probe confirms explicit `--watch` fails
clearly outside the dashboard command

## Post-Deploy Monitoring & Validation

- Watch for `[fusion:dev] source changed`, `source restart deferred`,
`active work drained`, and `restart requested` logs during the first
watched development session.
- Healthy behavior is one exit-86 respawn per edit batch, no interrupted
active agents, refreshed dist artifacts, and a healthy dashboard after
respawn.
- Investigate repeated restart loops, watcher attachment warnings,
declined restart retries, or liveness-read failures.
- Immediate mitigation is to use ordinary `pnpm dev` without `--watch`;
no production runtime behavior or durable setting needs rollback.
- Validation owner: Fusion maintainers during the first source edit
after merge.

---

[![Compound
Engineering](https://img.shields.io/badge/Built_with-Compound_Engineering-6366f1)](https://github.com/EveryInc/compound-engineering-plugin)


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
* Added `pnpm dev:watch` to automatically restart development runtime
processes when source files change.
* Development restarts now wait for active work to finish, preventing
new work from starting during the transition.
* Enhanced `pnpm dev:hmr` with graceful runtime source restarts while
keeping the dashboard available.
  * Rapid source changes are grouped to avoid unnecessary restarts.

* **Documentation**
* Updated development setup and contribution guides with the new watch
workflow.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-04 08:57:30 -07:00
gsxdsm
2249b9bc20 FN-8774: retain Kimi K3 quarantine through deadline
Keep the Kimi K3 dashboard route test quarantined until the mandated deletion date.

- Preserve the /api/models supplemental test and paired Vitest exclusion through 2026-08-15.
- Record the explicit retention deadline in the quarantine ledger.

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

Fusion-Task-Id: FN-8774

Fusion-Task-Lineage: 8ef704e4-f682-4a97-af1a-2070ca43d8a1

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-03 23:36:20 -07:00
gsxdsm
3b2c6f4c12 FN-8772: refresh W32 test-velocity baseline
Refresh the weekly test-velocity baseline with the latest measurements.

- Record current gate, boot-smoke, and changed-only test timings
- Update slowest-test attribution and quarantine counts
- Append the captured snapshot to the velocity history

Files changed:
docs/test-velocity-baseline.md     |  67 +++++++++++-----------
scripts/test-velocity-history.json | 112 +++++++++++++++++++++++++++++++++++++
2 files changed, 145 insertions(+), 34 deletions(-)

Fusion-Task-Id: FN-8772

Fusion-Task-Lineage: 84d73aef-f0ca-4322-a21b-447f230bb203

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-03 20:18:28 -07:00
gsxdsm
0d492f9056 FN-8770: consolidate task display sorting
Centralize workflow column sorting in core and remove the duplicate dashboard implementation.

- Export shared display-column sort options and complete-column modes from core.
- Route board, lane, list, and column consumers through the shared sorter.
- Harden inert flag seam checks for same-named module functions.

Files changed:
 .../display-ranking-roles-resolved.test.ts         |   6 +-
 packages/core/src/__tests__/task-priority.test.ts  |  63 +++++++
 packages/core/src/index.gate.ts                    |   2 +
 packages/core/src/index.ts                         |   2 +
 packages/core/src/tasks/task-priority.ts           |  87 +++++----
 packages/core/src/types.ts                         |   9 +
 packages/dashboard/app/components/Board.tsx        |  45 +----
 packages/dashboard/app/components/Column.tsx       |   4 +-
 packages/dashboard/app/components/Lane.tsx         |  34 +---
 packages/dashboard/app/components/ListView.tsx     |  19 +-
 .../app/components/__tests__/Lane.test.tsx         |   8 +-
 .../app/components/__tests__/taskSorting.test.ts   | 201 ---------------------
 packages/dashboard/app/components/taskSorting.ts   | 138 --------------
 scripts/__tests__/check-inert-flag-seams.test.mjs  |   4 +-
 scripts/check-inert-flag-seams.mjs                 |  83 +++------
 15 files changed, 177 insertions(+), 528 deletions(-)

Fusion-Task-Id: FN-8770

Fusion-Task-Lineage: 81740c52-0a3c-44df-9fbb-addaefdfeb82

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-03 16:15:12 -07:00
gsxdsm
56819e21e9 fix: restore plugin SDK and Todo packaging 2026-08-03 12:16:32 -07:00
gsxdsm
cb57093d03 refactor: domain folder layout (types, API, core, engine) (#2398)
## Summary

Wave 17 organizes Fusion into **domain folders** (stacks on #2397).

### Layout
- **core/types/** — board, task, agents, settings, merge, workflow,
mesh, …
- **core/src/** — agents, ai, async-stores, workflows, tasks, config,
db, …
- **dashboard/app/api/** — client, tasks, agents, git, missions,
planning, …
- **engine/src/** — agents, auth, execution, merge, missions, overseer,
worktree, …

Root keepers retained for large entrypoints (`store.ts`, `executor.ts`,
`merger.ts`, …).

Public barrels (`@fusion/core`, `@fusion/engine`, `app/api.ts` → legacy)
stay stable.

## Test plan
- [x] `@fusion/core` typecheck
- [x] `@fusion/engine` typecheck (pre-existing playwright-core noise
only)
- [ ] CI merge gate

**Stack:** #2394 → #2397 → **this PR**
2026-08-03 00:20:53 -07:00
gsxdsm
19e9f5bc88 chore(release): require interactive confirm; drop authorized/--yes skips
Remove the typed authorization phrase and the --yes/-y auto-confirm path so
every real release must confirm y/N in an interactive terminal. Reject --yes
with a clear error so old muscle memory cannot skip the proceed prompt.
2026-08-02 19:58:37 -07:00
gsxdsm
1e7f510ee2 fix: stop blocking tasks on open-PR file claims — board tasks are the only blockers
Remove the FN-8700 PR/file-claim blocking mechanism end to end (operator
decision after FN-8728 parked on unrelated PR #2398):

- Drop the AGENTS.md claim-check rule and scripts/check-file-claimed.mjs
- Executor prompt + fn_task_done no longer accept pr:N refs or treat open
  PRs as blocked-exit reasons
- execution-block-classifier classifies on Fusion task dependencies only;
  legacy pr refs are discarded, reason prose never makes a block durable
- Remove the session-log BLOCKED promotion and the gh-backed
  reconcile-external-pr-blockers self-healing sweep
- Legacy file-claim parks are no longer honored, so previously PR-blocked
  rows recover via normal paths

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-08-02 17:06:38 -07:00
gsxdsm
cfc63fc8f5 FN-8724: stabilize hydration freshness tests
Make the useTasks hydration freshness coverage deterministic and restore it to the dashboard suite.

- Control the system clock for hydration fixtures and flush async updates without advancing time.
- Remove the rescued test from the dashboard exclusion list and quarantine ledger.

Files changed:
 .../__tests__/useTasks-hydration-freshness.test.ts | 30 ++++++++++++++--------
 packages/dashboard/vitest.config.ts                |  8 ------
 scripts/lib/test-quarantine.json                   |  5 ----
 3 files changed, 19 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-8724

Fusion-Task-Lineage: 1d764e2c-0975-4d26-92c6-187a6a94caee

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 20:30:16 -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
9c9dd7db2f FN-8706: scan paginated PR files for claims
Scan paginated pull-request file lists so claim checks remain reliable for large diffs.

- Replace truncated PR diff scans with count-validated paginated GitHub API requests.
- Fail closed when open PR or file-list data is incomplete, malformed, or exceeds the API ceiling.
- Add coverage for large diffs, API failures, count mismatches, and claim precedence.

Files changed:
 scripts/__tests__/check-file-claimed.test.mjs | 186 ++++++++++++++++++++++++++
 scripts/check-file-claimed.mjs                | 119 +++++++++++-----
 2 files changed, 272 insertions(+), 33 deletions(-)

Fusion-Task-Id: FN-8706
Fusion-Task-Lineage: 1edf3546-553b-4e35-8c41-cd5143c08e0a
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 09:39:38 -07:00
gsxdsm
ebe514c3e4 FN-8677: propagate task update lanes before conversion
Propagate cache-warmed workflow lanes through task updates so synchronous engine consumers support renamed boards.

- Add task lane cache and attach resolved lanes to task:updated metadata.
- Update scheduler, triage, and notification consumers to use carried lanes with bridge-safe fallbacks.
- Cover lane propagation and renamed-lane event behavior with core and engine tests.

Files changed:
 .changeset/fn-8677-manual-merge-hold-lanes.md      |   7 ++
 .changeset/task-updated-carries-lanes.md           |   7 ++
 ...orkflow-ir-readers-always-return-the-default.md |  22 +++++
 .../sync-workflow-ir-second-blocker.test.ts        |  43 +++-----
 .../core/src/__tests__/task-lane-cache.test.ts     |  30 ++++++
 .../task-updated-lanes-emit-surfaces.test.ts       |  92 ++++++++++++++++++
 .../__tests__/task-updated-lanes-payload.test.ts   |  42 ++++++++
 packages/core/src/index.ts                         |   1 +
 packages/core/src/store.ts                         |  36 ++++++-
 packages/core/src/task-lane-cache.ts               |  63 ++++++++++++
 .../core/src/task-store/archive-lifecycle-2.ts     |   3 +
 packages/core/src/task-store/moves.ts              |   1 +
 packages/core/src/task-store/task-artifacts-ops.ts |   1 +
 packages/core/src/task-store/task-update.ts        |   1 +
 packages/core/src/task-store/update-task-deps.ts   |   4 +-
 .../core/src/task-store/workflow-definitions.ts    |  71 +++++---------
 .../__tests__/scheduler-task-updated-lanes.test.ts | 108 +++++++++++++++++++++
 .../task-updated-lanes-bridge-compat.test.ts       |  94 ++++++++++++++++++
 ...task-updated-lanes-engine-emit-surfaces.test.ts | 101 +++++++++++++++++++
 .../src/__tests__/triage-pause-abort.test.ts       |  22 +++++
 .../src/__tests__/triage-planning-wake.test.ts     |  25 +++++
 .../notification-renamed-lifecycle-columns.test.ts |  84 +++++++++++++++-
 .../__tests__/task-wedge-notification.test.ts      |  19 ++++
 .../src/notification/notification-service.ts       |  56 ++++-------
 packages/engine/src/scheduler.ts                   |  62 +++---------
 packages/engine/src/triage.ts                      | 105 ++++++--------------
 scripts/lib/inert-sync-lane-baseline.json          |   5 +-
 27 files changed, 858 insertions(+), 247 deletions(-)

Fusion-Task-Id: FN-8677

Fusion-Task-Lineage: d8fef9db-0f88-4dfd-9813-be25e10e3588

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-01 01:15:10 -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
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
897cce9d94 FN-8656: resolve scheduler lanes for renamed holds
Resolve scheduler lane lookup against workflow-defined hold and terminal columns.

- Use asynchronous workflow lane resolution after the synchronous event prologue
- Preserve legacy lane fallback and recognize all terminal workflow columns
- Update scheduler regression coverage, sync-lane guardrails, and release notes

Files changed:
 .changeset/fn-8656-scheduler-renamed-hold-lanes.md |   7 ++
 .../sync-workflow-ir-callsite-allowlist.test.ts    |  10 +-
 .../scheduler-renamed-hold-events.test.ts          |  20 ++--
 ...ow-scheduler-parked-columns-live-e2e.pg.test.ts |  13 ++-
 ...-sync-role-conversion-inert-live-e2e.pg.test.ts |   8 +-
 packages/engine/src/scheduler.ts                   | 121 +++++++++------------
 scripts/check-inert-sync-lane-conversions.mjs      |   5 +
 scripts/lib/inert-sync-lane-baseline.json          |   3 +-
 8 files changed, 92 insertions(+), 95 deletions(-)

Fusion-Task-Id: FN-8656

Fusion-Task-Lineage: 389a95a1-289f-4dde-86b3-1e450f8d43db

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-31 22:19:32 -07:00
gsxdsm
012729cf2b chore: tighten lifecycle-column census baseline after slot-accounting fix
The active-worktree slot-accounting fix removed two deliberate scheduler
literals (done/archived: 3 -> 2); re-record so the ratchet follows the count
down.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-31 22:07:50 -07:00
gsxdsm
744c01f7fb FN-8657: extract move-target literal counter
Make the move-target literal ratchet directly testable without changing its scan behavior.

- Export the AST-based legacy destination counter for fixture testing
- Cover literal destinations, private moves, and deliberate exemptions

Files changed:
 .../__tests__/check-move-target-literals.test.mjs  | 30 ++++++++-
 scripts/check-move-target-literals.mjs             | 77 +++++++++-------------
 2 files changed, 60 insertions(+), 47 deletions(-)

Fusion-Task-Id: FN-8657

Fusion-Task-Lineage: 5b1f9ac4-6026-4baf-b42c-f41ab0562679

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-31 21:34:25 -07:00
gsxdsm
577dcb6c0c FN-8643: correct TaskWedgeNotifications FNXC timestamp
Correct the TaskWedgeNotifications migration-baseline stamp and remove its obsolete future-date allowance.

- Set the baseline FNXC annotation to its intended non-future timestamp.
- Remove the resolved migration from the future-date baseline allowlist.

Files changed:
 packages/core/src/postgres/migrations/0000_initial.sql | 2 +-
 scripts/lib/fnxc-future-dates-baseline.json            | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

Fusion-Task-Id: FN-8643

Fusion-Task-Lineage: 0f27e9e6-0581-4e38-8005-e93f94ad4f78

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-31 19:32:55 -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