From 2489ce3898298cc32698975cb1455e507ab93443 Mon Sep 17 00:00:00 2001 From: Onibot Date: Mon, 19 Oct 2026 20:24:42 +0200 Subject: [PATCH] stream: show WHAT was answered, not just counts - LIST expert output renders the members (value is just the count; the opaque value=22 hid the actual rivers) - FANOUT line lists the sliced items by name - partial joins name which entity rows are missing --- code/floop/engine.py | 12 ++++++++++-- code/floop/machine.py | 8 +++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/code/floop/engine.py b/code/floop/engine.py index 5ac2e66..fb8ebae 100644 --- a/code/floop/engine.py +++ b/code/floop/engine.py @@ -155,8 +155,16 @@ class KnowledgeEngine: prov["parent_question"] = parent_question note = "" if value.upper() != "UNKNOWN" else "knowledge returned UNKNOWN" if streams is not None: - streams.output("EXPERT", - f"value={value} quote={(ans.get('quote') or '')[:80]} [{src}]") + # LIST rows: value is the COUNT — the members are the real answer; + # render them (first 10, then +N) or the log shows an opaque '22' + if isinstance(ans.get("list_items"), list) and ans["list_items"]: + items = ans["list_items"] + shown = ", ".join(items[:10]) + (f" (+{len(items) - 10} more)" if len(items) > 10 else "") + streams.output("EXPERT", + f"value={value} list={shown} [{src}]") + else: + streams.output("EXPERT", + f"value={value} quote={(ans.get('quote') or '')[:80]} [{src}]") return EvidenceRow( qid=qid, answer_type=answer_type, diff --git a/code/floop/machine.py b/code/floop/machine.py index 73d3611..276b9a2 100644 --- a/code/floop/machine.py +++ b/code/floop/machine.py @@ -230,7 +230,7 @@ class FloopRun: attribute = self._attribute_of(q.text) self.streams.call("FANOUT", f"expanding {q.qid} into {len(items)} entity questions", think=self.tprefix + f"fan-out: {q.qid} over {list_eid}'s " - f"{len(items)} items — one question per item, then a join") + f"{len(items)} items ({', '.join(items)}) — one question per item, then a join") # 1) one entity question per item (no deps: the list row already exists) entity_qids: list[str] = [] for item in items: @@ -288,6 +288,12 @@ class FloopRun: total = sum(nums) partial = len(nums) < len(entity_rows) self.streams.state(f"join: sum of {len(nums)} entity rows = {total}", think=True) + if partial: + missing = [r.eid for r in entity_rows + if r.eid not in ids] + self.streams.state( + f"join partial: {len(nums)} of {len(entity_rows)} values summed; " + f"missing {', '.join(missing)}", think=True) return EvidenceRow( qid=q.qid, answer_type=AnswerType.FUNCTION, payload={"value": _fmt_num(total), "sum_of": ids,