Skip to content

refactor(storage): retire unread workflow projection tables - #3937

Open
Sun-GLiang wants to merge 1 commit into
apache:mainfrom
Sun-GLiang:refactor/3934-retire-workflow-projections
Open

refactor(storage): retire unread workflow projection tables#3937
Sun-GLiang wants to merge 1 commit into
apache:mainfrom
Sun-GLiang:refactor/3934-retire-workflow-projections

Conversation

@Sun-GLiang

@Sun-GLiang Sun-GLiang commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Task Ledger and Plan replay their event tables for every read, but mutations also maintained SQLite projection rows that no reader consumed. This change removes those redundant projection tables and keeps the event ledgers as the sole durable authority.

Workflow schema advances from 9 to 10. The migration validates both projection tables against their exact released shapes before dropping either one, and fails closed on altered DDL, attached schema objects, or case-insensitive name collisions.

Fixes #3934

Verification

  • npm --workspace @maka/storage test — 997 tests: 981 passed, 16 skipped, 0 failed
  • npm --workspace @maka/storage run typecheck
  • npm run lint -- <changed files>
  • npm run format:check -- <changed files>
  • Regression coverage includes event-only persistence, schema 8/9 upgrades, atomic migration rollback, name collisions, attached triggers/views, Task/Plan purge, operation retries, and backup/restore.

Migration

Workflow databases upgrade from schema 9 to 10 in the existing central migration transaction. Released projection tables are removed only after both shapes validate; missing tables are treated as already converged. Older readers reject schema 10 without modifying the database.

AI use

Select exactly one:

  • No generative tool made a substantive contribution
  • Generative tooling made a substantive contribution

Tool(s) and scope: OpenAI Codex analyzed the storage paths, implemented the schema and store changes, added regression coverage, ran local verification, and prepared this pull request. The human contributor remains responsible for review and submission.

Checklist

  • Tests cover the change and fail without it
  • Lint, format, typecheck and the affected suites pass locally

Does this PR entail a change in behavior?

  • Yes — described under Summary above
  • No

@Sun-GLiang
Sun-GLiang force-pushed the refactor/3934-retire-workflow-projections branch 2 times, most recently from cff947f to ea1736c Compare August 26, 2026 15:43
@Sun-GLiang
Sun-GLiang force-pushed the refactor/3934-retire-workflow-projections branch from ea1736c to 3eb10d6 Compare August 26, 2026 15:54
@github-actions github-actions Bot added the effort/L Under 1000 readable lines label Aug 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

effort/L Under 1000 readable lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(storage): retire the unread Task Ledger and Plan projection tables

1 participant