Skip to content

storage: export artifact metadata in SQLite session bundles - #1705

Merged
likun666661 merged 1 commit into
apache:mainfrom
likun666661:agent/session-bundle-sqlite
Jul 31, 2026
Merged

likun666661 merged 1 commit into
apache:mainfrom
likun666661:agent/session-bundle-sqlite

Conversation

@likun666661

Copy link
Copy Markdown
Member

Summary

  • read canonical artifact_records from a read-only WAL snapshot and require a completed cutover whose retained legacy fingerprint still matches
  • retain legacy JSONL input only for pre-cutover compatibility, while omitting artifacts/metadata.jsonl from every exported bundle
  • filter Artifact rows and payload files to the selected session, then seed those rows into the destination runtime.sqlite
  • keep the Artifact writer lock across snapshot, payload copy, and selected-session projection so queued mutations cannot leak into the bundle
  • validate the destination through the SQLite Artifact store and cover continued writes after restore

Migration guarantees

  • cross-session Artifact rows and payloads are excluded
  • live WAL rows remain visible while the operational database is open
  • changed legacy evidence after completed cutover fails closed before destination creation
  • canonical publication/purge residue continues to require authority recovery
  • legacy metadata order does not affect relational export validation
  • restored bundles reopen and accept new Artifact writes without recreating metadata JSONL

Verification

  • Biome checks on all changed files
  • npm --workspace @maka/storage run typecheck
  • 41 focused session-bundle and Artifact writer-lock tests
  • full Storage suite: 854 passed, 1 skipped
  • session-bundle measurement suite: 26 passed

Part of #1649. This is the selected-session relational-closure slice of Stage 5; full operational backup/restore remains separate follow-up work.

@likun666661
likun666661 marked this pull request as ready for review July 31, 2026 13:21
@likun666661
likun666661 merged commit 97eaca0 into apache:main Jul 31, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant