interplane.Get Omega
Read in your language

interplane.io

Source of interplane.io: a Rust generator that renders the page from the protocol repository's public record, deployed hourly from the Spark.

Brought by drakestapleton

Comparing 7f137ea642fb8e9b943fd118dd0e628b2e9c7619 ... 3bf83bcc3b1390dcdffd13ebe8be42f25b582227

12 files changed, +242 -168

AGENTS.md+2-4
README.md+14-13
content/_layout.html+2-2
content/contribute/index.html+1-1
content/forge/index.html+1-1
content/index.html+2-2
content/llms.txt+2-1
content/omega/index.html+22-0
content/routes.txt+1-0
docs/CLAIMS.md+5-3
scripts/sync-to-hub.sh+50-37
scripts/tests/check-sync.sh+140-104

AGENTS.md

@@ -50,10 +50,8 @@ Shared rules: read https://www.aienos.com/agents/RULES.md first. Where the two d
5050 - No translated copies. Readers translate pages with their own browser or tool (`/translate/`), and the
5151 builder refuses a route under `/zh-`, `/zh/` or `/zh`. Make pages translate well instead: keep
5252 commands in `code`/`pre`, and let the builder mark hashes, IDs and file names `translate="no"`.
53-- Work on a branch. Publish one reviewed commit, given in full, after its owner-signed native
54- Interplane landing. Plain Git on the Spark is the source route; GitHub and Radicle are not
55- publishing routes. Preserve the landing receipt and verify served files after deployment.
56- There is no schedule. Do not run `scripts/sync-to-hub.sh`.
53+- Work on a branch. The publisher publishes only the signed main of this project in the Interplane
54+ store, after `ipl verify` for the pinned owner. There is no schedule. Do not run `scripts/sync-to-hub.sh`.
5755 - Never commit `dist*/`, `target/`, tokens or SSH material.
5856
5957 ## Before requesting a release review

README.md

@@ -275,8 +275,8 @@ release mode and check the badge, the receipts, the installer and the claims tab
275275 status and refusal text. Its oracles are `sha256sum`, the published verifier run through `file://`,
276276 and, when given, the forge's own chain tool. It also runs `check-claims.sh`.
277277
278-`check-sync.sh` tests the retired publisher against three local git repositories with Radicle, the compiler,
279-the builder, `rsync` and `sudo` stubbed. Nothing in it contacts a server.
278+`check-sync.sh` runs the publisher against a local signed-store layout with `ipl verify`, the
279+compiler, the builder, `rsync` and `sudo` stubbed. Nothing in it contacts a server.
280280
281281 `check-render.sh` opens every built page in frames 1280, 390 and 360 px wide (`WIDTHS`) in a real
282282 browser and fails when a page is wider than the frame shows, when a header nav link is narrower than
@@ -303,17 +303,18 @@ Use the reviewed commit in the native owner-signed Interplane store and the plai
303303
304304 The following describes the old script and its tests, not the current publishing route.
305305
306-`scripts/sync-to-hub.sh [--log-dir DIR] COMMIT` publishes one approved commit. The full 40-digit
307-commit is required.
308-The script asks Radicle (`rad://z399yKvnXcBQNkKoq86iBDgTvQ5QV`, not the HTTP mirror) for the
309-canonical head and refuses unless it equals that commit and the source clone holds it. It then
310-exports exactly that commit, compiles with the pinned compiler, builds in release mode, verifies,
311-and refuses test-data output.
312-
313-There is no schedule. On the Spark the user service `aien-run-interplane-sync` watches the site
314-project's Radicle refs folder and starts the script when that folder changes. That service passes no
315-commit today, so each start ends at the usage refusal and publishes nothing until its owner passes
316-the approved commit.
306+`scripts/sync-to-hub.sh [--log-dir DIR] [COMMIT]` publishes the signed main of this project in the
307+Interplane store (`STORE`, default `~/interplane-store-owner`). It first runs
308+`ipl verify STORE interplane.io --expect-owner IPL_EXPECT_OWNER`; with no owner fingerprint in
309+`IPL_EXPECT_OWNER`, a project that does not verify, or an owner that is not the pinned one, it
310+refuses. A named COMMIT (full 40 digits) must equal the main that verify reports; with none, that
311+main is the commit. It then exports exactly that commit from the store's own repository (read in
312+place, never written), compiles with the pinned compiler, builds in release mode, verifies, and
313+refuses test-data output.
314+
315+There is no schedule. On the Spark the user service `aien-run-interplane-sync` watches the project's
316+`refs/heads` folder in the store and starts the script with no commit when that folder changes, so
317+each `ipl land` on main is published once it verifies.
317318
318319 Destinations, each with its own receipt (state, destination, digest, source commit, time) under
319320 `LOGDIR`:

content/_layout.html

