feat: two-pass EXTRACT (claims -> typed Facts) for prose chunks #27

Merged
onibot merged 1 commits from feat/two-pass-extract into main 2026-10-26 16:42:28 +01:00
Owner

Pass 1 ExtractClaims (free-form strings, coreferences resolved), Pass 2 TypeClaim (one claim -> one typed Fact, same schema the store eats, orders never produced by construction). extract_mode config-driven, default two_pass, table frags stay legacy. Budget: 1 charge per chunk + 1 per claim. TDD: two_pass_extract 5/5 + two_pass_wiring 2/2 (real store, e2e); suite 29 files green.

Pass 1 ExtractClaims (free-form strings, coreferences resolved), Pass 2 TypeClaim (one claim -> one typed Fact, same schema the store eats, orders never produced by construction). extract_mode config-driven, default two_pass, table frags stay legacy. Budget: 1 charge per chunk + 1 per claim. TDD: two_pass_extract 5/5 + two_pass_wiring 2/2 (real store, e2e); suite 29 files green.
onibot added 1 commit 2026-10-26 16:42:27 +01:00
His diagnosis accepted (26/10): the single-pass EXTRACT's giant typed
JSON array (verbatim quotes + temporal restrictions + sibling orders)
is the output budget behind the 40-minute arithmetic on slow local
models. Two-pass shortens EVERY output:

- Pass 1 ExtractClaims: plain claim strings, coreferences resolved
  (entities named, never pronouns) — near-zero format tax.
- Pass 2 TypeClaim: ONE claim -> one typed Fact per call (same Fact
  schema the store eats; temporal fields optional, containment-checked
  downstream as always). Orders NEVER produced here: one claim at a
  time has no siblings — the legacy Fact keeps orders for the
  single-pass path and table frags, untouched.
- extract_mode: two_pass (default) | single (legacy) — config-driven,
  read from config.yaml's knowledge block by run_app.
- Budget: Pass 1 charges once per chunk; Pass 2 charges once per
  claim. Table frags keep the legacy single-pass call.
- Prompt log: CLAIMS/TYPE stage labels added.

TDD: two_pass_extract 5/5 (signatures, coref law, honest empties) +
two_pass_wiring 2/2 (end-to-end on a real store: two_pass ingests
typed facts with windows kept; single-pass control green). Suite: 29
test files green. The router from #26 makes the upcoming
extraction-model swap a pure config edit.
onibot merged commit 88769c508c into main 2026-10-26 16:42:28 +01:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: onibot/floop#27