D1+N2: README scan-resume fix; Category cast guard (closes #34, #33) - #50
Merged
Conversation
Closes #34 (D1) and #33 (N2). Only the remaining bits of each — spec §12.3 and plan M7-T03 (D1) and settings-repo shape drift (N2) were already addressed in prior MRs. D1 — README "Scans resume from the last completed directory" was inaccurate; the implementation re-walks but skips unchanged files via size+mtime quick-check. Updated to match actual behavior. N2 — categoryForExtension previously cast arbitrary CategoryMap keys to the Category union without a runtime guard. A custom category key (legal per the map type) would silently persist out-of-range strings into SQLite. Added a runtime guard that returns null for unknown keys, with a test asserting the behavior. Closes #34 Closes #33 Co-Authored-By: Claude Opus 4.7 <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.
Summary
Small cleanup bundle:
D1 — README's "scans resume from the last completed directory" claim was factually wrong; the implementation actually re-walks and skips unchanged files via size+mtime. Reworded.
N2 —
categoryForExtensioninshared/settings.tscast arbitrary map keys to theCategoryunion without a runtime guard. Added a guard that returnsnullfor unknown keys.Most of D1 and N2's original scope already shipped in earlier MRs (spec §12.3 in B1, plan M7-T03 in M2, settings-repo shape drift in M1). Only the remaining items land here.
Test plan
categoryForExtensionreturnsnullfor unknown category keysOut of scope
Closes #34
Closes #33