Commit Graph

9475 Commits

Author SHA1 Message Date
gsxdsm
9f0492e69f fix(review): address PR #1713 review findings
- base-commit-capture.ts: shell-quote integration branch with a real
  single-quoted POSIX literal instead of JSON.stringify (not shell-safe).
- TaskCard.tsx: memo compares full workspaceWorktrees values, not just key
  sets, so a same-key worktreePath/branch change re-renders.
- TaskDetailModal.tsx: gate/render workspace summary off hydrated workingTask.
- worktree-acquisition.ts: null the singular worktree/branch columns in the
  workspaceWorktrees write so isWorkspaceTask stays true; wrap non-fatal
  post-acquire observability so logEntry/audit can't re-escalate to fatal.
- agent-tools.ts: register sub-repo worktree via onAcquired unconditionally
  (idempotent) so a resumed/already-acquired path is tracked after restart.
- executor.ts: DB liveness fallback also checks task.workspaceWorktrees paths.
- executor-workspace.test.ts: root non-git assertion runs in fx.rootDir (".").

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-22 00:22:48 -07:00
gsxdsm
d5fa8654f7 fix(review): Phase A workspace hardening — tool errors, activeWorktrees, non-fatal acquire
ce-code-review (5 personas) on Phase A. No P0; the workspace-root-removal path
was ruled out and the contract changes verified additive. Applied:

P1: fn_acquire_repo_worktree now catches WorkspaceRepoAcquireBusyError (and
generic failures) and returns a sanitized retryable isError instead of an
uncaught throw into the agent loop; runContext is forwarded so audit/log keep
attribution. Per-repo acquired worktree paths are now registered into the
executor's activeWorktrees Set (via an onAcquired callback) — previously the Set
only held the browse-only root, making the U1 per-repo liveness invariant hollow.
Post-acquire identity-guard install and base-SHA capture are now non-fatal
(log-and-continue): a hook/branch failure no longer strands the on-disk worktree
(the worktree is usable without the guard; an undefined baseCommitSha is already
an accepted state).

P2: the KTD3 settings-strip also strips settings.baseBranch (resolveFromSettings
falls back integrationBranch → baseBranch, so a shared baseBranch leaked); the
workspaceWorktrees write re-reads the task fresh before merging to avoid a
sibling-repo clobber on sequential acquires (store-level atomic merge deferred to
Phase B); the busy-path logging is wrapped so it can't mask the busy error; the
TaskCard memo compares key-sets not counts; the stuck-kill no-op for workspace
tasks is now logged; the exclusivity check-then-act synchrony is documented.

Residuals (Phase B): per-repo worktree teardown, orphan-scan coverage, reaper
dedup, store-level atomic merge.

Gate green: typecheck, lint, build, test:gate (649+58), affected (25 + TaskCard 251).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 21:33:56 -07:00
gsxdsm
12d33c512d feat(workspace): Phase A U2 — per-repo acquisition hardening
acquireWorkspaceRepoWorktree now hardens each sub-repo worktree at acquisition:
(1) installs the identity guard with the executor's settings args
(commitMsgHookEnabled/taskPrefix/taskAttributionTrailerName) for single-repo
parity — it was installing no guard before; (2) captures a per-repo
baseCommitSha local-first against the repo's resolved integration branch via
resolveIntegrationBranch(repoAbsPath, {...settings, integrationBranch: undefined})
— stripping the shared override so each sub-repo falls through to its own
origin/HEAD, not a project-wide branch; (3) persists baseCommitSha into the
workspaceWorktrees[repo] entry (Task type extended); (4) registers same-sub-repo
exclusivity on the sub-repo path via activeSessionRegistry under a distinct
"workspace-repo-acquire" kind (released in finally), so two concurrent workspace
tasks contending for the same sub-repo are serialized (throws
WorkspaceRepoAcquireBusyError). Idempotent re-acquire short-circuits.

resolveCapturedBaseCommitSha gains an optional trailing integrationBranch param
defaulting to "main", so existing single-repo callers + base-commit-capture
real-git tests stay green. New audit events worktree:workspace-repo-acquire-busy
/-failed. 6 new real-fixture tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 21:17:08 -07:00
gsxdsm
1fa3691f1f docs(workspace): Phase A implementation plan (U1/U2/U10) 2026-06-21 21:07:32 -07:00
gsxdsm
023e4b057d feat(workspace): Phase A U3 — dashboard "doesn't look broken" floor
Workspace tasks (no task.worktree, populated workspaceWorktrees) now render in
existing task views without crashing or going blank. New read-only
WorkspaceWorktreesSummary component (placeholder "N repos acquired" + a flat
repo→worktree/branch list — within the "doesn't look broken" ceiling, not a rich
status UI); TaskCard and TaskDetailModal nil-guard on isWorkspaceTask. Single-repo
rendering unchanged. CONCEPTS.md notes workspace-task merges are non-atomic
(repos land independently on local integration refs; partial-land is local and
operator-resettable). Tests 8/8; TaskCard regression 251/251.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 21:07:20 -07:00
gsxdsm
09bd01baf0 feat(workspace): Phase A U1 — executor session scoping for workspace mode
In workspace mode (loadWorkspaceConfig present), the executor now skips the
root acquireTaskWorktree({rootDir}) and every intervening rootDir git preflight
(base-commit capture, contamination, identity-guard, verifyWorktreeInvariants),
runs the agent session rooted at the non-git workspace root (cwd=rootDir,
browse-only; task.worktree never set), and tracks activeWorktrees as a per-task
Set<path>. scopePromptToWorktree is a no-op in workspace mode. The non-workspace
path is unchanged (every change branches on this.workspaceConfig; a single-repo
task holds a one-element Set).

Converted every activeWorktrees consumer to membership semantics (feasibility-
verified list): findActiveWorktreeOwner, hasActiveWorktreeBinding, the FN-6736
phantom-binding reclaim, listWorktreeHolders (flat-maps a Set into N holder rows
— verified the FN-6782 reaper keys off taskId only, so slot accounting is
unaffected), the conflict-set iteration, the three deleteActive* unregister
resolvers (loop every path), cleanup, getWorktreePath (undefined for a
multi-worktree workspace task), and the verifyWorktreeInvariants singular
resolution (gated off in workspace mode — per-repo verify returns in Phase B).

Rewrote executor-workspace.test.ts from vi.mock-the-subject to a real two-repo
git fixture harness (_workspace-fixture.ts, shared with later units), 13 tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 21:07:20 -07:00
gsxdsm
316d2659b8 fix(review): workspace-merge park must use status:'failed' to avoid re-enqueue loop (U0)
Post-fix verification review (correctness + adversarial + reliability, unanimous
P0) found that the earlier retry-burn fix introduced an infinite loop: parking a
WorkspaceTaskMergeError task with status:null + mergeRetries:0 passes every
auto-merge eligibility gate (canMergeTask short-circuits only on status==='failed'),
so the cooldown sweep re-enqueues it every tick → guard re-throws → re-park, forever.

