Commit Graph

3010 Commits

Author SHA1 Message Date
gsxdsm
7ded57e550 FN-9167: clear interrupted manual merge status
Prevent interrupted manual merges from leaving tasks stranded in a transient merging state.

- track locally owned merge stamps and clear them through fenced abort cleanup
- handle SIGINT, SIGTERM, and SIGHUP for foreground task merges with documented exit behavior
- reconcile only age-proven orphan stamps before manual CLI and UI-only dashboard merges
- cover merge stamp authorization, signal cleanup, and mock completeness with regression tests
- add a patch changeset and operator documentation

Files changed:
 .../fn-9167-interrupted-manual-merge-stamp.md      |   7 +
 docs/cli-reference.md                              |   1 +
 docs/task-management.md                            |   2 +-
 .../task-command-github-import-tracking.test.ts    |   3 +
 packages/cli/src/commands/__tests__/task.test.ts   | 179 +++++-
 packages/cli/src/commands/dashboard.ts             |   3 +
 packages/cli/src/commands/task.ts                  | 138 +++--
 .../merge-orphan-durable-write-inventory.json      | 608 +++++++++++----------
 .../src/__tests__/merge-active-status.test.ts      |  49 ++
 packages/engine/src/index.ts                       |   2 +
 .../engine/src/merge/clear-orphaned-merge-stamp.ts |  80 +++
 packages/engine/src/merge/merger-ai.ts             |  12 +
 packages/engine/src/project-engine.ts              |  20 +-
 13 files changed, 735 insertions(+), 369 deletions(-)

Fusion-Task-Id: FN-9167

Fusion-Task-Lineage: 554380e2-ce55-4e7a-89fd-f5c24341937b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 20:17:42 -07:00
gsxdsm
416c6a0215 FN-9170: Preserve structured merge failure sentinels
Keep merge-unavailable intact across workflow merge dispatch so graph routing receives the engine's structured result.

- preserve merge-unavailable alongside implementation-incomplete during primitive classification
- cover direct and legacy merge paths, audit context, normalization, and non-terminal retry behavior
- document the structured sentinel invariant and add a patch changeset

Files changed:
 .changeset/fn-9170-merge-unavailable.md            |   7 ++
 docs/architecture.md                               |   2 +
 .../merge-unavailable-classification.test.ts       | 113 +++++++++++++++++++++
 .../src/__tests__/workflow-merge-nodes.test.ts     |  47 ++++++++-
 .../engine/src/workflows/workflow-merge-nodes.ts   |  13 ++-
 5 files changed, 176 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-9170

Fusion-Task-Lineage: 99cc501f-8a25-49f5-b81a-74dd2e6e872b

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 20:08:05 -07:00
gsxdsm
2a31505823 FN-9163: Add repositories to existing workspace tasks
Enable validated workspace membership additions and make active tasks discover new repositories safely.

- add idempotent direct-child Git repository validation and workspace configuration updates
- expose repository discovery and addition through Settings and dashboard API routes
- refresh workspace membership during acquisition while blocking additions after review or landing begins
- document the workflow and cover core, dashboard, and engine behavior with focused tests

Files changed:
 .changeset/fn-9163-workspace-add-repo.md           |   7 ++
 docs/dashboard-guide.md                            |   2 +
 docs/settings-reference.md                         |   2 +-
 docs/workspaces.md                                 |  12 +-
 .../core/src/__tests__/workspace-add-repo.test.ts  |  12 ++
 packages/core/src/git/git-repository.ts            |  68 ++++++++++-
 packages/core/src/index.gate.ts                    |   3 +
 packages/core/src/index.ts                         |   3 +
 packages/dashboard/app/api/agents/agents.ts        |  11 +-
 .../settings/sections/GeneralSection.tsx           |   3 +
 .../settings/sections/WorkspaceReposCard.css       |   6 +
 .../settings/sections/WorkspaceReposCard.tsx       |  46 ++++++++
 .../__tests__/workspace-repos-card.test.tsx        |  49 ++++++++
 .../src/__tests__/workspace-add-repo-route.test.ts |  65 ++++++++++
 .../dashboard/src/routes/register-git-github.ts    |  35 +++++-
 .../__tests__/workspace-add-repo-midflight.test.ts | 131 +++++++++++++++++++++
 packages/engine/src/agent-tools.ts                 |  27 ++++-
 packages/engine/src/executor/deps-bags.ts          |  44 ++++++-
 packages/engine/src/executor/run-implementation.ts |   2 +
 19 files changed, 512 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-9163

Fusion-Task-Lineage: 7456f55f-b7c8-4076-994f-42994d8babb0

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 19:59:04 -07:00
gsxdsm
3b0a6b795f FN-9162: Group workspace worktrees under configurable roots
Configure collision-safe workspace and repository subfolders beneath custom worktree roots.

- add shared workspace layout helpers and export them through runtime and gate barrels
- route acquisition, pinning, cleanup, archive, and extension discovery through grouped paths
- allow absolute worktree roots in settings and document the workspace layout
- protect shared-root containers from destructive sweeps and cover multi-repository behavior

Files changed:
 .changeset/fn-9162-workspace-worktree-root.md      |   7 ++
 docs/settings-reference.md                         |   2 +-
 docs/workspaces.md                                 |   6 ++
 .../extension-workspace-worktree-root.test.ts      |  81 +++++++++++++++++
 packages/cli/src/extension.ts                      |  53 ++++++++++-
 packages/core/src/__tests__/pi-extensions.test.ts  |  46 +++++++++-
 .../core/src/__tests__/worktree-layout.test.ts     |  49 ++++++++++
 packages/core/src/index.gate.ts                    |  13 +++
 packages/core/src/index.ts                         |   9 ++
 packages/core/src/plugins/pi-extensions.ts         |  12 ++-
 packages/core/src/task-store/archive-lifecycle.ts  |  11 +--
 packages/core/src/tasks/worktree-layout.ts         |  77 ++++++++++++++++
 .../dashboard/app/components/SettingsModal.tsx     |   4 +-
 .../settings/sections/WorktreesSection.tsx         |   2 +-
 .../worktree-acquisition-workspace.test.ts         |  55 ++++++++++-
 .../engine/src/__tests__/worktree-paths.test.ts    |  19 +++-
 .../engine/src/__tests__/worktree-pinning.test.ts  |  17 ++++
 .../engine/src/__tests__/worktree-pool.test.ts     |  19 +++-
 .../src/executor/workspace-main-checkout-guard.ts  |   2 +-
 packages/engine/src/self-healing.ts                |  20 +++-
 .../engine/src/worktree/worktree-acquisition.ts    | 101 +++++++++++++++------
 packages/engine/src/worktree/worktree-names.ts     |  14 +--
 packages/engine/src/worktree/worktree-paths.ts     |  75 ++++++++++++---
 packages/engine/src/worktree/worktree-pinning.ts   |  10 +-
 packages/engine/src/worktree/worktree-pool.ts      |  44 ++++++---
 25 files changed, 656 insertions(+), 92 deletions(-)

Fusion-Task-Id: FN-9162

Fusion-Task-Lineage: b5f5e247-577c-4357-9ffe-97e2447b4fd4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 19:46:35 -07:00
gsxdsm
5ba0b0cffc FN-9168: Record terminal merge-boundary parks in run audit
Add failure-isolated audit visibility for merge-boundary proof failures without changing terminal park behavior.

- Emit a redacted event from retry-boundary and graph-terminal park paths.
- Bound audit sink latency and isolate absent, throwing, rejecting, or hung sinks.
- Add reason-code coverage, catalogue documentation, and a patch changeset.

Files changed:
 .changeset/fn-9168-merge-boundary-audit.md         |  7 ++
 AGENTS.md                                          |  1 +
 docs/run-audit.md                                  |  1 +
 .../src/__tests__/executor-graph-boundary.test.ts  | 33 ++++++---
 .../__tests__/merge-boundary-unproven-park.test.ts | 78 +++++++++++++++++++-
 .../executor/emit-merge-boundary-unproven-audit.ts | 82 ++++++++++++++++++++++
 .../engine/src/executor/handle-graph-failure.ts    | 23 +++++-
 .../executor/route-graph-merge-failure-to-retry.ts | 36 +++++++++-
 .../engine/src/executor/workflow-merge-boundary.ts | 38 ++++++++--
 .../engine/src/run-audit/run-audit-catalogue.ts    |  5 +-
 packages/engine/src/util/run-audit.ts              | 10 +++
 11 files changed, 293 insertions(+), 21 deletions(-)

