feat(stella-pipeline): enforce and record verifier independence for the verdict call - #1867
Open
macanderson wants to merge 3 commits into
Open
feat(stella-pipeline): enforce and record verifier independence for the verdict call#1867macanderson wants to merge 3 commits into
macanderson wants to merge 3 commits into
Conversation
added 2 commits
August 6, 2026 03:57
…he verdict call - require_independent_verifier refuses before spend when the verdict would resolve to the worker's own model (parity with the witness gate) - every model verdict's LadderSnapshot now states grader independence as a structured fact (verifier_independent), stamped at the call seam - settings key pipeline_require_independent_verifier wires the opt-in
…d-file limit; wire schema + baseline
Contributor
There was a problem hiding this comment.
Sorry @macanderson, you have reached your weekly rate limit of 500000 diff characters.
Please try again later or upgrade to continue using Sourcery
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
… after rebase Closes #1795
macanderson
force-pushed
the
worktree-verifier-independence-1795
branch
from
August 6, 2026 11:04
9bb22f5 to
abe2542
Compare
Contributor
Reviewer's GuideAdds an opt-in hard gate to require an independent verifier model for the verdict call, records verifier independence on LadderSnapshot for all model verdicts, and performs small refactors/tests splits to keep large files within size limits while updating wire formats and settings plumbing accordingly. Sequence diagram for verdict grading with verifier independence gatesequenceDiagram
actor Operator
participant AgentEngineConfig
participant PipelineConfig
participant Pipeline
participant VerifierStage
participant Verdict
participant LadderSnapshot
Operator->>AgentEngineConfig: set pipeline_require_independent_verifier
AgentEngineConfig->>PipelineConfig: apply_pipeline_tuning(cfg, config)
AgentEngineConfig-->>PipelineConfig: config.require_independent_verifier = pipeline_require_independent_verifier_on()
Operator->>Pipeline: start_run(config)
Pipeline->>Pipeline: witness_author_independence()
alt require_independent_verifier && Unavailable
Pipeline-->>Operator: Err(PipelineError::VerifierNotIndependent)
else gate_allows_run
Pipeline->>VerifierStage: verifier(request)
VerifierStage->>VerifierStage: resolve_provider(Role::Verifier)
VerifierStage->>VerifierStage: resolve_provider(Role::Worker)
VerifierStage->>VerifierStage: parse_verifier_response(result.text)
VerifierStage-->>Verdict: Verdict { verifier_independent: None }
VerifierStage->>Verdict: set verifier_independent = Some(worker.model_ref != resolved.model_ref)
VerifierStage-->>Pipeline: Verdict
Pipeline->>LadderSnapshot: with_rung(verdict.rung())
Pipeline->>LadderSnapshot: with_verifier_independence(verdict.verifier_independent)
Pipeline-->>Operator: AgentEvent::Verdict { evidence.ladder = LadderSnapshot }
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
The witness author has a hard independence gate; the verdict call had none — with one configured provider, the "independent code reviewer" is the same model that wrote the code, its PASS ends the run, and the only trace is a once-per-run prose caveat that scrolls away (the 46%-agreement measurement in
verify.rswas made under exactly this condition). Two halves, per the issue:PipelineConfig::require_independent_verifiermirrorsrequire_independent_witness— same shared probe (witness_author_independence, worker-vs-verifier model-ref), same placement ahead of triage so a refused run costs $0, its own error variant (PipelineError::VerifierNotIndependent). Default off: a single-provider BYOK seat keeps working. Reachable via the new settings keypipeline_require_independent_verifier(settings.json and stella.toml), wired inapply_pipeline_tuningso every driver honours it. The probe's reason wording was made role-neutral ("no model independent of the worker resolves") since three framings now share it.LadderSnapshotnow carriesverifier_independent: Option<bool>—Some(false)= self-graded — stamped at the call seam (Pipeline::verifier) where the actual resolution is in hand, threaded throughverify::Verdict, and additive on the wire (absent on deterministic/waived/abstain rungs, on pre-existing snapshots, and when the worker itself is unresolvable).replay::verdict_provenancenarrates it (grader=self-graded (worker's own model)), anddocs/wire/is regenerated.Exemplar: the existing
require_independent_witnessgate (#1147) — same refusal shape, same before-spend contract — anddiff_coverage's three-valued honesty for why the fact isOption<bool>, never a defaulted bool.Two god-file limits would have been newly crossed by this diff, so two test extractions ride along (repo rule: split, not grow):
replay/late_reconciliation_tests.rsout ofreplay.rs, andverify/tests/witness_strip.rsout ofverify/tests.rs. The regenerated baseline tightenspipeline.rs(3642 → 3616) and grows only the two irreducible one-liners (themoddeclaration inpipeline/tests.rs, the required field inevent.rs's test constructor).Closes #1795
The witness
main, passes here)Flip-checked by restoring the old behavior in place and re-running — three behavioral witnesses fail, the two invariant guards pass on both sides, as designed:
verifier_independence::requiring_an_independent_verifier_refuses_before_spending_anything— refusal with an empty provider script, $0, no stage openedverifier_independence::a_self_graded_verdict_states_the_fact_on_its_snapshot—Some(false)on the stored verdictverifier_independence::an_independent_verdict_states_that_too—Some(true), distinguishable from pre-fact snapshotsverifier_independence::the_verifier_independence_requirement_is_opt_in/..._lets_a_distinct_verifier_through— guards (pass on both)Plus protocol round-trip + additive-parse tests in
ladder.rs(invariant 4).The gate
cargo fmt --checkcargo clippy --workspace --all-targets -- -D warnings— clean except the two pre-existingwitness_stage.rswarnings fix(stella-pipeline): unbreak main — two clippy failures merged with #1813 #1859 unbreaks; none in files this PR touchescargo test— stella-pipeline (549), stella-protocol, stella-cli all green; rustdoc-D warningsclean;make guardsgreen exceptgate-parity, which is red on main and owned by fix(gate): unbreak main — file-size baseline skew and a stale gate-parity count #1845Closes #Nabove and as a commit trailerCI note: until #1845 (gate-parity) and #1859 (witness_stage clippy) merge, the required job will be red on those pre-existing steps; I'll
gh pr update-branchafter they land.Nothing left behind
Ground-rule check
stella-core; no new depsAnything reviewers should know?
diff_coverage's unmeasured honesty).Unverifiable) also leaves it absent — by the field's own contract the fact rides only theModelVerdictrung; calibration: partition verifier false-positive rates by the new grader-independence fact #1865 covers reading it at scale.Summary by Sourcery
Enforce optional independence between worker and verifier models for verdicts and record verifier independence as structured data on verdict snapshots, while keeping wire formats and configuration in sync and extracting oversized tests into dedicated modules.
New Features:
Enhancements:
Documentation:
Tests: