feat(workflows): fold_usage verification cost ledger (V6, #2494) - #2520
Merged
Conversation
Declare finalDecision, scoreTablePath, and reviewReportPath without placeholder values that GitHub Code Quality flagged as dead stores. Every loop path assigns them before return. Assistant-model: Grok 4.6
flora131
marked this pull request as ready for review
August 19, 2026 16:53
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.
Summary
Slice V6 of the LLM-as-a-Verifier adoption program (
specs/2026-08-17-tournament-soft-selection.md§5.3): thefold_usageverification cost ledger — plus the planned V2⋈V3 reconciliation merge.Merge commit (first parent of this branch's delta):
origin/verifier/adversarial-mean-vetomerged into the stack line, resolving the planned parallel edit of the adversarial runner — V2's graded semantics (criteria × verifier fan-out,decide_verificationsole accept path, re-ask, demoted reducer) wired through V3's prompt plumbing (build_scoring_prompt+warm_first_fan_out), proven by the adversarial + prompt-layout + tournament suites post-merge.V6 proper (131 source lines):
packages/workflows/builtin/verification-usage.ts(new):fold_usage(results)→UsageTotals {calls, input, output, cacheRead, cacheWrite, cost, turns, cacheHitRate}— pure fold overmodelAttempts[].usageincluding retried attempts; absent fields count 0; importable without tournament code (the B-track consumes it in B3)comparisons.jsongains a usage block per phase (attempts/ring/pivots/reducer) + total; adversarialverification-summary-<round>.jsongains a usage block; writes happen once per phase so durable replay re-emits checkpointed writesGoal/ralph usage blocks are V10's (Q4). Base:
verifier/tournament-runner(V5, #2517). Stack: V1 → V3 → V4 → V5 → V6.Evidence
Produced by an implement→review→repair goal run (approved turn 1; completion/evidence/risk reviewers all
complete;remaining_work: none):npm run check— green (includes the coding-agent tsgoerasableSyntaxOnlypass)npx vitest --run --project unit -t "usage-fold"— green: absent-usage zeros, retries summed, hit-rate derivation, empty set all-zeropackages/workflows/CHANGELOG.mdunder## [Unreleased]### AddedSpec contract:
specs/2026-08-17-tournament-soft-selection.md§5.3 (Q4: goal/ralph blocks deferred to V10 — noted on #2494).Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.