feat: two-pass EXTRACT (claims -> typed Facts) for prose chunks
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.
This commit is contained in:
@@ -164,6 +164,8 @@ _STAGE_BY_MODULE = {
|
||||
"MissingSignature": "MISSING",
|
||||
"AnswerSignature": "ANSWER",
|
||||
"ExtractSignature": "EXTRACT",
|
||||
"ExtractClaims": "CLAIMS",
|
||||
"TypeClaim": "TYPE",
|
||||
"AnswerFromKG": "answer_kg",
|
||||
"SelectTableSignature": "SELECT_TABLE",
|
||||
"VerifyCountSignature": "VERIFY_COUNT",
|
||||
|
||||
Reference in New Issue
Block a user