Skip to content

refactor(storage): isolate platform log persistence - #41

Merged
xiaour merged 2 commits into
xiaour:mainfrom
BigDataDZ:codex/query-log-repository
Oct 19, 2026
Merged

xiaour merged 2 commits into
xiaour:mainfrom
BigDataDZ:codex/query-log-repository

Conversation

@BigDataDZ

Copy link
Copy Markdown
Collaborator

PlatformDatabase mixes domain storage with dataset-query, audit and model-call log persistence. Extract those eight log methods into PlatformLogRepository using the same SQLite connection and migration lifecycle, while retaining the existing PlatformDatabase entry points as forwarding methods. SQL, trace defaults, serialization, return fields, token aggregation and log statistics are unchanged.

The database facade shrinks from 4,136 to 3,961 lines. Lower its size baseline and register the new 241-line repository. No schema migration, new connection or dependency is introduced.

Validation: three real-SQLite characterization tests passed before and after extraction. They cover trace correlation, joined names, JSON/boolean fields, ordering and limits, failure logs, digest bounds, statistics, token-budget filters/fallbacks and damaged JSON. Full npm test: 577 tests, 565 passed, 12 optional skips, 0 failures. Lint: 0 errors / 7 existing warnings. Eval: 14/14 fixtures, 2 L3 judgments pending. Independent review verified every moved method/helper matches the original and reran all three characterization tests.

Depends on #37 for the shared PostgreSQL HTTP acceptance path; merge #37 first. Its prerequisite changes are included to keep this branch verifiable. This refactor is independent of #38's Agent presentation extraction.

@xiaour
xiaour merged commit 9e176ec into xiaour:main Oct 19, 2026
3 of 4 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.

2 participants