Commit Graph

1340 Commits

Author SHA1 Message Date
Fusion
0056b85668 feat(FN-4063): enforce planning and triage memory write contracts
Enforces memory write contracts for triage and planning agents, adding tests in both `project-memory.test.ts` and `triage.test.ts` to guard the contract boundaries established in `project-memory.ts`.

Fusion-Task-Id: FN-4063

Fusion-Task-Lineage: 5f86295b-d583-4757-9aa5-30a64b2cc2d6
2026-05-11 21:48:26 -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
1772572191 feat(FN-4027): memoize startup slim list reads to avoid redundant fresh fet
Added memoization for startup slim task list reads (`store.ts`), with dashboard server routing startup reads through the memo window and tests covering the store watcher consumers in scheduler and worktree-pool, plus performance documentation.

Fusion-Task-Id: FN-4027
2026-05-11 21:48:26 -07:00
Fusion
6acc51cf02 feat(FN-4039): recover worktree db scratch bootstrap on hydration failure
Codifies the worktree database open-path hydration failure with a recovery bootstrap mechanism, documented the behavior in storage docs, and added test coverage for the executor hydration degradation path — all gated behind a patch changeset for `@runfusion/fusion`.

Fusion-Task-Id: FN-4039
2026-05-11 21:48:26 -07:00
Fusion
a318f196bc feat(FN-4041): harden empty rawResponse handling in memory-insights
Hardened empty `rawResponse` handling in the memory insights module by adding defensive checks to prevent errors when the response is empty, accompanied by tests to cover those edge cases (FN-4041 Step 1).

Fusion-Task-Id: FN-4041
2026-05-11 17:46:42 -07:00
Fusion
14e020f791 feat(FN-4019): prevent merge-confirmed finalization loops via self-healing
Added self-healing logic to prevent merge-confirmed tasks from re-entering the executor, with test coverage for both merge error recovery and self-healing behavior, plus corresponding architecture and task-management docs.

Fusion-Task-Id: FN-4019
2026-05-11 15:29:34 -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
fdc7309a48 feat(FN-3908): broaden multi-dependency auto-unblock logs
Commits merged:
- feat(FN-3908): complete Step 1 — broaden multi-dependency auto-unblock logs

Files changed:
packages/engine/src/__tests__/scheduler.test.ts | 2 +-
 packages/engine/src/scheduler.ts                | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

Fusion-Task-Id: FN-3908
2026-05-11 14:32:56 -07:00
Fusion
de1e13d221 feat(FN-4014): split merger monolith into domain-specific test suites
The monolithic `merger.test.ts` (8,229 lines) has been decomposed into nine focused test suites covering conflict resolution, diff scope, merge details, merge lifecycle, post-merge, prompt and utils, session recovery, skills, and verification, along with a shared `merger-test-helpers.ts` module for

Fusion-Task-Id: FN-4014
2026-05-11 14:24:46 -07:00
Fusion
83b0407276 feat(FN-4021): split monolithic store tests into focused domain suites
FN-4021 refactors the core store test suite by splitting the monolithic `store.test.ts` (6,865 lines) into nine focused domain suites — activity, comments, create, movement, ops, parsing, resilience, scheduling, snapshots, update, and upsert — and introduces shared test helpers to support the split

Fusion-Task-Id: FN-4021

Fusion-Task-Lineage: 359f2dca-f7f7-4735-bcbd-92d569d2bcd5
2026-05-11 13:35:53 -07:00
Fusion
45ec544c77 test(FN-3908): add multi-dependency and queued-recovery regressions 2026-05-11 13:13:20 -07:00
Fusion
6b3e6355fa feat(FN-3908): complete Step 3 — log queued dispatch blockers 2026-05-11 13:07:45 -07:00
Fusion
d0834618f2 feat(FN-3908): complete Step 2 — recover stale queued dependency tasks 2026-05-11 13:02:18 -07:00
Fusion
42087ddfeb feat(FN-4015): classify and recover from stale module-resolution incidents
Merges FN-4015 to add stale module-resolution incident detection and self-healing in the engine (`transient-error-detector.ts`, `self-healing.ts`) with mobile regression coverage for the shared `AgentErrorDetailsModal` layout.

Fusion-Task-Id: FN-4015
2026-05-11 12:04:20 -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
1cf987208c feat(FN-4018): isolate split merger temp workspaces with settings persisten
Merged FN-4014 to fix dual-scope GitHub tracking settings persistence and validation (mission vs task scope), scoped repo saves to the relevant section, and documented the dual defaults. Also landed FN-4018 to isolate split merger temp workspaces and add regression checks for split-suite test isolat

Fusion-Task-Id: FN-4018
2026-05-11 11:41:19 -07:00
Fusion
e441398208 feat(FN-3906): add frontend scope helpers for workflow step auto-skip
Adds frontend-UX auto-skip behavior for workflow steps in the executor, with tests covering the flow and documentation of the recovery logic. A changeset is included for this patch release.

Fusion-Task-Id: FN-3906

Fusion-Task-Lineage: 3c50b82b-dd03-4ba3-8d77-5aaabb8734da
2026-05-11 11:21:21 -07:00
Fusion
39a5668057 feat(FN-3899): stabilize blockedBy overlap stamping and add recovery utilit
Stabilizes blocked-by overlap stamping in the scheduler and adds a standalone `recover-stale-blocked-by` utility script to clear stale upstream blockers, with corresponding scheduler tests and architecture documentation.

Fusion-Task-Id: FN-3899
2026-05-11 10:36:01 -07:00
Fusion
b56306c422 feat(FN-3905): use merger session model for post-merge workflow steps
The merge implements post-merge model resolution, using the merger's own session model for executing post-merge prompt workflow steps instead of falling back to executor model defaults. Tests cover the resolution hierarchy, and documentation clarifies the precedence order for downstream consumers.

Fusion-Task-Id: FN-3905
2026-05-11 09:32:53 -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
94fb1cc2ef feat(FN-4001): merge fusion/fn-4001
Commits merged:
- merge fusion/fn-4001

Files changed:
packages/cli/src/__tests__/bundle-output.test.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Fusion-Task-Id: FN-4001
2026-05-11 08:02:53 -07:00
Fusion
e59a740d0f feat(FN-3841): add worktree database hydration to executor
Implements worktree database hydration for the executor (`worktree-db-hydrate.ts`), enabling the task executor to restore its database state from a worktree on resume, with integration in `executor.ts` and comprehensive test coverage across the new module and worktree scenarios. Documentation and a

Fusion-Task-Id: FN-3841
2026-05-11 06:47:43 -07:00
Fusion
f870f07cab feat(FN-3979): validate overlap coverage for FN-3834 and keep tests type-sa
FN-3979 adds test coverage validating the FN-3834 overlap detection fix: Step 1 introduces overlap validation tests in the merger and self-healing test suites, and Step 2 cleans up a type-safety issue in the overlap test.

Fusion-Task-Id: FN-3979
2026-05-11 06:47:43 -07:00
Fusion
161bfa9571 feat(FN-3834): short-circuit no-op merges and auto-finalize review tasks
Merged FN-3834 to add a no-op merge recovery flow to the merger, including a branch-ahead detector, short-circuit logic to exclude no-op merges from the mergeable sweep, and finalization of no-op review tasks — backed by substantial test coverage across merger and self-healing modules.

Fusion-Task-Id: FN-3834
2026-05-11 06:47:43 -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
5386d38567 feat(FN-3990): add task lineage identity and association storage
Adds task lineage storage infrastructure (FN-3990 Step 2), introducing a dedicated `task-lineage.ts` module and related types to track task identity and association relationships, with corresponding database schema and store support plus tests and documentation for the lineage reconciliation process

Fusion-Task-Id: FN-3990
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
8f4598fd6d feat(FN-3962): align fn_task_done recovery detection in self-healing
Refined self-healing recovery logic for tasks that lack a `fn_task_done` signal, aligned detection in the engine with matching test coverage and architecture documentation for the recovery behavior.

Fusion-Task-Id: FN-3962
2026-05-11 06:47:42 -07:00
Fusion
0d6115f455 feat(FN-3972): recover in-review tasks with missing worktrees
- Add self-healing recovery to detect in-review tasks that lost their worktree and clear stale blockedBy state
- Extend restart recovery coordinator handling and tests for missing-worktree classification behavior
- Add focused self-healing and restart recovery test coverage for the new recovery path
- Document missing-worktree review recovery behavior in architecture docs

Fusion-Task-Id: FN-3972
2026-05-10 23:36:10 -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
234c2a5945 feat(FN-3968): add tests for task env inheritance and isolation in spawn/ch
Adds test coverage for task environment propagation through the spawn flow, covering child agents inheriting task env, workflow step task env, and spawn hook env isolation cases in `pi-create-fn-agent.test.ts`, with minor additions to `executor-step-session.test.ts` and `executor-pause.test.ts`.

Fusion-Task-Id: FN-3968
2026-05-10 23:36:10 -07:00
Fusion
9d785a7ed6 feat(FN-3816): add merger self-healing for missing workspace and environmen
Implements merger self-healing with a missing workspace entry detector, bootstrap recovery path, and environment fault retry handling, plus supporting tests for merge error recovery and verification utilities, alongside documentation updates.

Fusion-Task-Id: FN-3816
2026-05-10 23:36:10 -07:00
Fusion
bccc39f741 feat(FN-3961): propagate taskEnv into agent subprocess sessions
Propagates `taskEnv` (task-scoped environment variables) through the agent session creation pipeline, including executor sessions, spawned child agents, and workflow sessions. The engine's session factory (`agent-session-helpers.ts`), executor, PI agent creation (`pi.ts`), and step session executor

