Commit Graph

81 Commits

Author SHA1 Message Date
gsxdsm
818bff7d06 fix(extensions): always prefer vendored @fusion/pi-claude-cli over external installs
When users have an external pi-claude-cli (e.g. a global `npm install -g
pi-claude-cli`, or `npm:pi-claude-cli` in ~/.pi/agent/settings.json packages),
pi's extension discovery loaded the upstream copy and shadowed our fork. The
upstream has a once-and-lock MCP-config bug that throws "Extension runtime not
initialized" during early streamSimple calls and never recovers.

Adds reconcileClaudeCliPaths in @fusion/core, used by both the daemon's
extension assembly and the engine's per-session registerExtensionProviders, to
drop any path with a `pi-claude-cli` segment that isn't our vendored fork and
prepend the vendored path. Engine resolves the fork via require.resolve and
gracefully no-ops when it isn't reachable (e.g. embedded standalone usage).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 15:25:08 -07:00
gsxdsm
79d47ddcca chore(release): v0.2.7
Version bump via changesets.
2026-04-25 11:38:48 -07:00
gsxdsm
01f3e70917 chore(release): v0.2.6
Version bump via changesets.
2026-04-25 10:21:52 -07:00
gsxdsm
ad49c32498 feat(tui+release): persist vitest memory guard, aggregate root CHANGELOG, lockstep all packages
TUI: vitest memory-guard threshold and on/off toggle now persist to
global settings (vitestAutoKillEnabled / vitestKillThresholdPct), so
they survive dashboard restarts. Stats panel shows the system-memory
used percentage next to used/free. Utilities panel exposes [+/-] to
adjust the threshold in 5% steps (50–99%).

Release: scripts/release.mjs auto-syncs a root CHANGELOG.md aggregated
from every packages/*/CHANGELOG.md, grouped by version with one
sub-block per package.

Versioning: all private @fusion/* packages joined the changesets fixed
group with the public cli + cli-alias and were aligned to 0.2.5, so
every release bumps every package and produces per-package CHANGELOG
entries that the aggregator picks up.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-25 09:09:31 -07:00
gsxdsm
2f5832e69c chore: bump pi-coding-agent + pi-ai to 0.70.0
Jumps engine, cli, and dashboard from 0.62.0 → 0.70.0. Replaces the
@sinclair/typebox 0.34.x dep with typebox@^1 (SDK migrated in 0.69).
Picks up eight releases of provider-side reliability fixes (Anthropic,
OpenAI Responses/Codex, Bedrock, OpenRouter, Kimi), Opus 4.7 adaptive
thinking support, and a uuid security bump. Code migrations follow in
subsequent commits.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-23 23:02:34 -07:00
gsxdsm
c0f9260998 feat(dashboard): bearer-token auth with browser persistence + MIT license
Pre-release polish. Two related changes bundled because they both land the
project on public-release footing:

Dashboard auth
- fn dashboard now gates the HTTP API + terminal/badge WebSockets behind a
  bearer token by default. Token resolution order: --token flag,
  FUSION_DASHBOARD_TOKEN env, FUSION_DAEMON_TOKEN env (back-compat), or an
  auto-generated fn_<32 hex>. --no-auth disables. The startup banner prints
  a click-to-open URL with ?token=<token> embedded.
- Auth middleware now also accepts fn_token=<token> as a query-string
  fallback so EventSource and WebSocket clients (which can't set custom
  headers) still authenticate.
- setupTerminalWebSocket / setupBadgeWebSocket now refuse unauthenticated
  upgrades with a proper 401 + socket close.
- Frontend: new auth.ts module captures ?token= off the URL into
  localStorage (key fn.authToken), strips it from the visible URL via
  replaceState, and installs a window.fetch wrapper that injects
  Authorization: Bearer <token> on every same-origin /api/* request.
  EventSource/WebSocket URL builders (api.ts, sse-bus.ts, useTerminal,
  useBadgeWebSocket) route through appendTokenQuery().

MIT license
- LICENSE file at repo root.
- license: "MIT" on root package.json and every packages/*/package.json,
  plus description/bugs metadata on the CLI package.

Docs
- docs/cli-reference.md documents --token / --no-auth / FUSION_DASHBOARD_TOKEN
  and the click-to-open auth flow.
- docs/getting-started.md, docs/docker.md, README.md point at the new flow
  and the CLI reference section.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 20:12:00 -07:00
Fusion
4e85969d56 perf(executor): recover approved steps on engine restart
When the engine restarts mid-step, an in-progress step may have already
passed plan + code review but not yet been flipped to done by the agent's
next task_update call. Previously, the next executor pass re-entered the
step and replayed both reviews — measured at 5-20 min of pure waste per
restart (observed in FN-2215 Step 1 and FN-2207 Step 6).

recoverApprovedStepsOnResume scans the task log for any in-progress step
whose most recent "code review Step N: APPROVE" entry is newer than its
most recent "Step N → pending" transition, and marks those steps done
before execute() runs. Safely skips steps that were reset after approval
(e.g. by a workflow revision) or only received REVISE verdicts.

