Repository navigation
journal index doesn't cover voice notes — the 'run journal index to index later' recovery hint is a dead end - #122
Merged
Merged
Conversation
Voice notes landed via `journal log` are indexed at land time via Indexer.IndexVoice; when that fails (e.g. Ollama down) the note is left on disk with the hint "run `journal index` to index later" — but `journal index` never scanned the voice-note landing zone, so the hint was a dead end and the note stayed permanently unindexed. `journal index` now walks `log.landing.dir` (default `logs/`) with a new index.WalkVoice, indexing each file through the same IndexVoice chunking (source=voice) and stable-hash change detection the land-time path uses, so re-running on unchanged voice notes is a no-op and --rebuild covers them too. The landing zone is also excluded from the plain-note walk (mirroring the existing transcripts exclusion) so a voice note isn't double-indexed as a regular note. Closes #118 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Contributor
Author
|
Retro: no durable lesson (merged clean / one-off). |
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.
🤖 Agent-Generated PR
Closes #118
Agent Used: Claude Code
Complexity: medium
Summary
journal indexnever scanned the voice-note landing zone (log.landing.dir, defaultlogs/), so when land-time indexing failed (e.g. Ollama down) the printed recovery hint — "runjournal indexto index later" — was a dead end: the note stayed on disk, unindexed, forever.journal indexnow scans that landing zone and indexes voice notes the same way the land-time path does.Implementation Notes
index.WalkVoice(root, logRel, since)ininternal/index/walk.go, sharing the existing directory-walk logic withWalkTranscriptsvia a new privatewalkLandingDirhelper (dedup, not new abstraction — the two walks were already structurally identical). Voice notes only ever land as.md(seeinternal/log.Filename), soWalkVoicematches.mdonly.runIndex(cmd/index.go) now walks the voice landing zone after the notes/transcripts passes and indexes each file viainternal/log.IndexVoice(the same helperjournal logcalls at land time), reusing the indexer's stable content-hash diffing — unchanged voice notes are a no-op on re-index, and--rebuildre-embeds them like everything else.noteExcludesnow also excludes the voice landing zone from the plain-note walk, mirroring the existing transcripts exclusion. Without this, the voice-note.mdfile would also get picked up by the regular note walk and re-chunked (by heading) assource=note— a second, differently-chunked copy of the same content living alongside the correctsource=voicechunks. Unfilteredjournal searchalready matches every source (Sources: nil= any), so voice notes remain fully searchable without that duplicate.journal indexcommand, per the issue and acceptance criteria.journal index --watchdoesn't drive voice notes throughIndexVoiceeither before or after this change; a landed-while-watching voice note is picked up by the next plainjournal indexrun. Extending live--watchcoverage to voice notes is a separate concern and out of scope here.Changes
internal/index/walk.go— newWalkVoice(voice landing zone walk), refactored shared logic intowalkLandingDir.cmd/index.go—runIndexindexes voice notes viaIndexVoice;noteExcludesexcludes the voice landing zone from the plain-note walk.cmd/index_test.go— new tests (below).CHANGELOG.md— entry under the in-progress3.0.2section.Testing
Automated:
go test ./...,go vet ./...,gofmt -l .clean)New tests in
cmd/index_test.go:TestRunIndexRecoversUnindexedVoiceNote— reproduces the issue: force land-time index failure, then runjournal indexand confirm the note becomes searchable via--source voice; also asserts the plain-note walk scanned 0 files (voice note not double-indexed assource=note).TestRunIndexVoiceNoopReindex— re-runningjournal indexon an already-indexed, unchanged voice note makes zero additional embed calls.TestRunIndexRebuildReembedsVoiceNotes—journal index --rebuildre-embeds voice notes and they remain searchable via--source voice.Manual testing performed:
go test ./...),go vet ./..., andgofmt -l .— all clean.Review Checklist
Correctness
Code Quality
Security
Performance
Tests
Reviewer Notes
The decision to exclude the voice landing zone from the plain-note walk (so voice notes aren't double-indexed under both
source=noteandsource=voice) is a small scope expansion beyond the letter of the issue, but is necessary for correctness — without it,journal indexwould silently create a second, wrong-shaped copy of every voice note's content. Flagging this explicitly for review.