Commit Graph

4639 Commits

Author SHA1 Message Date
Fusion
e6889a4b32 test(FN-2142): replace engine heartbeat integration dependencies with fakes
- Add mock-only rationale comments and tighten assignment watcher typing in heartbeat tests
- Replace SQLite-backed MessageStore setup in heartbeat message-flow coverage with an in-memory fake store
- Swap assignment watcher AgentStore setup to an EventEmitter-based mock with explicit heartbeat and budget stubs
- Refactor run-audit integration tests to use an in-memory TaskStore fake for recording and filtering audit events
2026-04-19 10:13:34 -07:00
Fusion
5e31c409bd feat(FN-2133): standardize project memory path guidance to .fusion/memory/
- Update executor, reviewer, core prompt templates, and path-boundary messaging to reference the .fusion/memory/ directory instead of a single MEMORY.md file
- Broaden worktree boundary checks in pi path validation to allow .fusion/memory/ directory access from task worktrees
- Align memory backend metadata and dashboard backend labels to display file backend storage as .fusion/memory/
- Refresh core/engine tests to assert the new directory-based memory wording and boundary behavior
2026-04-19 10:13:34 -07:00
Fusion
d47694036f feat(FN-2128): merge fusion/fn-2128 2026-04-19 10:13:34 -07:00
Fusion
7ed7cf3277 refactor(FN-2132): bootstrap canonical memory before existence checks
- Run memory-layer bootstrap before backend exists checks so legacy migrations seed canonical files during upgrades
- Preserve first-run MEMORY.md scaffold creation when long-term memory was created from the default migration scaffold
- Remove legacy direct file-exists fallback from backend ensure flow and rely on backend canonical paths
- Add tests for canonical read precedence in file/qmd backends and migration-preserving project-memory bootstrap
2026-04-19 10:13:34 -07:00
Fusion
a4ce10a1c5 feat(FN-2115): add heartbeat multiplier and agent interval controls
- Add heartbeatIntervalMultiplier to shared settings schema/types with settings parity coverage
- Apply heartbeat multiplier in engine scheduling logic while preserving explicit per-agent interval behavior
- Add Settings modal and Agents view controls for heartbeat multiplier and per-agent interval overrides, including new styling
- Expand dashboard and engine test coverage for multiplier/heartbeat controls and document the new setting
2026-04-19 10:13:34 -07:00
Fusion
a70ff39e31 fix(FN-2148): use hash cache-busting and fix store teardown
- Switch PluginLoader bypass-cache imports from a query string to a hash fragment for reload-safe module differentiation
- Update inline documentation to reflect hash-based cache busting semantics in Node ESM imports
- Close AgentStore in the affected agent-store test afterEach hook to ensure cleanup alongside TaskStore teardown
2026-04-19 10:13:34 -07:00
gsxdsm
52b2d2c2f1 feat(FN-2136): merge fusion/fn-2136 2026-04-19 10:13:34 -07:00
gsxdsm
fec0dd3889 feat(FN-2127): merge fusion/fn-2127 2026-04-19 10:13:34 -07:00
Fusion
daeeb2f83d fix(FN-2143): hide empty header view overflow trigger
- Gate the view overflow trigger and menu behind a computed hasViewOverflowItems check
- Render overflow controls only when at least one of Insights, Roadmaps, Skills, or Memory is enabled
- Add Header tests covering trigger visibility for enabled and fully disabled overflow configurations
- Align App and tablet header tests to include an available overflow item when validating hidden menu entries
2026-04-19 10:13:34 -07:00
gsxdsm
f71c16cd54 feat(FN-2147): merge fusion/fn-2147 2026-04-19 10:13:34 -07:00
Fusion
95370d6299 fix(FN-2141): route reflection stores through getFusionDir
- Initialize AgentStore and ReflectionStore with taskStore.getFusionDir() in reflection APIs
- Prevent reflection endpoints from touching root-level fusion.db and agents artifacts
- Add regression coverage to ensure root project files are not created by reflection requests
2026-04-19 10:13:34 -07:00
gsxdsm
57c70fc378 feat(FN-2146): merge fusion/fn-2146 2026-04-19 10:13:34 -07:00
gsxdsm
0f167df7d4 feat(FN-2144): merge fusion/fn-2144 2026-04-19 10:13:34 -07:00
Fusion
c5918f386f fix(FN-2139): wire source export condition into CLI builds
- Add "source" export entries for @fusion/core, @fusion/dashboard, and @fusion/engine package exports
- Configure tsup/esbuild to include the "source" condition when resolving workspace dependencies
- Pass --conditions=source to bun compile so compiled CLI binaries resolve source-conditioned exports consistently
2026-04-19 10:13:34 -07:00
gsxdsm
59fbdc8dab feat(FN-2113): merge fusion/fn-2113 2026-04-19 10:13:34 -07:00
Fusion
a956ce5a4f refactor(FN-2126): align memory handling with canonical .fusion/memory paths
- Update memory docs and contracts to reference canonical .fusion/memory files while treating the legacy top-level memory file as compatibility-only
- Tighten memory backend path normalization messaging and map stale qmd legacy top-level memory results back to .fusion/memory/MEMORY.md
- Remove legacy memory read/write fallback branches from backend initialization paths and rely on ensureOpenClawMemoryFiles() migration behavior
- Preserve migration-seeded legacy content during ensureMemoryFile() bootstrap and add regression coverage for seeded long-term memory creation
2026-04-19 10:13:34 -07:00
gsxdsm
3472c122d4 feat(FN-2123): merge fusion/fn-2123 2026-04-19 10:13:34 -07:00
Fusion
9884f87208 fix(FN-2137): right-align usage modal footer actions
- Wrap the Refresh and Close footer buttons in a dedicated right-aligned action group
- Preserve existing refresh/close behavior while improving footer layout consistency
- Add .usage-actions-right styles with token-based spacing and margin-left auto
2026-04-19 10:13:34 -07:00
gsxdsm
bde0370d03 feat(FN-2135): merge fusion/fn-2135 2026-04-19 10:13:34 -07:00
Fusion
a10e4c2dfe refactor(FN-2129): route agent-instructions warnings through structured logger
- Replace direct console.warn calls in agent-instructions with createLogger("agent-instructions") warnings
- Keep existing truncation and path-validation safeguards while standardizing diagnostic output format
- Add focused diagnostics tests that verify single warning emission for truncation and invalid instructionsPath scenarios
- Add coverage for missing instructions files and project memory read failures to ensure graceful fallback behavior
2026-04-19 10:13:34 -07:00
Fusion
88c4492c1b fix(FN-2124): harden swallowed project-engine error paths
- Replace previously silent catch blocks in auto-merge and settings-listener flows with runtimeLog.warn messages
- Add warning logs for startup and periodic auto-merge sweeps plus poll interval fallback when settings reads fail
- Add regression tests that force each swallowed-error path and assert structured warnings are emitted
- Cover global/engine unpause resumeOrphaned failures and stuck-detector checkNow failures in project-engine tests
2026-04-19 10:13:34 -07:00
Fusion
4c8acea995 fix(FN-2111): select no-task heartbeat prompt by run type
- Promote HEARTBEAT_NO_TASK_SYSTEM_PROMPT as the primary no-task heartbeat constant while keeping a backward-compatible alias.
- Refine no-task heartbeat guidance for lightweight ambient coordination and explicit tool usage.
- Select the no-task prompt for heartbeat runs without task context before appending instruction/rating overlays.
- Update heartbeat regression tests to assert the renamed no-task prompt constant and prompt/tool expectations.
2026-04-19 10:13:34 -07:00
Fusion
95169722df test(FN-2125): add refresh fetch rejection regression coverage
- Add a useBackgroundSessions test for refresh fetch rejection after initial sessions load
- Assert the hook logs the expected warning with the thrown refresh error
- Verify existing sessions remain intact when refresh fails to prevent state regression
2026-04-19 10:13:34 -07:00
Fusion
9a532316cf test(FN-2122): isolate HOME for core and CLI vitest runs
- Add test setup files in core and CLI that override HOME to a per-worker temp directory
- Wire the new isolation setup into core and CLI vitest setupFiles before existing test bootstrap
- Add a core canary test to verify HOME, homedir(), and defaultGlobalDir() resolve under isolated temp paths
- Document how global HOME isolation complements per-fixture isolation in test-project utilities
2026-04-19 10:13:34 -07:00
Fusion
8e00867012 feat(FN-2121): introduce structured logging in plugin loader
- Add a reusable createLogger utility in @fusion/core for prefixed log/warn/error output
- Replace plugin-loader console logging with structured logger calls across load, reload, stop, and hook paths
- Route plugin-scoped logger methods through createLogger, including debug gating on DEBUG=plugins
- Add regression tests that mock logger.js and verify key structured log emissions and error logging flows
2026-04-19 10:13:34 -07:00
gsxdsm
eaaac2282a feat(FN-2120): merge fusion/fn-2120 2026-04-19 10:13:34 -07:00
gsxdsm
dd58a3ec43 feat(FN-2119): merge fusion/fn-2119 2026-04-19 10:13:34 -07:00
Fusion
2f611ce489 fix(FN-2107): normalize task ID handling for task creation tools
- Return the created task ID directly from runTaskPlan and propagate it through fn_task_plan
- Remove hardcoded FN-### log parsing so CLI extension supports structured IDs like PROJ-042
- Add heartbeat fallback parsing from task_create text output when details.taskId is absent
- Expand engine and CLI tests to cover structured task IDs and updated task-plan return behavior
2026-04-19 10:13:34 -07:00
Fusion
a901975ed8 feat(FN-2118): merge fusion/fn-2118 2026-04-19 10:13:33 -07:00
Fusion
11c5791622 fix(FN-2117): log swallowed engine runtime errors
- Add structured warning logs in silent catch paths for IPC worker shutdown, plugin unregistration cleanup, child runtime metrics polling, and merger build rollback reset
- Improve merger rollback warning context to make build-verification reset and retry failures easier to diagnose
- Add regression tests covering each new warning path to ensure errors are surfaced without changing existing control flow
- Add StepSessionExecutor test coverage for cherry-pick abort logging when conflict cleanup fails
2026-04-19 10:13:33 -07:00
Fusion
f947b7dc49 feat(FN-2116): add start action for terminated agent cards
- Add a Start button for terminated agents in board cards alongside Delete
- Add a Start action for terminated agents in list cards with icon + label
- Reuse the existing state transition handler to move terminated agents back to active
- Extend AgentListModal tests to cover Start button visibility and start action behavior
2026-04-19 10:13:33 -07:00
gsxdsm
46aeee0959 feat(FN-2110): merge fusion/fn-2110 2026-04-19 10:13:33 -07:00
gsxdsm
7a920249f8 feat(FN-2105): merge fusion/fn-2105 2026-04-19 10:13:33 -07:00
gsxdsm
cace54db0b feat(FN-2104): merge fusion/fn-2104 2026-04-19 10:13:33 -07:00
Fusion
bee87329da feat(FN-2030): add project markdown explorer to Documents view
- Add recursive markdown file discovery in file-service with excluded directories and sorted metadata output
- Expose GET /api/files/markdown and wire a frontend API client plus useProjectMarkdownFiles hook
- Redesign DocumentsView with project/task tabs, search, task grouping, and desktop/mobile file preview flows
- Add coverage for markdown scanning and DocumentsView behaviors, and update useDocuments tests for new API usage
2026-04-19 10:13:33 -07:00
gsxdsm
9bc570d58c feat(FN-2112): merge fusion/fn-2112 2026-04-19 10:13:33 -07:00
gsxdsm
8fdd532e91 feat(FN-2109): merge fusion/fn-2109 2026-04-19 10:13:33 -07:00
Fusion
43e123b2b3 docs(FN-2097): clarify layered memory layout and legacy fallback semantics
- Update memory architecture and contributing docs to describe .fusion/memory/ as the canonical layered workspace
- Reframe .fusion/memory.md references as a deprecated legacy fallback used only for migration/alias compatibility
- Expand the memory plugin contract with explicit layered layout, migration behavior, and invariant language
- Align settings reference memory-insight file descriptions with the canonical long-term memory model
2026-04-19 10:13:33 -07:00
gsxdsm
a78eaa21bd feat(FN-2099): merge fusion/fn-2099 2026-04-19 10:13:33 -07:00
Fusion
af104006ba feat(FN-2102): merge fusion/fn-2102 2026-04-19 10:13:33 -07:00
Fusion
ca6fefd6ca fix(FN-2098): align no-task heartbeat guidance and stabilize flaky tests
- Update HEARTBEAT_NO_TASK_SYSTEM_PROMPT copy to emphasize inbox, memory, delegation, and heartbeat_done usage
- Expand heartbeat monitor tests to assert no-task prompt/tool alignment and preserve task-scoped prompt behavior
- Harden first-run and App view tests by using a safe cwd fallback and more robust async UI waits
- Add best-effort dashboard performance reporting hooks in App and useProjects via a new reportDashboardPerf API helper
2026-04-19 10:13:33 -07:00
Fusion
d9a806f61a docs(FN-2094): align memory plugin contract with OpenClaw layout
- Rewrite memory backend contract docs to match shipped MemoryBackend interfaces, capabilities, and registry behavior
- Clarify .fusion/memory/ as the canonical layered workspace and keep .fusion/memory.md compatibility-only
- Document backend resolution through memoryBackendType with qmd as the default and qmd-to-file search fallback behavior
- Synchronize architecture, contributing, and settings reference docs with the updated memory model terminology
2026-04-19 10:13:33 -07:00
Fusion
e8dcca6e54 Remove dashboard-load timing instrumentation
The perf logs were temporary diagnostics used to identify that slow
reloads were caused by a registered remote node timing out in
/projects/across-nodes. Root cause is resolved and the short-circuit
for zero-remote setups (already committed in 7ea60382a) remains.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 10:13:33 -07:00
gsxdsm
4b448a2b40 Remove dashboard-load timing instrumentation
The perf logs were temporary diagnostics used to identify that slow
reloads were caused by a registered remote node timing out in
/projects/across-nodes. Root cause is resolved and the short-circuit
for zero-remote setups (already committed in 7ea60382a) remains.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-19 01:03:36 -07:00
Fusion
7424c843f2 feat(FN-2089): merge fusion/fn-2089 2026-04-19 01:03:36 -07:00
gsxdsm
f3de45b050 fix(teardown): improve cleanup logic to avoid shared directory deletion 2026-04-19 01:03:36 -07:00
Fusion
9d9f0ac3bd Cleanup and fix transient error detection in review 2026-04-19 01:03:36 -07:00
gsxdsm
48b53d1bdb Cleanup and fix transient error detection in review 2026-04-18 23:47:05 -07:00
gsxdsm
bc841e9bf6 test: enforce test-directory isolation across all packages
Introduce a shared test-utils module and global vitest setup that
guarantee tests never write to the real .fusion directory or leak temp
directories under /tmp.