Fusion-Task-Id: FN-9168

Fusion-Task-Lineage: cdeb5c1f-4b22-4531-878e-b18955e6ea5a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 19:34:53 -07:00
gsxdsm
d280fa6f54 FN-9166: preserve implementation-incomplete merge failures
Keep structured incomplete-implementation failures intact so graph recovery can resume or fail closed without retrying a no-op merge.

- Preserve normalized implementation-incomplete reasons during direct merge-attempt classification.
- Cover primitive, legacy seam, resumable, fail-closed, and cancellation paths.
- Document the merge-boundary invariant and add a patch changeset.

Files changed:
 .../fn-9166-preserve-implementation-incomplete.md  |  7 ++
 docs/architecture.md                               |  2 +-
 .../merge-node-paused-abort-retryable.test.ts      | 76 ++++++++++++++++++++++
 .../__tests__/workflow-merge-cancellation.test.ts  | 15 ++++-
 .../src/__tests__/workflow-merge-nodes.test.ts     | 46 +++++++++++++
 .../engine/src/workflows/workflow-merge-nodes.ts   | 13 +++-
 6 files changed, 155 insertions(+), 4 deletions(-)

Fusion-Task-Id: FN-9166

Fusion-Task-Lineage: 1b7946bf-62e3-42f0-8c8c-09230fef22bb

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 19:12:28 -07:00
gsxdsm
ef35fb8e5a FN-9164: select per-repository workspace base branches
Workspace worktrees now honor and persist the appropriate base branch for each sub-repository throughout their lifecycle.

- Resolve requested bases per repository, normalize remote-only refs, and fall back safely to repository integration branches.
- Reuse recorded bases for landing, recovery, and revert flows with privacy-safe audit breadcrumbs.
- Surface base and fallback details in task UI, documentation, tests, and release notes.

Files changed:
 .changeset/fn-9164-workspace-base-branch.md        |   7 +
 AGENTS.md                                          |   1 +
 docs/task-management.md                            |   2 +-
 docs/workspaces.md                                 |   8 +-
 packages/core/src/types/task/task-core.ts          |  12 ++
 .../dashboard/app/components/TaskDetailModal.css   |  14 ++
 .../app/components/WorkspaceWorktreesSummary.tsx   |   2 +
 .../__tests__/WorkspaceWorktreesSummary.test.tsx   |  13 ++
 .../src/routes/register-task-workflow-routes.ts    |   2 +
 .../task-revert.workspace.real-git.test.ts         |  25 +++
 .../src/__tests__/workspace-base-branch.test.ts    |  93 +++++++++++
 .../worktree-acquisition-workspace.test.ts         |  27 ++++
 packages/engine/src/execution/task-revert.ts       |  58 +++++--
 packages/engine/src/merge/merger-ai.ts             |  30 +++-
 packages/engine/src/self-healing.ts                |  50 +++++-
 packages/engine/src/util/run-audit.ts              |   6 +
 .../engine/src/worktree/workspace-base-branch.ts   | 180 +++++++++++++++++++++
 .../engine/src/worktree/worktree-acquisition.ts    |  62 ++++---
 18 files changed, 548 insertions(+), 44 deletions(-)

Fusion-Task-Id: FN-9164

Fusion-Task-Lineage: 487a1c77-32cb-47dd-bf43-297a146951ba

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 18:57:33 -07:00
gsxdsm
179f08c2d4 FN-9158: recover Windows antivirus-blocked PostgreSQL payloads
Recover quarantined or truncated embedded PostgreSQL runtime files and explain Windows Defender remediation.

- Validate materialized payload inventory with v3 markers and repair mismatches atomically.
- Surface actionable error 4551 diagnostics through startup failures.
- Add regression coverage, operator documentation, and a patch changeset.

Files changed:
 ...-9158-windows-av-blocked-embedded-pg-payload.md |   7 +
 ...ndows-antivirus-blocks-embedded-postgres-dll.md |  27 +++
 docs/storage.md                                    |   4 +
 .../__tests__/postgres/embedded-lifecycle.test.ts  | 139 +++++++++++++-
 .../src/__tests__/postgres/startup-factory.test.ts |  19 ++
 packages/core/src/postgres/embedded-lifecycle.ts   | 208 ++++++++++++++++++++-
 packages/core/src/postgres/startup-factory.ts      |  30 +--
 7 files changed, 414 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-9158

Fusion-Task-Lineage: ec2c97d7-0797-49c1-b875-6b147ff26917

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 18:50:27 -07:00
gsxdsm
944ca642ee FN-9154: add fail-closed PostgreSQL hygiene reporting
Add an offline PostgreSQL cluster-hygiene report that records trustworthy campaign admission evidence.

- Parse provenance envelopes and fail closed on missing, malformed, cross-cluster, or stale-marker evidence.
- Classify campaign databases and owner liveness without authorizing destructive cleanup.
- Document the capture workflow and cover measured, malformed, liveness, marker, and unrelated-name cases.

Files changed:
 docs/testing.md                                    |  27 +++
 .../pg-cluster-hygiene-report/count-mismatch.txt   |   9 +
 .../fixtures/pg-cluster-hygiene-report/empty.txt   |   0
 .../pg-cluster-hygiene-report/liveness-absent.txt  |   7 +
 .../pg-cluster-hygiene-report/liveness-alive.txt   |   8 +
 .../pg-cluster-hygiene-report/liveness-dead.txt    |   8 +
 .../pg-cluster-hygiene-report/malformed.txt        |  11 ++
 .../pg-cluster-hygiene-report/markers-stale.txt    |   8 +
 .../fixtures/pg-cluster-hygiene-report/mixed.txt   |  17 ++
 .../pg-cluster-hygiene-report/no-banner.txt        |   1 +
 .../pg-cluster-hygiene-report/post-state.txt       |   7 +
 .../pg-cluster-hygiene-report/pre-state.txt        |   8 +
 .../pg-cluster-hygiene-report/truncated.txt        |   7 +
 .../__tests__/pg-cluster-hygiene-report.test.mjs   | 171 +++++++++++++++++
 scripts/pg-cluster-hygiene-report.mjs              | 212 +++++++++++++++++++++
 15 files changed, 501 insertions(+)

Fusion-Task-Id: FN-9154

Fusion-Task-Lineage: fca5a025-9460-4850-8ac9-891d563b3d04

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 18:44:29 -07:00
gsxdsm
7b55a02e51 FN-9157: fix workflow merge boundary proof and retry routing
Make workflow merge admission accept valid foreach completion and terminate retries when proof is unavailable.

- Treat fully terminal live foreach steps as implementation proof for Review Level 0 workflows.
- Preserve merge-boundary-unproven as a terminal graph failure and park blocked retries visibly.
- Add unit, graph-boundary, and PostgreSQL regression coverage plus operator documentation and a patch changeset.

Files changed:
 .changeset/fn-9157-merge-boundary.md               |  7 +++
 docs/architecture.md                               |  4 ++
 docs/workflow-steps.md                             |  6 ++
 .../src/__tests__/workflow-merge-proof.test.ts     | 11 +++-
 packages/core/src/workflow-merge-proof.ts          | 20 +++++--
 .../src/__tests__/executor-graph-boundary.test.ts  | 64 +++++++++++++++++++++-
 ...xecutor-merge-boundary-foreach-proof.pg.test.ts | 10 ++++
 .../__tests__/merge-boundary-unproven-park.test.ts | 48 ++++++++++++++++
 .../create-authoritative-workflow-primitives.ts    | 13 ++++-
 .../create-authoritative-workflow-seams.ts         |  6 +-
 .../executor/evaluate-workflow-merge-boundary.ts   | 18 +++++-
 .../executor/route-graph-merge-failure-to-retry.ts | 26 ++++++++-
 packages/engine/src/executor/task-predicates.ts    |  2 +
 .../engine/src/executor/workflow-merge-boundary.ts | 29 +++++++---
 .../engine/src/workflows/workflow-merge-nodes.ts   | 13 +++++
 15 files changed, 253 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-9157