- Park with status:'failed' (keep mergeRetries:0). canMergeTask now blocks the
  auto-sweep; a human's manual merge still works because it flows through the
  manual-resolver branch (rejectMergeResolvers), which bypasses canMergeTask — so
  'failed' does not block manual retry (the original comment's worry was wrong).
- Detect the error via `err instanceof Error && err.name === "WorkspaceTaskMergeError"`,
  matching the VerificationError/MergeAbortedError convention and bundle-safe across
  the @fusion/core→@fusion/engine boundary (drops the now-unused class import).
- Document that the dispatch door guard is a fast-fail only; the unconditional
  chokepoint guard inside runAiMerge is the authoritative enforcement.
- Add a regression test asserting the auto-merge park sets status:'failed' (not null).

Gate green: lint, typecheck, build, test:gate (649+58), project-engine (81).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 20:29:46 -07:00
gsxdsm
7240b77c67 fix(review): harden R7 workspace merge guard + deprecation warning (U0)
Applies ce-code-review (autofix) feedback — 5 reviewers, P1s corroborated.

F1 [P1, ×4 reviewers] Guard the merge chokepoint, not just the 4 doors. The
per-caller `getTask().catch(()=>null); if(t) assert` pattern failed open on a
transient read, and runAiMerge re-read the task unguarded — so a workspace
task could reach git work against the non-git root. Added a named
WorkspaceTaskMergeError and call assertNotWorkspaceTaskMerge inside runAiMerge
(the sole merge path) and the deprecated aiMergeTask body; door guards remain
as fast-fail defense-in-depth.

F2 [P1] The dispatch catch treated the guard throw as a merge failure and set
mergeRetries=MAX, permanently blocking manual retry. It now recognizes
WorkspaceTaskMergeError and parks without burning retries.

F3 [P2] Deprecation-warning test asserted toBeLessThanOrEqual(1) — vacuously
true on zero emissions. Now resets the per-project flag and asserts the
warning fires exactly once and not again on a second deterministic merge.

F6 [P2] The once-per-process warning flag suppressed the notice for all other
projects in a multi-project host; now keyed per project (Set by cwd).

F5/F7/F8 [P3] @deprecated propagated to the aiMergeTask barrel re-export; CLI
runTaskMerge guard moved inside the formatted try/catch; FNXC placeholder
timestamps corrected; test .at(-1) -> length index.

Documented as residual (deferred to master-plan U8, not bugs in U0's window):
self-healing auto-finalize + store.mergeTask are additional merge-completing
paths not hardened here — workspace tasks are not end-to-end runnable until
master-plan Phase A, and U8 makes self-healing workspace-aware.

Gate green: typecheck (29 projects), lint, build, test:gate (649+58),
affected tests (206+4).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 19:19:55 -07:00
gsxdsm
a6252e518d refactor(merger): unify on runAiMerge as the sole merge path (U0)
Make runAiMerge (the FN-5633 clean-room AI merge path, already the default)
the sole merge path; soft-deprecate the legacy aiMergeTask pipeline. Phase 0
of the workspace-mode master plan — a standalone merge-consolidation refactor
that lands first so downstream workspace work targets one merge function.

U1 — collapse the dispatch: project-engine.ts now calls runAiMerge
unconditionally; the two direct callers that bypassed the dispatch
(dashboard.ts onMergeImpl in --no-engine mode, task.ts runTaskMerge /
`fn task merge`) now route to runAiMerge too. Export runAiMerge from
@fusion/engine.

U2 — soft-deprecate: aiMergeTask is @deprecated (body retained for a later
deletion pass; shared helpers runAiMerge imports, e.g.
captureSingleCommitLandedMetadata, left intact). merger.mode "deterministic"
is annotated deprecated and made inert (type + field kept — published
@runfusion/fusion surface); the dispatch logs a one-time deprecation warning
and routes to runAiMerge. Changeset added (minor).

U3 — R7 workspace merge-boundary guard: shared @fusion/core predicate
assertNotWorkspaceTaskMerge(task) rejects tasks with populated
workspaceWorktrees at all four merge entry points (dispatch, store.mergeTask,
onMergeImpl, runTaskMerge) with an error naming master-plan U6. Covers the
window until per-repo merge support lands; U6 removes it.

U4 — deterministic-mode blast-radius audit: no production project, CI config,
or seeded setting pins merger.mode "deterministic"; only four engine tests
used it to drive the dispatch to aiMergeTask as a mockable seam — migrated to
mock runAiMerge instead. Other module-level aiMergeTask mocks were dead under
the default "ai" mode or test aiMergeTask directly (body retained), so they
are unaffected.

Also removes an unused acquireWorkspaceRepoWorktree import inherited from the
foundation branch (executor.ts) that was failing lint; master-plan U1 re-adds
it with its per-repo usage.

Merge gate green: lint, typecheck (29 projects), build, test:gate
(649 + 58), plus the migrated (114) and new predicate (4) tests.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 18:58:06 -07:00
MichaelHoughtonDeBox
8f4098e5b1 feat: add workspace mode foundation (multi-repo projects)
Allow registering a non-git parent directory that contains multiple git
repositories as a single Fusion project. The agent acquires per-repo
worktrees on demand via a new `fn_acquire_repo_worktree` tool as it
discovers it needs to work in each sub-repo.

This commit lays the foundation:
- detectWorkspaceRepos / loadWorkspaceConfig / saveWorkspaceConfig in
  @fusion/core (config persisted to .fusion/workspace.json)
- Task.workspaceWorktrees data model + store plumbing (per-repo
  worktree/branch map, distinct from the singular task.worktree)
- acquireWorkspaceRepoWorktree wraps acquireTaskWorktree per sub-repo,
  clearing the singular worktree/branch fields so each sub-repo gets a
  fresh worktree instead of resuming a sibling repo's worktree
- fn_acquire_repo_worktree agent tool + workspace prompt injection
- executor git-repository validation bypassed when a workspace config
  is present
- CLI `fn init` detects a non-git dir containing sub-repos and writes a
  workspace config

Known gap (intentionally left for design discussion, see PR): the
executor's main worktree-acquisition path still assumes a single git
root and is not yet workspace-aware. End-to-end execution (skipping the
root acquisition, per-repo merge, per-repo session scoping) is a
follow-on once the execution model is agreed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 22:04:37 +01:00
gsxdsm
04f266d647 Merge pull request #1709 from Runfusion/gsxdsm/stuck-kill-reset
fix(FN-5048): reset stuck-kill streak on forward progress
2026-06-21 11:49:08 -07:00
gsxdsm
b9b9447d6e fix(FN-5048): reset stuck-kill streak on forward progress
stuckKillCount is a lifetime counter — incremented by self-healing on each stuck-kill
and reset ONLY by a manual retry — so a long task that genuinely advances between
intermittent stalls could be terminalized by accumulation toward maxStuckKills (default 6),
even though it is making progress.

Reset the streak in TaskStore.updateStep when a step reaches a terminal forward status
(done/skipped), the single chokepoint every step-completion surface routes through (legacy
fn_task_update, graph markStepDone, fn_task_done). It deliberately does NOT rescue a task
wedged re-running the same failing step — no step completes between those kills, so it still
terminalizes as designed; it only bounds the budget to consecutive stalls. Complements the
verification fan-out cap (PR #1708) that keeps verification fast in the first place.

New regression suite asserts reset on done/skipped/graph-source-done and NO reset on
in-progress advance or ignored out-of-order transitions. Merge gate + full @fusion/core
suite (6242 tests) + engine self-healing/stuck-detector (442 tests) green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 11:17:56 -07:00
gsxdsm
bbac132d71 Merge pull request #1708 from Runfusion/gsxdsm/slow-tests
fix: keep Fusion test verification bounded
2026-06-21 11:08:02 -07:00
gsxdsm
21df96cfbb fix(FN-5048): address PR feedback on test verification
Fusion-Task-Id: FN-5048
2026-06-21 10:53:08 -07:00
gsxdsm
03af93eb3a fix(FN-5048): direct agent + tool verification away from full workspace suite
Tighten the executor agent guidance and the fn_run_verification tool guidance so
verification stays scoped to changed files instead of running the full workspace
test suite, which (for a foundational-package edit) reverse-expands across the
whole workspace and stalls the task.

- agent-prompts.ts: remove the "during final integration" blanket permission to
  run workspace-wide suites; name the forbidden full-run commands explicitly.
- run-verification-tool.ts: strengthen BOUNDED_VERIFICATION_GUIDANCE to forbid
  `pnpm test:full` / `pnpm verify:workspace` / whole-package runs as verification.

Engine + core typecheck pass; run-verification-command and executor-review-verdicts
prompt-assertion suites stay green (93 tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 10:50:48 -07:00
gsxdsm
e949853511 test(FN-5048): migrate 41 core store tests to shared in-memory harness
The per-test `createTaskStoreTestHarness` recreated a TaskStore from scratch
every test — mkdtemp ×2 + new store + recursive rm with retry backoff — which
dominated wall-clock across these high-test-count files. Switch the files that
tolerate a shared store to `createSharedTaskStoreTestHarness`, which builds the
store once and resets state between tests via full table truncation + FTS
rebuild + filesystem reset, preserving isolation.

Measured on store-create.test.ts (53 tests): 4.44s → 1.78s wall
(test execution 3.59s → 0.93s, ~3.9x). Full @fusion/core suite stays green
(346 files, 6236 tests) and typecheck passes.

19 files that test disk persistence / migration / workflow-definition state are
incompatible with a shared in-memory store and were intentionally left on the
per-test harness.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 10:47:13 -07:00
gsxdsm
bc1c7db4bc Merge pull request #1707 from Runfusion/gsxdsm/engine-worklow
fix(engine): preserve task progress when a single-session run is hard-cancelled (FN-6722)
2026-06-21 10:42:55 -07:00
gsxdsm
ce90cc9b62 fix(FN-5048): keep Fusion test verification bounded 2026-06-21 10:05:12 -07:00
gsxdsm
e6503ca872 Address PR review feedback (#1707)
- Read hasResumableProgress from latestTask (the store snapshot fetched
  at ~9226), not the frozen dispatch-time task param, so a freshly
  dispatched task that commits step progress mid-session is preserved on
  a hard-cancel teardown — not just the re-dispatch case (greptile P1)
- Add companion regression test for the fresh-task-with-in-session-progress
  case, which fails against the stale-task snapshot (greptile P1)
- Reformat the requirement comment block to the canonical FNXC heading
  (FNXC:WorkflowLifecycle yyyy-MM-dd-hh:mm:) convention (CodeRabbit)

Fusion-Task-Id: FN-6722

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 09:59:26 -07:00
gsxdsm
93017a3c4a fix(engine): preserve task progress when a single-session run is hard-cancelled
When the engine aborted in-flight work mid-execution and bounced the task
back to `todo`, the single-session teardown cleared the task `branch` and
re-queued without `preserveResumeState` — resetting every step to `pending`
(store.moveTaskInternal resetAllStepsToPending) and dropping the pointer to
the commits already on the task branch. The next dispatch then re-planned
from Step 0 and the committed work was stranded, observed as FN-6722 losing
all its progress and getting stuck in todo.

The teardown now keeps the branch and moves with `preserveResumeState`
whenever the task has resumable step progress, matching the sibling
step-session (executor ~8065) and pause-park (executor ~1826) paths, so
execute() resumes onto the existing branch from the first incomplete step.
The worktree is still removed to free its concurrency slot (FN-6782) — only
the durable pointers (branch + step state) are kept.

Adds a regression test driving the exact single-session catch teardown.

Fusion-Task-Id: FN-6722

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 09:41:51 -07:00
gsxdsm
7e478fb473 Merge pull request #1703 from Runfusion/gsxdsm/workflow-optional-steps
feat(dashboard): workflow optional steps — authoring, full-modal parity, stepwise seam
2026-06-21 09:04:39 -07:00
gsxdsm
7600e665fb Merge pull request #1706 from Runfusion/chore/claude-md-import
chore: add CLAUDE.md importing AGENTS.md
2026-06-21 09:04:08 -07:00
gsxdsm
c7b56a5ab7 FN-6832: preserve default workflow routing
Preserve the default workflow unless users explicitly request workflow routing changes.

- Update triage and fast-planning prompt guidance to stop inferring alternate workflows from task type or no-commit markers.
- Refresh workflow docs and prompt tests to assert explicit-request-only workflow selection.
- Add a patch changeset for the published CLI package.

Files changed:
 .changeset/fn-6832-workflow-routing.md               |  5 +++++
 docs/workflow-steps.md                               |  5 ++++-
 packages/core/src/agent-prompts.ts                   | 20 +++++++++++++-------
 .../src/__tests__/triage-threshold-settings.test.ts  |  7 +++++--
 packages/engine/src/__tests__/triage.test.ts         | 13 +++++--------
 5 files changed, 32 insertions(+), 18 deletions(-)

Fusion-Task-Id: FN-6832

Fusion-Task-Lineage: 5a7ad103-2081-4c4c-ac32-fd5e4f6adfda
2026-06-21 09:00:40 -07:00
gsxdsm
f13aaa1a99 FN-6722: expose resolved GitHub issues
Expose resolved GitHub issue details in Command Center analytics and exports.

- Add resolved issue rows to local GitHub issue analytics with exact-vs-approximate timestamp metadata.
- Render a resolved issues table in the Command Center GitHub area without empty links when issue URLs are missing.
- Include resolved issue details in CSV export, route coverage, dashboard tests, docs, and the release changeset.
- Quarantine the unrelated dashboard dev-server process timer flake observed during workspace verification under the deletion ratchet.

Files changed:
 ...fn-6722-command-center-resolved-issue-detail.md |   5 +
 docs/dashboard-guide.md                            |   3 +-
 .../src/__tests__/github-issue-analytics.test.ts   | 109 +++++++++++++++++++--
 packages/core/src/github-issue-analytics.ts        |  45 ++++++++-
 packages/core/src/index.ts                         |   1 +
 .../__tests__/CommandCenter.mobile-scroll.test.tsx |   4 +-
 .../__tests__/CommandCenter.test.tsx               |   1 +
 .../components/command-center/areas/GithubArea.tsx |  67 +++++++++++++
 .../command-center/areas/__tests__/areas.test.tsx  |  55 +++++++++++
 .../register-command-center-routes.test.ts         |  61 +++++++++++-
 packages/dashboard/src/command-center-csv.ts       |  39 +++++++-
 packages/dashboard/vitest.config.ts                |   7 +-
 scripts/lib/test-quarantine.json                   |   5 +
 13 files changed, 382 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-6722
Fusion-Task-Lineage: 9fcbd8c2-f1bc-4b86-b5f5-593e5fd0e675
2026-06-21 09:00:40 -07:00
gsxdsm
c18e827b90 FN-6839: await CLI cached store shutdown
Rescue the retained CLI quarantine by making TaskStore shutdown deterministic before fixture cleanup.

- Await cached extension TaskStore closes and clear the cache before asynchronous shutdown drains.
- Update CLI fixtures to await direct and cached store closure, with a regression proving cached close is awaited.
- Remove rescued CLI quarantine entries/excludes and document the loaded-suite rescue with a patch changeset.

Files changed:
 .changeset/fn-6839-close-cached-stores.md          |  5 ++
 CLAUDE.md                                          |  1 +
 docs/testing.md                                    |  4 ++
 .../extension-agent-set-instructions.test.ts       |  2 +-
 .../__tests__/extension-goal-tools-audit.test.ts   |  2 +-
 .../cli/src/__tests__/extension-goal-tools.test.ts |  2 +-
 .../cli/src/__tests__/extension-insights.test.ts   |  6 +--
 .../__tests__/extension-mission-goal-tools.test.ts |  2 +-
 .../cli/src/__tests__/extension-task-tools.test.ts | 16 ++++---
 packages/cli/src/__tests__/extension.test.ts       | 56 +++++++++++-----------
 .../src/__tests__/research-extension-tools.test.ts |  4 +-
 packages/cli/src/extension.ts                      | 16 +++----
 packages/cli/vitest.config.ts                      |  6 +--
 scripts/lib/test-quarantine.json                   | 15 ------
 14 files changed, 68 insertions(+), 69 deletions(-)

Fusion-Task-Id: FN-6839

Fusion-Task-Lineage: ea0c7c77-bb59-4db4-931d-5e052a1043e5
2026-06-21 09:00:40 -07:00
gsxdsm
fbce59b707 FN-6777: add artifact registry storage
Add a core artifact registry for storing metadata and task-scoped artifact payloads.\n\n- Add artifact types, schema, migrations, store APIs, and exports for registering/listing artifact metadata.\n- Persist binary artifact payloads under task or project artifact directories and hydrate artifacts during worktree acquisition.\n- Cover registry behavior, DB schema, and worktree hydration with tests and document storage semantics.\n\nFiles changed:\n .changeset/fn-6777-artifact-registry.md            |   5 +\n docs/storage.md                                    |   8 +\n packages/core/src/__tests__/artifacts.test.ts      | 257 +++++++++++++++++++++\n packages/core/src/__tests__/db.test.ts             |   5 +\n packages/core/src/db.ts                            |  59 ++++-\n packages/core/src/index.ts                         |   2 +-\n packages/core/src/store.ts                         | 220 +++++++++++++++++-\n packages/core/src/types.ts                         |  75 ++++++\n .../engine/src/__tests__/executor-test-helpers.ts  |   1 +\n .../engine/src/__tests__/executor-worktree.test.ts |   2 +\n .../__tests__/worktree-acquisition-backend.test.ts |   2 +-\n .../worktree-acquisition-secrets-env.test.ts       |   2 +-\n .../worktree-acquisition-worktrunk.test.ts         |   2 +-\n .../src/__tests__/worktree-acquisition.test.ts     |   2 +-\n .../src/__tests__/worktree-db-hydrate.test.ts      |  59 +++++\n packages/engine/src/worktree-acquisition.ts        |   2 +-\n packages/engine/src/worktree-db-hydrate.ts         |  42 +++-\n 17 files changed, 732 insertions(+), 13 deletions(-)

Fusion-Task-Id: FN-6777

Fusion-Task-Lineage: 42cdcdcf-6388-42fe-8de1-6857ef20839d
2026-06-21 09:00:40 -07:00
gsxdsm
cc26b333ce FN-6856: restrict executor full-suite testing
Clarify executor verification guidance so agents default to targeted tests and reserve full workspace suites for explicit opt-in.

- Update canonical executor prompts to prohibit full/workspace-wide test suites as the normal verification path.
- Preserve workspace lint/build/typecheck gates while requiring targeted test verification unless task or workflow instructions opt in.
- Extend executor prompt coverage to assert the full-suite restriction and allowFullSuite opt-in language.

Files changed:
 packages/core/src/agent-prompts.ts                            | 11 ++++++++---
 .../engine/src/__tests__/executor-review-verdicts.test.ts     |  5 ++++-
 packages/engine/src/executor.ts                               | 11 ++++++++---
 3 files changed, 20 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6856
Fusion-Task-Lineage: 78d698df-9e85-4371-bf59-af27e64e3069
2026-06-21 09:00:40 -07:00
gsxdsm
e18745b79e FN-6844: move engine controls to footer status bar
Move engine stop, pause, and scheduler tuning controls into the executor footer status bar.

- Add a footer EngineControlMenu popover with stop/start, pause/resume, and debounced concurrency/worktree sliders.
- Remove the engine controls from the dashboard header and wire the footer running-state text to open the controls.
- Update dashboard tests, English labels, and operator documentation for the footer control location.

Files changed:
 docs/dashboard-guide.md                            |   4 +
 packages/dashboard/app/App.tsx                     |   7 -
 .../app/__tests__/tablet-header-controls.test.tsx  |  21 +-
 .../dashboard/app/components/EngineControlMenu.css | 118 +++++++++
 .../dashboard/app/components/EngineControlMenu.tsx | 292 +++++++++++++++++++++
 .../dashboard/app/components/ExecutorStatusBar.css |  28 ++
 .../dashboard/app/components/ExecutorStatusBar.tsx |  25 +-
 packages/dashboard/app/components/Header.css       |  89 -------
 packages/dashboard/app/components/Header.tsx       |  81 +-----
 .../app/components/__tests__/App.test.tsx          | 132 ----------
 .../__tests__/EngineControlMenu.test.tsx           | 145 ++++++++++
 .../__tests__/ExecutorStatusBar.test.tsx           |  40 +++
 .../app/components/__tests__/Header.test.tsx       |  57 +---
 .../components/__tests__/MultiProjectFlow.test.tsx |   8 -
 .../app/components/__tests__/ResearchView.test.tsx |   4 -
 packages/i18n/locales/en/app.json                  |   5 +-
 16 files changed, 666 insertions(+), 390 deletions(-)

Fusion-Task-Id: FN-6844

Fusion-Task-Lineage: f0e17e3d-489e-483c-ba7d-a020c111231c
2026-06-21 09:00:40 -07:00
gsxdsm
6b6d3a8951 chore: add CLAUDE.md importing AGENTS.md
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 04:17:56 -07:00
gsxdsm
85f324fd2c Merge pull request #1705 from Runfusion/gsxdsm/fix-spinners
fix: make loading spinners actually spin across the dashboard
2026-06-21 04:10:56 -07:00
gsxdsm
37d27a99b8 FN-6856: restrict executor full-suite testing
Clarify executor verification guidance so agents default to targeted tests and reserve full workspace suites for explicit opt-in.

- Update canonical executor prompts to prohibit full/workspace-wide test suites as the normal verification path.
- Preserve workspace lint/build/typecheck gates while requiring targeted test verification unless task or workflow instructions opt in.
- Extend executor prompt coverage to assert the full-suite restriction and allowFullSuite opt-in language.

Files changed:
 packages/core/src/agent-prompts.ts                            | 11 ++++++++---
 .../engine/src/__tests__/executor-review-verdicts.test.ts     |  5 ++++-
 packages/engine/src/executor.ts                               | 11 ++++++++---
 3 files changed, 20 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6856
Fusion-Task-Lineage: 78d698df-9e85-4371-bf59-af27e64e3069
2026-06-21 04:09:15 -07:00
gsxdsm
48c86d7ca7 FN-6844: move engine controls to footer status bar
Move engine stop, pause, and scheduler tuning controls into the executor footer status bar.

- Add a footer EngineControlMenu popover with stop/start, pause/resume, and debounced concurrency/worktree sliders.
- Remove the engine controls from the dashboard header and wire the footer running-state text to open the controls.
- Update dashboard tests, English labels, and operator documentation for the footer control location.

Files changed:
 docs/dashboard-guide.md                            |   4 +
 packages/dashboard/app/App.tsx                     |   7 -
 .../app/__tests__/tablet-header-controls.test.tsx  |  21 +-
 .../dashboard/app/components/EngineControlMenu.css | 118 +++++++++
 .../dashboard/app/components/EngineControlMenu.tsx | 292 +++++++++++++++++++++
 .../dashboard/app/components/ExecutorStatusBar.css |  28 ++
 .../dashboard/app/components/ExecutorStatusBar.tsx |  25 +-
 packages/dashboard/app/components/Header.css       |  89 -------
 packages/dashboard/app/components/Header.tsx       |  81 +-----
 .../app/components/__tests__/App.test.tsx          | 132 ----------
 .../__tests__/EngineControlMenu.test.tsx           | 145 ++++++++++
 .../__tests__/ExecutorStatusBar.test.tsx           |  40 +++
 .../app/components/__tests__/Header.test.tsx       |  57 +---
 .../components/__tests__/MultiProjectFlow.test.tsx |   8 -
 .../app/components/__tests__/ResearchView.test.tsx |   4 -
 packages/i18n/locales/en/app.json                  |   5 +-
 16 files changed, 666 insertions(+), 390 deletions(-)

Fusion-Task-Id: FN-6844

Fusion-Task-Lineage: f0e17e3d-489e-483c-ba7d-a020c111231c
2026-06-21 04:01:39 -07:00
gsxdsm
3b61ac3d23 fix: make loading spinners actually spin across the dashboard
Many loading states rendered bare "Loading…" text with no spinner
element, and a couple rendered an unstyled `loading-spinner` div with no
matching CSS (invisible). The global spin animation was never broken —
it rotates in Chromium and WebKit — so prior transform-box edits chased
a non-bug, validated only by a string-matching CSS test.

Add a shared <LoadingSpinner> (self-contained animated SVG, no
lucide-react import so it survives partial test mocks) and adopt it
across ~47 loading placeholders so every loading state shows a
consistent animated spinner. Includes a component test that asserts the
svg carries the animate-spin utility.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 03:53:43 -07:00
gsxdsm
68c4053a85 fix(droid): stop model-discovery process storm; read catalog from droid exec --help
discoverDroidModels ran `droid models`/`droid model list`, which aren't real
droid commands — they parse as a prompt and launch a persistent
`droid exec --stream-jsonrpc` agent session that never exits, leaking a process
per call. The dashboard reloads the droid extension on every chat-send, so these
piled into dozens of orphaned `droid` processes.

Switch discovery to parse `droid exec --help` (lists Available + Custom models,
exits cleanly) via new parseDroidModelsFromHelp, and add a SIGKILL-on-timeout
guard so a wedged spawn can never leak. Verified against the real binary: 46
models, 0 leaked processes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 03:40:56 -07:00
gsxdsm
4672203acd FN-6814: add Shadcn Gray theme variant
Adds a neutral Shadcn Gray dashboard color theme across selection, bootstrap, documentation, and release notes.

- Add Shadcn Gray to core theme validation and dashboard theme picker options.
- Define dark and light zinc-gray theme tokens plus matching swatch previews.
- Cover the new theme with regression tests and document the expanded theme count.

Files changed:
 .changeset/shadcn-gray-variant.md                  |   5 +
 docs/dashboard-guide.md                            |   2 +-
 packages/core/src/types.ts                         |   4 +-
 .../app/__tests__/shadcn-gray-theme.test.ts        |  65 ++++++++++
 .../dashboard/app/components/ThemeSelector.css     |  15 +++
 packages/dashboard/app/components/themeOptions.ts  |   2 +
 packages/dashboard/app/index.html                  |   2 +-
 packages/dashboard/app/public/theme-data.css       | 143 ++++++++++++++++++++-
 8 files changed, 228 insertions(+), 10 deletions(-)

Fusion-Task-Id: FN-6814

Fusion-Task-Lineage: 0548ad7a-5a3c-4e39-8dab-3eb5d40d84c1
2026-06-21 03:40:56 -07:00
gsxdsm
f030f73032 FN-6847: move sidebar collapse toggle into footer
Move the left sidebar collapse control into the footer so it sits above Settings with row-style behavior.

- Replace the floating border collapse button with a footer row button that keeps accessible expanded/collapsed labels.
- Retokenize collapse toggle CSS around shared sidebar item styling and remove the obsolete floating modifier.
- Extend sidebar tests and dashboard guide coverage for the footer placement and collapsed rail behavior.

Files changed:
 docs/dashboard-guide.md                            |  4 +-
 .../dashboard/app/components/LeftSidebarNav.css    | 24 ++--------
 .../dashboard/app/components/LeftSidebarNav.tsx    | 32 ++++++-------
 .../components/__tests__/LeftSidebarNav.test.tsx   | 54 ++++++++++++++++++++--
 4 files changed, 72 insertions(+), 42 deletions(-)

Fusion-Task-Id: FN-6847

Fusion-Task-Lineage: 5d7781a1-afc9-4e5c-bf7b-0648bb874285
2026-06-21 03:40:56 -07:00
gsxdsm
1ff87147b7 FN-6831: narrow list sidebar and wrap task titles
Refine the desktop list split pane so narrower sidebars still show readable task titles.

- Lower the list-view sidebar minimum width from 280px to 200px across resize and keyboard handling.
- Clamp desktop list task titles to two wrapped lines with overflow protection.
- Update ListView coverage for the smaller persisted/keyboard minimum and title-clamp CSS.

Files changed:
 packages/dashboard/app/components/ListView.css     | 10 +++++++++-
 packages/dashboard/app/components/ListView.tsx     |  2 +-
 .../app/components/__tests__/ListView.test.tsx     | 22 +++++++++++++++++-----
 3 files changed, 27 insertions(+), 7 deletions(-)

Fusion-Task-Id: FN-6831

Fusion-Task-Lineage: ac3e455d-8cb0-4f42-ac5c-d735e56d2b89
2026-06-21 03:40:56 -07:00
gsxdsm
9d55f29c7a FN-6822: add dashboard i18n accessible-name fallbacks
Ensure dashboard accessibility labels render English defaults when i18n catalogs are unavailable.

- Add inline default text for the dashboard loader status label.
- Reuse the stash copy-reference fallback label for button accessibility and initial focus targeting.

Files changed:
 packages/dashboard/app/components/DashboardLoader.tsx    | 10 +++++++++-
 packages/dashboard/app/components/StashConflictModal.tsx | 12 +++++++++---
 2 files changed, 18 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-6822

Fusion-Task-Lineage: 5057b051-43bd-467c-87b7-9ce86522c0c3
2026-06-21 03:40:56 -07:00
gsxdsm
19d60480db FN-6826: elevate the theme dropdown when open
Ensure the Command Center theme selector renders above neighboring views while preserving mobile in-flow behavior.

- Add an open state class to the theme dropdown root for local stacking control.
- Raise the open dropdown and popover above Command Center sibling cards without exceeding app chrome layers.
- Cover desktop elevation and mobile static popover behavior in ThemeDropdown tests.

Files changed:
 .../dashboard/app/components/ThemeDropdown.css     | 15 +++++++-
 .../dashboard/app/components/ThemeDropdown.tsx     |  2 +-
 .../components/__tests__/ThemeDropdown.test.tsx    | 40 ++++++++++++++++++++++
 3 files changed, 55 insertions(+), 2 deletions(-)

Fusion-Task-Id: FN-6826

Fusion-Task-Lineage: ff43c06e-f3a7-4b4c-8e29-46deb66e9145
2026-06-21 03:40:56 -07:00
gsxdsm
70653dd66b Merge pull request #1704 from Runfusion/gsxdsm/engine-not-running
fix: report engine available when another fusion process owns it
2026-06-21 03:38:11 -07:00
gsxdsm
cb64e874de docs: enrich engine singleton-lock learning after PR #1704 review
- Fix frontmatter enums (root_cause: logic_error, component: tooling); add #1699
  to related_prs and last_updated
- Reflect post-review behavior: external marker cleared at lock-acquire time;
  reconcile/startAll/onProjectAccessed swallow EngineAlreadyRunningError
- Add rejected approach (don't merge has()/hasRunningEngine) and the
  keep-them-distinct invariant
- Tighten socket-name detail (sha1[:16]); cross-link the browser-testing doc

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 03:35:16 -07:00
gsxdsm
fa9a3cc52f Address PR review feedback (#1704): clear stale external marker on acquire
Move externalEngines.delete(projectId) to immediately after acquiring the
singleton lock instead of after engine.start() succeeds. If a project was
marked external, the holder exits, acquire succeeds, but start() then throws,
the success-path delete never ran and hasRunningEngine() reported a phantom
engine forever. Added a regression test for the failed-takeover path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 03:32:53 -07:00
gsxdsm
0a49023f0b Address PR review feedback (#1704)
- Stop reconciliation/startAll/onProjectAccessed from warning every tick for
  externally-owned engines: swallow EngineAlreadyRunningError in the outer
  catches (it's expected and already logged once in createAndStart)
- Add FNXC:DashboardHealth requirement-trace comments on the externalEngines
  field and the dashboard hasRunningEngine health check
- Add regression test: reconciliation stays quiet across ticks for an
  externally-owned engine (inner refusal logged once, outer failure suppressed)
- Add regression test: hasDashboardEngine legacy fallback to getAllEngines when
  hasRunningEngine is unavailable on the manager

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 03:29:47 -07:00
gsxdsm
7d312b416d docs: capture engine singleton-lock learning (EngineAlreadyRunningError != no engine)
Document the false "engine not running" banner root cause and fix as a
docs/solutions learning, and add an "Engine Singleton Lock" entry to
CONCEPTS.md: a failed per-machine lock acquisition is proof an engine is
running elsewhere, not "no engine."

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 03:15:22 -07:00
gsxdsm
7c8eba38b4 Address PR review feedback (#1703)
- FNXC requirement-trace comments on the stepwise workflow-step seam,
  the flowToIr v2-signal/byte-identity contract, and TaskForm's
  optional-steps create-mode behavior
2026-06-21 03:13:23 -07:00
gsxdsm
9479f0b313 docs(solutions): capture eslint exhaustive-deps CI-lint gotcha 2026-06-21 03:10:21 -07:00
gsxdsm
7635ba8682 fix: report engine available when another fusion process owns it
The dashboard's engine-availability health check only counted engines
this process started. A second launch (e.g. `pnpm dev dashboard`
alongside an already-running `fusion`) is correctly refused the
per-machine engine singleton lock, so its engine map stays empty and
the dashboard showed a false "engine not running" banner even though an
engine was live on the machine.

ProjectEngineManager now records projects whose singleton lock is held
by another process (via EngineAlreadyRunningError) and exposes
hasRunningEngine(), which the health endpoint consults so the banner
reflects machine-level truth. Reconciliation still retries so this
process takes over if the other exits, and the "refusing to start" log
fires once per project instead of on every 30s reconciliation tick.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-21 03:09:35 -07:00
gsxdsm
45dc1795ef Address PR review feedback (#1703)
- Dropdown: aria-multiselectable, drop dead aria-labelledby, ArrowUp opens panel
- Dirty-state: NewTaskModal tracks enabledWorkflowSteps so toggles trigger discard prompt
- TaskForm: reset optionalStepsLoading on the no-workflow early return
- Node editor: pass plugin step templates into the optional-steps panel (both layouts)
- FNXC requirement comments on the new optional-steps components
2026-06-21 03:00:40 -07:00
gsxdsm
e16d48910c fix(ci): drop unknown react-hooks/exhaustive-deps disable directive in TaskForm 2026-06-21 02:45:34 -07:00
gsxdsm
481e38d422 fix(review): apply autofix feedback 2026-06-21 02:39:15 -07:00