Skip to content

feat(daemon): scored verified candidates (roadmap-v0.6 B.2)#80

Merged
RNT56 merged 3 commits into
mainfrom
claude/v06-b2-scoring
Jun 29, 2026
Merged

feat(daemon): scored verified candidates (roadmap-v0.6 B.2)#80
RNT56 merged 3 commits into
mainfrom
claude/v06-b2-scoring

Conversation

@RNT56

@RNT56 RNT56 commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

Roadmap-v0.6 B.2 — a new crustcore_daemon::score that picks the best verifier-accepted fan-out candidate, not merely the first accepted.

  • score_candidate(meta, risk) → PatchScore — pure: correctness dominates (+VERIFIED_BONUS = 100), then smaller diff (bounded penalty), more gates passed, and a security-review boost.
  • pick_best(candidates, risk) → Option<T> — highest score, ties keep the first proposer (deterministic).

Safety (the key property)

VERIFIED_BONUS (100) is larger than the sum of every other term (diff ≤50 + gates ≤20 + security ≤8 = 28 of swing), so a verified candidate's score (≥50) can never be overtaken by an unverified one (≤28). Scoring reorders accepted candidates but can never promote an unverified patch — it's a tie-break among verifier-accepted candidates, never a bypass of verifier-owned completion (invariants 6, 13).

CI core vs live seam

  • CI core (7 tests): verified-always-outranks-unverified (even maxed-out); smaller-diff ranks higher; security boost; golden 3-proposer (fail / pass-large / pass-small) ranks pass-small highest; ties keep first; empty → None; default metadata never panics.
  • Live seam: the live SubagentExecutor extracting diff metadata from a real VerifiedPatch is the existing P11-exec-live seam — no new seam (the scorer stays pure, defaulting missing metadata to 0).

Tests run

cargo xtask verifygreen. Nano unchanged at 53.5% (daemon-only). Independent off main.

🤖 Generated with Claude Code

RNT56 and others added 3 commits June 29, 2026 05:12
Adds crustcore_daemon::score: score_candidate(PatchMetadata, RiskTier) ->
PatchScore and pick_best, selecting the best verifier-accepted fan-out
candidate instead of merely the first accepted.

Correctness dominates by construction: VERIFIED_BONUS (100) exceeds the sum
of every other term (diff penalty <=50, gates <=20, security <=8), so a
verified candidate ALWAYS outranks an unverified one — scoring reorders
accepted candidates but can never promote an unverified patch (invariants 6,
13). Among verified, smaller diff + more gates rank higher with a small
security boost; ties keep the first proposer (deterministic).

Pure + total — missing metadata defaults to zero and never fails (the live
executor fills it from the real VerifiedPatch, the existing P11-exec-live
seam). 7 new tests incl. the golden fail/pass-large/pass-small ranking;
daemon-only; zero nano impact. `cargo xtask verify` green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@RNT56 RNT56 merged commit 55829a3 into main Jun 29, 2026
6 checks passed
@RNT56 RNT56 deleted the claude/v06-b2-scoring branch June 29, 2026 21:19
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