ADR 0001: the runtime¶
File: agda-native-ide/docs/adr/0001-runtime.md
- Status: Accepted when the pull request that adds it merges. The fork, its import, its pins and its notice land with this record; the second lane is recorded and not adopted (#30). Since 2026-10-07 the page runs this repository's own build of Agda 2.9.0 (§ 7), and since 2026-10-08 the server's reactor build, with the drive in its worker, so that the page needs no cross-origin isolation (§ 8), and it says so when a browser cannot run it (§ 9). Since 2026-10-13 it mounts the interface archives a check's imports need, after stating their bytes (§ 12), and since 2026-11-25 it runs the released Agda 2.9.0 with the standard library 2.4.1 (§ 13).
- Date: 2026-10-04; § 7 2026-10-07; § 8 and § 9 2026-10-08; § 10 2026-10-11 and 2026-10-12; § 11 2026-10-12; § 12 2026-10-13; § 13 2026-11-25.
- Tracking: #7 (this record); #2 (the fork), #48 (the notice), #4 (the pins; its mirror and rebuild stay open), #3 (its dev-shell clause); #30 (the second lane); #53 (the license questions deferred until before the repository goes public); #58 (the 2.9.0 compiler, § 7); #59 (the reactor and the drive in one worker, § 8); #8 (the page's notices, § 9); #12 and #13 (the library archives, § 10); #11 (the playground's project, § 11); #14 (mounting what the imports need, § 12); #108 (the releases, § 13).
- Ancestry: agda-native-air's browser IDE proposal, § 1 "Fork the runtime"; agda-algebras PR 585 and its ADR-011, which built and measured the second lane; the 2026-10-04 investigation of the fork, whose findings are recorded on #2 to #6, #13, #48, #49 and #50.
Executive summary¶
The IDE's runtime is plfa-playground, forked whole. It runs the
Agda Language Server (Agda with a language-server front end), compiled to WASI
(the WebAssembly System Interface, the POSIX-like imports through which a
WebAssembly program reaches files and streams), in a browser worker. As
forked, a second worker owned the in-memory filesystem Agda reads, and the two
shared memory, which is why the page had to be served cross-origin isolated
(with the two response headers, Cross-Origin-Opener-Policy and
Cross-Origin-Embedder-Policy, without which a browser withholds shared
memory). Since 2026-10-08 the server is its reactor build, which exports
functions JavaScript calls with messages, in one worker with the filesystem,
so nothing is shared and any static host serves the page (§ 8). The page
drives Agda through its interaction protocol, and an edit that stays inside
one goal is checked with a give (Agda's command that checks one expression
against one goal) rather than a full reload. docs/notes/runtime.md
explains the architecture.
It comes in as a snapshot, not a history merge: 89 of upstream's 128 files,
byte for byte, at commit ae0aa84c, with a provenance record of every file's
SHA-256; and no binary the app needs is committed: 35 of them (the
compiler, the archives, the fonts and an icon) were pinned by SHA-256 in the
flake and fetched, and Agda's builtin library is built by the flake from a
pinned Agda (#49). Since 2026-10-07 the compiler is this repository's
own build, pinned by its hashes, and the standard library is built here,
patched (§ 7); since 2026-11-25 both come from releases, Agda 2.9.0 and
the standard library 2.4.1, unpatched (§ 13). 33 of upstream's pins
remain. The build refuses a file
that differs from its pin, and NOTICE names everything the built site
ships, with the license texts beside it.
Why this shape: the fork already does what every later milestone builds on, under the MIT license; a history merge would put about 171 MB of binary blobs into this repository for good, against its rule that no binary is committed.
Where it stands: in the dev shell, the imported app builds, its 5 unit tests
and its type check pass, and it checks Main.agda in headless Chromium with
crossOriginIsolated true (§ 3). Since 2026-10-05 the site is also a Nix
package that builds reproducibly (#3), and CI builds it, runs its unit
tests and type check, and checks Main.agda in headless Chromium on every
pull request (#5); since 2026-10-08 it checks the page served without the
isolation headers and with them, and the page's notices for a browser it
cannot run in (§ 8, § 9).
Where it goes: the fork's compiler, agda-web's build of Agda 2.8.0, gave
way on 2026-10-07 to this repository's own build of Agda 2.9.0 and its
language server, from a recipe that pins every input, with the standard
library 2.3 patched to check under it, and binaries released from a public
repository of this organization (§ 7); on 2026-10-08 the page moved to the
server's reactor build and stopped needing isolation (§ 8), and it now
names the browsers it is tested in and says so where it cannot run (§ 9).
agda-algebras' archives are built and checked for it since 2026-10-11
(§ 10), and since 2026-10-12 the playground's Main is a project of its
own over agda-algebras, under the library's options line (§ 11); since
2026-10-13 the site carries those archives, and the page mounts the ones a
check's imports need, after stating their bytes and asking (§ 12).
Hosting (#6), the license review before the repository goes public
(#53), and the second lane, the plain checker as the verdict of record
(#30), remain.
1. The fork¶
(See also #2, the proposal's § 1, and docs/notes/runtime.md.)
Decision. The runtime is plfa-playground, rather than its ancestor agda-web/als-demo or the plain batch checker; its architecture is kept as it is until Milestone 1 changes it deliberately.
- Kept: the two workers joined by shared memory, the language-server
transport, the give rule (an edit wholly inside one goal is checked with
Cmd_give; anything else is a fullCmd_load), the library archive format (stored zips with interfaces under_build/2.8.0/agda/, mounted bymountDriveArchives), and the IndexedDB persistence. - Not kept, later: PLFA (#20), the Cloudflare tooling (#3), and upstream's hand-maintained cache tokens (#3); none is removed here.
Evidence.
- What the fork has that its ancestor lacks. agda-web/als-demo
("A teaser of Agda REPL", its description) is where the worker, the
filesystem, the highlighting, the input method and the transport began
(upstream's
NOTICE.md). Its controller sends one Agda command,Cmd_load, and has no give rule, no archive mounting and no persistence (src/lib/controller.svelte.tson itspublicbranch, 12,470 bytes, read 2026-10-04); plfa-playground's controller (33,161 bytes) adds the goal commands, the give rule,mountDriveArchivesand the IndexedDB cache, and its repository carries the recipe that built its compiler from pinned sources (compiler/build-agda-wasm.sh). - What the plain checker lacks.
agda-opt.wasmis a batch program: it has no language server (hover, completion), and agda-algebras PR 585 had to build a host that paces its standard input to get goal commands from it (§ 5). It is the second lane, not the first. - The fork works as imported. Built and driven here (§ 3), and in the investigation (#2's findings).
- The license permits it: MIT, with "Copyright 2026 Andy Pan", the line
als-demo's license carries (upstream's
LICENSEis byte-identical to als-demo's), while every upstream commit is Seungheon Oh's (#48).
Status. Adopted. Open: everything Milestone 1 changes, starting with
the drive's lookups (#50) and the builtin interfaces (#49). On
2026-10-05 #3 removed wrangler, the last Cloudflare package, and
replaced the hand-maintained cache tokens with values the build derives
from the files; the rest of upstream's Cloudflare-shaped build, the
post-step that gzips the compiler (scripts/prepare-cloudflare-assets.mjs)
and static/_headers, waits for the host (#6). On 2026-10-08 #59
replaced the two workers joined by shared memory with one worker that holds
the server's reactor build and the drive (§ 8).
2. The import¶
(See also #2 and docs/provenance.md.)
Decision. Upstream comes in as a snapshot of its tree at
ae0aa84c24363a8d6dadc292b6eb8f88f7f38705 (2026-08-31), in one commit whose
files are upstream's, byte for byte, without its binaries, with a provenance
record and an upstream remote for later syncs; not as a merge of its
history.
- The record, in
upstream/: every file of upstream's tree with its SHA-256 (plfa-playground.sha256, asscripts/upstream-record.shprints it), the imported files still byte-identical to upstream (unchanged.sha256, checked bymake provenance-check), and the pins (assets.sha256, § 3).docs/provenance.mdsays what became of each file. - Collisions: upstream's
README.md,LICENSEand CI workflow come in asREADME.plfa-playground.md,LICENSE.plfa-playground(verbatim) and.github/workflows/app.yml; its.gitignoreis merged into this repository's;wrangler.jsonc(upstream's Cloudflare account) is left out. - Changes: each change to an imported file is its own commit, says so
in a header comment naming the upstream file and commit (or, for JSON, in
docs/provenance.md), and leavesunchanged.sha256. This pull request changes the workflow (it builds from the pins, without the deploy job) andpackage.json(nodeployscript), and removes upstream'sNOTICE.md, whichNOTICEsupersedes. - Syncing is file by file: the README's "Syncing with upstream" diffs
a later commit's record against the committed one, takes the files still
upstream's, merges the changed ones three ways with
git merge-file, and updates the records and the pins.
This departed from the plan's wording, and the plan was changed to
match on 2026-10-05, by William's decision. #2's title had said "history
and attribution intact", and Milestone 0's description "The fork comes in
with its history"; the history does not come in, and the attribution does,
in LICENSE, NOTICE and the record. The title now reads "Fork
plfa-playground into this repository, as a recorded snapshot with its
attribution", and the description "The fork comes in as a recorded
snapshot, with its attribution".
Evidence.
- Upstream's binaries, measured 2026-10-04 in a clone of upstream:
at
ae0aa84c,static/holds 60,183,062 bytes, 59,422,474 of them in 37 binary files (git diff --numstatagainst the empty tree marks them binary). Across upstream's four commits there are 67 distinct binary blobs totaling 171,397,049 bytes (172,157,637 with the text understatic/), three compiler builds among them (28,841,108, 28,921,665 and 32,996,332 bytes), and a fresh clone's pack is 94.25 MiB. A history merge would add them all to every clone of this repository, against CLAUDE.md's rule that no binary is committed. - The snapshot is exact: every one of the 89 imported files has the
blob id of its upstream file (
git ls-files -sjoined with upstream'sgit ls-tree);make provenance-checkre-verifies the unchanged ones by SHA-256. - The sync procedure was run: on a scratch clone, against a constructed
later upstream commit changing five files (one still upstream's, one
renamed, one changed here, one new, one pinned binary), the record diff
named exactly those five, and
git merge-filemerged upstream's change topackage.jsonwhile keeping this repository's removal ofdeploy. One trap was found and documented: in zsh,"$NEW:path"reads:sas a history modifier ("bad substitution"), so the README writes"${NEW}:path".
Status. Adopted, the plan's wording included (2026-10-05).
3. The pins¶
(See also #4, #3, and docs/provenance.md.)
Decision. Every binary the app needs from upstream is pinned by SHA-256 and fetched by the flake, one fixed-output fetch per file, from upstream's tree at the imported commit; the build checks the files it consumes against the same pins.
- The pins:
upstream/assets.sha256, 35 files, 48,642,786 bytes: the compiler (als-2.8ext.wasm), the standard library 2.3 (agda-stdlib-2.3.zip), six JuliaMono fonts, the favicon's PNG, and PLFA's 26 archives. The flake reads the file and makes afetchurlper line fromraw.githubusercontent.com/SeungheonOh/plfa-playground/<commit>/<path>;nix build .#assetsis the set, with Agda's builtin library (agda-data.zip), which was a 36th pin (591,281 bytes) until #49 replaced it with a build (§ 6). A fixed-output fetch (one whose output hash is declared in advance) fails when the bytes differ. - The checks:
make assetscopies the set intostatic/and checks it;make buildchecks every pinned file instatic/against its pin (sha256sum --check --strict) beforenpm run build, and, since #49, thatagda-data.zipis the flake's build. - Not pinned: upstream's
als-2.8ext.wasm.gz, because the build writes its own and the dev server falls back to the raw compiler without it; and, since #49,agda-data.zip, which the flake builds (§ 6). - The dev shell gains node 22 (22.22.2,
pkgs.nodejs_22), so thatnix develop --command npm ...works: the dev-shell clause of #3, taken early because #2's acceptance needs npm.
Evidence (2026-10-04, this machine, headless Chrome 153.0.8010.47).
- The pins hold: with none of them in the Nix store,
nix build .#assetsfetched all 36 (49,234,067 bytes) in 32.5 s, and every file matched; the compiler's pin is the one #4 verified (sha256-U8YrCtVpqdEj90SxksE3gMSUreDN3vTaqgDbQezX96E=, SHA-25653c62b0a..., the hash upstream'scompiler/README.mdrecords). - A changed pin fails the fetch: with the last hex digit of
agda-data.zip's pin changed from 3 to 0,nix build .#assetsstopped with "hash mismatch in fixed-output derivation" (specifiedsha256-J9gd...nqA=, gotsha256-J9gd...nqM=), exit 1. - A changed file fails the build: with one byte of
static/agda-stdlib-2.3.zipflipped (offset 998,948, 0x8c to 0x8d),make buildstopped at "static/agda-stdlib-2.3.zip: FAILED", exit 2, beforenpm run buildran;make assetsrestored the file. - The pinned app builds and runs, from a clean tree (no
node_modules, nobuild/, no materialized binaries) on an idle machine:make assets, thennpm ci(167 packages),npm run check(svelte-check: 4302 files, 0 errors, 0 warnings),npm test(5 of 5) andmake build(9.4 s; 300 files, 29,239,191 bytes inbuild/: the app's 83 files, 28,705,637 bytes as the investigation measured, plusNOTICE.txtand the license texts) all pass. Served with the isolation headers and driven headless with the investigation's server and driver, three fresh profiles were "Agda ready" at 0.85 to 0.96 s and had checkedMain.agdaat 1.87 to 2.19 s (2 open goals; the check itself 0.93 to 1.18 s), withcrossOriginIsolatedtrue; each first visit made 25 requests for 15,630,931 bytes (the investigation's 15,630,936, less five bytes: SvelteKit names each build with an identifier that appears five times in the page, and this build's,__sveltekit_qipo0l, is one character shorter), and each warm reload made none and checked by 1.26 to 1.48 s. The runs are in the pull request that adds this record. - Where upstream got the binaries (
docs/provenance.md): the compiler exists only in upstream's git tree (#4); the six fonts are byte-identical to JuliaMono'swebfonts/atv0.060; the standard library's 1,391 files equal agda-stdlibv2.3's by CRC-32;agda-data.zipis byte-identical to agda-web/als-demo's. The fonts and the standard library therefore have second sources for #4's mirror. - The gzip:
npm run buildwrote a 10,154,917-byte gzip that inflates to the pinned compiler; with no.gzinstatic/,npm run devserved a 404 for it, the page fetched the raw compiler, and Agda checkedMain.agda(2 open goals, isolated). The built site has no raw compiler at all (the post-step deletes it), so a browser withoutDecompressionStream(Firefox before 113 and Safari before 16.4, both inside the build's declared targets) gets a 404 for the fallback and a page that says "Agda ready" and never checks, as on upstream's live site; measured 2026-10-05 (docs/notes/runtime.md, "Startup"), and #3's to decide.
Status. Adopted. Open on #4: a mirror this organization controls (the
compiler has one source, a personal repository), and the rebuild recipe as a
flake app, with its outcome recorded. On 2026-10-07 #58 retired two of
these pins, the compiler and the standard library, which the page no longer
ships (§ 7); 33 remain, 13,648,557 bytes. On 2026-10-05 #3 decided that the
built site does not ship the raw compiler. The fallback could serve only
Safari 15.2 to 16.3, since every Firefox without DecompressionStream (before
113) also lacks the module workers the page starts (from 114; MDN's
compatibility data), and it would cost 33 MB a deploy, over Cloudflare Pages'
25 MiB limit for one file. The page's silence when it cannot fetch or
decompress the compiler was answered on 2026-10-08 by #8: the page says
why Agda could not start, and the dev server, which the fallback served,
serves the gzip itself (§ 9).
4. The notice¶
Decision. A root NOTICE names every artifact the built site ships,
with its copyright and license, and licenses/ holds every license text,
each read at its source; make build publishes both beside the site, as
NOTICE.txt and licenses/. Upstream's NOTICE.md is removed, and its
lineage paragraphs are carried into NOTICE verbatim.
- GMP: the compiler statically links GMP 6.3.0, which is offered under
LGPL-3.0-or-later or GPL-2.0-or-later; the notice takes the LGPL, ships
its text and the GPL-3.0's (which the LGPL incorporates), and meets the
LGPL's relinking condition by pointing at the pinned sources of every
part of the compiler and at the recipe that links them, so that anyone
can rebuild it with a modified GMP. This is a judgment, not counsel's,
and William's to confirm; the GPL's source clause also leaves the
distributor responsible for those sources staying available, so the GMP
tarball belongs in #4's mirror beside the compiler. On 2026-10-05
William deferred this and every other open license question to #53,
to be settled before the repository goes public; the notice stood as
written meanwhile. On 2026-10-07 William confirmed it (#53's comment
of that day): GMP is distributed under the LGPL, and each public release
of the compiler carries GMP's source tarball and GHC's two patches to it,
with the build plans (the first,
agda-2.9.0-da66a8c-als-8of formalverification/agda-wasm-builds), so decision 10 is adopted. - The favicon is Agda's official mark, adapted; agda/agda ships the
mark in its package as an
extra-doc-filesentry under its MIT license and states no other terms, so the notice credits it under Agda's license and no replacement is needed.
Evidence.
- Every text was read at its source, at the commit or tag
NOTICEnames, and copied verbatim (.gitattributeskeeps git from changing their line endings). One could not be: nonempty-vector 0.2.4'sLICENSEis empty in its Hackage tarball and in its repository alike, soNOTICEsupplies the BSD-3-Clause text its cabal file declares, in a file that says it was supplied (found in review). - The page's packages were listed from a build with source maps, not
from the lockfile: 35 npm packages, four more embedded in
jszip's prebuilt file, and the bundler's helpers. Only comlink's license comment survives minification, so the page's code credits almost none of them itself. - The compiler's packages come from a cabal build plan solved with the pinned toolchain at index state 2026-08-31T23:24:32Z, the time the binary was committed (the recipe pins no index state): 150 packages in the executable's link closure. The binary's strings carry 57 unit ids, 35 of them with a content hash that fixes the package's source, flags and dependencies; every one is in the plan and none disagrees. Any index state from 2026-08-29T13:20:56Z, the newest upload among the planned packages, gives the same plan.
- The C and C++ code the plan does not list: GMP 6.3.0 (the GHC
bindist's own header says so, and its
ghc-bignumarchive holds GMP's objects), wasi-libc and compiler-rt's builtins (the toolchain's clang adds both to every link), libc++ and libc++abi (the binary names libc++abi), and simdutf (bundled bytext).
Status. Adopted. Open: #53, the license review before the
repository goes public (the packages the binary does not confirm,
libffi-wasm, and nonempty-vector's supplied text; GMP was settled on
2026-10-07, above), and the notice's upkeep when the dependencies change
(#3 trims them). On
2026-10-07 the notice's section 3 moved to the 2.9.0 compiler (§ 7): its
140 packages come from that build's own plan rather than a re-solved one,
the binary names 56 of them exactly, and two texts are new for the
review, zstd's C library's and the patent grant its Haskell package
ships. On 2026-10-08 it moved to the reactor build that the page ships
(§ 8): 141 packages from the reactor's own plan (the command module's and
ghc-experimental), and the reactor's JavaScript glue, GHC's code under
GHC's license; the page bundles 34 npm packages, spsc gone with the
rings it served; and coi-serviceworker.js is no longer shipped.
5. The second lane¶
(See also #30, the proposal's § 1, and agda-algebras PR 585.)
Decision. The plain checker, agda-opt.wasm from agda-web/agda-wasm-dist
(release v2.8.0-ghc9.10.3-r0), is not adopted here. It is recorded as the
planned verdict of record, the lane whose batch exit code decides whether a
file checks, beside the language server's interactive lane (#30,
Milestone 3).
Evidence. agda-algebras PR 585, measured in headless Chromium 153 on 2026-10-04 and recorded in its ADR-011:
- The plain checker answers every goal command without isolation.
Driven through Agda's interaction protocol (
--interaction-json) with a standard input paced from Agda's own answers, it gave, refined, split cases and inferred types on three agda-algebras exercises, withcrossOriginIsolatedfalse in every run. It shares no memory between threads, so it needs noSharedArrayBuffer. - One process can stay alive across commands, still without isolation. A probe using JavaScript Promise Integration (JSPI, which lets WebAssembly suspend on a JavaScript promise instead of blocking a thread) kept one Agda process across commands: on a 244-module image, 12.9 s for the first load, then 1.45 s per reload and 45 to 55 ms per goal query, against about ten seconds per command as shipped. Only Chromium was tried.
What it means for isolation. Only the language-server lane needs cross-origin isolation; the batch lane runs on any static host, and in a browser or a context where isolation is unavailable (where service workers are disabled, so the fork's service-worker fallback cannot run, #6). A page that cannot isolate itself can still check a file, slower, through the batch lane, and JSPI would make that lane interactive where it exists; where JSPI is missing, PR 585's shipped path (one process per command, about ten seconds each on that image) still works. So the isolation requirement is the interactive lane's, not the IDE's. Since 2026-10-08 the interactive lane needs no isolation either (§ 8).
Status. Recorded, not adopted. Open: #30.
6. What the measurements already settled¶
These were measured during the investigation, are recorded on their issues, and are cited here rather than measured again.
- Interfaces built by the flake's native Agda are accepted by the
browser's Agda (#13). Both use interface version 202507030; a
Mainimporting agda-algebras'Overture.Basictype-checked onlyMain(oneCheckingline in Agda's running info), where the sources-only control checked all 66 modules. So the library archives of Milestone 1 can be built natively. That holds for Agda 2.8.0 only: Agda 2.9.0's interfaces depend on the word size of the Agda that writes them (§ 7). - Most of a check's time is the drive's lookups (#50): the in-memory
filesystem scans every file and builds a regular expression per file on
each lookup. With interfaces accepted, a
MainimportingOverture.Basictook 13.6 to 18.5 s per check, and 1.8 to 3.7 s with an index on the lookups. - The builtin interfaces are stale (#49):
agda-data.zipholds Agda 2.7.0.1's interfaces (version 202406290), so a fresh profile's first check type-checks the builtins it imports again. Re-observed here: the defaultMain.agda's first check printed fourCheckinglines (Main,Agda.Builtin.Nat,Agda.Builtin.Bool,Agda.Builtin.Equality), as on the live site. That is upstream's behavior, kept unchanged by this import.
Status. Settled; the fixes are #49 and #50.
The builtins' fix (#49, 2026-10-06). agda-data.zip is built by
the flake from the whole of an Agda's own lib/prim (sources, library file,
and the interfaces that Agda builds under _build/<its version>/agda/), at
the root the page's server reads it from, reproducibly; its input is one
attribute, agdaDataInput (today the pinned nixpkgs' Agda 2.8.0 and
lib/prim), which #58's move to another Agda changes. The input must be
the Agda the server embeds, to the commit: the page runs als --setup
before every server start, and --setup writes every builtin source from
the server's own copy over the drive's. Measured 2026-10-06 in headless
Chromium 149: a fresh profile's first check of the default Main.agda
type-checks Main alone (the browser check now asserts it), and so does
each of two Mains that between them import all 36 builtins; an archive
holding the fork's 2.7.0.1 sources beside the new interfaces gives the
same in the browser, where native Agda, which reads the archive's sources,
checks 9 and 4 builtins again. The pull request has the runs.
7. The 2.9.0 compiler¶
(See also #58, #59, #61, #13, #4,
compiler/build-agda-2.9.0.sh, and
docs/notes/runtime.md.)
Decision. The page's compiler is this repository's own build of Agda 2.9.0
and the Agda Language Server for wasm32-wasi, from a recipe that pins every
input, in place of agda-web's build for Agda 2.8.0 (§ 3). The page ships it
with the standard library 2.3 patched to check under 2.9.0, and every
interface it ships is built by a 32-bit (wasm32) Agda.
- The sources: agda/agda
da66a8c7, thenightlyof 2026-10-05 (2.9.0 is unreleased), built as it is, since Agda builds for WASI unpatched since agda/agda PR 8205; and agda/agda-language-serverv8(0f77a209) against it, with two patches incompiler/patches/. The first adds a flag for Agda 2.9.0 and 21 branches for its API, guarded by Agda's version so that the server still builds against 2.8.0, and fixes the reactor module, which does not compile atv8. The second is the server's wasm project file: the index state, lsp 2.8 from the server's own submodule (the reactor needs it), and lsp's WebSocket support turned off. - Three modules and a glue file: the server as a command module, which
the page runs (
static/als-2.9.0.wasm); the server as a reactor module, with the JavaScript glue GHC's post-linker writes, for #59; and the plainagda, which builds the builtins here and is the batch lane's (#30). - The toolchain: ghc-wasm-meta
58260711, the commit Agda's own flake pins atda66a8c7(GHC 9.10.3.20260731), as a flake input with its own nixpkgs, so that its store paths are those of Agda's dev shell; one toolchain for all three modules, where the server's CI uses an older one (c3f44696) that nothing has proven with Agda 2.9.0. - The data directory: both builds are without Agda's
use-xdg-data-homeflag, so the data directory isAgda_datadiritself,/in the page, and neither the page's layout noragda-data.zip's root changes. - The recipe is a script in a pinned dev shell, run by an optional CI
job, not a pure derivation.
nix develop .#compiler --command compiler/build-agda-2.9.0.shbuilds the four files at one fixed path, since the binaries record their build paths;.github/workflows/compiler.ymlruns it on demand and when a pull request that changes the recipe or its pins opens or is ready for review, and fails unless the bytes matchcompiler/agda-2.9.0.sha256;nix build .#compilerfetches the files by those hashes. A pure derivation would need every Hackage package as a fixed-output fetch, a second packaging of a plan cabal already pins by its index state, for a build of two Agdas (27 minutes from empty on this workstation) that no cache here spares CI from; #4's findings recommended the same split. - Where the binaries live: releases of a public repository of this
organization, William's decision of 2026-10-07, created the same day:
formalverification/agda-wasm-builds, whose release
agda-2.9.0-da66a8c-als-8holds the four pinned files, the three build plans, and GMP's source with GHC's patches; the flake fetches the files from it by their hashes. The move to Agda's 2.9.0 release is a new Agda commit in the recipe, a rebuild, a new release and a new file of hashes. - Every interface the page ships is built by a wasm32 Agda, since
Agda 2.9.0 writes an interface's integers at the width of the machine
that writes it (below): the builtins' archive is built by the compiler's
plain
agdarun under wasmtime in the Nix sandbox (agdaWasminflake.nix). - The standard library is 2.3, patched as in #61's row 2b
(agda-stdlib's
agda-mastercommits1896499fand1b7f26af, and39631ce9ported to 2.3), William's decision of 2026-10-07, and with two commits of itsmasterbranch,fbf6ce16andb0d29e13, without whichData.Nat.Primalitydoes not check; built by the flake from thev2.3tag andstdlib/patches/(packages.stdlib). - The 2.8.0 compiler stays pinned, unshipped (
nix build .#compiler-2_8_0), with its recipe, until the 2.9.0 compiler passes #13's gate.
Evidence. Measured 2026-10-07 on this workstation (20 cores, 64 GB, Linux 7.0.0-31-generic); #58's findings have each phase in full.
- Agda builds for WASI unpatched at the pin: in Agda's own dev shell,
an exploratory
wasm32-wasi-cabal build --index-state=2026-10-05T16:41:29Z -O2 --enable-split-sections exe:agdatook 19 min 23 s from an empty store, andwasm-opt -Oz(binaryen version_131) took its module from 107,483,009 to 34,277,999 bytes. The recipe's build, at its fixed path, is the pinned 34,277,969 bytes (below): the module records the path it was built at. Under wasmtime it reports "Agda version 2.9.0", checks a module of builtins with 4Checkinglines and then 1 over its own interfaces, and exits 42 on a type error. - Agda's own suites pass under it: with the native
agda-testsbuilt bycabal build -fdebug(the workaround agda/agda#8756 suggests for themake install-binits workflow uses, which fails at the pin) andtest/run-agda-wasm.sh, Succeed passed 2,016 tests of 2,016, Fail 1,853 of 1,853, and Common passed; Bugs passed 14 of 15, the one failure (Issue8182) a golden value that holds-vdebugging output, which a build without Agda'sdebugflag does not print. - The server's changes are local: 10 source files and
package.yaml, every change in a branch for Agda 2.9.0, and the patched server still builds against Agda 2.8.0 (natively, unoptimized, both). Built for wasm32, the command module took 20 min 3 s (Agda again, as a package of the server's project) and the reactor then 13 s, since the flag changes only the server's own executable. The pinned reactor, with its glue, ranrun_setup(42 ms, 41 builtin sources written) andnew_language_serverunder node 22.22.2's WASI. - The recipe reproduces its bytes: its first run, in
nix develop .#compiler, built the four pinned files; a second, from an empty work directory at the same path (16:30 to 16:57 MDT, 26 min 49 s: the plainagdain 12 min 43 s from an empty cabal store, the command module in 12 min 5 s, the reactor in 8 s), built the same four files and the same three build plans, byte for byte. The pins:
| File | Bytes | SHA-256 |
|---|---|---|
agda.wasm |
34,277,969 | da2f1efc6b13e0d8b8a69311511c8ed6fbfbc2759bd8ec299004580fcfba1eb1 |
als.wasm |
35,880,158 | b1f45936329c529b5677e38bc0e8d22d7a1c9c47277e8f77146f5667c76228e4 |
als-reactor.wasm |
35,817,413 | a0c7ae5741dd3f11c6be9e9fac4281889f2861ec2b53b5379452d11a4a23e8c9 |
als-reactor.js |
5,044 | c782dbaca349830299055c71ec9c4f72ec543c0d612d08b7c40fbb364e601dce |
- And on GitHub's runner: the CI job, on a runner with 2 cores and
7.8 GiB of memory, built the same four files from the pins in 78
minutes (the plain
agdain 32 min 49 s, the command module in 34 min 26 s), and itssha256sum --checkpassed (run 37708498495). It needs swap: GHC's resident memory peaks at 8.95 GiB compiling Agda's library (measured here with GNU time), the run before was shut down in that build, and this one, with the 16 GiB swap file the job now adds, used up to 5.3 GiB of it. - The page works on it: the browser check passes on the built site
(headless Chromium 149): the first check of the default
Main.agdatype-checksMainalone over the builtins the compiler'sagdabuilt, the give leaves one goal, the type error comes back in 2.9.0's words, and the status bar shows "Agda v2.9.0 Language Server v8 (WebAssembly build)". Measured in one sitting against the 2.8.0 page (mainatc95f10c), three fresh profiles each, every run started at a 1-minute load average of 1.48 to 1.69: "Agda ready" at 887 to 984 ms (2.8.0: 830 to 862 ms); the first check done at 1,314 to 1,417 ms (1,265 to 1,322), 325 to 337 ms by the page's own count (339 to 372); a give 453 to 483 ms (465 to 477); a warm reload checked at 901 to 953 ms (889 to 915). A first visit fetches 25 files, 16,126,490 bytes against 15,724,238: the compiler's gzip is 964,398 bytes more (11,119,315), the standard library and the builtins 562,580 fewer, the page's own code 434 more (measured before the standard library's last two patches, which add 11 bytes to its archive). On two copies of the site whose defaultMainimports every 2.9.0 builtin (the 35 plain ones in one, the 6 cubical ones in the other), the same check passes withMainalone checked: the server accepts all 41 interfaces the compiler'sagdabuilt. - Agda 2.9.0's interfaces depend on the word size of the Agda that wrote
them. agda/agda PR 8065 (2025-08-16) made the serializer write
IntandWordat the machine's width, 8 bytes on x86-64 and 4 on wasm32, where 2.8.0'sData.Binarywrote a fixed width (which is why § 6's finding held). The wasm32 Agda cannot decode a 64-bit Agda's interface and checks the module again, silently, or hangs reading a length it misdecodes; a native Agda reading a wasm32 interface stops with "Heap exhausted". Measured under wasmtime with the compiler'sagda: over builtins built by the nightly's static x86-64 binary at the same commit, a module importing three builtins checks four modules; over the same builtins built by the wasmagda, one. AMainimporting agda-algebras'Overture.Basicchecks onlyMainover interfaces the wasmagdabuilt, and all 66 modules over the same closure built natively. #59's spike saw the hang in the page, at 3.4 to 3.7 GiB. - The patched standard library checks whole: all of its 1,154
modules check from source under the nightly at the pin (
agda --build-library, exit 0, 108 s, the library's own 50 deprecation warnings); with row 2b's three patches alone the check stops 651 modules in, atData/Nat/Primality.agda:214(InstanceNoCandidate), since Agda 2.9.0's instance search no longer eta-expands a variable of a record type (agda/agda PR 8367), which the last two patches answer. Under the compiler'sagda,Data.Nat.Primalitychecks from source (198 modules) and PLFA'spart1/Relationstoo (30 modules). The archive's sources are formalverification/agda-stdlib's tagv2.3-agda-2.9.0(fb5d1840), file for file.
What 2.9.0 changed, as the page meets it.
- The interaction protocol: an error's text (a type error reads
The terms/0/and/1/are not equal at type Natwhere 2.8.0 wrote0 != 1 of type Nat; the browser check now expects it); a give sent withnoRangeis answered{"paren": false}rather than with the expression reprinted, and the page inserts the expression it sent (#59's spike); running info stays a string in the JSON encoding;Cmd_constraintstakes a normalization level, andGoalAndHave,NormalForm,InferredTypeandMimeranswers carry more (Agda's changelog), none of which the page sends or reads. The server answers in Agda's own JSON only when started with--raw(its PR 40), so the page now passes it. - The interface format: the version is 202610030, stored
little-endian in bytes 16 to 23 of the header (2.8.0's 202507030 was
big-endian), the payload is zstd where it was gzip, and its integers have
the writer's word size (above). Interfaces built by 2.8.0, such as
PLFA's archives, live under
_build/2.8.0/and are not read. - The startup: the controller ran
als --setupfor 2.9.0 as it did for 2.8.0, and the server reads/lib/primas before; since 2026-10-08 the reactor'srun_setupdoes the same (§ 8).
Status. Adopted on 2026-10-07 in #58's pull request: the recipe,
the patches, the pins, the patched standard library, the builtins built
by the wasm agda, the page on the new compiler, and the CI job, which
built the pinned bytes on GitHub's runner. The public repository for
the binaries exists since 2026-10-07, and CI fetches from it; the page has
run the reactor since 2026-10-08 (§ 8). #13's gate passes under 2.9.0
since 2026-10-12, on archives built by a wasm32 Agda (§ 10): the server
accepts every interface that agda-algebras' 350 roots (its modules, each
of which a reader may import) need. The move to Agda's 2.9.0 release is
§ 13's (2026-11-25). Open: the 2.8.0 compiler's pin, which row 22 kept
until that gate passed.
8. The reactor and the drive in one worker¶
(See also #59, #58, #50, #6, and docs/notes/runtime.md.)
Decision. The page runs the language server's reactor build in one worker with the drive, so that no memory is shared between threads and the page needs no cross-origin isolation.
- The reactor: the server built with its
reactorflag (§ 7), which exports functions that JavaScript calls with one message each, through GHC's JavaScript FFI, where the command module blocked on standard input. The worker drives it as #59's spike found: the whole argv, the program's name first, given through WASI before_initialize(Runno'sinitialize), thenrun_setup(Agda's--setup),new_language_server, andrun_language_servernever awaited, with onerecv_messagealways pending and eachsend_messagechained on the last. - The drive in the server's worker: a file call is a function call on the same thread; the page's writes, the archives it mounts and the IndexedDB cache are functions of that worker, which run between the server's steps. #50's index moves unchanged. The cache reads each dirty file from the drive's own record, so files at paths made after startup are persisted too, which the drive worker never did.
- No isolation: the page allocates no
SharedArrayBuffer; the isolation headers instatic/_headers(its cache rules stay), the service workercoi-serviceworker.jswith its script tag, the dev server's headers, and the checks ofcrossOriginIsolatedin the page and the worker are removed. So any static host serves the page (#6). - What ships:
als-reactor-2.9.0.wasm, gzipped by the build, and its JavaScript glue,als-reactor-2.9.0.js, which the worker imports by its URL with a cache token rather than letting Vite bundle it, so that the file the page runs is the pinned file byte for byte and changes only with the module it was generated from. The command module,als.wasm, stays pinned for the compiler's records and is not shipped. - The version: a reactor has no
--version, and the server reports no version of its own, so the controller asks Agda withCmd_show_versionwhen the server is first ready, and the status bar shows Agda's answer, "Agda 2.9.0". - No RTS options: the fork's
+RTS -A64m -RTSis removed (below). - Agda's positions are read against the text it loaded: the editor
takes its text as Agda's only when the page sends
Cmd_load, where it did so after every write to the drive (below).
Evidence. Measured 2026-10-08 on this workstation (20 cores, 64 GB,
Linux 7.0.0-31-generic) in headless Chromium 149.0.7827.200 (the flake's),
a fresh profile per run, five per cell, the arms alternating, every run
starting below a 1-minute load average of 2 (0.66 to 1.97). The stdio
arm is main at 5b9a5d6, served with the isolation headers; the reactor
arm is this change at e6be0a6, served without them. Both carry only the
controller's measuring hooks, both start the server with the fork's argv
(--raw +RTS -A64m -RTS +AGDA --interaction -AGDA), and both read the same
builtins, standard library and PLFA archives, so only the transport and
the startup differ. Each command is timed from its send to Agda's
ResponseEnd; "Agda ready" is the status bar's, since navigation. The
second root is a Main that imports 32 of the builtins. Ranges, in ms,
with medians:
| root | arm | Agda ready | first check | give | warm reload |
|---|---|---|---|---|---|
| default | stdio, isolated | 901 to 916 (907) | 269 to 287 (279) | 14.4 to 23.2 (18.1) | 77 to 91 (77) |
| default | reactor, not isolated | 641 to 666 (650) | 242 to 259 (254) | 13.7 to 22.4 (19.7) | 70 to 72 (70) |
| 32 builtins | stdio, isolated | 906 to 931 (913) | 514 to 547 (520) | 16.8 to 22.8 (18.7) | 141 to 185 (154) |
| 32 builtins | reactor, not isolated | 646 to 684 (666) | 414 to 452 (416) | 17.9 to 25.6 (24.4) | 122 to 124 (124) |
- Every check type-checked what it should: every first check and every
warm reload, in both arms, printed one
Checkingline,Main. - Startup: "Agda ready" came about 257 ms sooner (medians 650 and 907
ms). The stdio build compiled its module once and instantiated and ran
it three times (
--version,--setup, the server) beside a second worker; the reactor is instantiated once. - Warm reloads were 9% faster on the default root and 19% on the
larger (medians); #59's spike measured 27% on its prototype. A PLFA
chapter,
Naturals, five runs a cell: its first check, from source in both arms (PLFA's archives hold 2.8.0's interfaces, which 2.9.0 does not read; 31 modules), took 9,874 to 11,591 ms (10,410) against 9,295 to 10,596 (9,514), and its warm reload, the chapter alone, 397 to 431 ms (412) against 301 to 350 (320), 22% faster, each by the page's own count.scripts/benchmark-plfa.mjs's wall time from the key press was 931 to 970 ms against 433 to 464, but most of that difference is the harness's own waiting: a trace of one run each saw "Checked" 446 and 391 ms after the key press. - The give is the same within the runs' spread.
- A drive call: 20,000
pathStatcalls on the root (#50's paths, 30% hits) took 0.19 to 0.21 µs each in four runs and 0.47 µs in a fifth, in the page's worker, against 17.1 to 20.1 µs through the proxy (#50, 2026-10-06) and 11.4 to 12.8 µs through it on #59's spike. - No isolation, in two browsers: the browser check passes served
without the headers (
crossOriginIsolatedfalse) and with them (true): in Chromium 149, in CI and here, and in Firefox 157 (Ubuntu's snap, headless, through WebDriver BiDi), 6 runs each way. A control that serves the opposite of what the check expects fails both ways. - The RTS options:
-A64mtakes effect (the reactor's heap after a warm reload was 94 MiB with it and 24 MiB without on the default root, 121 and 31 MiB on the larger), and made no check faster: warm reloads 68 to 75 ms (70) with it and 64 to 74 (72) without, 118 to 127 (124) and 113 to 116 (114) on the larger root, and PLFA'sNaturalsfrom source 9,295 to 10,596 ms (9,514) and 9,400 to 10,335 (9,721). - The commit point: asked with the compiler's own
agda, the defaultMain.agda's goal 1 keeps its range, 303 to 320, after goal 0 is given and the text above it shrinks. Upstream's controller took the buffer as Agda's after every write to the drive, the one that follows a give included; when that write completed before the give's interaction points arrived, their ranges fell past the end of the text, the mapping threw, the router's stream stopped, and the page hung. In Firefox 157 the browser check hung so 3 times in 8 runs, with the headers and without; with the commit atCmd_loadonly, 0 times in 12, and 0 in 6 in Chromium. - The runs: #59's findings of 2026-10-08 carry the tables, the method and the load average of every run.
Status. Adopted 2026-10-08 in #59's pull request. Open: archive extraction runs on the server's thread and delays its next step (not measured); the host is still #6's to choose, now from any static host; #62's shared core takes this worker as its WebAssembly engine.
9. Browsers¶
(See also #8, #59, and the README's "Browsers".)
Decision. A browser that is hard to support is not supported: the page says so when it cannot run there, and the documentation names the browsers it is tested in, with no polyfill, shim or fallback (William, 2026-10-07).
- What the page checks, before it starts Agda: module workers,
DecompressionStream, and the five WebAssembly features the compiler uses, SIMD, reference types, bulk memory, sign extension and non-trapping float-to-int conversions (src/lib/support.ts). IndexedDB is optional: without it the page runs, uncached. - What it says: a browser without one of them gets a notice naming what is missing and the browsers the page is tested in. When a step of the startup fails (a request, the compiler's decompression or compilation, the drive, the setup), the page shows "Agda could not start:" and the step, and its heading and status bar say "Agda did not start", where the status bar said "Agda ready" with nothing checked. A server that fails, or exits when the page did not ask it to, shows "Agda stopped" the same way.
- No fallback: the page's fallback to the raw compiler, dead in the built site since decision 15, is removed; the dev server, which it served, serves the gzip itself.
- Tested: Chromium 149, in CI and here, and Firefox 157, here, both on 2026-10-08, served with the isolation headers and without. WebKit (Safari) is untested: none was at hand.
Evidence.
- The compiler's needs: the reactor's
target_featuressection names ten WebAssembly features; validated with each left out in turn (binaryen 132), it needs the five above and none of the others. By WebAssembly's feature table and MDN's compatibility data (read 2026-10-08 and 2026-10-05), the page's needs first coincide in Chrome 96, Firefox 114 and Safari 16.4. So the browsers decision 15 weighed, Safari 15.2 to 16.3, which lackDecompressionStream, lack SIMD too: the raw compiler could not have run there either. - The notices are tested:
scripts/browser-check/notices.mjs, in CI, checks a browser withoutDecompressionStream(removed before the page loads), a compiler request answered 404, a compiler that is not a gzip, and a standard library whose transfer breaks off; all four pass in Chromium 149 and Firefox 157. Against a build of the commit before #8's change, the first three fail, the first two showing "Agda ready | 0 goals" after 60 s, the silence #8's comment of 2026-10-05 found; the fourth, added in review, fails against the commit before it, with the browser's error and no file named. A server that exited when the page had not asked it to left "Agda ready" on screen; it now shows "Agda stopped: the language server exited with code 0." (an LSPexitsent withoutshutdown, checked through an instrumented build). - IndexedDB is optional: with
indexedDBremoved from the worker's global before it ran, or replaced by one whoseopenthrows at once, the page checked and reloadedMain.agda, and no cache database was made; with it, the database was made.
Status. Adopted 2026-10-08 (#8). Open: WebKit.
10. The library archives¶
(See also #12, #13, #14, #61, #11, and
docs/notes/library-archives.md.)
Decision. agda-algebras' interfaces, and those of the standard-library
modules it imports, are built in the Nix sandbox by the compiler's plain
agda.wasm under wasmtime, over a stage laid out as the page's drive, and
packed into stored zips so that the archives an import needs hold its
closure's interfaces and nothing else, with an index taken from Agda's own
dependency graph. An interface is the file Agda writes for a checked
module and reads in place of checking it again; a module's closure is
every module it imports, directly or not, itself included.
- Built by the page's Agda, at the page's paths: the compiler's
agda.wasm(decision 20), run with a directory laid out from the archives the page mounts (agda-data.zip, the standard library's archive, agda-algebras' sources) as the guest's root,HOME=/home/rootandAgda_datadir=/, as the page's server.nix build .#agda-algebras-interfacesbuilds them,.#agda-algebras-archivespacks them, and.#agda-algebras-checkchecks them. - What is built: every module of agda-algebras' include path,
Legacy/included (351 atd32f045f), withagda --build-library, which finds them itself in a fixed order; and the standard-library modules they import (253 of 1,154), not the whole library. - The pin: agda-algebras at
d32f045f(its master on 2026-10-15), afetchFromGitHubwith its hash beside the standard library's source inflake.nix, so a move is one edit and leavesflake.lockalone. It wasf067d57d(its master on 2026-10-10) until agda-algebras' master history was rewritten on 2026-10-14, and the evidence below was measured there. Its sources ship as their own archive,agda-algebras-sources.zip, beside the standard library's, mounted at/agda-algebras. - The packing: one archive per agda-algebras module; the standard-library modules grouped by the set of agda-algebras modules that reach them, one archive per group. A group is needed whole or not at all by any set of agda-algebras imports, so nothing is fetched beyond the closure but zip headers. Stored, since the interfaces' payload is zstd already; every file under 25 MiB.
- The index:
index.jsonbeside the archives, schema 1: the Agda version and theagda.wasmdigest, the libraries with their pins and paths, the roots, every archive with its bytes and SHA-256, and every module with its paths, its archive and its successors in Agda's transitively reduced graph, whose reachability is exact. Closures come from that graph, never from the sources. - The check: every root, on a fresh stage holding only the archives
the index names for it, type-checks a
Mainimporting it with exactly oneCheckingline; two controls must print more. - CI: a job of its own, path-filtered on what the archives are built
from and what the gate below is made of, which builds nothing when the
check's derivation is the base's and the gate's code is unchanged; it
builds, rebuilds, packs and checks when the derivation changed, and
builds the archives and runs the gate alone when only the gate's code
did. It reads the public
formalverificationCachix cache and pushes to it frommainonly. The site carries the index and the archives since #14 (§ 12). - The gate (#13): the check again under the language server the
site ships, its reactor, in headless Chromium, through the engine's
browser transport: every root in a fresh session holding only the
archives the index names for it must type-check
Mainalone, with no error, and the same two controls must type-check more. A session (one engine: a worker, its drive and its reactor) per root, not one shared by the roots that each of the checks run at once takes in turn, since a shared session's drive holds earlier roots' archives and Agda keeps what it decoded, so it could not show that a root needs only its own. The same job runs it, every root, when the archives' derivation changed or the gate's code did (its app's store path, the engine's core and browser transport, its page, the lockfile, theMakefile). - The drive's libraries (#13): the engine lays the drive out from a
list of libraries (
BrowserConfig.archives.libraries), each a zip extracted at the root with its.agda-libpath and its name, and writes Agda's libraries and defaults files from it after the standard library; the page passes PLFA as its one entry. A root library (a project's own.agda-lib, here/play/play.agda-lib) is the host's to write. - Licenses: agda-algebras' interfaces are Apache-2.0, like its
sources, since an interface holds its module's source text; the index
is data under agda-algebras'
LICENSE-data(Apache-2.0 or CC0-1.0); the standard library's interfaces are MIT.
Evidence. Measured 2026-10-11 on this workstation (20 cores, 64 GB,
Linux 7.0.0-31-generic) and on GitHub's runner; #12's findings of that
date have the runs, and docs/measurements/library-archives-2026-10-11.json
the local ones.
- The build: in the sandbox,
--build-librarychecked all 350 modules of agda-algebras and 251 of the standard library, and no builtin (their interfaces fromagda-data.zipwere accepted), in 5 min 54 s to 6 min 59 s on a quieter machine and 10 min 27 s to 12 min 27 s on a loaded one, holding 995 MiB of GHC's total memory in use, a quarter of a wasm32 heap's 4 GiB. wasmtime's compile ofagda.wasm, once per derivation, is the peak: 4.4 GiB for 14 to 23 s. - Reproducible: six builds wrote the same bytes, one of them outside the
sandbox at a host path, the third by
--rebuild, and--rebuildof the archives passes; a timestamp written into the output makes it fail. Every build sees the guest's paths, but the order still matters: built through a generatedEverything.agda, the same inputs gave 600 of 601 interfaces identical and the umbrella moduleagda-algebraswith 70 more deprecation warnings stored (314,087 bytes against 284,544). - The packing: 395 archives, 70,104,812 bytes, the largest 6,965,690.
Setoid.Varieties.HSPneeds 128 of them, 39,251,541 bytes against a floor of 39,186,131; #12's 2.8.0 tiers, on the same interfaces, fetch 15,858,563 bytes forOverture.Basicagainst a floor of 4,306,193. Compression buys 0.09% (the payload is zstd). - The check: 350 of 350 roots type-checked
Mainalone, eight at once in 7 min 21 s; the two controls printed 2Checkinglines each. - On the runner (2 cores, 7.8 GiB; run 38153481044):
--build-libraryin 10 min 33 s (981 MiB), its--rebuildpassed, and the check, two at once, in 30 min 6 s, 350 of 350; the whole job 58 minutes, no swap used. Its index is byte-identical to the one built here, so all 395 archives reproduce across machines. A push that left the check's derivation as it was built nothing, in 21 s. - The gate (2026-10-12, headless Chromium 149, this workstation, four
at once, with other sessions' builds beside it;
docs/measurements/library-archives-browser-2026-10-12.json): 350 of 350 roots type-checkedMainalone under the server, which reports Agda 2.9.0, in 12 min 49 s; the controls printed 2Checkinglines each, and archives withOverture.Basic's emptied failed it and its importer, exit 1. Agda's load took a median 7.9 s, the slowest 16.8 s; the umbrella module 15.0 s at a heap of 735,248,384 bytes, a sixth of a wasm32 heap. Summed over the roots, 3,020 s, of which the sessions' starts were 313 s. A session shared by each of the four checks run at once took 85 s, its heaps ending at 844,693,504 to 906,166,272 bytes, so the heap did not decide between them. On GitHub's runner (4 cores; run 38209105006, dispatched on #13's branch), 350 of 350 and the controls 2 and 2; four at once each, the check underagda.wasmsummed 2,498 s and the gate's loads 3,369 s (3,908 s with the starts and mounts), so the browser takes 1.3 to 1.6 times wasmtime's time. Over that run and the pull request's two, the gate's step took 17 min 18 s to 23 min 56 s, and the whole job 49 min 0 s to 66 min 28 s (runs 38209105006, 38213187621, 38243413321). After the branch was rebased onto #64's engine, the gate gave the same counts at 495a793. - The drive's libraries (2026-10-12): unit tests pin the registry the
drive writes (the standard library alone, with PLFA as the page has it,
with two libraries, with none) and a failed fetch's words; the page's
browser check, both ways, its notices and the browser's conformance
suite passed in
site.ymlon this branch (run 38243413314), and the suite on both engines here; with the PLFA archive removed from a copy of the site, the page still says "PLFA could not be downloaded (HTTP 404 Not Found)".
Status. Adopted 2026-10-11 in #12's pull request; the gate and the
drive's list of libraries 2026-10-12 in #13's. The site ships the
sources archive since #11's pull request, for the playground's project
(§ 11), and the index and the interface archives, mounted as a check's
imports need them, with their cache and their license notice, since
#14's (§ 12). The cache's write token reached main's archives job on
2026-10-13 (run 38448805227, the first to push), so a change to the gate
alone, or a build of the site, fetches the interfaces main built rather
than building them again (§ 12). Open: the benchmark over these roots
(#18).
11. The playground's project¶
(See also #11, #13, #14, #16, and
docs/notes/runtime.md's "The playground's project".)
Decision. The playground's Main.agda is a module of a project of its
own, /play/, whose library depends on the standard library and
agda-algebras, under agda-algebras' own options line, so that a postulate
or a TERMINATING pragma is refused there as the library refuses it. The
playground is the page's scratch buffer, which the agda-algebras site's
"Playground" link opens; a root library is a project's own .agda-lib.
- The layout:
/play/Main.agdabeside/play/play.agda-lib(name: play,depend: standard-library-2.3 agda-algebras,include: .), asstage.shwrites it and the gate checks every root under; agda-algebras' sources archive in the drive's list of libraries, at/agda-algebras, before PLFA's, which stays at the root for its chapters. - The site ships the sources archive,
agda-algebras-sources.zip, built by the flake from the pinned commit (decision 31), checked bymake assets-check, with a cache token, in the drive cache's namespace, and inNOTICEunder Apache-2.0. - The host names the drive's first files: the engine lays out the
files the host names (
BrowserConfig.files), inside the transport's root, after the archives and over what the drive's cache restores, where it held an empty/Main.agda; the page namesplay.agda-lib. - The default
Maincarries{-# OPTIONS --without-K --exact-split --safe #-}, imports only builtins, whose interfaces the site ships, and opens one goal on the first screen; after a load that leaves goals, the page asks for the selected goal's context and shows it with the goal. - The stored buffer's key is named by its path,
agda-web-ide-beta:doc:/play/Main.agda; nothing migrates from the old key, since nothing is deployed.
Evidence. Measured 2026-10-12 on this workstation in headless
Chromium 149, with other sessions' builds beside it (load 1.4 to 10);
docs/measurements/playground-2026-10-12.json has the runs.
- The browser check passes on the new default:
Mainalone type-checked, one goal with its type and its twelve context entries, Infer, the give that closes the goal, a type error, a postulate refused with[SafeFlagPostulate]at its position, andimport Overture.Signaturestype-checked from source with its 10 standard-library modules. Three controls, each restored afterward, fail it: the default without--safe(the postulate is accepted), agda-algebras left off the drive (the first check fails with Agda's[LibraryError], "Library 'agda-algebras' not found"), and no context read after a load. - Which flags reach
Main: only its own line and its library'sflags:;--safein the standard library'sflags:left a postulate in a play module accepted, and inplay.agda-librefused it (native Agda 2.9.0 at the compiler's commit). - What it costs: one more request on a first visit, 985,864 bytes;
the first check of the default 0.40 s against 0.27 s for the previous
default (medians of five alternating runs on a quiet machine; the ratio
held under load);
open import Setoid.Algebras.Basic, 170 modules from source, 1 min 38 s to 6 min 32 s cold over six runs (median 2 min 35 s) and 3.3 to 11.9 s after a reload, against 3.7 s from its 50 archives (decision 38's gate), which still type-checkMainalone with PLFA's library on the drive. - The engine passes the conformance suite, 12 of 12 on both engines and identical, after the change to the drive's first record.
Status. Adopted 2026-10-12 in #11's pull request. The interface
archives an import needs are mounted, with consent and a cache, since
#14's (§ 12). Open: the three exercises, which land in /play/ beside
Main (#16).
12. Mounting what the imports need¶
(See also #14, #12, #13, #11, #6, #24, and
docs/notes/library-archives.md's "The mount in the
page".)
Decision. The site serves agda-algebras' archive index and interface
archives from its own origin, and before a check of the playground's Main
the page mounts the archives its imports need: those the browser keeps are
read from its store, and the rest are fetched only after the page has
stated their bytes and the reader has agreed. To mount an archive is to
extract its interfaces onto the drive Agda reads; the archive store is an
IndexedDB database in which the browser keeps fetched archives by their
SHA-256; the drive's cache is the database, named by a digest of the
assets (its namespace), in which the drive keeps what Agda wrote.
- The origin: the site's own,
/agda-algebras/index.jsonand/agda-algebras/interfaces/*.zip, copied fromnix build .#agda-algebras-archivesby the site's derivation andmake assets, with a?cache=token from each archive's SHA-256. Not a GitHub release: its files send noAccess-Control-Allow-Origin, so the page cannot read them.static/_headersis unchanged; the host is #6's. - The plan: the imports are read from the buffer by Agda's own
lexical and literate rules; builtins (
Agda.*) need none; the closure is the index's (needsof #12); an import the index lacks is followed into its source on the drive, and its imports join the plan. The plan and the description of the library (its sources, its index, its archives' base, each with its bytes and digest) are@agda-native-ide/manifest's, validated, for #24's plugin manifest to generalize. - What is not mounted: an archive already mounted, and one whose every interface the drive holds (written by an earlier check from source): Agda accepts an import by the hash of its source and its imports', not by the interface's bytes.
- The question: the bytes still to fetch (in bytes, KB of 1,024 bytes or MiB, with the exact count), the archives, the modules, the origin; Fetch, Check from source or Cancel; the answer remembered for the tab if the reader asks, and a decline remembered for its archives. Nothing is fetched before the answer, and the question shows no spinner.
- The fetch and the store: at most six archives at once, with their progress in bytes; each checked against its SHA-256 and kept in the store, which a second visit reads with no request; the index evicts what it no longer names; STOP ends a fetch, and nothing is checked after a stop or a failure, which names the archive.
- The drive's cache: the index's digest joins its namespace; drive databases of other namespaces are deleted when the page starts; a mounted archive's paths leave the cache, so its bytes are kept once.
Evidence. Measured 2026-10-13 on this workstation in headless Chromium
149 (docs/measurements/library-mount-2026-10-13.json).
- The origin: a page at
127.0.0.1fetching a GitHub release asset ofagda-wasm-buildsfailed (TypeError: Failed to fetch); a GitHub Pages file fetched. The built site went from 30,439,204 to 100,856,795 bytes, and its build from the archives' derivation reads the cache in CI and builds the interfaces untilmainpushes them. - The plan: the reading's closure equals Agda's for 597 of the 601
modules of agda-algebras and the standard library, the other 4 by the
implicit
Agda.Primitive; the plan equalsneedsfor every root (a unit test, and CI over the built site's index);open import Data.Vecplans 29 archives where the index alone planned none. - What is not mounted: interfaces the page wrote from source were
byte-identical to the archives' (11 of 11, and 170 of 170 for
Setoid.Algebras.Basic's closure, which took 5 min 0.5 s); the hash Agda checks isiFullHash(Agda.TypeChecking.Monad.Base, andAgda.Interaction.Importsat the compiler's commit). - The browser check (its steps on the mount, with and without the
isolation headers):
import Overture.Signaturesasks for 202.1 KB (206,933 bytes), 3 archives holding 11 modules, with no request before the answer, Esc canceling and a second check asking again, then fetches exactly those 3 and type-checksMainalone; a second visit asks nothing, requests no archive and type-checks nothing, and a drive database of another namespace is gone;Setoid.Varieties.HSPasks once, for 37.2 MiB (39,044,608 bytes), the 125 archives not yet mounted, fetches exactly those and type-checksMainalone; an archive kept under another digest is evicted, asked for alone and fetched again, once; with the answer remembered, the bytes are stated in the status bar about a millisecond before the request; a declined fetch requests nothing, mounts what the browser keeps, and Agda checks the declined archive's one module alone, not evenMain, accepting the archived interfaces above it. Four controls fail it: a store whose reads miss, a page that requests an archive before the answer, no eviction, and a decline that mounts nothing. The notices: an archive not found, an archive that is not its digest's, and the index not found, after whichMainchecks from source. - Times (local server, a 1-minute load of 2 to 3, medians of three):
the mount took 58, 157 and 419 ms and the check 1.06, 3.21 and 6.54 s
for
Overture.Basic,Setoid.Algebras.BasicandSetoid.Varieties.HSP(14, 50 and 128 archives); a second visit mounted them from the store in 43, 96 and 188 ms. A second sample at a load of 1.8 to 4.9 took 77, 176 and 599 ms, and 1.25, 3.73 and 8.56 s. The gate passed both roots it was given with the transport changed.
Status. Adopted 2026-10-13 in #14's pull request. The site's build
reads the cache, which main fills since 2026-10-13 (the write token,
§ 10). Open: what the page loads when Agda starts, and PLFA's
chapter archives, are not stated in bytes before they start, which
Milestone 1's exit criterion asks of every download; #24's plugin
manifest, which generalizes the library's description.
13. The releases¶
(See also #108, #58, #61, #13, ualib/agda-algebras#597,
compiler/build-agda-2.9.0.sh, and
docs/provenance.md.)
Decision. The page moves from the pre-release Agda it was built on (§ 7) to the releases: Agda 2.9.0, the language server's first release for it, and the standard library 2.4.1, unpatched; agda-algebras' archives are rebuilt from its own move to the same releases. William's decisions of 2026-11-24 set the target: the standard library 2.4.1 now, rather than a wait for 3.0.
- Agda: agda/agda's tag
v2.9.0(da046d69, 2026-11-13), 67 commits after thenightlyda66a8c7, built as before and unpatched; the Hackage index moves to the tag's time, 2026-11-13T06:53:39Z. - The language server: agda/agda-language-server's tag
v11(2aab2ac6, 2026-11-20), which adds theAgda-2-9-0flag and ports the server to Agda 2.9.0's API itself (its PR 73). Of § 7's two patches, the first shrinks to the one import v11's reactor module still lacks (compiler/patches/agda-language-server-reactor-setup.patch); the second, the wasm project file, stays, with the new index state, since v11'scabal.project.wasm32is v8's. - The toolchain is unchanged: Agda's
flake.locknames the same ghc-wasm-meta,58260711, at the tag as at the nightly. - The binaries: a new release of formalverification/agda-wasm-builds,
agda-2.9.0-da046d6-als-11, holds the four pinned files, the plans and GMP's source;compiler/agda-2.9.0.sha256pins them. - The standard library: agda/agda-stdlib's tag
v2.4.1(ac7c79b2, 2026-11-17), as released, shipped asagda-stdlib-2.4.1.zip; its library isstandard-library-2.4.stdlib/patches/is removed. - agda-algebras: its sources, module list and archives from
66c324f8, the merge of its PR 642, which moved it to the same releases (ualib/agda-algebras#597); built by the new compiler'sagda.wasm, as row 20 requires, since the interfaces' format version changes. - The native Agda (the companion's tests and the native engine) moves to the same tag, and the companion's fixture to the same agda-algebras commit.
Evidence. Measured 2026-11-24 and 2026-11-25 (UTC) on this workstation (20 cores, 64 GB), with other sessions' builds running beside these, so the times are upper bounds; #108's findings have each run.
- The compiler builds from the releases: the recipe, from an empty work
directory, ran 35 min 8 s (the plain
agda20 min 15 s, the server's command module 12 min 41 s, the reactor 8 s over it), peak resident memory 9.0 GiB;agda.wasmis 34,508,797 bytes,als.wasm36,179,686 andals-reactor.wasm36,112,189 (34,277,969, 35,880,158 and 35,817,413 at the nightly), and the reactor's glue is the same file. A second run from an empty work directory at the same path built the same four files and the same three plans, byte for byte (32 min 23 s). - The patches: v11 does not take the old server patch (
git apply --checkfails in 9 of its 11 files), and builds for Agda 2.9.0 with the reactor import alone; the wasm project patch applies to v11 unchanged but for its index state. Agda itself was never patched (§ 7). - The plans move a little: the server's link closure is still 141 packages, with five Hackage packages at newer versions (case-insensitive 1.2.2.0, enummapset 0.7.4.0, nonempty-vector 1.0, regex-tdfa 1.3.2.7, scientific 0.3.10.0) besides the server's own; NOTICE § 3 lists them, regenerated from the plan, and nonempty-vector 1.0 ships a license text of its own, so the one NOTICE supplied is gone.
- The interface format changes: the header version is 202610261 at
the tag (202610030 at the nightly), in all 41 builtin interfaces and
all 596 of the archives' interfaces, so every interface the page ships
is rebuilt, by the new
agda.wasm. - The standard library 2.4.1 checks whole, unpatched: all 1,187
modules under the native Agda at the tag (
agda --build-library, exit 0, 209 s); the 253 that agda-algebras imports under the newagda.wasmin the archives' build. - agda-algebras checks whole under the compiler: the interfaces build
checked all 343 of its modules and 253 of the standard library's, and
no builtin, in 641 s; the cold check, every root from only the
archives the index names, passed 343 of 343, its two controls 2 lines
each. The archives are 392 (343 modules and 49 standard-library
groups), 73,285,365 bytes, against 398 and 71,419,730 at
d32f045f. - #13's gate passes: in headless Chromium 149 under the new site's
reactor, each root in a fresh session with only its archives, 343 of 343
checked
Mainalone, and both controls checked 2 modules, in 633 s four at once; on main's site and archives the same gate passed 351 of 351 in 844 s, beside the compiler's build (baseline, 2026-11-25). - The page: the browser check passes in Chromium 149, once its
hover expectation follows v11's rendering, which prints a type as Agda
does (
Level, where v8 with the patch printedAgda.Primitive.Level); the notices check passes; the conformance suite passes 13 of 13 in the page and against the native Agda at the tag, 12 answered identically and one differing only by the declared batch lane.make testpasses all 5,552 tests oncemake assetshas filledstatic/(without the assets, the five that read the shipped index and module list skip), andmake checkpasses.
Status. Adopted in #108's pull request. Open: agda-native-air
still pins the nightly and the patched v2.3 (docs/agents.md); the 2.8.0
compiler's pin (row 22).
14. Decision log¶
| # | Decision | Status | Evidence |
|---|---|---|---|
| 1 | Fork plfa-playground whole, not als-demo or the plain checker; keep its two workers, transport, give rule, archive format and persistence | Adopted (#2); its two workers and their shared memory superseded by row 23 | als-demo sends only Cmd_load; the fork builds, tests and checks Main.agda here (§ 3) |
| 2 | Import a snapshot of ae0aa84c, 89 files byte for byte, with a per-file SHA-256 record; no history merge |
Adopted (#2; the plan's wording changed to match, 2026-10-05) | 67 binary blobs, 171,397,049 bytes, in upstream's history; blob ids equal |
| 3 | Keep upstream's colliding files at new paths (README.plfa-playground.md, LICENSE.plfa-playground, app.yml); merge its .gitignore; leave out wrangler.jsonc |
Adopted (#2); app.yml later replaced by site.yml (#5) |
docs/provenance.md |
| 4 | Every change to an imported file is its own commit, with a header comment or a provenance row, and leaves upstream/unchanged.sha256 |
Adopted (#2) | make provenance-check |
| 5 | Sync file by file from the record, with git merge-file for changed files |
Adopted (#2) | Rehearsed on a constructed later commit (§ 2) |
| 6 | Pin upstream's binaries by SHA-256 (36; 35 since #49 builds the builtins), one fixed-output fetch per file; check the pinned files in static/ before every build |
Adopted (part of #4) | A changed pin fails the fetch; a flipped byte fails the build (§ 3) |
| 7 | Do not pin upstream's compiler gzip | Adopted | The build writes its own, and since #8 the dev server serves one; the raw fallback is removed (§ 3, rows 15 and 27) |
| 8 | Node 22 in the dev shell | Adopted (part of #3) | 22.22.2, inside upstream's engines range |
| 9 | NOTICE plus licenses/, published as NOTICE.txt and licenses/; upstream's NOTICE.md removed |
Adopted (#48) | Every text read at its source (§ 4) |
| 10 | GMP under LGPL-3.0-or-later, relinking met by the pinned sources and the recipe | Adopted (William, 2026-10-07, #53's comment) | Each public release of the compiler carries GMP's source and GHC's patches (§ 4) |
| 11 | The Agda mark stays, under Agda's MIT license | Adopted (#48) | Agda.cabal's extra-doc-files |
| 12 | The plain checker is the planned verdict of record, not adopted here | Recorded (#30) | PR 585: no isolation; JSPI 1.45 s reloads, 45 to 55 ms queries |
| 13 | Native interfaces are accepted; the drive is the cost; the builtins were stale, and are built since by the flake, from the Agda the server embeds | Settled; the builtins' fix adopted (#49, 2026-10-06) | #13, #50, #49; § 6 |
| 14 | The open license questions wait until before the repository goes public; the notice stands as written meanwhile | Adopted (William, 2026-10-05; #53) | § 4 |
| 15 | The built site does not ship the raw compiler; the page's silence without it is proposed for #8 | Adopted (#3, 2026-10-05); the silence answered by row 27 | Only Safari 15.2 to 16.3 could use it; 33 MB a deploy; Cloudflare Pages' 25 MiB file limit (§ 3) |
| 16 | The compiler is this repository's build: Agda 2.9.0 at da66a8c7 and the language server v8 with two patches, for wasm32-wasi, with ghc-wasm-meta 58260711 and the Hackage index pinned; no agda-web patch |
Adopted (#58, 2026-10-07) | Agda's suites pass under it; the server needed 21 version-guarded branches; the browser check passes (§ 7) |
| 17 | The recipe is a script in a pinned dev shell and an optional CI job; nix build .#compiler fetches its four files by hash |
Adopted (#58; its first criterion reworded) | Two Agda builds, 27 minutes from empty on 20 cores and 78 on GitHub's 2-core runner, which needs swap; a second run here and the runner built the same bytes (§ 7) |
| 18 | Built without use-xdg-data-home: the data directory is Agda_datadir itself |
Adopted (#58) | The page's layout and agda-data.zip's root unchanged (§ 7) |
| 19 | The binaries live in releases of a public repository of this organization | Decided by William, 2026-10-07; created the same day, formalverification/agda-wasm-builds | Its release agda-2.9.0-da66a8c-als-8 holds the four pins, and CI fetches from it (§ 7) |
| 20 | Every interface the page ships is built by a wasm32 Agda; the builtins by the compiler's agda under wasmtime |
Adopted (#58) | Agda 2.9.0 writes interfaces at its word size: native interfaces are checked again, or hang (§ 7) |
| 21 | The page ships the standard library 2.3 patched as in #61's row 2b, with two later fixes from agda-stdlib's master |
Adopted (William, 2026-10-07; the two fixes the same day) | No released version checks under 2.9.0 (#61); with the five patches the whole library checks (§ 7) |
| 22 | The 2.8.0 compiler stays pinned, unshipped, with its recipe, until the 2.9.0 one passes #13's gate | Adopted (#58); the gate passes since 2026-10-12 (row 38), so its removal is open | nix build .#compiler-2_8_0 (§ 7) |
| 23 | The runtime needs no cross-origin isolation: the page runs the server's reactor build in one worker with the drive, sharing no memory; the headers, the service worker and both checks are removed | Adopted (#59, 2026-10-08) | The browser check passes with the headers and without, in Chromium 149 and Firefox 157; "Agda ready" 650 against 907 ms, warm reloads 9 to 22% faster, a drive call 0.2 µs against 11 to 20 µs (medians; § 8) |
| 24 | The site ships the reactor and its glue, the glue imported by its URL, not bundled; the command module stays pinned, unshipped | Adopted (#59) | The shipped glue is the pinned file (make assets-check); NOTICE § 3 from the reactor's own plan, 141 packages (§ 8) |
| 25 | The status bar shows Agda's own version, asked with Cmd_show_version when the server is first ready |
Adopted (#59) | The reactor has no --version, and the server sets no serverInfo; the browser check asserts "Agda 2.9.0" (§ 8) |
| 26 | The server starts with no RTS options: the fork's +RTS -A64m -RTS is removed |
Adopted (#59) | It takes effect (a heap of 94 against 24 MiB) and made no check faster (§ 8) |
| 27 | A browser that is hard to support is not supported: the page checks what it needs, names what is missing and the browsers it is tested in, and shows a failure to start; no polyfill, shim or fallback | Adopted (William, 2026-10-07; #8, 2026-10-08) | Four notices tested in CI, failing against the page before; the needs first coincide in Chrome 96, Firefox 114 and Safari 16.4 (§ 9) |
| 28 | The editor takes its text as the one Agda's positions refer to only when the page sends Cmd_load |
Adopted (#59) | Agda keeps a goal's loaded range after a give; the old commit point hung 3 of 8 runs in Firefox, the new none of 18 (§ 8) |
| 29 | agda-algebras' interfaces are built in the Nix sandbox by the compiler's agda.wasm under wasmtime, over a stage laid out as the page's drive from the archives it mounts, mounted as the guest's root |
Adopted (#12) | 350 + 251 modules checked, no builtin; the interfaces land where the server looks; Agda 2.9.0 interfaces do not cross word sizes (row 20) (§ 10) |
| 30 | Every module of agda-algebras' include path is built, with agda --build-library; the standard library only as far as it is imported |
Adopted (#12) | --build-library sorts its paths, so its order is fixed; 995 MiB of a 4 GiB heap; the standard library's other 903 modules are not needed (§ 10) |
| 31 | agda-algebras is pinned by fetchFromGitHub in flake.nix, at d32f045f; its sources ship as their own archive, beside the standard library's, at /agda-algebras |
Adopted (#12) | Like the standard library's pin, one edit; flake.lock untouched; the sources archive is 1,012,304 bytes and changes only with agda-algebras (§ 10) |
| 32 | One archive per agda-algebras module; standard-library modules grouped by the agda-algebras modules that reach them; stored zips, each under 25 MiB | Adopted (#12); supersedes #12's 2.8.0 tiers | Any set of agda-algebras imports fetches its closure and zip headers: the HSP root 39,251,541 bytes against 39,186,131; the 2.8.0 tiers fetch 15.9 MB for Overture.Basic against 4.3 MB (§ 10) |
| 33 | The index is JSON beside the archives, schema 1, its closures from Agda's --dependency-graph |
Adopted (#12) | Agda's graph is built from the interfaces' imports and reduced transitively, so reachability is exact; a regular expression misses nested imports (#12, 2026-10-04) (§ 10) |
| 34 | Every root is checked cold from the archives the index names, exactly one Checking line, with two controls that must fail |
Adopted (#12) | 350 of 350, here and on GitHub's runner; the controls print 2 lines each (§ 10) |
| 35 | CI builds, rebuilds, packs and checks them in a job of its own, path-filtered, and skipped when the check's derivation is the base's and the gate's code is unchanged (row 39); it reads the formalverification Cachix cache and writes it from main; the site did not carry them until #14 |
Adopted (#12; the cache and the rebuild on pull requests, William, 2026-10-11, the repository public); the site carries them since #14 (row 44) | 58 minutes on a 2-core runner, uncached; 21 s when nothing changed (§ 10) |
| 36 | agda-algebras' interfaces are Apache-2.0 like its sources, not LICENSE-data's extracted data; the index is LICENSE-data's |
Adopted (William, 2026-10-11, on the session's recommendation) | A 2.9.0 interface holds its module's source text (iSource); LICENSE-data excludes the sources in whole or in part (§ 10) |
| 37 | The engine lays the drive out from a list of libraries (archive, .agda-lib, name) and writes Agda's registry from it; the page passes PLFA as one; a root library is the host's |
Adopted (#13) | One registry written at startup held only the standard library and PLFA (#11, 2026-10-04); the registry pinned by unit tests, and the page's browser check, notices and conformance suite passing on it (§ 10) |
| 38 | Every root of agda-algebras is checked under the site's reactor in headless Chromium, each in a fresh session with only its archives, exactly one Checking line, with two controls that must fail |
Adopted (#13) | 350 of 350, 12 min 49 s four at once here; the controls 2 and 2; a shared session per job took 85 s but cannot show a root needs only its own archives (§ 10) |
| 39 | CI runs the gate in the archives' job, every root, when the archives' derivation or the gate's code changes | Adopted (#13) | On the 4-core runner the gate's step took 17 min 18 s to 23 min 56 s, 350 of 350, in jobs of 49 to 66 minutes (runs 38209105006, 38213187621, 38243413321); it runs only when its own inputs change, so pull requests need no subset of the roots (§ 10) |
| 40 | The playground's Main is /play/Main.agda in a project of its own, play.agda-lib depending on the standard library and agda-algebras; the site ships agda-algebras' sources archive, mounted at startup beside PLFA's |
Adopted (#11) | The gate's layout; without agda-algebras on the drive the default fails with [LibraryError]; one more request, 985,864 bytes (§ 11) |
| 41 | The engine lays out the files the host names in place of an empty /Main.agda of its own |
Adopted (#11) | The conformance suite 12 of 12 on both engines and identical; a file outside the root is refused before anything is fetched (§ 11) |
| 42 | The default Main carries agda-algebras' options line, imports only builtins, and opens one goal, whose context the page shows after the check |
Adopted (#11) | Main alone type-checked; a postulate refused with [SafeFlagPostulate]; controls without --safe and without the context read fail the browser check (§ 11) |
| 43 | The stored buffer's key is named by its path, with no migration from the old key | Adopted (#11) | Nothing is deployed, so no reader holds a document under the old key (§ 11) |
| 44 | The site serves agda-algebras' index and interface archives from its own origin, from the archives' derivation; not a GitHub release | Adopted (William, 2026-10-13, on the session's proposal, after the release was measured) | A release's files send no CORS header, so the page cannot fetch them; the site 30,439,204 to 100,856,795 bytes; its build reads the cache and builds the interfaces until main pushes them (§ 12) |
| 45 | Before a check of the playground's Main, the page plans the archives from its imports by Agda's own reading rules and the index, following an import the index lacks into its source on the drive; builtins need no plan |
Adopted (#14) | The reading's closure is Agda's for 597 of 601 modules, 4 by Agda.Primitive; the plan is needs for every root; Data.Vec plans 29 archives, not none (§ 12) |
| 46 | The page states the bytes still to fetch, the archives, the modules and the origin, and asks; nothing is fetched before the answer; an answer may be remembered for the tab, and a decline is remembered for its archives | Adopted (#14) | The browser check's import and HSP steps, and a control that requests an archive early fails the import step (§ 12) |
| 47 | The browser keeps fetched archives in IndexedDB by their SHA-256, checked on arrival, and the index evicts what it no longer names | Adopted (#14) | A second visit requests no archive; a changed archive is fetched once and its old copy evicted; controls without reads or without eviction fail (§ 12) |
| 48 | A mount skips an archive whose interfaces the drive already holds | Adopted (#14) | Agda checks iFullHash, not the interface's bytes; the page's interfaces from source were byte-identical to the archives' (181 of 181) (§ 12) |
| 49 | The index's digest joins the drive cache's namespace; drive databases of other namespaces are deleted when the page starts; a mounted archive's paths leave the drive's cache | Adopted (#14) | The browser check's second visit deletes a planted database; a unit test of the drive (§ 12) |
| 50 | static/_headers is unchanged; a second visit's lack of requests comes from the store, whatever the host caches |
Adopted (#14) | Cloudflare Pages joins two Cache-Control rules with a comma; the host is #6's (§ 12) |
| 51 | The compiler is built from the releases: Agda's tag v2.9.0 (da046d69) and the language server's tag v11 (2aab2ac6), with ghc-wasm-meta 58260711 and the Hackage index at the tag's time; supersedes row 16's sources |
Adopted (#108, 2026-11-25) | The same toolchain; the four files built and pinned, the same bytes again from an empty work directory (§ 13) |
| 52 | Of the server's patches only the reactor's import of Agda.Setup remains, with the wasm project file |
Adopted (#108) | v11 ports the server to Agda 2.9.0 itself; the old patch fails on 9 of its 11 files; v11's reactor module calls setup, and none of its imports provides it (§ 13) |
| 53 | The binaries live in a new release, agda-2.9.0-da046d6-als-11; a release does not change once published |
Adopted (#108) | The release's directory carries its sources, patches, plans, NOTICE and license texts, as row 19's (§ 13) |
| 54 | The page ships the standard library 2.4.1 as released; stdlib/patches/ is removed; supersedes row 21 |
Adopted (William, 2026-11-24, 2.4.1 rather than a wait for 3.0) | All 1,187 modules check under the native Agda at the tag; the 253 agda-algebras imports under agda.wasm (§ 13) |
| 55 | agda-algebras' sources, module list and archives come from 66c324f8, its own move to the releases, built by the new agda.wasm; the companion's fixture and the native Agda move with them |
Adopted (#108) | Every shipped interface at the tag's format, 202610261; the gate 343 of 343 under the page's reactor, the controls 2 and 2 (§ 13) |
References¶
- Issues: #2 (the fork), #3 (the Nix build), #4 (the pins), #5
(CI), #6 (hosting), #7 (this record), #8 (the page's notices, once a
page that could not isolate itself), #9 (the Explorer, in
docs/notes/explorer.md), #10 (the editor's states, and agda-algebras' modules read-only, in the runtime note's "The editor's states"), #11 (the playground's project, § 11), #12 (the library archives, § 10), #13 (interface acceptance), #14 (mounting the archives, § 12), #16 (the exercises), #18 (the benchmark), #20 (PLFA's removal), #30 (the second lane), #48 (the notice), #49 (the builtins), #50 (the drive), #53 (the license review before going public), #58 (the 2.9.0 compiler), #59 (the reactor), #61 (the library under 2.9.0), #62 (the shared core), #64 (the native engine), #108 (the releases). - Elsewhere: agda-algebras PR 585 and its ADR-011;
agda-native-air's browser IDE proposal; plfa-playground
at
ae0aa84c. - Documents:
docs/notes/runtime.md(how the runtime works),docs/notes/library-archives.md(the library archives),docs/measurements/library-archives-2026-10-11.json(their runs),docs/measurements/library-archives-browser-2026-10-12.json(the gate's),docs/measurements/playground-2026-10-12.json(the playground's),docs/measurements/explorer-2026-10-13.json(the Explorer's),docs/measurements/library-mount-2026-10-13.json(the mount's) anddocs/measurements/library-tabs-2026-10-13.json(the library's modules opened read-only, and their copies),docs/notes/explorer.md(the Explorer),docs/provenance.md(the record),NOTICE. - Code:
flake.nix(packages.assets, the pins;packages.site;apps.browser-check;packages.compiler,packages.stdlib,packages.compiler-2_8_0,devShells.compiler,agdaWasm),compiler/build-agda-2.9.0.shwithcompiler/patches/andcompiler/agda-2.9.0.sha256,.github/workflows/compiler.yml,Makefile(assets,assets-check,dev,build,test,check,browser-check,browser-check-notices,provenance-check,library-gate),upstream/(the records),scripts/upstream-record.sh,scripts/asset-manifest.mjsandsrc/lib/assets.ts(the derived cache tokens),packages/engine/src/browser/worker/als.tsanddrive.ts(the reactor and the drive, insrc/lib/worker/until #62),src/lib/support.ts(what the page needs),scripts/browser-check/(run.mjs,notices.mjs,cdp.mjs,bidi.mjs),.github/workflows/site.yml; for the playground's project,PLAYGROUNDand the drive's libraries insrc/lib/controller.svelte.ts,DEFAULT_SOURCEinsrc/routes/+page.svelte,BrowserConfig.filesinpackages/engine/src/browser/index.tswithlayOutDrivein its worker'sdrive.ts, andmkAgdaAlgebrasSourcesinflake.nix, whichpackages.assetsinstalls; for the library archives,packages.agda-algebras-interfaces,-archivesand-checkinflake.nix(agdaAlgebras, the pin),scripts/library-archives/(stage.sh,build.sh,pack.mjs,index.mjs,check.sh, and the gate,gate.mjsandgate/, withapps.library-gate) and.github/workflows/library-archives.yml; for the Explorer, the list of agda-algebras' modules,scripts/library-modules.mjs, whichmkAgdaAlgebrasModulesinflake.nixruns andpackages.assetsinstalls, andmake assets-checkruns again, with its schema,parseLibraryManifestinpackages/manifest/src/index.ts; the tree,ExplorerTree.svelteandtree.tsinpackages/views/src/; the page'sexplorerItemsandopenFromExplorerinsrc/routes/+page.svelte; andscripts/browser-check/explorer.mjs; for the mount,packages/manifest/src/imports.tsandlibrary.ts,packages/engine/src/browser/index.ts(mountArchives),archive-store.tsanddrive-caches.ts,prepareImportsinsrc/lib/controller.svelte.ts, and the browser check's steps on the mount and its notices; for the editor's states,src/lib/documents.ts(a state per open file, the read-only document, the autosave per key),showDocumentandcloseDocumentinsrc/lib/controller.svelte.ts, andcreateEditorStateand the tabs insrc/routes/+page.svelte, with the color scheme's comparison insrc/lib/codemirror/theme.ts; for agda-algebras' modules,openLibraryModuleand the library's line in the page,loadLibraryModuleandreadLibrarySourcein the controller (the session'sload(path), which writes nothing), and the code points ofsrc/lib/codemirror/lsp-hover.ts; for the copies,src/lib/playground.ts(the name, the module line, the selection, the import in Main),copyToPlaygroundin the page, andfindModule,createPlaygroundFileand the startup's files in the controller, withsourceSuffixesinpackages/manifest/src/library.ts; and the browser check's library, copy and import steps inscripts/browser-check/run.mjs.