6 entries. All books.

Contents


Prune acknowledgements that excuse nothing, fired on Nucleation

2026-11-04 00:25:45

luria repair --prune_stale (luria/prune.py, ADR-138, #385) removes acknowledgement codes that answer for no site, and deletes a directive left naming nothing.

Fired on a real case before trusting it. This ran on a scratch worktree of Nucleation at the head of dmarx/nucleation#391, after that PR had removed its 69 wholly unused directives by hand. It found 336 idle codes in 262 files, all in directives that were otherwise in use, and none of them whole directives. That matches a count taken independently, from Citation.excused_by, before the module existed. The guard’s re-scan found the loud citations unchanged, stale_annotations() was 0 before and after, and a second run found nothing. The sampled diffs removed only the idle code and left the reason text as it was.

The guard was fired on a sabotaged prune (test_the_guard_restores_the_files_when_a_finding_changes). _idle is patched to call every code idle, so a directive that is answering for a citation gets removed. The re-scan sees the citation go loud, restores the file, and raises with the code named.

Traps.

  • used(ann) is per directive. A per-code question has to go through excused_by, and that is matched by identity (id(ann)), since Annotation is a frozen dataclass whose equal copies would collide.
  • Findings are compared by (file, code) count, not by line. Deleting a directive line moves every citation under it, so a by-line comparison fails on every whole-directive removal.
  • mention-ok cannot use excused_by. The acknowledgement program gives a site to the first state-claiming directive and to a mention-ok only failing that. A mention whose site an inactive-ok holds today looks idle, and deleting it would lose the cover ADR-105 wants when the document goes Active.
  • A first draft found the cited codes per directive by scanning every site. That is quadratic: six thousand directives against the whole record’s sites. The sites are indexed by file first.

unconcretize, fired on nucleation#387

2026-11-04 04:47:32

luria unconcretize CODE... (luria/unconcretize.py, ADR-140) gives a numbered document its number back as a temporary code.

Fired on the real case before trusting it. The case was nucleation#387, whose branch filed ADR-068 while the trunk merged a different ADR-068. In a scratch worktree of that branch:

  • unconcretize ADR-068 renamed it ADR-tmpuzsbf in about 3 seconds and rewrote three files: the document’s heading, luria.yaml (five comments and blurbs) and a changelog fragment, whose link label and target both changed.
  • After a commit, git merge origin/main was clean. The add/add conflict was gone.
  • concretize then numbered the document ADR-069, recorded formerly: ADR-tmpuzsbf, and rewrote all five luria.yaml citations.

Traps.

  • concretize never rewrote luria.yaml. A temporary code cited in a config comment survived concretization as a dangling code. The fix is one file list, concretize.rewritable_files, which both commands read, config included. The fired case found it: before the change, ADR-069’s five config citations would have stayed ADR-tmpuzsbf.
  • Plain replacement is safe for a temporary tail and wrong for a number. LIT-156 is a prefix of LIT-1563, and nucleation has four-digit codes. The match is whole-token, and excludes a preceding -, so LU-ADR-068 is not touched.
  • Giving back several numbers in one commit ties them for concretize’s commit-time order. The renumbering test asserts contiguity and survival, not which document takes which number.
  • The first design scoped the rewrite to lines added since a merge base. It refused mid-merge, and refused documents that predate the branch. The owner rejected it: the user names the document, and the command should not be relative to a commit. Running before the merge gives the collision fix without it.

Fired once before trusting: luria new now refuses a title that cites a code

2026-11-21 04:29:19

The guard of ADR-143, fired on the real case that prompted it, from this repository’s code: python -m luria.cli new adr --title "Revisits ADR-001 on naming" refused with the message, and wrote nothing. Before the change the same title was scaffolded (with the installed release, which does not have the guard). The tests cover the refusal, a code in backticks passing, and a code-shaped word from no scheme passing.

Two tests in tests/test_encoding.py fail in the environment this was written in, on a missing jinja2, on main as well; they are not this change’s.


A scratch HOME hides user site-packages from a subprocess test

2026-11-26 00:24:03

tests/test_encoding.py runs luria init, index and lint in a subprocess under an ASCII locale, with HOME set to the test’s tmp_path so nothing leaks in. In an environment where luria’s dependencies were installed into the user site-packages (root’s ~/.local here), that scratch HOME hides them: the subprocess died on import jinja2, and both behavioural tests reported “init crashed under an ASCII locale” — an import error dressed as the encoding failure the tests exist to catch. CI’s runner installs into the system site-packages, so it never showed there.

Fix: one ascii_env() helper for both tests, passing the parent’s sys.path as PYTHONPATH. The import path has nothing to do with the encoding under test.

Fired before trusting (DP-006): with writes.py switched to encoding="ascii", the behavioural test fails on UnicodeEncodeError … '—' — the real failure — and passes again once restored.

The trap generalizes: any subprocess test that scrubs HOME for isolation also scrubs the user site. Pass the import path explicitly.


Measuring the Quartz site build from CI history, and a weekly timed build

2026-11-26 18:52:39

The question. Published records were getting slow to build and heavy to open, and the plan is to replace Quartz. The requirements had to come from what CI had already recorded, not from a local benchmark. So the data is every pages.yml run of luria (365 runs), nucleation (584) and mathematics-of-meaning (157), with per-step durations for samples of 32, 26 and 1 build jobs, and 23 build logs. The numbers are in ADR-148’s context. In one line: luria holds flat at about 90 s; nucleation’s site step went from 61 s (2026-09-25) to 2731 s (2026-11-25), near-linear in its artifact (r = 0.985, n = 18); Quartz’s emit phase is 84% of the build.

Traps in the CI data, for whoever reads it next.

  • Run duration is not build time in nucleation. A gate job and the pages concurrency group can hold a run queued: one run reads 2814 s and skipped its build. 75 “successful” runs of 60 s or less are gate no-ops. Use the build job’s own started_at/completed_at.
  • Logs are tailed to 5,000 lines by the API, and since 2026-10-03 nucleation’s tail is entirely upload-pages-artifact’s tar listing (about 49k lines on 2026-11-25). Quartz’s phase lines were readable for only five nucleation builds. This is why the timed build keeps its own Quartz log in an artifact and writes only phase lines to the job log.
  • Artifacts are kept for a day and logs older than about three months return 410, so the history can’t be re-read later. The weekly site-perf artifact is kept for 90 days.
  • Quartz rounds its own totals with pretty-time: a 40-minute build reads “40m”, a 58-second phase ”58s”. luria.site_perf stamp adds sub-millisecond stamps to every line.
  • luria’s September outliers (site step 506 s and 631 s on 2026-09-03) were Quartz 4.5.2’s npm install taking 4–5 minutes, not the build. Quartz 5 installs in 5–6 s.

Found along the way. mathematics-of-meaning has never published: all 157 runs fail in luria site with yaml.scanner.ScannerError: mapping values are not allowed in this context while parsing a document’s frontmatter, under luria 0.35.0 and 1.10.x alike. That is a bug in the record, the reader, or both, independent of Quartz, and should be fixed on its own. Separately, at nucleation’s size the failures are deploys, not builds: three deploy-pages runs timed out at 10 minutes on 360–440 MB artifacts.

The fix, for now: measure continuously. actions/site takes timings (off by default). Verbose Quartz prints a line per emitted file, so nucleation’s log would gain about 49k lines a build. The weekly run turns it on and uploads site-perf: step durations, Quartz phases, the per-emitter timeline, the slowest markdown files and output bytes by kind. The per-emitter timeline is what will say whether social cards, the content index or the HTML itself dominate emit, which the CI history can’t. site_perf was fired once on a real Quartz log and output (strata-g’s record, built locally): it read all four phases, and found 361 social cards (7.5 MB) and 39 demo videos (99.7 MB) in 127.9 MB of output.

LadybugDB, checked before proposing it (ADR-146). ladybug 0.23.0 wrote a two-node, one-edge database to a single 96 KB file; @ladybugdb/wasm-core 0.23.0 (the Node variant, loading the bytes into its in-memory filesystem, as a browser would) opened it read-only and answered the same Cypher query. The browser variant itself wasn’t run. Its default build needs no cross-origin isolation, which GitHub Pages can’t provide; the worker is 25.7 MB raw and 4.4 MB gzipped.


The journal book moved to a shipped template, byte-identical, and what it cost until templates were cached

2026-11-27 01:50:21

What moved. ADR-147’s first step. journal.render_book now renders luria:journal-book.md.j2 over journal.book_context. The data half still lives in journal.py: which entries, the period label, and each entry’s heading slug.

The slug pass is why there are two template files. The contents list links each entry heading’s slug, and a slug depends on every heading before it in the book, entry bodies included (ADR-100). So the slugs are computed from rendered markup. Keeping a Python copy of the section markup for that pass would have been two copies to drift (DP-004). Instead the section and heading markup are macros in luria:journal-book-parts.md.j2, which the book template imports and entry_anchors renders. They had to be a separate file: Jinja’s template.module renders the importing template’s top level with an empty context, and the strict undefined rejects that.

How “unchanged” was checked. tests/test_journal_book_view.py keeps the old generator verbatim as an oracle, helpers included. The first draft of the oracle called journal._sections and journal.entry_anchors, so for everything below the contents list it compared the new code with itself. It passed first time, which is what gave it away. A positive control now changes one field of the shipped section and asserts the comparison notices (DP-015). The oracle matched on every book of four real records:

recordbooksentries
luria4162
nucleation6525
strata-g378
mantle13

On this branch, luria index changes the November book only by adding this branch’s own unmerged entry.

The cost, and the fix. Rendering through views._environment() compiled three templates per book, plus the parts once per call, because that environment is deliberately rebuilt per render: a project’s template is read from the tree as it is now. On luria’s 162 entries that was 0.071 s against the generator’s 0.008 s, about 9×. A shipped template is read from the package, which doesn’t change under a running process, so views.shipped(name) compiles each once per process, with the same sandbox, undefined and filters. Best of five runs after the change: 9.8 ms against 7.1 ms. Worth knowing for every later step of the migration: use views.shipped, not _environment(), for a luria: template rendered in a loop.