Repository navigation
dedup(knowledge): the Chroma adapters share their argument shapes (#18557) - #20473
Conversation
…8557) The sync and async adapters repeated the same normalisation for add, upsert, update, get, query and delete, and the same collection provenance. They now build these in _chroma_args and make their own calls. A guard stops the copies returning.
|
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 19 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. |
✅ SSOT Configuration Compliance: Passing🎉 No new hardcoded values of either class — Known backlog in |
Auto-sync: merging
|
| side | commit | subject | issue refs |
|---|---|---|---|
| main | 8e17b7290 |
fix(train): reach floors return to mid-window on the merged tree (#20444) | #20444 |
| this branch | 6942f729a |
chore(guards): re-pin the reach floors the pre-push gate reported stale (#18557) | #18557 |
Thinking Path
#18557 lists a "Chroma adapter pair" with no paths. It is
knowledge/backends/chromadb_adapter.pyandasync_chromadb_adapter.py, which repeat the same argument handling and differ inawait. The sync and async calls can't share a body, but what they send can.What Changed
knowledge/backends/_chroma_args.py: new pure functions for the arguments ofadd,upsert,update,get,queryanddelete, and for a new collection's provenance.shared_helper_cores_18557_slice6_test.pyfails if either adapter reshapes an argument itself, rebuilds a filter block, or stamps its own provenance.Verification
With either adapter put back to main's version, the guard fails:
chroma_args_test.pyasserts the exact raw calls forupsert,get,queryanddeleteon both adapters, plusquery_batchon the async one, and the shapes for an empty sequence,limit=0, an emptywhereand adeletewith no filter. Acode-reviewerpass compared every call with main's code and found no change in the arguments sent.Not checked: a real ChromaDB. I did not check why the 40 tests skip; the contract suites skip their ChromaDB half when only the conftest stub is present (#13242), so expect that to be it.
add,updateand the two collection-creating client methods have no adapter-level test here. Their shapes come from the same functions.The repin exited 2 because 14 guard modules don't import in the local environment, so their floors weren't measured. The pre-push gate then passed.
Risks
utc_timestampon an adapter module would no longer take effect. None does.[*ids]or an aliased timestamp import would get past it.Differences left in place, since neither has a production caller I found that hits it:
_chroma_safe_name; the sync one doesn't, so a sync call with a:in the name would reach ChromaDB as written.metadataandconfiguration; the async one doesn't. That search coveredknowledge/andservices/knowledge/only.Model Used
Claude Opus 5.5
Issue Link
Refs #18557
🤖 Generated with Claude Code