arborist/tests
russell@unturf.com 4fada8e22e
tests: anti-regression layer for the seven-point program (23 tests)
Each directive gets a structural pin in tests/test_directives.py.
A future PR that silently weakens a directive fails by name.

D1 (no LLM in hard verifier path):
  - verify_quotes / verify_claim_lattice / verify_claim_lattice_json
    signatures must NOT carry chat_client / llm / judge / model
    parameters.
  - SCHEMA_SQL verifier_method CHECK constraint enum excludes
    'llm', 'model', 'judge', 'nli', 'hermes', 'ai'.

D2 (Hermes emits pointer clauses):
  - ANSWER_MODES contains both lattice variants.
  - DEFAULT_ANSWER_MODE in ANSWER_MODES.
  - parse_pointer_claims returns structured (claim_text, pointer_ids)
    nodes from pointer-line input.

D3 (build CTI internally):
  - Runtime parses pointer-line prose into typed claim nodes
    (text + pointer_ids list); model never produces structured
    output directly in pointer mode.
  - Evidence map built by runtime from retrieved chunks; pointer
    ids minted sequentially; evidence ids content-addressed.

D4 (bind retrieval AND evidence map):
  - build_run_dag accepts evidence_map_root parameter (✓).
  - Marker test: build_run_dag does NOT yet accept retrieval_plan_hash
    parameter; flip when ticket #000001 lands.

D5 (deterministic pointer verify):
  - verify_claim_lattice is deterministic: same inputs → same
    verdict byte-for-byte.
  - _claim_textually_overlaps_evidence (the per-pair coverage
    check) is a pure function with no LLM-side parameters.

D6 (anchor-class warrant before NLI):
  - warrant_check signature is lexical-only (no chat_client / llm
    / judge / nli params).
  - Date-anchor failure case fires (year missing from cited spans).
  - Relation-shape failure case fires when ALL proper-noun anchors
    are missing from cited spans.
  - Marker test: per-shape detectors for entity-list / count /
    why-cause shapes are absent today; flip when ticket #000003 lands.

D7 (rename labels honestly):
  - Renderer maps STRICT → EVIDENCE-LINKED for claim_lattice* methods.
  - Renderer keeps STRICT for quote / span / entity / paraphrase
    methods (those verify against pinned spans, not synthesis).
  - SCHEMA_SQL audit_mode CHECK constraint enum stays
    {STRICT, HYBRID, UNGROUNDED} regardless of renderer relabel.

D8 (test-pinning before automation):
  - docs/seven-point-program.md exists.
  - bench/qa_sweep.py exposes _directive_compliance helper.
  - docs/TICKETS.md indexes the partial directives (D3, D4, D6) so
    the design log doesn't drift from the program doc.

23 new tests; full suite 692 passed (was 669, +23).

