Repository navigation
fix(kb): a collection appears on its first write, not with its entity (#19725) - #20684
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 47 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Code review on PR #20684 (head a9185a8): changes needed. Read against the diff and
Not checked: what |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
|
Code review on PR #20684 (head a42688e): approve. Covers the delta since a9185a8, read against the diff; tests not run. Left open, not blocking: the guard misses |
Thinking Path
#19725: most Chroma collections were empty because creating a work item, company, project or sprint made one straight away. Writers already use
get_or_create_collectionthrough the one name builder, and the readers cope with a missing collection (_peer_search,companies,ac_suggester,capability_indexer,decision_log,work_item_kb,rag_assembler). One didn't:sprint_summarizermatched on error text the adapter doesn't produce, so it now usesget_collection_or_none. So the eager calls only produced the empties.The issue's open question about
work_item_<id>againstwork_item:<id>: they are one name. The KB client maps:to_because Chroma rejects:(kb_chroma_clientinllc/kb/collections.py).What Changed
test_create_kb_failure_rolls_back_no_commitis removed because that failure can't happen now.archive_collectionlogs a missing collection at debug, since that's now the usual case when a work item finishes.work_item_kbandartifact_ingestornow pass theentity_typeandentity_idmetadata the old creator set, since it can't change after creation.ensure_collectioncalls underllc/, and no hand-builtwork_item_{...}style names.KbCollectionManager.ensure_collectionnow has no production caller and stays: the health-scan proposal on #19725 is its next caller.Refs #19725. Still open, in follow-ups: the vector browser hiding empty collections, which adds a UI string and so waits for #20662, and the health scan's approval-gated proposal. Existing empties are untouched (#17038).
Verification
Tests pass locally across the new guard,
test_sprint_summarizer, the company create and authz tests,test_kb_collection_names_19519,test_kb_collections,test_sprints_idorandtest_suggest_ac_endpoint. Not run on a host. Reader tolerance was checked by reading each call site; onlysprint_summarizerhas a test for it.Model Used
Claude Opus 5.5