Spaces:
Running
feat(restraint): a11oy Restraint — governed + measured frugality gate
Browse filesAdopts the 6-rung ladder + lite/full/ultra intensity from the open-source Ponytail coding-agent skill (github.com/DietrichGebert/ponytail, MIT, (c) 2026 DietrichGebert) — adopted + governed, NOT invented here. Wires a pre-write reasoning gate into the a11oy Code path emitting restraint: ceiling comments. GOVERNED: signed DSSE receipt + advisory Lambda (Conjecture 1 OPEN, floor < 1.0) per decision. MEASURED: two-arm benchmark ported from Ponytail's promptfoo methodology, labelled MEASURED only when run else SAMPLE/ROADMAP; Ponytail's numbers stay CITED as theirs. ENERGY: J/token tie-in. Endpoints /api/a11oy/v1/restraint/{evaluate,bench,info}; UI at /restraint. Additive; 0 runtime CDN; 0 visible codenames.
Mirror of szl-holdings/a11oy main commit 57c7029c53adce0ffe00f482b2a70f656a3d7970.
Signed-off-by: Perplexity Computer Agent <agent@perplexity.ai>
- .github/copy-sync-lockstep.json +1 -0
- benchmarks/restraint/README.md +38 -0
- benchmarks/restraint/promptfooconfig.yaml +40 -0
- web/restraint.html +307 -0
|
@@ -45,6 +45,7 @@
|
|
| 45 |
"web/quant.html",
|
| 46 |
"web/living-anatomy.html",
|
| 47 |
"web/nemo.html",
|
|
|
|
| 48 |
"web/operator.html",
|
| 49 |
"web/v4_fleet_panel.html"
|
| 50 |
]
|
|
|
|
| 45 |
"web/quant.html",
|
| 46 |
"web/living-anatomy.html",
|
| 47 |
"web/nemo.html",
|
| 48 |
+
"web/restraint.html",
|
| 49 |
"web/operator.html",
|
| 50 |
"web/v4_fleet_panel.html"
|
| 51 |
]
|
|
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# a11oy Restraint — benchmark (Ponytail methodology, our measurements)
|
| 2 |
+
|
| 3 |
+
Two arms — **no-skill baseline** vs **a11oy-restraint** — over the same five
|
| 4 |
+
everyday tasks Ponytail uses (email validator, JS debounce, CSV sum, React
|
| 5 |
+
countdown, FastAPI rate-limit). Code LOC is counted from fenced code blocks;
|
| 6 |
+
tokens and latency come from the API. Median reported.
|
| 7 |
+
|
| 8 |
+
## Honesty labels (Doctrine v11)
|
| 9 |
+
|
| 10 |
+
- **MEASURED** — printed ONLY for a run we actually executed on our stack.
|
| 11 |
+
- **SAMPLE** — an illustrative fixture derived from our ladder model (the
|
| 12 |
+
`/api/a11oy/v1/restraint/bench` endpoint returns this when no model run is
|
| 13 |
+
wired on the Space).
|
| 14 |
+
- **ROADMAP** — the overall bench label until a real run is wired.
|
| 15 |
+
|
| 16 |
+
We **never** reprint Ponytail's published numbers as ours.
|
| 17 |
+
|
| 18 |
+
## Reproduce
|
| 19 |
+
|
| 20 |
+
```bash
|
| 21 |
+
cp ../../.env.example ../../.env # add your model key
|
| 22 |
+
npx promptfoo@latest eval -c benchmarks/restraint/promptfooconfig.yaml --repeat 10
|
| 23 |
+
npx promptfoo@latest view
|
| 24 |
+
```
|
| 25 |
+
|
| 26 |
+
Once a run completes, paste the measured medians into a `results/` file and the
|
| 27 |
+
UI/endpoint can surface them as **MEASURED** for that run only.
|
| 28 |
+
|
| 29 |
+
## Citation (Ponytail, MIT)
|
| 30 |
+
|
| 31 |
+
a11oy Restraint **adopts** the 6-rung ladder and the lite/full/ultra intensity
|
| 32 |
+
levels from the open-source **Ponytail** coding-agent skill
|
| 33 |
+
(<https://github.com/DietrichGebert/ponytail>, MIT, © 2026 DietrichGebert) —
|
| 34 |
+
**adopted + governed, not invented here**. Ponytail's published results
|
| 35 |
+
(80–94% less code, 47–77% cheaper, 3–6× faster; median of 10 runs across
|
| 36 |
+
Haiku/Sonnet/Opus) are **cited as Ponytail's**, never claimed as ours. Our
|
| 37 |
+
contribution is the governance (signed DSSE receipts + advisory Λ), the
|
| 38 |
+
measured-on-our-stack benchmark, and the J/token energy tie-in.
|
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# a11oy Restraint benchmark — Ponytail methodology PORTED to OUR stack.
|
| 2 |
+
#
|
| 3 |
+
# PROVENANCE (honest): this config is adapted from the open-source Ponytail
|
| 4 |
+
# skill's benchmark (github.com/DietrichGebert/ponytail/blob/main/benchmarks/
|
| 5 |
+
# promptfooconfig.yaml, MIT, © 2026 DietrichGebert). We reuse Ponytail's FIVE
|
| 6 |
+
# everyday tasks and its two-of-its-three arms idea, but we measure OUR arm
|
| 7 |
+
# (a11oy-restraint) on OUR models. We DO NOT reprint Ponytail's published
|
| 8 |
+
# numbers (80-94% less code, 47-77% cheaper, 3-6x faster, median across
|
| 9 |
+
# Haiku/Sonnet/Opus) as ours — those stay CITED as Ponytail's.
|
| 10 |
+
#
|
| 11 |
+
# Run: npx promptfoo@latest eval -c benchmarks/restraint/promptfooconfig.yaml --repeat 10
|
| 12 |
+
# View: npx promptfoo@latest view
|
| 13 |
+
# Needs a model key in the environment (set it, then the live UI label flips
|
| 14 |
+
# from SAMPLE/ROADMAP to MEASURED for the run you actually executed).
|
| 15 |
+
#
|
| 16 |
+
# Two arms ONLY (no-skill baseline vs a11oy-restraint). LOC is counted
|
| 17 |
+
# deterministically from fenced code blocks; tokens + latency come from the API.
|
| 18 |
+
description: "a11oy Restraint vs no-skill baseline: same model, same tasks. Measures code LOC (deterministic) and tokens/latency (API telemetry). Numbers are OURS, measured on OUR stack — never Ponytail's reprinted."
|
| 19 |
+
|
| 20 |
+
prompts:
|
| 21 |
+
- id: file://arms/baseline.txt
|
| 22 |
+
label: baseline (no skill)
|
| 23 |
+
- id: file://arms/a11oy-restraint.txt
|
| 24 |
+
label: a11oy-restraint
|
| 25 |
+
|
| 26 |
+
defaultTest:
|
| 27 |
+
assert:
|
| 28 |
+
- type: javascript
|
| 29 |
+
value: file://loc.js
|
| 30 |
+
metric: code_loc
|
| 31 |
+
|
| 32 |
+
# The same five everyday tasks Ponytail benchmarks (cited; tasks are facts, not
|
| 33 |
+
# Ponytail's measured outputs). Our restraint ladder is expected to stop high on
|
| 34 |
+
# most of these (stdlib / native / one-line).
|
| 35 |
+
tests:
|
| 36 |
+
- vars: { task: "Write me a Python function that validates email addresses." }
|
| 37 |
+
- vars: { task: "Add debounce to a search input in vanilla JavaScript. It currently fires an API call on every keystroke." }
|
| 38 |
+
- vars: { task: "Write Python code that reads sales.csv and sums the 'amount' column." }
|
| 39 |
+
- vars: { task: "Build me a countdown timer component in React that counts down from a given number of seconds." }
|
| 40 |
+
- vars: { task: "Add rate limiting to my FastAPI endpoint so users can't spam it." }
|
|
@@ -0,0 +1,307 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<!DOCTYPE html>
|
| 2 |
+
<html lang="en">
|
| 3 |
+
<head>
|
| 4 |
+
<meta charset="UTF-8"/>
|
| 5 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
| 6 |
+
<title>a11oy Restraint — Governed + Measured Frugality Gate · SZL Holdings</title>
|
| 7 |
+
<meta name="description" content="a11oy Restraint: a governed, measured frugality gate for the a11oy Code agent. Before emitting a diff the agent descends a 6-rung ladder (YAGNI, stdlib, native, installed dep, one line, then minimal code) and stops at the first rung that holds, marking deliberate simplifications with restraint: ceiling comments. Every decision becomes a signed DSSE receipt and an advisory Lambda score; benchmark numbers are labelled MEASURED only when actually run, else SAMPLE/ROADMAP. The ladder + intensity levels are adopted from the open-source Ponytail skill (MIT); governance and measurement are ours."/>
|
| 8 |
+
<link rel="preconnect" href="https://fonts.googleapis.com"/><link rel="preconnect" href="https://fonts.gstatic.com" crossorigin/>
|
| 9 |
+
<link href="https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"/>
|
| 10 |
+
<style>
|
| 11 |
+
:root{
|
| 12 |
+
--ground:#0a0a0a; --panel:#0e0e0e; --panel2:#080808;
|
| 13 |
+
--gold:#c9b787; --gold-bright:#d6c69a;
|
| 14 |
+
--teal:#5fb3a3; --teal-soft:rgba(95,179,163,0.10);
|
| 15 |
+
--cream:#f5f5f5; --paragraph:#9a9a9a; --muted:#888; --dim:#555;
|
| 16 |
+
--gold-line:rgba(201,183,135,0.15); --gold-soft:rgba(201,183,135,0.04);
|
| 17 |
+
--teal-line:rgba(95,179,163,0.22);
|
| 18 |
+
--live:#5a8a6e; --err:#b06a5a;
|
| 19 |
+
--green:#39d98a; --yellow:#f5c451; --red:#ff6a5a; --blue:#5bc8ff;
|
| 20 |
+
--mono:'JetBrains Mono',ui-monospace,SFMono-Regular,monospace;
|
| 21 |
+
--display:'Space Grotesk',Georgia,serif;
|
| 22 |
+
}
|
| 23 |
+
*{box-sizing:border-box;}
|
| 24 |
+
html,body{margin:0;padding:0;background:var(--ground);color:var(--cream);font-family:var(--display);-webkit-font-smoothing:antialiased;}
|
| 25 |
+
.mono{font-family:var(--mono);}
|
| 26 |
+
a{color:inherit;text-decoration:none;}
|
| 27 |
+
code{font-family:var(--mono);color:var(--gold-bright);font-size:.9em;}
|
| 28 |
+
.topbar{position:sticky;top:0;z-index:60;display:flex;align-items:center;gap:1rem;flex-wrap:wrap;padding:.5rem 1.1rem;background:rgba(10,10,10,.92);backdrop-filter:blur(10px);border-bottom:1px solid var(--gold-line);font-family:var(--mono);font-size:10.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--gold);}
|
| 29 |
+
.topbar .sep{color:var(--dim);}
|
| 30 |
+
.topbar .live{display:inline-flex;align-items:center;gap:.4rem;color:var(--cream);}
|
| 31 |
+
.live-dot{width:6px;height:6px;border-radius:50%;background:var(--live);box-shadow:0 0 6px var(--live);animation:pulse 2.2s ease-in-out infinite;}
|
| 32 |
+
@keyframes pulse{0%,100%{opacity:1;}50%{opacity:.35;}}
|
| 33 |
+
.switcher{margin-left:auto;display:flex;align-items:center;gap:.3rem;flex-wrap:wrap;}
|
| 34 |
+
.flag{padding:.22rem .55rem;border-radius:6px;border:1px solid transparent;color:var(--muted);transition:.15s;}
|
| 35 |
+
.flag:hover{color:var(--cream);border-color:var(--gold-line);background:var(--gold-soft);}
|
| 36 |
+
.flag.active{color:var(--ground);background:var(--gold);border-color:var(--gold);font-weight:600;}
|
| 37 |
+
.wrap{max-width:1320px;margin:0 auto;padding:1.6rem 1.4rem 4rem;}
|
| 38 |
+
h1{font-size:1.75rem;font-weight:600;margin:.2rem 0 .3rem;letter-spacing:-.01em;}
|
| 39 |
+
.badge{display:inline-block;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--teal);border:1px solid var(--teal-line);background:var(--teal-soft);padding:.25rem .6rem;border-radius:5px;margin-left:.4rem;vertical-align:middle;}
|
| 40 |
+
.lede{color:var(--paragraph);font-size:.95rem;line-height:1.65;max-width:1180px;margin:.6rem 0 1rem;}
|
| 41 |
+
.lede b{color:var(--cream);font-weight:600;}
|
| 42 |
+
.honest{border:1px solid var(--gold-line);background:var(--gold-soft);border-radius:8px;padding:.7rem 1rem;margin:.4rem 0 1.2rem;font-family:var(--mono);font-size:11.5px;color:var(--paragraph);line-height:1.7;}
|
| 43 |
+
.honest .k{color:var(--gold);text-transform:uppercase;letter-spacing:.08em;font-size:10px;}
|
| 44 |
+
.honest .hi{color:var(--teal);}
|
| 45 |
+
.cards{display:grid;grid-template-columns:repeat(4,1fr);gap:.8rem;margin:0 0 1.2rem;}
|
| 46 |
+
.card{border:1px solid var(--gold-line);background:var(--panel);border-radius:8px;padding:.85rem 1rem;}
|
| 47 |
+
.card .lbl{font-family:var(--mono);font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:var(--dim);}
|
| 48 |
+
.card .big{font-size:1.5rem;font-weight:600;margin:.35rem 0 .15rem;color:var(--teal);}
|
| 49 |
+
.card .sub{font-family:var(--mono);font-size:10.5px;color:var(--muted);}
|
| 50 |
+
.grid2{display:grid;grid-template-columns:1.1fr .9fr;gap:1rem;}
|
| 51 |
+
.panel{border:1px solid var(--gold-line);background:var(--panel);border-radius:10px;padding:1rem 1.1rem;margin-bottom:1rem;}
|
| 52 |
+
.panel h2{font-size:1.05rem;font-weight:600;margin:0 0 .2rem;display:flex;align-items:center;justify-content:space-between;gap:.5rem;}
|
| 53 |
+
.panel h2 .meta{font-family:var(--mono);font-size:10px;color:var(--dim);text-transform:uppercase;letter-spacing:.06em;}
|
| 54 |
+
.panel .desc{color:var(--paragraph);font-size:.85rem;line-height:1.55;margin:.1rem 0 .6rem;}
|
| 55 |
+
.kv{font-family:var(--mono);font-size:12px;color:var(--paragraph);line-height:1.9;margin-top:.4rem;}
|
| 56 |
+
.kv .k{color:var(--dim);display:inline-block;min-width:160px;}
|
| 57 |
+
.kv .v{color:var(--cream);}
|
| 58 |
+
.pill{display:inline-block;font-family:var(--mono);font-size:10px;letter-spacing:.06em;text-transform:uppercase;padding:.18rem .5rem;border-radius:5px;border:1px solid var(--gold-line);}
|
| 59 |
+
.pill.green{color:var(--green);border-color:rgba(57,217,138,.4);background:rgba(57,217,138,.08);}
|
| 60 |
+
.pill.yellow{color:var(--yellow);border-color:rgba(245,196,81,.4);background:rgba(245,196,81,.08);}
|
| 61 |
+
.pill.blue{color:var(--blue);border-color:rgba(91,200,255,.4);background:rgba(91,200,255,.08);}
|
| 62 |
+
input,textarea,select{font-family:var(--mono);font-size:12.5px;background:var(--panel2);color:var(--cream);border:1px solid var(--gold-line);border-radius:7px;padding:.55rem .7rem;width:100%;}
|
| 63 |
+
textarea{min-height:70px;resize:vertical;}
|
| 64 |
+
label.fld{display:block;font-family:var(--mono);font-size:10px;letter-spacing:.08em;text-transform:uppercase;color:var(--dim);margin:.6rem 0 .25rem;}
|
| 65 |
+
button{font-family:var(--mono);font-size:11.5px;letter-spacing:.06em;text-transform:uppercase;background:var(--gold);color:var(--ground);border:none;border-radius:7px;padding:.55rem 1rem;cursor:pointer;font-weight:600;transition:.15s;}
|
| 66 |
+
button:hover{background:var(--gold-bright);}
|
| 67 |
+
button.ghost{background:transparent;color:var(--gold);border:1px solid var(--gold-line);}
|
| 68 |
+
button.ghost:hover{background:var(--gold-soft);}
|
| 69 |
+
.seg{display:inline-flex;gap:.2rem;border:1px solid var(--gold-line);border-radius:7px;padding:.2rem;}
|
| 70 |
+
.seg button{background:transparent;color:var(--muted);padding:.35rem .7rem;}
|
| 71 |
+
.seg button.on{background:var(--gold);color:var(--ground);}
|
| 72 |
+
.ladder{display:flex;flex-direction:column;gap:.35rem;margin:.5rem 0;}
|
| 73 |
+
.rung{display:flex;align-items:flex-start;gap:.6rem;border:1px solid var(--gold-line);border-radius:7px;padding:.5rem .7rem;background:var(--panel2);font-size:12.5px;}
|
| 74 |
+
.rung .n{font-family:var(--mono);font-size:11px;color:var(--dim);min-width:1.4rem;}
|
| 75 |
+
.rung.held{border-color:var(--teal-line);background:var(--teal-soft);}
|
| 76 |
+
.rung.held .n{color:var(--teal);}
|
| 77 |
+
.rung .nm{color:var(--paragraph);}
|
| 78 |
+
.rung.held .nm{color:var(--cream);}
|
| 79 |
+
.rung .tag{margin-left:auto;font-family:var(--mono);font-size:9px;letter-spacing:.06em;text-transform:uppercase;color:var(--dim);}
|
| 80 |
+
.rung.held .tag{color:var(--teal);}
|
| 81 |
+
.ceil{font-family:var(--mono);font-size:12px;color:var(--gold-bright);background:var(--panel2);border:1px solid var(--gold-line);border-radius:7px;padding:.6rem .75rem;margin:.5rem 0;white-space:pre-wrap;word-break:break-word;}
|
| 82 |
+
table{width:100%;border-collapse:collapse;font-family:var(--mono);font-size:11.5px;margin-top:.5rem;}
|
| 83 |
+
th,td{text-align:right;padding:.4rem .5rem;border-bottom:1px solid var(--gold-line);}
|
| 84 |
+
th:first-child,td:first-child{text-align:left;}
|
| 85 |
+
th{color:var(--dim);text-transform:uppercase;font-size:9.5px;letter-spacing:.08em;font-weight:500;}
|
| 86 |
+
td{color:var(--paragraph);}
|
| 87 |
+
td.hi{color:var(--teal);}
|
| 88 |
+
.foot{font-family:var(--mono);font-size:10.5px;color:var(--dim);line-height:1.8;margin-top:1.5rem;border-top:1px solid var(--gold-line);padding-top:1rem;}
|
| 89 |
+
.foot a{color:var(--gold);}
|
| 90 |
+
.szl-pill{font-family:var(--mono);}
|
| 91 |
+
.spin{display:inline-block;width:11px;height:11px;border:2px solid var(--gold-line);border-top-color:var(--gold);border-radius:50%;animation:rot .8s linear infinite;vertical-align:middle;}
|
| 92 |
+
@keyframes rot{to{transform:rotate(360deg);}}
|
| 93 |
+
.sample-chips{display:flex;gap:.35rem;flex-wrap:wrap;margin:.5rem 0;}
|
| 94 |
+
.chip{font-family:var(--mono);font-size:10.5px;color:var(--muted);border:1px solid var(--gold-line);border-radius:20px;padding:.25rem .65rem;cursor:pointer;}
|
| 95 |
+
.chip:hover{color:var(--cream);background:var(--gold-soft);}
|
| 96 |
+
</style>
|
| 97 |
+
</head>
|
| 98 |
+
<body>
|
| 99 |
+
<div class="topbar">
|
| 100 |
+
<span class="live"><span class="live-dot"></span> a11oy</span>
|
| 101 |
+
<span class="sep">/</span><span>Restraint</span>
|
| 102 |
+
<span class="sep">/</span><span>Governed + Measured Frugality Gate</span>
|
| 103 |
+
<span class="switcher">
|
| 104 |
+
<a class="flag" href="/console">Console</a>
|
| 105 |
+
<a class="flag" href="/agent">Agent Loop</a>
|
| 106 |
+
<a class="flag" href="/nemo">Agent Model</a>
|
| 107 |
+
<a class="flag" href="/energy">Energy</a>
|
| 108 |
+
<a class="flag active" href="/restraint">Restraint</a>
|
| 109 |
+
</span>
|
| 110 |
+
</div>
|
| 111 |
+
|
| 112 |
+
<div class="wrap">
|
| 113 |
+
<h1>a11oy Restraint <span class="badge" id="b-doctrine">Doctrine v11</span><span id="b-heuristic"></span></h1>
|
| 114 |
+
<p class="lede">
|
| 115 |
+
Before the a11oy Code agent emits a diff, it descends a <b>6-rung ladder</b> and stops at the
|
| 116 |
+
first rung that holds — <b>(1) YAGNI</b>, (2) stdlib, (3) native platform feature,
|
| 117 |
+
(4) already-installed dependency, (5) one line, then (6) minimum viable code. Deliberate
|
| 118 |
+
simplifications are marked with <code>restraint:</code> ceiling comments that name the upgrade path.
|
| 119 |
+
Every decision becomes a <b>signed DSSE receipt</b> and an advisory <b>Λ</b> trust score; the
|
| 120 |
+
benchmark reproduces code-reduction / cost / speed numbers on <b>our</b> stack, labelled
|
| 121 |
+
<b>MEASURED only when actually run</b>, else SAMPLE/ROADMAP.
|
| 122 |
+
</p>
|
| 123 |
+
<div class="honest">
|
| 124 |
+
<span class="k">Provenance — honest</span> The ladder and the <span class="hi">lite / full / ultra</span>
|
| 125 |
+
intensity levels are <b>adopted</b> from the open-source <b>Ponytail</b> coding-agent skill
|
| 126 |
+
(<a href="https://github.com/DietrichGebert/ponytail" target="_blank" rel="noopener" style="color:var(--gold)">github.com/DietrichGebert/ponytail</a>,
|
| 127 |
+
MIT, © 2026 DietrichGebert) — <b>adopted + governed, not invented here</b>. Our additions are
|
| 128 |
+
the signed receipts, the Λ score, the measured-on-our-stack benchmark, and the energy tie-in.
|
| 129 |
+
Ponytail's published numbers (<span class="hi">80–94% less code, 47–77% cheaper, 3–6× faster</span>,
|
| 130 |
+
median across Haiku/Sonnet/Opus) are <b>cited as Ponytail's</b>, never claimed as ours.
|
| 131 |
+
Λ uniqueness is <b>Conjecture 1 (OPEN)</b>, advisory floor < 1.0 — not a proven theorem.
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<div class="cards" id="cards">
|
| 135 |
+
<div class="card"><div class="lbl">Ladder rungs</div><div class="big">6</div><div class="sub">stop at first that holds</div></div>
|
| 136 |
+
<div class="card"><div class="lbl">Intensity levels</div><div class="big">3</div><div class="sub">lite · full · ultra</div></div>
|
| 137 |
+
<div class="card"><div class="lbl">Per-decision receipt</div><div class="big">DSSE</div><div class="sub" id="c-signer">in-image ECDSA-P256</div></div>
|
| 138 |
+
<div class="card"><div class="lbl">Energy thesis</div><div class="big">J/tok</div><div class="sub">less code · fewer joules</div></div>
|
| 139 |
+
</div>
|
| 140 |
+
|
| 141 |
+
<div class="grid2">
|
| 142 |
+
<div class="panel">
|
| 143 |
+
<h2>Evaluate a task <span class="meta">POST /api/a11oy/v1/restraint/evaluate</span></h2>
|
| 144 |
+
<p class="desc">Type what the code agent is about to build. Restraint runs the pre-write ladder, names the ceiling, scores Λ, estimates lines/tokens/joules saved, and signs the decision.</p>
|
| 145 |
+
<div class="sample-chips" id="chips"></div>
|
| 146 |
+
<label class="fld">Task</label>
|
| 147 |
+
<textarea id="task" placeholder="e.g. add a cache for these API responses">add a cache for these API responses</textarea>
|
| 148 |
+
<label class="fld">Intensity</label>
|
| 149 |
+
<div class="seg" id="seg">
|
| 150 |
+
<button data-i="lite">lite</button>
|
| 151 |
+
<button data-i="full" class="on">full</button>
|
| 152 |
+
<button data-i="ultra">ultra</button>
|
| 153 |
+
</div>
|
| 154 |
+
<div style="margin-top:.7rem;display:flex;gap:.5rem;">
|
| 155 |
+
<button id="run">Run ladder</button>
|
| 156 |
+
<button class="ghost" id="runbench">Run benchmark</button>
|
| 157 |
+
</div>
|
| 158 |
+
</div>
|
| 159 |
+
|
| 160 |
+
<div class="panel">
|
| 161 |
+
<h2>Ladder decision <span class="meta" id="dec-label"></span></h2>
|
| 162 |
+
<p class="desc" id="dec-summary">Run the ladder to see which rung stopped it and why.</p>
|
| 163 |
+
<div class="ladder" id="ladder"></div>
|
| 164 |
+
<div class="ceil" id="ceil" style="display:none"></div>
|
| 165 |
+
<div class="kv" id="dec-kv"></div>
|
| 166 |
+
</div>
|
| 167 |
+
</div>
|
| 168 |
+
|
| 169 |
+
<div class="grid2">
|
| 170 |
+
<div class="panel">
|
| 171 |
+
<h2>Signed receipt <span class="meta">in-image ECDSA-P256 / DSSE</span></h2>
|
| 172 |
+
<p class="desc">The governed differentiator: every restraint decision is a tamper-evident DSSE receipt. Verify in-browser against <code>/cosign.pub</code>.</p>
|
| 173 |
+
<div class="kv" id="receipt-kv"><span class="k">status</span> <span class="v">— run the ladder —</span></div>
|
| 174 |
+
</div>
|
| 175 |
+
<div class="panel">
|
| 176 |
+
<h2>Energy tie-in <span class="meta" id="energy-label"></span></h2>
|
| 177 |
+
<p class="desc">Less code → fewer tokens → fewer joules on our GPU. Estimates are MODELED; the joules label defers to the on-box NVML meter (reads <code>sample</code> unless a fresh exporter reading is present).</p>
|
| 178 |
+
<div class="kv" id="energy-kv"><span class="k">tokens saved</span> <span class="v">—</span></div>
|
| 179 |
+
</div>
|
| 180 |
+
</div>
|
| 181 |
+
|
| 182 |
+
<div class="panel">
|
| 183 |
+
<h2>Benchmark — baseline vs a11oy-restraint <span class="meta" id="bench-label">GET /api/a11oy/v1/restraint/bench</span></h2>
|
| 184 |
+
<p class="desc">Ported from Ponytail's promptfoo methodology (MIT): the same five everyday tasks, two arms, median reported. <b>Numbers are SAMPLE/ROADMAP on this Space</b> (no model run wired here) and flip to <b>MEASURED</b> only when a model run is supplied. We measure our own; we never reprint Ponytail's numbers as ours.</p>
|
| 185 |
+
<table id="bench"><thead><tr><th>Task</th><th>Rung</th><th>Baseline LOC</th><th>Restraint LOC</th><th>LOC −%</th><th>Cost-proxy −%</th><th>Latency −%</th><th>Label</th></tr></thead><tbody><tr><td colspan="8" style="text-align:center;color:var(--dim)">Run benchmark to populate.</td></tr></tbody></table>
|
| 186 |
+
<div class="kv" id="bench-agg" style="margin-top:.7rem"></div>
|
| 187 |
+
</div>
|
| 188 |
+
|
| 189 |
+
<div class="foot" id="foot">
|
| 190 |
+
<div>a11oy Restraint · Doctrine v11 (locked=8 @ c7c0ba17) · Λ = Conjecture 1 (OPEN, advisory floor < 1.0) · SLSA L1 honest, L2/L3 roadmap · 0 runtime CDN · signed receipts.</div>
|
| 191 |
+
<div>Adopted + governed from <a href="https://github.com/DietrichGebert/ponytail" target="_blank" rel="noopener">Ponytail</a> (MIT, © 2026 DietrichGebert). Endpoints: <code>/api/a11oy/v1/restraint/{evaluate,bench,info}</code>.</div>
|
| 192 |
+
</div>
|
| 193 |
+
</div>
|
| 194 |
+
|
| 195 |
+
<script src="/static/shared/szl_label_engine.js"></script>
|
| 196 |
+
<script src="/static/shared/szl_receipt_cosign.js"></script>
|
| 197 |
+
<script>
|
| 198 |
+
"use strict";
|
| 199 |
+
var INTENSITY = "full";
|
| 200 |
+
function $(s){return document.querySelector(s);}
|
| 201 |
+
function el(t,c,h){var e=document.createElement(t);if(c)e.className=c;if(h!=null)e.innerHTML=h;return e;}
|
| 202 |
+
function pill(key){ try{ if(window.SZLLabels&&window.SZLLabels.badgeHTML){return window.SZLLabels.badgeHTML(key);} }catch(e){} return '<span class="szl-pill pill">'+key+'</span>'; }
|
| 203 |
+
async function getJSON(u,opt){try{var r=await fetch(u,opt);if(!r.ok)return null;return await r.json();}catch(e){return null;}}
|
| 204 |
+
function esc(s){return String(s==null?'':s).replace(/[&<>]/g,function(m){return {'&':'&','<':'<','>':'>'}[m];});}
|
| 205 |
+
|
| 206 |
+
// honest badges via window.SZLLabels
|
| 207 |
+
$('#b-heuristic').innerHTML = pill('HEURISTIC');
|
| 208 |
+
$('#bench-label').innerHTML = 'GET /api/a11oy/v1/restraint/bench ' + pill('ROADMAP');
|
| 209 |
+
$('#energy-label').innerHTML = pill('MODELED');
|
| 210 |
+
|
| 211 |
+
var CHIPS = ["add a cache for these API responses","validate an email address","add a date picker",
|
| 212 |
+
"build a generic pluggable plugin framework for later","sort this list of names",
|
| 213 |
+
"add rate limiting to my FastAPI endpoint","add debounce to a search input in vanilla JS"];
|
| 214 |
+
(function(){var c=$('#chips');CHIPS.forEach(function(t){var b=el('span','chip',esc(t));b.onclick=function(){$('#task').value=t;run();};c.appendChild(b);});})();
|
| 215 |
+
|
| 216 |
+
document.querySelectorAll('#seg button').forEach(function(b){
|
| 217 |
+
b.onclick=function(){document.querySelectorAll('#seg button').forEach(function(x){x.classList.remove('on');});b.classList.add('on');INTENSITY=b.getAttribute('data-i');run();};
|
| 218 |
+
});
|
| 219 |
+
|
| 220 |
+
function renderLadder(trail, stopped){
|
| 221 |
+
var L=$('#ladder');L.innerHTML='';
|
| 222 |
+
(trail||[]).forEach(function(r){
|
| 223 |
+
var held=r.rung===stopped;
|
| 224 |
+
var row=el('div','rung'+(held?' held':''));
|
| 225 |
+
row.innerHTML='<span class="n">'+r.rung+'</span><span class="nm">'+esc(r.name)+'</span>'+
|
| 226 |
+
'<span class="tag">'+(held?'STOPPED HERE':(r.held?'holds':'skip'))+'</span>';
|
| 227 |
+
L.appendChild(row);
|
| 228 |
+
});
|
| 229 |
+
}
|
| 230 |
+
|
| 231 |
+
async function run(){
|
| 232 |
+
var task=$('#task').value.trim(); if(!task)return;
|
| 233 |
+
$('#dec-summary').innerHTML='<span class="spin"></span> running ladder…';
|
| 234 |
+
$('#dec-label').innerHTML='';
|
| 235 |
+
var d=await getJSON('/api/a11oy/v1/restraint/evaluate',{method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({task:task,intensity:INTENSITY,lang:'py'})});
|
| 236 |
+
if(!d){$('#dec-summary').textContent='endpoint unavailable (is the Space running?)';return;}
|
| 237 |
+
$('#dec-label').innerHTML=pill(d.label||'HEURISTIC');
|
| 238 |
+
$('#dec-summary').innerHTML='Stopped at rung <b style="color:var(--teal)">'+d.stopped_at_rung+' — '+esc(d.rung_key)+'</b>. '+esc(d.answer);
|
| 239 |
+
renderLadder(d.ladder_trail,d.stopped_at_rung);
|
| 240 |
+
var ce=$('#ceil');ce.style.display='block';ce.textContent=d.restraint_comment;
|
| 241 |
+
var lam=(d.lambda_score&&d.lambda_score.lambda)||0;
|
| 242 |
+
var saved=d.lines_saved_estimate||{};
|
| 243 |
+
$('#dec-kv').innerHTML=
|
| 244 |
+
'<div><span class="k">Λ (Conjecture 1, <1.0)</span><span class="v">'+lam.toFixed(3)+(lam<1?' ✓ below floor':'')+'</span></div>'+
|
| 245 |
+
'<div><span class="k">lines saved (modeled)</span><span class="v">≈'+(saved.lines_saved_modeled||0)+' LOC ('+Math.round((saved.reduction_fraction||0)*100)+'%)</span> '+pill(saved.label||'MODELED')+'</div>'+
|
| 246 |
+
'<div><span class="k">never simplify away</span><span class="v">'+esc((d.never_simplify||[]).join(', '))+'</span></div>'+
|
| 247 |
+
'<div><span class="k">intensity</span><span class="v">'+esc(d.intensity)+'</span></div>';
|
| 248 |
+
|
| 249 |
+
// receipt panel
|
| 250 |
+
var rc=d.signed_receipt;var rk=$('#receipt-kv');
|
| 251 |
+
if(rc){
|
| 252 |
+
var signed=rc.signed===true;
|
| 253 |
+
rk.innerHTML='<div><span class="k">signed</span><span class="v">'+(signed?pill('LIVE')+' yes':'<span class="pill yellow">UNSIGNED</span> '+esc(rc.honesty||''))+'</span></div>'+
|
| 254 |
+
'<div><span class="k">payloadType</span><span class="v">'+esc(rc.payloadType||'—')+'</span></div>'+
|
| 255 |
+
'<div><span class="k">PAE sha256</span><span class="v">'+esc((rc._pae_sha256||'').slice(0,32))+'…</span></div>'+
|
| 256 |
+
'<div><span class="k">keyid</span><span class="v">'+esc((rc.signatures&&rc.signatures[0]&&rc.signatures[0].keyid)||'—')+'</span></div>'+
|
| 257 |
+
'<div><span class="k">verify</span><span class="v">against <code>/cosign.pub</code> in-browser</span></div>';
|
| 258 |
+
if(rc.signatures&&rc.signatures.length&&window.SZLReceipts&&window.SZLReceipts.verifyEnvelope){
|
| 259 |
+
try{var v=await window.SZLReceipts.verifyEnvelope(rc,{});if(v){rk.insertAdjacentHTML('beforeend','<div><span class="k">browser verify</span><span class="v">'+(v.valid?'✓ valid':'✗ '+esc(v.reason||''))+'</span></div>');}}catch(e){}
|
| 260 |
+
}
|
| 261 |
+
} else { rk.innerHTML='<span class="k">status</span> <span class="v">no signer wired</span>'; }
|
| 262 |
+
|
| 263 |
+
// energy panel
|
| 264 |
+
var en=d.energy_tiein||{};
|
| 265 |
+
$('#energy-kv').innerHTML=
|
| 266 |
+
'<div><span class="k">tokens saved (modeled)</span><span class="v">≈'+(en.tokens_saved_modeled||0)+'</span></div>'+
|
| 267 |
+
'<div><span class="k">joules saved (modeled)</span><span class="v">≈'+(en.joules_saved_modeled||0)+' J</span> '+pill('MODELED')+'</div>'+
|
| 268 |
+
'<div><span class="k">J / output token</span><span class="v">'+(en.j_per_output_token_modeled||0)+' (modeled)</span></div>'+
|
| 269 |
+
'<div><span class="k">joules meter label</span><span class="v">'+pill(((en.joules_label||'sample')).toUpperCase())+'</span></div>'+
|
| 270 |
+
'<div><span class="k">thesis</span><span class="v">'+esc(en.thesis||'')+'</span></div>';
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
async function runbench(){
|
| 274 |
+
var tb=$('#bench').querySelector('tbody');
|
| 275 |
+
tb.innerHTML='<tr><td colspan="8" style="text-align:center;color:var(--dim)"><span class="spin"></span> running…</td></tr>';
|
| 276 |
+
var b=await getJSON('/api/a11oy/v1/restraint/bench?intensity='+INTENSITY);
|
| 277 |
+
if(!b){tb.innerHTML='<tr><td colspan="8">endpoint unavailable</td></tr>';return;}
|
| 278 |
+
$('#bench-label').innerHTML='GET /api/a11oy/v1/restraint/bench '+pill(b.overall_label||'ROADMAP');
|
| 279 |
+
tb.innerHTML='';
|
| 280 |
+
(b.rows||[]).forEach(function(r){
|
| 281 |
+
var tr=el('tr');
|
| 282 |
+
tr.innerHTML='<td title="'+esc(r.task)+'">'+esc(r.task.slice(0,42))+(r.task.length>42?'…':'')+'</td>'+
|
| 283 |
+
'<td>'+r.stopped_at_rung+'</td>'+
|
| 284 |
+
'<td>'+r.baseline.loc+'</td><td class="hi">'+r.a11oy_restraint.loc+'</td>'+
|
| 285 |
+
'<td class="hi">'+r.loc_reduction_pct+'%</td>'+
|
| 286 |
+
'<td>'+r.cost_proxy_reduction_pct+'%</td>'+
|
| 287 |
+
'<td>'+r.latency_reduction_pct+'%</td>'+
|
| 288 |
+
'<td>'+pill(r.label)+'</td>';
|
| 289 |
+
tb.appendChild(tr);
|
| 290 |
+
});
|
| 291 |
+
var a=b.aggregate||{};var pp=b.ponytail_published||{};
|
| 292 |
+
$('#bench-agg').innerHTML=
|
| 293 |
+
'<div><span class="k">median LOC reduction</span><span class="v">'+a.median_loc_reduction_pct+'% '+pill(b.overall_label)+'</span></div>'+
|
| 294 |
+
'<div><span class="k">median cost-proxy reduction</span><span class="v">'+a.median_cost_proxy_reduction_pct+'%</span></div>'+
|
| 295 |
+
'<div><span class="k">median latency reduction</span><span class="v">'+a.median_latency_reduction_pct+'%</span></div>'+
|
| 296 |
+
'<div><span class="k">Ponytail (cited, not ours)</span><span class="v">'+esc(pp.code_reduction||'')+' · '+esc(pp.cost_reduction||'')+' · '+esc(pp.speed||'')+' '+pill('CITED')+'</span></div>'+
|
| 297 |
+
'<div style="color:var(--dim);font-size:11px;margin-top:.4rem">'+esc(b.honesty||'')+'</div>';
|
| 298 |
+
}
|
| 299 |
+
|
| 300 |
+
$('#run').onclick=run;
|
| 301 |
+
$('#runbench').onclick=runbench;
|
| 302 |
+
// info → signer label
|
| 303 |
+
(async function(){var i=await getJSON('/api/a11oy/v1/restraint/info');if(i&&i.doctrine){$('#b-doctrine').textContent='Doctrine '+i.doctrine.version;$('#c-signer').textContent='in-image ECDSA-P256';}})();
|
| 304 |
+
run();
|
| 305 |
+
</script>
|
| 306 |
+
</body>
|
| 307 |
+
</html>
|