Repository navigation
refactor: fold the last frontmatterEnd copy into markdown-scan - #68
Merged
Merged
Conversation
The comment on the vault-updates copy named its own duplicate in focus.ts and explained why it had been left alone. That reason no longer holds now there is a module for exactly this. The two copies had identical bodies. The only difference was the parameter type: vault-updates took `readonly string[]`, focus.ts took `string[]`. The vault-updates signature is the one that moved, being the wider of the two, and focus.ts's callers pass a mutable array, which satisfies it. No behaviour change. Tests untouched, 818 before and 818 after.
Bhekani Khumalo (bhekanik)
marked this pull request as ready for review
August 27, 2026 16:49
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.
What
Moves the duplicated
frontmatterEndintolib/sdk/markdown-scan.ts. Both copies are gone;focus.tsandvault-updates.tsimport it.The comment on the vault-updates copy named its own duplicate in
focus.tsand explained why ithad been left alone. That reason stopped applying when
markdown-scan.tslanded.How the two copies differed
Only in the parameter type:
The bodies were byte-identical. The vault-updates signature is the one that moved, per the
instruction and because
readonly string[]is the wider of the two;focus.tspasses a mutablearray, which satisfies it.
Verification
bunx tsc --noEmitclean,bun run lintclean,anti-slop-checkclean on changed lines.git diff --stat: 16 insertions, 27 deletions across three files.Observation, not changed
focus.tshas its ownisArchivedHeading(line), a third variant of the archived-heading test thatmarkdown-scan.tsnow owns for the other two files. It is not a copy: it accepts levels 2-6 only(the others accept 1-6) and matches with a
\b(?:ARCHIVED|HISTORICAL)\bregex against the rawheading text rather than against canonicalised words. Folding it in would change behaviour, so it
needs its own decision rather than a move.