Fusion-Task-Lineage: 7c68dfe2-28fb-4353-9ae6-df0ddbaf799a

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 18:16:49 -07:00
gsxdsm
7dfce1cc16 FN-9160: Prevent draft storage quota exhaustion
Make browser draft restoration best-effort so oversized or quota-blocked writes never interrupt task creation.

- cap free-text draft persistence at 64,000 bytes and warn once when restoration is unavailable
- make scoped storage operations throw-safe with bounded retries and stale volatile-state reclamation
- extend quota, composer, modal persistence, and chat draft coverage and document the storage policy
- add a patch changeset for the operator-facing fix

Files changed:
 .changeset/fn-9160-quick-entry-quota.md            |   7 ++
 docs/storage.md                                    |  31 +++---
 .../dashboard/app/components/InlineCreateCard.tsx  |  25 ++++-
 .../dashboard/app/components/QuickEntryBox.tsx     |  25 ++++-
 .../components/__tests__/ChatView.draft.test.tsx   |  36 +++++-
 .../components/__tests__/InlineCreateCard.test.tsx |  20 ++++
 .../components/__tests__/QuickEntryBox.test.tsx    |  36 +++++-
 .../app/hooks/__tests__/modalPersistence.test.ts   |  28 +++--
 packages/dashboard/app/hooks/modalPersistence.ts   |  29 ++---
 .../app/utils/__tests__/projectStorage.test.ts     |  88 ++++++++++++++-
 packages/dashboard/app/utils/projectStorage.ts     | 122 +++++++++++++++++++--
 11 files changed, 384 insertions(+), 63 deletions(-)

Fusion-Task-Id: FN-9160

Fusion-Task-Lineage: 63481936-91f1-4e7a-b27c-c3c5f49014dd

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 18:08:55 -07:00
gsxdsm
fb77eef7a9 FN-9150: Capture abandoned PostgreSQL timeout boundaries
Capture elapsed and join evidence for PostgreSQL test boundaries that Vitest abandons before settlement.

- emit unique boundary join keys, progress ladders, terminal records, and payload-free watchdog breaches
- classify ladder-only, breach, and unobservable lifecycle evidence in the loaded-failure census
- cover abandoned and superseded body windows and document the corrective campaign findings

Files changed:
 ...res-loaded-lane-unrelated-failure-population.md |  33 ++++++-
 docs/testing.md                                    |  14 ++-
 .../__test-utils__/pg-timeout-boundary-observer.ts | 108 ++++++++++++++++++---
 .../__tests__/pg-timeout-boundary-observer.test.ts |  98 ++++++++++++++++++-
 .../__tests__/pg-loaded-failure-census.test.mjs    |  30 ++++++
 scripts/pg-loaded-failure-census.mjs               |  71 ++++++++++++--
 6 files changed, 327 insertions(+), 27 deletions(-)

Fusion-Task-Id: FN-9150

Fusion-Task-Lineage: fc2e9f99-7739-4d86-99f4-713a78f53e57

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 10:10:39 -07:00
gsxdsm
a1977e052b FN-9149: Add PostgreSQL timeout-boundary diagnostics
Instrument the opt-in PostgreSQL test harness to attribute loaded-lane timeout failures without changing default behavior.

- Add bounded setup, body, and teardown watchdog probes with host, cluster, and template evidence.
- Wire observer records into the harness and loaded-failure census with explicit suppression and attribution handling.
- Cover observer inertness, boundary behavior, and census joins while documenting the 27-worker campaign findings.

Files changed:
 ...res-loaded-lane-unrelated-failure-population.md |  31 +-
 docs/testing.md                                    |  27 ++
 .../core/src/__test-utils__/pg-test-harness.ts     | 113 +++++-
 .../__test-utils__/pg-timeout-boundary-observer.ts | 451 +++++++++++++++++++++
 .../pg-test-harness-observer-inertness.test.ts     |  31 ++
 .../__tests__/pg-timeout-boundary-observer.test.ts | 177 ++++++++
 .../__tests__/pg-loaded-failure-census.test.mjs    |  31 ++
 scripts/pg-loaded-failure-census.mjs               | 101 ++++-
 8 files changed, 934 insertions(+), 28 deletions(-)

Fusion-Task-Id: FN-9149

Fusion-Task-Lineage: 4df4ee28-5369-41ae-bb0c-e7e9ae78d873

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 08:41:14 -07:00
gsxdsm
161edaa694 FN-9148: add PostgreSQL loaded-failure census
Add retained-log census tooling and evidence for PostgreSQL loaded-lane timeout investigations.

- Parse complete Vitest logs and optional diagnostics without opening PostgreSQL or running tests.
- Classify failing files, lifecycle positions, failure shapes, backend headroom, waits, and watchdog data.
- Cover high-failure, healthy, malformed-diagnostics, and truncated-log cases with fixtures.
- Document the reproduced population, unsupported remedies, and successor measurement requirements.

Files changed:
 ...res-loaded-lane-unrelated-failure-population.md |  80 ++++++++++
 docs/testing.md                                    |   8 +
 .../fixtures/pg-loaded-failure-census/high-run.txt |  77 +++++++++
 .../fixtures/pg-loaded-failure-census/high.jsonl   |   4 +
 .../fixtures/pg-loaded-failure-census/low-run.txt  |   4 +
 .../pg-loaded-failure-census/truncated-run.txt     |   2 +
 .../__tests__/pg-loaded-failure-census.test.mjs    |  65 ++++++++
 scripts/pg-loaded-failure-census.mjs               | 172 +++++++++++++++++++++
 8 files changed, 412 insertions(+)

Fusion-Task-Id: FN-9148

Fusion-Task-Lineage: c632a9d0-b823-4416-ab46-0d834e850007

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 06:24:01 -07:00
gsxdsm
687990c0a6 FN-9146: document PostgreSQL flake campaign evidence
Document the bounded investigation results for active core PostgreSQL suite-only flakes.

- Record per-lane outcomes and sampled cluster-capacity evidence for entries 1, 2, and 7.
- Clarify reproduced, unreproduced, and unattributed statuses without changing quarantine policy.
- Ratchet campaign completeness, ownership, and documentation-link coverage in the register tests.

Files changed:
 .../suite-only-flakes-observed-register.md         | 71 +++++++++++++++++-
 docs/testing.md                                    |  4 +
 scripts/__tests__/observed-flake-register.test.mjs | 85 ++++++++++++++++++++--
 3 files changed, 148 insertions(+), 12 deletions(-)

Fusion-Task-Id: FN-9146

Fusion-Task-Lineage: d5de3fac-48d6-4ee7-ae09-173007d234e5

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 05:38:54 -07:00
gsxdsm
91daa37162 FN-9147: synchronize script test baselines
Align script-test expectations and documentation with the current validator and dashboard test inventory.

- Add the pre-JSON anchor validator to the verify-fast baseline.
- Ratchet documented pretest validators against canonical order and membership.
- Remove deleted dashboard tests from timing data.

Files changed:
 docs/testing.md                        | 22 +++++++++-
 scripts/__tests__/verify-fast.test.mjs | 76 +++++++++++++++++++++++++++++++++-
 scripts/test-timings.json              |  2 -
 3 files changed, 95 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-9147

Fusion-Task-Lineage: fdb33c60-e019-402b-b91b-ba0f0f971350

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 05:23:41 -07:00
gsxdsm
ed2cbd08a1 FN-9145: clarify active flake register states
Reorganize the suite-only flake register around its current decision state.

- Separate active observations, gate evictions, and archived closed records while preserving entry anchors.
- Mark entry 1 as an escalated second sighting and restore FN-9126/FN-9131, FN-9128, and FN-9127 ownership.
- Add regression checks for active counts, exact states and owners, and testing-guide anchors.

