arborist/docs/diagrams/verifier-ladder.dot
russell@unturf.com de07ad9392
docs: distill #000008+#000009+#000010 into core docs + diagrams
Three Explore agents fanned out in parallel for a docs/ + diagrams/
+ code-comment audit against the shipped state of the three
preflight tickets. This commit lands all the alignment fixes.

Core docs updates:

  CLAUDE.md
    - dag.py module description: stage counts now read
      "7/8 quote · 9/10 CTI · 3 reject" reflecting #000009 preflight
      stage + reject-broad early-return shape.

  docs/cti-architecture.md §2.2 + §2.3
    - §2.3 Merkle-AGI-DAG section rewritten: documents all five DAG
      shapes (legacy 7/9, post-#000009 8/10, reject-broad 3),
      describes the preflight stage's 5 nested CTI clauses
      (classifier / answer_contract / prompt_contract /
      evidence_contract / policy_refs), pins
      PREFLIGHT_NODE_VERSION = "preflight-node-v1", states the
      audit-replay payoff.
    - §2.2 CTI section: adds the four new modules
      (quantifier, model_profiles, quantifier_reminder,
      metacognition) as code anchors. Notes that pre-answer
      preflight contract extends CTI upstream of retrieval.

  docs/seven-point-program.md
    - D3 status ½ → ¾ — pre-answer preflight contract landed via
      #000008 + #000010. Code anchors + pinning tests updated.
    - D4 status ½ → ¾ — preflight stage adds upstream control
      commitment to the run-DAG. Code anchors include
      build_reject_run_dag + preflight_node_hash.
    - Status snapshot table: tickets column now references
      #000008/#000009/#000010 against D1/D3/D4 directives.
    - "Post-landing addendum (2026-05-03 / 2026-05-04)" subsection
      summarises all three tickets + their commit shas + final
      test count (993 passing, up from 734).

  docs/modules.md
    - Q&A pipeline table: added 4 new modules (quantifier.py,
      model_profiles.py, quantifier_reminder.py, metacognition.py).
      dag.py row updated to "7/8 quote · 9/10 CTI · 3 reject".
    - dag.py subsection rewritten: documents all 5 DAG shapes,
      describes the preflight payload's 5 clauses + question_state.
    - 4 new module subsections (quantifier / model_profiles /
      quantifier_reminder / metacognition) explaining each
      module's purpose, signature, and how it feeds the run-DAG
      preflight clause.

Diagram updates:

  docs/diagrams/query-pipeline.dot + .svg
    - New "PREFLIGHT (#000008 + #000010)" node inserted between
      cache_check and concepts_lookup.
    - New "REJECT-BROAD" node showing the 3-stage minimal DAG
      escape path.
    - render node label extended with the audit-line tail token
      catalog.

  docs/diagrams/aborist-modules.dot + .svg
    - 4 new qa_* nodes in the retrieval & verifier cluster.
    - 8 new edges: qa_query/qa_runner each call into all 4
      preflight modules; qa_dag has dotted edges to qa_quantifier
      + qa_metacognition (preflight clause sources).
    - qa_dag label updated to mention preflight_node_hash + 5 clauses.

  docs/diagrams/verifier-ladder.dot + .svg
    - Soft-demote violations list extended: BROAD_QUANTIFIER_RUNAWAY
      / CAP_APPLIED / SCOPE_UNBOUND, FORMAT_COLLAPSED, BARE_NAME_CLAIM.
    - New "AUDIT-LINE TAILS" annotation node listing all 11 tail
      tokens (#000008 broad-* + #000010 metacog + classic verifier).
    - Dashed edges from each rung to tails note showing tails
      compose onto labels.

Code-side stale-comment fixes (caught by 3rd Explore agent):

  aborist/qa/keys.py:218
    - "The four fields" → "The seven fields"; mention #000010 adds
      six more for metacognition.
  aborist/qa/query.py:2644
    - 7-stage / 9-stage comment expanded to enumerate all four
      base+preflight shapes plus the 3-stage reject path.
  aborist/qa/runner.py:835
    - same expansion as query.py for runner.ask() callsite.

mesh-*.dot, ingest-pipeline.dot, qa-modes-bench.md, bench-maxing.md,
bench-emergent-design.md, verifier-semantic-gap-design.md,
self-reference-design.md, concept-relations-design.md confirmed
orthogonal — no edits needed.

993 tests still passing (no behavior change). 7 files modified
across docs/ + 3 dot diagrams + 3 SVGs + 4 code-comment fixes.
2026-05-03 19:18:22 -04:00

59 lines
3.5 KiB
Text

// Verifier label ladder: how (audit_mode, violations) → display rung.
//
// Schema column `audit_mode` keeps the v9.8 trichotomy
// (STRICT / HYBRID / UNGROUNDED). The display ladder is a renderer-
// only transformation that names what's actually proved at each rung.
//
// Render: dot -Tsvg verifier-ladder.dot -o verifier-ladder.svg
digraph verifier_ladder {
rankdir=TB
node [shape=box, style="rounded,filled", fontname="Helvetica", fontsize=10]
edge [fontname="Helvetica", fontsize=9]
bgcolor="white"
// Inputs
inputs [label="VERIFIER OUTPUT\naudit_mode ∈ {STRICT, HYBRID, UNGROUNDED}\nviolations: list[dict]", fillcolor="#fff7e6", shape=note]
// Decision tree
is_ungrounded [label="audit_mode == UNGROUNDED?", fillcolor="#dddddd", shape=diamond]
has_warrant_miss [label="WARRANT_MISSING or\nTITLE_MISMATCH in violations?", fillcolor="#dddddd", shape=diamond]
has_soft_demote [label="any soft-demote violation?\n(LAZY_ANCHOR_DEMOTED,\nPOINTER_OVERFLOW_TRIMMED,\nTOO_MANY_CLAIMS, BARE_NAME_CLAIM,\nFORMAT_COLLAPSED,\nBROAD_QUANTIFIER_RUNAWAY,\nBROAD_QUANTIFIER_CAP_APPLIED,\nBROAD_QUANTIFIER_SCOPE_UNBOUND, …)", fillcolor="#dddddd", shape=diamond]
is_hybrid [label="audit_mode == HYBRID?", fillcolor="#dddddd", shape=diamond]
// Rungs (top to bottom = strongest to weakest)
evidence_warranted [label="EVIDENCE-WARRANTED\npointer verified +\nwarrant ran & passed +\nNO soft demotes", fillcolor="#28a745", fontcolor="white"]
anchor_warranted [label="ANCHOR-WARRANTED\npointer-linked +\nwarrant passed where it ran;\nsoft demotes present", fillcolor="#7cc66e"]
pointer_linked [label="POINTER-LINKED\npointer/source/chunk verified;\nwarrant didn't apply OR failed\nfor at least one claim", fillcolor="#ffc107"]
ungrounded [label="UNGROUNDED\nno verified pairs\nat all", fillcolor="#dc3545", fontcolor="white"]
// Suffix annotation
partial [label="HYBRID → add `-PARTIAL` suffix\non whichever rung applies", fillcolor="#fff0e0", shape=note]
// Audit-line tail tokens (#000008 + #000010 — pure render layer,
// composed onto the rung label after the suffix is applied).
tail_tokens [label="AUDIT-LINE TAILS\nappended to all rung labels:\n#000008 quantifier guard:\n · broad cap N · broad rejected\n · broad unbounded · broad runaway\n#000010 metacognition preflight:\n · false premise · contradictory\n · stale risk · out of corpus\n · frame ambiguous\nclassic verifier:\n · warrant missing · title mismatch\n · format collapsed", fillcolor="#fff0e0", shape=note]
// Decision flow
inputs -> is_ungrounded
is_ungrounded -> ungrounded [label="yes"]
is_ungrounded -> has_warrant_miss [label="no"]
has_warrant_miss -> pointer_linked [label="yes"]
has_warrant_miss -> has_soft_demote [label="no"]
has_soft_demote -> anchor_warranted [label="yes"]
has_soft_demote -> evidence_warranted [label="no"]
// HYBRID adds suffix to all 3 non-UNGROUNDED rungs
evidence_warranted -> is_hybrid [style=dotted]
anchor_warranted -> is_hybrid [style=dotted]
pointer_linked -> is_hybrid [style=dotted]
is_hybrid -> partial [label="yes" style=dotted]
// All four rungs can carry tail tokens.
evidence_warranted -> tail_tokens [style=dashed, color="#888888"]
anchor_warranted -> tail_tokens [style=dashed, color="#888888"]
pointer_linked -> tail_tokens [style=dashed, color="#888888"]
ungrounded -> tail_tokens [style=dashed, color="#888888"]
{rank=same; evidence_warranted; anchor_warranted; pointer_linked; ungrounded}
}