Commit Graph

1709 Commits

Author SHA1 Message Date
gsxdsm
b6ac5f2e51 FN-6608: bound engine verification runs
Add durable engine-level guardrails for verification command timeouts.

- Add project-level verificationCommandTimeoutMs settings plumbing and docs.
- Enforce configured verification budgets and hard caps in executor and merger verification paths.
- Detect marathon verification commands, soft-cap them by default, and require allowFullSuite for explicit full-suite runs.
- Cover timeout defaults, marathon detection, and guidance updates with engine/core tests.

Files changed:
 .changeset/fn-6608-verification-bound.md           |   5 +
 docs/settings-reference.md                         |   1 +
 docs/testing.md                                    |   2 +
 .../src/__tests__/settings-consistency.test.ts     |   5 +
 packages/core/src/agent-prompts.ts                 |   6 +-
 packages/core/src/settings-schema.ts               |   7 +-
 packages/core/src/types.ts                         |   6 +
 .../engine/src/__tests__/executor-core.test.ts     |   3 +
 .../src/__tests__/run-verification-command.test.ts | 176 ++++++++++++++++++++-
 packages/engine/src/executor.ts                    |  11 +-
 packages/engine/src/merger.ts                      |   9 +-
 packages/engine/src/run-verification-tool.ts       | 142 +++++++++++++++--
 packages/engine/src/verification-utils.ts          |  13 +-
 13 files changed, 360 insertions(+), 26 deletions(-)

Fusion-Task-Id: FN-6608
Fusion-Task-Lineage: c593a96d-eb8b-492c-82c7-8943c239f588
2026-06-18 01:27:09 -07:00
gsxdsm
d0be3e462d FN-6610: harden engine test isolation recovery
Harden shared test isolation seams so engine tests survive mid-run cleanup.

- Recreate owned worker roots, HOME directories, and cwd before child-process launches.
- Add regression coverage for tmpdir redirect, HOME, cwd, SQLite, and git config recovery.
- Revalidate worktree database scratch directories before direct SQLite opens and document the rescue pattern.

Files changed:
 docs/testing.md                                    |  2 +
 packages/core/src/__test-utils__/vitest-setup.ts   | 92 ++++++++++++++++++----
 .../__tests__/vitest-setup-tmp-redirect.test.ts    | 33 ++++++++
 .../src/__tests__/executor-step-session.test.ts    |  6 +-
 .../src/__tests__/worktree-db-hydrate.test.ts      | 22 +++++-
 5 files changed, 135 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-6610

Fusion-Task-Lineage: 18233ee2-1dfe-4b0d-bd12-e4f5b7f9cc29
2026-06-18 01:20:03 -07:00
gsxdsm
29b27a7ebb FN-6620: categorize Fusion tool analytics
Improve Command Center tool analytics so Fusion tool calls land in meaningful buckets.

- categorize Fusion task, planning, research, agent, skills, secrets, workflow, GitHub, and memory tool families
- re-bucket historical tool_call rows whose stored category was missing or `other` while preserving explicit custom categories
- cover categorization and aggregation behavior with core tests
- add a patch changeset for the published CLI package

Files changed:
 .changeset/fn-6620-tool-categories.md              |  5 ++
 packages/core/src/__tests__/tool-analytics.test.ts | 33 +++++++++++
 packages/core/src/__tests__/usage-events.test.ts   | 69 +++++++++++++++++++---
 packages/core/src/tool-analytics.ts                | 22 +++++--
 packages/core/src/usage-events.ts                  | 66 ++++++++++++++++++++-
 5 files changed, 178 insertions(+), 17 deletions(-)

Fusion-Task-Id: FN-6620

Fusion-Task-Lineage: a8f2525e-7aff-4576-89e2-6b142792f380
2026-06-17 21:45:50 -07:00
gsxdsm
4c3186d0d1 FN-6615: prefer fresh plugin source over stale dist
Plugin entry resolution now avoids stale gitignored dist output in dev worktrees.

- Prefer bundled plugin entries when present, preserving published tarball behavior.
- Choose src/index.ts over dist/index.js when source files are newer than dist output.
- Cover CLI and core plugin loaders with freshness and sync tests.
- Add a patch changeset for the published CLI package.

Files changed:
 .changeset/fn-6615-prefer-fresh-src.md             |  5 ++
 .../__tests__/bundled-plugin-install.test.ts       | 46 ++++++++---
 .../resolve-plugin-entry-path-sync.test.ts         | 50 ++++++++++--
 packages/cli/src/plugins/bundled-plugin-install.ts | 93 ++++++++++++++++++----
 packages/core/src/__tests__/plugin-loader.test.ts  | 71 ++++++++++++++++-
 packages/core/src/plugin-loader.ts                 | 93 ++++++++++++++++++----
 6 files changed, 313 insertions(+), 45 deletions(-)

Fusion-Task-Id: FN-6615

Fusion-Task-Lineage: 3d9abfa8-a405-47fa-8330-451c26a0ee75
2026-06-17 19:46:47 -07:00
gsxdsm
c4878514f9 FN-6600: harden core worker-root teardown retries
Harden the core Vitest worker-root cleanup path and rescue the related broad-suite quarantines.

- Increase bounded retries for transient ENOTEMPTY/EBUSY worker-root cleanup races.
- Add teardown coverage proving transient ENOTEMPTY retries remove the worker root.
- Remove rescued core quarantine entries from the ledger and Vitest exclude list.
- Document the FN-6600 core cleanup rescue pattern in testing guidance.

Files changed:
 docs/testing.md                                    |  2 ++
 .../core/src/__test-utils__/vitest-teardown.ts     |  7 +++++-
 .../vitest-teardown-worker-root-cleanup.test.ts    | 27 ++++++++++++++++++++++
 packages/core/vitest.config.ts                     |  6 +++--
 scripts/lib/test-quarantine.json                   | 15 ------------
 5 files changed, 39 insertions(+), 18 deletions(-)

