Commit Graph

37 Commits

Author SHA1 Message Date
gsxdsm
6bd8004ba1 FN-8915: document agent activity API contract
Publish an inspectable contract for durable agent-activity history and pagination.

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

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

Fusion-Task-Id: FN-8915

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

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 15:58:54 -07:00
gsxdsm
6bd178bdcf FN-8864: add durable agent activity stream
Add a persisted, project-scoped agent activity feed with query and live delivery surfaces.

- Store sequenced, attributed activity events with privacy-safe metadata and retention.

- Emit activity across agents, workflow execution, reviews, approvals, merges, and recovery.

- Provide paginated API history and resilient SSE tailing with coverage and documentation.

- Renumber the activity migration to 0049 after reconciling main’s 0048 GitHub check-state migration.

Files changed:

 .changeset/fn-8864-agent-activity-events.md        |   7 +
 docs/architecture.md                               |   8 +
 docs/diagnostics.md                                |   4 +
 docs/storage.md                                    |   1 +
 .../__tests__/agent-activity-attribution.test.ts   |  21 +
 .../agent-activity-metadata-hygiene.test.ts        |  60 +++
 .../src/__tests__/agent-activity-writers.test.ts   |  94 +++++
 .../postgres/agent-activity-events.pg.test.ts      |  57 +++
 .../src/__tests__/postgres/schema-applier.test.ts  |  34 +-
 packages/core/src/agents/agent-store.ts            |  24 ++
 packages/core/src/agents/approval-request-store.ts |  15 +-
 packages/core/src/index.ts                         |   4 +
 .../0049_fn_8864_agent_activity_events.sql         |  24 ++
 packages/core/src/postgres/schema-applier.ts       |  15 +-
 packages/core/src/postgres/schema/project.ts       |  19 +-
 packages/core/src/store.ts                         |  17 +
 .../core/src/task-store/agent-activity-outbox.ts   |  75 ++++
 .../src/task-store/async/async-agent-activity.ts   |  71 ++++
 packages/core/src/types.ts                         |   2 +
 packages/core/src/types/agents/agents.ts           |  79 ++++
 packages/dashboard/app/api.ts                      |  54 +++
 .../src/__tests__/agent-activity-route.test.ts     |  68 ++++
 .../src/__tests__/sse-agent-activity.test.ts       | 315 +++++++++++++++
 packages/dashboard/src/routes/README.md            |   2 +-
 .../src/routes/register-setup-activity-routes.ts   |  19 +-
 packages/dashboard/src/sse.ts                      | 139 ++++++-
 .../src/__tests__/agent-activity-writers.test.ts   | 442 +++++++++++++++++++++
 packages/engine/src/executor.ts                    | 110 ++++-
 packages/engine/src/merger.ts                      |  15 +-
 packages/engine/src/self-healing.ts                |  35 +-
 30 files changed, 1809 insertions(+), 21 deletions(-)

Fusion-Task-Id: FN-8864
Fusion-Task-Lineage: 4938f35b-a0bc-4eb3-905c-178fed859cc6
Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 14:39:17 -07:00
gsxdsm
c60a11607f FN-8856: bound scheduler hold-release sweep work
Keep hold-release scheduling and dashboard health checks responsive under PostgreSQL load.

- Batch and cache workflow-selection reads for each hold-release pass.
- Bound sweep execution, prevent overlapping project passes, and expose sweep instrumentation.
- Time-bound PostgreSQL health probes and add regression coverage.

Files changed:
 .changeset/fn-8856-hold-release-sweep-bounded.md   |   7 +
 docs/architecture.md                               |   6 +
 docs/diagnostics.md                                |   4 +
 .../__tests__/workflow-ir-selection-cache.test.ts  |  77 ++++
 packages/core/src/index.ts                         |   2 +
 packages/core/src/store.ts                         |   6 +-
 .../core/src/task-store/workflow-definitions.ts    |  25 ++
 .../core/src/workflows/workflow-ir-resolver.ts     |  27 +-
 .../__tests__/dashboard-postgres-health.test.ts    |  76 ++++
 .../dashboard/src/dashboard-postgres-health.ts     |  34 +-
 .../__tests__/hold-release-instrumentation.test.ts |  34 ++
 .../hold-release-sweep-bounded-db-work.test.ts     | 467 +++++++++++++++++++++
 packages/engine/src/execution/hold-release.ts      | 391 +++++++++--------
 packages/engine/src/scheduler.ts                   |  56 ++-
 14 files changed, 1021 insertions(+), 191 deletions(-)

