Written for the next agent. It assumes you have read nothing yet and tells you what is true, what is a trap, and what to do first.
DESIGN.md is a locked specification: implement it, never revise it.
ROADMAP.md is the ordering authority and now also carries the deferral
schedule. docs/deferred.md holds the reasoning behind each deferral. Where
those three disagree with this file, they win — this file rots and they do not.
All seven v0.1.0 items landed, each as its own commit, from 55aef36 (the
vocabulary freeze) to f1fb255 (the sync wiring). Everything builds and every
test passes in three modes: default, -tags allons_dev, -tags iroh.
What that does not mean:
- v0.1.0's exit criterion is not met. It asks for a design partner running a real tool across three devices for two weeks. Nobody has run it across two. Shipping the items is not passing the gate.
- Gate B is one check of three. In-process loopback passes. See §5 below — the LAN check is now the only one outstanding and it is blocked on a build.
- The largest known defect has no owner. See §3.
Read docs/gate-a.md and docs/gate-b.md before trusting any performance or
connectivity claim. Both are written threshold-first and both record predictions
that turned out wrong rather than deleting them. That is the house standard for
measurement: if you re-measure something and the old number was wrong, strike it
through and put the new one beside it.
The instructions the previous session ran under, and which produced the commit series above:
- Up to five opus subagents, orchestrating rather than implementing. Give each a disjoint file scope. Tell every one of them explicitly: do not run any git write command. You review and you commit.
- One commit per milestone, written when the milestone is validated, not when the agent reports done.
- Validate the agents' work yourself. They are wrong often enough to matter, and they are wrong in a specific way: the code is usually fine and the claim about the code is overstated. See §4 for what to actually check.
Two commits in this history did not build, and the cause was concurrency. An
agent added a one-line command registration to cmd/allons/main.go while I was
staging that same file for a different milestone; I had grepped it clean minutes
earlier. Both commits were rewritten and verified in a detached worktree.
So: before every commit, verify the staged tree builds in isolation, not that your working tree builds.
W=$(mktemp -d); git worktree add -q --detach "$W" HEAD (cd "$W" && go build ./... && go test ./... -count=1) git worktree remove --force "$W"
And when agents run in parallel, treat cmd/allons/main.go, cmd/allons/stubs.go,
cmd/allons/cli_test.go, docs/daily.md and docs/deferred.md as contended.
Re-read immediately before editing; never stage a contended file without reading
its diff first.
| Tag | What it turns on |
|---|---|
| (none) | No native transport. iroh.Available() is false; Ticket/AddPeer refuse by name. |
iroh |
The real transport. Needs internal/irohffi/lib/ — gitignored, rebuild with go run ./internal/irohbuild (~6 min, needs cargo). -verify re-derives and diffs. |
dev / allons_dev |
The inspector and the localhost port. dev is also Wails' own tag. |
macOS: Wails 2.13 does not link under -tags dev on the current SDK. Use
CGO_LDFLAGS="-framework UniformTypeIdentifiers". allons doctor diagnoses this
with a link probe and names the fix.
The quadratic state-projection recompute — half fixed, and the remaining half is the interesting half.
The Reducer contract change this section used to ask for has landed. Reducers
report the rows they wrote (local.Touched), so a remote apply hands
StateProjection.Refresh a precise changed set instead of an empty one. That is
real: 18 entities for a 64-operation batch, instrumented, and five separate
mutations each make a test fail.
It did not fix the number, and that is the thing to understand before you touch
this. Re-measured (BenchmarkGateAProjectionsByBatch, -count=2, load average
2.6–3.4) at a 40,000-operation backlog:
| batch | before | after | growth rate |
|---|---|---|---|
| 256 | 120.2 µs/op | 171.4 µs/op | unchanged, still linear in backlog |
| 64 | 469.5 µs/op | 594.3 µs/op | unchanged |
Two measurements explain the whole of it, and both are in docs/gate-a.md §7.2:
avg_changed = 18.0per 64-operation batch. The changed set is precise. The contract change works.avg_tags = 13.0, out of the workload's 17 distinct tag values, over anotes_tagstable that grows one row per operation. The fixture projection recounts each affected tag from live state, so thirteen of seventeen tags is most of a linearly growing table — and "incremental" visits a linearly growing row set however precise the changed set is.
The per-batch cost is the tell that it is not the changed set any more: it was flat at ~30 ms at both batch sizes before, and now moves with batch size (38.0 ms at 64, 43.9 ms at 256). A cost that varies with operations-per-transaction is a cost that is reading what it was told.
gate-a.md §7 was NOT reinstated, and the numbers are why. 256 remains about
3x cheaper than 64 on the projection axis at every backlog, so the §7.1 trade is
intact and both constants stay where they are.
A projection whose refresh is O(rows the transaction changed) rather than O(rows
carrying an affected tag). The shape: a projection-owned membership table, one row
per (tag, note), with the count adjusted by the membership delta — idempotent
because membership is derived from state rather than accumulated, and
rebuild-consistent because the count is a function of rows the projection owns.
examples/notes now has a scoped refresh that measures flat (294 → 362 µs/op
across a 40x backlog increase) on a growing tag vocabulary and still rising on a
fixed one, which is the same finding from the other side: cost follows
notes-per-tag, not the changed set.
Two things you will hit immediately, both now in docs/deferred.md:
- No projection refresh can use any generated index.
Refreshgets a*sql.Txand[]EntityRef, neither of which carries a workspace identifier, and every generated index is led byworkspace_id.EXPLAIN QUERY PLANsaysSCANfor a correctly-scoped refresh. Read the plan; do not trust the timing — an index led byworkspace_idbuys nothing, and believing otherwise cost this document one wrong measurement that is recorded rather than removed. - The interim mitigation still cannot be expressed at the
sync.Logseam.Applyreceives envelopes and no session context, deliberately, so a "this is a catch-up" signal has to be inferred insidelocal. It was offered to the project owner alongside the two other options and not chosen, because it trades DESIGN.md §7.5's co-transactionality during catch-up.
Asked for because the previous session could not reproduce §4.1's 16% throughput advantage for batch=64. Re-run at 1M operations, three counts per size, both sizes projections-off. It does not reproduce. 64 comes out 2–3% slower than 256 — 3,912 against 4,001 ops/s — which is the same order as the spread, so the two are tied and there is no turnover in the curve at these sizes.
Worth knowing why that is believable rather than a different machine: the database size (1,005.7 MiB, 1,060 B/op), the WAL asymmetry (5.0 MiB at 64 against 8.1 at 256) and peak resident (48.1 MiB) all reproduce exactly. Only the throughput ordering differs. The write-lock half of §4.1's claim does stand — 16.4 ms per batch at 64 against 64 ms at 256 — and T1 and T2 are met at both sizes, so Gate A's verdict is unchanged.
Recorded in docs/gate-a.md §4.1a, with the original left struck through rather
than deleted. Batch sizes 1 and 16 were not re-run; that part of the curve is
still a single-machine figure.
What actually caught real problems in this session:
- Mutate the check out and confirm the test fails. 0.1-d closed the HELLO
nonce gap and its suite would still have passed with the engine's session-proof
verification deleted. I added a test, then mutated
session.goto confirm the test fails. Do this for any security-relevant check. - Inject a lie into a harness that claims to prevent lies.
docs/docs_test.goverifies documented commands and snippets. I fed it a fake flag, a nonexistent path, and a snippet drifted from its source. All three were caught with file and line — but I did not know that until I tried. - Measure the claim, do not read it. 0.1-b estimated ~100 OS threads at 32
sessions. Measured: flat at +3 from one connection to eight, because the pumps
park in Go and not inside cgo. Note the trap —
runtime/pprof's threadcreate profile only counts threads the Go runtime made, and iroh is Rust with its own; counting at the kernel is what made the number honest. - Check whether a "frozen" string has two declarations. Twice, one owner was
missing: the kind grammar (
oplogowns it) and the feature strings (wireowns them). Two spellings of a wire string both compile and disagree only in the field. - Run the thing by hand.
allons inspectreported "not running" for a replica that was running because nothing wroteinspector.url. Its tests passed. One manual run found it. - Distrust reported greenness during concurrency. Diagnostics showed
undefinedsymbols in a file that built fine; they were mid-edit snapshots. Conversely an agent reported all-green while another agent's file did not compile. Verify at the moment you commit, not from a report.
The project owner removed NAT traversal from the gate: proving hole punching is iroh's job, and local plus LAN verification is sufficient. Do not treat NAT as a release blocker, and do not read check 3 as passing — it was never run. (If it is ever wanted: host a peer, dial it from a laptop, and keep it out of the gate.)
Check 2 (LAN) passes. darwin/arm64 ↔ linux/amd64 on one subnet, eleven
criteria declared before the run, five mutations each of which fails the check.
docs/gate-b.md §1 has the criteria, §4.8 the linux archive, §4.9 the results and
the mutations, and "Reproducing" the exact two-host invocation. Re-run
independently before trusting it; it takes under a second once the binaries exist.
What made it work, since the handoff you are reading previously listed these as open:
- The linux/amd64 archive is built natively on the host, not cross-compiled,
because the whole value of
internal/irohbuildis that the link line is derived from the toolchain that built the archive. The derived line is-lgcc_s -lutil -lrt -lpthread -lm -ldl -lc. Nothing was hand-written — §15.1's own darwin sketch was wrong in the way that links cleanly and panics at runtime (missing CoreWLAN → an Objective-C class lookup fails, so there is no undefined symbol), and that is why deriving it is the process rather than a convenience. slateis NixOS. Its system Go is 1.24.10 and it has no cargo, so everything runs inside onenix shellat a pinned nixpkgs revision. Two traps:go.modrequires 1.26.0, not the "1.25+" this file and ROADMAP both used to claim; and iroh-ffi v1.1.0 requires rustc ≥ 1.91, so nixpkgs 25.05's cargo 1.86 fails the build. Both are now recorded in ROADMAP's Carried forward table.
Three things it does not establish, all in docs/gate-b.md and in ROADMAP:
the linux archive's portability off the NixOS machine that built it, a
byte-identical linux rebuild from a fresh clone, and anything at all about NAT.
allons doctor also cannot verify the linux manifest, because
internal/packaging reads only checksums.json — which is correctly the darwin
one.
And the gate is still not the release. 0.1.0's exit criterion is a design partner running a real tool across three of their own devices for two weeks. Two machines converging for 0.7 s is the gate.
- One reducer (DESIGN rule 2). Local and remote writes take the same path. If you find yourself writing a second way to mutate state, stop — two writers is where divergence lives.
- The wire vocabulary is frozen and enforced.
Tx.Emitrefuses framework kinds from application code (emitAnyis the framework's own path); the generator refuses a model whose table is a reserved namespace;sync.Newrefuses an unknown feature string. Adding a kind after v0.1.0 means every replica in the field quarantines it — and quarantine forwards, so adata.purgeadded later would erase nothing while appearing to succeed. - Quarantine is not rejection. An unknown kind is stored
applied=0, verified, and forwarded.sync.Log.Rangedeliberately does not filter onappliedfor exactly this reason. - Reads are query-only (§3.2a): no
Execon the interface,PRAGMA query_only=ON, and the generator rejects non-SELECT sqlc. If you want a write on a read path, you have misread the design. RetirePeerrefuses, and there is a test that it refuses and authors nothing. §3.6 annotates it "emits auth.retire" and that reducer arrives at 0.2.0. Emitting one now would put a signed operation in the log that every peer quarantines and forwards.- Revocation does not exist and must not be faked. A local block would be
worse than nothing: the paired device holds a complete copy and reaches the
workspace through any third peer. The workspace id is access-bearing until
0.2.0's membership reducers, and
local/pairing's package comment says so. - Sealed migrations are immutable and now verified —
lock.json's digest is checked on every read, not just written at seal time. local/webimportslocal. Nothing inlocalmay importlocal/web. That cycle has bitten this project twice.
- A deferral takes a place on the timeline. It does not drop a feature, weaken
a compatibility promise, or live only in
docs/deferred.md.ROADMAP.mdnow has a "Carried forward" table; when you defer something, put it there with the milestone that owns it. Six items in this session arrived assigned to milestones that had already shipped, which is worse than being late: an item assigned to a finished milestone is not skipped, it stops being read. - Honest refusal beats a convincing fake. This was called out explicitly and approvingly about revocation. When a mechanism does not exist, say so in the error, name the milestone, and write no operation.
- Do not narrate status instead of working. Earned feedback from this session. Prefer landing a milestone over reporting on one.