Commit Graph

135 Commits

Author SHA1 Message Date
gsxdsm
71e2aec5b7 FN-5663: add goal-citation audit trail to agent reasoning
Record goal citation evidence so agent reasoning can be traced end-to-end.

- add core goal citation types, extraction helper, persistence schema, and store APIs for citation create/list workflows
- add CLI support and tests for goal citation flows, including command wiring and regression coverage
- update docs and add a published changeset for @runfusion/fusion describing the new audit-trail capability

Files changed:
 .changeset/fn-5663-goal-citation-audit-trail.md    |  10 +
 docs/agents.md                                     |  15 ++
 docs/cli-reference.md                              |   6 +-
 packages/cli/src/__tests__/bin.test.ts             |   2 +
 .../cli/src/__tests__/goals-citations-cli.test.ts  |  82 ++++++++
 packages/cli/src/bin.ts                            |  19 +-
 packages/cli/src/commands/goals.ts                 |  43 +++++
 packages/core/src/__tests__/db-migrate.test.ts     |  10 +-
 packages/core/src/__tests__/db.test.ts             |  34 ++--
 .../src/__tests__/goal-citation-extractor.test.ts  |  56 ++++++
 .../src/__tests__/goal-citations-store.test.ts     | 175 +++++++++++++++++
 packages/core/src/__tests__/goals-schema.test.ts   |   2 +-
 packages/core/src/__tests__/insight-store.test.ts  |  10 +-
 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 +-
 .../core/src/__tests__/store-merge-queue.test.ts   |   2 +-
 packages/core/src/__tests__/task-documents.test.ts |   2 +-
 packages/core/src/db.ts                            |  51 ++++-
 packages/core/src/goal-citation-extractor.ts       |  56 ++++++
 packages/core/src/index.ts                         |  13 ++
 packages/core/src/store.ts                         | 210 ++++++++++++++++++++-
 packages/core/src/types.ts                         |  51 ++++-
 .../src/store/__tests__/roadmap-store.test.ts      |   4 +-
 24 files changed, 817 insertions(+), 46 deletions(-)

Fusion-Task-Id: FN-5663

Fusion-Task-Lineage: 720f2c4b-4363-464a-a76f-472ec6aca136
2026-05-29 08:25:38 -07:00
Fusion (runfusion.ai)
d04c7803e0 feat(FN-5339): trim AGENTS.md to essential rules, move detailed guidance to
Restructured AGENTS.md from a 588-line catch-all into a lean reference of essential rules by offloading deep guidance into five new/expanded doc files: agents.md, architecture.md, dashboard-guide.md, settings-reference.md, and testing.md. Also restored a missing FN-5345 lifecycle invariant in self-h

Fusion-Task-Id: FN-5339

Fusion-Task-Lineage: e1a2dc4f-ae50-46f4-acd3-8f2c3673feb4
2026-05-21 19:41:52 -07:00
Fusion (runfusion.ai)
6fdfb1ad5c feat(FN-5425): add coordination notice system for multi-agent room task fil
Adds a `room-coordination.ts` helper module for multi-agent coordination messaging, wires coordination notices into the agent heartbeat path, and ships tests plus documentation for the feature. A changeset prepares the `@runfusion/fusion` package for release.

Fusion-Task-Id: FN-5425
2026-05-21 00:17:33 -07:00
gsxdsm
b936ab9bb5 feat(FN-5414): merge fusion/fn-5414 2026-05-20 20:15:43 -07:00
Fusion (runfusion.ai)
1237168b71 feat(FN-5227): add bulk controls for project agents
- Add project-scoped Pause All Agents and Resume All Agents actions to the AgentsView controls menu
- Load bulk-action eligibility on menu open and skip ephemeral or ineligible agents
- Surface bulk action confirmations, success/error toasts, and refresh agent state after updates
- Add dashboard tests and agent docs coverage for the new bulk controls

