machine: fan-out planner + disjointness guard (runs 07/08 lessons)

(a) Disjointness guard (knowledge/expert.py): a LIST ingest whose members
    don't overlap the entities the parent's evidence names is refused; the
    gather continues to the next article. Run-08's 'flow of Po/Adige/Tiber'
    answered by the Amazon from a world-wide table can no longer happen.
(b) Fan-out planner (floop/machine.py): a 'for each' subquestion over a list
    row expands deterministically into N entity questions + one join.
    Top-N bound respected ('those three' over 22 rows -> top 3 by table
    order, logged). The join is a deterministic sum over the entity rows
    (verified=True: computation is its own proof), partial sums named.
    Entity rows are tagged fan_group in provenance so the join finds them.
Also: LIST ingest keeps TABLE ORDER (ranked tables rank; alphabetical sort
      destroyed the ranking) — dict.fromkeys dedup.
Budget: 40 -> 80 (a 3-entity fan-out needs ~3x a scalar question).

Verified live (cold KG, 2 runs): list ingest in table order, slice top-3,
fan-out -> 3 entity questions + join, Po answered with verbatim quote
(1,460 m3/s). 28/28 tests (fan-out expansion+join, top-N slice, guard).
This commit is contained in:
2026-10-19 20:16:01 +02:00
parent 852db78c99
commit 209909e776
6 changed files with 369 additions and 6 deletions
+4
View File
@@ -35,6 +35,10 @@ class OpenQuestion:
reason: str = "" # init | missing | child-goal
qid: str = "" # assigned by QuestionStack
status: str = "open" # open | answered | failed
# fan-out bookkeeping (set by the machine's planner expansion)
fan_group: str = "" # original qid whose expansion produced this question
fan_join: bool = False # this question is the group's join (sum) question
fan_source: str = "" # the list row eid the expansion reads
@dataclass