Skip to content

feat(storage): add SQLite session metadata foundation - #1371

Merged
likun666661 merged 1 commit into
apache:mainfrom
likun666661:agent/sqlite-session-metadata-foundation
Jul 23, 2026
Merged

feat(storage): add SQLite session metadata foundation#1371
likun666661 merged 1 commit into
apache:mainfrom
likun666661:agent/sqlite-session-metadata-foundation

Conversation

@likun666661

Copy link
Copy Markdown
Member

Part 1 of #1370.

What changed

  • add a versioned SQLite schema for canonical SessionHeader payloads plus indexed recency, flag, status, parent, revision, and label projections
  • add transactional create/read/list/update/delete APIs with metadata-version CAS and fail-closed validation
  • add source-marked, whole-catalog legacy JSONL header import that is idempotent and rolls back atomically
  • reuse the existing FileSessionStore compatibility codec so legacy defaults migrate exactly once
  • verify that session metadata tables coexist with the RuntimeEvent schema in one workspace database

Scope boundary

This foundation PR does not change production SessionStore wiring or defaults. Existing workspaces continue using file-backed headers until the follow-up cutover PR. StoredMessage transcript bodies remain JSONL.

Why

Session metadata updates currently rewrite the complete transcript and session listing walks file headers. This PR establishes the durable/queryable layer separately so the default cutover and legacy-format cleanup can be reviewed independently.

Validation

  • npm test --workspace @maka/storage — 430 passed, 1 skipped
  • targeted Biome format and lint — passed
  • npm run typecheck@maka/storage and preceding workspaces passed; the all-workspace command remains red on unrelated current-main CLI declaration drift and a Desktop test fixture ComposerHandle.setSkills mismatch

Follow-ups

  • PR 2: migrate existing workspaces and make SQLite the default canonical SessionStore metadata writer
  • PR 3: remove JSONL header authority and finish export, downgrade, backup, and E2E coverage

@likun666661
likun666661 force-pushed the agent/sqlite-session-metadata-foundation branch from ae9753a to e03e7b0 Compare July 23, 2026 05:59
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