Fusion-Task-Id: FN-6600

Fusion-Task-Lineage: 107fb5cf-82c8-4e65-915d-0ef69725369b
2026-06-17 19:19:05 -07:00
gsxdsm
b20def94d2 FN-6592: rescue mission restart integration coverage
Rescue mission integration restart coverage while keeping unrelated core quarantines intact.

- Close reopened TaskStore handles during mission integration restart tests.
- Add restart-fidelity assertions for empty and populated mission hierarchy read paths.
- Document that mission-integration stays out of the core quarantine list.

Files changed:
 .../core/src/__tests__/mission-integration.test.ts | 140 +++++++++++++++++----
 packages/core/vitest.config.ts                     |   4 +-
 2 files changed, 121 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-6592

Fusion-Task-Lineage: 292caa5d-eb18-4356-bcaf-a9c1796a7815
2026-06-17 18:25:10 -07:00
gsxdsm
e064becba5 FN-6583: reject dangling workflow edges
Workflow validation now rejects unresolved graph endpoints before editor evidence can miss fail-closed gaps.

- Validate every top-level workflow edge source and target against declared nodes.
- Cover dangling source and target endpoints while preserving valid linear and rework-region edges.
- Add desktop compact-graph cycle rejection coverage for the workflow editor toast path.

Files changed:
 packages/core/src/__tests__/workflow-ir.test.ts    | 80 ++++++++++++++++++++++
 packages/core/src/workflow-ir.ts                   | 17 +++++
 .../__tests__/WorkflowNodeEditor.test.tsx          | 22 ++++++
 3 files changed, 119 insertions(+)

Fusion-Task-Id: FN-6583

Fusion-Task-Lineage: 24bcb426-1c98-408d-9a50-562911143231
2026-06-17 14:56:07 -07:00
gsxdsm
167084f19e FN-6585: add workflow restart durability coverage
Add focused store-level coverage for preserving explicit workflow selections across restarts.

- Cover default, custom, built-in, and create-time workflow selection persistence after reopening the disk-backed task store.
- Verify branch progress and foreach step instances survive restarts for selected custom workflows.
- Assert missing custom workflow definitions fail closed without corrupting existing selections.

Files changed:
 .../__tests__/workflow-restart-durability.test.ts  | 288 +++++++++++++++++++++
 1 file changed, 288 insertions(+)

Fusion-Task-Id: FN-6585

Fusion-Task-Lineage: 20ac9893-68e2-48bf-98f7-cd7dd963d2ed
2026-06-17 14:52:56 -07:00
gsxdsm
556ddd4491 FN-6591: stabilize dist task-list barrel tests
Stabilize the @fusion/core task-list dist barrel guard without weakening its coverage.

- Load the built dist core barrel once in beforeAll when dist artifacts exist.
- Reuse the cached runtime module across dist export and fn_task_list surface assertions.
- Keep the source barrel and real runtime export path coverage intact while reducing duplicate dynamic import pressure.

Files changed:
 .../core/src/__tests__/task-list-format.test.ts    | 33 ++++++++++++++--------
 1 file changed, 21 insertions(+), 12 deletions(-)

Fusion-Task-Id: FN-6591

Fusion-Task-Lineage: 4de45ab8-fdb3-4ed0-bf21-afcc2fb49902
2026-06-17 14:52:56 -07:00
gsxdsm
c94fb194c4 FN-6584: keep title summarizer out of workflow lanes
Clarify that title summarization remains project/global-scoped instead of a workflow model lane.

- Remove title summarizer entries from the workflow model lane catalog and display grouping.
- Add regression coverage for dashboard workflow settings and core built-in workflow setting parity.
- Update settings documentation to point title summarizer configuration at Project Models.

Files changed:
 docs/settings-reference.md                         | 29 +++++++++++++--------
 .../core/src/__tests__/settings-parity.test.ts     |  6 +++++
 .../app/components/WorkflowSettingsPanel.tsx       | 22 +++++-----------
 .../__tests__/WorkflowSettingsPanel.test.tsx       | 30 +++++++++++++++++++++-
 .../__tests__/workflow-setting-display.test.ts     | 24 +++++++++++++++++
 .../app/components/workflow-setting-display.ts     | 12 +++------
 6 files changed, 87 insertions(+), 36 deletions(-)

Fusion-Task-Id: FN-6584
Fusion-Task-Lineage: 2246213d-8775-4074-ae8e-04b9afe28f96
2026-06-17 14:52:56 -07:00
gsxdsm
8037ef15a3 Merge main into feature/factory-view: reconcile lazy-view inventory to 23
Resolves conflicts in the lazy-loaded heavy-views inventory. main independently
grew the curated list to 22 (adding AppModals lazy modals); this branch added the
Command Center view. Combined count is 23 — updated the AGENTS.md prose/inventory
and the lazy-loaded-views-docs test contract (count + length assertions) to 23,
keeping main's richer "App-level and AppModals" wording.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 11:46:31 -07:00
gsxdsm
a84a8e1793 FN-6570: guard task list formatting fallback
Prevent fn_task_list surfaces from crashing when the runtime core namespace lacks the clamp export.

- Add a shared defensive task-list formatter with a bounded fallback clamp.
- Route CLI, dashboard planning-board, and engine triage fn_task_list output through the formatter.
- Cover missing, throwing, and non-string clamp behavior in core and CLI tests.
- Document the resilient task-list formatting behavior and add a patch changeset.

Files changed:
 .changeset/fn-6570-task-list-resolve-fix.md        |  5 ++
 docs/cli-reference.md                              |  2 +-
 packages/cli/src/__tests__/extension.test.ts       | 57 +++++++++++++++++++++-
 packages/cli/src/extension.ts                      |  8 ++-
 .../core/src/__tests__/task-list-format.test.ts    | 49 ++++++++++++++++++-
 packages/core/src/index.ts                         |  2 +-
 packages/core/src/task-list-format.ts              | 35 +++++++++++++
 packages/dashboard/src/planning-board-tools.ts     |  8 ++-
 packages/engine/src/triage.ts                      |  8 ++-
 9 files changed, 164 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-6570

