The 4 tools (find_contradictions, find_anachronisms, find_orphans,
find_ontology_violations) now read pre-materialized violation nodes
from Neo4j, populated by seed.py:seed_violations. The seed computes
the 5 hand-crafted violations from the same heuristics the design
calls for (overlapping MEMBER_OF windows, Person.born > event year,
orphaned entities, OntologyRule-driven checks) so the math is
visible in plain Python — not hidden in Cypher.
* plugins/consistency.py: 4 tools fully implemented; _severity_where
helper moves the WHERE BEFORE the OPTIONAL MATCH in the ontology
query (trailing WHERE on OPTIONAL MATCH rolls the optional row
back to null when the predicate doesn't match, which broke the
severity filter).
* seed.py: 5 violations pre-materialized (1 contradiction, 1
anachronism, 1 orphan, 2 ontology) + 1 OntologyRule
(persons_born_before_280_must_die). Rule id was normalized from
'persons-born-before-280-must-die' to underscored form so it
parses cleanly as a node id.
* examples/test_consistency.sh: 10 assertions across 4 tools
(severity filter variants), exits 0.
* tests/test_consistency.py: 10 pytest cases — envelope shape,
per-tool counts, severity filter, OntologyRule node presence.
* README.md: T5 marked done.
Verification:
pytest tests/test_consistency.py 10/10 PASS
bash examples/test_consistency.sh 10/10 assertions, exit 0
bash test.sh no regressions, exit 0
- examples/llm_consumer.py: raw httpx + urllib driver — discovers tools
via tools/list, runs the tool-use loop against LiteLLM (minimax-m3), saves
per-question JSON traces. No agent framework per task scope.
- examples/system_prompt.txt: 5 question types + tool protocol (per
lore-engine/docs/07-reasoning-harness.md).
- examples/run_questions.sh: bash driver — exits 0 iff all 5 questions pass
hand-verified correctness against the seed data.
- examples/results/*.json: traces from a real end-to-end run, all 5 PASS.
- examples/REPORT.md: per-question ground truth vs answer, with tool-call
audit. The model used 9 distinct tools across 5 questions (requirement
was >=4); every factual claim is grounded in a tool result; no
fabrication.