/ Stream
build 2026.12.03 · --:--:-- UTC · RSS

BabbTools for the frontier.

mascot mascot
All materials

One page per Lab: resolving the Notes-vs-Labs conflict, and the routine that builds it

stream-lab-page-routine.md View the source file

Status: Proposal — for Morgen to approve, amend, or reject. Nothing here is decided. Prepared: 2026-11-29, from Morgen's message of 13:38 EST and the Lab just created through the tool (2026-11-29-unfolding-kernel-muse, local copy at the local stream checkout, stream main ccecd0d).

The conflict, stated plainly

There are two live publishing surfaces and they overlap:

  • Notes (Telegraph posts, semi-live): narrative posts that appear as they are written — findings, decisions, summaries, replies. Fast, flood-tolerant in Making, one post per idea.
  • Labs pages (site pages, one per Lab): the complete record of a dated, authored piece of work — question, files changed, artifacts, evidence, notes, status. Slow, complete, versioned by the Lab framework.

The conflict: a Lab's work is also note-worthy, so the same content wants to live in both places. If it is copied into both, the two copies drift (a note says one thing, the Lab page says another, and no one knows which is current). If it lives in only one, the other surface loses what it is for (Notes loses the live narrative; Labs loses the complete record).

(a) The rule that resolves it

Notes never contain the Lab's record. Labs pages never contain narrative. Each links to the other; nothing is duplicated.

  • A Notes post may describe Lab work — what was found, what was decided, what changed — in narrative form, with a summary block at the top and a link to the Lab page. It never reproduces the Lab's files, evidence, or tables. If a reader wants the record, the link takes them there.
  • A Labs page is the Lab's own complete record, auto-organized from the Lab folder itself (see (b)). It contains no narrative prose written for the page; its readable account is the Lab's own README.md (question, what was done, what was learned). It links back to the Notes posts that describe it (via the relations mechanism or a links list in the page).
  • One fact, one home. A finding is stated in a Note and evidenced in the Lab. A decision is recorded in the Lab's status/notes and announced in a Note (tag decision). An artifact is shown on the Labs page and linked from the Note. If the same sentence would have to appear in both places, it belongs in the Lab and the Note links to it.

Consequence for the first publishing batch (4 draft rows): rows 02 and 04 (forests-vs-declarative, design-architecture-challenges) are Notes that describe Lab work and link to the Lab page; they are not the record of it. Row 01 (publishing research) and row 05 (publishing decisions) are not Lab work at all — they are pure Notes, and no Labs page is involved.

(b) The HTML routine: one page per Lab, auto-organized

Recommendation: a generator in babb-home, driven by the Lab folder, built as an extension of the existing build-stream-visuals.py pattern — not a new builder.