Files changed:
 .../suite-only-flakes-observed-register.md         | 189 +++++++++++++--------
 scripts/__tests__/observed-flake-register.test.mjs |  65 +++++++
 2 files changed, 181 insertions(+), 73 deletions(-)

Fusion-Task-Id: FN-9145

Fusion-Task-Lineage: 39b3292a-db48-4be4-878c-7d2b026abae3

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-19 04:16:48 -07:00
ischindl
72877c8cf9 fix(RUFU-074): idle backoff + jitter for the task-deleted outbox consumer (#3471)
**Problem:** Each dashboard/engine project consumer polled
`task_deleted` outbox on a fixed 5s setInterval, so ~44 per-project
consumers thundered together on the same cadence — an idle DB query
storm and CPU hot-spot even when projects were paused/idle.

**Fix:** The outbox consumer reschedules itself from each poll outcome:
an idle poll (zero events) grows the next delay by
`TASK_DELETED_OUTBOX_BACKOFF_STEP_MS` toward `MAX_POLL_MS`, with ±20%
jitter so the consumers de-synchronize; a poll that delivered events
resets to the fast base. A paused/idle project drains its outbox and
backoff alone drops the DB load.

**Includes:** regression test (bounded jitter + idle growth),
performance changeset, solution doc, deploy handoff script.

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

- **Performance**
- Reduced unnecessary idle polling by gradually increasing the polling
interval, up to 60 seconds, with bounded timing variation.
- Restored the faster 5-second polling cadence when new events, waits,
or transient errors occur.
- Preserved event ordering, delivery guarantees, acknowledgements, and
independent behavior across concurrent consumers.

- **Documentation**
- Added guidance on polling behavior, deployment verification, and
monitoring targets.

- **Tests**
- Added coverage for backoff growth, jitter limits, event bursts,
concurrent consumers, error handling, retries, and clean shutdown.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-18 22:11:47 -07:00
ischindl
f195ff5b3d feat(RUFU-081): add Prometheus-format /metrics system observability endpoint (#3475)
**Problem:** Fusion had no Prometheus-scrapeable metrics surface, so
production CPU/health/DB/fleet observability had to be inferred from
logs and ad-hoc monitoring.

**Fix:** Expose a Prometheus-text `/metrics` HTTP endpoint on the
dashboard with runtime + domain samplers: request latency quantiles
(p50/p95/max), last-request-age freeze indicator, CPU user/system,
RSS/heap, child-process spawn rates by kind, git children count, PG tps,
active/idle/total projects, running agents, and board task counts.
Scraped at 5s by the existing Prometheus/Grafana stack
(fusion-observability).

**Includes:** full test coverage for the Prometheus text parser and each
sampler.

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

* **New Features**
* Added a public, unauthenticated `/metrics` endpoint with
Prometheus-formatted dashboard, runtime, process, database, and domain
metrics.
* Added request latency, resource usage, child-process, project
activity, agent, and task metrics.
* Metrics remain available in headless mode and provide stable snapshots
without triggering additional data writes or on-demand I/O.

* **Documentation**
* Documented metric families, sampling behavior, and degraded-operation
handling.

* **Tests**
* Added comprehensive coverage for collection, formatting, parsing,
endpoint behavior, and sampler lifecycle.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-08-18 22:11:22 -07:00
gsxdsm
f12b9f8463 fix: wait for the dev server rather than tunnelling a guessed port
When the dev child had not reported a bound port within 60s, the wrapper fell
back to the configured port and published a tunnel to it. In the case the
port fix exists for — a container whose own Fusion owns 4040 — that hands out
a dev-looking URL serving a completely different instance, with only a
passing "which may not be it" warning to show for it.

Observed with a dev server stopped on the interactive `Run central db now?
(Y/n)` prompt: it never listens, so it never reports, so the tunnel published
the container's Fusion instead.

A missing tunnel is a visible problem that explains itself; a tunnel to the
wrong app is a silent one. The wrapper now waits, unbounded, printing a
notice once a minute that names the interactive-prompt case. An explicit
--tunnel=PORT still publishes immediately, since it names a target the dev
child knows nothing about.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 20:38:48 -07:00
gsxdsm
9f10767254 feat: share terminal sessions across browsers
Terminal PTYs already lived in a server-side registry whose WebSocket attach
supports several viewers, but the tab list is per-browser localStorage and a
browser with no stored tabs skipped the session listing entirely (FN-7686's
cold-open optimization) and spawned its own PTY. Two people on one Fusion —
or one person in a second browser — therefore never saw each other's
terminals and quietly accumulated parallel sessions.

- A zero-tab client adopts the server's sessions, oldest first, so every
  client converges on the same set. A client with stored tabs still only
  validates them; adopting there would resurrect tabs the user closed here.
- FN-7686's guarantee weakens from "never waits" to "waits at most
  ADOPT_LIST_TIMEOUT_MS (1.5s), then behaves exactly as before": auto-create
  fires on a 0ms timer, so a background list can never win that race. Its
  regression test and comment now state the bounded contract.
- Closing a tab asks which close was meant — detach here (PTY keeps running
  for other viewers) or end the session for everyone. alwaysAsk is set: this
  gates an informed choice and both wrong answers are destructive. Desktop
  and mobile close controls both route through it.
- A footer Reopen control lists sessions the server still runs that this
  browser is not showing and reattaches to them, so detaching is not a
  one-way door.

Also fixes a multi-viewer data bug: the attach called
getScrollbackAndClearPending(), discarding queued output and deleting a slice
of every already-attached viewer's live stream. It now flushes pending output
to existing viewers first, then reads scrollback for the newcomer, so each
viewer receives it exactly once.

Drive-by: closeTab's dependency array was empty while its body reads
projectId, freezing it at the first render's project.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 19:13:53 -07:00
gsxdsm
ee57f8a3b9 fix: print the dashboard token with the dev tunnel URL
`pnpm dev --tunnel` published a bare URL under a "public, unauthenticated"
header. That label was wrong for the flag's own default target: --tunnel with
no port aims at the dashboard, which is bearer-token gated, so the recipient
of a shared link got a 401 with no token to supply.

resolveDevTunnelAuth() now classifies the target and the banner says what is
actually true of it:

  token         dashboard with auth on — prints the token and a ?token= link,
                resolved from FUSION_DASHBOARD_TOKEN, FUSION_DAEMON_TOKEN,
                then ~/.fusion/settings.json
  token-pending first run, token not minted yet — defers to the dashboard's
                own startup banner
  no-auth       --no-auth is on; the dashboard really is open
  foreign       a non-dashboard port; Fusion has no auth to lend it, the only
                genuinely ungated case

Auth resolves at banner time rather than flag-parse time so a token the dev
child mints on a first authenticated run is already readable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 18:21:50 -07:00
gsxdsm
7423555c46 feat(dev): pnpm dev --tunnel publishes the dev server over a quick tunnel
Operator case: someone works inside a remote Fusion (a container, a shared box),
starts a dev server there, and needs to view it from their own browser. The dev
server binds inside that machine, so without a tunnel the only options are port
publishing or a VPN — both needing cooperation from whoever owns the host.

  pnpm dev --tunnel            # tunnels the dashboard port (PORT, default 4040)
  pnpm dev --tunnel=5173       # tunnels a Vite dev server instead
  pnpm dev --tunnel dashboard  # tunnel the default port AND run the dashboard
  FUSION_DEV_TUNNEL=1 pnpm dev

Cloudflare QUICK tunnels are usable here precisely because a dev server is HTTP:
no account, no domain, no card. The TCP endpoints that SSH would have needed
require a card (ngrok) or a domain plus Zero Trust (Cloudflare) — that asymmetry
is why this exists for HTTP only, and it is recorded in the module header so the
next person does not retry the SSH variant.

Design decisions:
- Tunnel failure is NON-FATAL. A missing cloudflared or a tunnel that never
  publishes a URL logs and is skipped; losing a preview URL must never cost the
  operator their dev loop.
- Watch-mode restarts reuse the existing tunnel. A fresh quick tunnel hands out a
  different hostname each time, which would invalidate an already-shared link.
- `--tunnel` consumes a following token only when it is numeric, so
  `--tunnel dashboard` forwards `dashboard` to the dev command rather than
  tunnelling port NaN. That is the bug this flag shape invites, so it is tested.

Verified end to end in a container: a dev server bound to 127.0.0.1 inside it was
fetched from the public internet through the tunnel (200, correct body). Also
confirmed that tunnelling the DASHBOARD port does not weaken auth — unauthenticated
requests through the tunnel return 401 for /api/tasks, /api/settings and
/api/artifacts, with only /api/health open by design.

Adding two fields to parseDevWrapperArgs' return broke two existing strict toEqual
assertions; those were updated rather than loosened to toMatchObject. 27 tests pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-18 17:18:56 -07:00
gsxdsm
b18c9d7594 FN-9144: Preserve test velocity measurement verdicts
Make test-velocity investigation notes durable across report regeneration and concurrent history updates.

- add idempotent note targeting for historical measurement entries
- serialize history mutations with bounded stale-lock recovery
- render all annotated cycles and record the W33 gate variance verdict
- document the generated-report workflow and cover retention/concurrency behavior

Files changed:
 .../merge-gate-w33-walltime-regression.md          |  15 ++
 docs/test-velocity-baseline.md                     |  12 ++
 docs/testing.md                                    |   2 +
 scripts/__tests__/test-velocity-baseline.test.mjs  | 153 +++++++++++++-
 scripts/test-velocity-baseline.mjs                 | 221 +++++++++++++++------
 scripts/test-velocity-history.json                 |   6 +
 6 files changed, 349 insertions(+), 60 deletions(-)

Fusion-Task-Id: FN-9144

Fusion-Task-Lineage: e3869e40-2cbc-4e5b-844e-9091da96b652

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-18 08:08:24 -07:00
ischindl
0540686599 fix(RUFU-073): thread a per-tick task workflow-selection cache through scheduler reads (#3470)
**Problem:** Scheduler was re-reading each task's
`task_workflow_selection` once per park-resolution (sweep, hold-release,
moved, unpause/wake), causing a nonstop PostgreSQL query storm (~232
idx_scan/s) on idle polling — a major engine CPU hot-spot.

**Fix:** Memoize the workflow selection per scheduler tick/event —
thread a shared, per-event selection cache through
`resolveWorkflowIrForTask` and all park-resolution handlers, then throw
it away. Each task resolves its parked columns with at most one read of
`task_workflow_selection` per tick. A selection write is always observed
on the next event's fresh cache (never a global/infinite LRU).

**Includes:** regression test asserting the once-per-tick read
invariant, performance changeset + per-tick-cache solution doc,
deploy+verify handoff script, and the parallel quarantine-ledger merge
(origin FN-9125 + RUFU-072 OOM entries both retained).

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

* **Performance Improvements**
* Reduced repeated workflow-selection reads during scheduler ticks and
related event processing.
* Improved scheduler and health API responsiveness through per-operation
caching and read deduplication.
* Preserved existing behavior, including retry handling for failed reads
and synchronous data-store support.

* **Documentation**
* Added architectural guidance covering workflow-selection performance,
caching behavior, and verification criteria.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-08-18 00:10:46 -07:00
gsxdsm
0a50e2142d FN-9143: inherit selected workflow in New Task dialog
Make every New Task entry point seed the dialog from the active Board or List workflow.

- Resolve implicit workflow selection through the modal manager while preserving explicit choices and All workflows behavior.
- Forward selected workflow IDs from List view and navigation-backed dialog entry points.
- Add cross-surface regression coverage, operator documentation, and a patch changeset.

Files changed:
 .changeset/fn-9143-new-task-selected-workflow.md   |  7 +++
 docs/dashboard-guide.md                            |  2 +-
 packages/dashboard/app/App.tsx                     |  4 +-
 packages/dashboard/app/components/AppModals.tsx    |  4 +-
 packages/dashboard/app/components/Column.tsx       |  4 +-
 .../dashboard/app/components/LeftSidebarNav.tsx    |  4 +-
 packages/dashboard/app/components/ListView.tsx     |  7 ++-
 .../components/__tests__/LeftSidebarNav.test.tsx   |  1 +
 .../app/components/__tests__/ListView.test.tsx     | 13 +++--
 .../new-task-dialog-selected-workflow.test.tsx     | 46 ++++++++++++++++++
 .../dashboard/app/components/dashboard/types.ts    |  2 +-
 .../app/hooks/__tests__/useModalManager.test.ts    | 55 ++++++++++++++++++++++
 packages/dashboard/app/hooks/useModalManager.ts    | 19 ++++++--
 13 files changed, 148 insertions(+), 20 deletions(-)

Fusion-Task-Id: FN-9143

Fusion-Task-Lineage: 43951c5d-24d2-4243-826a-c6f416607882

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-17 20:54:43 -07:00
gsxdsm
83a33be353 feat(dashboard): persistent sign-in dialog for paste-back provider logins
Operator report: during a container login there was nowhere obvious to paste the
redirect URL and no sign of what the app was waiting on. The flow was split
across a pre-flight confirm that warned about paste-back and vanished, a card
that shrank to a disabled "Waiting for login…" chip, and the paste field
rendered inline in that card below the fold of a scrolling modal.

ProviderLoginDialog now opens with the flow and stays until it ends: a two-step
progress list, a button to re-open a lost sign-in tab, the paste field, and the
terminal outcome inline instead of a toast that disappears while the operator is
in another browser tab.

Three defects found and fixed while verifying it in a real container:

- It sank behind the onboarding modal and clicks landed on the modal instead.
  createPortal relocates the DOM node but NOT the React tree, so pointer events
  bubbled to the host FloatingWindow, which raises itself to a fresh
  nextFloatingZ() on every pointerdown — each click in the dialog lifted the
  window above it. Fixed by rendering the dialog as a sibling of the window,
  claiming z once on open (it was calling nextFloatingZ() inline on every render
  of a modal that re-renders on a 2s poll), and stopping propagation on the
  overlay. Ratcheted for every portaled .modal-overlay.
- Spacing did not match any other dialog: it hand-rolled header/action padding
  instead of using .modal-header/.modal-actions, and padded each child
  separately. Every row now shares var(--modal-padding) — verified at a uniform
  17px inset across header, steps, paste prompt, field, Submit, and actions.
- The paste field was invisible (.form-input fills with var(--surface), and so
  does .modal — measured #0c0c0e on #0c0c0e), Submit was a 25px row-density
  btn-sm, and both could scroll out of reach. The field now sinks to var(--bg)
  with var(--border-strong), Submit takes standard control padding, and the
  paste region is pinned outside the scroll area.

Dialog anatomy rules (spacing primitives, portal/stacking) documented in
docs/dashboard-guide.md.

Verified: 441 dashboard tests including 4 new dialog tests, eslint, dashboard
typecheck, and the rendered dialog measured in a container build.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 20:47:28 -07:00
gsxdsm
bb11e493f7 fix(auth): restore Codex login and promote outboard resize targets
Operator report from a containerized dashboard: OpenAI Codex login never opened
a browser window at all, and floating windows still needed the FN-8015 follow-up.

- pi's `AuthPrompt` is a discriminated union — text, secret, select, manual_code —
  and FusionAuthStorage.login's interaction shim flattened every variant into
  `onPrompt({message, placeholder})`, discarding `type` and a select's `options`.
  pi's Codex `login()` OPENS with `prompt({type:"select"})` (Browser vs Device
  code) before emitting any auth URL, so the dashboard answered the method picker
  with the promise that waits for a pasted code — input the UI never solicits,
  because nothing had been surfaced yet. The flow hung until the route's 30s
  kickoff timeout: "Login initiation timed out", no window. The route's
  onSelect/selectOauthOption has had the right answer since FN-5917, but the
  callback was dead code from the moment login moved to pi's ModelRuntime.
  Verified against a real container: the login endpoint now returns Codex's
  auth.openai.com URL in 0.03s instead of timing out after 30s.
- Promote FN-8766's outboard east/NE/SE resize targets from Task Detail to every
  desktop window. With FN-8015's body gutter deleted, a hosted scrollbar sits
  flush against the painted edge where those hit zones used to cover it (issue
  #2140); moving the targets outside the shell keeps it grabbable without
  insetting anything. That needs the host to stop clipping, so the body and its
  direct child inherit the corner radius — only 8 of ~30 callers set that
  themselves — and phones re-assert clipping since they hide every handle.
- Document the fixed OAuth callback ports (Anthropic 53692, Codex 1455) and
  PI_OAUTH_CALLBACK_HOST for Docker: without them the browser callback cannot
  reach the container's loopback listener, which is why subscription logins
  appeared to fail there.

Verified: 14989 dashboard tests, 58 engine auth-storage tests (4 new, covering
each prompt type), pnpm test:gate, eslint, and both typechecks all pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 17:38:26 -07:00
gsxdsm
2fa6ca28d8 fix(docker): make a default docker build + documented run actually work
Three defects found while bringing up a container from a clean checkout:

- The dashboard's vite build (~5.7k modules) exceeded V8's default old-space on a
  stock Docker Desktop VM and aborted the image build with "Ineffective
  mark-compacts near heap limit" (exit 134). Raise the ceiling for that RUN only.
- The documented `-v fusion-home:/home/node/.fusion` mount seeded a root-owned
  named volume over a path absent from the image, so embedded Postgres initdb hit
  "Permission denied", the supervisor burned its 4 restarts, and the container went
  unhealthy on first run. Pre-create the directory node-owned so a fresh named
  volume inherits it; document that bind mounts still need a host-side chown.
- Drop the dependency-graph plugin's tsconfig path mapping for the taskStuck module
  deleted in 2eae0b2507 / 29d94e0fa3.

Verified: full `docker build` from a clean export of this tree succeeds unpatched,
and a run against brand-new named volumes with no manual chown reaches health=healthy
with /api/health 200.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-17 16:24:15 -07:00
ischindl
c84924b99a fix(RUFU-076): stop self-healing git storm on paused projects and bound repair sweeps (#3473)
**Problem:** Self-healing repeatedly spawned git children
(status/rev-parse/for-each-ref) for paused/idle projects on every sweep,
and certain repair sweeps ran unbounded — a spawn/git storm that spiked
CPU and I/O on the production host.

**Fix:** Bound self-healing git work for paused projects (skip/cooldown)
and cap the repair sweeps so the engine stops churning git processes
when there is nothing actionable. Includes in-process-runtime pause-gate
+ self-healing pause-storm regression tests.

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

## Summary by CodeRabbit

- **Bug Fixes**
- Paused projects no longer trigger Git-intensive self-healing
maintenance.
- Pause and unpause transitions now correctly stop and resume
maintenance scheduling.
  - Global and engine-level pauses are handled consistently.
- **Improvements**
- Active-project Git maintenance is limited to an hourly cadence,
reducing unnecessary activity.
- Merge-metadata recovery is capped at 25 items per cycle for more
predictable processing.
  - Database and filesystem housekeeping continues during pauses.
- **Documentation**
- Updated architecture and runtime documentation to describe pause-aware
maintenance behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-17 15:05:10 -07:00
gsxdsm
2b99b365de FN-9141: rescue plugin-runner tests and enforce quarantine lockstep
Rescue the plugin-runner suite before deletion while making quarantine records mechanically consistent.

- preserve logger assertions across worker-reused mock cleanup with a stable hoisted logger
- remove the rescued suite from the quarantine ledger and Vitest exclusion
- enforce ledger-to-exclude lockstep and cover missing or dangling quarantine entries
- document the reproduction evidence, rescue disposition, and strict checker behavior

Files changed:
 .../suite-only-flakes-observed-register.md         |  14 +-
 docs/testing.md                                    |  17 +-
 .../engine/src/__tests__/plugin-runner.test.ts     |  37 ++--
 packages/engine/vitest.config.ts                   |  14 +-
 scripts/__tests__/check-quarantine-ledger.test.mjs | 217 +++++++++---------
 scripts/__tests__/ci-test-shard-timings.test.mjs   |   5 +-
 scripts/check-quarantine-ledger.mjs                | 245 +++++++++++++--------
 scripts/lib/test-quarantine.json                   |  10 +-
 8 files changed, 314 insertions(+), 245 deletions(-)

Fusion-Task-Id: FN-9141

Fusion-Task-Lineage: 5b0549bf-3cc6-495e-bf99-a30a2dffb029

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-17 05:25:17 -07:00
gsxdsm
6d7b4a3ac3 FN-9140: make Vitest timeout ownership surveys deterministic
Replace ambiguous setup-boundary observations with calibrated, repeatable timeout ownership evidence.

- record fixture lifecycle events in an append-only JSONL ledger with process-safe ordering
- classify four timeout-budget arms across repeated isolate-mode cells and fail closed on incomplete evidence
- expand connectionless unit coverage and document the terminal insufficient-data survey result

Files changed:
 .../test-failures/postgres-ddl-admission-bound.md  |   2 +
 .../vitest-setup-boundary-timeout-ownership.md     |  37 +++
 docs/testing.md                                    |   2 +-
 scripts/__tests__/pg-setup-boundary-probe.test.mjs | 195 ++++++++----
 scripts/pg-setup-boundary-probe.mjs                | 341 ++++++++++++---------
 5 files changed, 371 insertions(+), 206 deletions(-)

Fusion-Task-Id: FN-9140

Fusion-Task-Lineage: 9c6970b8-af80-400a-b2b2-49718d4fe87f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 22:47:53 -07:00
gsxdsm
2c3a47368f FN-9136: Characterize PostgreSQL fork database reuse
Characterize safe per-fork PostgreSQL database reuse while documenting why the production experiment remains reverted.

- add a bounded pool primitive with reset, verification, discard, and ownership fencing
- cover recycling, poison handling, capacity, and reclaim namespace behavior
- align PostgreSQL campaign documentation with the dead-fork leak rejection

Files changed:
 .../test-failures/postgres-ddl-admission-bound.md  |   4 +-
 .../suite-only-flakes-observed-register.md         |   4 +-
 docs/testing.md                                    |   4 +-
 .../core/src/__test-utils__/pg-fork-db-pool.ts     | 184 +++++++++++++++++++++
 .../__tests__/pg-fork-db-pool-ownership.test.ts    |  36 ++++
 .../core/src/__tests__/pg-fork-db-pool.test.ts     |  60 +++++++
 6 files changed, 287 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-9136

Fusion-Task-Lineage: 9e14e0eb-d957-4207-977e-2d913e78750f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 22:06:38 -07:00
gsxdsm
1a3e68de5d FN-9139: add bounded PostgreSQL pre-admission measurement
Establish an inert PostgreSQL setup signal and repeatable evidence tooling without changing harness behavior.

- add explicit setup participation semantics and inertness coverage
- survey Vitest setup boundaries with isolated report-only fixtures
- bound interleaved campaigns by process group and campaign deadline
- reject missing backend samples and enable candidate diagnostics
- document the rejected boundary result and successor protocol

Files changed:
 .../test-failures/postgres-ddl-admission-bound.md  |  15 ++
 docs/testing.md                                    |  10 ++
 packages/core/package.json                         |   2 +-
 .../src/__test-utils__/pg-setup-participation.ts   |  22 +++
 .../src/__tests__/pg-setup-participation.test.ts   |  21 +++
 .../__tests__/vitest-setup-pg-inertness.test.ts    |  10 ++
 packages/core/vitest.pg.config.ts                  |  10 ++
 .../__tests__/pg-preadmission-campaign.test.mjs    |  63 +++++++
 scripts/__tests__/pg-setup-boundary-probe.test.mjs |  92 ++++++++++
 scripts/pg-preadmission-campaign.mjs               | 194 +++++++++++++++++++++
 scripts/pg-setup-boundary-probe.mjs                | 182 +++++++++++++++++++
 11 files changed, 620 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-9139

Fusion-Task-Lineage: 2cf8ccbf-37f9-4fdc-8e8f-326df823e1cd

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 21:09:58 -07:00
gsxdsm
8bb56a2185 FN-9134: add drift-resistant PostgreSQL DDL lane metric
Add a report-only acceptance metric and terminal evidence for PostgreSQL DDL structural experiments.

- require seven ordered control/candidate pairs with green Vitest summaries and zero leaked databases
- reject missing tests, failed summaries, nonzero exits, and unhandled runner errors
- document the no-improvement campaign result and retain the next candidate direction
- cover timing statistics, ordering, leak rejection, and runner-log validation

Files changed:
 .../test-failures/postgres-ddl-admission-bound.md  |   8 ++
 .../suite-only-flakes-observed-register.md         |   2 +-
 docs/testing.md                                    |  24 ++++
 scripts/__tests__/pg-ddl-lane-metric.test.mjs      |  62 +++++++++
 scripts/pg-ddl-lane-metric.mjs                     | 139 +++++++++++++++++++++
 5 files changed, 234 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-9134

Fusion-Task-Lineage: 3466ebf8-7125-475b-9574-6c4c92198bb3

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 20:17:12 -07:00
gsxdsm
ae507afc37 FN-9131: Add PostgreSQL harness budget characterization
Characterize cluster-shared PostgreSQL connection admission while keeping regressive harness wiring disabled.

- add advisory-lock slot budgeting, bootstrap gating, and local allocation accounting
- cover budget arithmetic, queueing, degradation, and PostgreSQL lock behavior
- document loaded-lane failures and the terminal-negative lifecycle boundary
- clarify that the active harness neither admits nor clamps against the experimental budget

Files changed:
 .../test-failures/pg-harness-connection-budget.md  |  21 +
 .../suite-only-flakes-observed-register.md         |   2 +
 docs/testing.md                                    |   6 +
 .../__tests__/pg-connection-budget.test.ts         | 146 ++++++
 .../src/__test-utils__/pg-connection-budget.ts     | 492 +++++++++++++++++++++
 .../core/src/__test-utils__/pg-test-harness.ts     |   8 +
 .../postgres/pg-connection-budget.pg.test.ts       |  36 ++
 7 files changed, 711 insertions(+)

Fusion-Task-Id: FN-9131

Fusion-Task-Lineage: c83611ad-95f9-44ef-a0fd-1f182a26725d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 19:29:05 -07:00
Phil Larson
0159ef8784 fix: preserve gridlock notification cooldown (#3469)
## Summary
- preserve the gridlock notification wall-clock cooldown across
transient detector clears
- add a regression test for clear-then-rediscover behavior during the
cooldown
- document the cooldown contract and add a patch changeset

## Test plan
- `corepack pnpm --filter @fusion/engine exec vitest run
src/__tests__/notifier.test.ts --project=engine-default
--reporter=verbose -t 'suppresses the same gridlock after a transient
resolution during cooldown'`
- `corepack pnpm --filter @fusion/engine typecheck`
- `corepack pnpm build`
- `corepack pnpm changeset status --output
/tmp/fusion-gridlock-changeset-status.json`


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

- **Bug Fixes**
- Gridlock notifications now remain suppressed during the 15-minute
cooldown, even if the condition temporarily clears and reappears.
- Prevents repeated notifications caused by transient detector-state
changes.

- **Documentation**
- Updated gridlock notification behavior documentation to reflect the
persistent cooldown.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-08-16 17:46:23 -07:00
gsxdsm
c709ed06d9 FN-9135: retain plugin runner quarantine through deadline
Preserve the quarantined plugin-runner coverage while recording the inconclusive reproduction campaign.

- Record two loaded-suite runs at each of 2, 6, and 8 workers.
- Keep all 82 plugin-runner tests, the ledger entry, and the default-lane exclusion through 2026-08-30.
- Clarify that opt-in strict checks do not block normal PR lanes.

Files changed:
 .../test-failures/suite-only-flakes-observed-register.md    | 13 ++++++++++++-
 docs/testing.md                                             |  3 +++
 2 files changed, 15 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-9135

Fusion-Task-Lineage: 239425e5-7393-4b8a-a114-0a14f0065847

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 17:38:53 -07:00
gsxdsm
f2d68939be FN-9138: guard same-millisecond approval audit ID collisions
Validate that lifecycle guards prevent duplicate deterministic approval audit IDs during concurrent writes.

- Add database-free coverage for losing and successful guarded approval transitions.
- Add PostgreSQL overlap probes for decisions, completions, and physical ID uniqueness.
- Document the deterministic audit identity and lifecycle ordering guarantees.

Files changed:
 docs/storage.md                                    |   2 +-
 .../approval-request-audit-id-race.test.ts         | 115 ++++++++++++++++++
 .../postgres/approval-request-lifecycle.pg.test.ts | 132 ++++++++++++++++++++-
 .../async-stores/async-approval-request-store.ts   |  10 ++
 4 files changed, 253 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-9138

Fusion-Task-Lineage: ccfc084f-2cd8-4549-8a42-242167139b8d

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 17:07:40 -07:00
gsxdsm
1d7dd3e7b8 FN-9133: Use bounded PostgreSQL DDL for reliability fixtures
Reliability fixtures now manage PostgreSQL databases through owned, deadline-bounded maintenance connections.

- Replace psql child-process DDL with postgres.js maintenance clients and forced cleanup.
- Remove redundant pre-create drops and preserve idempotent teardown behavior.
- Add a live-connection cleanup contract test and document audit measurements and policy.

Files changed:
 .../postgres-reliability-helper-ddl-audit.md       | 48 +++++++++++
 docs/testing.md                                    |  2 +-
 packages/engine/package.json                       |  5 +-
 .../_helpers-pg-ddl-contract.pg.test.ts            | 66 +++++++++++++++
 .../__tests__/reliability-interactions/_helpers.ts | 93 +++++++++++++---------
 pnpm-lock.yaml                                     |  3 +
 6 files changed, 176 insertions(+), 41 deletions(-)

Fusion-Task-Id: FN-9133

Fusion-Task-Lineage: 5a7f511d-abb4-4468-a97a-04331f60d245

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 16:11:21 -07:00
gsxdsm
2160f7500c FN-9132: order approval audits by lifecycle on timestamp ties
Ensure approval audit histories preserve lifecycle chronology when events share a timestamp.

- rank tied audit events by the declared approval lifecycle before audit ID
- cover tied and distinct timestamps through module and public store surfaces
- document the diagnosed satellite assertion and add a patch changeset

Files changed:
 .changeset/fn-9132-approval-audit-order.md         |  7 +++
 .../suite-only-flakes-observed-register.md         | 27 +++++++++++
 ...oval-request-audit-project-isolation.pg.test.ts |  2 +-
 .../postgres/approval-request-lifecycle.pg.test.ts | 53 +++++++++++++++++++++-
 .../async-stores/async-approval-request-store.ts   | 17 +++++--
 5 files changed, 100 insertions(+), 6 deletions(-)

Fusion-Task-Id: FN-9132

Fusion-Task-Lineage: 2f49e896-69bf-48c8-b813-4b1b2b72fc65

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 16:04:18 -07:00
gsxdsm
a453245715 FN-9130: Add guarded PostgreSQL DDL admission infrastructure
Document and test PostgreSQL DDL admission experiments while preserving the direct harness after measured regressions.

- add advisory-slot admission with local slot accounting, degradation telemetry, and fail-closed reentrancy
- cover cross-fork bounds, session loss, timeouts, spawned nested work, and cleanup invariants
- make concurrent lifecycle coverage settle all creates and clean up every successful database in finally
- record loaded-core measurements and retain the existing PostgreSQL worker cap

Files changed:
 .../test-failures/postgres-ddl-admission-bound.md  |  34 ++
 .../suite-only-flakes-observed-register.md         |   2 +-
 docs/testing.md                                    |   8 +
 .../core/src/__test-utils__/pg-ddl-admission.ts    | 351 +++++++++++++++++++++
 .../core/src/__test-utils__/pg-test-harness.ts     |  44 ++-
 .../core/src/__tests__/pg-ddl-admission.test.ts    | 294 +++++++++++++++++
 .../postgres/pg-harness-ddl-concurrency.pg.test.ts |  56 ++++
 packages/core/vitest.pg.config.ts                  |   5 +
 8 files changed, 778 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-9130

Fusion-Task-Lineage: e28777cd-cd7c-4598-9db6-c4622cb9fa33

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 15:57:36 -07:00
gsxdsm
b31be1ba7c FN-9126: Record project-identity flake reproduction
Document the second sighting of the project-identity PostgreSQL timeout and hand off structural diagnosis.

- Record the sterile 27-worker reproduction against the integration SHA
- Preserve pass, failure, and skip counters for both PostgreSQL-directory runs
- Mark quarantine as policy-forbidden and assign root-cause follow-up to FN-9131

Files changed:
 .../solutions/test-failures/suite-only-flakes-observed-register.md | 7 +++++++
 1 file changed, 7 insertions(+)

Fusion-Task-Id: FN-9126

Fusion-Task-Lineage: 9e31b00f-268b-46fa-af7a-58973c93d8fc

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 14:07:57 -07:00
gsxdsm
3c235ce275 FN-9129: fence revision attribution assertions by identity
Make settings revision attribution tests select only immutable revisions owned by each test.

- Resolve reset-ordering failures by querying revision IDs from unique targets and payloads.
- Prove late background system writes cannot contaminate actor assertions.
- Document the loaded-lane diagnosis, evidence, and remediation.

Files changed:
 .../suite-only-flakes-observed-register.md         |  26 ++++++
 .../settings-revision-attribution.test.ts          | 104 ++++++++++++++++-----
 2 files changed, 107 insertions(+), 23 deletions(-)

Fusion-Task-Id: FN-9129

Fusion-Task-Lineage: ae336ed2-0870-400c-9599-37adb588e283

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 13:47:12 -07:00
gsxdsm
1c9e4dfccd FN-9127: instrument PostgreSQL teardown diagnostics
Add opt-in evidence capture for loaded PostgreSQL teardown stalls without changing teardown behavior.

- Add bounded phase and hook watchdogs with capped pg_stat_activity snapshots.
- Instrument the shared PostgreSQL test harness and cover diagnostic behavior with focused tests.
- Document the diagnostic workflow, measured flake campaign, and corrected mission-store gate scope.

Files changed:
 .../suite-only-flakes-observed-register.md         |  12 ++
 docs/testing.md                                    |  19 ++
 .../src/__test-utils__/pg-teardown-diagnostics.ts  | 237 +++++++++++++++++++++
 .../core/src/__test-utils__/pg-test-harness.ts     | 120 ++++++++---
 .../src/__tests__/pg-teardown-diagnostics.test.ts  | 162 ++++++++++++++
 .../__tests__/postgres/mission-store.pg.test.ts    |   8 +-
 6 files changed, 526 insertions(+), 32 deletions(-)

Fusion-Task-Id: FN-9127
Fusion-Task-Lineage: 2488b7c0-f12f-4560-9a99-41aaca9d1526
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 12:59:23 -07:00
gsxdsm
5e5422de6e FN-9128: isolate schema-applier PostgreSQL fixtures
Use shared PostgreSQL harness fixtures to reduce repeated schema DDL while preserving migration coverage.

- replace private database lifecycle helpers with shared empty and baselined fixtures
- add regression coverage for fixture-state selection and idempotent schema application
- document PostgreSQL bootstrap guidance and the resolved flake investigation

Files changed:
 .../suite-only-flakes-observed-register.md         |  13 +-
 docs/testing.md                                    |   3 +
 .../postgres/schema-applier-isolation.test.ts      |  54 +++++++
 .../src/__tests__/postgres/schema-applier.test.ts  | 160 +++++++--------------
 4 files changed, 119 insertions(+), 111 deletions(-)

Fusion-Task-Id: FN-9128

Fusion-Task-Lineage: 036c9011-8973-4211-a77a-42bf0eb9fa5e

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 12:27:35 -07:00
gsxdsm
beb8ae67db FN-9125: document flake findings and quarantine plugin runner
Classify the suite-only failures by actual PostgreSQL dependency and preserve unresolved evidence for follow-up.

- Record non-reproduction results and assign PostgreSQL investigations to focused follow-up tasks.
- Quarantine the independent in-memory plugin runner test under the deletion ratchet.
- Document evidence requirements for future PostgreSQL flake diagnosis.

Files changed:
 .../suite-only-flakes-observed-register.md         | 32 ++++++++++++++++++++--
 docs/testing.md                                    |  4 +++
 packages/engine/vitest.config.ts                   | 10 +++++++
 scripts/lib/test-quarantine.json                   |  8 +++++-
 4 files changed, 51 insertions(+), 3 deletions(-)

Fusion-Task-Id: FN-9125

Fusion-Task-Lineage: 1dc80163-a0dc-4241-bab1-75a2cafb9abe

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 11:46:39 -07:00
gsxdsm
385059f5ca FN-9124: Move mission planning CTA to top of list
Place the primary mission-planning action consistently above mission content across desktop and mobile layouts.

- move the Plan New Mission and Create actions above the mission list
- increase the mission CTA height with shared design tokens and remove duplicate empty-state controls
- document and test placement, sizing, create-mode, empty-state, and responsive behavior

Files changed:
 .changeset/fn-9124-mission-cta-top.md              |   7 ++
 docs/missions.md                                   |   2 +-
 .../dashboard/app/components/MissionManager.css    |  42 +++----
 .../dashboard/app/components/MissionManager.tsx    |  89 +++++++-------
 .../dashboard/app/components/PlanningModeModal.css |  14 +--
 .../dashboard/app/components/PlanningModeModal.tsx |  12 +-
 .../__tests__/MissionManager.mobile-css.test.ts    |  33 +++--
 .../MissionManager.plan-cta-placement.test.tsx     | 134 +++++++++++++++++++++
 8 files changed, 238 insertions(+), 95 deletions(-)

Fusion-Task-Id: FN-9124

Fusion-Task-Lineage: 09ad7695-80ed-46af-a1c1-f334952c37ec

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 08:05:11 -07:00
gsxdsm
53acaf96c3 FN-9123: Repair script test contract drift
Repair script-test contracts to match the current repository policies and live workflow coverage.

- Align static-gate and pretest mirrors with authoritative validator chains.
- Update the merger-rule floor and parameterized flake registration.
- Repoint workflow reliability evidence to the surviving dispatch test.

Files changed:
 .../test-failures/suite-only-flakes-observed-register.md       |  4 +++-
 scripts/__tests__/agents-md-invariants.test.mjs                | 10 ++++++++--
 scripts/__tests__/engine-vitest-gate-policy.test.mjs           |  6 ++++++
 scripts/__tests__/run-static-gate-checks.test.mjs              |  7 +++++++
 scripts/__tests__/verify-fast.test.mjs                         |  6 ++++++
 scripts/lib/workflow-reliability-release-check.json            |  4 ++--
 6 files changed, 32 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-9123

Fusion-Task-Lineage: 1a3dad24-69e3-423e-a159-56fd3f1085a3

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 04:05:45 -07:00
gsxdsm
fe910fcce7 FN-9122: align merge gate timing and policy baselines
Re-establish a trustworthy W33 merge-gate timing baseline without weakening blocking coverage.

- Document the controlled W33 re-measurement and future regression protocol.
- Align static-validator test ledgers with all 15 canonical gate checks.
- Correct gate composition, engine-core inventory, and bundle metrics in testing guidance.

Files changed:
 .../merge-gate-w33-walltime-regression.md          | 82 ++++++++++++++++++++++
 docs/testing.md                                    | 12 ++--
 .../__tests__/engine-vitest-gate-policy.test.mjs   | 12 ++++
 scripts/__tests__/run-static-gate-checks.test.mjs  |  2 +
 scripts/__tests__/verify-fast.test.mjs             |  8 +++
 5 files changed, 111 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-9122

Fusion-Task-Lineage: 47ace0d7-902d-4ea5-848d-3d2386867c42

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-16 03:49:28 -07:00