Bounded secondary-index range must enumerate duplicate postings #8
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/tek9#8
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Consumer blocker
lost-rob0t/llm-log#15needs a bounded outcome-dataset query over a non-unique Tek9 secondary index. Live integration evidence showed that two durable documents sharing the exact indexed value are both visible throughindex-fetch, but an exact-keyselect-index-rangequery does not reliably enumerate both postings, solimit + 1cannot be used for truthful truncation.Current source
At current
master/ pinned consumer revisiona9f5b595f5d965163d2b7c518c72a2efd9be13fe:index-fetch/index-document-idsexplicitly enumerate duplicate values, but have no result bound;select-index-rangeis the bounded primitive, but advances with genericcursor-next, which loses the exact duplicate-aware guarantee required by a non-unique index range.This is a generic Tek9 query primitive defect, not llm-log-specific schema behavior.
Required contract
RED first in
tests/test-indexes.lisp:aand one has keyb;select-index-range db index "a" :end "a"returns bothadocuments;:limit 1returns exactly one and:limit 2returns exactly two duplicate postings;a..brange retains all postings in deterministic key/document order;Implementation boundary
Fix the existing public
select-index-rangeprimitive rather than adding an llm-log-specific escape hatch. Use LMDB duplicate-aware cursor movement so one seek can traverse(key, duplicate-id)postings while respecting the global result limit and inclusive end key.No full scan and no unbounded materialization.
Acceptance
Tek9 test suite GREEN on exact head, then llm-log must pin that exact tested Tek9 revision and its #15 outcome-dataset integration fixture must independently go GREEN after expert-host restart.