arborist/tests
russell@unturf.com 84d5b5cd76
qa(#000008): Phase 2 — model-profile caps + governance hash (dry-run)
Lands aborist/qa/model_profiles.py with two profiles:
  - adamo1139/Hermes-3-Llama-3.1-8B-FP8-Dynamic
      tight caps for broad intensities (ALL=8, COMPREHENSIVE=5,
      OPEN_REQUEST=5) reflecting the 2026-05-02 runaway case.
  - default
      large-reasoner-class fallback (ALL=12, COMPREHENSIVE=15,
      OPEN_REQUEST=12). Used when model_profile_id has no entry.

cap_for_intensity() resolves caps via three-source chain:
  1. policy_overrides (per-call dict, highest priority)
  2. per-model profile from PROFILES
  3. "default" profile fallback

EXPLICIT_COUNT sentinel handles SMALL_NUM_EXPLICIT and
COMPARATIVE_BOUND — cap is the question's explicit count, not a
profile-set value. Defensive fallback to MANY cap if classifier
fired the rung without extracting a count.

Four new policy fields, all folded into governance_policy_hash via
_VERIFIER_POLICY_FIELDS:
  - quantifier_guard_enabled    master kill (default True)
  - quantifier_guard_apply_caps dry-run gate (default False per
                                §10.11.3 — cap LOOKED UP and reported
                                on result, but NOT applied to the
                                verifier until operator flips True)
  - quantifier_caps_by_intensity per-call override dict
  - quantifier_guard_modes      per-mode opt-in list (default
                                ["claim_lattice_pointer",
                                 "claim_lattice"]; quote opts out)

Six-level disable hierarchy (§10.11.2) implemented:
  - Per-test:    policy={"quantifier_guard_enabled": False}
  - Per-call:    --no-quantifier-guard (Phase 4)
  - Per-phase:   each policy switch is independent
  - Per-mode:    quantifier_guard_modes filter
  - Per-model:   model_profiles.py lookup
  - Master:      governance_policy_hash invalidation on flip

Wired through both query() and runner.ask() — both compute
effective_max_claims from the (classifier_intensity, model_profile,
policy_overrides) triple and pass it as max_claims_per_answer to
the verifier. Dry-run mode keeps effective_max_claims at the policy
default (12) until apply_caps flips True.

Result dict surfaces claim_cap_applied (the LOOKED-UP cap, even in
dry-run) plus all Phase-1 quantifier fields on miss-path AND
cache-hit path so bench rows stay column-aligned.

19 new tests pin: per-model selection, EXPLICIT_COUNT sentinel,
override precedence, governance-hash invalidation on every cap
field, profile shape (all ten rungs covered), default profile
presence.
2026-05-03 07:30:28 -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(#000008): Phase 0.x telemetry — pointer/bracket/profile fields 2026-05-03 07:17:48 -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(verify): FORMAT_COLLAPSED soft-demote + open #000008 (broad-quantifier preflight) 2026-05-02 16:43:41 -04:00
test_cli_render.py qa(verify): FORMAT_COLLAPSED soft-demote + open #000008 (broad-quantifier preflight) 2026-05-02 16:43:41 -04:00
test_compress.py storage cheats + TF-IDF retrieval fix 2026-04-27 17:24:51 -04:00
test_concepts.py qa(concepts): corpus-derived concept_relations table replaces frozensets 2026-05-01 21:14:53 -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 qa(provenance): #000001 land — retrieval_plan_hash binds D4 2026-05-01 19:26:01 -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_frame.py qa(frame): #000002 land — reference-frame polarity contract (D3 → ✓) 2026-05-01 20:18:13 -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): wordlist union (US+UK) + configurable supplemental dictionaries 2026-05-02 14:27:24 -04:00
test_journal.py journal: emit unfirehose/1.0 JSONL for queries + bench cycles 2026-05-02 15:19:39 -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 docs: consolidate self-reference design — flat MVP + fact-Core distillation 2026-05-02 12:39:42 -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(verifier): promote deflection sidecar to soft-demote violation 2026-05-01 23:44:32 -04:00
test_quantifier_caps.py qa(#000008): Phase 2 — model-profile caps + governance hash (dry-run) 2026-05-03 07:30:28 -04:00
test_quantifier_classifier.py qa(#000008): Phase 1 — pure quantifier classifier (dry-run wired) 2026-05-03 07:23:44 -04:00
test_query.py qa(query): #000007 land — query-layer hyphen folding 2026-05-02 14:12:46 -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(verify): Rule 9 — SUBJECT_TOKENS_ABSENT premise-parroting demote 2026-05-02 15:51:58 -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): #000003 land — anchor-class generalization (D6 → ✓) 2026-05-01 19:16:06 -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