From b7905a1ea64dda421836d9e0e8dac37514f5f94f Mon Sep 17 00:00:00 2001
From: DavidG
Date: Wed, 18 Nov 2026 12:07:37 +0100
Subject: [PATCH 1/2] docs: redraw the demo with the approval answered in lox
run (#77)
The demo's terminals now show a capture of the scenario run through the
code (scripts/brand/demo-capture/): curl through the gate with lea's
sources.json, the frames lox run draws for the gate's ticket, and the
gate's audit records. The request carries an email only: a GitHub token
in the body is now refused by the gate itself (E_SECRET_EGRESS), without
a question. The README caption saying the demo predates the hub is gone.
Co-Authored-By: Claude Fable 5.2
---
README.md | 3 +-
docs/install.md | 4 +-
scripts/brand/demo-capture/gate.txt | 14 +
scripts/brand/demo-capture/lox-run-denied.ans | 26 ++
.../brand/demo-capture/lox-run-details.ans | 26 ++
scripts/brand/demo-capture/lox-run-idle.ans | 26 ++
.../brand/demo-capture/lox-run-question.ans | 26 ++
scripts/brand/demo.py | 366 +++++++++++-------
site/assets/demo.svg | 271 ++++++-------
site/index.html | 4 +-
10 files changed, 468 insertions(+), 298 deletions(-)
create mode 100644 scripts/brand/demo-capture/gate.txt
create mode 100644 scripts/brand/demo-capture/lox-run-denied.ans
create mode 100644 scripts/brand/demo-capture/lox-run-details.ans
create mode 100644 scripts/brand/demo-capture/lox-run-idle.ans
create mode 100644 scripts/brand/demo-capture/lox-run-question.ans
diff --git a/README.md b/README.md
index ebc1e8f..d4cc2e2 100644
--- a/README.md
+++ b/README.md
@@ -16,9 +16,8 @@
anything that sends data or reaches an unknown host waits for you.
-
+
-
An agent (here Claude Code, left, in a lea container) and the approval screen (right). Drawn in the console's frame from before the hub: today you answer in lox run.
Quick start ·
diff --git a/docs/install.md b/docs/install.md
index 9682467..651c596 100644
--- a/docs/install.md
+++ b/docs/install.md
@@ -54,7 +54,9 @@ no host install. Coming from v0.1.0's
install](docker.md#migrating-from-a-host-install).
The README's demo is generated by [`scripts/brand/demo.py`](../scripts/brand/demo.py):
-`python3 scripts/brand/demo.py > site/assets/demo.svg`.
+`python3 scripts/brand/demo.py > site/assets/demo.svg`. Its terminals show
+the capture in `scripts/brand/demo-capture/` (curl through the gate, the
+frames of `lox run`, the gate's audit records), not text written by hand.
Accounts, volumes, the exact `docker run` of each command, and what Docker
does and does not separate: [docs/docker.md](docker.md). Every command
diff --git a/scripts/brand/demo-capture/gate.txt b/scripts/brand/demo-capture/gate.txt
new file mode 100644
index 0000000..f06b982
--- /dev/null
+++ b/scripts/brand/demo-capture/gate.txt
@@ -0,0 +1,14 @@
+$ curl -sS -o /dev/null -w %{http_code}
+ https://pkg.go.dev/net/http
+200
+[exit: ]
+$ curl -sS -X POST https://hooks.example.net/build -H content-type: application/json -d @report.json
+LockHTTP refused this request (E_DENIED): denied on the hub
+Do not retry the same request; ask the user.
+request id: h-mwm0lqu6-2e4461e938feb20c
+[exit: ]
+== AUDIT
+{"ts":"2026-11-18T11:05:15.286Z","event":"free","profile":"default","decision":"free","request_id":"h-mwm0lqtu-378af86922e0fd52","container":"lea-ab12cd34ef","project":"shop","via":"direct","agent":"dev-3","attribution":"proxy-auth","role":"dev","parent":"lead-1","task_id":"t-42","branch":"feat/ci-report","phase":"http","tls":"mitm","method":"GET","host":"pkg.go.dev","port":443,"path":"/net/http","req_headers":["accept","user-agent"],"rule":"trusted","class":"read","status":200,"resp_bytes":184,"duration_ms":3,"policy_fp":"sha256:ffe9c710b3ecc681e9f1f83e4a6b2a5ded6b1c439326de2c7c038bbd8de8f52c"}
+{"ts":"2026-11-18T11:05:15.659Z","event":"denied","profile":"default","decision":"denied","warnings":["unknown host hooks.example.net"],"reason":"denied on the hub","approval":"hub","ticket":"01M7Q5A4SCE9TCWVDV7E8J21DR","approver":{"id":"host:uid:1000","display":"alice"},"facade":"tty","hub_sig":"SwML2A50LYO6C4HXx1w33lGhpeeF6vrV4ftV7E7G46-BoCgTNwfTZ4As7TXKHcv90CbXWrW-oapekiFWniP-Bw","request_id":"h-mwm0lqu6-2e4461e938feb20c","container":"lea-ab12cd34ef","project":"shop","via":"direct","agent":"dev-3","attribution":"proxy-auth","role":"dev","parent":"lead-1","task_id":"t-42","branch":"feat/ci-report","phase":"http","tls":"mitm","method":"POST","host":"hooks.example.net","port":443,"path":"/build","req_headers":["accept","content-length","content-type","user-agent"],"req_bytes":49,"body_fp":"json:a20a0c27eefde4875a3a193fa2802e3e8de1e09d24334ce7633b23fc8c09b2fd","rule":"default:write","class":"write","policy_fp":"sha256:ffe9c710b3ecc681e9f1f83e4a6b2a5ded6b1c439326de2c7c038bbd8de8f52c"}
+{"ts":"2026-11-18T11:05:15.659Z","event":"refused","profile":"default","decision":"refused","code":"E_DENIED","warnings":["unknown host hooks.example.net"],"reason":"denied on the hub","request_id":"h-mwm0lqu6-2e4461e938feb20c","container":"lea-ab12cd34ef","project":"shop","via":"direct","agent":"dev-3","attribution":"proxy-auth","role":"dev","parent":"lead-1","task_id":"t-42","branch":"feat/ci-report","phase":"http","tls":"mitm","method":"POST","host":"hooks.example.net","port":443,"path":"/build","req_headers":["accept","content-length","content-type","user-agent"],"req_bytes":49,"body_fp":"json:a20a0c27eefde4875a3a193fa2802e3e8de1e09d24334ce7633b23fc8c09b2fd","rule":"default:write","class":"write","policy_fp":"sha256:ffe9c710b3ecc681e9f1f83e4a6b2a5ded6b1c439326de2c7c038bbd8de8f52c"}
+
diff --git a/scripts/brand/demo-capture/lox-run-denied.ans b/scripts/brand/demo-capture/lox-run-denied.ans
new file mode 100644
index 0000000..f739424
--- /dev/null
+++ b/scripts/brand/demo-capture/lox-run-denied.ans
@@ -0,0 +1,26 @@
+[1m lox run [0m[1;30;42m AUTO [0m[2m ~/Documents/shop[0m [32m● hub up[0m[2m · 1 lock[0m
+[2m connected [0m[2mnone yet: a lock connects on its agent's first request[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ [2m12:05:16[0m [36mdev-3[0m [2m⇄ [0mweb [2m-[0m [1;33mwrite[0m [1;36mfrom[0m container lea… [31m✘ denied[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+ [1mShift+Tab[0m[2m mode[0m [1ma[0m[2m audit[0m [1m?[0m[2m help[0m [1mq[0m[2m quit[0m
\ No newline at end of file
diff --git a/scripts/brand/demo-capture/lox-run-details.ans b/scripts/brand/demo-capture/lox-run-details.ans
new file mode 100644
index 0000000..999bce4
--- /dev/null
+++ b/scripts/brand/demo-capture/lox-run-details.ans
@@ -0,0 +1,26 @@
+[1m lox run [0m[1;30;42m AUTO [0m[2m ~/Documents/shop[0m [32m● hub up[0m[2m · 1 lock[0m[2m · [0m[1;33m1 waiting[0m
+[2m connected [0m[2mnone yet: a lock connects on its agent's first request[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+[1;33m ┌[0m[1;33m ◆ QUESTION [0m[1;33;1mwrite[0m[1m on web [0m[1;33m───────────────────────────────────────────────────[0m[1;33m┐[0m
+[1;33m │ [0m[36;1mdev-3[0m[2m asks (unverified name)[0m[2m · ⇄ lockhttp[0m[2m · expires in 23h59m[0m [1;33m│[0m
+[1;33m │ [0m[1;33mPOST[0m[1m hooks.example.net · lea-ab12cd34ef[0m [1;33m│[0m
+[1;33m │ [0m [1;36mfrom[0m container lea-ab12cd34ef (project shop) · agent dev-3 (declared, pr…[1;33m│[0m
+[1;33m │ [0m [1;33mPOST[0m mitm://hooks.example.net/build [1;33m│[0m
+[1;33m │ [0m body 49 bytes application/json json:a20a0c27eefde4… [1;33m│[0m
+[1;33m │ [0m headers: accept content-length content-type user-agent [1;33m│[0m
+[1;33m │ [0m task t-42 · role dev · parent lead-1 · branch feat/ci-report [1;33m│[0m
+[1;33m │ [0m decided by: default:write [1;33m│[0m
+[1;33m │ [0m [1;33m│[0m
+[1;33m │ [0m preview (masked): [1;33m│[0m
+[1;33m │ [0m {"build":"ok","author":"[2;3m‹j***(23)›[0m"} [1;33m│[0m
+[1;33m │ [0m [1;33m│[0m
+[1;33m │ [0m client gone: y lets the same request through once in the next 10 minutes [1;33m│[0m
+[1;33m │ [0m request h-mwm0lqu6-2e4461e938feb20c [1;33m│[0m
+[1;33m │ [0m[31m! unknown host hooks.example.net[0m [1;33m│[0m
+[1;33m │ [0m[2mwhy asked: this lock's ticket does not name its kind (version 1): asked[0m [1;33m│[0m
+[1;33m │ [0m[32;1my[0m[2m approve [0m[31;1mn[0m[2m deny [0m[1md[0m[2m less[0m[1m x[0m[2m forget profile[0m [1;33m│[0m
+[1;33m └────────────────────────────────────────────────────────────────────────────┘[0m
+
+ [2m12:05:16[0m [36mdev-3[0m [2m⇄ [0mweb [2m-[0m [1;33mwrite[0m [1;36mfrom[0m container lea… [1;33m◆ ask:v1[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+ [1mShift+Tab[0m[2m mode[0m [1my/n[0m[2m answer[0m [1md[0m[2m details[0m [1ma[0m[2m audit[0m [1m?[0m[2m help[0m [1mq[0m[2m quit[0m
\ No newline at end of file
diff --git a/scripts/brand/demo-capture/lox-run-idle.ans b/scripts/brand/demo-capture/lox-run-idle.ans
new file mode 100644
index 0000000..cfaf0cc
--- /dev/null
+++ b/scripts/brand/demo-capture/lox-run-idle.ans
@@ -0,0 +1,26 @@
+[1m lox run [0m[1;30;42m AUTO [0m[2m ~/Documents/shop[0m [32m● hub up[0m[2m · 1 lock[0m
+[2m connected [0m[2mnone yet: a lock connects on its agent's first request[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+[2m no ticket yet: every ticket and decision of the hub shows here, masked by its[0m[2m…[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+ [1mShift+Tab[0m[2m mode[0m [1ma[0m[2m audit[0m [1m?[0m[2m help[0m [1mq[0m[2m quit[0m
\ No newline at end of file
diff --git a/scripts/brand/demo-capture/lox-run-question.ans b/scripts/brand/demo-capture/lox-run-question.ans
new file mode 100644
index 0000000..6e09cc7
--- /dev/null
+++ b/scripts/brand/demo-capture/lox-run-question.ans
@@ -0,0 +1,26 @@
+[1m lox run [0m[1;30;42m AUTO [0m[2m ~/Documents/shop[0m [32m● hub up[0m[2m · 1 lock[0m[2m · [0m[1;33m1 waiting[0m
+[2m connected [0m[2mnone yet: a lock connects on its agent's first request[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+[1;33m ┌[0m[1;33m ◆ QUESTION [0m[1;33;1mwrite[0m[1m on web [0m[1;33m───────────────────────────────────────────────────[0m[1;33m┐[0m
+[1;33m │ [0m[36;1mdev-3[0m[2m asks (unverified name)[0m[2m · ⇄ lockhttp[0m[2m · expires in 23h59m[0m [1;33m│[0m
+[1;33m │ [0m[1;33mPOST[0m[1m hooks.example.net · lea-ab12cd34ef[0m [1;33m│[0m
+[1;33m │ [0m [1;36mfrom[0m container lea-ab12cd34ef (project shop) · agent dev-3 (declared, pr…[1;33m│[0m
+[1;33m │ [0m [1;33mPOST[0m mitm://hooks.example.net/build [1;33m│[0m
+[1;33m │ [0m body 49 bytes application/json json:a20a0c27eefde4… [1;33m│[0m
+[1;33m │ [0m headers: accept content-length content-type user-agent [1;33m│[0m
+[1;33m │ [0m[2m … 8 more lines: d for details[0m [1;33m│[0m
+[1;33m │ [0m[31m! unknown host hooks.example.net[0m [1;33m│[0m
+[1;33m │ [0m[2mwhy asked: this lock's ticket does not name its kind (version 1): asked[0m [1;33m│[0m
+[1;33m │ [0m[32;1my[0m[2m approve [0m[31;1mn[0m[2m deny [0m[1md[0m[2m details[0m[1m x[0m[2m forget profile[0m [1;33m│[0m
+[1;33m └────────────────────────────────────────────────────────────────────────────┘[0m
+
+
+
+
+
+
+
+
+ [2m12:05:16[0m [36mdev-3[0m [2m⇄ [0mweb [2m-[0m [1;33mwrite[0m [1;36mfrom[0m container lea… [1;33m◆ ask:v1[0m
+[2m────────────────────────────────────────────────────────────────────────────────[0m
+ [1mShift+Tab[0m[2m mode[0m [1my/n[0m[2m answer[0m [1md[0m[2m details[0m [1ma[0m[2m audit[0m [1m?[0m[2m help[0m [1mq[0m[2m quit[0m
\ No newline at end of file
diff --git a/scripts/brand/demo.py b/scripts/brand/demo.py
index 95a248a..0e33863 100644
--- a/scripts/brand/demo.py
+++ b/scripts/brand/demo.py
@@ -1,24 +1,38 @@
#!/usr/bin/env python3
"""Generate site/assets/demo.svg: lockhttp's value in one looping image.
-Claude Code (left, in a lea container) reads a page of a trusted docs host: the gate lets the GET
-through at once. It then POSTs a build report to an unknown host: the gate holds the request and
-the lockhttp console (right, its own account) shows the approval screen, with the body preview
-masked. The human answers "n token in body"; the agent gets a 403 E_DENIED, and the gate's audit
-keeps both decisions. Pure SVG + CSS keyframes, so it plays on GitHub, on the site and in any
-browser. Every animation shares one clock of LOOP seconds.
+An agent (left, Claude Code in a lea container) reads a page of a trusted host: the gate lets the
+GET through at once. It then POSTs a build report to an unknown host: the gate holds the request
+and asks lockhub, and the question shows in `lox run` (right, the human's own terminal, outside
+lea). The human presses d to read the whole masked screen, then n; the agent gets a 403 E_DENIED,
+and the gate's audit keeps both decisions. Pure SVG + CSS keyframes, so it plays on GitHub, on
+the site and in any browser. Every animation shares one clock of LOOP seconds.
-The console, refusal and audit lines follow the real output of lockhttp and lockkit (approval
-frame, screen body from internal/httpconsole, Preview masking, writeRefusal, wire.Record); keep
-them in step when those change. The audit lines are abridged where they show "…".
+No output on screen is written here: it is read from scripts/brand/demo-capture/, a capture of
+the scenario run through the code itself.
+
+ gate.txt the two curl commands run through the gate (internal/gate) with lea's
+ sources.json, their output as curl printed it, and the gate's audit records
+ lox-run-*.ans the frames lockhub's `lox run` (internal/loxrun) drew for the gate's ticket,
+ with their colours: idle, the question, the question after d, after n
+
+What is typed here is the scenario's input (the prompt, the two commands), Claude Code's frame
+around a command and its output, the pane titles, the badges and the captions. The audit lines
+are the captured records with fields left out where they show "…".
python3 scripts/brand/demo.py > site/assets/demo.svg
"""
-LOOP = 14.5
+import json
+import pathlib
+import re
+
+CAPTURE = pathlib.Path(__file__).parent / "demo-capture"
+
+LOOP = 16.0
C = dict(bg="#0b1120", pane="#020617", bar="#0f172a", border="#253047", text="#e2e8f0",
dim="#64748b", sub="#94a3b8", green="#4ade80", teal="#5eead4", violet="#a78bfa",
- red="#f87171", yellow="#facc15", accent="#22c55e")
+ red="#f87171", yellow="#facc15", cyan="#22d3ee", accent="#22c55e")
FONT = "'JetBrains Mono','SF Mono',Menlo,Consolas,'DejaVu Sans Mono',monospace"
SANS = "Inter,-apple-system,'Segoe UI',system-ui,Helvetica,Arial,'DejaVu Sans',sans-serif"
@@ -95,95 +109,179 @@ def badge(xc, y, label, col, cls):
family=FONT, anchor="middle") + "")
-W, H = 1200, 600
+# --- The capture --------------------------------------------------------------------------
+
+def read_gate():
+ """gate.txt: the output of each curl, and the audit records."""
+ raw = (CAPTURE / "gate.txt").read_text()
+ runs, audit = raw.split("== AUDIT\n")
+ outs = []
+ for block in runs.split("$ curl ")[1:]:
+ out = block[:block.index("[exit: ")]
+ # The command's own echo ends at its URL or its last argument.
+ marker = "https://pkg.go.dev/net/http\n" if "pkg.go.dev" in out else "-d @report.json\n"
+ outs.append(out[out.index(marker) + len(marker):].rstrip("\n").split("\n"))
+ return outs, [json.loads(l) for l in audit.splitlines() if l.strip()]
+
+
+SGR = re.compile(r"\x1b\[([0-9;]*)m")
+FG = {"30": C["pane"], "31": C["red"], "32": C["green"], "33": C["yellow"], "36": C["cyan"]}
+BG = {"42": C["green"]}
+
+
+def read_frame(name):
+ """A frame of lox run as rows of runs (col, text, colour, bold, italic, background)."""
+ rows = []
+ for raw in (CAPTURE / f"lox-run-{name}.ans").read_text().split("\n"):
+ runs, col, pos = [], 0, 0
+ fg, bold, italic, bg, dim = C["text"], False, False, None, False
+
+ def emit(s):
+ nonlocal col
+ if s:
+ colour = fg if not dim or fg != C["text"] else C["sub"]
+ runs.append((col, s, colour, bold, italic, bg))
+ col += len(s)
+
+ for m in SGR.finditer(raw):
+ emit(raw[pos:m.start()])
+ pos = m.end()
+ for code in (m.group(1) or "0").split(";"):
+ if code in ("0", ""):
+ fg, bold, italic, bg, dim = C["text"], False, False, None, False
+ elif code == "1":
+ bold = True
+ elif code == "2":
+ dim = True
+ elif code == "3":
+ italic = True
+ elif code in FG:
+ fg = FG[code]
+ elif code in BG:
+ bg = BG[code]
+ else:
+ raise SystemExit(f"demo.py: SGR {code} of lox-run-{name}.ans has no colour here")
+ emit(raw[pos:])
+ rows.append(runs)
+ return rows
+
+
+def draw_frame(rows, x, y, lh, size, cls):
+ """Each run is placed at its own column and stretched to its width, so a glyph taken from
+ a fallback font never shifts what follows it."""
+ chw = size * 0.602
+ out = [f'']
+ for r, runs in enumerate(rows):
+ yy = y + r * lh
+ for col, s, colour, bold, italic, bg in runs:
+ if bg:
+ out.append(f'')
+ lead = len(s) - len(s.lstrip(" "))
+ t = s.strip(" ")
+ if not t:
+ continue
+ attrs = f' font-weight="700"' if bold else ""
+ attrs += ' font-style="italic"' if italic else ""
+ out.append(f'{esc(t)}')
+ out.append("")
+ return "".join(out)
+
+
+curl_out, audit = read_gate()
+get_out, post_out = curl_out
+free_rec = next(r for r in audit if r["event"] == "free")
+denied_rec = next(r for r in audit if r["event"] == "denied")
+container, agent_name = free_rec["container"], free_rec["agent"]
+
+W, H = 1200, 680
body.append(f'')
LH = 18
D, S, T, G, R, Y, V = C["dim"], C["sub"], C["text"], C["green"], C["red"], C["yellow"], C["violet"]
+# Timeline (seconds).
+T_GET, T_GET_OUT = 1.0, 1.9
+T_POST, T_ASK = 3.2, 4.0
+T_DETAILS, T_DENY, T_REPLY = 6.0, 9.4, 10.2
+
# --- Agent pane (left) --------------------------------------------------------------------
-AX, AY, AW, AH = 24, 24, 468, 388
-pane(AX, AY, AW, AH, "✻ Claude Code", "container lea-ab12cd34ef")
+AX, AY, AW, AH = 24, 24, 476, 468
+pane(AX, AY, AW, AH, "✻ Claude Code", f"container {container}")
ax, ay = AX + 16, AY + 54
agent = [
- (0.3, [("> ", D), ("read the net/http Client docs, then post the", T)]),
+ (0.3, [("> ", D), ("check that the net/http docs are up, then post the", T)]),
(0.3, [(" ", D), ("build report to our webhook", T)]),
- (1.0, [("● ", G), ("Fetch", T), ("(https://pkg.go.dev/net/http)", S)]),
- (1.9, [(" └ ", D), ("Received 41.2KB (200 OK)", S)]),
- (2.6, [("● ", T), ("Client.Timeout bounds the whole exchange.", T)]),
- (2.6, [(" ", T), ("Posting the report now.", T)]),
- (3.4, [("● ", G), ("Bash", T), ("(curl -sS -X POST https://hooks.example.net/build", S)]),
- (3.4, [(" ", T), ("-H 'content-type: application/json' -d @report.json)", S)]),
+ (None, []),
+ (T_GET, [("● ", G), ("Bash", T), ("(curl -sS -o /dev/null -w '%{http_code}\\n'", S)]),
+ (T_GET, [(" ", T), ("https://pkg.go.dev/net/http)", S)]),
]
+agent += [(T_GET_OUT, [(" └ " if i == 0 else " ", D), (l, T)]) for i, l in enumerate(get_out)]
+agent += [
+ (None, []),
+ (T_POST, [("● ", G), ("Bash", T), ("(curl -sS -X POST https://hooks.example.net/build", S)]),
+ (T_POST, [(" ", T), ("-H 'content-type: application/json' -d @report.json)", S)]),
+]
+get_row = 3
+post_row = len(agent) - 2
for i, (t, parts) in enumerate(agent):
- body.append(spans(ax, ay + i * LH, parts, cls=show(t)))
+ if parts:
+ body.append(spans(ax, ay + i * LH, parts, cls=show(t)))
row = len(agent)
-body.append(spans(ax, ay + row * LH, [(" └ ", D), ("Running…", Y)], cls=show(3.7, 7.6)))
-reply = [
- (7.8, [(" └ ", D), ("LockHTTP refused this request (E_DENIED): denied by", T)]),
- (7.8, [(" ", D), ("the human: token in body; do not retry unless asked", T)]),
- (7.8, [(" ", D), ("Do not retry the same request; ask the user.", T)]),
- (7.8, [(" ", D), ("request id: h-mh9q2m7c-91fd04b2a8e6c357", D)]),
- (8.8, [("● ", T), ("You refused the post: report.json carries a", T)]),
- (8.8, [(" ", T), ("token. I won't retry. Send it without the token?", T)]),
-]
-for i, (t, parts) in enumerate(reply):
- body.append(spans(ax, ay + (row + i) * LH, parts, cls=show(t)))
-
-# --- Console pane (right) -----------------------------------------------------------------
-CX, CY, CW, CH = 572, 24, 604, 388
-pane(CX, CY, CW, CH, "lockhttp console", "account lockhttp · its own session")
-cx, cy = CX + 16, CY + 54
-CS = 11.5 # one character is 0.602 em wide
+body.append(spans(ax, ay + row * LH, [(" └ ", D), ("Running…", Y)], cls=show(T_POST + 0.3, T_REPLY - 0.2)))
+
+
+def wrap(s, width):
+ """Wrap on spaces, as the agent's terminal does."""
+ out, cur = [], ""
+ for word in s.split(" "):
+ if cur and len(cur) + 1 + len(word) > width:
+ out.append(cur)
+ cur = word
+ else:
+ cur = f"{cur} {word}" if cur else word
+ return out + [cur]
+
+
+reply = []
+for l in post_out:
+ reply += wrap(l, 60)
+for i, l in enumerate(reply):
+ colour = D if l.startswith("request id:") else T
+ body.append(spans(ax, ay + (row + i) * LH, [(" └ " if i == 0 else " ", D), (l, colour)],
+ cls=show(T_REPLY)))
+
+# --- lox run pane (right) -----------------------------------------------------------------
+CX, CY, CW, CH = 580, 24, 596, 468
+pane(CX, CY, CW, CH, "lox run", "your terminal · outside lea")
+CS, CLH = 11.5, 16
CHW = CS * 0.602
-con = [
- [("$ ", D), ("lockhttp console", T)],
- [("✓ ", G), ("profile ", T), ("default", T), (" · lockhttp gate ", T), ("(approved policy)", D)],
- [("› ", C["accent"]), ("Listening on /run/lockhttp/user-default.sock", T)],
-]
-for i, parts in enumerate(con):
- body.append(spans(cx, cy + i * LH, parts, size=CS))
-screen = [
- [("╭─ ", V), ("DEFAULT", V), (" · POST hooks.example.net · lea-ab12cd34ef ", T), ("─────", V)],
- [("│ ", V), ("requested by container lea-ab12cd34ef · agent dev-3 (declared, proxy-auth)", D)],
- [("│", V)],
- [("│ ", V), ("POST mitm://hooks.example.net/build", T)],
- [("│ ", V), ("body 97 bytes application/json json:31578a783c831b…", T)],
- [("│ ", V), ("task t-42 · role dev · parent lead-1 · branch feat/ci-report", T)],
- [("│ ", V), ("decided by: default:write", T)],
- [("│", V)],
- [("│ ", V), ("preview (masked):", T)],
- [("│ ", V), (' {"build":"ok","author":', T), ('"j***(20)"', C["teal"]), (',"token":', T),
- ('""', C["teal"]), ("}", T)],
- [("│ ", V), ("request h-mh9q2m7c-91fd04b2a8e6c357", T)],
- [("│ ", V), ("▲ unknown host hooks.example.net", R)],
-]
-srow = len(con) + 1
-g = [f'']
-for i, parts in enumerate(screen):
- g.append(spans(cx, cy + (srow + i) * LH, parts, size=CS))
-g.append("")
-body.append("".join(g))
-prow = srow + len(screen)
-py = cy + prow * LH
-body.append(spans(cx, py, [("╰─ ", V), ("Approve? [y/N] ", T)], cls=show(4.4), size=CS))
-# The human types "n token in body", one key at a time.
-answer = "n token in body"
-for i, ch in enumerate(answer):
- if ch != " ":
- body.append(text(cx + CHW * (18 + i), py, ch, cls=show(6.0 + i * 0.06, fade=0.03), size=CS,
- col=R if i == 0 else T, weight=700 if i == 0 else 400))
-# Cursor, blinking before the answer, then following it.
-blink = anim([(0, "opacity:0"), (4.5, "opacity:0"), (4.51, "opacity:1"), (5.0, "opacity:1"),
- (5.01, "opacity:0"), (5.4, "opacity:0"), (5.41, "opacity:1"), (5.99, "opacity:1"),
- (6.0, "opacity:0"), (LOOP, "opacity:0")])
-body.append(f'')
-body.append(spans(cx, py + LH, [("✗ ", R), ("denied: token in body", T)], cls=show(7.0), size=CS))
-# Key hint, lit while the console waits.
-body.append(f''
- + text(CX + CW - 106, py, "only you can answer", size=12, col=C["pane"],
- weight=700, family=SANS, anchor="middle") + "")
+cx, cy = CX + 20, CY + 52
+frames = [("idle", 0.0, T_ASK), ("question", T_ASK, T_DETAILS), ("details", T_DETAILS, T_DENY),
+ ("denied", T_DENY, END)]
+for name, t0, t1 in frames:
+ rows = read_frame(name)
+ if name == "idle":
+ cls = anim([(0, "opacity:1"), (t1, "opacity:1"), (t1 + 0.1, "opacity:0"), (END + 0.5, "opacity:0"),
+ (LOOP, "opacity:1")])
+ else:
+ cls = show(t0, END if name == "denied" else t1, fade=0.1)
+ body.append(draw_frame(rows, cx, cy, CLH, CS, cls))
+
+
+def key_hint(t0, t1, label):
+ """The key the human presses: lox run does not echo it."""
+ w = 196
+ xc = CX + CW / 2 - 10
+ body.append(f''
+ + text(xc, CY + 19.5, label, size=12, col=C["pane"],
+ weight=700, family=SANS, anchor="middle") + "")
+
+
+key_hint(T_ASK + 0.9, T_DETAILS, "you press d: the whole screen")
+key_hint(T_DETAILS + 2.2, T_DENY, "you press n: deny")
# --- The gate, between the two ------------------------------------------------------------
GX, GW = AX + AW + 12, CX - AX - AW - 24
@@ -191,73 +289,75 @@ def badge(xc, y, label, col, cls):
body.append(f'')
body.append(text(GC, AY + 26, "gate", size=12, col=C["accent"], weight=700, family=SANS, anchor="middle"))
-body.append(text(GC, AY + AH - 2, ":3130", size=11, col=S, family=FONT, anchor="middle"))
-fy = ay + 2 * LH - 4 # the Fetch line
-by = ay + 6 * LH - 4 # the curl line
-sy = cy + (srow + 3) * LH - 4 # the screen's request line
+fy = ay + get_row * LH - 4 # the GET's line
+by = ay + post_row * LH - 4 # the POST's line
+sy = cy + 4 * CLH - 4 # the question card's first row
pkt = 'r="6" cx="0" cy="0"'
-body.append(f'')
-body.append(f'')
-badge(GC, fy - 18, "FREE", G, show(1.35, 3.2, fade=0.1))
-body.append(f'')
-body.append(f'')
-badge(GC, by - 18, "ASK", Y, show(3.75, 7.2, fade=0.1))
-body.append(f'')
-body.append(f'')
-badge(GC, by + 22, "403", R, show(7.3, END, fade=0.1))
+body.append(f'')
+body.append(f'')
+badge(GC, fy - 18, "FREE", G, show(T_GET + 0.35, T_POST, fade=0.1))
+body.append(f'')
+body.append(f'')
+badge(GC, by - 18, "ASK", Y, show(T_POST + 0.55, T_DENY + 0.3, fade=0.1))
+body.append(f'')
+body.append(f'')
+badge(GC, by + 22, "403", R, show(T_DENY + 0.4, END, fade=0.1))
# --- The gate's audit (bottom) ------------------------------------------------------------
-BX, BY, BW, BH = 24, 426, W - 48, 84
+BX, BY, BW, BH = 24, 506, W - 48, 84
body.append(f'')
body.append(text(BX + 16, BY + 24, "gate audit", size=12, col=C["accent"], weight=700, family=SANS))
-body.append(text(BX + 92, BY + 24, "gate-2026-10-28.jsonl · one line per decision, traced to container and agent",
+body.append(text(BX + 92, BY + 24, f"gate-{free_rec['ts'][:10]}.jsonl · one line per decision, traced to container and agent",
size=12, col=D, family=SANS))
-def jline(pairs):
- """A JSONL record as coloured runs: pairs of (key, value) or "…" for an elided run."""
- out = [("{", D)]
- for i, kv in enumerate(pairs):
- if i:
+def jline(rec, keys, colours):
+ """A captured record as coloured runs, with "…" wherever fields are left out."""
+ out, prev = [("{", D)], -1
+ order = list(rec)
+ for k in keys:
+ i = order.index(k)
+ if prev >= 0:
out.append((",", D))
- if kv == "…":
- out.append(("…", D))
- continue
- k, v, col = kv
- out += [(f'"{k}":', D), (v, col)]
+ if i != prev + 1:
+ out.append(("…,", D) if prev >= 0 else ("…", D))
+ if prev < 0:
+ out.append((",", D))
+ out += [(f'"{k}":', D), (json.dumps(rec[k], ensure_ascii=False, separators=(",", ":")), colours.get(k, T))]
+ prev = i
+ if prev != len(order) - 1:
+ out.append((",…", D))
out.append(("}", D))
return out
-free = jline([("event", '"free"', G), ("decision", '"free"', G), "…", ("container", '"lea-ab12cd34ef"', T),
- ("agent", '"dev-3"', T), "…", ("method", '"GET"', T), ("host", '"pkg.go.dev"', T),
- ("path", '"/net/http"', T), ("rule", '"trusted"', S), "…", ("status", "200", T)])
-refused = jline([("event", '"refused"', R), "…", ("code", '"E_DENIED"', R), "…",
- ("reason", '"denied by the human: token in body; …"', Y), "…",
- ("container", '"lea-ab12cd34ef"', T), ("agent", '"dev-3"', T), "…", ("method", '"POST"', T),
- ("host", '"hooks.example.net"', T), "…"])
-body.append(spans(BX + 16, BY + 48, free, cls=show(2.0), size=10))
-body.append(spans(BX + 16, BY + 68, refused, cls=show(7.8), size=10))
+free = jline(free_rec, ["event", "container", "agent", "method", "host", "path", "rule", "status"],
+ {"event": G, "rule": S})
+denied = jline(denied_rec, ["event", "reason", "approval", "facade", "container", "agent", "method", "host"],
+ {"event": R, "reason": Y})
+body.append(spans(BX + 16, BY + 48, free, cls=show(T_GET_OUT + 0.1), size=10))
+body.append(spans(BX + 16, BY + 68, denied, cls=show(T_DENY + 0.4), size=10))
# Captions.
-caps = [(0.0, 3.3, "Reads of hosts you trust pass at once."),
- (3.3, 7.4, "A write to an unknown host waits for you, in a console the agent can't reach."),
- (7.4, END, "You say no: the agent gets a 403, and the audit keeps both.")]
+caps = [(0.0, T_POST, "Reads of hosts you trust pass at once."),
+ (T_POST, T_DENY, "A write to an unknown host waits for you in lox run, which the agent can't reach."),
+ (T_DENY, END, "You say no: the agent gets a 403, and the audit keeps both.")]
for t0, t1, s in caps:
- body.append(text(W / 2, 562, s, cls=show(t0 + 0.05, t1 - 0.2), size=24, weight=650,
+ body.append(text(W / 2, 642, s, cls=show(t0 + 0.05, t1 - 0.2), size=24, weight=650,
family=SANS, anchor="middle"))
-label = ("lockhttp: Claude Code, in a lea container, reads a page of pkg.go.dev, a trusted host, and "
- "the gate lets it through at once. It then POSTs a build report to hooks.example.net, an "
- "unknown host: the gate holds it, and the lockhttp console, in its own account, shows the "
- "approval screen with the body masked. The human answers n token in body; the agent gets a "
- "403 E_DENIED, and the gate's audit records both decisions.")
+label = ("lockhttp: an agent (Claude Code, in a lea container) fetches a page of pkg.go.dev, a trusted "
+ "host, and the gate lets the GET through at once. It then POSTs a build report to "
+ "hooks.example.net, an unknown host: the gate holds it, and a question shows in lox run, in "
+ "the human's own terminal. The human presses d to read the whole masked screen (the author's "
+ "email shows as j***(23)), then n; the agent gets a 403 E_DENIED, denied on the hub, and the "
+ "gate's audit records both decisions.")
print(f'")
diff --git a/site/assets/demo.svg b/site/assets/demo.svg
index 5b82bf0..6f1e7e1 100644
--- a/site/assets/demo.svg
+++ b/site/assets/demo.svg
@@ -1,166 +1,117 @@
-