@@ -2,7 +2,7 @@
22 <html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"><title>{{title}}</title><meta name="description" content="{{description}}"><meta name="theme-color" content="#0a0a0f"><link rel="canonical" href="{{canonical}}"><meta property="og:title" content="{{title}}"><meta property="og:description" content="{{description}}"><meta property="og:type" content="website"><meta property="og:url" content="{{canonical}}"><link rel="icon" type="image/svg+xml" href="/public/favicon.svg"><link rel="stylesheet" href="/public/style.css"></head>
33 <body><a class="skip" href="#main">Skip to content</a>{{#test_data}}
44 <p class="test-banner data-test-data">TEST DATA. The Hop values and receipts on this page are made up to check the builder. This is not a release.</p>{{/test_data}}
5-<header class="site-head"><div class="shell head-row"><a class="brand" translate="no" href="/" aria-label="Interplane home"><svg class="mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2v20M2 12h20M4.9 4.9l14.2 14.2M4.9 19.1L19.1 4.9" fill="none" stroke="currentColor" stroke-width="2"/></svg><span>interplane<i class="dot">.</i></span></a><nav aria-label="Main"><a href="/yard/">Yard</a><a href="/how-it-works/">How it works</a><a href="/evidence/">Evidence</a>{{#receipts}}<a href="/receipts/">Receipts</a>{{/receipts}}<a href="/mission/">Mission</a><a href="/ada/">ADA</a><a href="https://interplane.io/explore">Forge</a></nav><a class="button dark small" href="/contribute/">Contributions</a></div></header>
5+<header class="site-head"><div class="shell head-row"><a class="brand" translate="no" href="/" aria-label="Interplane home"><svg class="mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2v20M2 12h20M4.9 4.9l14.2 14.2M4.9 19.1L19.1 4.9" fill="none" stroke="currentColor" stroke-width="2"/></svg><span>interplane<i class="dot">.</i></span></a><nav aria-label="Main"><a href="/yard/">Yard</a><a href="/how-it-works/">How it works</a><a href="/evidence/">Evidence</a>{{#receipts}}<a href="/receipts/">Receipts</a>{{/receipts}}<a href="/mission/">Mission</a><a href="https://interplane.io/explore">Forge</a></nav><a class="button dark small" href="/contribute/">Contributions</a></div></header>
66 <main id="main" tabindex="-1">
77 {{main}}
88 </main>
@@ -10,7 +10,7 @@
1010 <div class="foot-top"><div class="foot-brand"><a class="brand" translate="no" href="/" aria-label="Interplane home"><svg class="mark" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2v20M2 12h20M4.9 4.9l14.2 14.2M4.9 19.1L19.1 4.9" fill="none" stroke="currentColor" stroke-width="2"/></svg><span>interplane<i class="dot">.</i></span></a><p>Good things come from unfinished things.</p><p class="rule-line">No proof. Not done.</p></div>
1111 <nav class="foot-cols" aria-label="Footer">
1212 <div><p class="foot-h">Interplane</p><a href="/yard/">The yard</a><a href="/how-it-works/">How it works</a><a href="/evidence/">Evidence</a>{{#receipts}}<a href="/receipts/">Receipts</a>{{/receipts}}<a href="/mission/">Mission</a><a href="/papers/">Papers</a><a href="/ada/">ADA</a><a href="/contribute/">Contributions</a><a href="/privacy/">Privacy</a><a href="/terms/">Terms</a></div>
13-<div><p class="foot-h">The forge</p><a href="/forge/">About the forge</a><a href="https://interplane.io/explore">Explore projects</a>{{#map}}<a href="https://interplane.io/galaxy/">The map</a>{{/map}}{{#hop}}<a href="/hop/">Hop for Mac</a>{{/hop}}<a href="/agents/">For agents</a></div>
13+<div><p class="foot-h">The forge</p><a href="/forge/">About the forge</a><a href="/omega/">Omega language</a><a href="https://interplane.io/explore">Explore projects</a>{{#map}}<a href="https://interplane.io/galaxy/">The map</a>{{/map}}{{#hop}}<a href="/hop/">Hop for Mac</a>{{/hop}}<a href="/agents/">For agents</a></div>
1414 <div><p class="foot-h">The protocol</p><a href="/protocol/">Overview</a><a href="/quick-start/">Quick start</a><a href="/concepts/">Concepts</a><a href="/adapter/">Writing an adapter</a><a href="/conformance/">Conformance</a><a href="/status/">Status</a></div>
1515 </nav></div>
1616 <p class="si-line">Interplane is part of <a href="/sovereign-intelligence/">Sovereign Intelligence&trade;</a>. SI means sovereign, not super: intelligence you own, run on hardware you own, and can check yourself.</p>

content/contribute/index.html

@@ -17,7 +17,7 @@ description: Contribution routes under construction, how to prepare a project, a
1717 <p>A clone copies source and history. It does not run the project.</p>
1818 <div class="box limits"><h3>Publishing is permanent</h3>
1919 <p>Once code is public, other computers may keep copies. Removing a listing cannot call those copies back. Inspect a project for passwords, keys and private material before publishing it.</p>
20-<p><span class="reg rule">The rule here</span> Interplane publishes reviewed changes through its Git repositories.</p>
20+<p><span class="reg rule">The rule here</span> Interplane is Interplane on Git. Radicle is not used.</p>
2121 <p><span class="reg rule">The rule here</span> If something published here is malware or is not the publisher's to share, this site can stop serving it, though copies may remain elsewhere.</p></div>
2222 <h2>Review and publication</h2>
2323 <p><span class="reg rule">The rule here</span> A project is added after a reviewer who did not write it reads an exact version, the checks run again from a clean copy, and a deliberately broken version fails them. A skipped check stays recorded as not run.</p>

content/forge/index.html

@@ -23,7 +23,7 @@ description: The Interplane forge is where public projects live with their histo
2323 <h2>Keep your own copy</h2>
2424 <p><span class="reg check">What you can check today</span> A project can be copied in full, history included, with plain Git and no account. A project's page on the forge gives the line for that project under Git over HTTPS. <a href="https://interplane.io/drakestapleton/interplane.io">This website's own project page</a></p>
2525
26-<div class="box note"><h3>Interplane on Git</h3><p><span class="reg rule">The rule here</span> Interplane publishes reviewed changes through its Git repositories.</p>
26+<div class="box note"><h3>Interplane on Git</h3><p><span class="reg rule">The rule here</span> Interplane is Interplane on Git. Radicle is not used.</p>
2727 <p><span class="reg build">Being built</span> Bazinga, zinga for short, Interplane's own protocol for keeping code and its history, is being written in Omega. It is not live yet.</p>
2828 <p><span class="reg rule">The rule here</span> The rule about who may add a change is ours, and it stays the same.</p></div>
2929 </div></div></section>

content/index.html

@@ -10,7 +10,7 @@ description: Interplane is a forge for Git repositories. Keep the repositories y
1010 <p class="term-note"><span class="reg rule">The rule here</span> A finished repository, a half-built agent experiment and an honest failure are each welcome. Work is called working only after someone who did not build it has run it again from a clean copy. <a href="#agent">Is your agent telling you the truth?</a></p>
1111 <p class="term-note"><span class="reg build">Being built</span> Public contributions and the open shelf are unavailable while the Interplane store migration is completed. <a href="/contribute/">Contribution status</a></p>
1212 <p class="term-note"><span class="reg build">Being built</span> Bringing a repository here with its commits is not open yet. Bazinga, zinga for short, Interplane's own protocol for keeping code and its history, is being written in Omega. <a href="#today">What runs here today and what is being built</a></p>
13-<div class="actions"><a class="button orange" href="/contribute/">Contribution status</a><a class="text-link" href="https://interplane.io/explore">Explore the projects <span aria-hidden="true">&rarr;</span></a></div>
13+<div class="actions"><a class="button orange" href="/contribute/">Contribution status</a><a class="text-link" href="https://interplane.io/explore">Explore the projects <span aria-hidden="true">&rarr;</span></a><a class="text-link" href="/omega/">Looking for the Omega language? <span aria-hidden="true">&rarr;</span></a></div>
1414 </div>
1515 <figure class="hero-art"><img class="big-art" src="/public/orbit.svg" alt="A code window, a broken satellite and an unfinished idea circling a blue planet" width="640" height="620"><img class="small-art" src="/public/orbit-small.svg" alt="A code window and a card that reads still has potential, circling a blue planet" width="360" height="300"></figure>
1616 </div></section>
@@ -93,7 +93,7 @@ description: Interplane is a forge for Git repositories. Keep the repositories y
9393 <p>Git is the other option. A clone is a full repository on your own machine, history included, and it keeps working without an account on a company's server.</p>
9494 <p><span class="reg check">What you can check today</span> Interplane is a forge for Git repositories, and it is itself two of them: the forge and this website. <a href="#charge">Who is in charge</a></p>
9595 <p><span class="reg rule">The rule here</span> This site can stop serving a project. It cannot call back the copies that other computers hold.</p>
96-<p id="today"><span class="reg rule">The rule here</span> Interplane publishes reviewed changes through its Git repositories.</p>
96+<p id="today"><span class="reg rule">The rule here</span> Interplane is Interplane on Git. Radicle is not used.</p>
9797 <p><span class="reg build">Being built</span> Bazinga, zinga for short, Interplane's own protocol for keeping code and its history, is being written in Omega. It is not live yet.</p>
9898 </div>
9999 </div></section>

content/llms.txt

@@ -7,6 +7,7 @@ Three registers are kept apart here and on the site: the rule (desk policy, not
77
88 ## What you can do here today
99
10+- Omega programming language home and where it lives now: https://interplane.io/omega/
1011 - List the public projects ({{yard.count}} as of {{yard.asof}}): https://interplane.io/explore
1112 The same list as a dated page on this site: https://interplane.io/yard/
1213 - Open a project page (files, history, the command that copies it). The pattern is https://interplane.io/drakestapleton/<project>
@@ -50,7 +51,7 @@ Interplane is a project on Interplane. The forge and this website are public Git
5051 The code does not live at this address alone. A clone is a full copy, and the pages of the forge and this website on the forge count the clones and fetches each has had over HTTPS: https://interplane.io/drakestapleton/interplane-forge and https://interplane.io/drakestapleton/interplane.io
5152 The rule: you do not need permission to change it. Clone it and change it, and keep or publish your version within its licence.
5253 The forge lists both repositories under one name today, drakestapleton. Pages: https://interplane.io/drakestapleton/interplane-forge and https://interplane.io/drakestapleton/interplane.io
53-The rule: Interplane publishes reviewed changes through its Git repositories.
54+The rule: Interplane is Interplane on Git. Radicle is not used.
5455
5556 ## Not available yet
5657

content/omega/index.html

new file mode 100644
@@ -0,0 +1,22 @@
1+title: Omega programming language: from a 408-byte seed | Interplane
2+description: Omega is a systems language with a compiler rebuilt from a 408-byte seed. Read the source, bootstrap challenge and limits. Omega's home is Interplane.
3+---
4+<section class="page-head"><div class="shell"><div class="col">
5+<span class="eyebrow">Omega programming language</span>
6+<h1>Omega: from a 408-byte seed to a compiler you can inspect.</h1>
7+<p class="lede">Omega is a systems language with a compiler written in Omega. Its bootstrap chain grows from a small hand-written loader into a compiler for AArch64 Linux.</p>
8+<div class="actions"><a class="button orange" href="https://interplane.io/drakestapleton/omega-mv">Read the source</a><a class="text-link" href="https://interplane.io/drakestapleton/omega-mv/blob/main/seed/challenge/CHALLENGE.md">Inspect the bootstrap challenge</a></div>
9+</div></div></section>
10+<section class="band"><div class="shell"><div class="col prose">
11+<h2>Where Omega lives now</h2>
12+<p>Omega's source and history live on Interplane, in the <a href="https://interplane.io/drakestapleton/omega-mv">omega-mv project</a>. The old GitHub addresses under aien-dev, including aien-dev/omega-mv, aien-dev/omega and the aien-dev Homebrew tap, are gone. If an older article, GitHub topic or search result sent you to one of them, start here.</p>
13+<h2>What you can do now</h2>
14+<p><span class="reg check">What you can check today</span> The project page shows the files, the history and the command that copies them. <a href="https://interplane.io/drakestapleton/omega-mv">The omega-mv project</a></p>
15+<p>The <a href="https://interplane.io/drakestapleton/omega-mv/blob/main/README.md">README</a> explains the supported machine, a small program and the current limits. The <a href="https://interplane.io/drakestapleton/omega-mv/blob/main/seed/README.md">seed walkthrough</a> describes the bootstrap stages and host dependencies.</p>
16+<p>Omega is research software. Migration from older C code is unfinished. The compiler's documented native profile is AArch64 Linux; other targets have separate qualification limits. Read the source's dated receipts before relying on a result.</p>
17+<h2>Downloads and installer</h2>
18+<p><span class="reg build">Being built</span> A packaged Omega download and an installer. Neither is published yet, and no release date is set. To try Omega today, build it from the source as the README describes.</p>
19+<h2>Follow the engineering</h2>
20+<p>The <a href="https://interplane.io/drakestapleton/omega-mv/blob/main/ENGINEERING-NOTES.md">engineering notes</a> record earlier work. The <a href="https://interplane.io/drakestapleton/omega-mv/tree/main/evidence">evidence directory</a> holds records tied to particular versions. A result applies to the version, machine and command named in its record.</p>
21+<p><a href="https://interplane.io/drakestapleton/omega-mv/blob/main/docs/ROADMAP-1.0.md">Read the road to 1.0</a>. Work described there is a plan until its implementation and checks are published.</p>
22+</div></div></section>

content/routes.txt

@@ -5,6 +5,7 @@
55 # site: main (interplane.io) or hopbot (hopbot.org, built only with Hop data).
66 # The last word makes an entry depend on optional data: hop, receipts, or install (content/hop.install.sh).
77 page main / content/index.html
8+page main /omega/ content/omega/index.html
89 page main /translate/ content/translate/index.html
910 page main /yard/ content/yard/index.html
1011 page main /how-it-works/ content/how-it-works/index.html

docs/CLAIMS.md

@@ -80,7 +80,7 @@ sentence as built, with tags removed.
8080 | claim | / | rule | A piece is published as working only after it has been run again. | Desk policy. This site cannot prove it. |
8181 | claim | / | rule | A project moves from the shelf to the forge's main table after a reviewer who did not write it has read an exact version, the checks have been run again from a clean copy, and a deliberately broken version has failed them. What is open for contributions today | Desk policy. This site cannot prove it. |
8282 | claim | / | rule | For the desk, a claim counts only when it comes with the exact command, its result and a fingerprint of what it produced. With those, the same version and the same tools, someone else can run it again. | Desk policy. This site cannot prove it. |
83-| claim | / | rule | Interplane publishes reviewed changes through its Git repositories. | Desk policy. This site cannot prove it. |
83+| claim | / | rule | Interplane is Interplane on Git. Radicle is not used. | Desk policy. This site cannot prove it. |
8484 | claim | / | rule | The person who wrote a change does not approve it. A second reviewer reads the exact change, and the checks are run again from a clean copy. How a change gets in | Desk policy. This site cannot prove it. |
8585 | claim | / | rule | The work is run again from a clean start by someone who did not build it. The record of a check is the exact command, what came back, and a fingerprint of the result. | Desk policy. This site cannot prove it. |
8686 | claim | / | rule | This site can stop serving a project. It cannot call back the copies that other computers hold. | Desk policy. This site cannot prove it. |
@@ -93,6 +93,8 @@ sentence as built, with tags removed.
9393 | claim | /agents/ | check | Read the same in JSON. The project list as JSON is https://interplane.io/explore.json . The project list, a project page and its releases answer in JSON when the request carries the header Accept: application/json . A project page also answers with .json on the end of its address, for example https://interplane.io/drakestapleton/hop.json | https://interplane.io/explore.json https://interplane.io/drakestapleton/hop.json |
9494 | claim | /concepts/ | build | A new Git home for the protocol repository. Its files are being moved there, and this site does not link them until that home answers. | Not live. |
9595 | claim | /conformance/ | build | A new Git home for the protocol repository. Its files are being moved there, and this site does not link them until that home answers. | Not live. |
96+| claim | /omega/ | build | A packaged Omega download and an installer. Neither is published yet, and no release date is set. To try Omega today, build it from the source as the README describes. | Not live. |
97+| claim | /omega/ | check | The project page shows the files, the history and the command that copies them. The omega-mv project | https://interplane.io/drakestapleton/omega-mv |
9698 | claim | /contribute/ | build | A public route for requesting that review on the forge is not open yet. | Not live. |
9799 | claim | /contribute/ | build | The open shelf and the bring, get and withdraw commands are unavailable in the current Interplane store. The contribution route is under construction. | Not live. |
98100 | claim | /contribute/ | check | Existing public repositories can be read and copied with Git. The project page gives its clone address. Explore the projects or open the Hop project . | https://interplane.io/explore https://interplane.io/drakestapleton/hop |
@@ -100,7 +102,7 @@ sentence as built, with tags removed.
100102 | claim | /contribute/ | rule | A project is added after a reviewer who did not write it reads an exact version, the checks run again from a clean copy, and a deliberately broken version fails them. A skipped check stays recorded as not run. | Desk policy. This site cannot prove it. |
101103 | claim | /contribute/ | rule | A recorded failure helps the next builder, and the agents that learn from public work, avoid repeating the same dead end. | Desk policy. This site cannot prove it. |
102104 | claim | /contribute/ | rule | If something published here is malware or is not the publisher's to share, this site can stop serving it, though copies may remain elsewhere. | Desk policy. This site cannot prove it. |
103-| claim | /contribute/ | rule | Interplane publishes reviewed changes through its Git repositories. | Desk policy. This site cannot prove it. |
105+| claim | /contribute/ | rule | Interplane is Interplane on Git. Radicle is not used. | Desk policy. This site cannot prove it. |
104106 | claim | /contribute/ | rule | What failed comes too. If you bring work here, you bring the failures with it, not only the work that almost made it, and you say what went wrong. This is required of people who build here. | Desk policy. This site cannot prove it. |
105107 | claim | /evidence/ | build | Catching an agent's "done" automatically. | Not live. |
106108 | claim | /evidence/ | build | Not live. Do not rely on it yet. | Not live. |
@@ -114,7 +116,7 @@ sentence as built, with tags removed.
114116 | claim | /forge/ | check | A project can be copied in full, history included, with plain Git and no account. A project's page on the forge gives the line for that project under Git over HTTPS. This website's own project page | https://interplane.io/drakestapleton/interplane.io |
115117 | claim | /forge/ | check | A project's page shows its files, its history and its downloads. Each of the 31 is a Git repository, listed by name in the yard. Explore the projects or read the list in the yard . | https://interplane.io/explore /yard/ |
116118 | claim | /forge/ | rule | A change gets in like this. Its author hands it over with the exact version and the checks they ran. A reviewer who did not write it reads that exact version. The checks are run again from a clean copy, and a deliberately broken version has to fail them. Then the desk adds it. A check that was not run is not counted as passed. | Desk policy. This site cannot prove it. |
117-| claim | /forge/ | rule | Interplane publishes reviewed changes through its Git repositories. | Desk policy. This site cannot prove it. |
119+| claim | /forge/ | rule | Interplane is Interplane on Git. Radicle is not used. | Desk policy. This site cannot prove it. |
118120 | claim | /forge/ | rule | The rule about who may add a change is ours, and it stays the same. | Desk policy. This site cannot prove it. |
119121 | claim | /hop/ | build | Hop as your checker | Not live. |
120122 | claim | /hop/ | check | You can copy Hop's Git repository from Interplane. Open the Hop project | https://interplane.io/drakestapleton/hop |

scripts/sync-to-hub.sh

@@ -2,20 +2,26 @@
22 # scripts/sync-to-hub.sh: publish ONE approved commit of interplane.io, and hopbot.org when that
33 # commit carries a Hop release. Runs on the Spark, which is also where hopbot.org is served.
44 #
5-# Usage: sh scripts/sync-to-hub.sh [--log-dir DIR] COMMIT
6-# COMMIT full 40-digit id (lower-case hex) of the approved commit. Required; no default.
5+# Usage: sh scripts/sync-to-hub.sh [--log-dir DIR] [COMMIT]
6+# COMMIT full 40-digit id (lower-case hex) of the commit to publish. It must be the signed
7+# main of the site project in the store. Without it, that signed main is published
8+# (this is how the service starts the script); either way step 1 decides.
79 # --log-dir DIR where the log, receipts, pending markers and the hopbot stage live. The LOGDIR
810 # setting does the same. Without either, the default folder is used and is written
911 # only when a transfer starts (see "The log" below).
1012 #
1113 # Order of work. Every refusal happens before a single file is transferred.
12-# 1. Canonical head. Asks Radicle, through the rad git helper, for refs/heads/main of the site
13-# project (rad://z399yKvnXcBQNkKoq86iBDgTvQ5QV). COMMIT must equal it. The HTTP mirror is
14-# never asked what the head is, so a mirror that lags cannot choose what gets published.
15-# 2. Source. Fetches into REPO and requires that REPO now holds COMMIT. A source that cannot
16-# supply the commit is a refusal, not a reason to build something older.
14+# 1. Signed head. Runs `IPL verify STORE interplane.io --expect-owner IPL_EXPECT_OWNER`. The
15+# project's signed chain must verify and its current owner must be the pinned owner (the
16+# fingerprint in IPL_EXPECT_OWNER, which must also agree with the owner-pins file ipl reads).
17+# IPL_EXPECT_OWNER unset or empty is a refusal: there is no default owner. verify must answer
18+# one line, `OK interplane.io ID main HEAD VISIBILITY OWNER SEQ CHAINHEAD`, naming that owner.
19+# HEAD is the store's refs/heads/main, which moves only through `ipl land` signed by the owner
20+# key. COMMIT must equal HEAD; without COMMIT, HEAD is the commit.
21+# 2. Source. The store's own repository for the project (STORE/projects/interplane.io/repo.git),
22+# read in place and never written: it must hold COMMIT. No clone, fetch or mirror is used.
1723 # 3. Build. Exports exactly that commit (git archive) into a scratch folder and builds there with
18-# the pinned compiler, then runs `site verify`. REPO's own checkout is never built or changed.
24+# the pinned compiler, then runs `site verify`. Nothing is built in the store.
1925 # 4. Test data. Refuses output that carries the fixture marker: a TEST-DATA file, a manifest line
2026 # naming it, or the banner attribute data-test-data in any HTML file.
2127 # 5. Destinations. Refuses a Hop release when the hopbot.org folder is missing on this machine.
@@ -46,8 +52,9 @@
4652 # USER ALL=(root) NOPASSWD: /usr/bin/rsync -rt --delete --chmod\=D755\,F644 --chown\=root\:root --exclude\=.well-known LOGDIR/hopbot.stage/ /var/www/hopbot.org/
4753 #
4854 # Settings:
49-# REPO clone that supplies the commit (default ~/workspace/web/interplane.io-live). When it
50-# does not exist it is cloned from the read-only mirror.
55+# STORE signed Interplane store (default ~/interplane-store-owner)
56+# IPL the ipl tool that verifies it (default ~/work/hive/agent-door/interplane-native/ipl)
57+# IPL_EXPECT_OWNER owner key fingerprint, SHA256:... Required; no default.
5158 # HUB ssh host for interplane.io (default hub)
5259 # WEBDIR document root for interplane.io on HUB (default /var/www/interplane.io)
5360 # HOPWEBDIR document root for hopbot.org on this machine (default /var/www/hopbot.org)
@@ -64,26 +71,24 @@
6471 # OMEGA_SRC local Omega checkout (default ~/workspace/omega-mv)
6572 #
6673 # How it is started: there is no schedule. The Spark user service aien-run-interplane-sync runs
67-# aien-onchange on the site project's Radicle refs folder and starts this script when that folder
68-# changes. That service passes no commit today, so until it is given the approved commit each
69-# start ends at the usage refusal and publishes nothing. A person can also run it by hand.
74+# aien-onchange on the project's refs/heads folder in the store and starts this script, with no
75+# commit, when that folder changes (and at least once a day). Each start publishes the verified
76+# signed main, or finds it unchanged. A person can also run it by hand.
7077 #
7178 # Other rules: never run while the Spark quiet flag is held (chip runs own the machine then).
7279 # No facts refresh and no last-good fallback: content/facts.json is part of the commit.
73-# Exit: 0 done or nothing to do, 2 usage, 3 compile, 4 build or verify, 5 canonical head or
80+# Exit: 0 done or nothing to do, 2 usage, 3 compile, 4 build or verify, 5 signed head or
7481 # source, 6 test data, 7 destination, 8 digest or transfer.
7582 set -eu
7683
77-RID=z399yKvnXcBQNkKoq86iBDgTvQ5QV
78-CANON="rad://$RID"
79-MIRROR="https://www.aienos.com/rad/$RID.git"
84+PROJECT=interplane.io
8085
8186 is_commit() {
8287 case "$1" in ''|*[!0-9a-f]*) return 1 ;; esac
8388 [ "${#1}" -eq 40 ]
8489 }
8590 usage() {
86- echo 'usage: sync-to-hub.sh [--log-dir DIR] COMMIT (the full 40-digit id of the approved commit)' >&2
91+ echo 'usage: sync-to-hub.sh [--log-dir DIR] [COMMIT] (the full 40-digit id of the signed main; default: the signed main)' >&2
8792 exit 2
8893 }
8994 LOGARG=
@@ -92,10 +97,16 @@ if [ "${1:-}" = --log-dir ]; then
9297 LOGARG=$2
9398 shift 2
9499 fi
95-if [ "$#" -ne 1 ] || ! is_commit "$1"; then usage; fi
96-COMMIT=$1
100+case $# in
101+ 0) COMMIT= ;;
102+ 1) is_commit "$1" || usage; COMMIT=$1 ;;
103+ *) usage ;;
104+esac
97105
98-REPO=${REPO:-"$HOME/workspace/web/interplane.io-live"}
106+STORE=${STORE:-"$HOME/interplane-store-owner"}
107+IPL=${IPL:-"$HOME/work/hive/agent-door/interplane-native/ipl"}
108+OWNER=${IPL_EXPECT_OWNER:-}
109+SRC="$STORE/projects/$PROJECT/repo.git"
99110 HUB=${HUB:-hub}
100111 WEBDIR=${WEBDIR:-/var/www/interplane.io}
101112 HOPWEBDIR=${HOPWEBDIR-/var/www/hopbot.org}
@@ -139,28 +150,30 @@ if command -v quietlock >/dev/null 2>&1 && ! quietlock check >/dev/null 2>&1; th
139150 exit 0
140151 fi
141152
142-# 1. The canonical head, from Radicle.
143-TAB=$(printf '\t')
144-CANON_OUT=$(git ls-remote "$CANON" refs/heads/main 2>>"$DETAIL") || refuse 5 "Radicle did not answer for the canonical head of $CANON"
145-CANON_HEAD=${CANON_OUT%%"$TAB"*}
146-if ! is_commit "$CANON_HEAD" || [ "$CANON_OUT" != "$CANON_HEAD${TAB}refs/heads/main" ]; then
147- refuse 5 "Radicle gave no single canonical head for $CANON"
153+# 1. The signed head, from the store, verified for the pinned owner.
154+[ -n "$OWNER" ] || refuse 5 "no owner is pinned for the publisher: set IPL_EXPECT_OWNER to the owner key fingerprint"
155+VERIFIED=$("$IPL" verify "$STORE" "$PROJECT" --expect-owner "$OWNER" 2>>"$DETAIL") ||
156+ refuse 5 "$PROJECT does not verify for owner $OWNER in $STORE"
157+set -f
158+# shellcheck disable=SC2086 # split the OK line into its fields
159+set -- $VERIFIED
160+set +f
161+if [ "$#" -ne 9 ] || [ "$1" != OK ] || [ "$2" != "$PROJECT" ] || [ "$4" != main ] || ! is_commit "$5" || [ "$7" != "$OWNER" ]; then
162+ refuse 5 "ipl verify gave no single OK line for $PROJECT main owned by $OWNER"
148163 fi
149-if [ "$CANON_HEAD" != "$COMMIT" ]; then
150- refuse 5 "$COMMIT is not the canonical head; Radicle says $CANON_HEAD"
164+if [ -z "$COMMIT" ]; then
165+ COMMIT=$5
166+ say "commit: the signed main of $PROJECT, $COMMIT"
167+elif [ "$COMMIT" != "$5" ]; then
168+ refuse 5 "$COMMIT is not the signed main of $PROJECT; the store says $5"
151169 fi
152170
153-# 2. The source must hold that commit.
154-if [ ! -d "$REPO/.git" ]; then
155- say "clone into $REPO"
156- git clone -q "$MIRROR" "$REPO" >>"$DETAIL" 2>&1 || refuse 5 "could not clone the source into $REPO"
157-fi
158-git -C "$REPO" fetch -q origin >>"$DETAIL" 2>&1 || refuse 5 "could not fetch the source in $REPO"
159-git -C "$REPO" cat-file -e "$COMMIT^{commit}" 2>>"$DETAIL" || refuse 5 "the source in $REPO cannot supply $COMMIT (it lags the canonical head)"
171+# 2. The store's repository must hold that commit. It is read in place, never written.
172+git --git-dir="$SRC" cat-file -e "$COMMIT^{commit}" 2>>"$DETAIL" || refuse 5 "the store repository $SRC cannot supply $COMMIT"
160173
161174 # 3. Build exactly that commit, away from any checkout.
162175 mkdir "$WORK/src"
163-git -C "$REPO" archive --format=tar -o "$WORK/src.tar" "$COMMIT" >>"$DETAIL" 2>&1 || refuse 5 "could not export $COMMIT"
176+git --git-dir="$SRC" archive --format=tar -o "$WORK/src.tar" "$COMMIT" >>"$DETAIL" 2>&1 || refuse 5 "could not export $COMMIT"
164177 tar -xf "$WORK/src.tar" -C "$WORK/src" >>"$DETAIL" 2>&1 || refuse 5 "could not unpack $COMMIT"
165178 cd "$WORK/src"
166179 BIN="$WORK/site-omega"

scripts/tests/check-sync.sh

@@ -1,10 +1,12 @@
11 #!/bin/sh
22 # Controls for scripts/sync-to-hub.sh. Nothing here contacts a server or writes outside its own
3-# temporary folder. git is the real git, working on three local repositories made here (the
4-# canonical history, a mirror that can lag it, and the publisher's clone); only the Radicle head
5-# query and the mirror clone address are answered by a wrapper. quietlock, uname, the compiler,
6-# the builder, rsync and sudo are stubs. The sudo stub replays the root copy into a temporary
7-# folder so that "the destination is empty" is measured, not assumed.
3+# temporary folder. git is the real git, working on local repositories made here (the history,
4+# and the project repository of a signed store that holds it); the git wrapper only traces calls
5+# and refuses any remote, clone, fetch or ref change. ipl is a stand-in for `ipl verify`: it answers
6+# with the real tool's OK line for the store's actual main, or refuses (exit 3) as the real tool
7+# does when the project does not verify or the owner asked for is not the pinned one. quietlock,
8+# uname, the compiler, the builder, rsync and sudo are stubs. The sudo stub replays the root copy
9+# into a temporary folder so that "the destination is empty" is measured, not assumed.
810 set -eu
911 ROOT=$(CDPATH= cd -- "$(dirname -- "$0")/../.." && pwd)
1012 TEST_ROOT=$(mktemp -d)
@@ -19,12 +21,14 @@ GIT_AUTHOR_NAME=fixture GIT_AUTHOR_EMAIL=fixture GIT_COMMITTER_NAME=fixture GIT_
1921 GIT_AUTHOR_DATE='2000-01-01T00:00:00Z' GIT_COMMITTER_DATE='2000-01-01T00:00:00Z'
2022 export TEST_ROOT REAL_SHA256 REAL_GIT REAL_RSYNC GIT_CONFIG_GLOBAL GIT_CONFIG_NOSYSTEM
2123 export GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_AUTHOR_DATE GIT_COMMITTER_DATE
22-RID=z399yKvnXcBQNkKoq86iBDgTvQ5QV
24+OWNER_FP=SHA256:FixtureOwnerKey0000000000000000000000000000
25+OTHER_FP=SHA256:SomeOtherOwnerKey11111111111111111111111111
2326 mkdir -p "$TEST_ROOT/bin"
2427
25-# ---- three local repositories: canonical history (A, then B, then C), a mirror, the clone
28+# ---- the history (A, then B, then C) and the signed store's repository for the project
2629 UP="$TEST_ROOT/upstream"
27-MIRROR="$TEST_ROOT/mirror.git"
30+STORE="$TEST_ROOT/store"
31+SRC="$STORE/projects/interplane.io/repo.git"
2832 mkdir -p "$UP/scripts" "$UP/native/lib" "$UP/content"
2933 "$REAL_GIT" -C "$UP" init -q
3034 "$REAL_GIT" -C "$UP" symbolic-ref HEAD refs/heads/main
@@ -42,31 +46,44 @@ A=$(commit release-a)
4246 B=$(commit release-b)
4347 printf 'note changed\n' >> "$UP/native/lib/sha2.om"
4448 C=$(commit release-c-with-a-changed-sha2-unit)
45-"$REAL_GIT" init -q --bare "$MIRROR"
46-"$REAL_GIT" -C "$MIRROR" symbolic-ref HEAD refs/heads/main
47-"$REAL_GIT" -C "$UP" push -q "$MIRROR" "$A:refs/heads/main"
48-mirror_to() { "$REAL_GIT" -C "$UP" push -q -f "$MIRROR" "$1:refs/heads/main"; }
49+"$REAL_GIT" init -q --bare "$SRC"
50+"$REAL_GIT" -C "$SRC" symbolic-ref HEAD refs/heads/main
51+"$REAL_GIT" -C "$UP" push -q "$SRC" "$A:refs/heads/main" "$C:refs/heads/history"
52+# store_main COMMIT: what `ipl land` would leave, the store's main at COMMIT
53+store_main() { "$REAL_GIT" -C "$SRC" update-ref refs/heads/main "$1"; }
4954
5055 cat > "$TEST_ROOT/bin/git" <<'STUB'
5156 #!/bin/sh
5257 set -eu
5358 printf 'git %s\n' "$*" >> "$TEST_ROOT/trace"
54-if [ "$1" = ls-remote ]; then
55- [ "$2" = rad://z399yKvnXcBQNkKoq86iBDgTvQ5QV ] && [ "$3" = refs/heads/main ] || { echo 'the canonical head was asked of something other than Radicle' >&2; exit 90; }
56- case "${STUB_CANON:-}" in
57- fail) exit 1 ;;
58- two) printf '%s\trefs/heads/main\n%s\trefs/heads/main\n' "$STUB_A" "$STUB_B" ;;
59- *) printf '%s\trefs/heads/main\n' "$STUB_CANON" ;;
59+for a in "$@"; do
60+ case "$a" in
61+ ls-remote|clone|fetch|pull|push|remote|update-ref|*://*) echo "git $a in deployment test: the source is the store, read in place" >&2; exit 90 ;;
6062 esac
61- exit 0
62-fi
63-if [ "$1" = clone ]; then
64- [ "$2" = -q ] && [ "$3" = https://www.aienos.com/rad/z399yKvnXcBQNkKoq86iBDgTvQ5QV.git ] || { echo 'unexpected clone address in deployment test' >&2; exit 90; }
65- exec "$REAL_GIT" clone -q "$TEST_ROOT/mirror.git" "$4"
66-fi
67-case "$*" in *://*) echo 'network address in deployment test' >&2; exit 90 ;; esac
63+done
6864 exec "$REAL_GIT" "$@"
6965 STUB
66+cat > "$TEST_ROOT/bin/ipl" <<'STUB'
67+#!/bin/sh
68+set -eu
69+printf 'ipl %s\n' "$*" >> "$TEST_ROOT/trace"
70+[ "$#" -eq 5 ] && [ "$1" = verify ] && [ "$2" = "$STORE" ] && [ "$3" = interplane.io ] && [ "$4" = --expect-owner ] || { echo 'unexpected ipl command' >&2; exit 90; }
71+# As the real tool: exit 3 when the owner asked for is not the pinned owner, or nothing verifies.
72+[ "$5" = "$OWNER_FP" ] || { printf 'ipl: current owner pin is %s, not %s\n' "$OWNER_FP" "$5" >&2; exit 3; }
73+[ "${STUB_IPL:-ok}" != fail ] || { echo 'ipl: interplane.io: does not verify: fixture' >&2; exit 3; }
74+HEAD=$("$REAL_GIT" --git-dir="$STORE/projects/interplane.io/repo.git" rev-parse refs/heads/main)
75+ID=$(printf '%064d' 1) CH=$(printf '%064d' 2)
76+ok() { printf 'OK %s %s %s %s public %s 8 %s\n' "$1" "$ID" "$2" "$HEAD" "$3" "$CH"; }
77+case "${STUB_IPL:-ok}" in
78+ ok) ok interplane.io main "$5" ;;
79+ other-owner) ok interplane.io main "$OTHER_FP" ;;
80+ other-project) ok interplane-forge main "$5" ;;
81+ other-branch) ok interplane.io next "$5" ;;
82+ two) ok interplane.io main "$5"; ok interplane.io main "$5" ;;
83+ empty) ;;
84+ *) exit 95 ;;
85+esac
86+STUB
7087 cat > "$TEST_ROOT/bin/quietlock" <<'STUB'
7188 #!/bin/sh
7289 exit "${STUB_QUIET:-0}"
@@ -150,28 +167,26 @@ STUB
150167 chmod +x "$TEST_ROOT/bin/"* "$TEST_ROOT/compiler"
151168 PATH="$TEST_ROOT/bin:$PATH"
152169 OMC="$TEST_ROOT/compiler"
153-REPO="$TEST_ROOT/repo"
170+IPL="$TEST_ROOT/bin/ipl"
154171 HUB=fixture-hub
155172 WEBDIR=/fixture-web
156-STUB_A=$A STUB_B=$B
157-export PATH OMC REPO HUB WEBDIR STUB_A STUB_B
158-unset OMC_RUNNER
159-"$REAL_GIT" clone -q "$MIRROR" "$REPO"
173+export PATH OMC IPL STORE OWNER_FP OTHER_FP HUB WEBDIR
174+unset OMC_RUNNER IPL_OWNER_PINS
160175
161176 N=0
162177 passed() { N=$((N + 1)); printf 'PASS control %02d: %s\n' "$N" "$1"; }
163178 fail() { printf 'FAIL control: %s\n' "$1" >&2; exit 1; }
164179 # prepare NAME: a new receipt folder and hopbot.org folder, every stub at its quiet default,
165-# the mirror and the clone as the previous control left them.
180+# the store's main at A and the pinned owner set.
166181 prepare() {
167182 LOGDIR="$TEST_ROOT/log-$1"
168183 HOPWEBDIR="$TEST_ROOT/www-$1/hopbot.org"
169184 mkdir -p "$HOPWEBDIR"
170- STUB_CANON=$A
185+ store_main "$A"; STUB_IPL=ok; IPL_EXPECT_OWNER=$OWNER_FP
171186 STUB_QUIET=0 STUB_BAD_COMPILER=0 STUB_HASH_FAIL=0 STUB_COMPILE_FAIL=0 STUB_BUILD_FAIL=0
172187 STUB_VERIFY_FAIL=0 STUB_RSYNC_FAIL=0 STUB_SUDO_FAIL=0 STUB_MACHINE=aarch64 STUB_ASSET=base
173188 STUB_HOP=0 STUB_TESTDATA=
174- export LOGDIR HOPWEBDIR STUB_CANON STUB_QUIET STUB_BAD_COMPILER STUB_HASH_FAIL STUB_COMPILE_FAIL
189+ export LOGDIR HOPWEBDIR STUB_IPL IPL_EXPECT_OWNER STUB_QUIET STUB_BAD_COMPILER STUB_HASH_FAIL STUB_COMPILE_FAIL
175190 export STUB_BUILD_FAIL STUB_VERIFY_FAIL STUB_RSYNC_FAIL STUB_SUDO_FAIL STUB_MACHINE STUB_ASSET
176191 export STUB_HOP STUB_TESTDATA
177192 : > "$TEST_ROOT/trace"
@@ -180,9 +195,9 @@ again() { : > "$TEST_ROOT/trace"; }
180195 run() { RC=0; sh "$ROOT/scripts/sync-to-hub.sh" "$@" > "$TEST_ROOT/stdout" 2> "$TEST_ROOT/stderr" || RC=$?; }
181196 transfers() { grep -c -e '^rsync ' -e '^sudo ' "$TEST_ROOT/trace" || :; }
182197 no_transfer() { [ "$(transfers)" -eq 0 ] || fail "$1: a transfer was started"; }
183-# refused NAME CODE TEXT COMMIT: that exit code, the reason in the output, no transfer, no receipt
198+# refused NAME CODE TEXT [COMMIT]: that exit code, the reason in the output, no transfer, no receipt
184199 refused() {
185- run "$4"
200+ run ${4:+"$4"}
186201 [ "$RC" -eq "$2" ] || { cat "$TEST_ROOT/stdout" "$TEST_ROOT/stderr" >&2; fail "$1: expected exit $2, got $RC"; }
187202 grep -q -- "$3" "$TEST_ROOT/stdout" "$TEST_ROOT/stderr" || { cat "$TEST_ROOT/stdout" "$TEST_ROOT/stderr" >&2; fail "$1: the refusal does not say: $3"; }
188203 no_transfer "$1"
@@ -203,12 +218,11 @@ SUDO_LINE() { printf 'sudo -n /usr/bin/rsync -rt --delete --chmod=D755,F644 --ch
203218 prepare usage
204219 for bad in '' "${A%????????}" "$(printf %s "$A" | tr a-f A-F)x" main; do
205220 RC=0
206- if [ -z "$bad" ]; then sh "$ROOT/scripts/sync-to-hub.sh" > "$TEST_ROOT/stdout" 2> "$TEST_ROOT/stderr" || RC=$?
207- else sh "$ROOT/scripts/sync-to-hub.sh" "$bad" > "$TEST_ROOT/stdout" 2> "$TEST_ROOT/stderr" || RC=$?; fi
208- [ "$RC" -eq 2 ] && grep -q '^usage: sync-to-hub.sh \[--log-dir DIR\] COMMIT' "$TEST_ROOT/stderr" || fail "commit argument '$bad' gave exit $RC"
221+ sh "$ROOT/scripts/sync-to-hub.sh" "$bad" > "$TEST_ROOT/stdout" 2> "$TEST_ROOT/stderr" || RC=$?
222+ [ "$RC" -eq 2 ] && grep -q '^usage: sync-to-hub.sh \[--log-dir DIR\] \[COMMIT\]' "$TEST_ROOT/stderr" || fail "commit argument '$bad' gave exit $RC"
209223 [ ! -s "$TEST_ROOT/trace" ] && [ ! -e "$LOGDIR" ] || fail "a usage refusal did some work"
210224 done
211-passed 'no commit, a short commit, a malformed commit and a branch name are usage refusals, exit 2, before any work'
225+passed 'an empty, a short and a malformed commit and a branch name are usage refusals, exit 2, before any work'
212226 run "$A" extra; [ "$RC" -eq 2 ] && [ ! -s "$TEST_ROOT/trace" ] || fail "two arguments gave exit $RC"
213227 passed 'a second argument is a usage refusal, exit 2'
214228
@@ -218,63 +232,87 @@ run "$A"
218232 [ "$RC" -eq 0 ] && [ ! -s "$TEST_ROOT/trace" ] || fail 'quiet flag did not skip'
219233 passed 'quiet flag held: skipped before any work'
220234
221-# ---- the canonical head comes from Radicle and must equal the approved commit
222-prepare canon-silent; STUB_CANON=fail
223-refused 'Radicle gives no answer for the canonical head' 5 'Radicle did not answer' "$A"
224-grep -q "^git ls-remote rad://$RID refs/heads/main$" "$TEST_ROOT/trace" || fail 'the canonical head was not asked of Radicle'
225-if grep -q -e '^git fetch' -e '^git clone' "$TEST_ROOT/trace"; then fail 'the source was fetched before the canonical head was known'; fi
226-prepare canon-two; STUB_CANON=two
227-refused 'Radicle answers with two heads' 5 'no single canonical head' "$A"
228-prepare canon-other; STUB_CANON=$B
229-refused 'approved commit is not the canonical head (the canonical head moved on)' 5 'is not the canonical head' "$A"
230-if grep -q -e '^git fetch' -e '^compile$' "$TEST_ROOT/trace"; then fail 'a commit that is not canonical reached fetch or compile'; fi
231-
232-# The reviewer's case: canonical main is ahead, the mirror still serves the old head and builds fine.
233-prepare stale-mirror; STUB_CANON=$B
234-refused 'canonical head ahead of a stale mirror: the source cannot supply the approved commit' 5 'cannot supply' "$B"
235-if grep -q '^compile$' "$TEST_ROOT/trace"; then fail 'the stale source was compiled'; fi
236-[ "$("$REAL_GIT" -C "$REPO" rev-parse HEAD)" = "$A" ] || fail 'the clone is not at the stale head this control expects'
235+# ---- the signed head: ipl verify of the store for the pinned owner, and COMMIT is the store's main
236+VERIFY_LINE="ipl verify $STORE interplane.io --expect-owner $OWNER_FP"
237+no_export() { if grep -q -e ' archive ' -e '^compile$' "$TEST_ROOT/trace"; then fail "$1: the source was exported or compiled"; fi; }
238+prepare owner-unset; store_main "$B"; unset IPL_EXPECT_OWNER
239+refused 'no owner pinned (IPL_EXPECT_OWNER unset)' 5 'no owner is pinned' "$B"
240+if grep -q '^ipl ' "$TEST_ROOT/trace"; then fail 'ipl was run with no owner pinned'; fi
241+no_export 'owner unset'
242+prepare owner-empty; store_main "$B"; IPL_EXPECT_OWNER=
243+refused 'no owner pinned (IPL_EXPECT_OWNER empty)' 5 'no owner is pinned' "$B"
244+prepare owner-unset-nocommit; store_main "$B"; unset IPL_EXPECT_OWNER
245+refused 'no owner pinned and no commit named' 5 'no owner is pinned'
246+no_export 'owner unset, no commit'
247+prepare verify-refused; store_main "$B"; STUB_IPL=fail
248+refused 'the store project does not verify (ipl exit 3)' 5 'does not verify for owner' "$B"
249+no_export 'verify refused'
250+prepare verify-refused-nocommit; store_main "$B"; STUB_IPL=fail
251+refused 'the store project does not verify and no commit named' 5 'does not verify for owner'
252+no_export 'verify refused, no commit'
253+prepare owner-mismatch; store_main "$B"; IPL_EXPECT_OWNER=$OTHER_FP
254+refused 'pinned owner is not the current owner (ipl refuses --expect-owner)' 5 'does not verify for owner' "$B"
255+grep -q 'current owner pin is' "$LOGDIR/sync.log" || fail 'the owner mismatch from ipl is not in the log'
256+no_export 'owner mismatch'
257+prepare owner-reported-other; store_main "$B"; STUB_IPL=other-owner
258+refused 'verify names a current owner other than the pinned one' 5 'no single OK line' "$B"
259+no_export 'other owner reported'
260+for kind in other-project other-branch two empty; do
261+ prepare "verify-$kind"; store_main "$B"; STUB_IPL=$kind
262+ refused "verify answer is not one OK line for interplane.io main ($kind)" 5 'no single OK line' "$B"
263+ no_export "verify $kind"
264+done
265+prepare ipl-missing; store_main "$B"; IPL="$TEST_ROOT/absent-ipl"
266+refused 'ipl missing' 5 'does not verify for owner' "$B"
267+IPL="$TEST_ROOT/bin/ipl"
268+prepare not-main; store_main "$B"
269+refused 'commit that is not the store main (main moved on)' 5 'is not the signed main' "$A"
270+grep -Fxq "$VERIFY_LINE" "$TEST_ROOT/trace" || fail 'the head was not taken from ipl verify of the store for the pinned owner'
271+no_export 'not main'
272+prepare not-landed; store_main "$A"
273+refused 'commit ahead of the store main (not landed)' 5 'is not the signed main' "$B"
274+no_export 'not landed'
237275
238-# ---- the mirror catches up: exactly the approved commit is built, whatever the clone has checked out
239-mirror_to "$B"
240-printf 'local edit that must never be published\n' > "$REPO/content/marker.txt"
241-prepare exact-commit; STUB_CANON=$B
276+# ---- exactly the signed main is built, read in place from the store, which is left as it was
277+prepare exact-commit; store_main "$B"
278+"$REAL_GIT" -C "$SRC" for-each-ref > "$TEST_ROOT/refs.before"
279+: > "$TEST_ROOT/store.mark"
242280 published "$B"
243-grep -q '<p>release-b</p>' "$TEST_ROOT/built-index" || fail 'the page was not built from the approved commit'
244-[ "$("$REAL_GIT" -C "$REPO" rev-parse HEAD)" = "$A" ] || fail 'the publisher moved the checkout of the clone'
245-grep -q 'local edit' "$REPO/content/marker.txt" || fail 'the publisher changed a file in the clone'
281+grep -q '<p>release-b</p>' "$TEST_ROOT/built-index" || fail 'the page was not built from the signed main'
282+[ "$(sed -n 1p "$TEST_ROOT/trace")" = "$VERIFY_LINE" ] || fail 'ipl verify was not the first step'
283+grep -Fq "git --git-dir=$SRC archive --format=tar " "$TEST_ROOT/trace" || fail 'the source was not exported from the store'
284+"$REAL_GIT" -C "$SRC" for-each-ref | cmp -s - "$TEST_ROOT/refs.before" || fail 'the publisher changed a ref in the store'
285+[ -z "$(find "$STORE" -newer "$TEST_ROOT/store.mark" -print)" ] || fail 'the publisher wrote into the store'
286+if grep -q -e 'rad:' -e 'ls-remote' -e ' clone ' -e ' fetch ' "$TEST_ROOT/trace"; then fail 'the publisher asked a remote'; fi
246287 receipt interplane.io published fixture-hub:/fixture-web "$B"
247-passed 'builds an export of the approved commit: an old, edited checkout in the clone is neither built nor changed'
248-"$REAL_GIT" -C "$REPO" checkout -q -- content/marker.txt
288+passed 'signed main named: verify first, then an export of exactly that commit from the store; the store is not written and no remote is asked'
249289
250-prepare fresh-clone; STUB_CANON=$B
251-REPO="$TEST_ROOT/new-clone"
252-published "$B"
253-grep -Fq "git clone -q https://www.aienos.com/rad/$RID.git " "$TEST_ROOT/trace" || fail 'a missing clone was not made from the read-only mirror'
254-grep -q '<p>release-b</p>' "$TEST_ROOT/built-index" || fail 'fresh clone: wrong commit built'
255-REPO="$TEST_ROOT/repo"
256-passed 'a missing clone is made from the read-only mirror, and still only the approved commit is built'
290+prepare no-commit; store_main "$B"
291+run
292+[ "$RC" -eq 0 ] || { cat "$TEST_ROOT/stdout" "$TEST_ROOT/stderr" >&2; fail "no commit named: expected a publish, got exit $RC"; }
293+grep -q "commit: the signed main of interplane.io, $B" "$TEST_ROOT/stdout" && grep -q '<p>release-b</p>' "$TEST_ROOT/built-index" || fail 'no commit named: the signed main was not the commit built'
294+receipt interplane.io published fixture-hub:/fixture-web "$B"
295+passed 'no commit named (the service start): the verified signed main is resolved, built and published'
257296
258297 # ---- compiler, build, verify and digest refusals
259-prepare bad-compiler; STUB_CANON=$B; STUB_BAD_COMPILER=1
298+prepare bad-compiler; store_main "$B"; STUB_BAD_COMPILER=1
260299 refused 'compiler with the wrong SHA-256' 3 'compilation failed' "$B"
261300 if grep -q '^compile$' "$TEST_ROOT/trace"; then fail 'a compiler with the wrong hash was run'; fi
262-prepare missing-compiler; STUB_CANON=$B; OMC="$TEST_ROOT/absent"
301+prepare missing-compiler; store_main "$B"; OMC="$TEST_ROOT/absent"
263302 refused 'missing compiler' 3 'compilation failed' "$B"
264303 OMC="$TEST_ROOT/compiler"
265-prepare compile-failed; STUB_CANON=$B; STUB_COMPILE_FAIL=1
304+prepare compile-failed; store_main "$B"; STUB_COMPILE_FAIL=1
266305 refused 'compilation failure' 3 'compilation failed' "$B"
267-prepare build-failed; STUB_CANON=$B; STUB_BUILD_FAIL=1
306+prepare build-failed; store_main "$B"; STUB_BUILD_FAIL=1
268307 refused 'build failure' 4 'native build failed' "$B"
269-prepare verify-failed; STUB_CANON=$B; STUB_VERIFY_FAIL=1
308+prepare verify-failed; store_main "$B"; STUB_VERIFY_FAIL=1
270309 refused 'verify failure' 4 'verify failed' "$B"
271-prepare hash-failed; STUB_CANON=$B; STUB_HASH_FAIL=1
310+prepare hash-failed; store_main "$B"; STUB_HASH_FAIL=1
272311 refused 'digest failure' 8 'could not take the digest' "$B"
273-mirror_to "$C"
274-prepare changed-sha2; STUB_CANON=$C
312+prepare changed-sha2; store_main "$C"
275313 refused 'commit whose SHA-2 unit is not the pinned one' 3 'compilation failed' "$C"
276314 if grep -q '^compile$' "$TEST_ROOT/trace"; then fail 'a changed SHA-2 unit reached the compiler'; fi
277-prepare unit-composition; STUB_CANON=$B
315+prepare unit-composition; store_main "$B"
278316 published "$B"
279317 "$REAL_GIT" -C "$UP" show "$B:native/lib/sha2.om" > "$TEST_ROOT/sha2.b"
280318 "$REAL_GIT" -C "$UP" show "$B:native/site.om" > "$TEST_ROOT/site.b"
@@ -285,14 +323,14 @@ passed "compiler input is the om2 line, the commit's SHA-2 unit, then the commit
285323
286324 # ---- fixture output is never published
287325 for kind in file manifest banner; do
288- prepare "testdata-$kind"; STUB_CANON=$B; STUB_TESTDATA=$kind
326+ prepare "testdata-$kind"; store_main "$B"; STUB_TESTDATA=$kind
289327 refused "fixture output ($kind marker) in the interplane.io build" 6 'fixture output is never published' "$B"
290328 done
291-prepare testdata-hop; STUB_CANON=$B; STUB_HOP=1; STUB_TESTDATA=hopfile
329+prepare testdata-hop; store_main "$B"; STUB_HOP=1; STUB_TESTDATA=hopfile
292330 refused 'fixture output (file marker) in the hopbot.org build' 6 'fixture output is never published' "$B"
293331
294332 # ---- interplane.io: transfer, receipt, unchanged, pending
295-prepare publish; STUB_CANON=$B
333+prepare publish; store_main "$B"
296334 published "$B"
297335 grep -q '^rsync -a --delete --exclude .well-known .*/dist/ fixture-hub:/fixture-web/$' "$TEST_ROOT/trace" || fail 'transfer options or destination differ'
298336 [ "$(transfers)" -eq 1 ] || fail 'a build without a Hop release made more than one transfer'
@@ -320,20 +358,18 @@ STUB_ASSET=changed-again; again; published "$B"
320358 passed 'the later release is then published'
321359
322360 # A receipt belongs to one commit: the same bytes from another commit are transferred and recorded anew.
323-prepare commit-bound; STUB_CANON=$A
324-mirror_to "$B"
361+prepare commit-bound; store_main "$A"
325362 published "$A"
326363 E=$("$REAL_GIT" -C "$UP" commit-tree -p "$B" -m 'same tree as A' "$A^{tree}")
327364 "$REAL_GIT" -C "$UP" update-ref refs/heads/same-tree "$E"
328-mirror_to "$E"
329-STUB_CANON=$E; again; published "$E"
365+"$REAL_GIT" -C "$UP" push -q "$SRC" "$E:refs/heads/same-tree"
366+store_main "$E"; again; published "$E"
330367 [ "$(transfers)" -eq 1 ] || fail 'a new commit with the same content was not transferred'
331368 receipt interplane.io published fixture-hub:/fixture-web "$E"
332369 passed 'a new approved commit with identical content is transferred and its receipt names the new commit'
333-mirror_to "$B"
334370
335371 # ---- destinations: interplane.io
336-prepare main-dest; STUB_CANON=$B
372+prepare main-dest; store_main "$B"
337373 published "$B"
338374 WEBDIR=/fixture-web-two; again; published "$B"
339375 grep -q ' fixture-hub:/fixture-web-two/$' "$TEST_ROOT/trace" && grep -q 'destination changed from fixture-hub:/fixture-web to fixture-hub:/fixture-web-two' "$TEST_ROOT/stdout" || fail 'changed interplane.io destination was skipped'
@@ -342,12 +378,12 @@ WEBDIR=/fixture-web
342378 passed 'interplane.io destination change: the same content is transferred to the new destination and the receipt names it'
343379
344380 # ---- destinations: hopbot.org, on this machine, by one root command
345-prepare hop-missing; STUB_CANON=$B; STUB_HOP=1; rmdir "$HOPWEBDIR"
381+prepare hop-missing; store_main "$B"; STUB_HOP=1; rmdir "$HOPWEBDIR"
346382 refused 'Hop release while the hopbot.org folder is missing' 7 'hopbot.org folder is missing' "$B"
347-prepare hop-unnamed; STUB_CANON=$B; STUB_HOP=1; HOPWEBDIR=
383+prepare hop-unnamed; store_main "$B"; STUB_HOP=1; HOPWEBDIR=
348384 refused 'Hop release while HOPWEBDIR is empty' 7 'hopbot.org folder is missing' "$B"
349385
350-prepare hop; STUB_CANON=$B; STUB_HOP=1
386+prepare hop; store_main "$B"; STUB_HOP=1
351387 published "$B"
352388 [ "$(grep -c '^rsync ' "$TEST_ROOT/trace")" -eq 1 ] && [ "$(grep -c '^sudo ' "$TEST_ROOT/trace")" -eq 1 ] || fail 'a Hop release must make one hub transfer and one root copy'
353389 grep -Fxq "$(SUDO_LINE)" "$TEST_ROOT/trace" || { cat "$TEST_ROOT/trace" >&2; fail 'the root command is not the one documented command'; }
@@ -361,7 +397,7 @@ no_transfer 'unchanged with Hop'
361397 passed 'same Hop release again: neither destination is transferred'
362398
363399 # The reviewer's case: the content was already published when the Hop destination comes into play.
364-prepare enable; STUB_CANON=$B
400+prepare enable; store_main "$B"
365401 published "$B"
366402 [ "$(transfers)" -eq 1 ] && [ ! -e "$LOGDIR/receipt.hopbot.org" ] || fail 'enable-after-skip: unexpected first run'
367403 STUB_HOP=1; again; published "$B"
@@ -370,7 +406,7 @@ grep -q '^.* unchanged: interplane.io' "$TEST_ROOT/stdout" || fail 'enable-after
370406 receipt hopbot.org published "local:$HOPWEBDIR" "$B"
371407 passed 'enable after skip: interplane.io unchanged and skipped, the newly enabled hopbot.org destination is still transferred'
372408
373-prepare hop-fail; STUB_CANON=$B; STUB_HOP=1; STUB_SUDO_FAIL=1
409+prepare hop-fail; store_main "$B"; STUB_HOP=1; STUB_SUDO_FAIL=1
374410 run "$B"
375411 [ "$RC" -eq 8 ] && [ -f "$LOGDIR/pending.hopbot.org" ] && [ ! -e "$LOGDIR/receipt.hopbot.org" ] || fail 'failed root copy: wrong exit, receipt or marker'
376412 receipt interplane.io published fixture-hub:/fixture-web "$B"
@@ -379,7 +415,7 @@ STUB_SUDO_FAIL=0; again; published "$B"
379415 receipt hopbot.org published "local:$HOPWEBDIR" "$B"
380416 passed 'a failed root copy exits 8 with interplane.io receipted and hopbot.org pending; the retry transfers hopbot.org alone'
381417
382-prepare hop-dest; STUB_CANON=$B; STUB_HOP=1
418+prepare hop-dest; store_main "$B"; STUB_HOP=1
383419 published "$B"
384420 OLDHOP=$HOPWEBDIR
385421 HOPWEBDIR="$TEST_ROOT/www-hop-dest/hopbot-two"; mkdir -p "$HOPWEBDIR"
@@ -391,7 +427,7 @@ receipt hopbot.org published "local:$HOPWEBDIR" "$B"
391427 passed 'hopbot.org destination change: the same content is transferred to the new folder; the old folder is left as it was and the log says so'
392428
393429 # ---- withdrawal
394-prepare withdraw; STUB_CANON=$B; STUB_HOP=1
430+prepare withdraw; store_main "$B"; STUB_HOP=1
395431 published "$B"
396432 [ -f "$HOPWEBDIR/index.html" ] || fail 'withdrawal control: nothing was published first'
397433 STUB_HOP=0; again; published "$B"
@@ -408,7 +444,7 @@ STUB_HOP=2; again; published "$B"
408444 receipt hopbot.org published "local:$HOPWEBDIR" "$B"
409445 passed 'a Hop release after a withdrawal is published again'
410446
411-prepare withdraw-missing; STUB_CANON=$B; STUB_HOP=1
447+prepare withdraw-missing; store_main "$B"; STUB_HOP=1
412448 published "$B"
413449 cp "$LOGDIR/receipt.hopbot.org" "$TEST_ROOT/hop-receipt"
414450 STUB_HOP=0; HOPWEBDIR="$TEST_ROOT/www-withdraw-missing/elsewhere"; mkdir -p "$HOPWEBDIR"; again; run "$B"
@@ -420,26 +456,26 @@ no_transfer 'withdrawal with a missing folder'; cmp "$LOGDIR/receipt.hopbot.org"
420456 passed 'withdrawal is refused, exit 7, with no transfer and the receipt kept, when HOPWEBDIR names another folder or the folder is missing'
421457
422458 # ---- the log: a run that names no folder leaves the default (live) folder alone unless it publishes
423-prepare log-default; STUB_CANON=$B
459+prepare log-default; store_main "$B"
424460 OLDHOME=$HOME; HOME="$TEST_ROOT/home-log"; mkdir -p "$HOME"; export HOME
425461 LIVE="$HOME/.local/share/interplane-site"
426462 unset LOGDIR
427463 run "$A"
428-[ "$RC" -eq 5 ] && grep -q 'is not the canonical head' "$TEST_ROOT/stdout" || fail "default log folder: expected refusal 5, got $RC"
464+[ "$RC" -eq 5 ] && grep -q 'is not the signed main' "$TEST_ROOT/stdout" || fail "default log folder: expected refusal 5, got $RC"
429465 grep -q 'not logged: no log folder was named' "$TEST_ROOT/stderr" || fail 'the refusal does not say that it was not logged'
430466 [ ! -e "$LIVE" ] || fail 'a refused run that named no log folder wrote to the default log folder'
431-passed 'no log folder named: a refusal (approved commit is not the canonical head) is printed, exit 5, and the default log folder is not created or written'
467+passed 'no log folder named: a refusal (commit is not the signed main) is printed, exit 5, and the default log folder is not created or written'
432468 STUB_QUIET=1; run "$B"; STUB_QUIET=0
433469 [ "$RC" -eq 0 ] && [ ! -e "$LIVE" ] || fail 'the quiet-flag skip wrote to the default log folder'
434470 passed 'no log folder named: the quiet-flag skip leaves the default log folder alone'
435471 NAMEDDIR="$TEST_ROOT/log-named"
436472 run --log-dir "$NAMEDDIR" "$A"
437-[ "$RC" -eq 5 ] && grep -q 'refuse: .* is not the canonical head' "$NAMEDDIR/sync.log" || fail '--log-dir: the refusal is not in the named log'
473+[ "$RC" -eq 5 ] && grep -q 'refuse: .* is not the signed main' "$NAMEDDIR/sync.log" || fail '--log-dir: the refusal is not in the named log'
438474 [ ! -e "$LIVE" ] || fail '--log-dir: the default log folder was written'
439475 passed '--log-dir DIR: the same refusal is recorded in DIR/sync.log and the default folder stays untouched'
440476 LOGDIR="$TEST_ROOT/log-env"; export LOGDIR
441477 run "$A"
442-[ "$RC" -eq 5 ] && grep -q 'refuse: .* is not the canonical head' "$LOGDIR/sync.log" || fail 'LOGDIR: the refusal is not in the named log'
478+[ "$RC" -eq 5 ] && grep -q 'refuse: .* is not the signed main' "$LOGDIR/sync.log" || fail 'LOGDIR: the refusal is not in the named log'
443479 [ ! -e "$LIVE" ] || fail 'LOGDIR: the default log folder was written'
444480 passed 'LOGDIR set: the refusal is recorded there'
445481 unset LOGDIR; again
@@ -455,7 +491,7 @@ HOME=$OLDHOME; export HOME
455491 LOGDIR="$TEST_ROOT/log-after"; export LOGDIR
456492
457493 # ---- the default compiler lookup is local and still passes the checksum gate
458-prepare default-compiler; STUB_CANON=$B
494+prepare default-compiler; store_main "$B"
459495 OMEGA_SRC="$TEST_ROOT/omega"
460496 export OMEGA_SRC
461497 mkdir -p "$OMEGA_SRC/seed/out"
@@ -465,4 +501,4 @@ published "$B"
465501 [ "$(transfers)" -eq 1 ] || fail 'default compiler lookup did not publish'
466502 passed 'default compiler lookup'
467503
468-printf 'RESULT pass=%d fail=0 (publisher controls; git is real and local, Radicle, compiler, builder, rsync and sudo are stubbed)\n' "$N"
504+printf 'RESULT pass=%d fail=0 (publisher controls; git is real and local, ipl, compiler, builder, rsync and sudo are stubbed)\n' "$N"