| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
paper_flow set the agent's output_type to the canonical knowledge.Paper,
whose store schema is hostile to OpenAI structured output:
- Paper.nodes is a dict[UUID, TreeNode]; a dict serialises to
additionalProperties, which the Agents SDK strict-JSON-schema mode
rejects ("additionalProperties should not be set for object types").
- With strict mode off, models do not emit RFC-4122 UUIDs, so the UUID
id fields fail Pydantic validation on free-form ids like "intro_node".
Either way the default flow raised before returning, so no real
extraction completed end-to-end.
Introduce a strict-schema-safe LLM target in the apex layer and keep the
canonical store schema untouched (UUID identity + dict map are
load-bearing for dedup/indexing per the storage design doc):
- quantmind/flows/_paper_draft.py: PaperDraft/PaperDraftNode (nested
children, no id bookkeeping) + draft_to_paper(), which assigns real
UUIDs, wires parent_id/children_ids, and injects provenance (source,
arxiv_id, authors, published-date as_of) the flow already knows from
the fetch layer instead of trusting the model to author it.
- paper_flow now targets PaperDraft by default and lifts the result into
a Paper. A caller-supplied output_type still bypasses the draft and is
returned verbatim (isinstance(result, Paper) pass-through), so the
existing override contract is preserved.
As a side effect this fixes empty Paper.arxiv_id/authors: previously the
model was asked to author provenance and routinely left it blank.
Verified end-to-end against the live Agents SDK (gpt-4o-mini): a real
arXiv paper now extracts into a 19-node Paper with UUID ids and survives
a JSON store round-trip. Full verify harness green (248 tests, 90% cov).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
This pull request has been inactive for 14 days and is now marked stale. It will be closed in 7 days if there is no further activity. Comment or remove the stale label to keep it open. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
paper_flow currently cannot complete an end-to-end extraction against the OpenAI Agents SDK, because it sets the agent's output_type to the canonical knowledge.Paper — a store schema that is hostile to structured output:
UserError: additionalProperties should not be set for object types.
Input should be a valid UUID ... 'root'.
Either way the default flow raises before returning — no real paper extracts. This is the migration gap flagged in the README note (#71).
Approach
Keep the canonical store schema untouched — its UUID identity + flat dict map are load-bearing for dedup/indexing per docs/design/en/storage.md — and fix the issue at the apex (flows) layer, which is where the LLM boundary actually lives (and the only layer import-linter allows to import knowledge):
As a side effect this also fixes empty Paper.arxiv_id / Paper.authors: previously the model was asked to author provenance and routinely left it blank.
Verification
Checklist
🤖 Generated with Claude Code