Fusion-Task-Id: FN-3961
2026-05-10 23:36:10 -07:00
Fusion
87772e1fb5 feat(FN-3767): add task runtime env injection into executor commands via pl
Adds executor runtime environment support to the plugin system, enabling plugins to contribute environment variables that get injected into executor commands. The implementation includes new plugin types (`ExecutorRuntimeEnvPlugin`), aggregation in the plugin runner, thread-through into executor com

Fusion-Task-Id: FN-3767
2026-05-10 23:36:09 -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
878fba40ab feat(FN-3960): add mesh replay outage contracts and runtime hooks
- Add core outage schema and mesh replay contract types, with CentralCore/CentralDB support for queue and snapshot persistence
- Expose runtime replay hooks in engine health monitoring and peer exchange paths to drive outage recovery flows
- Expand protocol and architecture docs for shared mesh replay behavior and finalized contract expectations
- Add regression tests across core and engine for queue sequencing, snapshot contracts, and replay integration

Fusion-Task-Id: FN-3960
2026-05-10 19:13:05 -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
49370b99c5 feat(FN-3951): fix merge recovery re-enqueue guard to prevent auto-merge lo
Hardens merge recovery logic (FN-3951) with guards against invalid state transitions during terminal merge errors, backed by new tests in `merge-error-recovery.test.ts` and `self-healing.test.ts`, and documented in the task management docs.

Fusion-Task-Id: FN-3951
2026-05-10 17:01:41 -07:00
Fusion
76c00fbadd feat(FN-3939): audit and patch PR #59 residual defects, add retry parity an
Completes FN-3939 audit work for PR #59 residual defects by refactoring the mission execution loop in the engine (halving its complexity), adding self-healing test coverage, and wiring in task workflow route improvements. Retry and validation behavior updates are documented in the changeset and skil

Fusion-Task-Id: FN-3939
2026-05-10 16:23:15 -07:00
Fusion
8e958e6879 feat(FN-3953): wire agent provisioning approval policy into engine tools
Merged agent provisioning approval policies into the engine with guard controls that restrict which agents can be created and by whom, integrated through the CLI extension and core policy definitions.

Fusion-Task-Id: FN-3953
2026-05-10 15:34:58 -07:00
Fusion
bcb4107a1a feat(FN-3932): add orphaned finalize-reset autostash safeguard in merger
The merger gains a safeguard that automatically stashes work when a finalize-reset leaves orphaned records, preventing merge-state corruption. Core exports the new orphan record type, project-engine wires the safeguard, and documentation traces the provenance flow; tests were added for the recovery

Fusion-Task-Id: FN-3932
2026-05-10 15:34:09 -07:00
Fusion
73f0318160 feat(FN-3946): add heartbeat scope guidance to agent-heartbeat
Adds heartbeat scope guidance to the agent-heartbeat module with corresponding tests, helping agents understand when and how to scope their heartbeat work.

Fusion-Task-Id: FN-3946
2026-05-10 15:34:09 -07:00
Fusion
6fc8044833 feat(FN-3940): expose github tracking controls in task detail modal
Adds GitHub tracking controls to the TaskDetailModal with corresponding test coverage, and documents the feature in the dashboard guide and task management docs.

Fusion-Task-Id: FN-3940
2026-05-10 15:33:25 -07:00
Fusion
46e5f517d9 feat(FN-3934): add restart recovery coordinator
Adds a new restart recovery coordinator (FN-3934) to manage task recovery on agent restart, including the core coordinator class, tests, and integration into the in-process runtime; also documents the coordinator in AGENTS.md.

Fusion-Task-Id: FN-3934
2026-05-10 15:33:25 -07:00
Fusion
b08a57f325 feat(FN-3931): recover triage planning model session keys in triage engine
The merge fixes triage planning model session key recovery in the engine, enabling the triage agent to properly use default model keys when resuming planning sessions. Tests were added to `triage.test.ts` to assert the correct behavior.

Fusion-Task-Id: FN-3931
2026-05-10 15:33:25 -07:00
Fusion
7e9ba31df9 feat(FN-3857): auto-recover merge deadlocks by recovering already merged ca
Adds auto-recovery for merge deadlocks when candidates have already been merged on main (FN-3857), including tests, documentation updates in AGENTS.md, and a patch changeset for the `@runfusion/fusion` package.

Fusion-Task-Id: FN-3857
2026-05-10 15:33:24 -07:00
Matthew Greenberg
b929b6fda7 fix(engine): align computeCacheHitRatio JSDoc with stored tokenUsage format 2026-05-10 16:03:32 -04:00
Matthew Greenberg
ea3299f0b9 fix(engine): remove leading newline from reviewer memorySection — buildPromptLayers handles joining 2026-05-10 16:03:32 -04:00