fix(journal): v0.6.26 — one-time SQLite->plugin import so re-enabling the journal preserves run history#293
Merged
Merged
Conversation
…t (BU-1H) Re-enabling the durable workflow_journal plugin blanked the portal's run-history view: the summary readers route to the (empty) plugin store while 391 existing runs lived only in local SQLite. Add a one-time, idempotent boot migration that copies every run + its checkpoints from the local SQLite engine into the active plugin via journal/save + journal/checkpoint_save, then writes a marker (.journal-imported-v1, next to workflow.db) to skip re-scanning. - journal_client::import_local_sqlite_into_plugin: resolves the backend; no-op (skipped) for the SQLite path (no plugin / kill-switch) and when the marker exists. Reads the LOCAL SQLite store directly via a Sqlite-pinned WorkflowStateManager (new_sqlite) + sqlite_all_run_ids, iterating one run at a time (bounded memory) and upserting into the plugin through an internal JournalImportSink seam. - Idempotent + safe: saves are upserts; the marker is written ONLY after a clean full pass, so a partial import retries next boot. Reads never mutate SQLite (no data loss). - Daemon hook in run_daemon.rs, right after the journal sink is wired and before reconcile reads the journal. Best-effort: a failure is logged and never blocks startup (kill-switch remains the escape hatch). - Tests: copy N runs+checkpoints (marker written), marker-present skip, empty store (marker written, 0 saves), SQLite backend no-op.
…es run-history blank on journal cutover)
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
When the
workflow_journalplugin is active, the run-summary readers read the plugin store — which started EMPTY after the v0.6.25 cutover (existing runs lived only in local SQLite), blanking the portal's/workflows. This adds the one-time import that the foundation pass deferred.import_local_sqlite_into_plugin(project_root): on the Plugin backend, scans the LOCAL SQLite store andjournal/save+journal/checkpoint_saveeach run/checkpoint (one at a time, bounded memory), then writes a.journal-imported-v1marker.ANIMUS_DISABLE_WORKFLOW_JOURNAL_PLUGIN=1).Verification
build/clippy/fmt clean; 1225 workspace tests pass (only the 2 pre-existing
decision_gate::workflow_*fail); 4 new import tests (copies N runs+checkpoints + marker; marker→skip; empty→marker+skip; SQLite-backend→no-op). codex stalled on the 2800-line state_manager.rs exploration (no findings emitted); manual P1 self-review clear (data-loss/double-import/startup-crash).After this deploys I drop the kill-switch → boot imports the ~391 runs → readers serve from Postgres.
🤖 Generated with Claude Code