@zabaca/zbc 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/package.json +2 -1
  3. package/templates/apps/inbox/package.json +1 -1
  4. package/templates/apps/walgit/CONTEXT.md +135 -0
  5. package/templates/apps/walgit/Dockerfile +40 -18
  6. package/templates/apps/walgit/README.md +518 -55
  7. package/templates/apps/walgit/e2e/README.md +100 -6
  8. package/templates/apps/walgit/e2e/harness.ts +262 -1
  9. package/templates/apps/walgit/e2e/live.ts +588 -0
  10. package/templates/apps/walgit/e2e/scenarios.ts +367 -5
  11. package/templates/apps/walgit/e2e/suite.ts +5 -5
  12. package/templates/apps/walgit/examples/watch.ts +209 -0
  13. package/templates/apps/walgit/package.json +12 -3
  14. package/templates/apps/walgit/registry.json +6 -11
  15. package/templates/apps/walgit/shared/capabilities.ts +189 -0
  16. package/templates/apps/walgit/shared/container-env.ts +114 -0
  17. package/templates/apps/walgit/shared/credentials.ts +81 -0
  18. package/templates/apps/walgit/shared/events.ts +277 -0
  19. package/templates/apps/walgit/shared/landing.ts +1241 -0
  20. package/templates/apps/walgit/shared/llms.ts +463 -0
  21. package/templates/apps/walgit/shared/outbox.ts +266 -0
  22. package/templates/apps/walgit/shared/policy.ts +59 -0
  23. package/templates/apps/walgit/shared/protocol.ts +197 -0
  24. package/templates/apps/walgit/shared/provenance.ts +154 -0
  25. package/templates/apps/walgit/shared/ref-cache.ts +181 -0
  26. package/templates/apps/walgit/shared/telemetry.ts +219 -0
  27. package/templates/apps/walgit/src/announce-main.ts +37 -0
  28. package/templates/apps/walgit/src/announce.ts +98 -0
  29. package/templates/apps/walgit/src/append-only.ts +112 -0
  30. package/templates/apps/walgit/src/cache.ts +172 -0
  31. package/templates/apps/walgit/src/cli.ts +493 -0
  32. package/templates/apps/walgit/src/compact.ts +25 -23
  33. package/templates/apps/walgit/src/delete-repo.ts +237 -0
  34. package/templates/apps/walgit/src/expire.ts +248 -0
  35. package/templates/apps/walgit/src/gc.ts +8 -16
  36. package/templates/apps/walgit/src/git-backend.ts +29 -0
  37. package/templates/apps/walgit/src/git.ts +78 -0
  38. package/templates/apps/walgit/src/hook-main.ts +259 -17
  39. package/templates/apps/walgit/src/hooks.ts +4 -3
  40. package/templates/apps/walgit/src/http.ts +237 -45
  41. package/templates/apps/walgit/src/instructions.ts +240 -0
  42. package/templates/apps/walgit/src/keys.ts +126 -0
  43. package/templates/apps/walgit/src/limits.ts +158 -0
  44. package/templates/apps/walgit/src/materialize.bench.ts +10 -10
  45. package/templates/apps/walgit/src/materialize.ts +48 -40
  46. package/templates/apps/walgit/src/mkdir-lock.ts +66 -0
  47. package/templates/apps/walgit/src/orphans.ts +2 -5
  48. package/templates/apps/walgit/src/pending.ts +201 -0
  49. package/templates/apps/walgit/src/push-cert.ts +254 -0
  50. package/templates/apps/walgit/src/push.ts +233 -46
  51. package/templates/apps/walgit/src/reconcile.ts +5 -8
  52. package/templates/apps/walgit/src/repo.ts +22 -77
  53. package/templates/apps/walgit/src/server.ts +148 -26
  54. package/templates/apps/walgit/src/signers.ts +577 -0
  55. package/templates/apps/walgit/src/store-env.ts +5 -4
  56. package/templates/apps/walgit/src/store.ts +47 -24
  57. package/templates/apps/walgit/src/usage.ts +404 -0
  58. package/templates/apps/walgit/src/verify.ts +171 -0
  59. package/templates/apps/walgit/src/wal-index.ts +189 -11
  60. package/templates/apps/walgit/tsconfig.json +8 -2
  61. package/templates/apps/walgit/tsconfig.worker.json +24 -0
  62. package/templates/apps/walgit/worker/events-do.ts +259 -0
  63. package/templates/apps/walgit/worker/index.ts +572 -0
  64. package/templates/apps/walgit/wrangler.jsonc +95 -0
  65. package/templates/apps/warehouse/package.json +1 -1
  66. package/templates/infra/modules/cloudflare/index.ts +77 -6
  67. package/templates/infra/modules/cloudflare-access/index.ts +85 -14
  68. package/templates/infra/modules/fly/index.ts +150 -10
  69. package/templates/infra/modules/turso/index.ts +43 -3
  70. package/templates/infra/package.json +1 -1
  71. package/templates/apps/walgit/entrypoint.sh +0 -59
  72. package/templates/apps/walgit/fly.toml +0 -52
  73. package/templates/apps/walgit/src/ssh-shell.ts +0 -36
  74. package/templates/apps/walgit/sshd_config +0 -38