Fusion-Task-Lineage: 455f38a8-5e4f-4643-a3ce-088ef0c92b01
2026-06-17 06:14:10 -07:00
gsxdsm
e2a3a37b26 FN-6569: make auto-merge retry cap configurable
Adds a project setting that controls how many auto-merge conflict retries run before recovery paths give up.

- Add maxAutoMergeRetries to project settings defaults, schema, types, and dashboard controls.
- Resolve the retry cap in engine merge handling, self-healing recovery, stall detection, and blocker fanout logic.
- Cover custom retry caps with core, dashboard, and engine regression tests.

Files changed:
 .changeset/fn-6569-max-auto-merge-retries.md       |  5 ++
 docs/architecture.md                               |  2 +-
 docs/settings-reference.md                         |  1 +
 .../core/src/__tests__/settings-defaults.test.ts   | 12 ++++
 packages/core/src/in-review-stall.ts               | 16 ++++-
 packages/core/src/index.ts                         |  1 +
 packages/core/src/settings-schema.ts               |  6 ++
 packages/core/src/task-priority.ts                 |  4 +-
 packages/core/src/types.ts                         |  8 +++
 .../dashboard/app/components/SettingsModal.tsx     |  8 +++
 .../components/settings/sections/MergeSection.tsx  | 26 +++++++
 .../app/hooks/__tests__/useBlockerFanout.test.ts   |  5 +-
 packages/dashboard/app/hooks/useBlockerFanout.ts   |  3 +-
 .../auto-merge-retry-cap-settings.test.ts          | 79 ++++++++++++++++++++++
 packages/engine/src/project-engine.ts              | 77 +++++++++++++--------
 packages/engine/src/self-healing.ts                | 30 +++++---
 16 files changed, 236 insertions(+), 47 deletions(-)

Fusion-Task-Id: FN-6569
Fusion-Task-Lineage: 42242d6a-68bc-41f1-b2d9-af2e6f168eed
2026-06-17 04:51:31 -07:00
gsxdsm
d17a6dbd74 FN-6535: harden task list dist runtime coverage
Add regression coverage that exercises fn_task_list through the built @fusion/core dist exports.

- Expand core task-list formatting tests from export checks to a runtime-shaped fn_task_list execution path.
- Add a CLI extension regression test that mocks @fusion/core to the built dist barrel before executing fn_task_list.
- Cover broad and filtered task-list truncation paths with dependency rendering to catch missing clampTaskListText exports.

Files changed:
 packages/cli/src/__tests__/extension.test.ts       |  82 ++++++++++++++-
 .../core/src/__tests__/task-list-format.test.ts    | 110 ++++++++++++++++++++-
 2 files changed, 190 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6535

Fusion-Task-Lineage: dd405811-5655-406d-92e6-53f0e35ac217
2026-06-17 02:50:29 -07:00
gsxdsm
177cce4059 FN-6515: guard task list formatting exports
Add regression coverage for task-list formatter exports and broad list clamping.\n\n- Verify @fusion/core source and built dist barrels expose task-list formatting helpers.\n- Cover broad fn_task_list output clamping as one plain-text block.\n- Document the built-dist guard expectation for runtime-consumed core exports.\n\nFiles changed:\n docs/testing.md                                    |  2 ++\n packages/cli/src/__tests__/extension.test.ts       | 35 ++++++++++++++++++++++\n .../core/src/__tests__/task-list-format.test.ts    | 32 ++++++++++++++++++++\n 3 files changed, 69 insertions(+)

Fusion-Task-Id: FN-6515

Fusion-Task-Lineage: b19dd616-6b5a-4b8a-8909-f368459fdc53
2026-06-16 23:32:38 -07:00
gsxdsm
0db81349bb FN-6492: clamp task list text output
Bound fn_task_list responses now stay as plain text across board-tool surfaces.\n\n- Add a shared task-list text clamp with an explicit truncation marker.\n- Route CLI, dashboard planning-board, and engine triage task-list output through the shared formatter.\n- Cover bounded and column-filtered output with core and CLI regression tests.\n- Record the patch changeset and quarantine the observed engine CLI executor flake.\n\nFiles changed:\n .changeset/fn-6492-task-list-text-bound.md         |  5 ++\n packages/cli/src/__tests__/extension.test.ts       | 79 +++++++++++++++++++++-\n packages/cli/src/extension.ts                      |  7 +-\n .../core/src/__tests__/task-list-format.test.ts    | 75 ++++++++++++++++++++\n packages/core/src/index.ts                         |  1 +\n packages/core/src/task-list-format.ts              | 45 ++++++++++++\n packages/dashboard/src/planning-board-tools.ts     |  8 ++-\n packages/engine/src/triage.ts                      |  7 +-\n packages/engine/vitest.config.ts                   |  5 ++\n scripts/lib/test-quarantine.json                   |  5 ++\n 10 files changed, 232 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-6492

Fusion-Task-Lineage: 8b347efb-bc17-4bbe-937c-4f07c63df318
2026-06-16 19:31:33 -07:00
gsxdsm
a38752c6bb FN-6486: rescue quarantined flaky tests
Rescue the same-day core and CLI flaky quarantines by fixing their fixture seams instead of appeasing timeouts.

- Make the core concurrent-write lock helper release synchronously inside its child process so package load cannot delay the transient lock release.
- Close real CLI TaskStore fixtures before removing temp roots and switch mock cleanup to non-hoisted unmocking.
- Remove both test files from package quarantine excludes and clear the quarantine ledger while documenting the rescue pattern.

