Chapter 13 — Typed field extraction¶
Mental model¶
A separate spine with its own worker and narrower failure taxonomy.
Recipe D: occam_playbook_resolve → schema match → occam_extract_knowledge. Caller must supply knowledge_schema (or rely on resolved schema). There is no schema-free mode. Output is facts[] plus Receipt telemetry—not Receipt v1.
Hard dependency: PS-4 extraction requires PS-5 playbook resolution.
Explanation¶
What the tool returns¶
facts[]— Typed fields per caller schema (selectors, types, row shapes where supported).meta.koId— Knowledge object identifier when configured.Receiptobject{ confidence, elapsedMs }— Extraction telemetry only (OD-5). Unsigned. NocontentHash, no signature, no Merkle root.occam_verifydoes not accept it.confidencein telemetry is heuristic—often0.0; not a correctness guarantee.
What this path skips¶
Compared to occam_transcode (Chapter 4):
- No
OccamRouterpost-processor pipeline (thin/challenge reclassification path differs) - No token budget (
max_tokensignored) - No Receipt v1 signing
- Browser leg may spawn throwaway Playwright per call (no pool reuse on browser fallback)
session_profilestorageStateis applied on the CSS extract browser-fallback leg (same as transcode).
Row mode¶
Host parsers do not set base_selector for row mode—row mode is dead. Document field/list selectors only.
Security (do not point at untrusted URLs)¶
- css-extract lacks DNS pinning and body cap on some paths.
- Nuxt
readNuxtPathevaluates page-controlled state viaeval().
Typed extraction is for known site shapes with operator-authored schemas, not arbitrary open-web scraping.
Task R step 10¶
Extract {limit, window, scope} via schema saved in Chapter 12 instead of re-parsing markdown.
CHECK¶
NETWORK
- Call
occam_extract_knowledgeandoccam_transcodeon the same URL withmax_tokensset on both. - Assert: extract ignores budget; transcode respects it.
- Assert: extract
Receipt.confidenceis heuristic (often0.0); no signedreceipt.signedenvelope on extract response.
Attempt occam_verify on extract telemetry—it must reject/not apply.
Common misconception¶
"occam_extract_knowledge returns a Receipt, so its output is verifiable."
The wire field named Receipt is extraction telemetry, not Occam Receipt v1. Only signed extraction envelopes from transcode/claim paths verify.
Limitations¶
- Worker timeout hardcoded ~45s.
- No Merkle citations from extract path—for quotable proofs, use transcode +
claim_check(Chapter 14, future Ch 16). - Values are as-extracted, unsigned—schema validation is structural, not truth.
- Do not present as safe for untrusted URLs until EF-013/043 mitigations ship.
Links¶
Public docs: Structured extraction · Examples: structured extraction · Tools: occam_extract_knowledge
Next chapter: Chapter 14 — What a receipt proves