@@ -0,0 +1,1241 @@
1
+ /**
2
+ * The page a browser gets at `/`.
3
+ *
4
+ * The same URL answers two audiences. git and curl send an `Accept` that never
5
+ * names HTML, and get src/instructions.ts — plain text, the whole protocol, no
6
+ * markup to parse. A browser sends `Accept: text/html` and gets this. One
7
+ * hostname, one route, and the pitch is never a second deployment to keep in
8
+ * sync with the service it describes.
9
+ *
10
+ * It is answered HERE, in the Worker, rather than proxied. That is the whole
11
+ * point of the placement: a link on an aggregator sends thousands of people to
12
+ * `/`, and not one of those requests should wake the container or queue behind
13
+ * a clone. The container serves git; the edge serves the argument.
14
+ *
15
+ * ── one argument, not three ───────────────────────────────────────────────
16
+ *
17
+ * The page used to walk three walls — no account, no way to share, no way to
18
+ * know something moved — as a scrolling story with a terminal that changed
19
+ * scene. The first two are settled by the two commands in the hero: whoever
20
+ * has run them has already seen that there was no signup and that a URL is the
21
+ * whole handoff, and reading an argument for what just happened is a page
22
+ * arguing with somebody who already agreed. So the body keeps the one thing
23
+ * the commands do NOT show — that finding out a ref moved needs no webhook —
24
+ * and everything else is a fact stated once.
25
+ *
26
+ * ── why the terms are arguments, not copy ─────────────────────────────────
27
+ *
28
+ * Every claim about what this host enforces — the caps, the window, who may
29
+ * read and write, whether anything can be destroyed — is rendered from the same
30
+ * `Capabilities` (`shared/capabilities.ts`) the push path enforces and `GET /`
31
+ * states — one derivation, read here rather than repeated. A page that promised
32
+ * a 24-hour window an unset `WALGIT_RETENTION_HOURS` never collects would be a
33
+ * lie told at the top of the funnel, and the only reliable way to not tell it
34
+ * is to have no copy that can outlive the config. So an unset limit removes its
35
+ * claim rather than defaulting to one.
36
+ *
37
+ * `Public` and `Append-only` were the two terms that never obeyed that rule.
38
+ * Both were written as unconditional prose — *"Every repository is
39
+ * world-readable and world-writable"*, *"Nothing you push can be destroyed"* —
40
+ * and both are opt-in flags (`WALGIT_PUBLIC`, `WALGIT_APPEND_ONLY`) a consumer
41
+ * scaffolding walgit has neither of until they set them. This page is answered
42
+ * at the edge, before any auth, to anyone, so a deployment running on tokens
43
+ * with append-only off advertised both to the world and enforced neither. They
44
+ * vary on the flags now, like everything beside them.
45
+ *
46
+ * The cap the page prints and the cap `pre-receive` refuses on are formatted by
47
+ * one function (`shared/policy.ts`), so they cannot look like two different
48
+ * numbers. That used to be a copy of `describeBytes` with a comment promising
49
+ * the two were kept identical.
50
+ */
51
+
52
+ import type { Capabilities } from './capabilities'
53
+ import { describeBytes } from './policy'
54
+ import { EVENTS_PATH, SIGNERS_REF } from './protocol'
55
+
56
+ /**
57
+ * Does this request want the page rather than the protocol?
58
+ *
59
+ * Only GET/HEAD on `/`, and only for a client that asked for HTML. git never
60
+ * sends `text/html` in its `Accept`, so the negotiation cannot misfire on a
61
+ * clone — and a client that asks for neither keeps the plain-text instructions,
62
+ * which is the safer default for anything automated.
63
+ */
64
+ export function wantsLanding(method: string, pathname: string, accept: string): boolean {
65
+ if (method !== 'GET' && method !== 'HEAD') return false
66
+ if (pathname !== '/') return false
67
+ return accept.toLowerCase().includes('text/html')
68
+ }
69
+
70
+ function describeHours(hours: number): string {
71
+ if (hours === 1) return '1 hour'
72
+ return `${hours} hours`
73
+ }
74
+
75
+ const claim = (key: string, value: string) =>
76
+ ` <li><span class="k">${key}</span><span class="v">${value}</span></li>`
77
+
78
+ /**
79
+ * The fourth term.
80
+ *
81
+ * With retention on it is the window, because a window is the most surprising
82
+ * thing about the service and the one nobody must learn only after pushing.
83
+ * With retention off there is no window to state, so the slot goes to the size
84
+ * caps — and when a deployment enforces nothing at all, the claim is absent
85
+ * rather than replaced by a reassuring sentence nothing backs.
86
+ */
87
+ function thirdClaim(caps: Capabilities): string {
88
+ if (caps.retentionHours !== null) {
89
+ const window = describeHours(caps.retentionHours)
90
+ return claim(
91
+ window,
92
+ `<b>A repository lives ${window} from its last push.</b> This is scratch space, on purpose.`,
93
+ )
94
+ }
95
+ if (caps.maxPushBytes !== null || caps.maxRepoBytes !== null) {
96
+ const parts: string[] = []
97
+ if (caps.maxPushBytes !== null) parts.push(`${describeBytes(caps.maxPushBytes)} per push`)
98
+ if (caps.maxRepoBytes !== null) {
99
+ parts.push(`${describeBytes(caps.maxRepoBytes)} per repository`)
100
+ }
101
+ return claim(
102
+ 'Bounded',
103
+ `<b>${parts.join(', ')}.</b> Refused in <code>pre-receive</code>, by a message that names which cap and what to do instead.`,
104
+ )
105
+ }
106
+ return ''
107
+ }
108
+
109
+ /** The permanence sentence, which turns on the same variable as the claim. */
110
+ function permanence(caps: Capabilities): string {
111
+ return caps.retentionHours === null
112
+ ? 'Not an archive: a repository here is a working surface, and nothing about this service is a promise to keep your history.'
113
+ : `Not permanent: ${describeHours(caps.retentionHours)} from the last push, a repository is collected.`
114
+ }
115
+
116
+ /**
117
+ * The one argument the two commands in the hero do not already make.
118
+ *
119
+ * One section and one illustration, and both were arrived at by deleting. The
120
+ * client used to be a section of its own — but "there is no webhook" and "here
121
+ * is the command that needs no webhook" are the same claim, and splitting them
122
+ * made a reader finish the argument, scroll, and start again.
123
+ *
124
+ * Then the illustration was two panels: the JSON on the wire, and a terminal
125
+ * running the client. Also one too many. A reader who is going to run the
126
+ * command does not need to see the frames it exchanges, and a reader who wants
127
+ * the frames wants `/llms.txt`, not a homepage. So the panel shows the command
128
+ * and the socket it opens, together, and the wire lives in the manual.
129
+ *
130
+ * Absent entirely when the deployment serves no stream, for the same reason
131
+ * every limit on this page is rendered rather than written: a section
132
+ * describing a socket that answers 404 is a lie told at the top of the funnel.
133
+ */
134
+ function eventsSection(host: string, caps: Capabilities): string {
135
+ if (!caps.events) return ''
136
+ const socket = `wss://${host}${EVENTS_PATH}`
137
+
138
+ return `
139
+ <section class="split">
140
+ <div class="split-say">
141
+ <h2>Stop asking whether main moved.</h2>
142
+ <p>Every check costs a fetch, a tool call and a slice of context, and almost every answer is <em>nothing changed</em>. A webhook would fix it, except an agent in a sandbox has no address to deliver one to.</p>
143
+ <p><strong>So the agent opens the socket instead:</strong> current state on connect, then one message per ref that moves.</p>
144
+ <p><strong>One command.</strong> It fetches, and flags what collides with your uncommitted work.</p>
145
+ </div>
146
+
147
+ <div class="split-show">
148
+ <div>
149
+ <div class="term term-solo">
150
+ <pre id="watch-cmd"><span class="p">$</span> bunx @zabaca/agentgit watch</pre>
151
+ <button class="copy" id="copy-watch" type="button" aria-live="polite" aria-label="Copy the watch command">Copy</button>
152
+ </div>
153
+ <p class="under"><span>npx</span> too · <span>--once</span> waits for the handoff</p>
154
+ </div>
155
+
156
+ <div class="panel wire" id="wire">
157
+ <div class="panel-head">
158
+ <span><span class="pulse"></span>${socket}</span>
159
+ </div>
160
+ <pre class="tx" id="wire-tx"><span class="ln" style="--d:0ms"><span class="p">$</span> bunx @zabaca/agentgit watch
161
+ </span><span class="ln" style="--d:220ms"><span class="c">watching study-42 for refs/heads/main</span>
162
+ </span><span class="ln" style="--d:400ms"><span class="ok">study-42 main: origin/main is 809eb587</span>
163
+ </span><span class="ln" style="--d:1150ms">
164
+ <span class="c"># the other agent pushes. no webhook, no polling.</span>
165
+ </span><span class="ln" style="--d:2050ms">
166
+ <span class="ok">study-42 main: origin/main is ef759899</span>
167
+ </span><span class="ln" style="--d:2400ms"><span class="no">study-42 main: COLLIDES with your work in src/index.ts</span><span class="caret"></span></span></pre>
168
+ <div class="panel-foot">Opened from the inside, so a sandbox needs no address.</div>
169
+ </div>
170
+ </div>
171
+ </section>
172
+ `
173
+ }
174
+
175
+ /**
176
+ * Append-only, whose second clause makes the same promise `Public` does.
177
+ *
178
+ * *"Anyone may add"* is unconditional writability in three words, so correcting
179
+ * the term below it and leaving this one alone would put two answers to the
180
+ * same question four lines apart. What append-only guarantees is untouched by
181
+ * the gate — it is who may push at all that narrows — so the gated version
182
+ * hands that question to the term that answers it.
183
+ *
184
+ * Absent entirely where `WALGIT_APPEND_ONLY` is unset, like every unenforced
185
+ * limit above it. *"Nothing you push can be destroyed"* is the strongest
186
+ * promise on the page and the one an agent is likeliest to rely on, and a
187
+ * deployment without the flag destroys history on a force push exactly like any
188
+ * other git host. There is nothing to say instead — *"refs can be rewritten"*
189
+ * is what every host does and is not a rule of this one — so the row leaves
190
+ * rather than being replaced.
191
+ */
192
+ function appendOnlyClaim(caps: Capabilities): string {
193
+ if (!caps.appendOnly) return ''
194
+ return claim(
195
+ 'Append-only',
196
+ '<b>Nothing you push can be destroyed.</b> ' +
197
+ (caps.namesCanRefuse
198
+ ? 'Whoever the name takes a push from may add; no one may rewrite or delete.'
199
+ : 'Anyone may add; no one may rewrite or delete.') +
200
+ ' A push that would rewrite history is refused in <code>pre-receive</code>, before anything is uploaded, by a message naming what to do instead.',
201
+ )
202
+ }
203
+
204
+ /**
205
+ * What anyone may do to a repository here, which the gate changes.
206
+ *
207
+ * Rendered rather than written for the reason every limit on this page is: the
208
+ * sentence it replaces — *"Every repository is world-readable and
209
+ * world-writable"* — is a promise `pre-receive` stopped keeping the moment a
210
+ * name could hold a Signer List, and a claim the page cannot back is the same
211
+ * defect as a window nothing collects.
212
+ *
213
+ * Read from `namesCanRefuse` — the gate alone — unlike the section below it and
214
+ * unlike the roadmap, which ask for `namesCanBeClaimed`: those two teach an
215
+ * agent to claim a name and must not do it where no push can be signed, whereas
216
+ * this states what is refused, and the hook refuses on the flag by itself. A
217
+ * deployment that sets it with no nonce seed refuses EVERY push to a claimed
218
+ * name, which makes unconditional writability more wrong, not less.
219
+ *
220
+ * Reads are untouched and the card still says so, because ADR-0012 is emphatic
221
+ * that none of this is a step toward private repositories: *"Privacy is not
222
+ * free yet"* was true before the gate and is true after it.
223
+ *
224
+ * None of which is true at all where `WALGIT_PUBLIC` is unset, which is every
225
+ * deployment that has not opted in: reads and writes both take a credential
226
+ * there (`src/server.ts`), and a page telling a visitor otherwise is telling it
227
+ * to the whole internet, since this page is served before any auth. Unlike
228
+ * `Append-only` the term does not leave — access is the one thing a reader of
229
+ * `The rules.` has to be told either way, and a list that simply omits it reads
230
+ * as a host that asks for nothing. So the slot states the other answer.
231
+ *
232
+ * That answer says nothing about who may WRITE beyond needing a credential,
233
+ * deliberately: a credentialed deployment can also run Signer Lists, where the
234
+ * token opens the door and a claimed name still refuses a stranger behind it.
235
+ * Reads are gated on the credential alone in every configuration, so that is
236
+ * the half the sentence quantifies over.
237
+ */
238
+ function publicClaim(caps: Capabilities): string {
239
+ if (!caps.publicAccess) {
240
+ return claim(
241
+ 'Credentialed',
242
+ '<b>Reads and writes need a credential.</b> Send it as the Basic-auth password or as a bearer token; the username is ignored. There is no per-repository privacy: one credential reads every name on this host.',
243
+ )
244
+ }
245
+ return claim(
246
+ 'Public',
247
+ caps.namesCanRefuse
248
+ ? '<b>Every repository is world-readable, and world-writable until its name is claimed.</b> Sharing is a URL, not an invitation. Privacy is not free yet.'
249
+ : '<b>Every repository is world-readable and world-writable.</b> Sharing is a URL, not an invitation. Privacy is not free yet.',
250
+ )
251
+ }
252
+
253
+ /**
254
+ * Holding a name, argued as a section rather than stated as a term.
255
+ *
256
+ * It is the second argument on this page, and it is here for the same reason
257
+ * the events section is: the two commands in the hero already show that there
258
+ * was no signup and that a URL is the whole handoff, and neither shows what a
259
+ * name costs. A term could state the rule; only a section can make the case,
260
+ * and the case is what a reader needs before they will spend a push on it.
261
+ *
262
+ * What the case IS depends on `appendOnly`, which is why `ownershipCost` below
263
+ * is rendered rather than written — the first draft of this section opened on
264
+ * *"Nothing you push can be destroyed"* unconditionally, which is the same
265
+ * promise `appendOnlyClaim` and `roadmapPulls` had to stop making and which
266
+ * this section made in a third place. Either way a stranger who knows the name
267
+ * can push into it; append-only is only what decides whether that is permanent
268
+ * or destructive.
269
+ *
270
+ * Placed BEFORE `The rules.`, beside the events argument rather than after the
271
+ * summary of it, so the two arguments read together and the terms below read as
272
+ * what both of them settle.
273
+ *
274
+ * The right column is the claim and then its consequence, in the order they
275
+ * happen: the commands that write the list, then the refusal a stranger reads.
276
+ *
277
+ * **The recipe is the whole of it, not the last line of it**, and every line it
278
+ * does show has to run. Three abbreviations were each tried and each is wrong:
279
+ * showing only the `git push` hands a reader a command that pushes their
280
+ * PROJECT's `HEAD` at the signers ref and is refused as an unreadable list;
281
+ * dropping `-c user.email`/`-c user.name` aborts in a fresh container with
282
+ * *"Please tell me who you are"*; and dropping `-c gpg.format=ssh` is the worst
283
+ * of the three, because this section only renders where the host advertises
284
+ * `push-cert`, so `--signed=if-asked` really does sign — with git's default
285
+ * OpenPGP format, from a key whose fingerprint is not the one just written into
286
+ * `signers`. A reader who has a PGP key would claim the name and then be locked
287
+ * out of it by their own next push.
288
+ *
289
+ * What is left to `/llms.txt` (`shared/llms.ts`) is `set -e` and the second
290
+ * key: this panel is the argument, and that document is the manual.
291
+ *
292
+ * **The transcript is an excerpt, and says so.** Every line of it is a line
293
+ * `heldMessage` (`src/signers.ts`) actually writes, and `landing.test.ts`
294
+ * checks them against the real refusal rather than against themselves — the
295
+ * page and the hook describing two different refusals is the drift every
296
+ * rendered claim here exists to prevent, and this one is worse than a wrong cap
297
+ * because the refusal is the only documentation the agent hitting it has. The
298
+ * elision is marked with a `…` line so nobody reads the panel as the whole
299
+ * message: what it cuts is the remedy block, which is long, and which the
300
+ * section beside it has already given.
301
+ *
302
+ * Gated on `namesCanBeClaimed` — the gate AND a seed — because the flag without
303
+ * a nonce seed is a misconfiguration in which nothing can sign, so inviting a
304
+ * visitor to claim a name there would be sending them to claim it with an
305
+ * unsigned push, after which every push to it, theirs included, is refused for
306
+ * carrying no certificate.
307
+ */
308
+ /**
309
+ * The bill append-only presents, or the one it does not.
310
+ *
311
+ * With the flag on, a stranger's branch in your name is as permanent as your
312
+ * own, and the cost is that nobody can undo it. With it off there is no
313
+ * permanence to argue from and the exposure is plainly worse — a stranger can
314
+ * move `main` or delete a ref — so the case for holding a name is made from
315
+ * that instead. Stating the append-only version on a deployment that does not
316
+ * enforce it would be the promise `appendOnlyClaim` just stopped making,
317
+ * reappearing two sections up the page.
318
+ */
319
+ function ownershipCost(caps: Capabilities): string {
320
+ return caps.appendOnly
321
+ ? 'Nothing you push can be destroyed — and that cuts both ways. Anyone who knows the name can add a branch to the repository your agent is working in, and then <em>neither of you can ever remove it</em>. Append-only defends their write as carefully as it defends yours.'
322
+ : 'Anyone who knows the name can push to the repository your agent is working in — a branch, a moved <code>main</code>, a deleted ref. Nothing stands between a stranger and your history, and <em>whoever pushes last wins</em>.'
323
+ }
324
+
325
+ function ownershipSection(host: string, caps: Capabilities): string {
326
+ if (!caps.namesCanBeClaimed) return ''
327
+
328
+ return `
329
+ <section class="split">
330
+ <div class="split-say">
331
+ <h2>A name a stranger cannot take.</h2>
332
+ <p>${ownershipCost(caps)}</p>
333
+ <p><strong>So a name can refuse a stranger.</strong> Write the fingerprints you trust to <code>${SIGNERS_REF}</code>. From the next push on, the repository takes pushes signed by those keys and refuses everything else — and every name nobody has claimed still takes anyone's.</p>
334
+ <p><strong>List two keys.</strong> There is no escrow here and no support address: one key, lost, is the end of the name.</p>
335
+ </div>
336
+
337
+ <div class="split-show">
338
+ <div>
339
+ <div class="term term-solo">
340
+ <pre><span class="c"># a repository whose tree is one file: signers.</span>
341
+ <span class="p">$</span> git init -q claim &amp;&amp; cd claim
342
+ <span class="p">$</span> ssh-keygen -lf ~/.ssh/id_ed25519.pub \\
343
+ | awk '{print $2}' > signers
344
+ <span class="p">$</span> git add signers
345
+ <span class="p">$</span> git -c user.email=agent@localhost \\
346
+ -c user.name=agent commit -qm claim
347
+ <span class="p">$</span> git -c gpg.format=ssh \\
348
+ -c user.signingkey=~/.ssh/id_ed25519.pub \\
349
+ push --signed=if-asked \\
350
+ https://${host}/$NAME.git \\
351
+ HEAD:${SIGNERS_REF}</pre>
352
+ </div>
353
+ <p class="under">List a second key · the full recipe is in <span>/llms.txt</span></p>
354
+ </div>
355
+
356
+ <div class="panel">
357
+ <div class="panel-head">
358
+ <span>what a stranger reads</span>
359
+ </div>
360
+ <pre class="tx"><span class="ln"><span class="p">$</span> git push agentgit HEAD:refs/heads/main
361
+ </span><span class="ln"><span class="no">walgit: refused — study-42 is held by a Signer List.</span>
362
+ </span><span class="ln"><span class="c">Your push carries no signature, so walgit cannot tell</span>
363
+ </span><span class="ln"><span class="c">whose it is. A name that holds a Signer List takes</span>
364
+ </span><span class="ln"><span class="c">signed pushes only:</span>
365
+ </span><span class="ln"><span class="c"> git push --signed=yes origin HEAD:refs/heads/&lt;branch&gt;</span>
366
+ </span><span class="ln"><span class="c">…</span>
367
+ </span><span class="ln"><span class="ok">Nothing was uploaded; the repository is unchanged.</span></span></pre>
368
+ <div class="panel-foot">Refused in <code>pre-receive</code>, before anything is uploaded. The message names a free name to use instead, and how to be added to this one.</div>
369
+ </div>
370
+ </div>
371
+ </section>
372
+ `
373
+ }
374
+
375
+ /**
376
+ * The signing term, present only where a push can actually be signed.
377
+ *
378
+ * Stated as a term rather than argued as a section: it changes nothing about
379
+ * how anyone uses the service — an unsigned push is accepted exactly as it was
380
+ * — so it belongs in the list of what is true here, not in the body.
381
+ */
382
+ function signingClaim(caps: Capabilities): string {
383
+ if (!caps.signedPushes) return ''
384
+ return claim(
385
+ 'Attributed',
386
+ "<b>A push signed with your key records that key's fingerprint.</b> " +
387
+ (caps.namesCanRefuse
388
+ ? 'Unsigned is fine unless a name has written a Signer List, which takes pushes from its own keys only. There is still no account: the fingerprint is the whole identity.'
389
+ : 'Nothing is refused for being unsigned, and there is still no account: the fingerprint is the whole identity.') +
390
+ ' <code>git push --signed=if-asked</code>.',
391
+ )
392
+ }
393
+
394
+ /**
395
+ * `The rules.`, assembled rather than slotted.
396
+ *
397
+ * Three of the four terms can be absent — each is rendered from a flag this
398
+ * deployment may not set — and a template with a placeholder per term leaves
399
+ * that term's blank line behind when it renders nothing, which the CSS draws as
400
+ * a rule with no row under it. Joining what is present is the arrangement where
401
+ * every combination of the flags produces a list with no dangling term, and it
402
+ * emits exactly what the four placeholders did when all four render.
403
+ *
404
+ * `Public` is the one that cannot vanish (`publicClaim` states the other answer
405
+ * instead), so the list is never empty.
406
+ */
407
+ function claims(caps: Capabilities): string {
408
+ return [appendOnlyClaim(caps), publicClaim(caps), thirdClaim(caps), signingClaim(caps)]
409
+ .filter((term) => term !== '')
410
+ .join('\n')
411
+ }
412
+
413
+ /**
414
+ * The `<meta description>`, which is the one claim read where the page is not.
415
+ *
416
+ * It says *"A public git host"* and *"no token"*, which are the same two
417
+ * capability claims the terms make — and this string is what a search result
418
+ * and a link preview show, so on a credentialed deployment it is the version of
419
+ * the lie that travels. Everything the sentence keeps is true of every
420
+ * deployment; only the two words that name a flag come out.
421
+ */
422
+ function metaDescription(caps: Capabilities): string {
423
+ return caps.publicAccess
424
+ ? 'A public git host for AI agents. No account, no token, no key: push to a name and the repository exists.'
425
+ : 'A git host for AI agents. No account, no key: push to a name and the repository exists.'
426
+ }
427
+
428
+ /**
429
+ * What the hero says a visitor needs, which is a capability claim in two words.
430
+ *
431
+ * *"No token"* stands above the terms and is read before them, so it obeys the
432
+ * rule they obey rather than being the last unconditional promise left on the
433
+ * page.
434
+ *
435
+ * The COMMANDS are deliberately not corrected with it, and it is a known gap
436
+ * rather than an oversight: the hero needs `https://walgit:$TOKEN@` and the
437
+ * watch panel needs `--token`, and where a visitor gets that token is a
438
+ * question this page does not answer and cannot answer from `Capabilities`.
439
+ * `/llms.txt` (`shared/llms.ts`) documents both for a credentialed deployment,
440
+ * so nobody is stranded; this page is the one that has not caught up. It is an
441
+ * editorial decision rather than a rendering one, and its own ticket.
442
+ */
443
+ function heroUnder(caps: Capabilities): string {
444
+ return caps.publicAccess
445
+ ? 'No account · <span>No token</span> · No key · <span>The name is the repository</span>'
446
+ : 'No account · <span>One token for the host</span> · No key · <span>The name is the repository</span>'
447
+ }
448
+
449
+ /**
450
+ * The first two roadmap rows, which are the two the gate makes untrue.
451
+ *
452
+ * The roadmap is "what is missing, in the order it unblocks itself", so a
453
+ * deployment where a name can already refuse a stranger must not go on calling
454
+ * ownership Next. Same rule as every limit on this page, applied to a promise
455
+ * instead of a cap.
456
+ *
457
+ * Where it shipped the row does not become a `Shipped` row — it LEAVES. This
458
+ * list is what is missing, and a section above now states ownership as a rule
459
+ * of the host; carrying it in both places would be the page describing one
460
+ * capability twice, once as a fact and once as an achievement. Only Private
461
+ * stays, because Private is genuinely still missing and the row was wrong about
462
+ * what it is blocked on: what a read would be gated on is the Signer List a
463
+ * name holds, not the fingerprint Provenance records. It is not next either —
464
+ * ADR-0012 is explicit that nothing here is a step toward private repositories
465
+ * — so the row keeps `data-next` off itself and hands it to nobody.
466
+ *
467
+ * Read from `namesCanRefuse` — the gate alone — like the two terms above and
468
+ * unlike the section, which teaches claiming and needs the seed too. The row is
469
+ * a statement about whether the capability EXISTS, not an invitation to use it
470
+ * — and on a deployment with the flag and no seed it exists and refuses
471
+ * everyone. Gating it on the seed put two answers on one page: a `Public` term
472
+ * saying a name can be claimed, above a roadmap row calling claiming a name the
473
+ * next thing to build.
474
+ */
475
+ function roadmapOwnership(caps: Capabilities): string {
476
+ if (!caps.namesCanRefuse) {
477
+ return ` <li data-next>
478
+ <span class="when">Next</span>
479
+ <h3>Ownership</h3>
480
+ <p>Claiming a name. Who pushed is already recorded; what is missing is the policy that says the first key to push a name keeps it — and un-claiming is a decision nobody will agree on, so it is the one row here that is hard to take back.</p>
481
+ </li>
482
+ <li>
483
+ <span class="when">After ownership</span>
484
+ <h3>Private</h3>
485
+ <p>There is nobody to be private from until a name has an owner. Reads gated on the same fingerprint that already gets recorded, and not before ownership means something.</p>
486
+ </li>`
487
+ }
488
+ return ` <li>
489
+ <span class="when">Unblocked, unplanned</span>
490
+ <h3>Private</h3>
491
+ <p>A name that holds a Signer List is the first thing here anyone could be private <em>from</em>. Reads are still gated on nothing: a claimed repository, its list and its history are as readable as everything else, and holding a name is not a step toward closing it.</p>
492
+ </li>`
493
+ }
494
+
495
+ /**
496
+ * Pull requests, whose first sentence is an append-only claim in seven words.
497
+ *
498
+ * *"Append-only already makes a proposal safe to push"* is the same promise the
499
+ * term above makes, stated in the roadmap instead — so gating the term and
500
+ * leaving this alone would move the false sentence rather than remove it. It is
501
+ * the same defect in the same page, one section down.
502
+ *
503
+ * What is MISSING is identical either way, which is why only the first sentence
504
+ * varies: the row is about the two things nobody has built, and append-only is
505
+ * the reason one of them is cheap rather than part of it.
506
+ */
507
+ function roadmapPulls(caps: Capabilities): string {
508
+ return caps.appendOnly
509
+ ? 'Append-only already makes a proposal safe to push. What is missing is a way to say a branch is one, and a way to say it landed — not a review UI.'
510
+ : 'A branch is already the whole of a proposal. What is missing is a way to say that is what it is, and a way to say it landed — not a review UI.'
511
+ }
512
+
513
+ /**
514
+ * The live client, shipped only where there is a socket to open.
515
+ *
516
+ * It sits behind the same gate as every other claim on this page: a deployment
517
+ * that serves no stream must not ship a client for one, or the page would carry
518
+ * code describing a capability its own Worker answers 404 for.
519
+ */
520
+ function wireScript(): string {
521
+ return `${WIRE_CLIENT}`
522
+ }
523
+
524
+ /**
525
+ * Every substitution passes a FUNCTION, never the string itself.
526
+ *
527
+ * `String.replace` reads `$` sequences in a replacement STRING as capture-group
528
+ * references, and these fragments are full of them: a shell prompt is
529
+ * `<span class="p">$</span>`, the claim recipe carries `awk '{print $2}'` and
530
+ * `$NAME`. Today every one of those is left literal — there are no capture
531
+ * groups in a string pattern — but that is a rule about what the fragments
532
+ * happen to contain, re-checked on every copy edit, and the failure it guards
533
+ * is silent: a command on the page that quietly differs from the one anybody
534
+ * runs. A function replacer is not interpreted at all, so the question stops
535
+ * being asked.
536
+ */
537
+ export function renderLanding(host: string, caps: Capabilities): string {
538
+ return PAGE.replaceAll('{{HOST}}', () => host)
539
+ .replace('{{META_DESCRIPTION}}', () => metaDescription(caps))
540
+ .replace('{{HERO_UNDER}}', () => heroUnder(caps))
541
+ .replace('{{CLAIMS}}', () => claims(caps))
542
+ .replace('{{ROADMAP_OWNERSHIP}}', () => roadmapOwnership(caps))
543
+ .replace('{{ROADMAP_PULLS}}', () => roadmapPulls(caps))
544
+ .replace('{{EVENTS}}', () => eventsSection(host, caps))
545
+ .replace('{{OWNERSHIP}}', () => ownershipSection(host, caps))
546
+ .replace('{{WIRE_SCRIPT}}', () => (caps.events ? wireScript() : ''))
547
+ .replace('{{PERMANENCE}}', () => permanence(caps))
548
+ }
549
+
550
+ const WIRE_CLIENT = `
551
+ // ── the transcript plays itself ────────────────────────────────────
552
+ //
553
+ // A recording rather than a live socket, and that was a deliberate
554
+ // retreat. The panel DID open a real WebSocket to this host and stream
555
+ // genuine pushes — verified, a push landed here four seconds after git
556
+ // returned — but a repository nobody is pushing to sits silent for
557
+ // exactly as long as anyone is reading it. The honest live version proved
558
+ // the connection was open and nothing else, and what a visitor needs to
559
+ // see is the thing ARRIVE.
560
+ //
561
+ // So the timing is the content: three lines land together, then a wait
562
+ // while the comment says another agent is pushing, then the new sha and
563
+ // the collision. The pause is the argument, because nothing polled during
564
+ // it.
565
+ //
566
+ // The lines are in the HTML and visible before this runs. Script only
567
+ // takes them away to give them back in order, so no JavaScript, a script
568
+ // that fails, or a request for less motion all leave the whole transcript
569
+ // on screen.
570
+ var tx = document.getElementById("wire-tx");
571
+ if (!tx || !("IntersectionObserver" in window)) return;
572
+ if (window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
573
+
574
+ tx.classList.add("armed");
575
+ var io = new IntersectionObserver(function (entries) {
576
+ if (!entries[0] || !entries[0].isIntersecting) return;
577
+ io.disconnect();
578
+ // Played once. A transcript that restarted every time it came back into
579
+ // view would read as a loop rather than as something that happened.
580
+ tx.classList.add("play");
581
+ }, { threshold: 0.35 });
582
+ io.observe(tx);
583
+ `
584
+
585
+ const PAGE = `<!doctype html>
586
+ <html lang="en">
587
+ <head>
588
+ <meta charset="utf-8">
589
+ <meta name="viewport" content="width=device-width, initial-scale=1">
590
+ <title>agentgit — Git for AI agents</title>
591
+ <meta name="description" content="{{META_DESCRIPTION}}">
592
+ <style>
593
+ /* Deliberately single-theme: a launch page with a fixed identity.
594
+ Every colour is painted explicitly so it holds on either host ground. */
595
+ :root {
596
+ --ground: #14100e; /* warm off-black — brown, not blue */
597
+ --raised: #1c1815;
598
+ --sunk: #0e0b0a;
599
+ --rule: #2e2723;
600
+ --rule-2: #423831;
601
+ --bone: #ede6de;
602
+ --muted: #a79b90;
603
+ --faint: #8f847a; /* AA on all three grounds: 5.18 / 4.83 / 5.37 */
604
+ --copper: #c56a3e; /* fresh metal */
605
+ --verdi: #4e9e8b; /* what copper becomes with age */
606
+
607
+ --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
608
+ --serif: "Newsreader", Georgia, "Times New Roman", serif;
609
+ }
610
+
611
+ * { box-sizing: border-box; }
612
+
613
+ html { -webkit-text-size-adjust: 100%; }
614
+
615
+ /* Surfaces the browser would otherwise paint from no design system at all. */
616
+ ::selection { background: var(--copper); color: var(--sunk); }
617
+
618
+ body {
619
+ background: var(--ground);
620
+ color: var(--bone);
621
+ font-family: var(--mono);
622
+ font-size: 16px;
623
+ line-height: 1.6;
624
+ margin: 0;
625
+ -webkit-font-smoothing: antialiased;
626
+ }
627
+
628
+ .wrap {
629
+ max-width: 62rem;
630
+ margin: 0 auto;
631
+ padding: clamp(2.5rem, 7vw, 6rem) clamp(1.15rem, 5vw, 2rem) 4rem;
632
+ }
633
+
634
+ a { color: var(--verdi); text-decoration-thickness: 1px; text-underline-offset: 3px; }
635
+ a:hover { color: var(--copper); }
636
+
637
+ :focus-visible {
638
+ outline: 2px solid var(--copper);
639
+ outline-offset: 3px;
640
+ border-radius: 1px;
641
+ }
642
+
643
+ /* ── hero ─────────────────────────────────────────────── */
644
+
645
+ /* Visible only once focused. Three focusables and one landmark make this
646
+ cheap rather than essential, but a keyboard user should never have to tab
647
+ through the page furniture to reach the command. */
648
+ .skip {
649
+ position: absolute;
650
+ clip-path: inset(50%);
651
+ left: 0;
652
+ top: 0;
653
+ background: var(--copper);
654
+ color: var(--sunk);
655
+ font-size: .72rem;
656
+ letter-spacing: .1em;
657
+ text-transform: uppercase;
658
+ text-decoration: none;
659
+ padding: .8rem 1.1rem;
660
+ z-index: 2;
661
+ }
662
+ .skip:focus { clip-path: none; color: var(--sunk); }
663
+
664
+ .badge {
665
+ display: inline-block;
666
+ font-size: .68rem;
667
+ letter-spacing: .14em;
668
+ text-transform: uppercase;
669
+ color: var(--muted);
670
+ border: 1px solid var(--rule-2);
671
+ padding: .32rem .6rem;
672
+ margin-bottom: 2rem;
673
+ }
674
+
675
+ h1 {
676
+ font-family: var(--mono);
677
+ font-weight: 700;
678
+ font-size: clamp(2.1rem, 7.6vw, 4rem);
679
+ line-height: 1;
680
+ letter-spacing: -.045em;
681
+ margin: 0 0 1.5rem;
682
+ text-wrap: balance;
683
+ }
684
+ h1 .dot { color: var(--copper); }
685
+
686
+ .lede {
687
+ font-family: var(--serif);
688
+ font-weight: 300;
689
+ font-size: clamp(1.15rem, 2.9vw, 1.5rem);
690
+ line-height: 1.5;
691
+ color: var(--bone);
692
+ max-width: 38ch;
693
+ margin: 0 0 2.75rem;
694
+ }
695
+ .lede em { font-style: normal; color: var(--copper); }
696
+
697
+ /* ── the command, which is the CTA ────────────────────── */
698
+
699
+ .cta { margin: 0 0 1rem; max-width: 44rem; }
700
+
701
+ /* The name is the only thing about the first push a visitor gets to decide,
702
+ so it is the only editable thing on the page. Typing here rewrites the
703
+ command below it, and the copy button reads the command rather than this
704
+ field, so what lands on the clipboard is what is on screen.
705
+
706
+ It stands where "give this to your agent" used to: naming the repository
707
+ IS creating it, so that instruction was a caption on the one step that
708
+ already explains itself. */
709
+ .repo-field {
710
+ display: inline-flex;
711
+ align-items: center;
712
+ gap: .6rem;
713
+ margin: 0 0 .75rem;
714
+ font-size: .68rem;
715
+ letter-spacing: .13em;
716
+ text-transform: uppercase;
717
+ color: var(--muted);
718
+ cursor: text;
719
+ }
720
+
721
+ /* A box, not an underline. The first version of this was a bottom rule and a
722
+ small copper word, which read as a label rather than as something to type
723
+ in — the one control on the page has to look like one. */
724
+ .repo-field input {
725
+ caret-color: var(--copper);
726
+ font-family: var(--mono);
727
+ font-size: .86rem;
728
+ letter-spacing: 0;
729
+ text-transform: none;
730
+ color: var(--copper);
731
+ background: var(--sunk);
732
+ border: 1px solid var(--rule-2);
733
+ border-left: 2px solid var(--copper);
734
+ padding: .5rem .7rem;
735
+ width: 15rem;
736
+ max-width: 48vw;
737
+ min-height: 44px;
738
+ }
739
+ .repo-field input::placeholder { color: var(--faint); }
740
+
741
+ /* Why a character disappeared. The field filters as you type rather than
742
+ refusing on submit — there is no submit — so the only place left to say
743
+ what happened is beside the field, at the moment it happens. */
744
+ .repo-note {
745
+ font-size: .66rem;
746
+ letter-spacing: .08em;
747
+ text-transform: none;
748
+ color: var(--copper);
749
+ opacity: 0;
750
+ transition: opacity .18s ease;
751
+ }
752
+ .repo-note[data-shown] { opacity: 1; }
753
+ .repo-field input:hover { border-color: var(--faint); border-left-color: var(--copper); }
754
+ /* The border shift is the resting-to-active cue; the outline is the
755
+ accessible one. An earlier version set outline:0 here, which also
756
+ defeated the global :focus-visible rule and left the page's only text
757
+ input invisible to the keyboard. */
758
+ .repo-field input:focus { border-color: var(--copper); background: var(--ground); }
759
+
760
+ /* The one token in the command that the field above rewrites, coloured so
761
+ the connection between the two is visible before anybody types. */
762
+ #repo-echo {
763
+ color: var(--copper);
764
+ border-bottom: 1px dashed var(--rule-2);
765
+ }
766
+
767
+ .term {
768
+ background: var(--sunk);
769
+ border: 1px solid var(--rule-2);
770
+ display: grid;
771
+ grid-template-columns: 1fr auto;
772
+ align-items: stretch;
773
+ }
774
+ .term-solo { max-width: 34rem; margin-bottom: .75rem; }
775
+
776
+ .term pre {
777
+ margin: 0;
778
+ padding: 1.1rem 1.2rem;
779
+ overflow-x: auto;
780
+ font-size: .82rem;
781
+ line-height: 1.85;
782
+ color: var(--bone);
783
+ }
784
+ .term .p { color: var(--copper); user-select: none; }
785
+ .term .c { color: var(--faint); }
786
+
787
+ .copy {
788
+ font-family: var(--mono);
789
+ font-size: .66rem;
790
+ letter-spacing: .12em;
791
+ text-transform: uppercase;
792
+ color: var(--bone);
793
+ background: var(--raised);
794
+ border: 0;
795
+ border-left: 1px solid var(--rule-2);
796
+ padding: 0 1.15rem;
797
+ min-width: 5.5rem;
798
+ min-height: 44px;
799
+ cursor: pointer;
800
+ }
801
+ .copy:hover { background: var(--copper); color: var(--sunk); }
802
+ .copy[data-done="1"] { background: var(--verdi); color: var(--sunk); }
803
+
804
+ .under {
805
+ font-family: var(--mono);
806
+ font-size: .72rem;
807
+ letter-spacing: .1em;
808
+ text-transform: uppercase;
809
+ color: var(--faint);
810
+ margin: 0 0 .6rem;
811
+ max-width: none;
812
+ }
813
+ .under span { color: var(--muted); }
814
+
815
+ /* ── panels ───────────────────────────────────────────── */
816
+
817
+ .panel { border: 1px solid var(--rule-2); background: var(--raised); }
818
+
819
+ .panel-head {
820
+ display: flex;
821
+ align-items: center;
822
+ justify-content: space-between;
823
+ gap: 1rem;
824
+ /* The socket URL is one token with no space to break at, and uppercase
825
+ plus tracking makes it longer than a 320px screen. Without this the
826
+ whole page pans rather than the header wrapping. */
827
+ overflow-wrap: anywhere;
828
+ padding: .7rem 1rem;
829
+ border-bottom: 1px solid var(--rule-2);
830
+ font-size: .66rem;
831
+ letter-spacing: .13em;
832
+ text-transform: uppercase;
833
+ color: var(--muted);
834
+ }
835
+ .pulse {
836
+ display: inline-block;
837
+ width: .42rem; height: .42rem;
838
+ border-radius: 50%;
839
+ background: var(--verdi);
840
+ margin-right: .5rem;
841
+ vertical-align: baseline;
842
+ }
843
+ /* The socket's address is a URL, not a label. Uppercasing it was both wrong
844
+ — the path is case-sensitive — and wide enough that tracking broke it
845
+ mid-token. Set as itself it fits on one line. */
846
+ .wire .panel-head > span:first-child {
847
+ text-transform: none;
848
+ letter-spacing: .02em;
849
+ font-size: .7rem;
850
+ color: var(--muted);
851
+ }
852
+
853
+ /* The transcript arrives a line at a time, on a schedule the markup carries
854
+ as --d. The long gap before the last two lines is the point of the whole
855
+ panel: nothing polled during it, and then the push simply showed up.
856
+
857
+ Lines are visible until script arms them, so the no-JavaScript reading is
858
+ the complete transcript rather than an empty box. */
859
+ .tx .ln { display: block; }
860
+ .tx.armed > .ln { opacity: 0; }
861
+ .tx.play > .ln {
862
+ animation: land .34s cubic-bezier(.2, .7, .3, 1) both;
863
+ animation-delay: var(--d, 0ms);
864
+ }
865
+ @keyframes land {
866
+ from { opacity: 0; transform: translateY(.3rem); }
867
+ to { opacity: 1; transform: none; }
868
+ }
869
+
870
+ .panel-foot {
871
+ border-top: 1px solid var(--rule-2);
872
+ padding: .85rem 1rem;
873
+ font-size: .74rem;
874
+ line-height: 1.55;
875
+ color: var(--faint);
876
+ }
877
+ .panel-foot code { color: var(--verdi); font-size: .78rem; }
878
+
879
+ .tx {
880
+ margin: 0;
881
+ padding: 1rem 1.15rem;
882
+ font-size: .74rem;
883
+ line-height: 1.65;
884
+ white-space: pre;
885
+ overflow-x: auto;
886
+ color: var(--muted);
887
+ }
888
+ .tx .p { color: var(--copper); }
889
+ .tx .c { color: var(--faint); }
890
+ .tx .ok { color: var(--verdi); }
891
+ .tx .no { color: var(--copper); }
892
+ .tx .caret {
893
+ display: inline-block;
894
+ width: .52em; height: 1em;
895
+ background: var(--copper);
896
+ vertical-align: -.14em;
897
+ animation: blink 1.05s steps(1) infinite;
898
+ }
899
+ @keyframes blink { 50% { opacity: 0; } }
900
+
901
+ /* ── prose sections ───────────────────────────────────── */
902
+
903
+ section { margin-top: 5rem; }
904
+
905
+ h2 {
906
+ font-family: var(--mono);
907
+ font-weight: 700;
908
+ font-size: clamp(1.35rem, 4vw, 1.85rem);
909
+ letter-spacing: -.03em;
910
+ margin: 0 0 1rem;
911
+ text-wrap: balance;
912
+ }
913
+
914
+ section p {
915
+ font-family: var(--serif);
916
+ font-weight: 300;
917
+ font-size: 1.08rem;
918
+ line-height: 1.62;
919
+ color: var(--muted);
920
+ max-width: 58ch;
921
+ margin: 0 0 1.25rem;
922
+ }
923
+ section p strong { color: var(--bone); font-weight: 400; }
924
+ /* The answer the reader keeps paying for and keeps not needing. Italic
925
+ rather than quoted: it is the thing the tool says, not a thing anyone said. */
926
+ section p em { font-style: italic; color: var(--faint); }
927
+
928
+ /* The one argument, and the wire beside it rather than under it: the prose
929
+ and the thing it describes are read together or not at all. */
930
+ .split {
931
+ display: grid;
932
+ grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
933
+ gap: 0 2.5rem;
934
+ align-items: start;
935
+ }
936
+ /* A grid item defaults to min-width:auto, so a track cannot shrink below its
937
+ content's min-content width — and .tx is white-space:pre with 53-character
938
+ lines. Without this the TRACK grew instead of the pre scrolling, and the
939
+ whole page panned sideways on every phone. */
940
+ .split > *,
941
+ .split-show > *,
942
+ .term > * { min-width: 0; }
943
+ .claims li, .road li { min-width: 0; }
944
+ .split-say p { max-width: 46ch; margin-bottom: 1rem; }
945
+ /* The command and the socket it opens are one column: the argument reads
946
+ down the left, and everything a reader would actually run or watch happens
947
+ on the right, in the order it happens. */
948
+ .split-show { display: grid; gap: 1.75rem; align-content: start; }
949
+ .split-show .term-solo { margin: 0 0 .5rem; max-width: 100%; }
950
+ .split-show .under { margin: 0; letter-spacing: .07em; }
951
+ .split-show .tx { font-size: .7rem; }
952
+
953
+ /* ── the terms ────────────────────────────────────────── */
954
+
955
+ .claims {
956
+ list-style: none;
957
+ margin: 0;
958
+ padding: 0;
959
+ display: grid;
960
+ gap: 0;
961
+ border-top: 1px solid var(--rule);
962
+ }
963
+ .claims li {
964
+ border-bottom: 1px solid var(--rule);
965
+ padding: 1.05rem 0;
966
+ display: grid;
967
+ grid-template-columns: 9.5rem 1fr;
968
+ gap: 0 1.5rem;
969
+ align-items: baseline;
970
+ }
971
+ .claims .k {
972
+ font-size: .68rem;
973
+ letter-spacing: .13em;
974
+ text-transform: uppercase;
975
+ color: var(--verdi);
976
+ }
977
+ .claims .v { color: var(--muted); font-size: .95rem; font-family: var(--serif); font-size: 1rem; }
978
+ .claims .v b { color: var(--bone); font-weight: 400; }
979
+ .claims .v code { font-family: var(--mono); font-size: .82rem; color: var(--verdi); }
980
+
981
+ /* ── the roadmap ──────────────────────────────────────── */
982
+
983
+ .road {
984
+ list-style: none;
985
+ margin: 0 0 1.5rem;
986
+ padding: 0;
987
+ display: grid;
988
+ grid-template-columns: repeat(2, minmax(0, 1fr));
989
+ gap: 1px;
990
+ background: var(--rule);
991
+ border: 1px solid var(--rule);
992
+ }
993
+ .road li {
994
+ background: var(--ground);
995
+ padding: 1.35rem 1.5rem;
996
+ display: grid;
997
+ gap: .5rem;
998
+ align-content: start;
999
+ }
1000
+ /* The rules are drawn by the container's background showing through a 1px
1001
+ gap, so a half-empty final row is not blank — it paints a solid --rule
1002
+ block beside the last card. The list is rendered from policy and is three
1003
+ rows on a deployment that has shipped ownership, four on one that has not,
1004
+ so an odd count is an ordinary state rather than an editing mistake. */
1005
+ .road li:last-child:nth-child(odd) { grid-column: 1 / -1; }
1006
+ .road h3 {
1007
+ font-family: var(--mono);
1008
+ font-size: .95rem;
1009
+ font-weight: 700;
1010
+ letter-spacing: -.01em;
1011
+ margin: 0;
1012
+ color: var(--bone);
1013
+ }
1014
+ .road .when {
1015
+ font-size: .62rem;
1016
+ letter-spacing: .14em;
1017
+ text-transform: uppercase;
1018
+ color: var(--faint);
1019
+ }
1020
+ .road li[data-next] .when { color: var(--copper); }
1021
+ .road p {
1022
+ font-family: var(--serif);
1023
+ font-size: 1rem;
1024
+ line-height: 1.55;
1025
+ color: var(--muted);
1026
+ margin: 0;
1027
+ max-width: 40ch;
1028
+ }
1029
+
1030
+ .caveat {
1031
+ font-family: var(--serif);
1032
+ font-size: 1rem;
1033
+ color: var(--muted);
1034
+ max-width: 58ch;
1035
+ margin: 0;
1036
+ }
1037
+
1038
+ footer {
1039
+ margin-top: 5rem;
1040
+ padding-top: 1.4rem;
1041
+ border-top: 1px solid var(--rule);
1042
+ display: flex;
1043
+ flex-wrap: wrap;
1044
+ gap: .6rem 1.6rem;
1045
+ font-size: .7rem;
1046
+ letter-spacing: .1em;
1047
+ text-transform: uppercase;
1048
+ color: var(--faint);
1049
+ }
1050
+ footer code { text-transform: none; color: var(--verdi); }
1051
+
1052
+ @media (max-width: 62rem) {
1053
+ .split { grid-template-columns: minmax(0, 1fr); gap: 2rem 0; }
1054
+ .split-say p { max-width: 58ch; }
1055
+ }
1056
+
1057
+ @media (max-width: 34rem) {
1058
+ .claims li { grid-template-columns: 1fr; gap: .25rem; }
1059
+ .road { grid-template-columns: 1fr; }
1060
+ .term { grid-template-columns: 1fr; }
1061
+ .copy { border-left: 0; border-top: 1px solid var(--rule-2); padding: .8rem; }
1062
+ }
1063
+
1064
+ @media (prefers-reduced-motion: reduce) {
1065
+ .tx .caret, .pulse, .tx .ln { animation: none; }
1066
+ .tx.armed > .ln, .tx.play > .ln { opacity: 1; transform: none; }
1067
+ * { transition: none !important; }
1068
+ }
1069
+ </style>
1070
+ </head>
1071
+ <body>
1072
+ <a class="skip" href="#start">Skip to the command</a>
1073
+ <div class="wrap">
1074
+
1075
+ <main id="start">
1076
+ <span class="badge">Open source — run your own</span>
1077
+
1078
+ <h1>Git for AI agents<span class="dot">.</span></h1>
1079
+
1080
+ <p class="lede">Your agent writes code all day and has nowhere of its own to put it. <em>Push to a name and the repository exists</em> — no account, no key, no API besides git itself.</p>
1081
+
1082
+ <div class="cta">
1083
+ <label class="repo-field" for="repo">
1084
+ <span>Name it</span>
1085
+ <input id="repo" name="repo" type="text" value="my-thing" placeholder="my-thing"
1086
+ spellcheck="false"
1087
+ autocomplete="off" autocapitalize="off" maxlength="64"
1088
+ aria-describedby="repo-help">
1089
+ <span class="repo-note" id="repo-note" role="status" aria-live="polite"></span>
1090
+ </label>
1091
+ <div class="term">
1092
+ <pre id="cmd"><span class="c"># there is no signup.</span>
1093
+ <span class="p">$</span> git remote add agentgit https://{{HOST}}/<span id="repo-echo">my-thing</span>.git
1094
+ <span class="p">$</span> git push agentgit main</pre>
1095
+ <button class="copy" id="copy" type="button" aria-live="polite" aria-label="Copy the two commands">Copy</button>
1096
+ </div>
1097
+ </div>
1098
+ <p class="under" id="repo-help">{{HERO_UNDER}}</p>
1099
+ {{EVENTS}}{{OWNERSHIP}}
1100
+ <section>
1101
+ <h2>The rules.</h2>
1102
+ <ul class="claims">
1103
+ {{CLAIMS}}
1104
+ </ul>
1105
+ </section>
1106
+
1107
+ <section>
1108
+ <h2>On the way.</h2>
1109
+ <p>What is missing, in the order it unblocks itself. Nothing here is a date, and each one is written down before it is built.</p>
1110
+ <ul class="road">
1111
+ {{ROADMAP_OWNERSHIP}}
1112
+ <li>
1113
+ <span class="when">Under design</span>
1114
+ <h3>Pull requests</h3>
1115
+ <p>{{ROADMAP_PULLS}}</p>
1116
+ </li>
1117
+ <li>
1118
+ <span class="when">Half built</span>
1119
+ <h3>CI</h3>
1120
+ <p>A ref moving is already an event, and the client already runs a command on it. The missing half is somewhere to run it that is not your machine.</p>
1121
+ </li>
1122
+ </ul>
1123
+ <p class="caveat">{{PERMANENCE}} Not a place for anything you cannot lose.</p>
1124
+ </section>
1125
+ </main>
1126
+
1127
+ <footer>
1128
+ <span>agentgit</span>
1129
+ <span>Open source</span>
1130
+ <span>Run your own: <code>zbc add walgit</code></span>
1131
+ </footer>
1132
+ </div>
1133
+
1134
+ <script>
1135
+ (function () {
1136
+ "use strict";
1137
+
1138
+ // The name, which is the whole of creating a repository here.
1139
+ //
1140
+ // Prefilled with a random suffix rather than left blank, because the advice
1141
+ // this page would otherwise have to give in a sentence — many agents run
1142
+ // near-identical prompts at the same time, and a plain name is probably
1143
+ // taken — is better given as the default anyone starts from.
1144
+ var field = document.getElementById("repo");
1145
+ var echo = document.getElementById("repo-echo");
1146
+
1147
+ var chars = "abcdefghjkmnpqrstuvwxyz23456789";
1148
+ var suffix = "";
1149
+ for (var i = 0; i < 6; i++) suffix += chars[Math.floor(Math.random() * chars.length)];
1150
+
1151
+ // Exactly the grammar the host accepts (shared/protocol.ts): one flat
1152
+ // segment, starting alphanumeric. Filtering as it is typed rather than
1153
+ // refusing on submit — there is no submit, and a command that cannot work
1154
+ // should never appear on screen to be copied.
1155
+ var clean = function (value) {
1156
+ return value.replace(/[^A-Za-z0-9._-]/g, "").replace(/^[^A-Za-z0-9]+/, "").slice(0, 64);
1157
+ };
1158
+
1159
+ var render = function () {
1160
+ echo.textContent = clean(field.value) || "my-thing";
1161
+ };
1162
+
1163
+ field.value = "my-thing-" + suffix;
1164
+ render();
1165
+ var note = document.getElementById("repo-note");
1166
+ var noteTimer;
1167
+ var say = function (message) {
1168
+ note.textContent = message;
1169
+ note.setAttribute("data-shown", "1");
1170
+ clearTimeout(noteTimer);
1171
+ noteTimer = setTimeout(function () {
1172
+ note.removeAttribute("data-shown");
1173
+ }, 2600);
1174
+ };
1175
+
1176
+ field.addEventListener("input", function () {
1177
+ var caret = field.selectionStart;
1178
+ var cleaned = clean(field.value);
1179
+ if (cleaned !== field.value) {
1180
+ field.value = cleaned;
1181
+ // Typing a character the host would refuse should not also move the
1182
+ // caret to the end of what was already typed.
1183
+ field.setSelectionRange(caret - 1, caret - 1);
1184
+ // And it should not vanish without a word. Silence here reads as a
1185
+ // broken keyboard rather than as a rule.
1186
+ say("letters, numbers, dot, dash, underscore");
1187
+ }
1188
+ render();
1189
+ });
1190
+ // An empty field shows my-thing in the command; leaving it empty should
1191
+ // leave the field agreeing with the command rather than blank.
1192
+ field.addEventListener("blur", function () {
1193
+ if (clean(field.value) === "") field.value = "my-thing";
1194
+ render();
1195
+ });
1196
+
1197
+ // What a copy button copies is read out of the block it sits next to,
1198
+ // rather than repeated here: a command written twice is a command that
1199
+ // eventually differs from itself, and the copy is the half nobody checks.
1200
+ // The prompt marks and the comment lines are not part of what runs.
1201
+ var runnable = function (pre) {
1202
+ return pre.textContent
1203
+ .split("\\n")
1204
+ .map(function (line) { return line.replace(/^\\s*\\$\\s?/, ""); })
1205
+ .filter(function (line) { return line.trim() !== "" && line.trim()[0] !== "#"; })
1206
+ .join("\\n");
1207
+ };
1208
+
1209
+ var copy = function (button) {
1210
+ if (!button) return;
1211
+ var pre = button.parentNode.querySelector("pre");
1212
+ if (!pre) return;
1213
+ var text = runnable(pre);
1214
+ button.addEventListener("click", function () {
1215
+ var done = function () {
1216
+ button.textContent = "Copied";
1217
+ button.setAttribute("data-done", "1");
1218
+ setTimeout(function () {
1219
+ button.textContent = "Copy";
1220
+ button.removeAttribute("data-done");
1221
+ }, 1800);
1222
+ };
1223
+ if (navigator.clipboard && navigator.clipboard.writeText) {
1224
+ navigator.clipboard.writeText(text).then(done, function () {
1225
+ button.textContent = "Select it";
1226
+ });
1227
+ } else {
1228
+ button.textContent = "Select it";
1229
+ }
1230
+ });
1231
+ };
1232
+
1233
+ copy(document.getElementById("copy"));
1234
+ copy(document.getElementById("copy-watch"));
1235
+
1236
+ {{WIRE_SCRIPT}}
1237
+ })();
1238
+ </script>
1239
+ </body>
1240
+ </html>
1241
+ `