Called from both the engine-restart path (resumeOrphaned) and the
unpause path, matching the two places the task log shows as vulnerable
to this race.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-21 20:12:00 -07:00
Fusion
5c8c250d14 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
0334f09d6f test: reduce default runner noise and contention 2026-04-12 13:41:10 -07:00
gsxdsm
15b27253b4 feat(FN-1269): complete routine engine integration with RoutineRunner and RoutineScheduler
- Add RoutineRunner class for routine execution via heartbeat system
- Add RoutineScheduler class for cron-based routine polling
- Add triggerManual and triggerWebhook methods for API and webhook triggers
- Wire RoutineScheduler into InProcessRuntime lifecycle
- Add routine trigger and webhook API endpoints
- Fix type mismatches between PROMPT and actual FN-1519 types
2026-04-10 12:11:55 -07:00
gsxdsm
325776b036 perf: speed up tests with parallel execution and fix type errors
- Add isolate: true to vitest configs for safe parallel test execution
- Simplify engine test script from 7 sequential runs to single parallel run
- Fix TypeScript type errors in Column, Board, WorktreeGroup, and App components
- Fix board-mobile test to match current TaskCard tap behavior
- Relax App deep-link test to handle React Strict Mode behavior
2026-04-08 23:53:14 -07:00
gsxdsm
05a00c2877 feat(FN-1040): add StepSessionExecutor for parallel step execution and integrate into executor
- Define StepSessionExecutor interfaces and utility types (FN-1039)
- Implement StepSessionExecutor class with parallel wave execution, conflict detection, and retry logic (FN-1039)
- Add comprehensive test suite for StepSessionExecutor (1225 lines) (FN-1039)
- Wire step-session execution branch into TaskExecutor with pause, stuck-kill, and global pause handlers
- Track active step executors per task for lifecycle management and cleanup
- Export StepSessionExecutor and types from engine package index
- Add executor integration tests for step session lifecycle (388 lines)
2026-04-06 22:43:31 -07:00
gsxdsm
1b98f167a0 feat(FN-978): add diagnostic logging, semaphore resilience, and executor tests
- Add structured diagnostic logging to executor, stuck-task-detector, and pi.ts with subsystem prefixes
- Add defensive guards to AgentSemaphore (limit minimum 1, invalid limit handling)
- Add comprehensive integration tests for agent execution flow (executor.test.ts)
- Add unit tests for semaphore resilience (concurrency.test.ts) and stuck-task-detector (stuck-task-detector.test.ts)
- Fix TypeScript errors in test task objects and duplicate execution test
- Document engine diagnostic logging points in AGENTS.md
2026-04-05 13:37:21 -07:00
gsxdsm
4c2be10d73 feat(FN-882): add loop detection recovery with compact-and-resume
- Add ContextLimitDetector to detect agent loops via repeated tool call patterns
- Implement compact-and-resume strategy: summarize conversation and restart agent from current step
- Add loop recovery to StuckTaskDetector with configurable attempt tracking and retry limits
- Extend executor with automatic loop recovery on context limit detection
- Add loop recovery support to pi executor with same compact-and-resume pattern
- Add comprehensive tests for context-limit-detector, stuck-task-detector loop detection, executor, and pi recovery
- Add changeset for patch bump to @gsxdsm/fusion
- Update README with loop detection and recovery documentation
2026-04-04 19:47:48 -07:00
gsxdsm
eef15f077c feat(engine): harden review pipeline with strict scope, build retry, and E2E tests
Improve the plan→review→approve→merge agent pipeline:

- Harden verdict extraction with JSON block parsing and anchored regexes
- Consolidate legacy/new merger conflict APIs into thin deprecated wrappers
- Add configurable strict scope enforcement (strictScopeEnforcement setting)
- Add build retry with timeout to merger (buildRetryCount, buildTimeoutMs)
- Add handleChangesRequested to PrCommentHandler for review feedback loop
- Remove dead code: handleFsChange, processTaskChange, unused imports/fields
- Add E2E multi-verdict sequence tests for the full review pipeline
- Fix unused parameter warnings across engine and core packages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 00:29:34 -07:00
gsxdsm
2d112e062a feat(FN-670): add mandatory build verification before merge
- Add report_build_failure tool to merger agent for explicit build failure signaling
- Run buildCommand before finalizing merge, abort if build fails with git reset --merge
- Treat build failures as fatal errors (no retry) and keep task in in-review
- Add build verification instruction to executor system prompt
- Update executor to use steeringComments field for mid-execution guidance
2026-04-01 07:28:28 -07:00
gsxdsm
c671beae96 feat(KB-503): add multi-project CLI support with project subcommands
- Add project subcommands: list, add, remove, show, set-default, detect
- Add --project flag support for all task commands
- Create project-context.ts utilities for project resolution
- Add defaultProjectId to GlobalSettings type
- Implement project auto-detection from cwd
- Update CLI argument parsing for global --project flag
- Add multi-project CLI documentation to AGENTS.md
2026-04-01 07:02:15 -07:00
gsxdsm
54767f60eb feat(KB-648): enable parallel test execution and optimize test performance
- Optimize backup tests using fake timers instead of real timeouts

