Keep recording metadata truthful and repair legacy Library rows - #60
Open
IMONsergey wants to merge 6 commits into
Open
Keep recording metadata truthful and repair legacy Library rows#60IMONsergey wants to merge 6 commits into
IMONsergey wants to merge 6 commits into
Conversation
This was referenced Aug 8, 2026
IMONsergey
marked this pull request as ready for review
August 8, 2026 17:17
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.
Summary
Clean rebuild directly from current production
mainof the truthful recording-metadata contract previously developed in #55.Product-truth fix
Legacy
transcriptionDurationSecondsis ASR processing time. It is no longer projected intoSuperDictateRecording.durationSeconds, which is reserved for real source-audio duration. Legacy rows therefore keep unknown capture date/duration unless real metadata exists.Runtime-ready metadata
SuperDictateLegacyHistoryEntrycan optionally carry a real recording UUID, capture date and source-audio duration while preserving ASR processing duration separately. Pre-metadata rows keep the deterministic text+occurrence UUID fallback. Explicit UUID rows do not renumber legacy duplicate fallback IDs.Existing Library repair
Previous builds could persist ASR processing time as recording duration. The existing agent startup merge now narrowly repairs those rows when all of the following are true:
Only that polluted duration is reset to unknown. Real runtime UUID rows and enriched legacy rows with real capture dates are not touched. Repair contributes to
mergeResult.changed, so the existing single writer persists the corrected archive.Tests
Full Core coverage verifies truthful duration semantics, real metadata preservation, deterministic legacy identities, idempotent merge, polluted-row repair and exclusions for real/enriched rows.
Runtime impact
Core contract + deterministic repair only. No audio, ASR, hotkey, insertion, TCC or UI runtime path changes. The following durable-identity runtime PR will consume this contract.