The "marker" tests for D4 and D6 document open work: today they
assert that a parameter / detector is ABSENT; when the corresponding
ticket lands, the assertion flips to PRESENT. The test failing
during ticket implementation is the expected signal, not a
regression — the test message names the ticket so the work-in-
progress is legible.
2026-05-01 16:32:08 -04:00
..
crawler crawler: skip feeds + sitemaps at ingest (they're discovery, not knowledge) 2026-04-29 05:55:28 -04:00
fixtures verify: strip wikitext from context before substring matching 2026-04-28 15:48:07 -04:00
__init__.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
test_bench_qa_sweep.py bench: per-row directive_compliance + 'directive coverage' summary section 2026-05-01 16:20:25 -04:00
test_burn.py cli: 'aborist burn-kindergarten' — mass-burn fresh providence rows 2026-04-29 16:56:59 -04:00
test_burn_doc.py cli: extend 'aborist burn' to documents and cores 2026-04-28 17:32:40 -04:00
test_claim_lattice.py qa: pointer-format includes source title + chunk prefix; lock EVIDENCE-LINKED label 2026-05-01 13:52:38 -04:00
test_cli_render.py qa: pointer-format includes source title + chunk prefix; lock EVIDENCE-LINKED label 2026-05-01 13:52:38 -04:00
test_compress.py storage cheats + TF-IDF retrieval fix 2026-04-27 17:24:51 -04:00
test_concepts.py concept overlay: synonym expansion + rivalry exclusion 2026-04-27 12:34:00 -04:00
test_dag.py qa: chain-segment failure localization + re-prompt repair tier 2026-04-29 19:27:33 -04:00
test_directives.py tests: anti-regression layer for the seven-point program (23 tests) 2026-05-01 16:32:08 -04:00
test_distill.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
test_distill_recursive.py recursive distillation: core -> depth+1 core 2026-04-27 07:54:30 -04:00
test_evict.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
test_grok_source.py add Grok export source: conversations + media posts 2026-04-27 13:49:42 -04:00
test_html_source.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
test_ingest.py verify: layered strategies + entity policies, rename VISUAL → UNGROUNDED 2026-04-28 16:58:31 -04:00
test_inspect.py qa/inspect: title-relevance sidecar — flag retrieval-driven hallucinations 2026-05-01 10:19:44 -04:00
test_keys.py arch: layer-cake docs + verifier_policy_hash + old-maps principle 2026-05-01 12:10:29 -04:00
test_llm_context_base.py qa: pipe wikitext-base-v1 into LLM context (was verifier-only) 2026-04-28 17:08:49 -04:00
test_merkle.py phase 0 explore: aborist core + sources + distill + evict 2026-04-27 07:53:18 -04:00
test_mesh.py mesh: cryptographic foundation, off by default 2026-04-27 19:00:24 -04:00
test_mesh_aead.py mesh: optional AEAD body encryption under per-epoch shared secret 2026-04-28 17:34:39 -04:00
test_mesh_chain.py mesh: per-peer audit chain-of-claims tracking on the wire 2026-04-28 19:41:25 -04:00
test_mesh_cli.py mesh: sync default-holds records younger than 1 hour (kindergarten window) 2026-04-29 16:07:24 -04:00
test_mesh_cli_pull.py mesh: 'pull' CLI verb — fetch document body from a peer 2026-04-28 17:33:27 -04:00
test_mesh_wire.py mesh: HTTP gossip wire — signed envelopes + 5 message types 2026-04-28 16:57:04 -04:00
test_mesh_wire_e2e.py mesh: HTTP gossip wire — signed envelopes + 5 message types 2026-04-28 16:57:04 -04:00
test_migration_audit_mode.py verify: layered strategies + entity policies, rename VISUAL → UNGROUNDED 2026-04-28 16:58:31 -04:00
test_providence_source.py qa: self-reference thought chains — STRICT-as-fact substrate 2026-05-01 10:16:47 -04:00
test_qa.py qa: post-LLM faithfulness verifier sets STRICT/HYBRID/VISUAL audit_mode 2026-04-28 15:45:08 -04:00
test_qa_quality_live.py qa: feedback-2/3 — honest label, sentence spans, source-role display, retrieval purity 2026-05-01 12:41:08 -04:00
test_query.py qa: lock phrase-route non-regression tests + open ticket #000002 (Module L) 2026-05-01 14:03:39 -04:00
test_reclassify.py verify: layered strategies + entity policies, rename VISUAL → UNGROUNDED 2026-04-28 16:58:31 -04:00
test_repair.py qa: chain-segment failure localization + re-prompt repair tier 2026-04-29 19:27:33 -04:00
test_resume.py resumable ingest + per-shard audit chain integrity 2026-04-27 11:29:27 -04:00
test_snapshot.py add corpus-level snapshots: single-hash identity for the forest 2026-04-27 21:29:10 -04:00
test_tfidf.py add TF-IDF keyword distiller 2026-04-27 07:55:53 -04:00
test_vcs_source.py add git and mercurial repo sources for self-play 2026-04-27 18:17:39 -04:00
test_verify.py qa: per-claim status taxonomy on verifier + repair-action plans on sidecar 2026-04-29 18:37:52 -04:00
test_verify_json.py qa: claim-count ceiling — TOO_MANY_CLAIMS demote (default 12/answer) 2026-04-30 19:46:52 -04:00
test_versioned_ingest.py storage cheats + TF-IDF retrieval fix 2026-04-27 17:24:51 -04:00
test_warrant.py qa: warrant-lite anchor-class — add date anchors (year + month name) 2026-05-01 15:24:11 -04:00
test_wikipedia_old.py prepare full Wikipedia 2003-05-16 ingest: cur + old (revisions) 2026-04-27 08:10:42 -04:00
test_wikipedia_xml.py add Phase IV Wikipedia XML + abstract sources 2026-04-27 17:24:28 -04:00
test_wikitext.py verify: layered strategies + entity policies, rename VISUAL → UNGROUNDED 2026-04-28 16:58:31 -04:00