Skip to content

D1+N2: README scan-resume fix; Category cast guard (closes #34, #33) - #50

Merged
curtyo18 merged 1 commit into
mainfrom
issue/D1-N2-small-cleanup
May 17, 2026
Merged

D1+N2: README scan-resume fix; Category cast guard (closes #34, #33)#50
curtyo18 merged 1 commit into
mainfrom
issue/D1-N2-small-cleanup

Conversation

@curtyo18

Copy link
Copy Markdown
Owner

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.

N2categoryForExtension in shared/settings.ts cast arbitrary map keys to the Category union without a runtime guard. Added a guard that returns null for 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

  • README reads correctly
  • categoryForExtension returns null for unknown category keys
  • Existing tests pass; lint + typecheck clean

Out of scope

Closes #34
Closes #33

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>
@curtyo18
curtyo18 merged commit e57dee9 into main May 17, 2026
2 checks passed
@curtyo18
curtyo18 deleted the issue/D1-N2-small-cleanup branch May 17, 2026 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant