watcher: a marker write that fails for a reason other than ErrNotRegular is only logged, so the note is retried every round #199

Open
opened 2026-10-05 21:47:40 +00:00 by mathias · 0 comments
Owner

Source: PR #195 review round 2 (non-blocking), 2026-10-05. Already on main; I found it by reading the code and have not reproduced it.

processFile in ingestion/internal/watcher/watcher.go writes the .processed and .failed markers. Since #195, a refused write (brainfs.ErrNotRegular) returns an error and the note is remembered, so it is not retried. Any other failure is still only logged, for example ENAMETOOLONG for a note name near 255 bytes plus the .processed suffix. Then:

  • no marker exists,
  • the note is not remembered,
  • the next round runs the pipeline (an LLM call) again,
  • and this repeats forever.

Fix: remember the note after any marker-write failure, not only ErrNotRegular, keyed by size and mtime as now. Or refuse note names whose marker name would exceed NAME_MAX before calling the pipeline.

Test: a note whose name is 250 bytes, run for 3 rounds; assert the model is called once.


Created via git-mcp on behalf of @mathias

**Source:** PR #195 review round 2 (non-blocking), 2026-10-05. Already on main; I found it by reading the code and have not reproduced it. `processFile` in `ingestion/internal/watcher/watcher.go` writes the `.processed` and `.failed` markers. Since #195, a refused write (`brainfs.ErrNotRegular`) returns an error and the note is remembered, so it is not retried. Any other failure is still only logged, for example ENAMETOOLONG for a note name near 255 bytes plus the `.processed` suffix. Then: - no marker exists, - the note is not remembered, - the next round runs the pipeline (an LLM call) again, - and this repeats forever. **Fix:** remember the note after any marker-write failure, not only ErrNotRegular, keyed by size and mtime as now. Or refuse note names whose marker name would exceed NAME_MAX before calling the pipeline. **Test:** a note whose name is 250 bytes, run for 3 rounds; assert the model is called once. --- _Created via git-mcp on behalf of @mathias_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mathias/hyperguild#199