exp(ablation): pilot harness for GRADATA_BETA_LB_GATE#92
Merged
Conversation
Stages a small, manual-kickoff A/B harness to measure the Beta lower- bound promotion gate shipped in PR #86. Does not run the experiment — Oliver runs it with GRADATA_ABLATION_CONFIRM=1 when he wants a signal. - brain/scripts/ablation_beta_lb_gate.py: synthetic 20-lesson brain, graduation simulation under gate on/off, Sonnet generate + Haiku judge, writes .tmp/ablation_beta_lb_<ts>.json + human summary. - brain/scripts/README-ablation-beta-lb.md: context, run commands, cost table, decision criteria (pref-lift >= +1.0% AND grad-drop <= 50%). - tests/test_ablation_beta_lb_gate.py: dry-run zero-LLM-call proof, gate discriminates on synthetic pool, env-var restore, output schema. Safety gate: without GRADATA_ABLATION_CONFIRM=1 the script prints the trial count + token + dollar estimate and exits 0. Dry-run is verified by a test that raises AssertionError on any client-factory access. No changes to production code — harness PR only.
There was a problem hiding this comment.
Gradata has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.
|
Caution Review failedPull request was closed or merged during review 📝 Walkthrough
WalkthroughA new comprehensive pytest suite ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
This was referenced Apr 20, 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.
Summary
Stages a pilot ablation harness to measure the effect of the Beta lower-bound promotion gate shipped in PR #86 (
self_improvement._passes_beta_lb_gate). Default-OFF until we have an in-band signal; this is the tool that produces that signal.No production code changes. Harness + README + tests only.
What the harness does
Runs two conditions on the same seeded synthetic brain (~20 PATTERN-tier lessons with varied
(alpha, beta_param)so some would be blocked by the gate, some wouldn't):GRADATA_BETA_LB_GATE=0GRADATA_BETA_LB_GATE=1Measures:
Writes
.tmp/ablation_beta_lb_<timestamp>.json+ human summary.How to run the pilot
```bash
Dry run (safe, zero API calls):
python brain/scripts/ablation_beta_lb_gate.py --tasks 10 --iterations 2
Actually run:
GRADATA_ABLATION_CONFIRM=1 python brain/scripts/ablation_beta_lb_gate.py --tasks 10 --iterations 2
```
Estimated cost: ~$1 for 10 tasks x 2 iterations (20 trials = 40 Sonnet gens + 20 Haiku judges). Dry-run prints a precise estimate for any --tasks / --iterations combo.
Safety gate
Without `GRADATA_ABLATION_CONFIRM=1`, the script runs a dry-run only — prints trial count / token estimate / dollar estimate, exits 0, makes zero LLM calls. Enforced by a test that monkey-patches `_make_anthropic_client` to raise on any access, then invokes `main()` and asserts it still exits 0.
Decision criteria (when to default the gate ON)
Default gate ON when both hold on the pilot:
If lift is positive but graduation drops too far, tune `GRADATA_BETA_LB_THRESHOLD` down from 0.70 and re-run. Source: `.tmp/autoresearch-synthesis.md` §5 / §6.
Files
Test plan
Generated with Gradata