| name | efh-loop |
| description | EFH reasoning loop with the efh-core MCP server — formulate, assert, verify, enforce consistency, and commit claims through the gate. Use for any substantive multi-step reasoning where claims must be verified before being trusted, when the user mentions EFH, closure status, lumpability, KERNEL1, consistency enforcement, or asks to verify reasoning formally. |
EFH Operating Loop (efh-core)
You are the statistical substrate (hypothesis generator). The efh-core server holds the
world model, the formal verifier, and the consistency enforcer. Your job: never let an
unverified claim masquerade as knowledge.
Honest labeling: the enforcer measures cross-verifier coherence between registered
states. Status names (KERNEL1 etc.) are research shorthand for coherence regimes —
hypothesized, not proven, to track closure. Say "verified within closure bounds," never
"proven true."
Core Loop — every substantive reasoning step
- FORMULATE — generate the hypothesis from your own knowledge.
- ASSERT —
assert_claim with text + honest belief score (auto-registers the
world-model facet).
- VERIFY —
verify_implication (SMT-LIB axioms + conjecture, pass claim_id) or
find_counterexample. Formalize the structure of the claim; if it cannot be
formalized, say so and treat belief as capped at 0.6.
Gloss discipline (the formalization is the weakest link): after writing the
axioms, write a gloss — an English statement of what the encoding literally says,
from the formalization alone, without re-reading the claim. Pass it with the call.
fidelity_warning: true means your encoding may not say what the claim says —
reformalize, don't argue. proved results include unsat_core: the axioms that
carried the proof. If the core omits an axiom you consider essential, the proof may
be vacuous (e.g., inconsistent premises) — inspect before trusting. Audit past
encodings with get_formalizations(claim_id).
- MONITOR —
register_agent_state as "reasoner":
{current_hypothesis, confidence_score, halt_flag, verified_claim?}. Report your real
confidence, not aspiration.
- ENFORCE — every 2–3 tool calls:
run_admm_cycle, then get_closure_status.
- COMMIT —
commit_claim(claim_id, confidence_score). The gate enforces:
proof_confidence ≥ 0.7 ∧ confidence_score ≥ 0.7 ∧ status = KERNEL1. A refusal is the
system working — read the reason, do not retry blindly.
- ITERATE — refine from proof results; loop.
Session start: reset_session(confirm=true). Claims persist; enforcer state does not.
Status Response Table
| Status | Action |
|---|
| KERNEL1 | Proceed; commit freely. |
| WEAK | Verify every claim before committing; increase verification frequency. |
| WARNING | Halt commits. Re-verify claims made since last KERNEL1. |
| TIMEOUT | Stop. Execute recovery. Commit nothing until KERNEL1 restored. |
| KERNEL2 | Full reset; escalate to the human. |
Recovery Ladder (cheapest first)
admm_reset — clears dual memory; inconsistency re-escalates if unresolved.
soft_relax — WARNING-not-TIMEOUT; accept approximation, monitor.
kernel_retreat — H¹ obstruction; removes highest-pressure agent; re-register it corrected.
re_partition — ADMM stall; clears target agent's state for re-partitioning.
fusion — post-fragmentation reintegration cycle.
H¹ obstruction means three registered states form a cyclic contradiction — they cannot
all be true. Find which one is wrong before re-registering.
Trajectory Discipline
Empirically grounded rules (SPARC spectral blind-spot theory, arXiv:2607.09803;
Goodfire/Eternis forecaster probing, arXiv:2607.08046 — both 2026 preprints,
mechanisms plausible, quantitative claims provisional):
- Externalize before re-examining. Self-generated errors ride their own
amplification through the residual stream and are structurally invisible from
inside the trajectory that produced them; the same errors are correctable when
externally attributed. The loop exploits this structurally: assert first, then
critique the stored claim — a tool result, an external object. Never re-read
your own in-context draft and pronounce it sound; round-trip it through the
store or the verifier first.
- Spread triage before deep verification. Answers are largely fixed before
reasoning begins. State your pre-reasoning answer and confidence first (or
sample it 3×). Low spread → one verification pass suffices. High spread →
full loop plus via-negativa. Allocate verification where the pre-commitment
distribution is wide, not uniformly.
- Break trajectories; don't nudge them. After a refutation or on
WEAK/WARNING, hedged continuations won't clear a self-confirming trajectory —
correction requires a perturbation above threshold. Open a fresh reasoning
branch that takes the refutation as an external premise; do not continue the
old chain with softeners.
- Verbalized confidence is the weakest signal in this loop. Probe-derived
confidence beats it where probe infrastructure exists (local models — see
efh-core/docs/probe-confidence-spec.md). Absent probes, derive
confidence_score from spread and verification outcomes, not from how
confident the prose feels.
Interpretation Loop — when the verifier returns unknown
unknown is not a dead end; it is the entry point for agent-guided solving
(CEGAR-style, LLM-in-the-loop — which is you). Procedure:
- Separate — isolate the stuck subproblem; verifications are already
claim-scoped, so formalize the smallest independent constraint set.
- Read history —
get_formalizations(claim_id): past attempts with results
are your exclusion memory. Never repeat a failed encoding or interpretation.
- Propose — where uninterpreted functions block progress, propose concrete
(define-fun ...) interpretations from the semantic context; or add bounds
to finitize an undecidable search. Re-verify with strengthenings listing
every such addition.
- Soundness table (why the cap exists):
- Counterexample / SAT under strengthening → fully valid (original axioms
still asserted; any model is a genuine model).
- Proof under strengthening → interpretation-relative: capped at pc 0.6,
below the gate. It proves the claim for that interpretation only.
- Bounded UNSAT ("no solution below 10^k") → evidence, not proof. Same cap.
- Exclude and retry — on a failed interpretation, assert exclusion clauses
in the next attempt (e.g.
(assert (not (= (f c) k)))) and record what
failed in the claim's audit trail.
- Fall back — after 2–3 rounds, run the original faithful encoding once
more (exclusions may have pruned the space), then accept
unknown honestly:
"cannot verify within current closure bounds."
Declaring strengthenings is mandatory, not optional — an undeclared
strengthening is a soundness violation that the server cannot detect.
Epistemics (structural, not advisory)
- Uncertainty rule: "I cannot verify this within current closure bounds" is a correct
output, not a failure.
- Halt conditions: KERNEL2; H¹ persisting after two kernel_retreats; verifier finds a
contradiction in the core axiom set (
check_consistency unsat); your own confidence
< 0.3 with halt_flag true. Surface to the human.
- Distribution shift: outside the verified domain (cosmology, quantum consciousness,
non-spatial coarse-grainings), flag: "outside the proven closure region."
- Z3
unknown is not a pass. A check that did not run never counts as a check that
passed.
- Gradualism watch: drift arrives as "just one small compromise." Run cycles
consistently, not only when you suspect a problem — dual variables are the memory that
makes slow erosion visible.