knowledge: PR-2 opportunistic harvest + seen-index #2

Merged
onibot merged 1 commits from feature/skim-pr2 into main 2026-10-20 15:02:39 +02:00
Owner

PR-2 of the skim (KNOWLEDGE.md §7) — the opportunistic harvest: goal-relevant tables seen in passing are ingested as typed edges (zero LLM), plus the run's seen-index and link queue.

What lands:

  • _harvest_side_tables: tables beyond the LIST answer whose caption/header carries a goal term AND whose entity column overlaps the entities in evidence → rows ingested as scalar edges (subject = entity, relation = value-column header, object = value + unit from the caption, quote = verbatim row, containment-checked). Deterministic; ambiguous tables recorded as leads, never guessed; the bounded-LLM promotion of leads is PR-3.
  • Seen-index per run: no article is fetched twice in one run.
  • Link queue: goal-region links join the fetch order (capped); hops still live in the plan.

Verified live (cold temp store, real Wikipedia): during Q1's fetch of the Italy list article, the harvest ingests the discharge table; the probes that Run G's Q5/Q6 died on now return adige | Flow at the mouth | 235 m3/s and tiber | Flow at the mouth | 239 m3/s from the KG.

Tests: 4 new (knowledge/tests/harvest.py), suite 39/39 green. Builds on PR-1 (#1, merged).

**PR-2 of the skim (KNOWLEDGE.md §7)** — the opportunistic harvest: goal-relevant tables seen in passing are ingested as typed edges (zero LLM), plus the run's seen-index and link queue. What lands: - `_harvest_side_tables`: tables beyond the LIST answer whose caption/header carries a goal term AND whose entity column overlaps the entities in evidence → rows ingested as scalar edges (subject = entity, relation = value-column header, object = value + unit from the caption, quote = verbatim row, containment-checked). Deterministic; ambiguous tables recorded as leads, never guessed; the bounded-LLM promotion of leads is PR-3. - Seen-index per run: no article is fetched twice in one run. - Link queue: goal-region links join the fetch order (capped); hops still live in the plan. Verified live (cold temp store, real Wikipedia): during Q1's fetch of the Italy list article, the harvest ingests the discharge table; the probes that Run G's Q5/Q6 died on now return `adige | Flow at the mouth | 235 m3/s` and `tiber | Flow at the mouth | 239 m3/s` from the KG. Tests: 4 new (`knowledge/tests/harvest.py`), suite 39/39 green. Builds on PR-1 (#1, merged).
onibot added 1 commit 2026-10-20 15:02:35 +02:00
The Italy run re-searched from scratch for Adige/Tiber discharge after Q1
had already fetched the article that contains it. PR-2 makes the skim
harvest what it sees in passing:

- _harvest_side_tables: goal-relevant tables beyond the LIST answer are
  ingested as typed scalar edges — zero LLM. Detection is deterministic
  and goal-directed: the table's caption/header must carry a GOAL term
  (the vocabulary the goal asks for, e.g. 'flow' in 'Flow at the mouth');
  the entity column must overlap the entities the parent's evidence names
  (a world discharge table is refused for Po/Adige/Tiber); the LIST
  answer's own table is skipped. Rows become edges: subject = entity
  cell, relation = value-column header, object = value + UNIT (the unit
  lives in the caption — quantities carry values AND units), quote = the
  verbatim stored row line, containment against the stored table text.
- A quantity table with no goal-vocabulary match is RECORDED as a lead
  (logged), never ingested on the unit pattern alone — the bounded LLM
  promotion is PR-3's call, by design.
- Seen-index (per run): articles already fetched are reused, zero
  re-fetch for later questions in the same run.
- Link queue: goal-region links from skim sheets join the candidate
  order (capped 12/article); hops still live in the plan — the law stands.
- config: skim_harvest / skim_harvest_max_tables / skim_link_queue.

Live smoke (cold temp store, real Wikipedia): harvesting the Italy list
article during Q1 ingests the discharge table; the Q5 probe
('average annual water flow discharge adige') and Q6 probe now return
'adige | Flow at the mouth | 235 m3/s' and 'tiber | Flow at the mouth |
239 m3/s' from the KG — the exact data Run G died without.

Tests: 4 new (knowledge/tests/harvest.py), suite 39/39 green.
onibot merged commit be320fd6a3 into main 2026-10-20 15:02:39 +02: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#2