e8317e703fcf7fc962a939cb0ae6001ef80ef7bf
343 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
f21d3ce132 |
feat(core): support additive archived task documents (#2375)
## Summary Re-lands the completed Fusion board task FX-005 on current upstream `main`, stacked on #2374 (FX-004). - adds a narrowly authorized additive publication path for archived task documents - preserves archived task and mission state and keeps ordinary replacement/deletion writes rejected - exposes retained archived current/revision reads - requires project-scoped revision/hash CAS for publication - maps malformed, unauthorized, missing, inconsistent, and stale states safely - rebases preserved dashboard drafts explicitly after CAS conflicts ## Why Operators need to append a correction or evidence revision to an archived task without unarchiving it or weakening ordinary archived-task immutability. ## Dependency This branch contains #2374 plus the eight FX-005 commits because cross-fork PRs cannot target a fork-only base branch. After #2374 lands, this PR should be rebased or refreshed so its diff collapses to FX-005 only. ## Validation - PostgreSQL task-store and archived-default suites: 33/33 - dashboard route and editor suites: 321/321 - agent document tools: 22/22 - core, dashboard, and engine typechecks pass <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added optimistic concurrency controls for task document creation and editing using revisions and content hashes. * Added safe, authenticated append-only corrections for documents retained on archived tasks. * Archived documents and revision history remain available for direct reading. * Agent and dashboard tools now report conflicts clearly and support explicit draft rebasing. * **Bug Fixes** * Prevented stale updates from overwriting newer document content. * Preserved archived-task immutability while allowing controlled corrections. * **Documentation** * Updated CLI, dashboard, storage, task-management, and agent guidance for these workflows. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: fusion-merge-train <merge-train@topkoli.local> Co-authored-by: Fusion <noreply@runfusion.ai> Co-authored-by: v <v@v.speedport.ip> Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com> |
||
|
|
3a7684b90e |
refactor: package code organization wave 12 (#2362)
## Summary Behavior-preserving package code organization (wave 12), continuing after wave 11 (#2333). - **Dashboard client API peels** from `app/api/legacy.ts` into focused modules with stable re-exports: - `git.ts` — remotes, PR management, terminal sessions, git management (`withRepoPath` preserved) - `workspace-files.ts` — file browser + workspace file ops - `provider-status.ts` — auth/CLI and runtime provider status - `github-import.ts` / `gitlab-import.ts` — issue/PR import clients - `run-audit.ts` — run-audit, timeline, org tree, task review - `task-diff.ts` — task diffs and commit associations - `agent-import-generation.ts` — agent import catalog + generation - **Core types peels** from `types.ts`: - `types/run-audit.ts` - `types/planner-intervention.ts` - **Domain rename**: `task-store/remaining-ops-5.ts` → `task-store/task-id-integrity.ts` (call sites updated) - **Line-count ratchet**: `legacy.ts` ceiling ~5665 → ~3339; baseline refreshed No intentional behavior changes; public import paths via `app/api` / `@fusion/core` remain stable. ## Test plan - [x] `@fusion/core` typecheck - [x] Dashboard `tsconfig.app` typecheck (wave12-related errors cleared; pre-existing playwright/plugin env noise unchanged vs main) - [x] ESLint on peeled API modules - [x] `pnpm check:line-count` (baseline updated) - [ ] CI: Lint / Typecheck / Build / Gate <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added dashboard client support for Git remotes/PR workflows, GitHub/GitLab importing, terminals (HTTP/SSE) and PTY sessions, workspace file browsing/editing/search, and task diff viewing with file/ZIP download helpers. - Added new dashboard APIs for planning/onboarding streaming, mission interview flows, provider/auth status, dev server sessions, run-audit/timelines & task review, agent import/generation, and AI title summarization. - Added backup and settings export/import helpers, plus model discovery/usage reporting and task steering actions. - **Refactor** - Modularized dashboard API clients into focused modules while preserving the existing integration style. - **Tests** - Updated a backend-mode SQLite guidance regression test to exercise the intended implementations. - **Chores** - Refreshed internal line-count baselines. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
d1c3b63cff |
fix(dashboard): honor beta channel on Settings check for updates
Settings "Check for updates" called a legacy endpoint that only queried npm latest and ignored prerelease ordering, so beta users never saw newer X.Y.Z-beta.N releases. Route the check through channel-aware force refresh and add a beta.0 → beta.1 regression test. |
||
|
|
eef5eb751e |
FN-8453: unify concurrency accounting and indicators
Unify live-agent capacity accounting across engine and dashboard. - Derive Running and Waiting from workflow traits and durable agent liveness. - Apply unified limits to planner, executor, and merge admission while updating dashboard indicators. - Remove duplicate concurrency controls and document the unified operator model. Files changed: .changeset/fn-8453-unified-concurrency.md | 7 + docs/agent-tool-surface-full-loop.md | 4 +- docs/architecture.md | 2 +- docs/dashboard-guide.md | 4 +- docs/settings-reference.md | 4 +- .../skill/fusion/references/fusion-capabilities.md | 4 +- .../core/src/__tests__/live-agent-count.test.ts | 91 ++++---- packages/core/src/index.gate.ts | 6 + packages/core/src/index.ts | 6 + packages/core/src/live-agent-count.ts | 107 ++++++--- packages/dashboard/app/App.tsx | 28 ++- packages/dashboard/app/api/board-workflows.ts | 2 + packages/dashboard/app/components/Column.tsx | 6 +- .../dashboard/app/components/EngineControlMenu.tsx | 26 --- .../dashboard/app/components/ExecutorStatusBar.tsx | 38 ++- .../dashboard/app/components/SettingsModal.tsx | 1 - .../app/components/__tests__/Column.test.tsx | 6 +- .../__tests__/EngineControlMenu.test.tsx | 10 +- .../__tests__/ExecutorStatusBar.test.tsx | 32 ++- .../command-center/CommandCenterControls.tsx | 26 --- .../settings/sections/SchedulingSection.search.ts | 9 - .../settings/sections/SchedulingSection.tsx | 13 -- .../app/hooks/__tests__/useExecutorStats.test.ts | 12 +- packages/dashboard/app/hooks/useExecutorStats.ts | 50 ++-- .../src/__tests__/project-store-resolver.test.ts | 11 +- packages/dashboard/src/project-store-resolver.ts | 14 +- .../register-config-mcp-pi-settings-routes.ts | 3 +- packages/engine/src/__tests__/concurrency.test.ts | 123 +++++++++- .../engine/src/__tests__/project-engine.test.ts | 34 +++ packages/engine/src/__tests__/triage.test.ts | 7 +- packages/engine/src/concurrency.ts | 207 ++++++++++++++++- packages/engine/src/project-engine.ts | 151 ++++++++++-- packages/engine/src/scheduler.ts | 82 ++++++- packages/engine/src/triage.ts | 254 +++++++++++++-------- .../lib/dashboard-browser-safe-core-modules.json | 5 + 35 files changed, 991 insertions(+), 394 deletions(-) Fusion-Task-Id: FN-8453 Fusion-Task-Lineage: 12cfa5df-675d-4fce-b17e-932376544239 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
36b3180962 |
FN-8442: redesign planning mode as sequential Q&A
Guide planning through sequential question-and-answer turns before task creation. - Add plan review, refinement, validation, creation retry, and idempotent task handoff states - Atomically claim planning-session task creation and reconcile persisted task links - Replace retired multi-pane planning UI and consolidate focused flow coverage - Document the sequential planning workflow and mobile behavior Files changed: .changeset/fn-8442-planning-sequential-qa.md | 7 + MOBILE.md | 2 +- docs/dashboard-guide.md | 9 +- packages/core/src/async-ai-session-store.ts | 82 +- packages/core/src/index.ts | 4 + packages/core/src/types.ts | 5 + packages/dashboard/app/api/legacy.ts | 4 +- .../dashboard/app/components/PlanningModeModal.css | 178 +- .../dashboard/app/components/PlanningModeModal.tsx | 317 +- .../__tests__/PlanningModeModal.initial.test.tsx | 993 +---- .../PlanningModeModal.planning-flow.test.tsx | 4377 +------------------- .../PlanningModeModal.ui-interactions.test.tsx | 1276 +----- .../__tests__/planning-e2e-plan-creation.test.ts | 25 +- .../dashboard/src/__tests__/planning-infinite-interview.test.ts | 44 +- .../src/__tests__/routes-planning.test.ts | 119 +- packages/dashboard/src/ai-session-store.ts | 33 + packages/dashboard/src/planning.ts | 140 +- .../src/routes/register-planning-subtask-routes.ts | 132 +- 18 files changed, 649 insertions(+), 7098 deletions(-) Fusion-Task-Id: FN-8442 Fusion-Task-Lineage: da2f335f-b1c9-411a-8575-31db20a2b8d5 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
8c347981e4 |
FN-8439: align Planning Mode with workflow triage prompts
Planning Mode now uses the selected workflow's triage planning template with its interview adapter. - Resolve planning prompts from workflow seams and explicit overrides - Pass and persist the selected workflow for planning sessions - Document the prompt behavior and cover prompt and UI request flow Files changed: .../fn-8439-planning-prompt-triage-template.md | 7 ++ docs/dashboard-guide.md | 2 + packages/core/src/prompt-overrides.ts | 42 +----------- packages/dashboard/app/api/legacy.ts | 3 +- .../dashboard/app/components/PlanningModeModal.tsx | 3 +- .../PlanningModeModal.planning-flow.test.tsx | 10 +++ packages/dashboard/app/utils/builtinPrompts.ts | 4 +- .../__tests__/planning-prompt-resolution.test.ts | 40 ++++++++++++ packages/dashboard/src/planning.ts | 74 ++++++++++++++++++---- .../src/routes/register-planning-subtask-routes.ts | 18 ++++-- 10 files changed, 142 insertions(+), 61 deletions(-) Fusion-Task-Id: FN-8439 Fusion-Task-Lineage: 1680a0cd-27c8-47f1-8cd2-de808d1404cf Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
02e297aab5 |
FN-8433: synchronize Planning Mode interview turns
Keep Planning Mode questions, answer history, and the running plan aligned across streaming and recovery paths. - Reconcile server and client interview state after answers, retries, and missed SSE events. - Keep persisted mid-interview summaries streaming until explicit validation. - Add client and route regressions for stale question replay and reconnect behavior. Files changed: .changeset/planning-turn-sync.md | 7 + packages/dashboard/app/api/legacy.ts | 6 +- .../dashboard/app/components/PlanningModeModal.tsx | 153 +++++++++++++++++---- .../PlanningModeModal.planning-flow.test.tsx | 117 ++++++++++++++++ .../src/__tests__/routes-planning.test.ts | 68 +++++++++ .../src/routes/register-planning-subtask-routes.ts | 25 ++-- 6 files changed, 340 insertions(+), 36 deletions(-) Fusion-Task-Id: FN-8433 Fusion-Task-Lineage: d59a5b75-6ea0-4f97-83ab-ede770b4ae06 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
2fe1b996bf |
FN-8400: rework Planning Mode into a guided three-pane flow
Make planning interviews easier to navigate while keeping the evolving plan and validation actions accessible. - Show answered questions in an editable navigation pane and keep one clear next-question action. - Keep the generated plan and validation controls visible throughout planning and recovery. - Add server validation and localized copy for session title updates. Files changed: .changeset/fn-8400-planning-mode-ui.md | 7 + MOBILE.md | 2 +- docs/dashboard-guide.md | 6 +- packages/dashboard/app/api/legacy.ts | 12 +- .../dashboard/app/components/PlanningModeModal.css | 112 +++-- .../dashboard/app/components/PlanningModeModal.tsx | 408 +++++++++++-------- .../PlanningModeModal.planning-flow.test.tsx | 453 ++++++++------------- .../PlanningModeModal.ui-interactions.test.tsx | 4 +- .../src/__tests__/routes-planning.test.ts | 50 +++ packages/dashboard/src/planning.ts | 21 +- .../src/routes/register-planning-subtask-routes.ts | 26 ++ packages/i18n/locales/en/app.json | 7 +- packages/i18n/locales/es/app.json | 7 +- packages/i18n/locales/fr/app.json | 7 +- packages/i18n/locales/ko/app.json | 7 +- packages/i18n/locales/zh-CN/app.json | 7 +- packages/i18n/locales/zh-TW/app.json | 7 +- packages/i18n/src/resources.d.ts | 5 + 18 files changed, 620 insertions(+), 528 deletions(-) Fusion-Task-Id: FN-8400 Fusion-Task-Lineage: 032cf0ad-134d-4680-878f-b870eea23cc9 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
a11f789b0c |
FN-8327: fall back to issues when Discussions are disabled
Reports can select a Discussion category and reliably file to Issues when Discussions are unavailable. - Add Discussion-disabled detection across GitHub GraphQL operations. - Let report submission select a category and disclose the actual filing destination. - Preserve duplicate handling and document the fallback behavior. Files changed: .changeset/fn-8327-discussion-fallback.md | 7 +++ docs/dashboard-guide.md | 4 +- packages/dashboard/app/api/report.ts | 22 +++++-- packages/dashboard/app/components/ReportModal.tsx | 7 ++- .../app/components/__tests__/ReportModal.test.tsx | 13 ++++ .../src/__tests__/github-discussions.test.ts | 29 +++++++-- .../src/__tests__/report-pipeline.test.ts | 63 ++++++++++++++----- .../dashboard/src/__tests__/report-routes.test.ts | 15 +++-- packages/dashboard/src/github.ts | 71 ++++++++++++++++------ packages/dashboard/src/report-pipeline.ts | 54 +++++++++++----- .../dashboard/src/routes/register-report-routes.ts | 12 +++- 11 files changed, 227 insertions(+), 70 deletions(-) Fusion-Task-Id: FN-8327 Fusion-Task-Lineage: 510d3d4f-ffc9-4167-bee8-7043e0ddbd9c Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
18f1cb743a |
FN-8308: add selectable GitHub Discussions report targets
Enable configurable GitHub Issue or Discussion destinations for in-app reports. - Add report target and Discussion category settings with localized controls. - Validate target overrides before Help shortcuts and route them through report filing. - Discover and validate GitHub Discussion categories through GraphQL. - Cover target validation on both draft and file routes. Files changed: .changeset/fn-8308-report-discussions.md | 7 +++ docs/dashboard-guide.md | 7 +++ .../core/src/__tests__/settings-parity.test.ts | 9 +++ packages/core/src/index.gate.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/settings-schema.ts | 4 ++ packages/core/src/types.ts | 10 ++++ packages/dashboard/app/api/report.ts | 13 +++- packages/dashboard/app/components/ReportModal.tsx | 9 ++- .../__tests__/SettingsModal.general.test.tsx | 18 ++++++ .../settings/sections/GeneralSection.tsx | 16 ++++- .../src/__tests__/github-discussions.test.ts | 44 ++++++++++++++ .../src/__tests__/report-pipeline.test.ts | 70 +++++++++++++++++++++- .../dashboard/src/__tests__/report-routes.test.ts | 19 ++++++ packages/dashboard/src/github.ts | 37 ++++++++++-- packages/dashboard/src/index.ts | 4 +- packages/dashboard/src/report-pipeline.ts | 41 +++++++++---- .../dashboard/src/routes/register-report-routes.ts | 32 ++++++++-- packages/i18n/locales/en/app.json | 26 +++++++- packages/i18n/locales/es/app.json | 26 +++++++- packages/i18n/locales/fr/app.json | 26 +++++++- packages/i18n/locales/ko/app.json | 26 +++++++- packages/i18n/locales/zh-CN/app.json | 26 +++++++- packages/i18n/locales/zh-TW/app.json | 26 +++++++- 24 files changed, 453 insertions(+), 47 deletions(-) Fusion-Task-Id: FN-8308 Fusion-Task-Lineage: f5ac1b67-ecbc-4765-88c7-c524c7e943bf Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
e4a032d9d9 |
FN-8399: expose incomplete migration status on dashboard
Expose durable SQLite-to-PostgreSQL migration state through dashboard health and banners. - Read per-project running and failed migration markers from PostgreSQL - Surface degraded migration state in health endpoints and dashboard banners - Preserve migration context across CLI and runtime startup paths - Document the recovery workflow and add a patch changeset Files changed: .changeset/FN-8399-migration-status-dashboard.md | 7 +++ docs/storage.md | 5 ++ packages/cli/src/commands/daemon.ts | 19 +++++++ packages/cli/src/commands/desktop.ts | 6 +++ packages/cli/src/commands/serve.ts | 20 +++++++- packages/core/src/index.ts | 2 + packages/core/src/postgres/index.ts | 2 + packages/core/src/postgres/sqlite-migrator.ts | 43 ++++++++++++++++ packages/dashboard/app/api/health.ts | 7 ++- .../app/components/dashboard/DashboardBanners.tsx | 18 ++++++- .../dashboard/__tests__/DashboardBanners.test.tsx | 12 ++++- .../__tests__/dashboard-postgres-health.test.ts | 45 +++++++++++++++++ .../dashboard/src/dashboard-postgres-health.ts | 58 ++++++++++++++++++++++ packages/dashboard/src/server.ts | 27 ++++++++-- packages/engine/src/project-engine-manager.ts | 4 ++ packages/engine/src/project-runtime.ts | 9 +++- packages/engine/src/runtimes/in-process-runtime.ts | 1 + 17 files changed, 275 insertions(+), 10 deletions(-) Fusion-Task-Id: FN-8399 Fusion-Task-Lineage: e196d6c4-ea9a-48ba-bedc-9e6fa44c33d3 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
a9c7a6bcc0 |
FN-8371: store report screenshot artifacts
Store opted-in report screenshots as validated local artifacts rather than GitHub attachments. - Add multipart report attachment upload with PNG/JPEG validation and provenance metadata. - Carry validated artifact references through report drafts and filing flows without binary egress. - Update report UI, tests, documentation, and release metadata. Files changed: .changeset/report-screenshot-artifacts.md | 7 + docs/dashboard-guide.md | 2 +- packages/core/src/index.gate.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/types.ts | 7 + packages/dashboard/app/api/report.ts | 14 +- packages/dashboard/app/components/ReportModal.css | 3 +- packages/dashboard/app/components/ReportModal.tsx | 41 ++--- .../app/components/__tests__/ReportModal.test.tsx | 58 +++++-- packages/dashboard/app/utils/report-capture.ts | 47 ++---- .../src/__tests__/report-pipeline.test.ts | 94 ------------ .../dashboard/src/__tests__/report-routes.test.ts | 123 +++++++++++---- packages/dashboard/src/report-pipeline.ts | 128 +++------------- .../dashboard/src/routes/register-report-routes.ts | 169 +++++++-------------- 14 files changed, 279 insertions(+), 418 deletions(-) Fusion-Task-Id: FN-8371 Fusion-Task-Lineage: 48d0e94d-602f-43e2-a63f-cb497221ac29 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
da1e445d6b |
FN-8310: add public-roadmap report deduplication
Add public-roadmap issues as a configurable, reviewable deduplication source for in-app reports. - Resolve roadmap settings across project, global, and tracking-repository fallbacks - Search and endorse matching open roadmap issues before filing duplicate reports - Expose and index roadmap controls with localized default descriptions Files changed: .changeset/fn-8310-public-roadmap-dedupe.md | 7 ++ docs/dashboard-guide.md | 2 +- docs/settings-reference.md | 4 +- .../core/src/__tests__/settings-parity.test.ts | 14 +++- packages/core/src/settings-schema.ts | 7 +- packages/core/src/types.ts | 13 +++- packages/dashboard/app/api/report.ts | 2 +- packages/dashboard/app/components/ReportModal.tsx | 18 ++--- .../dashboard/app/components/SettingsModal.tsx | 15 +++- .../app/components/__tests__/ReportModal.test.tsx | 12 ++-- .../__tests__/SettingsModal.general.test.tsx | 6 +- .../settings/__tests__/section-keys.test.ts | 5 +- .../app/components/settings/save-split.ts | 14 ++-- .../app/components/settings/section-keys.ts | 5 ++ .../settings/sections/GeneralSection.search.ts | 34 ++++++--- .../settings/sections/GeneralSection.tsx | 29 ++++++-- .../sections/SourceControlGlobalSection.search.ts | 27 +++++++ .../sections/SourceControlGlobalSection.tsx | 55 ++++++++++---- .../settings-default-descriptions.test.tsx | 4 +- .../src/__tests__/report-pipeline.test.ts | 73 ++++++++++++------- .../dashboard/src/__tests__/report-routes.test.ts | 23 +++--- packages/dashboard/src/report-pipeline.ts | 84 ++++++++++++++-------- .../dashboard/src/routes/register-report-routes.ts | 9 +-- packages/i18n/locales/en/app.json | 17 ++++- packages/i18n/locales/es/app.json | 17 ++++- packages/i18n/locales/fr/app.json | 17 ++++- packages/i18n/locales/ko/app.json | 17 ++++- packages/i18n/locales/zh-CN/app.json | 16 ++++- packages/i18n/locales/zh-TW/app.json | 16 ++++- 29 files changed, 409 insertions(+), 153 deletions(-) Fusion-Task-Id: FN-8310 Fusion-Task-Lineage: 0efa8d76-e849-4256-bdcd-e9d6dd612e41 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
48b3656bde |
refactor: package code organization wave 11 (#2333)
## Summary Wave 11 of package code organization (continues #2328 / wave 10), after syncing main into the wave10 stack. ### Peels | New module | Parent | |---|---| | `app/api/event-source.ts` | resilient `EventSource` reconnect + pagehide cleanup | | `app/api/chat.ts` | chat sessions / rooms / streaming | | `app/api/projects.ts` | multi-project management client | | `app/api/agents.ts` | agent CRUD / soul / memory | | `app/api/workflows.ts` | workflow definition client | | `app/api/scheduling.ts` | automations + routines | | `app/api/ai-text.ts` | text refine / import translate / subtasks | | `app/api/ai-sessions.ts` | AI / planning session client + `startKeepAlive` | | `app/api/research.ts` | research + evals client | | `task-store/branch-and-pr-entities.ts` | rename of `remaining-ops-6` | Public paths stay stable via `legacy.ts` re-exports (`app/api.ts` → `legacy`). ### LOC - `legacy.ts` ~8921 → ~5670 ### Shims - `legacy.ts` → peels above (delete-when: dashboard imports domain modules) - `remaining-ops-6` → `branch-and-pr-entities` (rename complete) ## Test plan - [x] eslint on peeled API modules + legacy - [x] dashboard app typecheck (`app/api/*` clean) - [x] core typecheck - [x] `plugin-setup-api` tests - [ ] CI merge gate <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Expanded dashboard APIs for agents, AI sessions, chat rooms/sessions, research runs, projects, workflows, routines/automations, and scheduling. * Added AI text refinement/translation, planning title regeneration, and streamed subtask breakdown with task creation. * Introduced resilient server-sent-events streaming for chat and other live updates. * Added workflow export/import and workflow design support, plus scripts and workflow configuration controls. * Added research export and ability to attach research outputs to tasks. * **Enhancements** * Missions support clearing an auto-merge override back to project defaults. * Subtasks can now include an optional priority when creating tasks. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
3bf7f92be0 |
refactor: package code organization wave 10 (#2328)
## Summary Wave 10 of package code organization (plan: `docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`), after #2274. ### Peels | New module | Parent | |---|---| | `types/agents.ts` | `types.ts` (permissions, Agent entity, ratings, reflections, heartbeat run types) | | `app/api/missions.ts` | `legacy.ts` (hierarchy, assertions, validation, autopilot) | | `app/api/messaging.ts` | `legacy.ts` (mailbox, approvals, reflections/ratings, budget) | | `app/api/plugins-and-skills.ts` | `legacy.ts` | | `app/api/todo.ts` | `legacy.ts` | | `app/api/insights.ts` | `legacy.ts` | | `app/api/system-panel.ts` | `legacy.ts` | | `task-store/workflow-definitions.ts` | rename of `remaining-ops-8` | Mission interview SSE streams stay in `legacy.ts` until `createResilientEventSource` is shared. Public paths stay stable via re-exports. ### LOC - `types.ts` ~7101 → ~6165 - `legacy.ts` ~10273 → ~8913 ### Shims - `types.ts` → `types/agents.ts` (delete-when: consumers import agents domain directly) - `legacy.ts` → peels above (delete-when: dashboard imports domain modules) - `remaining-ops-8` → `workflow-definitions` (rename complete) ## Test plan - [x] `@fusion/core` typecheck - [x] eslint on peeled dashboard API modules - [x] `pnpm check:line-count` - [x] `agent-permissions` + `agent-permission-policy` tests - [x] `plugin-setup-api` tests - [ ] CI merge gate <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added typed dashboard API support for missions, milestones/features, validation loops, and autopilot. * Added insights browsing and management, including run triggering. * Added messaging/mailboxes and approvals, plus agent reflections, ratings, and budget controls. * Added plugins & skills management and discovery. * Added todo lists and items with reordering. * Added system monitoring controls: rebuilds/restarts, logs, and research finding promotion. * **Improvements** * Centralized agent-related type contracts for safer browser consumption. * Enhanced legacy API compatibility and improved AI session deletion error handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
38891bfd81 |
FN-8296: add chat-requested task verification
Enable chat agents to queue and monitor executor-owned verification runs. - Persist task verification requests through a new PostgreSQL migration. - Expose action-gated chat request and status tools with executor processing. - Show verification status in task and Command Center views. - Advance the schema baseline to migration 0024 and keep chat mocks complete. Files changed: .changeset/fn-8296-feature.md | 7 ++ docs/agent-tool-surface-full-loop.md | 10 +-- docs/dashboard-guide.md | 4 + packages/core/src/index.ts | 2 + .../core/src/postgres/migrations/0000_initial.sql | 20 +++++ .../migrations/0024_task_verification_request.sql | 20 +++++ packages/core/src/postgres/schema-applier.ts | 13 ++- packages/core/src/postgres/schema/project.ts | 25 ++++++ packages/core/src/store.ts | 16 +++- packages/core/src/task-store/reads.ts | 14 +++- packages/core/src/task-store/remaining-ops-6.ts | 49 ++++++++++- packages/core/src/types.ts | 30 +++++++ packages/dashboard/app/api/legacy.ts | 1 + packages/dashboard/app/api/task-content.ts | 10 +++ .../dashboard/app/components/TaskDetailModal.tsx | 17 +++- .../app/components/TaskVerificationStatus.css | 94 ++++++++++++++++++++++ .../app/components/TaskVerificationStatus.tsx | 39 +++++++++ .../__tests__/TaskVerificationStatus.test.tsx | 28 +++++++ .../components/command-center/CommandCenter.css | 33 ++++++++ .../components/command-center/CommandCenter.tsx | 37 ++++++++- packages/dashboard/src/__tests__/chat.test.ts | 1 + packages/dashboard/src/chat.ts | 55 +++++++++++++ .../src/routes/register-command-center-routes.ts | 20 +++++ .../src/routes/register-task-workflow-routes.ts | 17 ++++ packages/engine/src/executor.ts | 51 +++++++++++- packages/engine/src/gating-classifications.ts | 5 ++ packages/engine/src/index.ts | 2 +- 27 files changed, 605 insertions(+), 15 deletions(-) Fusion-Task-Id: FN-8296 Fusion-Task-Lineage: f94647cf-c89f-4f0e-b25f-cbf5b56683bc Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
e2b5532290 |
FN-8288: add native structure preview foundation
Provide reusable, typed previews for native dashboard structures. - Define five-kind native structure references and preview payloads. - Add project-scoped preview resolution API with unavailable states and capped excerpts. - Add a callback-driven inline preview card, tests, documentation, and release note. Files changed: .changeset/fn-8288-native-structure-preview.md | 7 ++ docs/dashboard-guide.md | 4 + packages/core/src/index.gate.ts | 2 +- packages/core/src/index.ts | 1 + packages/core/src/types.ts | 54 ++++++++++ packages/dashboard/app/api/legacy.ts | 1 + packages/dashboard/app/api/task-content.ts | 13 ++- .../app/components/NativeStructurePreview.css | 61 +++++++++++ .../app/components/NativeStructurePreview.tsx | 115 +++++++++++++++++++++ .../__tests__/NativeStructurePreview.test.tsx | 102 ++++++++++++++++++ packages/dashboard/src/native-structure-preview.ts | 88 ++++++++++++++++ .../native-structure-preview-routes.test.ts | 102 ++++++++++++++++++ .../src/routes/register-task-workflow-routes.ts | 23 +++++ 13 files changed, 571 insertions(+), 2 deletions(-) Fusion-Task-Id: FN-8288 Fusion-Task-Lineage: 1a4ce369-9f9e-4a45-b533-2d53b5f1020c Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
4cc8002c97 |
FN-8341: rework planning interviews for reactive validation
Make planning interviews user-controlled and context-aware from validation through task creation. - Replace fixed-depth and deepening checkpoints with reactive follow-up questions - Add explicit planning validation and require it before creating or breaking down work - Expose validation through the API, CLI, routes, types, documentation, and release notes - Update localized copy and PlanningModeModal mocks and assertions for the revised workflow Files changed: .changeset/fn-8341-deepening-checkpoint-removal.md | 7 + .changeset/fn-8341-planning-reactive-backend.md | 7 + docs/dashboard-guide.md | 8 +- packages/cli/src/commands/task.ts | 12 +- packages/core/src/index.gate.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/types.ts | 38 +- packages/dashboard/app/api/legacy.ts | 15 +- .../dashboard/app/components/PlanningModeModal.tsx | 192 +----- .../__tests__/PlanningModeModal.autosize.test.tsx | 4 + .../__tests__/PlanningModeModal.initial.test.tsx | 50 +- .../PlanningModeModal.planning-flow.test.tsx | 442 +------------ .../__tests__/PlanningModeModal.test-helpers.ts | 1 + .../PlanningModeModal.ui-interactions.test.tsx | 3 + .../__tests__/planning-infinite-interview.test.ts | 221 +++++++ packages/dashboard/src/planning.ts | 711 ++++++--------------- .../src/routes/register-planning-subtask-routes.ts | 64 +- packages/i18n/locales/en/app.json | 1 - packages/i18n/locales/es/app.json | 1 - packages/i18n/locales/fr/app.json | 1 - packages/i18n/locales/ko/app.json | 1 - packages/i18n/locales/zh-CN/app.json | 1 - packages/i18n/locales/zh-TW/app.json | 1 - 23 files changed, 536 insertions(+), 1249 deletions(-) Fusion-Task-Id: FN-8341 Fusion-Task-Lineage: 102f88af-2675-43f5-8e08-5403a0e17da8 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
7e7c3c999b |
FN-8317: add reviewed report screenshots and activity traces
Capture optional report context while preserving scrubbed text-first filing.\n\n- Add browser screenshot capture, review, validation, and compensating upload cleanup.\n- Include bounded activity traces in report drafts and filing flows.\n- Preserve roadmap deduplication and document report privacy behavior.\n\nFiles changed:\n .changeset/fn-8317-report-context.md | 7 + docs/dashboard-guide.md | 4 +- packages/dashboard/app/api/report.ts | 15 +- packages/dashboard/app/components/ReportModal.css | 5 +- packages/dashboard/app/components/ReportModal.tsx | 52 +++---- .../app/components/__tests__/ReportModal.test.tsx | 14 ++ packages/dashboard/app/hooks/useViewState.ts | 7 + .../app/utils/__tests__/report-capture.test.ts | 17 +++ packages/dashboard/app/utils/report-capture.ts | 47 +++++++ packages/dashboard/package.json | 1 - .../src/__tests__/report-pipeline.test.ts | 100 +++++++++++++- .../dashboard/src/__tests__/report-routes.test.ts | 17 +++ .../dashboard/src/__tests__/report-scrub.test.ts | 8 ++ packages/dashboard/src/github.ts | 107 +++++++++++++++ packages/dashboard/src/report-pipeline.ts | 152 ++++++++++++++++----- packages/dashboard/src/report-scrub.ts | 8 ++ .../dashboard/src/routes/register-report-routes.ts | 103 ++++++-------- pnpm-lock.yaml | 129 +++++++++-------- 18 files changed, 590 insertions(+), 203 deletions(-) Fusion-Task-Id: FN-8317 Fusion-Task-Lineage: 9d200cee-cf69-4827-9e1e-f7789adf09e0 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
c95e08ea21 |
FN-8297: add research finding promotion to mission features
Bridge completed research findings into durable mission roadmap features. - Persist stable finding and citation provenance on mission features - Add idempotent promotion APIs, dashboard controls, and agent tooling - Document the promotion flow and cover finding identity and feature synchronization Files changed: .changeset/fn-8297-research-mission-bridge.md | 7 ++++ docs/missions.md | 4 +++ docs/research.md | 4 +++ .../__tests__/research-finding-identity.test.ts | 15 +++++++++ packages/core/src/async-mission-store-queries.ts | 26 +++++++++++++++ packages/core/src/async-mission-store.ts | 16 +++++++++ packages/core/src/index.gate.ts | 3 ++ packages/core/src/index.ts | 3 ++ packages/core/src/mission-types.ts | 13 ++++++++ .../core/src/postgres/migrations/0000_initial.sql | 4 +++ .../0023_research_feature_provenance.sql | 8 +++++ packages/core/src/postgres/schema-applier.ts | 13 +++++++- packages/core/src/postgres/schema/project.ts | 5 +++ packages/core/src/research-feature-promotion.ts | 38 ++++++++++++++++++++++ packages/core/src/research-types.ts | 21 ++++++++++++ packages/core/src/types.ts | 1 + packages/dashboard/app/api/legacy.ts | 21 ++++++++++++ packages/dashboard/app/components/ResearchView.tsx | 19 ++++++----- packages/dashboard/app/hooks/useResearch.ts | 3 ++ packages/dashboard/src/chat.ts | 4 +-- packages/dashboard/src/research-routes.ts | 37 +++++++++++++++++---- .../src/__tests__/agent-mission-tools.test.ts | 14 +++++++- .../src/__tests__/mission-feature-sync.test.ts | 20 ++++++++++++ packages/engine/src/agent-tools.ts | 26 +++++++++++++++ packages/engine/src/mission-feature-sync.ts | 1 + 25 files changed, 308 insertions(+), 18 deletions(-) Fusion-Task-Id: FN-8297 Fusion-Task-Lineage: ffef4d26-1372-466a-8d3d-2b9b5cc9a53b Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
ca7bc3e46e |
refactor: package code organization wave 9 (#2274)
## Summary Wave 9 of package code organization (plan: `docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`), after #2252. ### Peels | New module | Parent | |---|---| | `app/api/global-and-pi-settings.ts` | `legacy.ts` | | `app/api/task-content.ts` | `legacy.ts` (attachments/logs/comments/docs/artifacts) | | `types/messages.ts` | `types.ts` | | `merger-diff-volume-gate` helpers | `merger.ts` | Public paths stay stable via re-exports. ### LOC - `legacy.ts` ~10561 → ~10269 - `types.ts` ~6998 → ~6937 - `merger.ts` ~11223 → ~11208 ## Test plan - [x] core/engine/dashboard typecheck (app) - [x] eslint on peeled modules - [x] api-tasks + memory/agent-log focused tests - [ ] CI merge gate <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added dashboard API endpoints for global and project-scoped settings, PI configuration, notification testing, and PI package install/reinstall. * Added task content APIs covering attachments, agent logs, session files, task comments, task documents, artifacts, and project markdown files. * Added structured messaging contracts and participant/message normalization. * Added diff-volume gate settings resolution and formatted findings output. * **Refactor** * Organized messaging and dashboard API surface into dedicated modules via re-exports. * Removed a deprecated verification-output alias. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
02ee8a4fd5 |
fix: hide stale task-card oversight icons (#2318)
## Summary Task cards now remove the overseer eye as soon as their workflow's effective oversight becomes `off`, instead of reusing an active value cached before the setting changed. The invalidation covers card remounts as well as mounted cards, and authoritative writes from the dashboard, agents, and configuration rollback reach the board through the existing project-scoped SSE stream. Older in-flight responses cannot restore the eye after a newer `off` value wins, while unrelated workflow-setting saves leave active indicators undisturbed. ## Validation - 99 focused dashboard regression tests passed across selected and aggregate cards, desktop and mobile, SSE delivery, and out-of-order responses - Core and dashboard typechecks passed - `pnpm lint` and `pnpm check:changesets` passed - `pnpm verify:fast` passed production builds and the CLI/server boot smoke <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **Bug Fixes** - Planner-overseer eye badges now disappear immediately when workflow oversight is turned off. - Prevented stale or out-of-order updates from displaying incorrect oversight status. - Oversight indicators now remain hidden when the effective setting cannot be confirmed. - Live workflow setting changes now update task cards without requiring a page refresh. - **Documentation** - Clarified eye badge visibility rules, tooltip meaning, and active oversight states in the dashboard guide. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
88b0db0f4d |
FN-8309: add report screenshot and activity capture
Add opt-in local screenshot attachments and scrubbed activity traces to reports. - Capture, preview, confirm, and locally retain report screenshots without GitHub egress. - Include bounded activity traces in draft and filing context with server-side validation. - Add report pipeline coverage, documentation, and release metadata. Files changed: .changeset/fn-8309-report-capture.md | 7 ++ docs/dashboard-guide.md | 2 + packages/dashboard/app/App.tsx | 10 ++ packages/dashboard/app/api/report.ts | 16 ++- packages/dashboard/app/components/ReportModal.css | 3 + packages/dashboard/app/components/ReportModal.tsx | 45 ++++++- .../app/utils/__tests__/activity-trace.test.ts | 19 +++ packages/dashboard/app/utils/activity-trace.ts | 37 ++++++ packages/dashboard/app/utils/capture-screenshot.ts | 22 ++++ packages/dashboard/package.json | 5 +- .../src/__tests__/report-pipeline.test.ts | 13 +++ packages/dashboard/src/report-pipeline.ts | 29 ++++- packages/dashboard/src/routes.ts | 2 +- .../dashboard/src/routes/register-report-routes.ts | 85 +++++++++++++- packages/dashboard/src/routes/types.ts | 4 +- pnpm-lock.yaml | 129 ++++++++++----------- 16 files changed, 341 insertions(+), 87 deletions(-) Fusion-Task-Id: FN-8309 Fusion-Task-Lineage: db9c14a6-1721-4e81-8891-cfd301473cd0 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
e8c37b076e |
FN-8277: add in-app agentic reporting
Add guided in-app reporting that safely files or endorses GitHub issues and discussions. - Add report actions, modal UI, API routes, and configurable per-action filing modes. - Scrub report payloads, self-check Help requests, and deduplicate before filing or endorsing. - Extend GitHub discussion support and cover the report pipeline with tests and documentation. Files changed: .changeset/fn-8277-agentic-reports.md | 7 + docs/dashboard-guide.md | 8 + docs/settings-reference.md | 2 + .../core/src/__tests__/settings-parity.test.ts | 9 + packages/core/src/index.gate.ts | 2 +- packages/core/src/index.ts | 2 +- packages/core/src/settings-schema.ts | 2 + packages/core/src/types.ts | 10 + packages/dashboard/app/api.ts | 1 + packages/dashboard/app/api/report.ts | 11 + packages/dashboard/app/components/Header.tsx | 30 +++ .../dashboard/app/components/ReportActionMenu.css | 6 + .../dashboard/app/components/ReportActionMenu.tsx | 22 ++ packages/dashboard/app/components/ReportModal.css | 6 + packages/dashboard/app/components/ReportModal.tsx | 81 ++++++++ .../app/components/__tests__/Header.test.tsx | 7 +- .../components/__tests__/ReportActionMenu.test.tsx | 18 ++ .../app/components/__tests__/ReportModal.test.tsx | 94 +++++++++ .../__tests__/SettingsModal.general.test.tsx | 15 ++ .../settings/sections/GeneralSection.tsx | 31 ++- .../src/__tests__/report-pipeline.test.ts | 127 ++++++++++++ .../dashboard/src/__tests__/report-routes.test.ts | 51 +++++ .../dashboard/src/__tests__/report-scrub.test.ts | 47 +++++ packages/dashboard/src/github.ts | 151 +++++++++++++- packages/dashboard/src/index.ts | 3 + packages/dashboard/src/report-help-selfcheck.ts | 13 ++ packages/dashboard/src/report-pipeline.ts | 225 +++++++++++++++++++++ packages/dashboard/src/report-scrub.ts | 66 ++++++ packages/dashboard/src/routes.ts | 2 + .../dashboard/src/routes/register-report-routes.ts | 118 +++++++++++ 30 files changed, 1156 insertions(+), 11 deletions(-) Fusion-Task-Id: FN-8277 Fusion-Task-Lineage: d50dc1da-7534-4324-ab05-1f8a0ad77c6a Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
69e7a34077 |
FN-8273: add mission auto-merge overrides
Allow operators to override project auto-merge behavior for each mission. - Add create and update API support for mission auto-merge overrides, including clearing inherited behavior. - Expose inherited, auto-merge, and single-pull-request choices in all mission forms. - Apply disabled mission auto-merge to newly triaged tasks and cover storage, API, and UI behavior. - Document the override and add a CLI changeset. Files changed: .changeset/fn-8273-mission-auto-merge.md | 7 ++ docs/missions.md | 4 + .../mission-store.sync-auto-merge.test.ts | 22 ++++ .../__tests__/postgres/mission-store.pg.test.ts | 35 ++++++ packages/core/src/async-mission-store.ts | 5 + packages/core/src/mission-store.ts | 5 + packages/dashboard/app/api/legacy.ts | 4 +- .../dashboard/app/components/MissionManager.tsx | 55 +++++++++ .../__tests__/MissionManager.auto-merge.test.tsx | 132 +++++++++++++++++++++ packages/dashboard/app/components/mission-types.ts | 2 + packages/dashboard/src/mission-routes.ts | 18 ++- .../routes/__tests__/mission-autoMerge-e2e.test.ts | 66 +++++++++++ 12 files changed, 351 insertions(+), 4 deletions(-) Fusion-Task-Id: FN-8273 Fusion-Task-Lineage: d24d7c22-5a14-4446-b3e1-c35b2f0480c3 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
7c23771433 |
FN-8265: add task follow-up proposal creation
Enable configured ephemeral workers to propose and create follow-up tasks from mailbox messages. - Add persisted task-proposal claim state, migrations, and async messaging APIs. - Register task-proposal creation routes, SSE events, agent tool support, and CLI integration. - Add mailbox creation controls, settings, documentation, localization, and regression coverage. Files changed: .changeset/fn-8265-task-follow-up-policy.md | 7 ++ docs/dashboard-guide.md | 2 +- docs/settings-reference.md | 12 ++- packages/cli/src/extension.ts | 34 ++++--- .../src/__tests__/postgres/sqlite-migrator.test.ts | 14 ++- .../postgres/task-proposal-claim.pg.test.ts | 51 +++++++++++ packages/core/src/async-message-store.ts | 39 ++++++++ packages/core/src/index.gate.ts | 4 +- packages/core/src/index.ts | 4 +- packages/core/src/message-store.ts | 46 ++++++++++ .../core/src/postgres/migrations/0000_initial.sql | 2 + .../migrations/0020_task_proposal_claim.sql | 4 + packages/core/src/postgres/schema-applier.ts | 13 ++- packages/core/src/postgres/schema/project.ts | 3 + packages/core/src/settings-schema.ts | 19 +++- packages/core/src/task-store/async-persistence.ts | 2 +- packages/core/src/task-store/persistence.ts | 4 +- packages/core/src/task-store/serialization.ts | 1 + packages/core/src/task-store/task-creation.ts | 51 +++++++++++ packages/core/src/task-store/task-row-mappers.ts | 2 +- packages/core/src/types.ts | 56 +++++++++++- packages/dashboard/app/api/legacy.ts | 5 + packages/dashboard/app/components/MailboxModal.tsx | 4 + .../app/components/MailboxTaskProposal.css | 3 + .../app/components/MailboxTaskProposal.tsx | 33 +++++++ packages/dashboard/app/components/MailboxView.tsx | 4 + .../__tests__/MailboxTaskProposal.test.tsx | 43 +++++++++ .../app/components/settings/section-keys.ts | 2 +- .../settings/sections/GeneralSection.search.ts | 13 ++- .../settings/sections/GeneralSection.tsx | 22 +++-- .../settings-default-descriptions.test.tsx | 4 +- .../routes/__tests__/task-proposal-routes.test.ts | 99 ++++++++++++++++++++ .../src/routes/register-messaging-scripts.ts | 101 +++++++++++++++++++++ packages/dashboard/src/sse.ts | 7 ++ packages/engine/src/agent-tools.ts | 30 ++++-- packages/engine/src/executor.ts | 9 +- packages/engine/src/step-session-executor.ts | 8 +- packages/i18n/locales/en/app.json | 5 + 38 files changed, 696 insertions(+), 66 deletions(-) Fusion-Task-Id: FN-8265 Fusion-Task-Lineage: 4e864a2f-3485-4a54-8be7-1699b5479a94 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
c7b1529ef8 |
feat(dashboard,core): warn before project creation when git is missing
Registering a project on a git-less host used to fail after submission with a raw spawn error. The setup wizard now probes gitCli up front and offers: open the Git downloads (picked up without restart thanks to the stale-PATH resolver), create the project anyway without a git repo (new skipGitInit passthrough, rejected for clone mode), or cancel. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
0b6c4cd4ca |
feat(dashboard,desktop): show live database-migration progress during boot
The one-time SQLite→PostgreSQL migration runs inside createTaskStoreForBackend before any HTTP server listens, so browsers saw "connection refused" and open tabs failed silently for minutes. Now: - CLI: a temporary holding server binds the dashboard port for the boot window, serving an auto-reloading "Database migration in progress" page and an /api/health payload with status "migrating" + structured progress; the port is handed off (awaited) to the real app.listen(). - Dashboard SPA: already-open tabs render the new MigrationInProgressBanner from the 15s health poll when status is "migrating". - Desktop: LocalRuntimeManager publishes migration progress on DesktopRuntimeStatus via the new core onMigrationProgress option; DesktopLaunchGate shows the live label and extends its 30s startup timeout while progress advances (2min stall cap), in both boot and first-run flows. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
9152d8fa61 |
FN-8229: remove background AI tasks pill
Replace the redundant footer AI session control with progress and action visibility in the session notification banner. - Delete the BackgroundTasksIndicator component, styles, footer wiring, and obsolete translations. - Surface non-planning generating and retained error sessions through the notification banner while leaving Planning in its dedicated view. - Update session lifecycle, localization, documentation, and regression coverage. Files changed: .../fn-8229-remove-ai-background-tasks-pill.md | 7 + docs/dashboard-guide.md | 4 +- packages/dashboard/README.md | 1 - packages/dashboard/app/App.tsx | 28 +-- .../app/__tests__/css-hygiene-scan.test.ts | 2 - .../dashboard-component-color-tokenization.test.ts | 1 - packages/dashboard/app/api/legacy.ts | 2 +- .../app/components/BackgroundTasksIndicator.css | 130 ------------- .../app/components/BackgroundTasksIndicator.tsx | 210 --------------------- .../dashboard/app/components/ExecutorStatusBar.css | 3 - .../dashboard/app/components/ExecutorStatusBar.tsx | 30 +-- .../app/components/SessionNotificationBanner.css | 10 + .../app/components/SessionNotificationBanner.tsx | 52 ++++- .../app/components/SubtaskBreakdownModal.tsx | 7 +- .../app/components/__tests__/App.test.tsx | 11 +- .../__tests__/ExecutorStatusBar.test.tsx | 1 - .../__tests__/SessionNotificationBanner.test.tsx | 88 ++++----- .../components/__tests__/utility-mobile.test.tsx | 191 +------------------ .../app/components/dashboard/DashboardBanners.tsx | 8 +- .../dashboard/__tests__/DashboardBanners.test.tsx | 30 ++- .../hooks/__tests__/useBackgroundSessions.test.ts | 21 ++- .../dashboard/app/hooks/useBackgroundSessions.ts | 21 ++- .../app/utils/__tests__/appLifecycle.test.ts | 61 ++---- packages/dashboard/app/utils/appLifecycle.ts | 16 +- packages/dashboard/src/routes.ts | 2 +- packages/i18n/locales/en/app.json | 33 +--- packages/i18n/locales/es/app.json | 44 ++--- packages/i18n/locales/fr/app.json | 44 ++--- packages/i18n/locales/ko/app.json | 44 ++--- packages/i18n/locales/zh-CN/app.json | 44 ++--- packages/i18n/locales/zh-TW/app.json | 44 ++--- packages/i18n/src/resources.d.ts | 48 ++--- 32 files changed, 316 insertions(+), 922 deletions(-) Fusion-Task-Id: FN-8229 Fusion-Task-Lineage: a232fb04-08ff-4f0a-a440-e94545243e61 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
86c281bc38 |
FN-8215: add GitHub issue comment posting
Enable operators to post upstream GitHub issue comments from the Import Tasks preview. - Add authenticated GitHub CLI and REST fallback support for creating issue comments. - Expose a validated API route and inline issue-comment composer with optimistic preview updates. - Add localized UI copy, documentation, release metadata, and coverage for client, route, and modal behavior. Files changed: .changeset/fn-8215-github-issue-add-comment.md | 7 ++ docs/dashboard-guide.md | 9 ++- packages/dashboard/app/api/legacy.ts | 13 ++++ .../dashboard/app/components/GitHubImportModal.css | 34 +++++++++ .../dashboard/app/components/GitHubImportModal.tsx | 68 +++++++++++++++++- .../__tests__/GitHubImportModal.test.tsx | 62 +++++++++++++++++ packages/dashboard/src/__tests__/github.test.ts | 48 +++++++++++++ .../dashboard/src/__tests__/routes-github.test.ts | 80 ++++++++++++++++++++++ packages/dashboard/src/github.ts | 49 +++++++++++++ .../dashboard/src/routes/register-git-github.ts | 56 +++++++++++++++ packages/i18n/locales/en/app.json | 5 ++ packages/i18n/locales/es/app.json | 5 ++ packages/i18n/locales/fr/app.json | 5 ++ packages/i18n/locales/ko/app.json | 5 ++ packages/i18n/locales/zh-CN/app.json | 5 ++ packages/i18n/locales/zh-TW/app.json | 5 ++ packages/i18n/src/resources.d.ts | 5 ++ 17 files changed, 459 insertions(+), 2 deletions(-) Fusion-Task-Id: FN-8215 Fusion-Task-Lineage: 0fe6acca-e86d-484f-a97f-5746d32717a1 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
da7c68c1dc |
refactor: package code organization wave 8 (#2252)
## Summary Wave 8 of package code organization (plan: `docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`), after #2166. ### Peels | New module | Parent | |---|---| | `app/api/board-workflows.ts` | `legacy.ts` | | `app/api/remote.ts` | `legacy.ts` | | `app/api/memory.ts` | `legacy.ts` | | `types/docker-nodes.ts` | `types.ts` | | `task-store/task-store-helpers.ts` | `remaining-ops-10.ts` (rename) | ### CI fix (main unblocker) FN-8142 requires pi SDK **0.80.8+** (`ModelRuntime`, `CredentialStore.list`). Floored `@earendil-works/pi-*` to `^0.80.8` so lockfile resolves past 0.80.6. Public import paths stay stable via re-exports. ### LOC - `legacy.ts` ~10975 → ~10561 - `types.ts` ~7349 → ~6928 ## Test plan - [x] core / dashboard typecheck + eslint on peels - [x] api-tasks (66) - [x] CI merge gate (Lint / Typecheck / Build / Gate) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added dashboard support for multi-lane board workflows, including workflow metadata retrieval and task custom-field updates. * Added dashboard memory client capabilities for reading/writing memory, managing memory files, compaction/dreaming, insights, auditing, backend status, and retrieval testing. * Added remote connectivity controls, including tunnel start/stop, provider activation, token generation, URL sharing, and QR generation. * Added Docker node configuration validation plus secure redaction for sensitive fields in responses. * **Improvements** * Consolidated dashboard API exports into dedicated modules and preserved the legacy API surface via re-exports. * **Chores** * Updated related agent dependency versions. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
e72629c251 |
FN-8126: add per-task merger model controls
Enable Quick Add and task editing to select merger models and thinking levels. - Persist merger model and thinking overrides through task APIs, storage, and PostgreSQL migrations. - Add merger-lane selection controls to Quick Add and model settings interfaces. - Apply task merger settings to merger and PR fallback sessions, with regression coverage. - Document the merger lane and include a release changeset. Files changed: .changeset/fn-8126-quick-add-merger-lane.md | 7 ++ docs/dashboard-guide.md | 2 + docs/settings-reference.md | 7 +- .../core/src/__tests__/model-resolution.test.ts | 9 ++ packages/core/src/index.gate.ts | 1 + packages/core/src/index.ts | 1 + packages/core/src/model-resolution.ts | 20 ++++ .../core/src/postgres/migrations/0000_initial.sql | 3 + .../migrations/0017_task_merger_model_lane.sql | 4 + packages/core/src/postgres/schema-applier.ts | 14 ++- packages/core/src/postgres/schema/project.ts | 3 + packages/core/src/store.ts | 2 +- .../core/src/task-store/archive-lifecycle-2.ts | 6 ++ packages/core/src/task-store/persistence.ts | 6 ++ packages/core/src/task-store/remaining-ops-2.ts | 4 +- packages/core/src/task-store/remaining-ops-6.ts | 2 +- packages/core/src/task-store/serialization.ts | 6 ++ packages/core/src/task-store/task-creation.ts | 6 ++ packages/core/src/task-store/task-row-mappers.ts | 4 +- packages/core/src/task-store/task-update.ts | 6 ++ packages/core/src/types.ts | 18 ++++ packages/dashboard/app/api/tasks.ts | 13 +++ .../dashboard/app/components/InlineCreateCard.tsx | 33 ++++++- .../app/components/ModelSelectionModal.tsx | 29 ++++++ .../dashboard/app/components/ModelSelectorTab.tsx | 101 +++++++++++++++++++-- .../dashboard/app/components/QuickEntryBox.tsx | 44 +++++++-- .../__tests__/ModelSelectionModal.test.tsx | 20 ++++ .../components/__tests__/ModelSelectorTab.test.tsx | 37 +++++++- .../src/routes/register-task-workflow-routes.ts | 27 +++++- .../src/__tests__/agent-session-helpers.test.ts | 8 ++ packages/engine/src/agent-session-helpers.ts | 16 +++- packages/engine/src/merger-ai.ts | 14 +-- packages/engine/src/merger.ts | 35 ++++--- packages/engine/src/pr-response-run-ops.ts | 7 +- 34 files changed, 451 insertions(+), 64 deletions(-) Fusion-Task-Id: FN-8126 Fusion-Task-Lineage: 3fc81801-6d77-4e11-9cf0-3af37313930e Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
fd036665ae |
FN-8123: add agent clarification notifications
Add agent clarification notices with ntfy delivery and mailbox support. - Add configurable clarification ntfy topics and notification settings - Route agent clarification requests to ntfy and the planning mailbox - Update planning dialogs, translations, documentation, and regression tests Files changed: .changeset/fn-8123-agent-clarification.md | 7 + docs/dashboard-guide.md | 6 + docs/settings-reference.md | 1 + .../core/src/__tests__/global-settings.test.ts | 11 + packages/core/src/settings-schema.ts | 2 + packages/core/src/types.ts | 6 + .../app/__tests__/settings-save-split.test.ts | 13 ++ packages/dashboard/app/api/legacy.ts | 3 +- .../dashboard/app/components/PlanningModeModal.tsx | 29 ++- .../dashboard/app/components/SettingsModal.tsx | 1 + .../__tests__/PlanningModeModal.initial.test.tsx | 17 +- .../app/components/settings/save-split.ts | 1 + .../settings/sections/NotificationsSection.tsx | 11 + .../src/__tests__/routes-planning.test.ts | 7 +- packages/dashboard/src/planning.ts | 228 ++++++++++++++++----- .../src/routes/register-planning-subtask-routes.ts | 59 +++++- packages/i18n/locales/en/app.json | 4 + packages/i18n/src/resources.d.ts | 4 + 18 files changed, 346 insertions(+), 64 deletions(-) Fusion-Task-Id: FN-8123 Fusion-Task-Lineage: cf397749-01c6-44d6-8d12-8ce7f5627c29 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
06a5fd813d |
refactor: package code organization waves 6–7 (#2166)
## Summary Waves 6–7 of package code organization (plan: `docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`), after #2148. ### Wave 6 | New module | Parent | |---|---| | `merger-autostash-labels.ts` | `merger.ts` | | `types/agent-state.ts` | `types.ts` | | `app/api/tasks-lifecycle.ts` | `legacy.ts` | | `task-store/task-row-mappers.ts` | `remaining-ops-3.ts` (rename) | ### Wave 7 | New module | Parent | |---|---| | `self-healing-optional-step-revision.ts` | `self-healing.ts` | | `self-healing-path-utils.ts` | `self-healing.ts` | | `merger-git-parse` (+ `quoteArg`, `getBranchChangedFiles`) | `merger.ts` | | `app/api/settings.ts` | `legacy.ts` | Public import paths stay stable via re-exports. ## Test plan - [x] engine + dashboard typecheck (incl. app) - [x] eslint on touched modules - [x] merger-autostash / parse-porcelain / getBranchChanged / api-tasks - [ ] CI merge gate <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added a dedicated task lifecycle API client (task promotion, merge, retry/reset/duplicate, pause/unpause, archive/unarchive, revert, plan approve/reject) plus branch-group and planner oversight actions. * Added a settings/config API service (effective task settings, update check/refresh/install). * Introduced standardized agent lifecycle states with identity/ephemeral detection helpers. * **Bug Fixes** * Improved autostash label compatibility and NUL-delimited changed-file detection for branch diffs. * **Refactor** * Modularized merger labeling/parsing, self-healing helpers, and lifecycle/type wiring while keeping behavior consistent. * **Tests** * Updated merger verification tests for `git diff -z` output handling. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
4df5c62854 |
FN-8133: add local codebase context metrics
Expose local codebase token estimates and apparent disk size in the project dashboard. - Add a bounded, cached, symlink-safe codebase metrics service and project API. - Display token and disk indicators across Command Center overview states. - Add formatting, route, UI, and metric calibration coverage with a minor changeset. Files changed: .changeset/fn-8133-codebase-metrics.md | 7 + docs/dashboard-guide.md | 2 +- .../dashboard/app/__tests__/api-projects.test.ts | 12 ++ packages/dashboard/app/api/legacy.ts | 14 ++ .../components/command-center/CommandCenter.css | 5 + .../components/command-center/CommandCenter.tsx | 65 +++++++-- .../CommandCenter.mobile-chart-layout.test.ts | 4 + .../__tests__/CommandCenter.test.tsx | 10 ++ .../__tests__/SystemStatsArea.test.tsx | 8 + .../command-center/areas/SystemStatsArea.tsx | 8 +- .../app/utils/__tests__/formatBytes.test.ts | 18 +++ packages/dashboard/app/utils/formatBytes.ts | 11 ++ .../src/lib/__tests__/codebase-metrics.test.ts | 62 ++++++++ .../lib/__tests__/fixtures/token-corpus/README.md | 17 +++ .../fixtures/token-corpus/calibration/component.ts | 1 + .../fixtures/token-corpus/calibration/config.json | 1 + .../lib/__tests__/fixtures/token-corpus/example.ts | 1 + .../lib/__tests__/fixtures/token-corpus/notes.md | 3 + .../fixtures/token-corpus/reference-counts.json | 9 ++ .../__tests__/fixtures/token-corpus/settings.json | 1 + .../lib/__tests__/fixtures/token-corpus/view.tsx | 1 + packages/dashboard/src/lib/codebase-metrics.ts | 161 +++++++++++++++++++++ .../__tests__/codebase-metrics-route.test.ts | 34 +++++ .../src/routes/register-project-routes.ts | 19 +++ 24 files changed, 456 insertions(+), 18 deletions(-) Fusion-Task-Id: FN-8133 Fusion-Task-Lineage: d591636b-d4b8-469e-8788-c4516eeb8405 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
3b6bfeee46 |
FN-8109: import PR comments as resolve feedback tasks
Enable GitHub comment imports to create independent resolve-feedback tasks. - Add comment import controls, status feedback, and client API support - Create validated GitHub comment tasks with quoted feedback and provenance - Label pull request imports as resolve-feedback work and document the workflow Files changed: docs/dashboard-guide.md | 4 +- packages/dashboard/app/api/legacy.ts | 20 ++++++ .../dashboard/app/components/GitHubImportModal.css | 35 +++++++++ .../dashboard/app/components/GitHubImportModal.tsx | 82 +++++++++++++++++++--- .../__tests__/GitHubImportModal.test.tsx | 56 +++++++++++++++ .../dashboard/src/__tests__/routes-github.test.ts | 73 +++++++++++++++++++ .../dashboard/src/routes/register-git-github.ts | 48 ++++++++++++- 7 files changed, 304 insertions(+), 14 deletions(-) Fusion-Task-Id: FN-8109 Fusion-Task-Lineage: bdb4477b-31b4-4e01-8439-b72437ff692d Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
e87b51bd07 |
FN-8054: add pinned chat conversations
Add durable, scoped pinning for Direct chat conversations. - Add pinned session persistence, migration coverage, and archive-safe row locking. - Enforce a three-conversation per-project pin limit through the chat API. - Add desktop and mobile pin controls, sorting, indicators, and regression tests. Files changed: .changeset/fn-8054-pin-conversations.md | 7 ++ docs/dashboard-guide.md | 2 + .../postgres/satellite-db-injected-stores.test.ts | 13 ++++ packages/core/src/async-chat-store.ts | 27 ++++++++ packages/core/src/chat-store.ts | 63 ++++++++++++++++-- packages/core/src/chat-types.ts | 9 +++ .../core/src/postgres/migrations/0000_initial.sql | 1 + .../postgres/migrations/0012_chat_session_pins.sql | 8 +++ packages/core/src/postgres/postgres-health.ts | 3 + packages/core/src/postgres/schema-applier.ts | 30 ++++++++- packages/core/src/postgres/schema/project.ts | 3 + packages/dashboard/app/api/legacy.ts | 1 + packages/dashboard/app/components/ChatView.css | 32 +++++++++- packages/dashboard/app/components/ChatView.tsx | 74 ++++++++++++++++++++-- .../dashboard/app/hooks/__tests__/useChat.test.ts | 21 ++++++ packages/dashboard/app/hooks/useChat.ts | 72 +++++++++++++++++---- .../dashboard/src/routes/register-chat-routes.ts | 25 +++++++- 17 files changed, 366 insertions(+), 25 deletions(-) Fusion-Task-Id: FN-8054 Fusion-Task-Lineage: 088cb01c-582b-4f56-a222-214da90ff356 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
9a34862586 |
refactor: package code organization waves 3–5 (#2148)
## Summary Waves 3–5 of package code organization (plan: `docs/plans/2026-07-14-001-refactor-package-code-organization-plan.md`). Behavior-preserving peels after #2139 and #2143. ### Wave 3 — Merger + heartbeat recovery - **`merger-errors.ts`** — verification/abort error classes - **`merger-owned-landed.ts`** — ownership classification + `Fusion-Task-Id` trailer - **`merger-conflict-resolution.ts`** — conflict classify/auto-resolve - **`agent-heartbeat-error-recovery.ts`** — durable error-recovery budget helpers ### Wave 4 — Self-healing + dashboard API - **`self-healing-constants.ts`** — public timing/budget constants - **`self-healing-branch.ts`** — `isBranchAheadOfBase` - **`app/api/client.ts`** — `api` / `ApiRequestError` / `buildApiUrl` / `proxyApi` - **`app/api/health.ts`** — health, engine status, updates + `withProjectId` ### Wave 5 — Types tracking + merger parse + task CRUD - **`types/task-tracking.ts`** — PR/issue/GitHub/GitLab tracking contracts - **`merger-git-parse.ts`** — `parseFailingFilesFromOutput`, `parsePorcelainZ`, `parseShortstatSummary` - **`app/api/tasks.ts`** — task list/detail/create/update/move client surface - Line-count baselines ratcheted down for `merger.ts`, `types.ts`, `legacy.ts` Public import paths stay on parent modules / `legacy.ts` / package barrels via re-exports. ## Test plan - [x] core/engine/dashboard typecheck (including `tsconfig.app.json`) - [x] eslint on touched modules - [x] `parse-porcelain-z` + merger parseFailing/getBranchChanged tests - [x] dashboard `api-tasks` + legacy-prinfo/pr-types (69) - [ ] CI merge gate <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Added dashboard API support for task listing/detail, archiving, creation, review updates, duplicate detection, bulk model updates, moving tasks, and overlap repair. - Added health/engine status and refresh/start controls, plus update checking. - **Bug Fixes** - Improved dashboard API handling for non-JSON/HTML responses with clearer errors, better URL routing for remote nodes, and project-scoped queries. - Strengthened automated recovery for heartbeat error/model-unavailable scenarios and safer merge-conflict classification/auto-resolution. - **Tests** - Updated merge-conflict resolution and lifecycle test mocks to match the updated git command behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
80f202831d |
FN-7994: keep planning session sidebar populated during load
Speed up Planning mode session-list load so the sidebar never blanks while history refreshes. - Seed the planning sidebar from already-loaded active sessions via initialSessions - Filter GET /ai-sessions and store listAll by optional type=planning to skip non-planning payloads - Show skeleton rows while the first authoritative session refresh is in flight - Wire type through client fetchAiSessions, dashboard AiSessionStore, and core listAllAiSessions - Add UI and route coverage for seeded/skeleton load and type-filtered listing - Ship patch changeset for the operator-facing performance fix Files changed: .changeset/FN-7994-planning-sidebar-fast-load.md | 7 +++ packages/core/src/async-ai-session-store.ts | 7 ++- packages/dashboard/app/App.tsx | 1 + packages/dashboard/app/api/legacy.ts | 3 +- .../dashboard/app/components/PlanningModeModal.css | 48 ++++++++++++---- .../dashboard/app/components/PlanningModeModal.tsx | 27 ++++++++- .../PlanningModeModal.planning-flow.test.tsx | 65 ++++++++++++++++++++++ .../app/components/dashboard/MainContent.tsx | 2 + .../dashboard/app/components/dashboard/types.ts | 2 + .../src/__tests__/routes-planning.test.ts | 29 ++++++++++ packages/dashboard/src/ai-session-store.ts | 2 +- packages/dashboard/src/routes.ts | 16 +++++- 12 files changed, 201 insertions(+), 8 deletions(-) Fusion-Task-Id: FN-7994 Fusion-Task-Lineage: 7c4cf98d-6dfe-4b9b-bc88-62257ed39507 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
5ff7a20738 |
FN-7976: fix mailbox artifact open and view-task popups
Fix Mailbox/Artifacts media auth and ensure View task always opens a usable popup. - Add artifactMediaUrlWithToken for authenticated img/video/audio/link loads while keeping artifactMediaUrl token-free for fetch and HTML previews - Load script-capable HTML artifact previews via Authorization + revocable blob URL so tokens never reach allow-scripts iframes - Keep non-board/list task popups (Mailbox, Documents) visible even when board/list-only popup gating is enabled - Upgrade duplicate popOut entries so reopening a task refreshes snapshot and origin - Document the behavior and add a patch changeset Files changed: .changeset/fn-7976-mailbox-artifact-fixes.md | 7 +++ docs/dashboard-guide.md | 2 +- packages/dashboard/app/App.tsx | 15 +++-- .../app/__tests__/App.taskPopupViewGating.test.tsx | 10 ++- .../dashboard/app/__tests__/api-artifacts.test.ts | 12 +++- .../api/__tests__/legacy-artifact-media.test.ts | 27 ++++++++ packages/dashboard/app/api/legacy.ts | 21 +++++-- .../dashboard/app/components/ArtifactsGallery.tsx | 72 ++++++++++++++++++---- .../dashboard/app/components/DocumentsView.tsx | 4 +- .../app/components/MailboxArtifactAttachment.tsx | 6 +- .../dashboard/app/components/TaskDocumentsTab.tsx | 6 +- .../components/__tests__/DocumentsView.test.tsx | 31 ++++++---- .../__tests__/MailboxArtifactAttachment.test.tsx | 24 ++++---- .../app/components/__tests__/MailboxView.test.tsx | 8 +-- .../components/__tests__/TaskDocumentsTab.test.tsx | 16 ++--- .../app/hooks/__tests__/usePoppedOutTasks.test.ts | 9 ++- packages/dashboard/app/hooks/usePoppedOutTasks.ts | 17 +++-- 17 files changed, 206 insertions(+), 81 deletions(-) Fusion-Task-Id: FN-7976 Fusion-Task-Lineage: 4c25b3a6-5836-4629-b33e-647f213e3261 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai> |
||
|
|
329fc1f664 |
fix(dashboard): authenticate artifact media URLs (#2144)
## Summary - append the existing same-origin daemon token fallback to artifact media URLs used by image, video, and link navigation - preserve project scoping and artifact ID encoding - add a focused regression test and patch changeset ## Root cause Artifact metadata loads through authenticated `fetch`, but previews and links use raw browser navigation (`<img src>`, `<video src>`, and anchors), which cannot attach the dashboard bearer header. The media endpoint therefore returned `401 Valid bearer token required` even though the dashboard itself was authenticated. ## Verification - `pnpm --filter @fusion/dashboard exec vitest run --project dashboard-app-quality-foundation-api app/__tests__/api-artifacts.test.ts --reporter=dot` - `pnpm lint` - `pnpm --filter @fusion/dashboard typecheck` - `pnpm check:changesets --strict` - `pnpm build` - `FUSION_PG_TEST_URL_BASE=postgresql://plarson@127.0.0.1:55432 VITEST_MAX_WORKERS=1 nix shell nixpkgs#postgresql --command pnpm test:gate` The broader dashboard foundation API shard was also attempted but aborted in Node after repeated unmanaged-file-descriptor warnings; the focused regression and canonical merge gate both pass. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed protected artifact images and links so they load correctly in authenticated dashboards. * Added authentication tokens to generated artifact media URLs for reliable previews and navigation. * **Tests** * Added coverage verifying authenticated artifact media URLs include the expected token and parameters. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
0863c0fb58 |
feat(dashboard): auto-translate foreign-language GitHub issues on import (#2141)
## Why The Import Tasks panel routinely lists issues in languages the operator cannot read. Translation already shipped in #2128, but deliberately **opt-in and preview-only** — its header comment read *"Translation is opt-in (never automatic) so import provenance stays faithful until the operator asks."* This reverses that decision **behind a default-off setting**, so operators who never opt in keep byte-faithful import provenance. The superseded comment is kept and annotated rather than deleted, so the reason the rule changed stays in the code. ### The structural gap #2128 left `POST /github/issues/import` accepts only `{owner, repo, issueNumber}` and **re-fetches the issue server-side**. A translation held in React state could never reach the created task, and the in-memory cache died with the modal. That is why the cache here is server-side rather than in the hook — it's what makes "imported issues carry the translated version" actually true. ## What operators get Auto-translate is **off by default**. When enabled: - The **50 most recent OPEN** foreign-language issues translate on panel load — **list titles**, not just the preview, so the list reads in your language before you click anything. - Translations show **by default**, with a toggle back to the original (hover a translated list title to see the original). - Translations **persist until the issue closes**, so re-opening the panel neither waits nor re-bills. - **Both single and batch import** carry the translation, so the created task reads like the preview you approved. - A **target language** setting (unset = follow the dashboard language) and a dedicated **model lane**, so you can pin a cheap/fast model without dragging the summarization lane onto it. ## Notable decisions | Decision | Why | |---|---| | Detect **before** the model | An issue already in the target language is never sent. Without this, an English repo with the setting on would bill every issue to return its input unchanged. | | Detection moved to `@fusion/core` | The panel and the server must not disagree about which issues are foreign; two copies of a heuristic drift. | | Own rate-limit budget | Translation shared a 10/hour budget with refine/goal-draft. Fanning out per-issue would fail partway **and** starve refine for the hour. | | Cache keyed on a **source hash** | An edited issue misses the cache and re-translates instead of serving stale prose. | | Import is **cache-read only** | A miss imports the original. Import must never block on, or fail because of, translation. | | `project_id` leads the cache PK + full RLS contract | All projects share one flat `project` schema. `verification_cache`'s PK predates that discipline; this table does not copy that mistake. | ## Verification - ✅ `pnpm lint`, `@fusion/core` + `@fusion/dashboard` typecheck - ✅ `pnpm verify:fast` — build + scoped typecheck + real boot smoke (`/api/health`) - ✅ `pnpm test:gate` — 479 tests - ✅ 19 new tests covering the billing invariants (off/closed/same-language ⇒ **no model call**), cache hit/miss-on-edit, the 50 cap, and per-item fail-soft - ✅ `schema-applier` real-Postgres suite (46 tests) exercises migration `0010` and its isolation invariant **Pre-existing failures NOT touched** (confirmed red on `HEAD` before this branch): `AppearanceSection`'s task-popup test, and two PG-cutover keys (`sqliteMigrationNotice`, `postgresMigrationInboxMessageSentAt`) missing description mappings. I left the latter rather than guess an allowlist entry that could mask a real coverage gap. ## Reviewer notes - Short Latin-script prose (a one-line Spanish title) rates only *medium* confidence and won't auto-translate — the existing heuristic is deliberately conservative so English issues are never billed. CJK detects regardless of length. The threshold is the knob if you'd rather bias toward translating. - The RLS/isolation contract in migration `0010` is the part most worth a careful look. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> |
||
|
|
4d78f9641b |
feat(dashboard): build/link local fn and npm restore from System panel
Add Command Center System controls for source/dev hosts to build the standalone fn binary and install it as the default PATH binary, switch back to the global npm install, and force-check for published updates. Build jobs stream into the shared job log and scroll that view into focus. |
||
|
|
bc2d22df6e |
feat(dashboard): offer AI translation in Import Tasks preview (#2128)
## Summary Import Tasks can now offer on-demand AI translation when a selected GitHub or GitLab issue/PR title and body appear to be in a different language than the active dashboard locale. - Detect foreign-language content with a conservative client heuristic (Unicode scripts + Latin stopwords) - Show an opt-in banner: **Translate**, then **Show original / Show translation**, plus **Dismiss** - Call new `POST /api/ai/translate-text` (shared AI-helper rate limit with refine/draft) - Translation is **display-only** in the preview; imported task text stays the original source language ## Why Operators working in a non-English dashboard (or reading non-dashboard-language issues) needed a way to understand import candidates without leaving the preview or changing what gets imported. ## Test plan - [x] Unit tests for language detection (`detectContentLanguage`) - [x] Unit tests for translate request validation, response parsing, and AI agent path - [x] GitHub import modal: French content shows translate controls; English content does not - [x] Dashboard typecheck clean for app + server packages - [ ] Manual: open Import Tasks with dashboard language English, select a French/Korean issue, translate and toggle original - [ ] Manual: confirm Import still creates the task with original title/body - [ ] Manual: dismiss banner for a selection and confirm it stays dismissed for that item ## Notes - Comments are not translated (title + body only) - zh-CN / zh-TW share a CJK family so Chinese content does not prompt translation when the UI is either Chinese locale - Secondary locale catalogs have empty placeholders for the new `git.translate*` keys (runtime falls back to English) |
||
|
|
a242f1b449 |
fix(FN-7952): migrate bundled plugins to PostgreSQL (#2111)
## Summary Bundled plugins now persist shared runtime state in project-scoped PostgreSQL tables instead of maintaining independent SQLite authority. Reports, CLI Printing Press, Compound Engineering, Roadmap, Even Realities, and WhatsApp all follow the same ownership and startup contract as Fusion core. ## Design decisions - Plugin schema hooks run through the host’s PostgreSQL owner and enforce project isolation. - The SDK exposes the host contract needed by bundled plugins without importing engine internals. - Legacy Roadmap ownership fixtures use the supported empty-owner sentinel, preserving current composite primary/foreign keys while exercising backfill behavior. - The lockfile travels with the Even Realities PostgreSQL dependency so packaged installs remain reproducible. ## Validation - All six affected plugin builds pass. - Affected plugin suites pass: 773 tests across Printing Press, Compound Engineering, Even Realities, Reports, Roadmap, and WhatsApp. - `pnpm test:gate` passes all 478 gate tests. - This PR changes 40 files. ## Stack - Depends on #2110 → #2109 → #2108. - The documentation/release PR completes the stack. Related: #2105 <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Breaking Changes** * PostgreSQL is now required for runtime storage; SQLite files are used only as one-time migration inputs. * The legacy `FUSION_NO_EMBEDDED_PG` fallback has been removed. * **New Features** * Added project-isolated PostgreSQL storage for plugins, reports, tasks, notifications, and other plugin data. * Added agent tools for reports and CLI service drafts. * Added PostgreSQL schema initialization support for plugin authors. * **Bug Fixes** * Improved migration and recovery of legacy plugin state. * Prevented cross-project data access and strengthened transactional schema updates. * **Documentation** * Updated storage, migration, deployment, plugin authoring, CLI, and dashboard guidance for PostgreSQL. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
4f037679ad |
feat: planner overseer session advisor (OMP advisor parity) (#2082)
## Summary Adds a **session advisor** to the planner overseer so Fusion can review live executor transcripts the way [oh-my-pi’s advisor](https://github.com/can1357/oh-my-pi/tree/main/packages/coding-agent/src/advisor) does — without replacing the existing lifecycle supervisor (stage watch, retry, merge confirmation, human-control withhold). ### What ships - **Emission guard** (`OverseerEmissionGuard`) — content-free phrase filter, session dedupe with severity-rank escalation, one accept per advisor update - **Session delta runtime** — queues agent-log deltas, drains through an advisor agent, drops backlog after 3 failures - **Session advisor service** — model gate, level matrix (`observe` / `steer` / `autonomous`), human-control re-check at inject, `[session-advisor]` steering comments - **OVERSEER.md / WATCHDOG.md** discovery for project review priorities - **AgentLogger `onEntriesFlushed`** + poll-backed agent-log cursor for durable deltas - Workflow settings: `plannerOverseerAdvisorProvider` + `plannerOverseerAdvisorModelId` (both required; empty = soft-disabled for cost safety) - Docs + changeset ### What does not ship (deferred) - Multi-advisor YAML roster, mutating advisor tools, reviewer/merger shadowing, true tool-abort interrupt ### Plan `docs/plans/2026-07-13-001-feat-overseer-advisor-parity-plan.md` ## Enablement 1. Set workflow **Session advisor model provider** + **Session advisor model id** 2. Oversight level `observe` (log only), `steer`, or `autonomous` (inject) 3. Optional: add `OVERSEER.md` or `WATCHDOG.md` in the project ## Test plan - [x] `pnpm --filter @fusion/core exec vitest run src/__tests__/overseer-emission-guard.test.ts` - [x] `pnpm --filter @fusion/engine exec vitest run` overseer-* unit tests (21 tests) - [x] Related planner-overseer / intervention regression tests - [x] `@fusion/engine` + `@fusion/core` typecheck - [ ] Manual: configure advisor model, run an executor task, confirm `[session-advisor]` inject + timeline metadata when concern is raised ## Residual Review Findings None from autofix pass (log-cursor ordering fix already committed). <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an off-by-default “session advisor” that can review live execution activity and provide severity-based guidance. * Added project and per-task controls to enable it, including a default enable switch and Quick Add / Task Detail toggles. * Enhanced advisor prompting by discovering and incorporating `OVERSEER.md`/`WATCHDOG.md` review files. * **Documentation** * Added architecture and settings documentation for the new session-advisor parity behavior. * **Bug Fixes** * Improved fail-soft handling so advisor behavior won’t disrupt execution. * Fixed concurrent PostgreSQL migration startup failures. * **Tests** * Added coverage for advice parsing, emission guarding, runtime behavior, and watchdog discovery. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
cdf67c1d98 |
fix(dashboard): stop Planning Mode retry loop, make AI sessions multi-tab (#2101)
## Problem Reported: planning gets stuck in a cycle of retrying and regenerating after a response was already supplied. After the user answers a planning question, `submitResponse` pushed the answer to history but left `session.currentQuestion` pointing at the just-answered question for the whole next generation. The planning SSE route's catch-up path re-emits `currentQuestion` to every fresh connection — and each FN-7946 auto-retry (#2073) opens a fresh connection. So after any generation error: 1. Auto-retry connects a fresh stream → the server re-emits the **already-answered** question. 2. The client treats any question event as progress: it **resets the 3-attempt auto-retry budget** and re-shows the answered question. 3. The retry regenerates; if it errors again the cycle repeats with a fresh budget — an unbounded retry/regenerate loop. Re-answering the stale question also 409-collided with the in-flight generation, feeding the same loop. ## Fix Invariant: `currentQuestion` is only set while the session is genuinely awaiting user input. - `submitResponse` clears it the moment an answer is accepted (normal turns and the deepening checkpoint), while preserving the legacy 200 respond contract on generation failure (the modal ignores the body and lets the SSE error drive recovery). - `retrySession` scrubs stale questions persisted by pre-fix builds before regenerating. - `buildSessionFromRow` only restores a question when the persisted row is `awaiting_input`. - `didSubmitSameAnswer` now compares against the last history entry so the duplicate-submit 409 message survives. - Agent onboarding gets the same fix (its SSE route also re-emits `currentQuestion` on connect); retry now asks the next question instead of re-asking the answered one. Surface enumeration: mission and milestone interviews keep questions the same way but their SSE routes never re-emit on connect, and the auto-retry budget machinery is Planning-Mode-only — planning + onboarding were the two affected surfaces. ## Symptom Verification - **Original symptom:** after answering a question, Planning Mode loops between "Retrying…" and regenerating, re-showing the already-answered question, with the auto-retry budget never exhausting. - **Exact reproduction:** answer a question, have the next generation fail (stuck watchdog/provider error), let the client auto-retry open a fresh SSE connection. - **Assertion it is gone:** new regression suite `planning-answered-question-reemit.test.ts` asserts `currentQuestion` is cleared mid-generation, on generation failure, on retry, and on restore from non-`awaiting_input` rows — so the SSE catch-up path has nothing stale to re-emit. All 5 tests fail against pre-fix code and pass with the fix; an onboarding regression test covers the sibling surface. ## Verification - New regression tests: 5/5 fail on pre-fix code, pass with the fix (plus 1 onboarding test). - Existing suites: 137 planning server tests pass (3 failures in `routes-planning.test.ts` fail identically without this change — pre-existing on the branch); all 69 `PlanningModeModal.planning-flow` client tests pass; `tsc --noEmit` clean; `pnpm check:changesets` passes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Made Planning Mode (and related planning controls) lock-free and multi-tab—no more take-over/active-in-another-tab lock overlays. * **Bug Fixes** * Fixed Planning Mode retry/generation flows where already-answered questions could reappear. * Ensured answered questions clear immediately and aren’t re-emitted during session recovery/SSE catch-up. * Improved session restoration and preserved legacy recovery behavior when generation fails after an answer. * **Tests** * Added regression coverage for the answered-question invariant and updated existing tests to reflect lock-free behavior. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- ## Follow-up: Planning Mode is now multi-tab via DB state (lock-free) Second commit removes all cross-tab coordination from planning — the persisted session row is the single source of truth and multiple tabs can read and interact with the same session: - **Server:** `/planning/*` routes no longer run `checkSessionLock` or parse `tabId`; a stale `tabId` from an older client is ignored instead of 409'd. Subtask/mission interview routes keep their existing lock behavior. - **Client:** `PlanningModeModal` drops `useSessionLock`, the `useAiSessionSync` BroadcastChannel broadcasts, `sessionTabId`/`lockSessionId` state, and the "Take Control" overlay. Tabs stay current via the per-session SSE stream plus the global `ai_session:updated` events `useBackgroundSessions` already consumes; concurrent writes resolve via the server's generation-in-progress guard (409). - **API client:** planning functions lose their `tabId` params. - **Fix uncovered by the refactor:** the 8s stuck-poll now resolves the session id inside each tick — the removed lock state was what previously re-armed the poll after Start Planning resolved the session id. - Also fixes a pre-existing PG-cutover break in `planning-generation-cancellation.test.ts` (`getSession` is async). Verification: 144 client planning tests and 137 server planning tests pass (the 3 remaining `routes-planning.test.ts` failures are pre-existing on the branch and fail identically without these changes); `tsc --noEmit` and eslint clean on changed files; `pnpm check:changesets` passes. Lock-conflict route tests were rewritten to assert lock-free semantics, plus a new modal test proving a session stays fully interactive with no lock acquisition even when another tab is active. --- ## Follow-up 2: the per-tab session lock is gone entirely Third commit extends the multi-tab model from planning to **every** AI interview surface (planning, subtask breakdown, mission interview, milestone/slice interview) and deletes the lock machinery root and branch. **Server** - Deleted the `/ai-sessions/:id/lock`, `/lock/force`, and `/lock/beacon` routes. - Dropped `checkSessionLock` from every planning/subtask/mission/milestone route (both copies — `routes.ts` and `mission-routes.ts`). A `tabId` from an older client is ignored, never 409'd; all `tabId` body parsing is gone. - Dropped `acquireLock` / `releaseLock` / `forceAcquireLock` / `getLockHolder` / `releaseStaleLocks` from `AiSessionStore`, plus the `@fusion/core` async helpers (`acquireAiSessionLock` et al) and core's re-exports. - Removed `lockedByTab`/`lockedAt` from `AiSessionRow`/`AiSessionSummary`, the upsert SQL, and all four session producers. **Client** - Deleted `useSessionLock` and the now-orphaned `getSessionTabId` util. - Removed the Take Control overlay, the "active in another tab" banners, and `BackgroundTasksIndicator`'s active-elsewhere gate (the confirm prompt and lock badge — sessions now just open). - Reduced `useAiSessionSync` to what its own comments already called it — a low-latency *status* supplement to SSE: no `activeTabMap`, `broadcastLock/Unlock/Heartbeat`, `owningTabId`, `tab:*` messages, or stale-heartbeat sweep. - Dropped `tabId` from every session API client function; removed the lock CSS. **Deliberately kept: the two DB columns.** `ai_sessions.locked_by_tab` / `locked_at` remain as dead, always-NULL columns with a deprecation note. Dropping them is an irreversible migration, and released binaries still name those columns explicitly in their upsert — an older install pointed at the same database would fail every session write. They can be dropped once no such binary can reach it. No code reads or writes them. **Verification**: 397 client tests and 137 server planning tests pass (the same 3 `routes-planning.test.ts` failures are pre-existing — verified identical on a clean stash); `tsc --noEmit` clean for `@fusion/core` and `@fusion/dashboard`; eslint clean on all changed files; the 30 PG `schema-applier` tests pass (they exercise the retained columns); `pnpm check:changesets` passes. The lock-conflict route tests and both modal lock tests were rewritten to assert the inverse: routes and modals stay fully interactive while another tab "holds" a lock, and the lock API is never called. --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com> |
||
|
|
b563b12662 |
feat: add Oh My Pi (omp) ACP runtime plugin (#2083)
## Summary - Add `fusion-plugin-omp-runtime` so Fusion agents can run through operator-installed **Oh My Pi (`omp`)** over the [Agent Client Protocol](https://omp.sh/docs/acp) (`omp acp`). - Wire staged/bundled install, Settings → Authentication card (enable + binary path), model discovery (`omp models` → `omp-cli/*`), and MCP eligibility for runtime id `omp`. - Forward Fusion `systemPrompt` via ACP `session/new` `_meta.systemPromptOverride`. ## How operators use it 1. Install/auth `omp` (credentials under `~/.omp`). 2. Enable **Oh My Pi — via omp ACP** in Settings → Authentication (optional binary path). 3. Set agent **Runtime Source → OMP Runtime** (`runtimeHint: "omp"`), or pick an `omp-cli/*` model when enabled. ## Known v1 gaps - No Grok-style Fusion `fn_*` loopback tool bridge yet (operator MCP is forwarded; in-process custom tools are not). - Model is fixed at spawn (`omp --model … acp`); no mid-session Fusion model switch. ## Test plan - [x] `pnpm --filter @fusion-plugin-examples/omp-runtime test` (unit + live ACP when `omp` is on PATH) - [x] Auth routes: `POST /api/auth/omp-cli`, `GET /api/providers/omp-cli/status` - [x] Engine `runtimeSupportsMcp("omp")` - [ ] Manual: enable card in dashboard, select OMP runtime on an agent, run a short chat turn <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added Oh My Pi (OMP) CLI support as an ACP-backed runtime and model provider, including model discovery and probing. * Added dashboard auth/status controls to enable OMP, check readiness, and configure the local binary path (with validation). * Exposed OMP custom `fn_*` tools via an MCP loopback bridge, plus optional filesystem capabilities and stricter tool permission gating. * **Documentation** * Added/expanded OMP runtime contract and integration docs (including the ACP session/handshake flow). * **Tests** * Added Vitest coverage for settings wiring, provider status, model discovery, runtime sessions, permissions, MCP bridging, and live connectivity. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
d7e072a03c |
fix: add psql binary guard + delete expired quarantine tests (ratchet) (#2090)
## Summary Follow-up to PR #2086 addressing two Greptile review findings. ## P2 — Missing `psql` binary guard (Greptile P2) `hasPg` in `_helpers.ts` previously checked only TCP connectivity to PostgreSQL. But `adminExecAsync()` shells out to the `psql` CLI for DDL (`CREATE/DROP DATABASE`). On a runner where Postgres is reachable but `psql` isn't installed, tests would fail with `spawn psql ENOENT` instead of skipping cleanly. **Fix**: Added `hasPsql = spawnSync("psql", ["--version"]).status === 0` to the `hasPg` guard, so tests skip when either Postgres is unreachable OR `psql` is missing. ## P1 — Expired quarantine entries (Greptile P1) The 16 dashboard test files quarantined on 2026-06-25 were past the 14-day deletion ratchet (AGENTS.md: "DELETED after 14 days unless rescued"). Per the ratchet, the test files were deleted and all references removed: - **Deleted 16 test files** (CSS drift, mock drift, mobile-render regressions) - **Removed 16 entries** from `scripts/lib/test-quarantine.json` (only the CLI entry remains) - **Emptied `quarantinedDashboardTests` array** in `packages/dashboard/vitest.config.ts` ## Verification | Check | Result | |---|---| | Merge gate (`pnpm test:gate`) | ✅ 294 + 99 + 63 = 456 passed | | Dashboard curated-gate | ✅ passes (891 files, 892 executed, 1 skip-listed, 1 quarantined) | | Typecheck (engine) | ✅ clean | | Lint | ✅ exit 0 | <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Removed multiple outdated dashboard UI, CSS/token, theme contrast, and API/route test suites. * Updated dashboard test configuration to stop excluding quarantined tests and to prune the quality shard to the current set. * Updated the Vitest split/config guard to match the new test fixture set. * Improved PostgreSQL test detection by requiring the `psql` CLI before running database checks. * Adjusted quarantine tracking by adding a new CLI extension distribution ledger entry and removing obsolete dashboard quarantine entries. <!-- end of auto-generated comment: release notes by coderabbit.ai --> |
||
|
|
c15c78feeb |
feat: migrate storage from SQLite to PostgreSQL (#1793)
# Migrate storage from SQLite to PostgreSQL — full dashboard cutover Migrates Fusion's storage layer to the embedded PostgreSQL `AsyncDataLayer` (the default backend) and **completes the satellite-store + feature cutover** so every dashboard and Command Center surface works in PG mode. ## Status — every surface works in embedded-PG mode Verified live against a running embedded-Postgres dashboard (all **200**, zero 5xx) and gate-tested (**23 files / 99 tests** on embedded PG, plus engine-core 294 and ci-shape 63 in the blocking merge gate; core/engine/cli/dashboard typecheck clean). | Area | Surfaces | State | |---|---|---| | Satellite stores | workflows, todos, insights, research, missions, goals, mailbox | ✅ | | Views | artifacts, documents, evals | ✅ | | Command Center | activity, productivity, team, tokens, tools, **workflows**, **github**, **signals**, **plugin-activations**, **live** (all 10) | ✅ | | Run execution | insight generation, research run execution | ✅ (store-path; AI step needs a provider) | | Live updates | SSE push for mission/research/insight events | ✅ | | Workflow editing | create / update / delete / select (+ id counter) | ✅ | | Engine | mission autopilot, incident-signal ingestion, regression storm-guard, agent wake-on-message | ✅ | | Core | tasks, agents, secrets, automations, memory, chat, usage, PRs, git | ✅ | ## Approach Each satellite store gets an `Async<Store>` wrapper exposing the sync store's method names over the existing `async-*-store.ts` helpers; `get<Store>Store()` returns a `Sync | Async` union; consumers `await` (harmless on sync), and engine/CLI paths that can't convert use `instanceof Sync` graceful fallback. Analytics aggregators branch on `"ping" in dbOrLayer` to run schema-qualified raw SQL over `project.*` (snake_case) in PG. Executors/orchestrators/autopilot are await-converted to drive the union store; the async store wrappers extend `EventEmitter` so SSE live-push fires in both backends. Not-yet-ported capabilities degrade gracefully (never 500) and are individually called out in commits. ## Sync with main The branch is kept continuously merged with `main` (currently through FN-7845, 2026-07-12); the earlier "final rebase deferred" note no longer applies. Use **Create a merge commit** (or squash) to land it — GitHub's rebase-merge cannot replay a merge-maintained branch. ## Residual Review Findings Multi-agent code review of the PostgreSQL satellite-store ports (U1–U5) applied 3 safe fixes (see `fix(review): apply autofix feedback`). The following are **real but gated** — recorded here as follow-up work rather than auto-applied. All are SQLite→PostgreSQL **concurrency/atomicity regressions**: the sync stores were immune only by SQLite's single-writer, single-threaded-handler execution; the async ports open multi-await read-modify-write windows. **Reachability is low today** because the execution engines that generate concurrent same-run mutations (insight run executor, research orchestrator/dispatcher) are `instanceof`-gated to sync mode in PG. No process-crash class survived (all engine fallbacks correctly guard the sync store). - **[P1] Research `appendResearchEvent` dual-write is non-atomic** (`packages/core/src/async-research-store.ts`, corroborated: adversarial + reliability). The `research_run_events` insert (own transaction) and the `run.events` jsonb update are separate writes — a crash between them, or two concurrent appends, splits the table count from the jsonb array. **Fix:** perform the seq-insert and the jsonb update in one `layer.transactionImmediate`. - **[P1] Research run terminal-reversion via stale full-row persist** (`async-research-store.ts` `persistResearchRun`/`updateResearchStatus`). Concurrent `PATCH /runs/:id/status` + `POST /runs/:id/events` can revert a terminal run to `running` by overwriting the whole row, bypassing the transition guard. **Fix:** scoped column `UPDATE`s with a `WHERE status …` guard, or optimistic version column. - **[P2] `updateResearchRun`/`updateInsightRun` read-then-write TOCTOU** — concurrent PATCHes last-writer-wins on the lifecycle merge. **Fix:** `SELECT … FOR UPDATE` / enclosing transaction. - **[P2] `upsertRun`/`createRunOrThrowConflict` check-then-create race** (`async-insight-store.ts`) — two callers can each create an "active" run. **Fix:** partial unique index on `(projectId, trigger) WHERE status IN ('pending','running')`. - **[P3] `createResearchRetryRun` return-value divergence** — sync returns the pre-update `queued` snapshot; async returns the reloaded `retry_waiting` run (persisted state is identical). Pick one side for cross-backend parity. - **[P2/perf] Mission `getMissionWithHierarchy`/`getMissionHealth` N+1 fan-out** — O(milestones×slices) sequential round-trips hold one pool slot per request; can starve the pool for large hierarchies. **Fix:** batched/joined reads. - **Testing gaps:** no PG-mode concurrency tests (interleaved status/event mutations), no sync↔async parity assertion for the lifecycle-error codes, and no mission status/health rollup parity test vs the sync `MissionStore`. ~~Out of scope (deferred): AI run *execution* (insight/research) + mission autopilot + live SSE mission events remain sync-gated/degraded in PG mode.~~ **Since ported** — insight/research run execution, mission autopilot, and SSE live push all run on the async layer now, which also makes the concurrency findings above genuinely reachable; they remain open follow-ups. --- ## Update — 2026-07-12: production-readiness hardening & live acceptance Everything below landed on this branch since the description above was written: **Production blockers from review — fixed** - `recoverStaleTransitionPending` ported to the async layer (backend moves write + clear the crash-safe marker; startup/maintenance sweeps no longer throw). - Lost-update class fixed: `atomicWriteTaskJson`/`WithAudit` write changed columns only (full-row upserts silently resurrected stale fields across concurrent store instances — the "task stuck unplanned forever" bug). - First-boot **auto-migration**: booting the PG backend over a project with a legacy `fusion.db` migrates it automatically (loud failure, SQLite kept as backup), and the dashboard shows a one-time **"your data was migrated" banner** with the backup paths and a Need-help Discord link. - `pg_dump`/`pg_restore` discovered from common install locations for embedded-mode backups. - The PG suite is part of the blocking merge gate (`test:pg-gate`). **Multi-project isolation (PR #2007, merged into this branch)** - `project_id` partition key on tasks / archived tasks / config, `taskProjectScope` threaded through every scan/claim/count, per-project config rows, layer bound to the project at startup. - Review P1 follow-up: the shared cold-storage `archive.archived_tasks` table is also partitioned and all archived-board reads/counts/searches are scoped. - Schema drift self-heal generalized to schema-qualified columns so existing databases upgrade in place. **Other changes** - Node settings sync **removed** in PG mode (409 `settings-sync-disabled-postgres`) — nodes share state by connecting to the same database; auth sync kept (per-machine file). - Perf (review findings): `listTasks` pushes column filter + ORDER BY + LIMIT/OFFSET into SQL; `getConversation` capped to the most recent 200 messages. - Fixed a false "operator action required" pause-abort log fired on every successfully auto-merged task. **Live acceptance — PASSED (2026-07-12)** A sandboxed instance (isolated HOME, embedded PG, real Opus executor) ran a task through the complete cycle: create → triage (AI spec) → execute → in-review → AI squash-merge landed on the project's `main` → done. A write+read sweep of every data surface (settings, comments, documents, attachments + artifact bridge + artifact edit, chat with real generation, goals, missions, agent mail, secrets, workflows, memory, CC analytics) was green on embedded PG. **Known remaining work** - The per-project `config` PK re-key has no upgrade path for pre-isolation embedded-PG databases (needs a real `DROP CONSTRAINT`/re-key migration; fresh databases are fine). - `pg_dump`/`pg_restore` binaries are not yet bundled in release artifacts (PATH/common-location discovery only). - The satellite-store concurrency findings listed above. --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Co-authored-by: Phil Larson <hello@phillarson.xyz> Co-authored-by: fusion-merge <fusion-merge@local> |