Fusion-Task-Id: FN-5227
2026-05-20 03:57:17 -07:00
Fusion (runfusion.ai)
5a101dc70b feat(FN-4785): complete Step 6 — document and ship agents-load perf fix
Fusion-Task-Id: FN-4785
Fusion-Task-Lineage: be241ee7-9df0-433c-a00b-997bcd558862
2026-05-16 13:04:28 -07:00
Fusion (runfusion.ai)
0121a09060 docs(FN-4746): complete Step 4 — document wake trigger diagnostics
Fusion-Task-Id: FN-4746
Fusion-Task-Lineage: 04107d0d-4319-4270-8480-7a98341a966d
2026-05-16 09:36:39 -07:00
Fusion (runfusion.ai)
5ac4bb8c74 docs(FN-4744): complete Step 4 — document consumed message wake reasons
Fusion-Task-Id: FN-4744
Fusion-Task-Lineage: 5ffbea10-4da3-4f85-9cc4-679545eb2383
2026-05-16 09:05:51 -07:00
Fusion
7b186c7d3d feat(FN-4603): complete Step 5 — document network_api gating for web fetch
Fusion-Task-Id: FN-4603
Fusion-Task-Lineage: c74085e2-d91c-468f-883b-5c33818e53fd
2026-05-15 07:55:22 -07:00
Fusion
cdec48f795 feat(FN-4599): complete Step 6 — document approval gate UI and changeset
Fusion-Task-Id: FN-4599
Fusion-Task-Lineage: 39bdbfd4-d90a-4232-a447-23ef107732e4
2026-05-15 07:10:36 -07:00
Fusion
34b98c2965 feat(FN-4488): complete Step 7 — docs and changeset
Fusion-Task-Id: FN-4488
Fusion-Task-Lineage: 3fc1ac43-490f-43f2-a27e-4fdceb64d9c4
2026-05-14 13:16:10 -07:00
Fusion
5050e349b6 feat(FN-4400): complete Step 9 — docs and release notes
Fusion-Task-Id: FN-4400
Fusion-Task-Lineage: 0d4f9c48-5b8b-49eb-9cf3-d1d585ffe7fc
2026-05-14 04:32:43 -07:00
Fusion
c07fb53671 feat(FN-4394): complete Step 9 — document heartbeat scope discipline
Fusion-Task-Id: FN-4394
Fusion-Task-Lineage: 1e7ad660-2cd2-40ba-b7b8-7ef552c6fa13
2026-05-14 03:23:43 -07:00
Fusion
f860618657 feat(FN-4401): complete remaining auto-claim snapshot integration
Fusion-Task-Id: FN-4401
Fusion-Task-Lineage: c1b6c497-b22c-48d5-b1c8-299877bf09ac
2026-05-14 01:10:47 -07:00
Fusion
6ec7591270 docs(FN-4166): cross-reference persistAgentThinkingLog in agents.md
Fusion-Task-Id: FN-4166
Fusion-Task-Lineage: 8c491fd0-2390-4501-9b80-8c45c9ebf6b5
2026-05-14 00:20:11 -07:00
gsxdsm
0765700ec9 docs(FN-4166): cross-reference persistAgentThinkingLog in agents.md
Fusion-Task-Id: FN-4166
Fusion-Task-Lineage: 8c491fd0-2390-4501-9b80-8c45c9ebf6b5
2026-05-14 00:20:11 -07:00
Fusion
8539a3dec0 feat(FN-4388): complete remaining observability surfaces
Fusion-Task-Id: FN-4388
Fusion-Task-Lineage: 7497a0a1-5edb-4778-b339-118d1fd668f7
2026-05-13 22:41:29 -07:00
Fusion
2f242d7d81 feat(FN-4152): complete Step 4 — document CLI agent chat
Fusion-Task-Id: FN-4152
Fusion-Task-Lineage: cd26df5e-92f2-431a-950e-84a0fd81bd1f
2026-05-13 21:41:14 -07:00
Fusion
4c1d642078 feat(FN-4386): complete Step 6 — document idle heartbeat setting
Fusion-Task-Id: FN-4386
Fusion-Task-Lineage: 82c1c281-8d69-42c1-8705-90e811b6df93
2026-05-13 16:38:00 -07:00
Fusion
e4d5216c0f feat(FN-4295): complete Step 5 — documentation & delivery
Fusion-Task-Id: FN-4295
Fusion-Task-Lineage: e2a47487-33f5-4077-8031-c7bb14882121
2026-05-13 10:08:30 -07:00
Fusion
e640da60eb fix(FN-4295): complete Step 5 — update stale-threshold docs
Fusion-Task-Id: FN-4295
Fusion-Task-Lineage: e2a47487-33f5-4077-8031-c7bb14882121
2026-05-13 10:08:30 -07:00
Fusion
14f252be51 feat(FN-4278): clarify orphaned-running timeout semantics in agent heartbea
Clarifies orphaned-running timeout semantics in the agents documentation and adds a related implementation detail in the agent heartbeat module.

