research: conflicts taxonomy + temporal restrictions + derived answers (design docs)

Findings from the 24-25/10 session (live runs, glm-5.3-flash):
- The A/B (his question, cold KG): glm cloud 148s -> Rajoy; qwen local
  50min -> honest UNKNOWN (KG held Rajoy; a noise row misled it).
- The (K5) bug: judge value contamination kills the ablation audit
  silently; repro shows the detector works with a clean value.
- dspy disk cache replays repeated runs (measurement law recorded).
- The conflicts inventory: 20 pairs, zero real contradictions — the
  4-case classifier conflates conjunction/paraphrase/temporal/polisemia.

RESEARCH-derived-answers.md: the design growing from all of it:
merge-time taxonomy (co-asserted / temporal / alternatives / real),
temporal restrictions (not Allen labels) on the typed Fact extractor,
and a derived-answer engine (typed query DSL + goal-directed proof,
no LLM judge in the loop). Span: knowledge/ + floop/ — doc at code/.
This commit is contained in:
2026-10-25 15:28:32 +01:00
parent 0f5a3f4ceb
commit 9cfc068ad6
2 changed files with 350 additions and 1 deletions
+80 -1
View File
@@ -130,4 +130,83 @@ rows were never extracted".
- The mask/ablation audit (dst-first law, run-L fix) — it gains signal.
- Anonymization before INIT (PR-16/17) — orthogonal.
- The branching design — still pending discussion; this branch may
feed it better questions, but does not implement it.
feed it better questions, but does not implement it.
## Findings from the live A/B and the (K5) bug (24–25/10, glm-5.3-flash)
**The A/B he asked for** (his question, cold KG both sides, dspy disk
cache deleted per run):
- glm-5.3-flash (cloud, cold KG): Rajoy, correct, 28 calls, 148 s.
- qwen3.8-27b (his PC via the house router, cold KG): honest UNKNOWN,
33 calls, 3,025 s. The KG HELD Rajoy (K12 "Rajoy recommended Sánchez
as his successor") — the judge lost it to a noise row ("ninth
president of Socialist International" made it read "that specific
presidency" as the SI).
- Warm-KG glm answered "Sánchez himself" (the third-succeeded-second
reading trap). Substrate state weighs as much as the model.
- Cloud is non-deterministic at temperature 0: identical INIT prompt,
two different decompositions (2 vs 3 subquestions) across runs.
- MEASUREMENT TRAP (both A/B sides): dspy.LM defaults cache=True and
persists to ~/.dspy_cache ACROSS processes and days, keyed on the
request (model+prompt+params, not base_url). A repeated question is
a byte-identical REPLAY wearing inference's clothes (0.4 s "runs").
Proven by curl (server does not cache) and by running the whole app
in an isolated netns (unshare -rn) — it completed with no network.
rm -rf ~/.dspy_cache before any run that must be fresh.
**The (K5) bug — the audit's silent death** (run 085457):
- glm answered Q1 ("which country or organization was he President
of?") with value="Socialist International (K5)" — the row-id glued
to the value, because AnswerFromKG says "cite rows by id" but has NO
citation output field. The judge sees K{i} ids (positional
enumerate indices over the probe's view — NOT store keys), so it
cites in the only field it has.
- _audit_ambiguity's _carries looks for the value inside row dsts:
"socialist international (k5)" is in no dst → support = [] → "the
judge invented it: nothing to ablate" → silent return. The audit
never runs. Repro on the warm KG: raw value → no audit; cleaned
value ("Socialist International") → ambiguous=True with Spain
alternatives (two rounds). The detector works; the interface kills
it. Value contamination is systematic with glm-5.3-flash, three
observed shapes: "(K5)" suffix, parenthetical reasoning ("2018
(Pedro Sánchez has been Prime Minister … cited from rows K16 and
K30)"), and a DATE question answered "15 (list of 15 members: …)"
via the LIST path.
- SECOND violation: pred.value.strip() enters the evidence payload
untyped — "typed payloads, never LLM prose" broken at the same spot.
- FIX DIRECTION (agreed, not yet coded): clean at the judge's output
boundary (_answer_from_rows), regex-anchored to trailing
row-citation shapes only ( "(PSOE)" inside a name is legitimate and
must survive).
**Run 090402 — the branch's own machinery, live and green:**
- Semantic probe live via VPS-local nomic-embed-text (his PC was down;
the house router had cloud-failovered and ollama.com has NO
embeddings API — same model pulled locally, identical vectors,
tau=0.45 calibration holds). "+9/+11 edges the lexical probe missed"
on both subquestions; final Rajoy correct.
- 0 AMBIGUOUS is CORRECT for this run: INIT decomposed to 2 subqs
(term-start → predecessor) and never asked "of what", so no scalar
answer ever faced the three readings. The ambiguity needs either
the "of what" subquestion or the conflicts-table signal (below).
- INFRA PITFAL: the code venv carries an editable-install pth that
pins imports to MAIN's tree — a PYTHONPATH shim that imported
knowledge.expert silently resolved to main and ran main's pipeline
inside the branch worktree (run 085457 was main code with the
branch's config; its "compose -> queries" line is main's
deterministic composer). Always assert the resolved module path
when running branch code with the shared venv.
**The conflicts inventory (20 pairs in the live KG, ZERO real
contradictions):** 10 same-quote "called for" (co-asserted
conjunction, one platform sentence split into 5 triples), 5
cross-quote "called for" (a multi-valued relation), 3 "position held"
(THE THREE PRESIDENCIES, pairwise — the polisèmia sitting in the
store since ingest), 1 "became" (temporal: 2014 vs 2018 live in the
quotes, ref_date empty), 1 "re-elected as" (entity-diff PSOE/PM).
The taxonomy, the temporal representation, and the answer engine that
consumes all of this are designed in RESEARCH-derived-answers.md (this
branch, same session).