fix(dual-solve): read grounding items from the context-pack dict#502
Open
Yurii214 wants to merge 1 commit into
Open
fix(dual-solve): read grounding items from the context-pack dict#502Yurii214 wants to merge 1 commit into
Yurii214 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Walkthrough
ChangesContext pack grounding
Estimated code review effort: 2 (Simple) | ~10 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
e6a3283 to
2231e2b
Compare
Member
|
/auto-merge |
ground_prompt gated its items on isinstance(pack, ContextPack), but build_context_pack returns a model_dump'd dict in production, so the guard was always false and grounding always returned "the knowledge base has nothing on this topic yet." — even when the kb had matching claims. dual-solve therefore never fed the code engines any kb context. read items from the dict (tolerating a ContextPack object too), mirroring synthesize's grounding. the existing test monkeypatched build_context_pack to return a ContextPack, so it exercised the dead branch and masked the bug; add a regression that drives the real, unmocked pipeline.
2231e2b to
debb239
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ground_promptgated its items onisinstance(pack, ContextPack), butbuild_context_packreturns amodel_dump'd dict in production (its signature is-> dict[str, Any]). so the guard was always false,itemswas always[], and dual-solve grounding always returned "the knowledge base has nothing on this topic yet." — even when the kb had matching claims. the code engines never received any kb context; the whole grounding feature was silently dead.this reads items out of the dict (tolerating a
ContextPackobject too), mirroring the shape handling already insynthesize.py.the existing
test_ground_prompt_renders_itemsmonkeypatchedbuild_context_packto return a realContextPack, so it exercised the dead branch and never saw the production dict shape — which is why the bug was invisible to the suite. addedtest_ground_prompt_renders_real_context_pack, which seeds a real claim and drives the unmocked pipeline.repro before: a kb with a claim matching the query still yields "nothing". after:
- [c1] auth uses jwt tokens.verified:
pytest tests/test_dual_solve.py,mypy src,ruff check src testsall green.Summary by CodeRabbit
Bug Fixes
Tests