Infrastructure:
- packages/core/src/__test-utils__/workspace.ts — tempWorkspace(),
  useIsolatedCwd(), trackForCleanup(), assertOutsideRealFusion() with
  auto-cleanup in afterEach.
- packages/core/src/__test-utils__/vitest-setup.ts — per-worker guard:
  chdirs each worker into an isolated tmp dir, wraps process.chdir to
  refuse the real .fusion, scopes tmp dirs under fusion-test-workers/
  (skips cwd change in thread-pool workers where chdir isn't supported).
- packages/core/src/__test-utils__/vitest-teardown.ts — globalSetup
  hook that wipes the shared parent even when workers are SIGKILLed.
- scripts/check-test-isolation.mjs + `test:isolated` / `test:check-
  isolation` scripts for CI.
- @fusion/test-utils alias + setupFiles + globalSetup wired into core,
  cli, engine, dashboard, tui vitest configs; matching tsconfig paths.

Test refactors (no behavior change):
- cli provider-settings, auth-paths, provider-auth — switch leaking
  mkdtempSync calls to tempWorkspace().
- core migration, first-run, store-backward-compat — replace manual
  process.chdir save/restore with useIsolatedCwd().
- tui fusion-context — replace 9 hardcoded tmp paths (collision-prone
  under parallelism) with tempWorkspace().
- dashboard useTheme, FileBrowser, TaskCard — resolve source-file reads
  against a PACKAGE_ROOT computed from import.meta.url instead of cwd,
  so tests don't depend on the process working directory.

Verified: full suite (~15,500 tests across 8 packages + plugins) passes
and the orphan-detector reports zero leaked temp directories after a
complete run.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-18 23:41:47 -07:00
gsxdsm
c77a4a572e feat(FN-2088): merge fusion/fn-2088 2026-04-18 23:22:26 -07:00