- Enable parallel file execution in core, engine, CLI, and dashboard packages

- Add inline test helpers to reduce dependencies in dashboard routes tests

- Update executor tests with exact command matching and improved assertions

- Update AGENTS.md with test optimization patterns (fake timers, unique temp dirs)
2026-04-01 06:54:50 -07:00
gsxdsm
1840f17ebf feat(KB-503): add multi-project CLI support
- Add project context utilities for multi-project operations

- Add project subcommands (list, add, remove, set-default, detect)

- Update CLI argument parsing with --project flag support

- Add multi-project documentation and changeset
2026-03-31 23:28:43 -07:00
gsxdsm
4b39bf1f4c feat(KB-618): add multi-project support to dashboard
- Add project API methods and types (fetchProjects, registerProject, fetchProjectHealth, etc.)
- Add ProjectCard component with health metrics, status badges, and pause/resume actions
- Add server-side project management routes for multi-project orchestration
- Add ActivityFeed component with grouped entries and project badges
- Add SetupWizard component with 5-step project creation flow
- Fix TypeScript errors in server routes for listProjects and getGlobalConcurrencyState
2026-03-31 23:19:03 -07:00
gsxdsm
e3055f8d93 fix(KB-503): address code review feedback for Step 1
- Add optional globalDir parameter to resolveProject(), getDefaultProject(),
  setDefaultProject(), and clearDefaultProject() for test isolation
- Remove ESLint suppression by using void operator for intentionally unused var
- Update all tests to use isolated globalDir parameter
- Complete tests for default project resolution
2026-03-31 22:38:56 -07:00
gsxdsm
fc0411713c feat(KB-330): rename internal packages from @kb/* to @fusion/*
- Rename @kb/core, @kb/dashboard, @kb/engine to @fusion/* namespace
- Update all import statements across 143+ files to use new package names
- Update workspace dependencies and root package.json references
- Fix bundler configurations (tsup, vite) for new package names
- Update test files and fix typecheck issues
- Add changeset file documenting the package rename
2026-03-31 13:33:44 -07:00
gsxdsm
555cbd9ddc feat(KB-141): fix workspace type resolution and add clean-checkout typecheck tests
- Remove dist-dependent workspace type resolution from all tsconfig files

- Add clean-checkout typecheck regression test to CI suite

- Update package.json type definitions for core, engine, dashboard, and cli packages

- Update README with typecheck testing documentation

- Clean up unused test files and component dependencies
2026-03-30 08:24:16 -07:00
gsxdsm
5dba4e1524 feat(KB-134): remove planning mode checkbox and repair strict typecheck gate
- Remove PlanningModeModal checkbox functionality and related tests
- Delete NewTaskModal.test.tsx and PlanningModeModal.test.tsx
- Repair strict typecheck gate in typecheck.test.ts
- Update engine dependencies (add execa)
- Add development note about strict typecheck to dashboard README
- Clean up App.tsx and NewTaskModal.tsx planning mode code
2026-03-30 08:00:41 -07:00
gsxdsm
a53e4c1420 feat(KB-048): add collapsible list sections to dashboard
- Add section expansion state management with localStorage persistence
- Update section headers with chevron toggle controls
- Implement conditional task row rendering based on section state
- Add Expand All / Collapse All toolbar controls
- Add CSS styles for chevron rotation animation and section headers
- Add comprehensive tests for collapsible section behavior
2026-03-29 19:51:41 -07:00
Dustin Byrne
cd22c2d19a fix: mark internal packages as private, only publish @dustinbyrne/kb 2026-03-27 00:28:03 -04:00
Dustin Byrne
c802108a02 refactor(HAI-116): rename kb to hai across all packages, CLI, and docs
- Rename npm packages from @kb/* to @hai/* and update all workspace references
- Rename CLI binary from kb to hai and config directory from .kb to .hai
- Update dashboard UI branding, titles, and references from kb to hai
- Update all test files, CI workflows, and documentation to reflect new naming
- Run comprehensive grep verification to ensure no stale kb references remain
2026-03-26 22:44:11 -04:00
Dustin Byrne
a7a9e985e2 feat(HAI-108): remove binary builds and configure npm publishing
- Remove binary build steps from CI and delete release/test-release workflows
- Replace release workflow with npm publish via version.yml and changesets
- Configure all packages (cli, core, dashboard, engine) for npm publishing
- Add package-config tests to verify publishConfig and package metadata
- Update README and documentation to reflect npm-based distribution
2026-03-26 22:44:11 -04:00
Dustin Byrne
cab27b5096 fix(HAI-085): resolve TS2307/TS2339 build errors in engine package
- Add @types/node dev dependency to fix TS2307 module resolution errors
- Sort dependencies alphabetically in engine package.json
- Update pnpm-lock.yaml with new type definitions
2026-03-26 00:55:16 -04:00
Dustin Byrne
6379008a88 feat(HAI-016): complete Step 1 — create shared AgentSemaphore 2026-03-25 21:14:13 -04:00
Dustin Byrne
961203692d feat: hai board — core, dashboard, cli, engine 2026-03-25 18:32:10 -04:00