You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug(llc): the KB context's sources answers tenancy, not where the document came from #17618
So on the LLC side sources means the company a chunk was inherited from, not the
document it came from. The document's provenance rides along inside each chunk's metadata and is never surfaced. A caller asking where a chunk came from receives a
tenant id, with no signal that it answered a different question.
Why it is its own issue
It is independent of the other two provenance defects found under #17527 and has a
different cause:
All three are one shape — a plausible value from a different question, with nothing
signalling the substitution — but each needs its own fix, and this one was reached by
asking what the LLC leg of #17527's round trip actually returns.
The cause is the third row.sources answered tenancy because there was no
single field it could have answered with: metadata["source"] is a filename, a
URN, a literal category or free text depending on the intake leg, and for a
connector-ingested fact the key does not exist.
Fixed
document_sources is returned beside sources, from knowledge/provenance.py's accessor, which speaks all five dialects and returns
nothing for a shape it does not recognise rather than a placeholder.
The tenancy list is deliberately unchanged — a caller relies on it, and removing it
to make room for the other meaning would trade one wrong answer for a break.
Acceptance criteria
The document's origin is retrievable from the LLC context, not only the
tenant's — document_sources, asserted in llc/tests/test_context_builder_document_sources.py.
sources keeps its existing meaning and its existing callers.
A chunk whose provenance is unrecognisable adds no entry, rather than a
placeholder.
The key is present on an empty result, so a caller need not branch on whether
it exists.
The chunk still carries its raw metadata, so a caller that knows a leg's
dialect better than the accessor does can read it directly.
✅ AC1 document_sources returned at autobot-backend/llc/kb/context_builder.py:279; test llc/tests/test_context_builder_document_sources.py::test_document_origin_is_surfaced_alongside_the_tenancy_list
Activity
mrveiss commentedon Oct 12, 2026
AC evidence (merged in #18504, e83eb77)
document_sourcesreturned atautobot-backend/llc/kb/context_builder.py:279; testllc/tests/test_context_builder_document_sources.py::test_document_origin_is_surfaced_alongside_the_tenancy_listsourcesunchanged (context_builder.py:271-276);test_the_two_lists_answer_different_questionstest_a_chunk_with_no_recognisable_provenance_adds_no_entrycontext_builder.py:256);test_no_results_still_carries_the_keymetadata(context_builder.py:268);test_the_chunk_still_carries_its_raw_metadataAll verifiable criteria met on origin/main; issue stays closed.
feat(kb): one accessor for five provenance dialects, every reader mig…
fix(kb): record the provenance scan's reach verdict (mrveiss#17618)
fix(kb): the agentic citation keeps the writer's own source label; th…
fix(kb): split document_origin under 30 lines, re-pin the chunker flo…
fix(train): train-8b CI reds on the merged tree — SLM generated types, …
Merge origin/main into issue-17527-round-trip: main already carries t…
chore(kb): merge main; the provenance accessor and the citation-label…