fix(schema): accept unknown speaker_map source instead of aborting the parse (#595) - #597
Merged
Merged
Conversation
…e parse (#595) An out-of-vocabulary speaker_map[].source aborted the whole frontmatter parse, which hard-blocked `minutes resummarize` on that file, even though resummarize's documented field contract lists speaker_map among the fields preserved untouched. It failed before the model call on a value it would never read. Hand-edited files are a supported input class: the desktop app's Open in Editor button invites direct edits, resummarize's own premise is that the file is open in an editor, and `minutes import text` ingests third-party archives that never went through the pipeline. A provenance label describing how an attribution was derived should not be able to make a meeting unreadable. AttributionSource gains an untagged Unknown(String) variant in both definitions (core and reader). The raw label round-trips verbatim rather than being normalized, so provenance survives a rewrite by a command that never consumed it. This drops Copy; the three affected call sites now take a reference. Also closes the trap that generated the bad value: the schema doc presented L0-L3 as parallel to the source enum, but L3's label 'user-confirmed' has no matching variant (the real one is 'manual'). The ladder is now explicitly labelled conceptual, with the on-disk value given for each level. The TypeScript copy in the SDK is widened to match, and the JSON schema snapshot now describes the lenient shape. Verified against the reporter's exact repro: the unfixed binary reproduces 'unknown variant `user-confirmed`', the fixed one completes a preview and an --apply, and the file still reads `source: user-confirmed` afterwards. Reported by @jmh1313. Fixes #595 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Fixes #595, reported by @jmh1313 with a diagnosis that identified both the bug and the thing that caused it.
The bug
An out-of-vocabulary
speaker_map[].sourceaborted the entire frontmatter parse, hard-blockingminutes resummarizeon that file. The sharp part, as the report puts it: resummarize's own documented field contract listsspeaker_mapamong the fields preserved untouched, and it failed before the model call. So the command refused to run because of a value it would never have read or written.Hand-edited files are a supported input class. The desktop app's Open in Editor button invites direct edits, resummarize's own premise is that the file is open in an editor right now, and
minutes import textingests third-party archives that never went through the pipeline. A label describing how an attribution was derived should not be able to make a meeting unreadable.The trap that generated it
user-confirmedis not a value Minutes has ever emitted. The schema doc listed the valid enum, then eleven lines later labelled the confidence ladderL3 (user-confirmed). Someone hand-editing reads that and writessource: user-confirmed. The actual variant ismanual.Fix
AttributionSourcegains an untaggedUnknown(String)in both definitions (core and reader). The raw label round-trips verbatim rather than being normalized, so provenance survives a rewrite by a command that never consumed it. This dropsCopy; three call sites now take a reference.source:value for each level, explicitly noting L3 ismanualand thatuser-confirmedis invalid.anyOf: [known enum, string]).Not done: ask 3, a
minutes consistency --fixrepair path for out-of-vocabulary values. Worth doing, but it is a separate feature rather than part of unbreaking the read path.Verification against the reporter's exact repro
Core lib 1176 passed, CLI 82 passed, clippy clean on core and reader, fmt clean, SDK typecheck clean.
One note on the diff
tauri/src-tauri/gen/schemas/*.jsonare regenerated files carrying the tauri 2.11.5 permission additions from #590, which landed without regenerating them. They are unrelated to this fix but correct, and dropping them would leave main stale.🤖 Generated with Claude Code