fix(persistence): address review comments on migration safety, transcript docs, and keychain clarity#14
Draft
Copilot wants to merge 2 commits into006-persistence-jsonl-sqlite-secrets-and-audit-logfrom
Conversation
…, and keychain store Co-authored-by: aaronolds <1485194+aaronolds@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add JSONL transcripts and SQLite store with audit enhancements
fix(persistence): address review comments on migration safety, transcript docs, and keychain clarity
Mar 6, 2026
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.
Five issues flagged in code review on the persistence PR: unsafe migration rename on partial failure, force-cast validation bypassing actionable errors, mismatched fsync doc, redundant schema_version migration, and misleading keychain backend contract.
Migration safety (
migrate-devices.ts)Rename gating — source file now only renamed to
.migratedwhenerrors.length === 0; any failure leaves it in place for manual remediation and retry.Up-front type validation — replaced blind
as string/as booleancasts with explicit checks before callingregisterDevice. Invalid records push a descriptive error andcontinue; no more relying on SQLite constraint violations for input feedback:Schema migrations (
migrations.ts)Removed the redundant v3 migration that created
schema_version.runMigrations()inOperationalStorealready creates this table unconditionally before iteratingMIGRATIONS, making v3 a dead no-op that muddied the migration history.Transcript writer (
transcript-writer.ts)Fixed JSDoc on the
fsyncoption: saidfd.datasync(), implementation usesfsyncSync().Keychain store (
keychain-secret-store.ts)Added class-level JSDoc and updated the constructor comment to clearly state that OS keychain availability is detected (exposed via
hasKeychainAccess) but all reads/writes go throughEncryptedFileSecretStore. Operators usingsecretsBackend: "keychain"are explicitly warned secrets land in the vault file, not the OS keychain. TheserviceNameoption is documented as reserved for future keychain integration.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.