Files changed:
 docs/testing.md                                         |  2 ++
 packages/cli/src/__tests__/extension-task-tools.test.ts | 17 +++++++++++++----
 packages/cli/vitest.config.ts                           |  4 +++-
 .../core/src/__tests__/store-concurrent-writes.test.ts  |  8 +++++++-
 packages/core/vitest.config.ts                          |  4 +++-
 scripts/lib/test-quarantine.json                        | 13 +------------
 6 files changed, 29 insertions(+), 19 deletions(-)

Fusion-Task-Id: FN-6486

Fusion-Task-Lineage: c90358c4-0549-4c68-8d17-2e2a336433b5
2026-06-16 15:08:24 -07:00
gsxdsm
0093678ee6 FN-6481: require release triage authorization
Block release-class tasks from automatic triage dispatch unless they come from a user-authored source with explicit authorization.

- Add release intent classification and authorization-marker enforcement before final triage transitions.
- Record activity/log details when release tasks are parked awaiting manual approval.
- Surface the new release-authorization activity in dashboard activity views.
- Cover release gating behavior with engine tests and document the architecture pattern.
- Add a changeset for the published CLI package.

Files changed:
 .changeset/fn-6481-release-triage-authorization.md |   5 +
 .../release-triage-requires-user-authorization.md  |  33 +++++
 packages/core/src/types.ts                         |   2 +
 packages/core/vitest.config.ts                     |   4 +
 packages/dashboard/app/components/ActivityFeed.tsx |   5 +
 .../dashboard/app/components/ActivityLogModal.tsx  |   6 +
 .../__tests__/triage-release-authorization.test.ts | 158 +++++++++++++++++++++
 .../engine/src/triage-release-authorization.ts     | 100 +++++++++++++
 packages/engine/src/triage.ts                      |  51 +++++++
 scripts/lib/test-quarantine.json                   |   8 +-
 10 files changed, 371 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6481
Fusion-Task-Lineage: 0bddb77a-87e5-4fa5-b31a-e773bdae7a29
2026-06-16 15:08:24 -07:00
gsxdsm
61f389ed3c Address PR review feedback (#1683)
- monitor-trait: atomic incident-level claim (conditional UPDATE) so concurrent
  regression ingests can't open duplicate fix tasks; loser absorbs (+ tests)
- register-git-github: attach/detach KnowledgeIndexRefreshService per project
  store so task:moved→done refreshes the index for non-primary projects
- agent-logger: make usage-event emission genuinely fail-soft (try/catch +
  absorb async rejection) so a throwing emitUsageEvent can't break tool logging
  (+ sync-throw and rejected-promise tests)
- db: add composite (kind, ts) index on usage_events backing Command Center
  tool analytics; folded into migration 118 (unreleased) — no SCHEMA_VERSION bump
- db.test: assert the six v120 deployments/incidents indexes survive migration
- lazy-loaded-views-docs.test: fix stale "20-view" → "21-view" description
- add FNXC_LOG change-log annotations across the touched package files per AGENTS.md

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-16 05:56:11 -07:00
gsxdsm
f5bd86214f feat(monitor): U13 — monitor stage (deployments, incidents, MTTR) closes the loop
Adds deployments + incidents tables (db migration 119→120), real MTTR/deploy/
incident aggregation replacing the U7 seam, an auth-gated SSRF-safe deploy/
incident ingestion route, and a monitor trait that auto-opens a single fix task
on a regression signal. Storm guard groups by the U11 Signal groupingKey with a
threshold gate, cooldown absorption, per-window circuit breaker, and self-loop
guard. Also completes the otel test ActivityAnalytics fixture.
2026-06-15 20:59:57 -07:00
gsxdsm
0a87890bd8 feat(knowledge): U14 — persistent knowledge index
Adds knowledge_pages (db migration 118→119) + a deterministic, model-free
keyword index of task/PR history in packages/dashboard/src, incrementally
refreshed on task completion (task:moved→done listener) and queryable via an
auth-gated, project-scoped API. Complements the LLM-extracted insights/memory
surfaces rather than duplicating them.

Follow-ups: no React view yet; PR-history page population attaches via U18.
2026-06-15 20:34:52 -07:00
gsxdsm
168dc2f796 feat(command-center): U10 — OpenTelemetry (OTLP) metrics export
mapAnalyticsToOtlp maps token/cost/activity aggregates to the OTLP/HTTP JSON
envelope (counters + gauges, model/provider/node/agent attributes); a periodic
dashboard exporter is opt-in via FUSION_OTEL_METRICS_ENDPOINT, https-validated,
header-redacted, backs off on failure, and never blocks startup/shutdown.
Minimal exporter (no SDK dep) — real @opentelemetry SDK is a follow-up.
2026-06-15 20:19:16 -07:00
gsxdsm
5bc8901f06 feat(command-center): U7 — SDLC funnel + throughput
aggregateSdlcFunnel derives per-stage counts, conversion, completion rate, and
throughput/day from activityLog task:moved transitions, mapping columns to stages
by trait (unknown → Other). Rides additively on the /activity payload; SdlcFunnel
renders it via the U4 Funnel primitive in the Overview Throughput section.
2026-06-15 20:15:59 -07:00
gsxdsm
cf46859335 feat(router): U17 — Fusion Model Router (session-level selection layer)
routeModel + conservative v0 allowlist (dependabot/lint → cheap tier) wired
into execution/planning/validation lanes in model-resolution.ts; governance
(isPermitted) and column-agent override are absolute, OFF by default. Routing
decisions (with counterfactual) emit via the U1 usage_events seam.
2026-06-15 19:57:20 -07:00
gsxdsm
e617ce65d9 feat(pr): U18 — surface + gate auto-resolution of PR review comments
Adds autoResolveReviewComments project setting (default on) gating the existing
Review-response loop, a single-sourced summarizePrThreadActivity counter, and
fixed/acted thread counts in the dashboard PR summary. Resolution stays
independent of the auto-merge gate (disabled merge still resolves threads).
2026-06-15 19:44:17 -07:00
gsxdsm
113263f362 feat(command-center): U9+U6a — analytics API endpoints + live snapshot composer
composeLiveSnapshot (core, U6a) feeds GET /api/command-center/live; register-
command-center-routes exposes tokens/tools/activity/productivity/live as thin
adapters over the U2 aggregators + U3 cost. All endpoints inherit session auth
(401 unauth) and apply getScopedStore (no cross-project leak). Vite proxy verified.
2026-06-15 19:44:10 -07:00
gsxdsm
4519732b20 feat(analytics): U3 — model pricing map + cost derivation
costFor() derives USD from token counts via a hand-maintained provider:model
rate map with pricingAsOf + staleness flag; unknown models report unavailable
rather than guessing. Cost wired additively into token-analytics per-task so it
is correct for any groupBy.
2026-06-15 19:31:54 -07:00
gsxdsm
53bb1d8f37 feat(analytics): U2 — core date-range aggregators (tokens/tools/activity/productivity)
Reusable aggregate() over tasks + usage_events with model/provider/node/agent
grouping. Autonomy ratio sources interventions from approval audit events +
user-authored steers (agent steers excluded); fully-autonomous sessions report
tool-calls-per-session, never divide-by-zero. LOC/MTTR seams flagged unavailable.
2026-06-15 19:27:45 -07:00
gsxdsm
ab9fdc4136 feat(telemetry): U1 — queryable usage_events table + emitUsageEvent capture
Schema migration 117→118 adds usage_events; events captured via a dedicated
emitUsageEvent seam wired through AgentLogger tool hooks + executor session
context (model/provider/nodeId), not by widening log signatures. meta is
size-capped and carries only non-sensitive descriptors.
2026-06-15 19:20:38 -07:00
gsxdsm
799e590e3e Merge pull request #1580 from Runfusion/feature/workflow-owned-merge-s07-completion-handoff-merge-work
refactor(workflow): S07 completion handoff creates merge work
2026-06-16 04:30:22 +08:00
gsxdsm
45184aef7e feat(acp): enable Route A via experimental flag (claudeCliAcp), default ON
Replace the manual FUSION_CLAUDE_ACP env enable with an experimental feature
switch. `experimentalFeatures.claudeCliAcp` is ON by default (off only when
explicitly set false); the engine translates it into the FUSION_CLAUDE_ACP
dispatch the pi-claude-cli provider reads, at registerExtensionProviders time.

- Still fail-closed: with no bridge path published (acp-runtime plugin absent),
  the provider falls back to `claude -p`.
- Explicit FUSION_CLAUDE_ACP env always wins (operator / test override).
- New testable helper claude-acp-enable.ts (6/6 tests); flag documented in the
  core experimentalFeatures doc.

So with the acp-runtime plugin installed, Claude CLI now routes through the ACP
bridge by default; set experimentalFeatures.claudeCliAcp=false to force `-p`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-15 12:14:20 -07:00
gsxdsm
fee0178b4f FN-6461: block incomplete no-commits no-op finalization
Add a shared no-op finalize guard so no-commits tasks with mostly incomplete steps return to todo instead of silently completing.

- Add core step-evidence evaluation for no-commits no-op finalization.
- Apply the guard across AI empty merge, early empty-own-diff, legacy no-op classifier, direct no-op, and self-healing finalize lanes.
- Emit run-audit/log evidence and preserve progress when demoting blocked tasks.
- Cover guard behavior with core, merger, AI merge, real-git, and self-healing tests.
- Document the finalize integrity invariant and add a patch changeset.

Files changed:
 .changeset/fn-6461-no-commits-finalize-guard.md    |   5 +
 docs/architecture.md                               |   2 +
 .../__tests__/no-commits-finalize-guard.test.ts    |  58 +++++++
 packages/core/src/index.ts                         |   2 +
 packages/core/src/no-commits-finalize-guard.ts     |  42 +++++
 packages/engine/src/__tests__/merger-ai.test.ts    |  59 +++++++
 .../merger-finalize-unproven.real-git.test.ts      | 176 +++++++++++++++++++++
 packages/engine/src/__tests__/self-healing.test.ts | 125 +++++++++++++++
 packages/engine/src/merger-ai.ts                   |  45 ++++++
 packages/engine/src/merger.ts                      | 130 +++++++++++++++
 packages/engine/src/run-audit.ts                   |   6 +
 packages/engine/src/self-healing.ts                |  41 ++++-
 12 files changed, 689 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6461
Fusion-Task-Lineage: 36647768-42da-414a-9304-d8e0ed61b99c
2026-06-15 02:29:08 -07:00
gsxdsm
4f7b3ac78f FN-6439: clear stale near-duplicate flags
Clear near-duplicate decisions when their canonical task is no longer active.

- Add a shared canonical activity helper for near-duplicate detection.
- Clear stale persisted near-duplicate metadata when canonical tasks are done, archived, or deleted.
- Prevent triage and dashboard surfaces from presenting duplicate decisions for inactive canonicals.
- Cover stale-flag cleanup and hidden dashboard affordances with regression tests.

Files changed:
 docs/task-management.md                            |   4 +-
 .../near-duplicate-stale-flag-clear.test.ts        | 105 +++++++++++++++++++++
 packages/core/src/__tests__/near-duplicate.test.ts |  19 +++-
 packages/core/src/index.ts                         |   2 +
 packages/core/src/near-duplicate-canonical.ts      |  25 +++++
 packages/core/src/near-duplicate.ts                |   3 +
 packages/core/src/store.ts                         | 102 +++++++++++++++++++-
 packages/dashboard/app/App.tsx                     |   7 +-
 packages/dashboard/app/components/Column.tsx       |  10 ++
 packages/dashboard/app/components/TaskCard.tsx     |  12 ++-
 .../dashboard/app/components/TaskDetailModal.tsx   |  12 ++-
 packages/dashboard/app/components/WorktreeGroup.tsx     |  30 +++++-
 .../app/components/__tests__/TaskCard.test.tsx     |  28 ++++++
 .../__tests__/TaskDetailModal.rendering.test.tsx   |  26 +++++
 .../near-duplicate-intake.test.ts                  |  24 +++++
 packages/engine/src/triage.ts                      |  10 ++
 16 files changed, 411 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6439

Fusion-Task-Lineage: e57b80e8-36aa-4b96-ad13-53b5a431477d
2026-06-14 15:29:35 -07:00
gsxdsm
2fc6d4d667 FN-6430: rescue CLI quarantine tests
Rescue the quarantined CLI suites by fixing shared test isolation instead of extending timeouts.

- Remove rescued CLI files from the quarantine ledger and Vitest exclude list while preserving an empty rescue ledger comment.
- Tighten Vitest HOME isolation to reject inherited worker homes and sweep legacy top-level fn-test-home roots with bounded cleanup.
- Reset affected CLI fixtures, close research stores, and narrow the slow mission store seam so rescued tests run on default timeouts.
- Document the CLI shared-fixture rescue pattern for future quarantine recoveries.

Files changed:
 docs/testing.md                                    |   2 +
 .../cli/src/__tests__/extension-task-tools.test.ts |   7 +-
 packages/cli/src/__tests__/extension.test.ts       | 117 +++++++++----------
 .../cli/src/commands/__tests__/mission.test.ts     |  16 ++-
 packages/cli/src/commands/__tests__/plugin.test.ts |   5 +
 packages/cli/vitest.config.ts                      |  52 ++-------
 packages/core/src/__test-utils__/vitest-setup.ts   |  25 ++++-
 .../core/src/__test-utils__/vitest-teardown.ts     |  28 ++++-
 .../vitest-teardown-worker-root-cleanup.test.ts    |  15 +++
 scripts/lib/test-quarantine.json                   | 124 +--------------------
 10 files changed, 157 insertions(+), 234 deletions(-)

Fusion-Task-Id: FN-6430

Fusion-Task-Lineage: 943b73b4-5f92-4703-8e93-0ae3207eb63c
2026-06-14 15:29:35 -07:00
gsxdsm
aa71ace101 fix(auth): refresh expired Claude OAuth tokens
Refresh stored Claude OAuth credentials before reporting dashboard auth status or resolving model auth so users do not need to repeatedly re-login after access-token expiry.

Coalesce concurrent refresh attempts, prevent stale refreshes from overwriting newer logins, and route CLI dashboard/serve/daemon/onboard auth wiring through the shared refresh-capable storage.
2026-06-13 23:20:06 -07:00
gsxdsm
b1ba87e599 FN-6414: preserve built-in Z.ai models after extensions
Keep GLM-5.2 visible when user Z.ai extensions replace the provider registration.

- Add shared helpers to clone and register the built-in Z.ai provider safely.
- Re-merge missing built-in Z.ai models after extension provider registration in daemon, serve, dashboard, and pi flows.
- Cover provider replacement behavior in core and dashboard model route tests, and document the extension-preserving behavior.

Files changed:
 .changeset/FN-6414-glm-5-2-visible.md              |  5 ++
 docs/settings-reference.md                         |  2 +-
 packages/cli/src/commands/daemon.ts                | 12 +--
 packages/cli/src/commands/dashboard.ts             | 12 +--
 packages/cli/src/commands/serve.ts                 | 12 +--
 packages/core/src/__tests__/zai-provider.test.ts   | 33 +++++++-
 packages/core/src/index.ts                         |  7 +-
 packages/core/src/zai-provider.ts                  | 93 +++++++++++++++++++++
 ...register-model-routes-zai-real-registry.test.ts | 97 ++++++++++++++++++++++
 packages/engine/src/pi.ts                          | 12 +--
 10 files changed, 250 insertions(+), 35 deletions(-)

Fusion-Task-Id: FN-6414

Fusion-Task-Lineage: f0990da2-968d-4782-8c00-fbc350d6954f
2026-06-13 21:17:20 -07:00
gsxdsm
066c919ace test: quarantine slow and flaky test lanes
Move observed load-sensitive and slow tests out of the default lanes per the deletion-ratchet policy, keep the quarantine ledger in sync, and preserve corrupt databases when recovery fails during verification.
2026-06-13 19:22:00 -07:00
gsxdsm
821a8fb936 Merge pull request #1672 from Runfusion/feature/ce-workflow-integration
feat: make the compound-engineering workflow run the CE way end-to-end
2026-06-13 16:36:57 -07:00
gsxdsm
9149121bb6 FN-6401: add built-in Z.ai GLM-5.2 support
Add Z.ai's built-in provider registration so GLM-5.2 is selectable across Fusion model settings.

- Define and export a shared Z.ai provider registration with existing GLM models plus GLM-5.2.
- Register the built-in provider for CLI server and engine pi model registries.
- Cover provider availability and CLI auth-provider wrapping with focused tests.
- Document Z.ai model selection and add a minor changeset.

Files changed:
 .changeset/FN-6401-glm-5-2.md                      |   5 +
 docs/settings-reference.md                         |   2 +
 packages/cli/src/commands/__tests__/daemon.test.ts |  11 ++
 .../cli/src/commands/__tests__/dashboard.test.ts   |  13 +++
 packages/cli/src/commands/__tests__/serve.test.ts  |  11 ++
 packages/cli/src/commands/daemon.ts                |   8 ++
 packages/cli/src/commands/dashboard.ts             |   8 ++
 packages/cli/src/commands/serve.ts                 |   8 ++
 packages/core/src/__tests__/zai-provider.test.ts   |  48 ++++++++
 packages/core/src/index.ts                         |   2 +
 packages/core/src/zai-provider.ts                  | 125 +++++++++++++++++++++
 .../src/__tests__/pi-create-fn-agent.test.ts       |   5 +-
 packages/engine/src/pi.ts                          |  20 +++-
 13 files changed, 264 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6401

Fusion-Task-Lineage: e1f7a90d-0614-4d9f-826f-015605a08baa
2026-06-13 16:30:29 -07:00
gsxdsm
80fbcdd5a3 FN-6396: harden test worker temp cleanup
Prevent stale Fusion test worker roots from leaking across merge-gate runs.

- Add per-run tokens to worker-root owner markers and pruning checks.
- Remove self-minted fallback worker roots during Vitest exit cleanup.
- Cover stale pid reuse, markerless redir roots, and SIGKILL-style orphan pruning with regression tests.

Files changed:
 packages/core/src/__test-utils__/vitest-setup.ts   | 83 +++++++++++++++++++---
 .../core/src/__test-utils__/vitest-teardown.ts     |  8 ++-
 .../vitest-teardown-worker-root-cleanup.test.ts    | 19 ++++-
 scripts/__tests__/test-changed.test.mjs            | 74 ++++++++++++++++++-
 scripts/test-changed.mjs                           | 76 ++++++++++++++++----
 5 files changed, 233 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-6396

Fusion-Task-Lineage: 711d966d-c70e-4cd7-81cd-accd18f17202
2026-06-13 16:30:28 -07:00
gsxdsm
dd0ceec7dd Merge main: keep ce-* agent install alongside stale-session recovery; address PR review
Resolves the onLoad conflict in the compound-engineering plugin by keeping both
the bundled ce-* persona-def install (this branch) and main's
recoverStaleSessionsForContext call.

Also addresses PR #1672 review feedback:
- executor: sentinel resume now guards on !live.paused (mirrors
  runAwaitInputNode) so a still-paused task can't consume a reply and re-enter
  the skill early.
- TaskCard: make the Answer-questions button text/title/aria-label fallbacks
  consistent ("Answer questions") for label-in-name a11y; update test.
- ce-work: replace the unshipped `skill: ce-worktree` reference with the real
  git worktree commands so Option B can't dead-end.
- ce-resolve-pr-feedback: invoke bundled scripts by absolute path via the new
  FUSION_CE_SKILLS_DIR env (sessions run with cwd=projectRoot); add the Fusion
  await-input sentinel path instead of AskUserQuestion for workflow steps;
  normalize whitespace-only review bodies like PR comments.
- plugin: expose FUSION_CE_SKILLS_DIR (installed skills root) to step sessions.
- plan doc: add language to fenced block (markdownlint MD040).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 16:08:51 -07:00
gsxdsm
97a49ac196 FN-6382: unquarantine stabilized flaky tests
Restore quarantined tests by fixing their flaky harness seams instead of extending the deletion ratchet.

- Mark active Vitest worker roots and skip live worker roots during prune cleanup.
- Make bubblewrap backend coverage deterministic with an injectable runner and restore it to the engine gate.
- Remove rescued core and bubblewrap tests from the quarantine ledger and Vitest excludes.

Files changed:
 .../core/src/__test-utils__/vitest-teardown.ts     | 10 +++++-
 packages/core/vitest.config.ts                     |  8 +----
 .../__tests__/sandbox/bubblewrap-backend.test.ts   | 29 +++++++++------
 packages/engine/src/sandbox/bubblewrap-backend.ts  |  9 +++--
 packages/engine/vitest.config.ts                   |  1 -
 scripts/__tests__/test-changed.test.mjs            | 23 ++++++++++++
 scripts/lib/test-quarantine.json                   | 34 ++----------------
 scripts/test-changed.mjs                           | 41 ++++++++++++++++++++++
 8 files changed, 102 insertions(+), 53 deletions(-)

Fusion-Task-Id: FN-6382

Fusion-Task-Lineage: 018dc7ac-1ef1-495e-a5fd-96ea44fcd43b
2026-06-13 11:39:37 -07:00
gsxdsm
2e03e54383 feat(workflow): CE commit/PR + resolve-feedback in the merge stage (U9)
Add ce-commit-push-pr and ce-resolve-pr-feedback as coding-mode skill
steps before the merge seam. Per KTD-6 the CE steps own commit/push/PR
creation and feedback resolution; Fusion's merge seam still owns the
board-state merge transition, so the two never race the same branch.
Tests assert the new steps, coding mode, preserved merge seam, and
ordering.

NOTE: the precise handoff between ce-commit-push-pr's PR and Fusion's
workflow-owned board merge (Risk-3) needs verification on a running board.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 09:01:18 -07:00
gsxdsm
10972bbdce FN-6360: clean up leaked test worker temp roots
Ensure test isolation removes stale worker temp roots after interrupted or busy Vitest runs.

- Add bounded retry cleanup for Vitest worker roots during teardown.
- Prune orphaned fusion-test-workers-* directories before changed-test isolation checks.
- Cover worker-root retry and pruning behavior with targeted tests.

Files changed:
 .../core/src/__test-utils__/vitest-teardown.ts     | 50 ++++++++++--
 .../vitest-teardown-worker-root-cleanup.test.ts    | 88 ++++++++++++++++++++++
 scripts/__tests__/test-changed.test.mjs            | 33 ++++++++
 scripts/test-changed.mjs                           | 32 ++++++++
 4 files changed, 196 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6360

Fusion-Task-Lineage: d537941d-dd58-403a-a82e-f0aeee9c1eb0
2026-06-13 08:11:46 -07:00
gsxdsm
bffae81a98 FN-6277: track and reconcile legacy auto-merge stamps
Track legacy auto-merge stamp provenance and add safe operator cleanup.

- Add autoMergeProvenance storage and migration support so user overrides can be distinguished from legacy review-entry stamps.
- Mark existing ambiguous in-review autoMerge=true tasks as legacy stamps without changing behavior, and expose a dry-run/apply reconciliation API to clear them safely.
- Emit a non-mutating advisory when global auto-merge is disabled while legacy stamped review tasks remain.
- Cover migration, persistence, reconciliation, movement, merge resolution, and advisory behavior with regression tests and docs.

Files changed:
 .../fn-6277-legacy-automerge-stamp-cleanup.md      |   5 +
 docs/architecture.md                               |   2 +-
 docs/settings-reference.md                         |   2 +-
 packages/core/src/__tests__/db-migrate.test.ts     |  30 ++--
 packages/core/src/__tests__/db.test.ts             |  44 +++---
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 .../legacy-automerge-stamp-reconcile.test.ts       | 144 +++++++++++++++++++
 .../src/__tests__/merge-request-record.test.ts     |   2 +-
 packages/core/src/__tests__/mission-store.test.ts  |   2 +-
 packages/core/src/__tests__/run-audit.test.ts      |   4 +-
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/store-movement.test.ts |  14 ++
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/__tests__/task-merge.test.ts     |  16 ++-
 packages/core/src/db.ts                            |  10 +-
 packages/core/src/index.ts                         |   1 +
 packages/core/src/store.ts                         | 157 ++++++++++++++++++++-
 packages/core/src/task-merge.ts                    |   8 +-
 packages/core/src/types.ts                         |  10 +-
 .../automerge-toggle-legacy-advisory.test.ts       | 128 +++++++++++++++++
 packages/engine/src/project-engine.ts              |  68 ++++++++-
 22 files changed, 593 insertions(+), 70 deletions(-)

Fusion-Task-Id: FN-6277

Fusion-Task-Lineage: 22d36519-f2ba-4ca7-8a09-12fc803c9a5b
2026-06-13 05:06:05 -07:00
gsxdsm
12621aaf60 FN-6335: record zero-step built-in workflow defaults
Record stepless built-in workflow defaults so zero-step selections survive task creation.\n\n- Return an explicit workflow selection for built-in workflows that compile to zero steps.\n- Cover both normal and reserved-id task creation for coding and interpreter-deferred stepwise defaults.\n- Add a patch changeset for the published Fusion package.\n\nFiles changed:\n .changeset/FN-6335-zero-step-workflow-defaults.md     |  5 +++++\n packages/core/src/__tests__/builtin-workflows.test.ts | 14 ++++++++++++++\n packages/core/src/store.ts                            |  4 +++-\n 3 files changed, 22 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-6335

Fusion-Task-Lineage: 521ef05d-bef7-4d26-9f6a-592363f522d1
2026-06-13 03:37:41 -07:00
gsxdsm
06e1ee7565 FN-6334: rescue db recovery corruption test
Rescues the database recovery corruption test by reducing its fixture size and removing its quarantine.

- Reduce recovery test fixture rows so sqlite3 .recover is not overfed while still corrupting a B-tree page.
- Re-enable packages/core/src/__tests__/db.test.ts in the core Vitest config.
- Remove the db recovery test entry from the quarantine ledger.

Files changed:
 packages/core/src/__tests__/db.test.ts | 5 +++--
 packages/core/vitest.config.ts         | 1 -
 scripts/lib/test-quarantine.json       | 5 -----
 3 files changed, 3 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6334

Fusion-Task-Lineage: c4555976-fe98-4f25-a1b5-e70bfd991b16
2026-06-13 03:26:52 -07:00
gsxdsm
4e6df035c1 FN-6275: allow verified no-op completions
Allow executors to finish already-satisfied tasks without fabricating commits while preserving existing completion guards.

- Add leading sentinel parsing for premise-stale, no-op, duplicate, and redundant completion summaries.
- Permit zero-commit fn_task_done only for recognized sentinels or existing no-commit contracts, with audit log/activity details.
- Document the verified no-op completion contract and add regression coverage for accepted and refused paths.

Files changed:
 .changeset/fn-6275-no-op-completion.md             |   5 ++
 docs/architecture.md                               |   1 +
 .../src/__tests__/no-op-completion-marker.test.ts  |  55 ++++++++++++
 packages/core/src/agent-prompts.ts                 |   4 +
 packages/core/src/index.ts                         |   5 ++
 packages/core/src/no-op-completion-marker.ts       |  48 ++++++++++
 .../__tests__/executor-task-done-invariant.test.ts | 100 +++++++++++++++++++++
 .../engine/src/__tests__/executor-test-helpers.ts  |   1 +
 packages/engine/src/executor.ts                    |  64 ++++++++++++-
 9 files changed, 279 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-6275

Fusion-Task-Lineage: 0a2ec21b-415f-411c-bfcd-4f1c19a6a136
2026-06-13 02:54:57 -07:00
gsxdsm
ae1a889d48 FN-6325: speed up core stability tests
Classify the archive FTS churn and merge-queue hook timeouts as deterministic test-cost fixes instead of quarantines.

- Reduce the archive FTS churn fixture while preserving rebuild shrinkage and search coverage.
- Use in-memory TaskStore setup for merge-queue cases that do not require disk persistence.
- Keep disk-backed coverage for legacy migration and competing-store lease arbitration.
- Verification: targeted archive FTS + merge-queue run passed in 7.47s versus 27.69s before the fix.

Files changed:
 .../core/src/__tests__/archive-db-fts-maintenance.test.ts |  6 +++---
 packages/core/src/__tests__/store-merge-queue.test.ts     | 15 ++++++++++-----
 2 files changed, 13 insertions(+), 8 deletions(-)

Fusion-Task-Id: FN-6325

Fusion-Task-Lineage: a6191c99-f7f1-4766-9e01-ccc3f0673bcd
2026-06-13 01:23:42 -07:00
gsxdsm
64de883d6c feat(workflow): run ce-work for compound-engineering execute step (U4)
Swap the compound-engineering workflow's execute seam for a
compound-engineering:ce-work skill node in coding mode, so the
implementation stage actually runs the CE way (R1). Add tests asserting
the ce-work skill executor and coding toolMode.

Part of the compound-engineering workflow integration plan
(docs/plans/2026-06-13-002).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-13 01:01:50 -07:00