Skip to content

refactor: split storage and MCP boundaries - #55

Merged
davidrobertson merged 3 commits into
mainfrom
codex/refactor-storage-boundaries
Jul 30, 2026
Merged

refactor: split storage and MCP boundaries#55
davidrobertson merged 3 commits into
mainfrom
codex/refactor-storage-boundaries

Conversation

@davidrobertson

@davidrobertson davidrobertson commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Move persisted-event parsing, raw JSONL access, SQLite schema setup, and row decoding out of storage.ts while keeping the LcmStorage API unchanged.
  • Move the MCP tool catalog, dispatch logic, and result shaping out of the stdio transport.
  • Add focused coverage for valid, malformed, and structurally invalid persisted events.
  • Harden nested assignment redaction found during installed CLI testing, while preserving JSON and shell structure plus benign token metrics.

Why

storage.ts and mcp.ts each owned several independent boundaries. This change separates those responsibilities without changing storage formats, MCP schemas, defaults, messages, or ordering.

Validation

  • npm run typecheck
  • npm test: 199 passed
  • npm run smoke
  • 31 focused redaction tests, including nested JSON, escaped quotes, empty values, deep assignment chains, and terminal assignments
  • 25,000-assignment regression: about 23 ms in the source test and 0.15 seconds through the installed hook
  • Installed cache: 49 hook/redaction tests plus smoke
  • Fresh isolated codex exec sessions exercised all 17 LCM tools, then rechecked each concrete regression on the final code
  • Manual hook, MCP, and CLI round-trips with isolated storage
  • npm pack --dry-run --json

Risk

This is a broad code move across persistence and MCP paths. Replay, migration, concurrency, framing, redaction, and recovery tests cover those paths. The frozen final commit passed code, security, QA, goal, maintainability, and runtime gates.

@davidrobertson
davidrobertson marked this pull request as ready for review July 30, 2026 01:05
@davidrobertson
davidrobertson merged commit 820efd1 into main Jul 30, 2026
1 check passed
@davidrobertson
davidrobertson deleted the codex/refactor-storage-boundaries branch July 30, 2026 01:06
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