Fusion-Task-Id: FN-8856

Fusion-Task-Lineage: 5fa55d95-0760-4c4d-8c6c-6e1805109b3c

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 04:37:47 -07:00
gsxdsm
ccf2ffe93d FN-8854: document rebase settings and configuration audits
Document the worktree rebase controls and configuration audit surfaces.

- Describe worktree rebase defaults, remote resolution, and legacy pipeline reachability
- Explain configuration revisions and Activity Log query contracts
- Add source-aligned documentation contract coverage

Files changed:
 docs/diagnostics.md                                | 22 ++++-
 docs/settings-reference.md                         | 15 ++++
 .../configuration-audit-documentation.test.ts      | 94 ++++++++++++++++++++++
 3 files changed, 130 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-8854

Fusion-Task-Lineage: 5807280f-e1da-4847-8337-1c27c8ed695f

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-09 02:06:44 -07:00
gsxdsm
1e5d80dd4d FN-8853: record all settings changes in Activity Log
Record all meaningful settings changes in the Activity Log.

- Replace the four-key listener allowlist with safe generic setting diffs.
- Exclude engine churn, redact sensitive values, and cap displayed summaries.
- Add regression coverage, diagnostics guidance, and a patch changeset.

Files changed: .changeset/fn-8853-settings-activity-coverage.md   |   7 ++
 docs/diagnostics.md                                |   4 +
 .../src/__tests__/settings-activity-log.test.ts    | 138 +++++++++++++++++++++
 packages/core/src/task-store/lifecycle-ops.ts      |  40 +++---
 packages/core/src/task-store/settings-activity.ts  |  95 ++++++++++++++
 5 files changed, 260 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-8853

Fusion-Task-Lineage: ea072564-0bf1-4a97-8dd8-cde5844b1055

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-08-08 21:10:13 -07:00
gsxdsm
73fe461db5 fix: demote routine engine log noise to debug
Keep the default TUI for lifecycle transitions (Starting/Specifying/Worktree created/merge/move). Demote expected skips, schedule-trigger echoes, session setup bookkeeping, warm worktree reuse, and fn_run_verification command-fail detail. Pin via severity manifest and contract tests.
2026-08-02 23:18:07 -07:00
gsxdsm
60706ed5e4 fix: demote high-frequency TUI log lines to debug
Session setup, track bookkeeping, intentional skill exclusions, token-cache
metrics, zero-count recovery summaries, and expected-missing PROMPT seed reads
were flooding the default log pane. Gate them behind FUSION_DEBUG so only
state transitions and operator-actionable warnings remain visible.
2026-08-01 11:48:56 -07:00
gsxdsm
cca13737b6 FN-8603: reduce steady-state diagnostic log noise
Route routine core, engine, and dashboard diagnostics through debug-gated shared loggers.

- Demote steady-state diagnostic sites while preserving warnings and errors for actionable failures.
- Add cross-package severity contracts and manifest coverage for demoted log sites.
- Document logging severity guidance and add a patch changeset.

Files changed:
 .changeset/fn-8603-log-severity.md                 |  7 ++
 docs/diagnostics.md                                | 20 ++++--
 .../__tests__/log-severity-spam-contract.test.ts   | 71 ++++++++++++++++++
 packages/core/src/activity-analytics.ts            |  5 +-
 packages/core/src/ai-summarize.ts                  | 61 +++++++---------
 packages/core/src/async-mission-store.ts           |  5 +-
 packages/core/src/async-secrets-store.ts           |  7 +-
 packages/core/src/central-core.ts                  | 17 ++---
 packages/core/src/docker-provisioning.ts           | 13 ++--
 packages/core/src/index.ts                         |  1 +
 packages/core/src/master-key.ts                    |  9 ++-
 packages/core/src/memory-compaction.ts             | 29 ++++----
 packages/core/src/memory-insights.ts               |  7 +-
 packages/core/src/migration-orchestrator.ts        |  7 +-
 packages/core/src/mission-store.ts                 |  5 +-
 packages/core/src/node-discovery.ts                |  7 +-
 packages/core/src/notification/dispatcher.ts       |  9 ++-
 .../core/src/plugins/bundled-plugin-install.ts     | 11 +--
 packages/core/src/reflection-store.ts              |  5 +-
 packages/core/src/secrets-store.ts                 |  7 +-
 packages/core/src/task-store/agent-logs.ts         | 21 +++---
 packages/core/src/task-store/async-events.ts       |  5 +-
 packages/core/src/task-store/async-maintenance.ts  |  7 +-
 packages/core/src/task-store/comments-ops.ts       |  7 +-
 packages/core/src/task-store/task-mutation-ops.ts  | 11 +--
 packages/core/src/task-store/workflow-integrity.ts |  9 ++-
 packages/core/src/types/merge-policy.ts            |  5 +-
 packages/core/src/usage-events.ts                  |  5 +-
 .../__tests__/log-severity-spam-contract.test.ts   | 48 +++++++++++++
 packages/dashboard/src/ai-refine.ts                |  5 +-
 packages/dashboard/src/ai-session-diagnostics.ts   | 10 +--
 packages/dashboard/src/chat.ts                     |  8 ++-
 packages/dashboard/src/devserver-manager.ts        |  9 ++-
 packages/dashboard/src/file-service.ts             |  5 +-
 packages/dashboard/src/github-tracking-comments.ts |  7 +-
 .../dashboard/src/github-tracking-reconciler.ts    |  5 +-
 packages/dashboard/src/github-tracking-state.ts    |  5 +-
 packages/dashboard/src/gitlab-lifecycle.ts         |  5 +-
 packages/dashboard/src/insights-routes.ts          |  9 ++-
 packages/dashboard/src/issue-image-attachments.ts  |  5 +-
 packages/dashboard/src/knowledge-index.ts          |  5 +-
 packages/dashboard/src/plugin-routes.ts            |  7 +-
 packages/dashboard/src/routes/board-workflows.ts   |  5 +-
 packages/dashboard/src/routes/context.ts           |  5 +-
 .../dashboard/src/routes/register-auth-routes.ts   | 13 ++--
 .../routes/register-docker-provisioning-routes.ts  |  7 +-
 .../dashboard/src/routes/register-git-github.ts    | 21 +++---
 packages/dashboard/src/routes/register-gitlab.ts   |  7 +-
 .../src/routes/register-session-diff-routes.ts     |  9 ++-
 .../src/routes/register-settings-memory-routes.ts  |  7 +-
 .../src/routes/register-setup-activity-routes.ts   |  7 +-
 .../dashboard/src/routes/register-signal-routes.ts |  5 +-
 .../src/routes/register-task-workflow-routes.ts    | 11 +--
 packages/dashboard/src/runtime-logger.ts           | 11 +--
 packages/dashboard/src/server.ts                   |  7 +-
 packages/dashboard/src/sse.ts                      |  8 ++-
 packages/dashboard/src/terminal-service.ts         | 34 ++++-----
 packages/dashboard/src/view-chunk-manifest.ts      |  5 +-
 .../engine/src/__tests__/log-severity-manifest.ts  | 83 ++++++++++++++++++++++
 .../__tests__/log-severity-spam-contract.test.ts   | 40 ++++++++++-
 .../src/__tests__/logger-debug-gating.test.ts      |  7 +-
 packages/engine/src/goal-anchoring-audit.ts        |  5 +-
 packages/engine/src/plugin-runner.ts               | 44 ++++++------
 packages/engine/src/pty-native.ts                  |  9 ++-
 .../engine/src/runtimes/child-process-worker.ts    |  4 +-
 packages/engine/src/self-healing.ts                | 12 ++--
 packages/engine/src/worktree-hooks.ts              | 10 ++-
 67 files changed, 632 insertions(+), 250 deletions(-)

Fusion-Task-Id: FN-8603

Fusion-Task-Lineage: 53901db6-1af2-4bd7-b5ea-49507e048ef2

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-26 12:01:19 -07:00
gsxdsm
e16204deef FN-8522: fix Windows embedded PostgreSQL crash recovery
Harden Windows embedded PostgreSQL startup and recover once from owned-cluster DLL initialization crashes.

- Provide child-only native PATH hardening and non-blocking runner-log monitoring.
- Detect the ordered 0xC0000142 shutdown sequence and restart only owned clusters on their resolved port.
- Add lifecycle coverage and operator diagnostics for recovery behavior.

