dream(darwin-evolution): ADR-249's cost seam wired into evolve() (evaluated) - #207
Draft
ruvnet wants to merge 2 commits into
Draft
dream(darwin-evolution): ADR-249's cost seam wired into evolve() (evaluated)#207ruvnet wants to merge 2 commits into
ruvnet wants to merge 2 commits into
Conversation
…evolve() EvolutionConfig gains optional costBudgetBytes; evaluateVariant now feeds the existing variantBytes(variant.dir) parsimony signal through scoreVariant's opt-in signals.cost seam when set, and stays byte-identical when omitted (every current caller). Closes the gap between ADR-249 (2026-08-10, seam shipped) and evolve()'s only call site, which never had a way to reach it. Deterministic before/after repro: 4 new evolve.test.ts tests fail exactly as predicted pre-fix, package suite 632/632 passed (0 regressions) post-fix. Independent adversarial critic: ACCEPT, two disclosed non-blocking caveats. Full receipt, competitor research, and witness: docs/dream-cycle/2026-08-17-gist.md, issue #206.
…dd 08-17 Ledger on main only had 08-13/08-14 despite 4 nights of runs (08-15 generator-genome PR #200, 08-16 flywheel-promotion PR #205 both exist, open, non-stale, with their own ledger rows sitting on unmerged branches). Backfilled those two rows from their PR bodies (verified, not guessed) and appended tonight's 08-17 darwin-evolution row with the real issue #206 / PR #207 numbers.
This was referenced Aug 18, 2026
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.
MetaHarness Dream Cycle, 2026-08-17. Deep surface:
darwin-evolution(slot 2). Full detail, receipts, candidate-selection reasoning, adversarial-critique writeup, and weight-eft/learn scan findings: #206.Hypothesis
Given
evolve.ts'sevaluateVariant, which already computesvariantBytes(variant.dir)(a deterministic surface-size signal) elsewhere in the file for Pareto tie-breaking but feeds no signal intoscoreVariant's ADR-249signals.costseam, whenEvolutionConfiggains an optionalcostBudgetBytesfield and, only when it is set,evaluateVariantpasses{ cost: { units: variantBytes(variant.dir), budgetUnits: costBudgetBytes } }intoscoreVariant, then a variant whose surface files grow pastcostBudgetBytesshould score a strictly lowercostEfficiency(and, on a crafted near-tie fixture, this alone should be able to flip a promotion decision from promoted to not-promoted), while every existingevolve()caller — none of which setcostBudgetBytes— continues to produce byte-identicalScoreCards to before, subject to: (a) zero regression in the existing 632-test suite, (b) omitted-field behavior stays byte-identical (ADR-249's own zero-cost-adoption contract, verified one level up), (c)scorer.tsitself untouched, (d) diff materially under 300 lines.Candidate
ADR-249 (2026-08-10) shipped an opt-in
signals.cost = {units, budgetUnits}seam on the frozen scorer, tested in isolation (scorer-signals.test.ts), butevolve.ts's only production call site never passedsignals— the seam was structurally unreachable from any real evolution run. Fixed:EvolutionConfig.costBudgetBytes(optional), threaded throughevaluateVariantinto the existingscoreVariantcall using the already-computedvariantBytes(variant.dir)parsimony signal (previously used only for'pareto'selection's tie-break).evaluateVariantis now exported (was module-private) for direct testability. 2 source files (evolve.ts+18/-2,types.ts+11), 1 test file (+79 lines, 4 new tests). Well under the 300-line target.Evaluation Receipt
Deterministic reproduction (not sampled):
evaluateVariant is not a function); the 5 pre-existingevolve.test.tstests are unaffected.packages/darwin-modefull suite 632 passed, 14 skipped, 0 regressions.tsc --noEmitclean. Full monoreponpm run buildclean (no wasm/NAPI degradation tonight).create-agent-harness,flywheel) that reference@metaharness/darwintypes re-run clean (11/11).costEfficiencyto exactlyround6(100/200) = 0.5; on a crafted near-tie fixture (parentfinalScore=0.4,promotionDelta=0.02) that decay alone movesfinalScorefrom 0.435 (promoted) to 0.385 (not promoted) — no other gate clause moves.Baseline Comparison
No caller in the shipped orchestration sets
costBudgetBytes, so every existingevolve()invocation is byte-identical to before this diff — verified directly by tracing the omitted-field path (not just via the pre-existingscorer-signals.test.tsfixtures, which only coverscoreVariantin isolation) and confirmed independently by the adversarial critic.Darwin Lineage
Not run — this is a scorer-wiring/config-plumbing fix to the evolution loop's own orchestration code, not a tunable routing/topology/prompt/tool/tier parameter; no Darwin mutation surface applies (ADR-071 mutation allowlist), same reasoning as the 2026-08-15/16 entries.
Flywheel Evidence
Not applicable in the "ran a flywheel evolution" sense — this candidate modifies
@metaharness/darwin's own scorer-seam wiring. Durable evidence is the deterministic test repro above, committed todocs/dream-cycle/2026-08-17-gist.md.Reward Hack Check
Purely additive diff, no existing test weakened, no gold/benchmark data touched.
variantBytesis the same signal already used for Pareto tie-breaking before this diff — if it's gameable by whitespace-stripping mutations, that property predates tonight. This diff does make it more consequential (now inside the primary score, not just a secondary tie-break) — disclosed, not hidden (see Adversarial Critique in the gist).Security Review
No credential/shell/network surface touched, no new dependency. Also statically audited tonight (unrelated to this candidate, $0): darwin-mode's SWE-bench solvers (
bench/swebench/*.mjs) allgit fetch --depth 1the base commit only, falling back to--depth 200ancestor history on failure — no future/gold-patch commits are ever fetched, unlike the git-history-leak class of grading defect that hit SWE-bench Pro's public graders. Checked and clear, not a finding requiring a fix.Regression Analysis
Zero regression: 632/632
packages/darwin-modetests pass (0 failures, 14 pre-existing skips unaffected),tscand full repo build clean, 2 dependent packages' darwin-referencing tests unaffected (11/11).ADR
Appended a dated 2026-08-17 section to
ADR-249(the ADR that shipped the seam this PR wires up) rather than minting a new ADR number, matching the 2026-08-13/14 precedent for a coverage/completion addition to an existing architectural decision.Research Gist
No gist-creation tool is available in this session's toolset (matching 2026-08-13 through 08-16) — committed instead:
docs/dream-cycle/2026-08-17-gist.md(GIST=LOCAL).Issue
#206 (full findings, candidate-selection reasoning, weight-eft/learn scan results, competitor review, ledger check).
Witness
Verifier procedure is in the gist's Witness section and was independently self-verified (round-trip reproduced programmatically) before this PR was opened.
Merge Policy
Human review required. Do not self-merge. Do not autonomously promote Flywheel state.
Recommendation: ACCEPT-WITH-CAVEATS — real, independently-critiqued, fully deterministic and reproducible fix that closes a genuine "ADR shipped, implementation dangling" gap. Two comparable-severity gaps are disclosed as still-open, natural next-night follow-ups (not silently fixed under review pressure, not silently left undisclosed): (1) no real
evolve()caller setscostBudgetBytesyet — this PR is plumbing only; (2)variantBytes's pre-existing gameability is now score-consequential rather than merely tie-break-consequential once a caller does opt in.Generated by Claude Code