Fusion-Task-Id: FN-4278
2026-05-13 09:06:20 -07:00
Fusion
bf6a679ff1 feat(FN-4257): run durable heartbeat task sessions in worktree
Fusion-Task-Id: FN-4257
Fusion-Task-Lineage: db48d51e-9e7d-471d-b26b-2a8763fb41d1
2026-05-13 06:29:34 -07:00
Fusion
40ef791b4d feat(FN-4255): complete Step 4 — add docs and release note
Fusion-Task-Id: FN-4255
Fusion-Task-Lineage: 315c5491-0e27-46cb-8474-fda9bb3a0eff
2026-05-13 06:29:34 -07:00
Fusion
53aa1e90f1 feat(FN-4249): complete Step 4 — document invariant and add changeset
Fusion-Task-Id: FN-4249
Fusion-Task-Lineage: e0052fae-38e1-4d66-8240-43d26f5790bb
2026-05-13 06:29:33 -07:00
Fusion
3f5a2fcbf3 feat(FN-4244): add no-task heartbeat procedure override
Merged FN-4244: adds an override path for the no-task heartbeat procedure in the engine, allowing agents to execute a custom procedure when they have no active task. The fix commit corrects the initial implementation, with test coverage for procedure source selection and updated documentation in `do

Fusion-Task-Id: FN-4244

Fusion-Task-Lineage: 6bf1bfe4-de2c-4467-93dc-d90231a53eb2
2026-05-12 21:45:34 -07:00
Fusion
08c29954ff docs(FN-4172): document expected heartbeat gaps
- Clarify in docs/agents.md that sub-hour heartbeat ages are normal with the default 1-hour interval
- Add FN-4172 investigation notes capturing persisted agent heartbeat measurements and classification rubric
- Record the close recommendation and verification results for the FN-4119 follow-up

Fusion-Task-Id: FN-4172
2026-05-12 20:11:22 -07:00
Fusion
e7fc3a9d17 feat(FN-4177): add heartbeat messaging support for chat rooms
The merge delivers room heartbeat messaging for agents, allowing heartbeat-triggered agents to send messages into chat rooms and subscribe to room activity. Core changes include new chat-store room APIs, engine heartbeat room message tools, and corresponding tests, with a small dashboard ChatView up

Fusion-Task-Id: FN-4177
2026-05-12 18:20:17 -07:00
Fusion
738d69fb82 feat(FN-4119): add stale heartbeat run reaper to prevent engine blockage
Implements a stale heartbeat reaper in the engine that detects and cleans up heartbeat runs exceeding their timeout, preventing blocked heartbeat cycles from stalling agent activity. Includes comprehensive tests for the reaper gates and documentation of the feature in agents.md.

Fusion-Task-Id: FN-4119
2026-05-12 17:04:33 -07:00
Fusion
079772a106 feat(FN-4056): restore bound reports lookup in heartbeat executor
Restores the bound reports lookup in the heartbeat executor (FN-4056), updating the relevant logic in `agent-heartbeat.ts` with a corresponding test and documentation clarification in `agents.md`.

Fusion-Task-Id: FN-4056
2026-05-12 07:47:10 -07:00
Fusion
8b0fc50a84 feat(FN-4066): document bulk lifecycle actions for agents
Documents bulk lifecycle actions in the agents reference (`docs/agents.md`), completing step 4 of FN-4066.

Fusion-Task-Id: FN-4066
2026-05-12 07:47:10 -07:00
Fusion
1b7643b383 feat(FN-4045): surface and handle delegate task collision errors
Added delegate collision detection and error surfacing across the task creation and delegation pipeline. The core store now throws a typed `DelegateCollisionError` when `createTask` encounters a duplicate task ID, the engine's `delegate_task` tool propagates these errors with context, and the CLI ex

Fusion-Task-Id: FN-4045
2026-05-12 07:47:10 -07:00
Fusion
1f7958fc0f feat(FN-3935): align engineer role routing with explicit assignment and del
Centralized routing policy helpers in core and aligned both direct assignment and delegation to route engineer-role agents consistently, ensuring assigned tasks respect explicit engineer routing the same way delegated tasks do. Added comprehensive test coverage across core, CLI, dashboard, and engin

Fusion-Task-Id: FN-3935

Fusion-Task-Lineage: 069f4d54-f7a8-4bd3-a2c3-4de830de042f
2026-05-11 21:48:26 -07:00
Fusion
3f6c4c688a feat(FN-3959): add heartbeat timer registration repair sweep
Heartbeat timer repair sweep — adds a registration repair mechanism that detects and flags stale timers via agent updates, with tests covering the new sweep behavior. Documentation updated in agents.md to reflect the repair flow.

Fusion-Task-Id: FN-3959

Fusion-Task-Lineage: 40708b6b-01e1-4673-93e1-299678de2879
2026-05-11 15:18:40 -07:00
Fusion
109ba3b9cf feat(FN-4033): handle stale timers in heartbeat scheduler
Adds stale timer repair handling to the heartbeat scheduler with test coverage, and updates the agents documentation accordingly.

Fusion-Task-Id: FN-4033
2026-05-11 14:47:21 -07:00
Fusion
a8ef54c7f9 feat(FN-4020): surface timer repair stale health in agent health utilities
Adds health-surfacing logic for timer-triggered stale heartbeats in the engine, a new `agentHealth.tsx` dashboard utility with tests, and documentation updates for the repair behavior.

Fusion-Task-Id: FN-4020
2026-05-11 11:52:21 -07:00
Fusion
631b384837 feat(FN-4005): harden durable transient recovery auto-restart flow
- Add bounded auto-restart handling in in-process runtime for durable agents after transient failures
- Extend self-healing recovery logic and transient error detection to classify and recover retryable runtime interruptions
- Add regression coverage across heartbeat executor, self-healing, and transient detector test suites
- Document durable agent transient recovery behavior in docs/agents.md

Fusion-Task-Id: FN-4005
2026-05-11 09:17:10 -07:00
Fusion
95c7588e30 feat(FN-4004): add bounded room thread and mailbox reply context to agents
Adds bounded room thread context and mailbox reply context to the chat system, implemented in `agent-tools.ts` with corresponding dashboard room handling in `chat.ts`; includes expanded test coverage for both modules and updated documentation in `agents.md`.

Fusion-Task-Id: FN-4004
2026-05-11 08:02:53 -07:00
Fusion
59a5777251 feat(FN-3884): implement heartbeat scope discipline for agent prompts
Adds heartbeat scope-discipline guardrails to the executor's heartbeat procedure, ensuring agents stay focused on their assigned scope rather than drifting to unrelated work. Includes tests for the updated heartbeat prompts and documentation in agents.md, shipped as a patch.

Fusion-Task-Id: FN-3884
2026-05-11 06:47:43 -07:00
Fusion
fcbd9a4022 feat(FN-3973): document spawn agent approval policy
Documents the spawn agent approval evaluation policy by adding a new `docs/spawn-agent-approval-evaluation.md` (48 lines), updating `docs/agents.md` with related guidance, trimming `docs/architecture.md`, and bumping the agent delegation section in `AGENTS.md`. The new evaluation doc captures the FN

Fusion-Task-Id: FN-3973
2026-05-11 06:47:43 -07:00
Fusion
867df04143 feat(FN-3976): reclassify github import action gating
Completes FN-3976 by reclassifying GitHub import action gating in the engine's `gating-classifications.ts`, updating documentation in `docs/agents.md` accordingly, and adding test coverage across four gating test suites.

Fusion-Task-Id: FN-3976
2026-05-11 06:47:42 -07:00
Fusion
44a9fb8ed8 feat(FN-3958): add heartbeat timer reconciliation self-healing
Adds scheduler heartbeat timer reconciliation with automatic self-healing when timers drift, including tests for tracked-only monitor recovery and documentation in the agents reference.

Fusion-Task-Id: FN-3958
2026-05-10 23:36:10 -07:00
Fusion
3ec12f10e7 feat(FN-3791): add agent provisioning approval guards and policy enforcemen
Implements approval guards for agent provisioning (FN-3791), adding policy-gated create/delete flows with dedupe logic, CLI tool alignment, engine run-audit coverage, and corresponding test suites, plus documentation updates and a regression fix for verification/tool docs sync.

Fusion-Task-Id: FN-3791
2026-05-10 23:36:10 -07:00
Fusion
6ce7f9f0df feat(FN-3971): add aggregate mailbox view for all agents
Adds an "All Agents" unified mailbox view to the dashboard, including a new aggregate API endpoint in `@fusion/core`, updated MailboxView UI with selection controls, CSS styling, and comprehensive tests across core and dashboard packages, with documentation updates.

Fusion-Task-Id: FN-3971
2026-05-10 23:36:10 -07:00
Fusion
f6c32f1049 feat(FN-3957): add delegate_task override flag to bypass executor role poli
Adds a `delegate_override` flag to the `delegate_task` tool that allows executor-role tasks to be assigned to non-executor agents. The override is persisted as metadata in the extension and honored by the heartbeat inbox guard, with test coverage across engine, core, and CLI packages plus updated do

Fusion-Task-Id: FN-3957
2026-05-10 23:36:09 -07:00
Fusion
fe50c3a3ad feat(FN-3956): execute provisioning on approval decisions
The merge completes Step 1 of agent provisioning approval followthrough, executing provisioning actions when approval decisions are made, with supporting documentation in AGENTS.md and docs/agents.md. Test coverage spans provisioning policy, approval routes, gating classifications, extension integra

Fusion-Task-Id: FN-3956
2026-05-10 19:13:05 -07:00
Fusion
1e7771e247 feat(FN-3922): enforce task skip on credential-failure heartbeat
Credential-missing recovery is now documented and enforced in the agent heartbeat layer, with comprehensive test coverage for both timer-triggered and assignment-triggered credential failure scenarios.

Fusion-Task-Id: FN-3922
2026-05-10 05:58:46 -07:00
Fusion
a1f4b53e21 feat(FN-3914): add durable heartbeat model fallback
Adds durable heartbeat model fallback logic to the engine's heartbeat subsystem (`agent-heartbeat.ts`, `agent-session-helpers.ts`, `pi.ts`), allowing heartbeats to gracefully use alternative AI models when the primary model is unavailable, with documentation updates to `agents.md` and `settings-refe

Fusion-Task-Id: FN-3914
2026-05-10 02:54:30 -07:00
Fusion
e69631ec24 feat(FN-3901): add builtin research web-search provider as default
The merge adds a builtin web-search research provider as the default, replacing the need for external research provider configuration and removing the setup gate for builtin defaults. Dashboard settings UX for research defaults was aligned (ResearchView, SettingsModal), CLI research commands were up

Fusion-Task-Id: FN-3901
2026-05-09 19:41:09 -07:00
Fusion
e0a84b27fb feat(FN-3452): document mesh lease recovery semantics
Documents mesh lease recovery semantics across the agents, architecture, and multi-project reference files, adding 32 lines of clarifying documentation to explain how mesh leases are recovered in the system.

Fusion-Task-Id: FN-3452
2026-05-09 11:31:57 -07:00