Files changed:
 .../fn-8522-windows-embedded-postgres-recovery.md  |   7 ++
 docs/diagnostics.md                                |  10 ++
 docs/storage.md                                    |   6 +
 .../__tests__/postgres/embedded-lifecycle.test.ts  |  87 ++++++++++++++
 .../postgres/embedded-windows-elevated.test.ts     |  49 ++++++++
 packages/core/src/postgres/embedded-lifecycle.ts   | 128 ++++++++++++++++++---
 .../core/src/postgres/embedded-windows-elevated.ts | 119 +++++++++++++++++--
 7 files changed, 382 insertions(+), 24 deletions(-)

Fusion-Task-Id: FN-8522

Fusion-Task-Lineage: f256e421-d82e-4afb-9f81-b5c18f1c7100

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-22 22:43:51 -07:00
gsxdsm
3e978e1540 fix: quiet per-poll scheduler hold-release and routing log spam
Both lines fired on every scheduler poll while nothing changed: a held
card re-attempts release each sweep, and every dispatch candidate logged
its resolved node. On a busy board that filled the operator log pane with
"Hold release for FN-XXXX deferred" and "routed to node=local" within
seconds, burying real scheduler events.

Add a Logger.debug() level, off by default and opted into per subsystem
via FUSION_DEBUG, and demote both lines to it. Routing to a remote node
stays at info since it explains where work actually went; only the local
default is demoted. Lines reporting a real transition (capacity
rejection, racing sweep, release failure) are untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-15 12:49:43 -07:00
gsxdsm
5ad8ec8cb6 FN-7528: capture post-task agent performance reflections
Capture deterministic post-task reflection metrics for completed agent tasks.

- Add non-LLM task performance capture with duration, touched files/packages, verification scope, and retry/rework metrics.
- Wire executor completion paths to fire best-effort reflection capture once per completed task when reflections are enabled.
- Extend reflection/run-audit types, docs, changeset, and regression coverage for capture behavior.

Files changed:
 .changeset/fn-7528-task-performance-capture.md     |   7 +
 AGENTS.md                                          |   1 +
 docs/diagnostics.md                                |  12 +-
 .../core/src/__tests__/reflection-store.test.ts    |  96 +++++++++
 packages/core/src/types.ts                         |  28 ++-
 .../engine/src/__tests__/agent-reflection.test.ts  | 202 +++++++++++++++++++
 .../executor-post-task-reflection-capture.test.ts  | 135 +++++++++++++
 packages/engine/src/agent-reflection.ts            | 215 ++++++++++++++++++++-
 packages/engine/src/executor.ts                    |  63 +++++-
 packages/engine/src/run-audit.ts                   |  29 +++
 10 files changed, 776 insertions(+), 12 deletions(-)

Fusion-Task-Id: FN-7528

Fusion-Task-Lineage: 153090e1-681b-4445-83e8-097bc70dcdb4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-07-04 21:28:15 -07:00
gsxdsm
605e4d7734 FN-7158: emit reflection run-audit telemetry
Record agent reflection outcomes in run audit without persisting reflection prose.\n\n- Emit generated, skipped, and failed reflection telemetry from AgentReflectionService.\n- Add run-audit metadata contracts, diagnostics docs, and operator-facing run-audit guidance.\n- Cover telemetry payloads and best-effort audit failures in agent reflection tests.\n- Add a minor changeset for the published Fusion CLI package.\n\nFiles changed:\n .changeset/fn-7158-reflection-telemetry.md         |  7 ++\n AGENTS.md                                          |  1 +\n docs/diagnostics.md                                | 12 +++\n .../engine/src/__tests__/agent-reflection.test.ts  | 99 ++++++++++++++++++++++\n packages/engine/src/agent-reflection.ts            | 60 ++++++++++++-\n packages/engine/src/run-audit.ts                   | 41 +++++++++\n 6 files changed, 219 insertions(+), 1 deletion(-)

Fusion-Task-Id: FN-7158

Fusion-Task-Lineage: e8a83fe9-2112-4ce4-9367-a6fa38b6fbb4

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
2026-06-27 20:33:22 -07:00
Phil Larson
4f803b8625 feat(FN-343): complete Step 5 — document cleanup diagnostics and changeset
Fusion-Task-Id: FN-343

Co-authored-by: Fusion <noreply@runfusion.ai>
2026-06-12 15:50:53 -07:00
gsxdsm
3615b0b19d FN-5941: stop todo/in-progress flapping
Prevent scheduler and self-healing churn from bouncing live tasks between todo and in-progress.

- add dispatch oscillation settings, scheduler settle-window tracking, and auto-pause audit/logging for rapid todo↔in-progress cycles
- harden self-healing against reclaiming genuinely active tasks by checking executor activity, grace windows, and heartbeat runs before requeueing
- cover the new reliability invariants with focused engine tests and document the new diagnostics/settings behavior

Files changed:
 docs/architecture.md                               |   1 +
 docs/diagnostics.md                                |   9 +
 docs/settings-reference.md                         |   3 +
 .../core/src/__tests__/settings-parity.test.ts     |   6 +
 packages/core/src/settings-schema.ts               |   6 +
 packages/core/src/types.ts                         |   9 +
 .../todo-inprogress-flapping.test.ts               | 556 +++++++++++++++++++++
 packages/engine/src/__tests__/scheduler.test.ts    |  14 +-
 .../self-healing-in-progress-limbo.test.ts         |   2 +-
 packages/engine/src/__tests__/self-healing.test.ts |   8 +-
 packages/engine/src/run-audit.ts                   |   8 +
 packages/engine/src/scheduler.ts                   | 113 ++++-
 packages/engine/src/self-healing.ts                | 230 +++++++--
 13 files changed, 928 insertions(+), 37 deletions(-)

Fusion-Task-Id: FN-5941

Fusion-Task-Lineage: babdd85e-d04c-47ca-901c-db692b2874bf
2026-06-07 18:51:47 -07:00
gsxdsm
866d01f532 FN-5959: bridge task goal provenance from mission links
Bridge mission-linked task provenance into goal diagnostics.

- derive task goal ids and goal records from the linked mission hierarchy with a task mission fallback
- record provenanceGoalIds in goal-injection diagnostics, run-audit metadata, and executor task logs
- add regression coverage and mission/diagnostics docs for derived task-to-goal provenance

Files changed:
 docs/diagnostics.md                                |   5 +-
 docs/missions.md                                   |  19 ++++
 packages/core/src/__tests__/mission-store.test.ts  | 123 +++++++++++++++++++++
 packages/core/src/mission-store.ts                 |  55 ++++++++-
 packages/engine/src/__tests__/goal-injection-diagnostics-wiring.test.ts      |  35 +++++-
 packages/engine/src/goal-injection-diagnostics.ts  |  21 +++-
 6 files changed, 247 insertions(+), 11 deletions(-)

Fusion-Task-Id: FN-5959

Fusion-Task-Lineage: 7c76ae98-37b1-421c-b477-a0147d034a4c
2026-06-03 15:32:29 -07:00
gsxdsm
d72cb2ab2b FN-5911: move agent logs to per-task JSONL storage
Store agent logs in per-task JSONL files instead of the legacy SQLite table.

- add a file-backed agent log store with JSONL append/read/prune helpers and task-scoped source refs
- migrate legacy SQLite agentLogEntries data into task files, rewrite goal citation references, and preserve soft-deleted logs for forensics
- update task store, settings, docs, dashboard route coverage, and add regression tests for migration, retention, and log access

