ANW-15 /query endpoint + restart-replay pin + UTC canonicalization

This commit is contained in:
Andreas Brenner 2026-05-14 16:08:13 +02:00
parent da2dfbbd6d
commit b045efd1f0
7 changed files with 784 additions and 9 deletions

View file

@ -443,7 +443,25 @@ impl GenServer for IndexWriterState {
let index = NoteIndex::new()
.map_err(|e| ExitReason::from(format!("index_writer: NoteIndex::new failed: {e}")))?;
self.index = Some(index);
tracing::info!(restart, "index_writer: init");
if restart > 0 {
// Writer-only restart: a fresh empty index has come up while the
// watcher keeps streaming batches at it. Ask `vault_scanner` for
// a full walk via the same `rescan_now` path the inotify-overflow
// recovery uses. Per kaa's pin (ADR-004 amendment 2026-05-14),
// rescan upserts are idempotent on path so in-flight watcher
// batches converge with the rescan.
VaultScanner::cast(
Dest::from(VAULT_SCANNER_NAME),
VaultScannerMessage::RescanNow,
);
tracing::info!(
restart,
"index_writer: init -- rescan_now dispatched to vault_scanner"
);
} else {
tracing::info!(restart, "index_writer: init");
}
Ok(())
}