Repository navigation
refactor(storage): isolate platform log persistence - #41
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.