Skip to content

refactor: readability pass — naming, comments, simplicity#45

Merged
aliasunder merged 3 commits into
mainfrom
refactor/readability-pass
May 19, 2026
Merged

refactor: readability pass — naming, comments, simplicity#45
aliasunder merged 3 commits into
mainfrom
refactor/readability-pass

Conversation

@aliasunder
Copy link
Copy Markdown
Owner

Summary

  • Rename vague variables across 5 files so code reads top-to-bottom without guessing what values hold
  • rebuildFromVault: files/itemsmarkdownFiles/noteContents, rel/fullrelativePath/absolutePath, itemnote, segsegment
  • upsertNote: datafrontmatter, extract coerceToArray helper for repeated nested ternary
  • fullTextSearch: relrelatedNote, log errors instead of silent catch { return [] }
  • findOrphans: Array.fill() over .map(() => str) for clearer intent
  • listPropertyKeys: jeproperty SQL alias
  • vault-patcher: bind fenceMatch[1] to fenceChars in both functions (consistency with extractLinks)
  • consent-page: esc/sescapeHtml/text/scope
  • memory-store: lastlastMatchIndex
  • file-watcher: relPath/relrelativePath, segsegment
  • Add clarifying comments on dynamic WHERE builder, better-sqlite3 transaction API, YAML date parsing

Test plan

  • npx tsc --noEmit — clean compile
  • npm test — 461 tests pass (13 files)
  • npm run lint — clean
  • All changes are internal renames/comments — no public API surface changes

🤖 Generated with Claude Code

aliasunder and others added 3 commits May 18, 2026 19:57
Rename vague variables to describe what values actually hold:
- rebuildFromVault: files/items → markdownFiles/noteContents,
  rel/full → relativePath/absolutePath, item → note
- fullTextSearch: rel → relatedNote
- file-watcher: relPath/rel → relativePath, seg → segment
- memory-store: last → lastMatchIndex
- consent-page: esc/s → escapeHtml/text/scope
- vault-patcher: bind fenceMatch[1] to fenceChars (2 functions)
- listPropertyKeys: je → property SQL alias

Add coerceToArray helper for repeated nested ternary in upsertNote.
Rename data → frontmatter in upsertNote for top-to-bottom clarity.
Add clarifying comments on dynamic WHERE builder, transaction API,
and YAML date parsing. Log errors in fullTextSearch instead of
swallowing silently. Replace .map(() => str) with Array.fill in
findOrphans for clearer intent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace acc.push() mutation with [...acc, item] spread.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aliasunder aliasunder merged commit 1f63b3d into main May 19, 2026
2 checks passed
@aliasunder aliasunder deleted the refactor/readability-pass branch May 19, 2026 00:03
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