merge: land #195 (watcher/pipeline writes through the brain root, #158 part B) on top of inbox zero and the wing resolver
Reconciled with v0.25.0 semantics: - markers are only the fallback when the original cannot be removed, and are now written through the brain root; the refused set (size+mtime keyed) replaces the path-only 'stuck' set - #195's tests updated for inbox zero (archive written, original retired, no marker), and the planted-marker-link test keeps its point: nothing is ever written through the link, and the note is processed once - the 'cannot retire' test now counts archive copies; it counted LLM calls, which pipeline.Run's source-hash check hides (mutation: removing the remember step left it green) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -409,12 +409,17 @@ func TestProcessDir_DoesNotReingestANoteItCannotRetire(t *testing.T) {
|
||||
},
|
||||
Schema: "# Schema",
|
||||
},
|
||||
stuck: &sync.Map{},
|
||||
}
|
||||
for i := 0; i < 3; i++ {
|
||||
processDir(context.Background(), cfg, "2026-10-19")
|
||||
}
|
||||
assert.Equal(t, int32(1), calls.Load(), "a note that cannot be retired is ingested once, not once per poll")
|
||||
// The LLM count alone proves nothing: pipeline.Run's source-hash check skips
|
||||
// extraction on an unchanged note, so a re-run is invisible there. What a
|
||||
// re-run does leave behind is another archive copy, every poll.
|
||||
archived, err := filepath.Glob(filepath.Join(rawDir, "processed", "2026-10-19", "*"))
|
||||
require.NoError(t, err)
|
||||
assert.Len(t, archived, 1, "a note that cannot be retired is archived once, not once per poll")
|
||||
assert.Equal(t, int32(1), calls.Load())
|
||||
}
|
||||
|
||||
// If the archive copy cannot be written, the original is the only copy left:
|
||||
|
||||
Reference in New Issue
Block a user