Files changed:
 .changeset/fn-5911-agent-log-jsonl.md              |   5 +
 AGENTS.md                                          |   2 +-
 docs/diagnostics.md                                |   2 +-
 docs/settings-reference.md                         |   2 +
 docs/soft-delete-verification-matrix.md            |   7 +-
 docs/storage.md                                    |   8 +-
 .../src/__tests__/agent-log-file-store.test.ts     | 123 ++++++
 .../core/src/__tests__/agent-log-migration.test.ts | 186 +++++++++
 .../core/src/__tests__/agent-log-retention.test.ts | 208 ++++++++++
 packages/core/src/__tests__/db-migrate.test.ts     |  14 +-
 packages/core/src/__tests__/db.test.ts             |  39 +-
 .../src/__tests__/goal-citations-store.test.ts     |  38 +-
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 .../src/__tests__/merge-request-record.test.ts     |   2 +-
 packages/core/src/__tests__/mission-store.test.ts  |   2 +-
 packages/core/src/__tests__/run-audit.test.ts      |   2 +-
 packages/core/src/__tests__/secrets-schema.test.ts |   6 +-
 .../src/__tests__/soft-delete-agent-logs.test.ts   |  71 ++--
 .../src/__tests__/store-agent-log-file.test.ts     |  91 +++++
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/store-test-helpers.ts  |  43 +-
 packages/core/src/__tests__/store-upsert.test.ts   |  37 +-
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/agent-log-constants.ts           |  25 ++
 packages/core/src/agent-log-file-store.ts          | 267 ++++++++++++
 packages/core/src/db.ts                            |  51 ++-
 packages/core/src/settings-schema.ts               |   1 +
 packages/core/src/store.ts                         | 453 ++++++++++++---------
 packages/core/src/types.ts                         |  10 +-
 .../__tests__/agent-log-routes.integration.test.ts |  48 +++
 .../src/__tests__/evaluator-evidence.test.ts       |  47 ++-
 packages/engine/src/self-healing.ts                |  12 +
 .../src/store/__tests__/roadmap-store.test.ts      |   4 +-
 34 files changed, 1477 insertions(+), 345 deletions(-)

Fusion-Task-Id: FN-5911

Fusion-Task-Lineage: 07c42f3a-87cf-4558-8f01-ac8460b5558b
2026-06-03 01:10:18 -07:00
gsxdsm
194dfa9387 FN-5758: add cited-goal audit aggregation and runtime route
Add end-to-end goal-citation audit trail plumbing across core, engine, CLI, and dashboard.

- extend goal citation extraction with aggregation logic and new core coverage
- expose cited-goal runtime data through dashboard routes with dedicated API tests
- wire goal-citation audit details into engine diagnostics and CLI extension audit expectations
- document the new audit behavior and publish a patch changeset for @runfusion/fusion

Files changed:
 .changeset/fn-5758-goal-citation-audit.md          |  9 +++
 docs/dashboard-guide.md                            |  2 +
 docs/diagnostics.md                                |  4 ++
 .../__tests__/extension-goal-tools-audit.test.ts   |  6 +-
 packages/cli/src/extension.ts                      |  3 +
 .../goal-citation-audit-aggregation.test.ts        | 63 ++++++++++++++++++
 packages/core/src/goal-citation-extractor.ts       | 54 ++++++++++++++-
 packages/core/src/index.ts                         |  1 +
 .../src/__tests__/routes-run-cited-goals.test.ts   | 77 ++++++++++++++++++++++
 packages/dashboard/src/routes.ts                   | 11 ++++
 .../src/routes/register-agent-runtime-routes.ts    | 49 ++++++++++++++
 .../src/__tests__/goal-anchoring-audit.test.ts     | 40 +++++++----
 packages/engine/src/goal-anchoring-audit.ts        |  4 ++
 packages/engine/src/goal-injection-diagnostics.ts  |  1 +
 14 files changed, 308 insertions(+), 16 deletions(-)

Fusion-Task-Id: FN-5758

Fusion-Task-Lineage: b077c0b7-6ca4-489d-8c36-73d80a2afdb2
2026-05-30 22:53:24 -07:00
gsxdsm
d98ff8780c FN-5759: inject active-goal context across engine lanes
Enable always-on active-goal prompt injection and diagnostic wiring across triage/executor flows.

- Refactor goal-context injection so agent heartbeat, executor, and triage all apply the active-goal seam consistently.
- Extend goal injection diagnostics implementation and exports, plus anchoring audit touchpoints.
- Add and update tests for goal context injection behavior and diagnostics wiring.
- Update architecture and diagnostics docs to describe the new always-on seam.

Files changed:
 docs/architecture.md                               |  2 +-
 docs/diagnostics.md                                |  2 +-
 .../src/__tests__/goal-context-injection.test.ts   | 19 ++++-
 .../goal-injection-diagnostics-wiring.test.ts      | 98 +++++++++++++++++++++-
 packages/engine/src/agent-heartbeat.ts             | 31 ++-----
 packages/engine/src/executor.ts                    | 32 ++-----
 packages/engine/src/goal-anchoring-audit.ts        |  2 +-
 packages/engine/src/goal-injection-diagnostics.ts  | 42 +++++++++-
 packages/engine/src/index.ts                       |  2 +
 packages/engine/src/triage.ts                      | 28 +++++--
 10 files changed, 191 insertions(+), 67 deletions(-)

