Commit graph Huginn/crates/huginn-daemon/tests
Author SHA1 Message Date
Meta Vens
4a4d8b029e Bound the whole search path by the search's own time; lag is not a rebuild
Soul pass 2 follow-ups F1, F2, F4, F5 on the semantic index.

F1: every call a search makes (identity reads, label read, embed, query) is
bounded by what remains of one Budget, and the queued ticket carries the moment
SEARCH_DEADLINE after it was asked. The ports take the bound per call
(model_identity, describe, search); QUERY_EMBED_TIMEOUT is gone, since the
ticket's deadline is the one number. A hung identity read frees the worker
within the search's time.

F2: one refusal predicate. Behind is lag and no longer refuses; only
Reconciling, Failing and Refused do, for the sink and the projector alike. The
worker absorbs the inbox before taking a search and leaves the search queued
while the writes ahead of it are unfinished, so a client that admits and then
searches reads its own writes. An index being rebuilt is still refused.

F4: the model-changed refusal and the worker's failure answer to queued
searches name the state and the pending count.

F5: a search that fails for its own reasons no longer forgets the
reconciliation; only a changed model or label does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:42:03 +02:00
Meta Vens
e899c65774 Give the live index smoke the embed bound
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 17:53:24 +02:00
Meta Vens
5eea49f756 Cut 11b: the semantic read, joined back through the mind
Qdrant supplies candidate ids and scores and nothing else. Mind::rank drops
every hit the mind does not hold, then lets CultNet's selection decide
membership over the whole mind with its keys narrowed to the candidates, so
in_force and cited mean what they mean in query. Order is score then ordinal;
the page is cut to the selection's limit and top_k; next is never set. A
cursor with semantic, blank text and an out-of-range top_k are refused by name
before anything is embedded. Mind::query loses its semantic parameter and the
"index is not wired" refusal; the published request schema's description of
SemanticQuery follows.

The serve loop never waits on the embedder: a semantic query becomes a Search
held beside its session, the worker embeds (behind the model's query
instruction) and searches between batches, and the loop answers when the
worker has or when ServeOptions::search_timeout passes. A worker that is
Failing or Refused refuses at once, typed Unavailable naming its own error.
VectorIndex gains search; Qdrant's adapter sends no filter.

Model identity is re-read before every flush and before every search: a model
re-pulled under the same dimensions but a new digest forgets the
reconciliation instead of mixing vectors, and the next step rebuilds. An idle
worker forgets the reconciliation every Backoff::recheck (60 s), so a lost
collection is found without a write. Both go through Projector::reconcile,
still the one judge.

Also fixes a race in the worker loop found by the mutation runs: entries were
taken from the inbox under one lock and published as wanted under another, so
whoami could read a stale Current with nothing queued while the worker held
them. Taking, absorbing and publishing are now one critical section.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 13:37:01 +02:00
Meta Vens
108ed8168c Live index smoke labels its scratch collections with a mind
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 10:09:43 +02:00
Meta Vens
38059c9599 Cut 11a: a live adapter smoke against a scratch collection (ignored by default)
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-09-29 08:05:27 +02:00