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 -->
This commit is contained in:
@@ -58,7 +58,7 @@ When `--project` is not supplied, Fusion resolves project context in this order:
|
||||
|
||||
1. Explicit `--project` flag
|
||||
2. Default project (set via `fn project set-default <name>`)
|
||||
3. Current-directory auto-detection (`.fusion/fusion.db` lookup upward)
|
||||
3. Current-directory auto-detection (`.fusion/project.json` lookup upward; legacy `fusion.db` is recognized only for migration)
|
||||
|
||||
---
|
||||
|
||||
@@ -590,10 +590,10 @@ fn task logs FN-001 --follow --limit 50 --type tool
|
||||
- unavailable-node policy value
|
||||
- source provenance line (`Source: <origin>`), including parent task / GitHub issue URL context when present
|
||||
|
||||
Every `fn task` subcommand that touches the board retries on lock (FN-7731,
|
||||
generalized to all subcommands in FN-7734): if the board database
|
||||
(`.fusion/fusion.db`) is momentarily locked by the engine or another agent,
|
||||
the command retries with bounded exponential backoff instead of failing
|
||||
Every `fn task` subcommand that touches the board retries transient storage
|
||||
failures (FN-7731, generalized to all subcommands in FN-7734): if PostgreSQL
|
||||
reports a retryable transaction or availability error, the command retries
|
||||
with bounded exponential backoff instead of failing
|
||||
outright. If the lock hasn't cleared once the retry deadline (default 15s)
|
||||
is reached, the command fails fast with a clear, actionable, non-zero-exit
|
||||
error naming the task and operation rather than hanging. Override the
|
||||
@@ -635,7 +635,7 @@ lock, the canonical transient-lock case) and closes the resolved store
|
||||
BEFORE each `process.exit()` call, since `runDbVacuum` always exits
|
||||
explicitly and a pending `finally` does not run after `process.exit()`. MCP
|
||||
global-scope settings live in the file-backed `GlobalSettingsStore`
|
||||
(`~/.fusion/settings.json`, no SQLite handle) and are intentionally left
|
||||
(`~/.fusion/settings.json`, no database handle) and are intentionally left
|
||||
with no close and no lock-retry. All of the above honor the same
|
||||
`FUSION_CLI_LOCK_RETRY_MS` deadline override.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user