Fusion-Task-Id: FN-5759

Fusion-Task-Lineage: 1419de34-2e86-4459-bcd4-426f15c067fe
2026-05-30 21:54:06 -07:00
gsxdsm
ee0b1cd9c8 FN-5658: add goal injection visibility diagnostics
Improve anchoring visibility by classifying and emitting goal-injection diagnostics across engine lanes.

- add goal-injection diagnostics module with result/failure classification and audit emission helpers
- wire heartbeat and executor prompt construction to resolve classified goal context and emit diagnostic events
- expose diagnostic APIs from engine index and add new run-audit event type for prompt goal injection
- add unit and wiring tests plus diagnostics docs updates for the new observability path

Files changed:
 docs/diagnostics.md                                |   8 +
 .../goal-injection-diagnostics-wiring.test.ts      |  87 +++++++++
 .../__tests__/goal-injection-diagnostics.test.ts   | 150 +++++++++++++++
 packages/engine/src/agent-heartbeat.ts             |  34 +++-
 packages/engine/src/executor.ts                    |  35 +++-
 packages/engine/src/goal-injection-diagnostics.ts  | 209 +++++++++++++++++++++
 packages/engine/src/index.ts                       |  10 +
 packages/engine/src/run-audit.ts                   |   7 +-
 8 files changed, 521 insertions(+), 19 deletions(-)

Fusion-Task-Id: FN-5658

Fusion-Task-Lineage: f4feaa37-d9b1-4bb6-b8c9-35a9b7a02f57
2026-05-29 20:50:08 -07:00
gsxdsm
ba6b41f533 chore(engine): remove triage broad-scope heuristics
Removes the BROAD_SCOPE_FLAG_VERSION/decideBroadScopeFlag pipeline,
the triage.ts call site that wrote `broadScopeFlag` source metadata
and emitted task:broad-scope-flagged-at-triage audit events, the
DatabaseMutationType enum entry, the diagnostic doc section, and the
associated unit + reliability-interaction tests.

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

Fusion-Task-Id: FN-5205

Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
Fusion-Task-Id: FN-5205
2026-05-23 02:25:00 -07:00
gsxdsm
2a3a07a612 feat(FN-5403): merge fusion/fn-5403 2026-05-22 23:12:49 -07:00
Fusion (runfusion.ai)
4cbdd157c5 feat(FN-5469): add useAgentLogs resume instrumentation and test coverage
Added resume instrumentation to the `useAgentLogs` hook (`packages/dashboard/app/hooks/useAgentLogs.ts`) with test coverage and diagnostics documentation. The new test file is included in the dashboard test gate via `vitest.config.ts`.

Fusion-Task-Id: FN-5469
2026-05-21 20:06:48 -07:00
Fusion (runfusion.ai)
a8715ed963 fix(FN-5335): enforce triple-proof gating for backward recovery
- Gate self-healing backward moves behind audited triple-proof predicates across reclaim paths
- Skip reclaim-pr-conflict mutations when proof checks fail and preserve no-action behavior
- Add broad unit and reliability-interaction coverage for triple-proof and cross-layer scenarios
- Document backward-move stage invariants, diagnostics, and add delivery changeset for @runfusion/fusion
2026-05-21 19:15:27 -07:00
Fusion (runfusion.ai)
854045f430 feat(FN-5416): instrument SSE stream resume events across PR checks, dev-se
Adds structured stream-resume instrumentation to the dashboard across four SSE hooks (PR checks, dev-server logs, research, background sessions), wiring `[wake-trigger-diagnostics]` log markers and view-resume route guards so the engine can distinguish cold starts from resume paths; includes tests f

Fusion-Task-Id: FN-5416
2026-05-21 18:15:26 -07:00
Fusion (runfusion.ai)
c04442f6ea feat(FN-5415): wire visibility resume emissions in board hooks and add test
Adds visibility resume emissions to the four managed state hooks (`useMeshState`, `useNodes`, `useProjects`, `useManagedDockerNodes`) and establishes corresponding instrumentation test coverage, with a documentation update to the diagnostics reference covering board hook telemetry.

