Skip to content

Keep recording metadata truthful and repair legacy Library rows - #60

Open
IMONsergey wants to merge 6 commits into
mainfrom
fix/truthful-history-metadata-v3
Open

Keep recording metadata truthful and repair legacy Library rows#60
IMONsergey wants to merge 6 commits into
mainfrom
fix/truthful-history-metadata-v3

Conversation

@IMONsergey

Copy link
Copy Markdown
Owner

Summary

Clean rebuild directly from current production main of the truthful recording-metadata contract previously developed in #55.

Product-truth fix

Legacy transcriptionDurationSeconds is ASR processing time. It is no longer projected into SuperDictateRecording.durationSeconds, which is reserved for real source-audio duration. Legacy rows therefore keep unknown capture date/duration unless real metadata exists.

Runtime-ready metadata

SuperDictateLegacyHistoryEntry can 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:

  • ID exactly matches the legacy deterministic fallback identity;
  • capture date is unknown;
  • a duration is present.

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.

@IMONsergey
IMONsergey marked this pull request as ready for review August 8, 2026 17:17
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