Reasons: build-stream-visuals.py (run by sync stream) already derives site pages from stream-repo sources, already copies lab HTML verbatim into assets/stream-visuals/embeds/, already keeps a catalogue (_data/stream_visuals.json), and already has the reviewed-script gate for generated HTML (a script runs only if its exact hash was read and recorded). A second builder would duplicate the sync, the catalogue, and the gate, and the two would drift. The Labs tab work already under way in babb-home (PR #20, feat/stream-labs-tab, not ours) is the page the generator feeds — the generator produces the per-Lab pages, the Labs tab lists them.

What the generator takes in (per Lab, from the stream checkout):

  • labs/<id>/lab.json — id, title, question, author, created date, kind, base commit, engages. These become the page header and the status line.
  • labs/<id>/README.md — the readable account (question, what was done, what was learned). Rendered as the page's narrative section, verbatim.
  • labs/<id>/files/ + files.csv / changes.patch (after publication) — the change list: path, change (new/changed/removed), hash. Rendered as a file table with per-file diff view (the spec §12 "read" need: original, altered version, differences).
  • labs/<id>/artifacts/ — interactive pages and diagrams. Embedded (HTML copied verbatim, as today) or linked, per artifact type.
  • labs/<id>/evidence/ — runs (from runs.jsonl: run id, time, command, exit code) and their outputs. Rendered as a runs table; a failing run is shown as a failing run, not hidden.
  • labs/<id>/notes/ — later additions, in date order, newest last (the Lab grows here after publication; only notes/ may grow).
  • labs/status.csv — the latest row for the Lab: status (open, accepted, rejected, deferred, withdrawn, superseded), by whom, what was learned. Rendered as a status banner; rejected Labs stay visible with their learned record (spec §2: rejected work stays on record).

What it auto-organizes (no hand editing of the generated page):

  1. Sections, in fixed order: header (title, date, author, status banner) → question → what was done / learned (README) → files changed (table + diffs) → artifacts → evidence (runs table) → notes (dated additions) → engages (what the Lab touched, from the indexes) → related Notes posts (links out).
  2. Ordering: files alphabetical by path; runs chronological; notes chronological; engages grouped by kind (section, element, file, lab).
  3. Status: the banner is computed from status.csv at build time, so a Lab accepted or rejected after the page was first built shows its new status on the next sync — no page edit needed.
  4. Evidence hashes: every output file shown with its recorded SHA-256 from runs.jsonl / published.json; a mismatch is shown as a mismatch, not silently re-rendered.
  5. Downloads: a zip of the Lab alone, and of base-plus-changes (spec §12 "download" need), built by the website from the same inputs.

Where it lives: a new generator module alongside build-stream-visuals.py in scripts/publishing/ (name to be decided — build-lab-pages.py is the working title), run by sync stream, writing per-Lab pages under standards/stream/labs/<lab-id>/ (where the four existing Lab pages already live) and a catalogue entry per Lab. The existing per-Lab pages (stream-bitpack-header-lab, etc.) are its first inputs (see (c)).

Safety, copied from the visuals builder: generated HTML goes through the reviewed-script gate (script hash recorded in reviewed_scripts before it runs); Lab HTML artifacts are copied verbatim, never re-rendered; the generator never writes into the stream repo (it reads a checkout and writes only babb-home pages).

(c) What happens to the pre-formal Interactive Labs

The four Interactive Labs posted before the formal mechanism (bitpack header, caps header, grammar header, views time slider) already live in docs/labs/ and already have Labs pages under standards/stream/labs/ (plus Visuals catalogue rows). They have no lab.json, no base commit, and no recorded runs — they predate the framework.

Recommendation: grandfather them as-is, and wrap them with the routine — do not migrate them.

  • They keep their existing pages and catalogue rows; nothing is re-issued under a Lab id they never had.
  • The generator gains a "legacy" mode: for a Labs page with no lab.json, it renders what exists (the HTML artifact + its catalogue entry) with a banner stating it predates the formal Lab mechanism and has no base, no recorded runs, and no status — so readers are not misled into treating it as a Lab record.
  • If one of them later becomes the subject of formal Lab work, that work gets its own Lab id and base, and the new Lab page links to the legacy page as prior art — the legacy page itself does not get retrofitted with a lab.json.
  • The same treatment applies to the other docs/labs/ HTMLs with no catalogue rows (Genesis, kernel companion, 128-positions explorer): they are artifacts, not Labs, and the routine does not claim them as Labs.

Alternative considered and rejected: backfilling a lab.json for each pre-formal Lab (inventing a base and a question after the fact). It would manufacture provenance the record does not have, and the spec is explicit that a Lab's id and base never change once published — a retrofitted base would be a false statement about where the work started.

(d) Open questions for Morgen

  1. Does the Notes-link / Labs-record split in (a) match how you want the two surfaces to divide the work — or should some Lab content (e.g. the findings table) also appear inside Notes posts?
  2. Is the generator an extension of build-stream-visuals.py (recommended), or a separate builder with its own sync step?
  3. Should the Labs tab list all Labs (including rejected and deferred, with their status shown) or only open/accepted ones?
  4. Are the pre-formal Interactive Labs grandfathered as proposed, or do you want one of them formally adopted as a Lab (with a real base and question)?
  5. Who approves a generated Labs page — does it go through the same queue approval as a Notes post, or does the generator's output deploy with the site sync?

What this does not do

  • It does not change the Notes publishing routine (PR #25, merged 2026-11-29) or the queue; Labs pages are site pages, not Telegraph posts.
  • It does not publish any Lab. The unfolding-kernel Lab itself is still local-only (see the Lab's README for its base deviation and its lab check result: 0 failures, 1 warning).
  • It does not build the generator — that is the next step after these questions are answered.