Fusion-Task-Id: FN-5415
2026-05-21 16:09:53 -07:00
Fusion (runfusion.ai)
b8147dd3b1 feat(FN-5405): remove broad-scope triage heuristics and UI advisory chips/b
Removes the broad-scope detection feature end-to-end: the TaskCard chip and TaskDetailModal advisory banner are gone from the dashboard, the triage heuristic that flagged tasks as broad-scope has been deleted from the engine along with its associated run-audit events, and documentation references ha

Fusion-Task-Id: FN-5405
2026-05-21 15:07:15 -07:00
Fusion (runfusion.ai)
f798378693 feat(FN-5346): add post-completion defensive backstop and shared reconcile
The merge adds a post-completion defensive backstop that probes and removes stale same-task `activeSessionRegistry` entries on `done`/`archived` transitions, completing FN-5346 with a shared reconcile helper, a defensive ownership probe wired into paused cleanup, audit event alignment, and regressio

Fusion-Task-Id: FN-5346
2026-05-20 21:53:02 -07:00
Fusion (runfusion.ai)
1913cb59fe feat(FN-5389): add resume event instrumentation with SSE, hooks, and diagno
FN-5389 adds dashboard resume event instrumentation: a `resumeInstrumentation` utility captures SSE resume signals, wired through `useChat`, `useChatRooms`, and `useTasks` hooks, with remount markers in `Board` and `ChatView`; diagnostics routes expose resume events for observability, documented in

Fusion-Task-Id: FN-5389
2026-05-20 19:58:49 -07:00
Fusion (runfusion.ai)
c60045df22 feat(FN-5223): anchor staleness and stall detectors to engine activation ti
The merge introduces an engine-activation timestamp as the staleness floor for task age calculations, replacing arbitrary wall-clock thresholds with a runtime-relative anchor. Step 1 adds settings defaults, Steps 2–4 wire the floor helper through project engine, in-process runtime, and task store hy

Fusion-Task-Id: FN-5223
2026-05-20 14:29:07 -07:00
Fusion (runfusion.ai)
6fb4b9ee47 feat(FN-5362): add heartbeat executor sparse-cache reports-health diagnosti
The merge fixes a stale cache-miss path in the heartbeat executor and adds `reports-health` diagnostics for cache-state reporting, with a regression test covering a sparse-cache false-positive scenario. It also adds a two-line tweak to the merger and updates the diagnostics documentation.

Fusion-Task-Id: FN-5362
2026-05-20 14:28:45 -07:00
Fusion (runfusion.ai)
37d4115bb6 feat(FN-5231): detect and flag broad-scope tasks at triage to prompt scope
- docs(FN-5231): complete Step 6 — AGENTS.md + delivery summary + dashboard follow-up
- test(FN-5231): complete Step 5 — verification gates green
- test(FN-5231): complete Step 4 — reliability interaction regression for broad-scope flag
- feat(FN-5231): complete Step 3 — wire broad-scope flag into finalizeApprovedTask
- feat(FN-5231): complete Step 2 — register broad-scope audit event type
- feat(FN-5231): complete Step 1 — broad-scope heuristic helper

Fusion-Task-Id: FN-5231
2026-05-20 05:28:36 -07:00
Fusion (runfusion.ai)
c48f9cbcad docs(FN-5189): add process supervision guidance
Fusion-Task-Id: FN-5189
Fusion-Task-Lineage: 4caa3f0a-af81-4c60-88e8-de229ed72e08
2026-05-19 17:19:03 -07:00
Fusion (runfusion.ai)
dac2ebbbf3 fix(FN-5168): stabilize cli worktree root test timeout
Fusion-Task-Id: FN-5168
Fusion-Task-Lineage: 0c865d3e-0886-4e51-a7ff-cb4c713dcc54
2026-05-19 16:15:25 -07:00
Fusion (runfusion.ai)
41c243880a docs(FN-5093): complete Step 6 — document in-review-stalled detector
Fusion-Task-Id: FN-5093
Fusion-Task-Lineage: fe96617a-88f8-4a3c-b96c-c516d2206331
2026-05-19 03:54:49 -07:00
Fusion (runfusion.ai)
20e1bb9d25 feat(FN-5091): complete Step 6 — document dependency blocked backlog health
Fusion-Task-Id: FN-5091
Fusion-Task-Lineage: f59dc7dd-abc2-4d1d-a755-1fe446314131
2026-05-19 03:21:17 -07:00
gsxdsm
6c1732d234 feat(FN-5076): merge fusion/fn-5076 2026-05-18 14:46:20 -07:00