Skip to content

Add a witness phase to the loop (3.12) - #68

Merged
yavorpanayotov merged 3 commits into
juxt:mainfrom
panayotovk:witness-independent-verification
Aug 19, 2026
Merged

Add a witness phase to the loop (3.12)#68
yavorpanayotov merged 3 commits into
juxt:mainfrom
panayotovk:witness-independent-verification

Conversation

@yavorpanayotov

Copy link
Copy Markdown
Collaborator

Why

The loop keeps getting stronger. 3.10 moved each phase into its own subagent. 3.11 fanned distill out across services. Each phase runs isolated and hands back a short result. This is the next step. The loop should be able to stand behind that result and prove it. Witness gives it that. It confirms the run's own answer against ground truth, and it leaves a record the loop can show for it.

What it does

This adds a new phase called witness. It runs at the convergence gate in its own subagent. It rebuilds the result from ground truth the run cannot fake. It reads the test runner's own exit status. It hashes each generated test and compares it to the hash propagate recorded. It reads the reconciliation line and the weed verdict. It checks the open questions. If any of that was faked, the witness fails and the loop keeps working. The loop converges only when the witness passes.

It stays cheap. It re-runs the fast deterministic tools and reads output the phases already produced. It never re-runs propagate, distill, or weed. So it costs one light pass per run.

Implementation

  • New witness skill and agent. Same dual entry as the other phases.
  • Propagate records the generated test hashes in the ledger. That is the baseline the witness checks.
  • The loop docs gate convergence on the witness verdict.
  • Witness writes a record to .allium-loop/<slug>.witness.json.
  • Tests cover it, including a live probe that weakens a test and confirms the witness catches it.
  • Version bump to 3.12.0.

The loop's phases run inside isolated sub-agents (3.10) and now fan out (3.11),
which moved the convergence signal out of the orchestrator's sight: it converges
on prose self-reports from actors it cannot see into -- tests passed, no test
weakened, no blocking question quietly parked. This adds the phase that confirms
those claims instead of trusting them.

allium:witness is an independent, deterministic verifier spawned at the
convergence gate. It re-derives the claim from ground truth the run cannot
fabricate -- the test runner's own exit status (not the reported count), the
sha256 of each generated test vs. the hash propagate recorded in the ledger (a
changed hash with no intervening propagate is a weakened test), the
reconciliation line, the weed verdict, and the spec's open-questions section --
and gates convergence on its verdict. It writes a durable witness record to
.allium-loop/<slug>.witness.json.

It is cheap by construction: it re-runs only the deterministic tools (test
command, allium check/analyse, hashing, grep) and reads the machine output the
phases already emitted. It never re-runs the model-heavy phases (propagate,
distill, weed reasoning), so it costs one light pass per converged run, not a
second loop. The anti-cheat rule "never weaken a generated test" stops being
prose the actor is trusted to honour and becomes a check the loop enforces.

Built as a thin dual-entry capability like distill/propagate (skill is the
single source; agent preloads it; VS Code agent materialised at build time):

- skills/witness/SKILL.md, agents/witness.md: the new capability.
- propagate records generated_test_hashes + reconciliation in the ledger so the
  witness has a baseline to check.
- plugin.json registers the skill and agent; generate-multi-editor emits the
  VS Code agent (and regenerates the stale distill/propagate agents).
- test-skills.mjs: witness joins every structural/modes/portability group, plus
  a live 'witnessing' probe that weakens a hashed test and asserts the witness
  returns FAIL naming the tamper -- deterministic, no model judging a model.
…eport

Wire allium:witness into the loop as the convergence gate. driving-the-loop.md
gains a fifth convergence condition (an independent witness PASS), a new §11
describing the deterministic checks and the PASS/FAIL/INCONCLUSIVE routing, and
the anti-cheat rule (§4) is now enforced by the witness rather than trusted.
Large goals (§6) witness each slice before it counts as converged and the whole
spec after integration; the ledger (§8) records the evidence the witness reads.
recommended-loops.md adds the witness to the exit condition, the guardrails and
the operator table; the top skill's routing table and loop summary follow.
The Allium loop now witnesses its own convergence: an independent, deterministic
allium:witness pass re-derives the claim from ground truth (the test runner's
exit status, the generated tests' hashes, the reconciliation and weed verdicts)
and gates convergence on its verdict. Bounded loops (3.10/3.11) that also prove
they got to green honestly.
@yavorpanayotov
yavorpanayotov merged commit 5ec055f into juxt:main Aug 19, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant