feat(auto-improvement): measurement-first self-improvement app (GitHub-native) - #1013
Conversation
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Arbiter — ⏳ review pendingArbiter is waiting for Opus-5 Design review output for Second-order review for False positive or not applicable? A repository writer can comment: For a broader accepted-risk deferral, apply |
UX Review (Fable 5) — 🟡 CONCERNSAdvisory UX-level review of Evidence gathered — I've read the diff's UI components, the English catalog additions, and all three committed screenshots. Emitting the review. UX-Verdict: CONCERNS The evidence surface is strong, but the headline stats and ruler card leak raw implementation values, and the "Kept" number doesn't count kept changes. Watch
Suggestions
[UX-REVIEWED] d538eb9 |
Design Review (Fable 5) — 🟡 CONCERNSAdvisory design-level review of Both design reviews are in. I have what I need to render the verdict. Design-Verdict: CONCERNS Sound, principled core — measurement-before-change is the right answer to "an unsupervised editor can't prove it helped" — but the marketed safety guarantees are weaker than stated and a large security-critical slice ships unexercised. Watch
Suggestions
[DESIGN-REVIEWED] d538eb9 |
d8cc7bc to
edababf
Compare
edababf to
ee28be2
Compare
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
ee28be2 to
f4972c6
Compare
f4972c6 to
f8f0c6d
Compare
af4c46f to
05584ea
Compare
05584ea to
923c30e
Compare
923c30e to
458ccd1
Compare
458ccd1 to
5e42507
Compare
CI status on
|
CI status update on
|
✅ All automated checks green on
|
Problem
An agent that edits your repository unsupervised has no way to prove it helped. It can
"optimize" something and be measuring noise; it can "fix" a bug it never reproduced; it can
delete a test to make the suite pass. There is no artifact a human can check afterwards, so
the only safe answer today is not to run one.
Why it matters
The useful version of this — a loop that finds real defects and proposes real fixes while you
sleep — is blocked on trust, not on capability. Without measurement you cannot tell a genuine
win from a coincidence, and without a paper trail you cannot review the result. So the feature
either does not ship, or ships as something nobody should point at a repository they care about.
Fix: measurement first, then change
The chain of thought is: you cannot keep a win you cannot measure → so prove the instrument
before using it → then make every kept change carry its own evidence.
1. Prove the ruler before touching anything. Phase 1 calibrates a noise band from repeated
baseline samples (
max(2sigma, floor)), then forces a known win and requires it to clear thatband. If the ruler cannot see a win it is known to contain, the perf run halts — the app
refuses to measure with an instrument it has not validated.
2. Keep-or-revert, never keep-and-hope. A candidate is kept only if its delta clears the
calibrated band and every guardrail holds. Bug-track candidates must demonstrate
RED → GREEN → STAYGREEN: a new test that fails on unmodified code, passes with the fix, and
keeps passing. A candidate that cannot show that is reverted, and the reason is recorded.
3. Every decision is durable. An append-only ledger records what was investigated and what
happened to it —
filed,Rejected by the gate,Below the noise band,No defect found,Duplicate. Content-fingerprinted, so the loop never re-investigates the same locus acrossrestarts.
4. It proposes; it does not publish. The clone's push is mechanically disabled (both remote
URLs neutralized — pushing by URL ignores the push URL, so disabling one is not enough). Work
leaves as a draft pull request you review. Direct-commit is opt-in and can never target a
protected branch.
Screenshots
Captured from a real run against
Zedmor/chess_testonthe loopback dashboard — not mockups.
The dashboard. Ruler calibrated with its measured band (7.76s), the ledger count, and the
push disabledbadge on the working clone.The findings ledger. Every locus the loop touched and its outcome. Note the statuses are
prose, not implementation tokens, and the irreversible action carries a text label
("Commit to the branch"), not a bare icon.
The evidence behind one kept change — the part that makes this reviewable. Defect statement,
reproduction hypothesis, the six verification gates that passed (
RED (x2) → GREEN → STAYGREEN),the repro test's path, the base sha it was measured against, the fingerprint, and the resulting
pull request.
What the loop actually found in that run
A real off-by-one:
order_movesis called with depth up toMAX_DEPTH(64), but the killertable has only 64 slots (indices 0–63), so at
depth == 64it indexeskiller_moves[64]andraises
IndexError. The agent wrote a test that reproduces it, fixed it, and the suite stayedgreen —
Zedmor/chess_test#1.Suggested reading order
121 files is a lot, so here is the path that makes it reviewable. The first four files are
the whole design; everything else is adapters, UI, and tests.
spine/contracts.pyspine/driver.pyspine/preflight.pycalibrate → force canary → require it clears the band, else refuse Phase 2.spine/keeper.py+spine/ledger.pyprofiles/github_repo/profile.pybackend/routes.py+website/src/apps/auto-improvement/Safety controls (each one is a test, not a promise)
backend/clone_setup.pyRepoEditAllowlistspine/agent_runner.pygit push,gh pr merge/ready/close/create,gh api,gh auth,gh secret,curl/wget/ssh— matched after stripping global options, command wrappers (sudo,env,timeout), nested shells and&&/;/|separators._governance_denialHookManager, including the operator's keystone denied-command list. Fail-closed: a broken hook layer denies.sandboxed_spawn_argv(mode="strict")~/.aws,~/.config/gh,~/.dockeras empty;~/.sshexposes onlyknown_hosts.security_posture.pyTests
811 tests in-tree. The interesting ones are not the happy paths:
test_dogfood_learnings.py— 107 documented defects (D-1…D-107in the test plan), eachfound by running this app against real repositories, each with a regression test proven to fail
before its fix. This is the file to read if you want to know what actually went wrong.
test_preflight.py/test_measurer.py— the ruler refuses to proceed when it cannot see aknown win; an empty diff means "scoped to nothing", never "unscoped".
test_github_profile.py— RED→GREEN→STAYGREEN gate, the reward-hacking test-count guard.test_pr_recipe.py— both remote URLs neutralized; neither push route works.Manual verification
The screenshots above are the verification: enabled on a live gateway, pointed at a real GitHub
repository, ran the loop, and read the resulting evidence panel and pull request. To reproduce:
Then enable Auto-Improve in Apps, paste a repository URL, pick a base branch, and Start run.
Known limitations (stated, not discovered later)
nested interpreter can open a socket even though
curl/wget/ncare denied. PR watchersare therefore opt-in (
watcherAutoStart, default OFF) — turn it on only for repositorieswhose pull-request comments you would be willing to execute. Closing this properly needs a
network-isolating primitive at the platform layer.
evolutionary ("current best == HEAD"), so resetting between winners would break cumulative
measurement. Test-pinned; the perf track has never kept a real win end-to-end, so this is
latent.
lacks, or assume POSIX and fail the Windows shard. Both reasons are recorded in
setup.cfgwith the measurement behind them.