Skip to content

feat(eval): Phase 4 scaffolding — self-healing agent-quality guard - #369

Merged
ProtocolWarden merged 2 commits into
mainfrom
feat/eval-phase4-scaffolding
Jun 21, 2026
Merged

feat(eval): Phase 4 scaffolding — self-healing agent-quality guard#369
ProtocolWarden merged 2 commits into
mainfrom
feat/eval-phase4-scaffolding

Conversation

@ProtocolWarden

Copy link
Copy Markdown
Owner

What

Stands up the Phase 4 (EVAL) machinery from HARNESS_TRUST_HARDENING §4 — everything that can be built ahead of the one irreducibly-human step (the operator answer-key signature). The fleet can now grade its own reviewer/worker quality, while being structurally unable to grade its own answer key.

The design in one line

The fleet grades itself, but cannot grade its own answer key. Everything self-heals with no human in the per-correction loop except an operator signature on each ground-truth label — encoded once, offline.

Modules (src/operations_center/eval/)

Module Role
corpus.py Append-only, hash-chained case ledger. Editing/deleting any past entry breaks the chain → tamper-evident.
signing.py Ed25519 operator signatures. A case is graded only when its signature verifies against the constitution public key. Asymmetric so no compute inside the trust boundary can forge a label; the private key stays offline.
replay.py Deterministic blocking gate — replays input.checks through the pure code-computed verdict (pr_review_watcher.verdict.compute_verdict) and exact-matches the committed answer. No model → zero flakiness → safe to block. Catches a #313-style verdict-bypass regression.
critic.py Non-blocking different-model-family N-of-M drift monitor (the model extractor is an injected seam).
constitution.py Monotonic baseline floor + report-only→blocking graduation (D-EVAL-3). Gate can never block before the key is seeded (§0.1 degrade-never-halt).
verify.py The required CI check (.github/workflows/eval-corpus-integrity.yml) tying chain + signatures + floor together.

The exam / answer-key split

  • The fleet may append unsigned candidate cases — scored and reported, never gating.
  • Only an operator-signed case counts toward the gate. The signature is made offline; no in-boundary compute can mint one.

What's seeded

7 unsigned candidate cases (#313 verdict-bypass + injection classes, #337 over-flag, plus legitimate concerns). All pass replay; the gate is correctly report-only (0/15 signed). CODEOWNERS pins eval/corpus, eval/constitution, and the workflow to the operator (D-EVAL-2).

Verification

$ python -m operations_center.eval.verify
chain OK: 7 entries, head aee9da2f1594…
operator key: NOT YET ANCHORED — all cases are candidates
cases: 7 total, 0 graded, 7 candidate
gate [report-only]: 0/15 signed cases — gate is report-only until the answer key is seeded
RESULT: PASS

33 unit tests (hash-chain tamper-evidence, signature non-transfer to a swapped input, replay gating, graduation modes, drift majority-vote, end-to-end verify incl. signed blocking + tamper detection). ruff/ty clean; Custodian T7 cleared.

Deferred — the one human step

The operator generates the Ed25519 key offline, commits the public key to eval/constitution/operator_pubkey.ed25519 (currently a placeholder), and signs ≥15 seed cases. At that point the gate graduates from report-only to blocking. Nothing else in EVAL needs a human.

🤖 Generated with Claude Code

ProtocolWarden and others added 2 commits June 21, 2026 07:18
Stands up the EVAL machinery (HARNESS_TRUST_HARDENING §4) — everything buildable
ahead of the one irreducibly-human step (the operator answer-key signature):

- corpus.py: append-only, hash-chained case ledger. Editing/deleting any past
  entry breaks the chain → tamper-evident (verified by a required CI check).
- signing.py: Ed25519 operator signatures. A case is *graded* only when its
  signature verifies against the constitution public key; asymmetric so no
  compute inside the trust boundary can forge a label. Private key stays offline.
- replay.py: deterministic BLOCKING gate — replays input.checks through the pure
  code-computed verdict (pr_review_watcher.verdict.compute_verdict) and exact-
  matches the committed answer. No model → zero flakiness; catches a #313-style
  verdict-bypass regression. Only operator-signed cases count toward the gate.
- critic.py: non-blocking, different-model-family N-of-M drift monitor (the model
  extractor is an injected seam; production wires a different-family adapter).
- constitution.py: monotonic baseline floor + report-only→blocking graduation
  (D-EVAL-3). The gate can never block before the answer key is seeded (§0.1).
- verify.py + eval-corpus-integrity.yml: the required check tying chain +
  signatures + floor together. CODEOWNERS pins corpus + constitution + workflow
  to the operator (D-EVAL-2).

Seeds 7 unsigned candidate cases (#313/#337 classes); all pass replay and the
gate is correctly report-only (0/15 signed). The exam/answer-key split: the fleet
may append candidate cases, but only an offline operator signature makes one
count toward the gate.

33 unit tests (hash-chain tamper-evidence, signature non-transfer, replay gating,
graduation, drift majority-vote, end-to-end verify). ruff/ty clean.

Deferred (irreducibly human): operator generates the Ed25519 key offline, commits
the pubkey, signs >=15 seed cases → gate graduates to blocking.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
CI surfaced two gaps in the Phase 4 scaffolding:
- cryptography was used by eval.signing but not declared, so the test/ty jobs
  failed to import it (it was only transitively present locally). Added it to
  [project] dependencies.
- the monotonic baseline-floor check lived only in the workflow's inline Python
  heredoc, so constitution.is_monotonic_successor_of was "tested but never called
  in production" (D12). Moved the enforcement into verify.py (--base-floor) and
  simplified the workflow to call it — de-stringifies the check and clears D12.

35 unit tests (added monotonic raise/lower cases); ruff/ty/D12 clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ProtocolWarden
ProtocolWarden merged commit 1dae533 into main Jun 21, 2026
23 checks passed
@ProtocolWarden
ProtocolWarden deleted the feat/eval-phase4-scaffolding branch June 21, 2026 11:29
ProtocolWarden added a commit that referenced this pull request Jun 21, 2026
Records the merged EVAL machinery (#369 + #370) in HARNESS_TRUST_HARDENING.md's
Phase-4 section — corpus hash-chain tamper-evidence, Ed25519 answer-key signing +
offline CLI, deterministic replay blocking gate, different-family drift monitor,
monotonic constitution + required integrity check, 7 seeded candidates — and
spells out what is still deferred (the operator key-anchor, the Component-2
outcome flagger, D-EVAL-4 over-flag attribution, the live drift-monitor model
adapter) so the doc reads scaffolding-done, not phase-complete. Docs-only.

Co-authored-by: ProtocolWarden <ProtocolWarden@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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