refactor: move task state to shared sqlite

Move task run, delivery, and flow registry persistence onto the shared OpenClaw state SQLite database.

Summary:
- Store task runs, delivery state, and flow runs in state/openclaw.sqlite via the generated Kysely schema.
- Migrate shipped task sidecars into the shared state DB and archive old sidecars, including invalid-config/read-only CLI paths.
- Keep startup migration lightweight for read-only status/tasks paths while still detecting known legacy state markers and custom session stores.

Verification:
- .agents/skills/autoreview/scripts/autoreview --mode local: clean after final fix
- pnpm test src/tasks/task-registry.store.test.ts src/tasks/task-flow-registry.store.test.ts src/commands/doctor-state-migrations.test.ts -- --reporter=verbose
- pnpm test src/commands/doctor-state-migrations.test.ts src/cli/program/config-guard.test.ts src/cli/route.test.ts src/cli/command-path-policy.test.ts -- --reporter=verbose
- pnpm test src/cli/program/config-guard.test.ts src/cli/route.test.ts src/cli/command-startup-policy.test.ts src/cli/command-path-policy.test.ts src/cli/command-execution-startup.test.ts -- --reporter=verbose
- pnpm test src/cli/program/config-guard.test.ts src/cli/argv.test.ts src/cli/route.test.ts src/commands/doctor-config-preflight.state-migration.test.ts -- --reporter=verbose
- pnpm test src/tasks/task-flow-registry.store.test.ts -- --reporter=verbose
- pnpm test test/scripts/lint-suppressions.test.ts -- --reporter=verbose
- pnpm db:kysely:check
- pnpm lint:kysely
- git diff --check HEAD
- pnpm test:startup:memory
- PR CI green on 2f7d76f0d5
This commit is contained in:
Peter Steinberger
2026-05-30 04:54:37 +02:00
committed by GitHub
parent e9dee8dfe1
commit d115fb4cf9
29 changed files with 2450 additions and 1340 deletions

View File

@@ -45,7 +45,7 @@ describe("command-execution-startup", () => {
startupPolicy: {
suppressDoctorStdout: true,
hideBanner: false,
skipConfigGuard: true,
skipConfigGuard: false,
loadPlugins: false,
pluginRegistry: { scope: "channels" },
},
@@ -168,7 +168,7 @@ describe("command-execution-startup", () => {
startupPolicy: {
suppressDoctorStdout: true,
hideBanner: false,
skipConfigGuard: true,
skipConfigGuard: false,
loadPlugins: false,
pluginRegistry: { scope: "channels" },
},
@@ -181,7 +181,7 @@ describe("command-execution-startup", () => {
allowInvalid: undefined,
loadPlugins: false,
pluginRegistry: { scope: "channels" },
skipConfigGuard: true,
skipConfigGuard: false,
});
const messageRuntime = {} as never;