fix(llm): reject nonconforming structured payloads - #1553
seonghobae wants to merge 6 commits into
Conversation
Signed-off-by: Seongho Bae <me@seonghobae.me>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (6)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughPydantic LLM payload models now reject unknown fields and implicit type conversions. Project graph confidence values must be finite and within ChangesStructured output contracts
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to Structured LLM payloads now reject unknown fields, coercions, and invalid confidence values before graph persistence. The validated confidence values are propagated directly, with no remaining concrete merge-blocking risk identified. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Pull request was converted to draft
Assisted-by: OpenAI Codex Signed-off-by: Seongho Bae <me@seonghobae.me>
|
Exact-head repair |
Signed-off-by: Seongho Bae <me@seonghobae.me>
Remove the unrelated OpenAI SDK wire-path migration and private serializer assertion from the structured-payload repair. Preserve strict product-owned payload validation while leaving transport migration to the released contextual-orchestrator contract.\n\nAssisted-by: OpenAI Codex <codex@openai.com>
Pull request was converted to draft
Record Naruon PR #1553 exact-head validation and the removal of unrelated OpenAI SDK transport churn from the product-owned payload hardening slice.\n\nAssisted-by: OpenAI Codex <codex@openai.com>
목적
Naruon이 소유하는 구조화 의미 payload의 검증 경계를 강화합니다. 이 PR은 provider/model routing 또는 OpenAI-compatible transport를 승인하거나 구현하는 PR이 아닙니다.
Exact identity
develop@042b0c70531b229af3acbd0421a2f23098d848b3codex/goal21-json-schema-currentc05948278b1b23932bb73215a4235d4ed855f4bb4643e3404e01a3c860cdbddb225000493357bb07behind_by=0; product/test delta remains exactly six filesRetained product delta
The useful delta is provider-agnostic schema hardening:
ExtractionResult,ExtractionPayload, its nested object/relation payloads, andGroundedAnswerPayloaduseConfigDict(extra="forbid", strict=True).extra=ignorebehavior.These payload models are Naruon product/domain contracts and can be hardened independently of transport ownership.
Architecture repair after live review
The predecessor test file used a real
AsyncOpenAIclient, synthetic provider URL/API key, literalorchestrator/freemodel selection, and direct_call_llm(...)seams to prove an OpenAI-compatible wire envelope. That characterization may describe current protected-base behavior, but it also encoded the wrong authority: Naruon must not define provider URL, credential, model, group, pool, or fallback semantics for production LLM work.A fresh 2026-09-04 owner read still returns zero GitHub Releases for
ContextualWisdomLab/contextual-orchestrator, so there is no immutable released consumer API/client/schema/runtime contract that this PR can truthfully bind to.Direct non-force child
9efd4425323dfa9f768569ca085a0ec335601308replaces those transport tests with provider-agnostic Pydantic contract tests. They verify top-leveladditionalProperties=false, runtime rejection of unknown top-level and nested project-graph fields, and strict scalar rejection without asserting any provider/model/base URL/API-key/OpenAI-SDK transport.Direct non-force child
13754d679eba8c997e27cf42cfed6e1ae60cefc6removes the predecessor's unrelated parenthesis-indentation churn fromllm_service.py; protected-base comparison now shows that file's effective delta is only theConfigDictimport/config needed for payload validation.Current non-force child
4643e3404e01a3c860cdbddb225000493357bb07removes a later, unrelated migration fromclient.beta.chat.completions.parseto the stable SDK namespace and its privateopenai.lib._parsingassertion. The installed OpenAI SDK supports both paths, but choosing Naruon's future wire contract is outside this payload-hardening slice and remains blocked on a released contextual-orchestrator consumer contract.Existing direct
AsyncOpenAIproduction seams visible on protecteddevelopare migration debt owned by the broader contextual-orchestrator consumer work; this PR does not treat them as a valid architectural exception merely because it touches their payload classes.Relation to #1529
This PR does not fully supersede #1529. #1529 retains useful structured-output wire characterization but is correctly Draft pending an immutable contextual-orchestrator consumer contract or fail-closed production migration. Closing it as fully inherited would lose its transport fixtures/evidence before they are recreated at the canonical released boundary.
The valid portion inherited here is only the fail-closed structured payload requirement. Any eventual wire/E2E successor must exercise the released contextual-orchestrator contract rather than reconstructing provider routing in Naruon.
Verification boundary
On exact head
4643e3404e01a3c860cdbddb225000493357bb07, 71 focused payload/service/extractor contracts and the full backend suite (1820 passed, 33 skipped) pass;git diff --checkalso passes. Fresh exact-head hosted checks/reviews must still be read after this push. Keep Draft until one unchanged exact head has every then-live protected repository/organization check terminal-success, zero valid unresolved findings/threads, and the qualifying independent post-last-push approval required by live governance.No self-approval, bypass/admin merge, force-push, destructive rebase, mutable owner dependency, direct-provider fallback, dummy/no-op requeue commit, or predecessor-evidence transfer.
Summary by CodeRabbit
Validation
Tests