feat(loops): seeded promotion gate + authored-path convergence#220
Merged
Conversation
- promotionGate: the statistical promotion decision as a package primitive — seeded paired bootstrap (agent-eval heldoutSignificance) over per-task holdout deltas, deterministic verdict, minimum-evidence floor (6 paired tasks), CI lower bound must clear the threshold. Replaces the bench-local unseeded pairedBootstrap whose verdict varied re-run to re-run. - authorStrategy: named fallbackModel retry (one attempt when the primary fails or returns no code block), temperature/maxTokens now passed through. - assertAuthoredCodeSafe -> assertStrategyContract: the lint enforces the harness's measurement invariants (author blindness + conserved dose) at the module boundary; docstring now says so in those terms. - bench: strategy-author.mts drops its duplicate authorStrategy/contractDoc and becomes the R0->R2 ladder CLI over the package primitive; flywheel-run authors and gates through the package; authored run artifacts gitignored and excluded from typecheck. - tests: regression coverage for harness-verified scoring, the empty-messages rule, the contract lint, and the gate's determinism/floor.
tangletools
approved these changes
Jun 10, 2026
tangletools
left a comment
Contributor
There was a problem hiding this comment.
✅ Auto-approved PR — 5151694e
Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.
tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-10T10:17:27Z
This was referenced Jun 10, 2026
drewstone
added a commit
that referenced
this pull request
Jun 10, 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.
What
promotionGateas a package primitive (src/runtime/promotion-gate.ts, exported from./loops): the promotion decision over a holdoutBenchmarkReport— SEEDED paired bootstrap via agent-evalheldoutSignificance, deterministic verdict, minimum-evidence floor (default 6 paired tasks), CI lower bound must clear the threshold. Replaces the bench-local unseededpairedBootstrapgate, whose verdict was non-deterministic re-run to re-run and accepted n=2.authorStrategyhardening: namedfallbackModelretry (one attempt when the primary call fails or returns no code block — the edge-524/thinking-model case), andtemperature/maxTokensare now actually passed through (temperaturewas declared but silently ignored).assertAuthoredCodeSafe→assertStrategyContract: same checks, honest framing — the lint enforces the harness's two measurement invariants at the module boundary (author blindness: no out-of-band reads/mutations of verifier state; conserved dose: no out-of-band compute), which is what keeps harness-verified scores and equal-budget comparisons meaningful. It is a contract lint for measurement integrity, not a security boundary.bench/src/strategy-author.mtsdrops its duplicateauthorStrategy+ driftedcontractDoc(it lacked the fix(runtime): authored-code import enforcement + empty-messages foot-gun #219 empty-messages rule) and becomes the R0→R2 ladder CLI over the package primitive;flywheel-run.mtsauthors and gates through the package. Authored run artifacts are gitignored + excluded from bench typecheck.tests/loops/strategy-suite.test.ts): harness-verified scoring (a{score:1}-doing-nothing body scores 0; keep-best overrides under-reporting), themessages: []-is-fresh rule, the contract lint's accept/reject set, and the gate's determinism + floor + fail-loud pairing.bench/HARNESS.mdsynced (author defaultdeepseek-v4-pro, rotating holdout, packaged gate).Why
The flywheel is the measurement instrument for the self-improvement program; its promotion verdict must be reproducible and its author path must have one implementation. This closes the bench/package duplication (drifted contracts), the unseeded-gate hole, and puts the #217/#219 correctness claims under test.
Verification
pnpm run typecheckclean,pnpm run lintclean (13 pre-existing warnings untouched),pnpm test698 passed / 1 skipped (+18 new).cd bench && npx tsc --noEmit -p tsconfig.jsonclean against the rebuilt dist.