Skip to content

armgit / bento

Public Imported from GitHub
0

Bento, the office suite that fits in a file

ci: split ci.yml by zone so rig registrations stop conflicting (#778)

nyblnet1fe6f3bbcf42
diff --git a/.github/actions/validate-convert/action.yml b/.github/actions/validate-convert/action.yml
new file mode 100644
index 00000000..246947f2
--- /dev/null
+++ b/.github/actions/validate-convert/action.yml
@@ -0,0 +1,41 @@
+# validate, convert slice: convert/: the standalone typecheck and the conversion engine rigs.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-convert
+description: validate, convert slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: Typecheck convert (standalone)
+ # convert/ is a library beside the apps (the CLI and bento.page/import
+ # use it; no shell does), so no app's tsc -b reaches it. Its own flags,
+ # its own pass — the same as kernel's.
+ working-directory: slides
+ shell: bento-step {0}
+ run: node_modules/.bin/tsc -p ../convert
+
+ - name: convert engine rigs
+ # The pptx importer's resolver is where real decks' fidelity lives --
+ # 91% of colour and 71% of run properties are indirect, and every hop
+ # fails silently (a backwards clrMap still renders, just dark-on-dark).
+ # Negative controls proven against mutated implementations; load.ts is
+ # the gate that matters for import: every emitted document must pass the
+ # REAL slides parseDoc with zero validateDoc errors. The runner also
+ # covers the `bento convert` CLI (it needs the shell built above and
+ # Chrome for "it opens"; neither may skip in CI), the delivery chain
+ # behind bento.page/import (signature, pin, version floor, untrusted-
+ # input gate, zip limits, exactly two requests), the built page's CSP,
+ # and the boundary: no app imports convert/, and the engine touches no
+ # DOM global.
+ shell: bento-step {0}
+ run: node scripts/test-convert.ts
diff --git a/.github/actions/validate-dash/action.yml b/.github/actions/validate-dash/action.yml
new file mode 100644
index 00000000..39003ded
--- /dev/null
+++ b/.github/actions/validate-dash/action.yml
@@ -0,0 +1,698 @@
+# validate, dash slice: bento/dash: install, typecheck, shell + splice gate, the release-channel rehearsal and the dash rigs.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-dash
+description: validate, dash slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ # dash: the data app — same pipeline, same gate.
+ - name: Install (dash)
+ working-directory: dash
+ shell: bento-step {0}
+ run: npm ci
+
+ - name: Typecheck (dash)
+ working-directory: dash
+ shell: bento-step {0}
+ run: node_modules/.bin/tsc -b
+
+ - name: Build single-file shell (dash)
+ working-directory: dash
+ shell: bento-step {0}
+ run: npm run build:single
+
+ - name: Splice conformance gate (dash)
+ shell: bento-step {0}
+ run: node scripts/shell-gate.mjs dash/dist-single/Bento_Dash.bento.html
+
+ - name: Release channel rehearsal (dash)
+ # Cuts a COMPLETE release — the real release.mjs, staged into a temp
+ # directory — with a throwaway key this step generates and discards, and
+ # then verifies the artifacts with kernel/src/update.ts itself, the code
+ # every shipped file runs, with only the embedded public key swapped.
+ # The point is the REFUSALS: a tampered manifest, a manifest signed for
+ # another app, a downgrade replay and a one-bit-flipped shell must each
+ # be rejected, and the conformance gate must refuse a shell whose doc
+ # block closes its own script. A signing pipeline cannot be tested by
+ # signing (the key never reaches CI), but this is everything except.
+ shell: bento-step {0}
+ run: node scripts/test-release-channel.mjs --app dash
+
+ - name: bento/dash model rig
+ # The format is permanent — additive forever, no server to migrate a
+ # single file. Two failures are unrecoverable once files exist: dropping
+ # a field this build does not recognise, and letting anything but an
+ # ABSENT block reach the starter document (which then overwrites live
+ # data on the first save). Both are asserted from both sides.
+ shell: bento-step {0}
+ run: node scripts/test-dash-model.ts
+
+ - name: bento/dash store + undo rig
+ # Undo is a patch log rather than document snapshots, which buys history
+ # that costs what the EDIT costs — and risks a failure a snapshot cannot
+ # have: an inverse that does not restore what it displaced. Every op is
+ # checked apply → undo → identical, because that failure is silent.
+ shell: bento-step {0}
+ run: node scripts/test-dash-store.ts
+
+ - name: bento/dash import rig
+ # Import is where a data tool does its damage, because every mistake is
+ # SILENT: the file opens, the grid fills, the totals compute, and the
+ # numbers are wrong. Two guards matter most and are checked from both
+ # sides — an undecidable date order is REFUSED rather than guessed, and
+ # the decimal convention is decided per COLUMN from the whole column.
+ shell: bento-step {0}
+ run: node scripts/test-dash-import.ts
+
+ - name: bento/dash formula rig
+ # A wrong number is the worst failure a spreadsheet has, and the
+ # dangerous ones are plausible rather than loud: an error that becomes a
+ # zero, a cycle that resolves to something, a column computed before the
+ # column it depends on. All three are asserted, each with a control.
+ shell: bento-step {0}
+ run: node scripts/test-dash-formula.ts
+
+ - name: bento/dash chart rig
+ # A tile names columns and derives its series at render, so the whole
+ # surface worth testing is the derivation. The failure that matters most
+ # is a missing value drawn as a zero — "we sold nothing" instead of "we
+ # do not know".
+ shell: bento-step {0}
+ run: node scripts/test-dash-chart.ts
+
+ # ── the rest of bento/dash. Each of these asserts a way a spreadsheet can
+ # be CONFIDENTLY WRONG, which is the failure that matters here: nobody
+ # re-derives a number by hand, so a wrong one is not caught by the person
+ # relying on it. Each rig argues its own case in its header; the lines
+ # below say why it gates a merge.
+ - name: bento/dash function pack
+ # Lookups, multi-criteria, finance, statistics — including the three
+ # places we deliberately depart from Excel because Excel's default is a
+ # trap: an approximate VLOOKUP on unsorted data, an IRR that converges
+ # on nothing, a PERCENTILE that clamps instead of refusing.
+ shell: bento-step {0}
+ run: node scripts/test-dash-functions.ts
+
+ - name: bento/dash cell formulas
+ # Evaluation ORDER. A cell computed before the cell it reads writes a
+ # stale number into the document, looking authoritative.
+ shell: bento-step {0}
+ run: node scripts/test-dash-cellformula.ts
+
+ - name: bento/dash A1 references
+ # `$` pins against a COPY and not against structure, and a reference
+ # into a deleted row is #REF! rather than whatever slid up into it.
+ shell: bento-step {0}
+ run: node scripts/test-dash-a1.ts
+
+ - name: bento/dash defined names
+ # A name is a redirection, and every way it can go wrong reports a
+ # NUMBER: substituted inside quoted text or after a sheet's `!`,
+ # outranking a column of the same name, spelled like a cell address and
+ # therefore never consulted, or DROPPED when its rows are deleted
+ # instead of becoming #REF!. Ends by mounting the real grid, because an
+ # engine the app never passes the name table to is invisible.
+ shell: bento-step {0}
+ run: node scripts/test-dash-names.ts
+
+ - name: bento/dash array formulas and spill
+ # A spilled cell is COMPUTED, not stored: it must never reach the file,
+ # a collision must BLOCK with #SPILL! rather than overwrite, two spills
+ # wanting one cell must pick the same winner on every machine, and the
+ # shape must survive the operators (2×3, not 6×1 — the wrong answer is
+ # right in the only cell anybody checks). Datasets deliberately do not
+ # spill; a column formula is the columnar answer to the same need.
+ shell: bento-step {0}
+ run: node scripts/test-dash-spill.ts
+
+ - name: bento/dash cross-sheet references and what row 1 means
+ # Both halves of one boundary. A per-CELL formula reaches another sheet
+ # from EITHER kind of sheet — it used to work on a spreadsheet and
+ # answer #REF! on a dataset in the same workbook, which was two call
+ # sites rather than a decision. A COLUMN formula still may not, and now
+ # names the boundary instead of calling a sheet in the tab strip an
+ # unknown name: reaching across is either a position that moves or a
+ # join with no key, and dash has `join`. Then the trap underneath: an A1
+ # row is the row the addressed sheet paints in its own gutter, so a
+ # dataset's row 1 is its first DATA row and a spreadsheet copy of it is
+ # one lower — safe only because the conversion shifts LOCAL references
+ # and leaves QUALIFIED ones alone. That last one is measured against
+ # both sheets, because it is the part that would rot in silence.
+ shell: bento-step {0}
+ run: node scripts/test-dash-xsheet.ts
+
+ - name: bento/dash pivot
+ # Subtotals are COMPUTED, not summed: an average of averages is a
+ # different number, and a distinct count does not add up.
+ shell: bento-step {0}
+ run: node scripts/test-dash-pivot.ts
+
+ - name: bento/dash dashboard
+ # Cross-filter selections compose, and the categories of a column
+ # PARTITION the sheet — no row dropped, none counted twice.
+ shell: bento-step {0}
+ run: node scripts/test-dash-dashboard.ts
+
+ - name: bento/dash data story
+ # A gap tweens as a gap. Interpolating an absent quarter through zero is
+ # the animation telling a lie about the data.
+ shell: bento-step {0}
+ run: node scripts/test-dash-story.ts
+
+ - name: bento/dash filter and sort
+ shell: bento-step {0}
+ run: node scripts/test-dash-filter.ts
+
+ - name: bento/dash filtering is REACHABLE
+ # The engine rig above proves sixteen predicates over an order vector;
+ # the app used to offer ONE of them per column — a free-text "Contains"
+ # box you had to already know the answer to spell into. This one drives
+ # the column menu over a real DOM: it opens the value checklist on a
+ # mounted grid, CLICKS a checkbox, and asserts the row indices
+ # `store.order` ends up holding — plus that a truncated list never
+ # pre-ticks itself, that a column's list honours the other columns'
+ # filters and not its own, and that none of it dirties the document.
+ shell: bento-step {0}
+ run: node scripts/test-dash-filterui.ts
+
+ - name: bento/dash rows and columns
+ # Structure, and the rid watermark — a rid must never be minted twice,
+ # which is collaboration's correctness precondition.
+ shell: bento-step {0}
+ run: node scripts/test-dash-rowcol.ts
+
+ - name: bento/dash selection and clipboard
+ shell: bento-step {0}
+ run: node scripts/test-dash-select.ts
+
+ - name: bento/dash data entry through the real editor
+ # Widget⇥12⇥4.50⏎ has to come home to column A. select.ts had the
+ # Tab-run model and test-dash-select.ts proved it; the editor's finish()
+ # never called it. This one drives typeInto + the cell's own onkeydown.
+ shell: bento-step {0}
+ run: node scripts/test-dash-entry.ts
+
+ - name: bento/dash cross-sheet structure
+ # Insert a row on Pipeline and =SUM(Pipeline!D1:D8) on Scratch has to
+ # widen. a1.ts had the scope rule; Grid.shiftFormulas walked one sheet.
+ shell: bento-step {0}
+ run: node scripts/test-dash-xshift.ts
+
+ - name: bento/dash sharing state
+ # Start/stop/rotate sharing mark the workbook unsaved (a rotation is
+ # revocation and must reach the file); only a writer copy offers write
+ # auth or calls itself an Editor — an allowlist, failing closed.
+ shell: bento-step {0}
+ run: node scripts/test-dash-share-dirty.ts
+
+ - name: bento/dash sync inbound
+ # A peer cannot set this copy's room, docId, readonly, template,
+ # format, version or policy — by relay op, by snapshot, or by a frame
+ # injected on the same-origin BroadcastChannel.
+ shell: bento-step {0}
+ run: node scripts/test-dash-sync-inbound.ts
+
+ - name: bento/dash room snapshot and inbound fields
+ # A dash room snapshot carries no never-synced field (collab first); a
+ # remote op or snapshot can't adopt one; no prototype-shaped name off the
+ # wire reaches any object, and a prototype-named actor can't throw.
+ shell: bento-step {0}
+ run: node scripts/test-dash-snapshot-collab.ts
+
+ - name: bento/dash save race (kernel SaveQueue)
+ # The unsaved dot goes out only for the revision that was written; a
+ # dropped file's handle swap waits for the write in flight; an in-place
+ # update stops the old shell from writing again. Each guard is
+ # sabotaged in the PR that introduced it; the rig carries two controls
+ # that reproduce the bugs without the guard.
+ shell: bento-step {0}
+ run: node scripts/test-dash-save-revisions.ts
+
+ - name: bento/dash conditional formatting
+ shell: bento-step {0}
+ run: node scripts/test-dash-condfmt.ts
+
+ - name: bento/dash conditional formatting is REACHABLE
+ # The engine rig above passes on six rule kinds; the app used to build
+ # two of them, so "highlight cells greater than N" was missing from a
+ # product that had already shipped it. This one drives the panel section
+ # with panels.ts's own KIT over a real DOM and asserts the rule OBJECT
+ # that would reach the document — plus that the menu and the panel
+ # actually mount it, which is what makes the rest of it visible.
+ shell: bento-step {0}
+ run: node scripts/test-dash-condfmtui.ts
+
+ - name: bento/dash a formula column is typed by what it returns
+ # It used to be born `number`, hardcoded: a formula splitting surnames
+ # out of "Lastname, Firstname" produced a NUMBER column of text that
+ # filtered, sorted, exported and totalled wrongly. Inference is by the
+ # JS type of the computed values, never their appearance — a numeric
+ # STRING typed number is the SUM 0 bug (test-dash-coltype.ts) arriving
+ # by a new door, and that is asserted by name.
+ shell: bento-step {0}
+ run: node scripts/test-dash-computedtype.ts
+
+ - name: bento/dash paste special
+ # Values only must land the COMPUTED value and NEVER an error object —
+ # the same class of damage scripts/test-dash-fill.ts records, reached
+ # from the other side. Also: formats-only cannot move a number (the
+ # column is summed before and after), a copied formula's relative refs
+ # translate while $A$1 does not and a CUT one does not translate at
+ # all, and transpose is REFUSED on a dataset because its columns are
+ # typed. Last section reads main.ts: the chord must reach the command,
+ # and the clip must be snapshotted BEFORE ⌘X clears the selection.
+ shell: bento-step {0}
+ run: node scripts/test-dash-pastespecial.ts
+
+ - name: bento/dash text to columns
+ # The split reuses import.ts's delimiter parser and its type inference,
+ # so "Smith, John" quoted stays one field and an undecidable date
+ # column lands as TEXT rather than eleven months out. The overwrite is
+ # named before it happens. And the outcome is checked in the DOCUMENT:
+ # patches are committed to a real Store, the source column survives,
+ # and re-running the recorded step reproduces the same bytes.
+ shell: bento-step {0}
+ run: node scripts/test-dash-tocolumns.ts
+
+ - name: bento/dash side panels
+ shell: bento-step {0}
+ run: node scripts/test-dash-panels.ts
+
+ - name: bento/dash panel rhythm
+ # The panel's spacing has been reported broken three times. This pins
+ # the numbers — one row height, one pitch, one gutter, one radius — and
+ # refuses a second spelling of any of them, so the next drift is a build
+ # failure rather than a fourth screenshot.
+ shell: bento-step {0}
+ run: node scripts/test-dash-panelrhythm.ts
+
+ - name: bento/dash About dialog
+ shell: bento-step {0}
+ run: node scripts/test-dash-about.ts
+
+ - name: bento/dash dialog surfaces
+ # The About dialog held eight sections and measured 1361px in a 429px
+ # viewport — 3.2 screens. It is two surfaces now (About = what travels
+ # in the file; Settings = what this reader's browser remembers) plus the
+ # password, which moved to the Save menu with the other instructions
+ # about how the file gets written. This holds the seam AND the size:
+ # each surface fits a laptop screen without scrolling, measured through
+ # a box model of about.css calibrated against that 1361px.
+ shell: bento-step {0}
+ run: node scripts/test-dash-surfaces.ts
+
+ - name: bento/dash thumbnail preview
+ # An encrypted workbook NEVER gets a preview — a plaintext title beside
+ # the ciphertext is the leak the password exists to prevent.
+ shell: bento-step {0}
+ run: node scripts/test-dash-preview.ts
+
+ - name: bento/dash zip
+ # Verified against real unzip implementations, not only our own reader:
+ # a reader and a writer that share a bug agree with each other perfectly.
+ shell: bento-step {0}
+ run: node scripts/test-dash-zip.ts
+
+ - name: bento/dash xlsx
+ # Both 1900 date epochs, including the leap-year bug — getting it wrong
+ # shifts every date by four years, silently.
+ shell: bento-step {0}
+ run: node scripts/test-dash-xlsx.ts
+
+ - name: bento/dash xlsx — what an import carries and what it says it dropped
+ # The gate that lost a number: `=SUM(RentCells)/B5` has no `!`, no `[`
+ # and no unknown function, so a bare defined name sailed through and
+ # the cell painted #NAME? over the 0.61 Excel had computed. Also pins
+ # the header-under-a-merged-title repair, and the freeze, per-cell
+ # format and Excel-table totals row that used to be dropped in silence.
+ # Builds real .xlsx bytes — the gate only ever sees real formula text.
+ shell: bento-step {0}
+ run: node scripts/test-dash-xlsx-carry.ts
+
+ - name: bento/dash WebGL
+ shell: bento-step {0}
+ run: node scripts/test-dash-gl.ts
+
+ - name: bento/dash 3D scenes
+ shell: bento-step {0}
+ run: node scripts/test-dash-viz3d.ts
+
+ - name: bento/dash CRDT convergence
+ # The big one: randomised concurrent edits across N replicas, asserted
+ # to converge. It has caught every ordering bug in the engine, and the
+ # two it did not catch were found by widening it.
+ shell: bento-step {0}
+ run: node scripts/test-dash-sync.ts
+
+ - name: dash spreadsheet convergence rig
+ # The SPREADSHEET kind's own rig, separate from the dataset one because
+ # it is a different convergence problem: a dataset row has a rid, and a
+ # spreadsheet cell has only its address. It also pins the snapshot
+ # FALLBACK — a patch that would move cells must mint zero ops and arm
+ # the whole-state path, because two replicas shifting addresses
+ # concurrently renumber each other's writes and no ordering repairs it.
+ shell: bento-step {0}
+ run: node scripts/test-dash-canvassync.ts
+
+ - name: dash validator rig
+ # 109 checks over the shapes that read as DATA rather than as damage —
+ # a column shorter than the sheet has rows, a dictionary index past the
+ # end of its dict. Nothing here refuses to load a workbook; the point is
+ # that the user is told, because neither of those looks wrong on screen.
+ shell: bento-step {0}
+ run: node scripts/test-dash-validate.ts
+
+ - name: dash comments rig
+ # A thread anchors to colId + rid, never a position, so it survives a
+ # sort. The checks that matter are the ORPHAN ones: a deleted row must
+ # leave the thread dead and saying so, not silently re-pointed at
+ # whoever inherited the row number.
+ shell: bento-step {0}
+ run: node scripts/test-dash-comments.ts
+
+ - name: dash recovery rig
+ # Every branch of the offer/no-offer decision, with no DOM and no
+ # IndexedDB in it. A snapshot that cannot be parsed is not offered — a
+ # Restore button that hands the app a document it will then refuse is a
+ # dead end wearing a live button.
+ shell: bento-step {0}
+ run: node scripts/test-dash-recovery.ts
+
+ - name: dash CSV export rig
+ # Text starting = + - @ tab or CR is exported with a leading quote, so
+ # opening the CSV in a spreadsheet never runs it as a formula.
+ shell: bento-step {0}
+ run: node scripts/test-dash-csv-export.ts
+
+ - name: dash i18n rig
+ # A core catalog ships inside every saved workbook and cannot be patched
+ # without a release, so drift has to fail here rather than in the field:
+ # a catalog key the source no longer contains is a dead translation, and
+ # a {placeholder} a translation dropped is a sentence with a hole in it.
+ shell: bento-step {0}
+ run: node scripts/test-dash-i18n.ts
+
+ - name: dash sheet-tabs rig
+ # Sheet order is the tab order and it lives in the DOCUMENT, so a
+ # reorder is an undoable patch whose inverse carries the ORIGINAL index
+ # — one undo puts a dragged tab back where it was, not at the end. Also
+ # guards that deleting the shown sheet steps to another TABLE sheet.
+ shell: bento-step {0}
+ run: node scripts/test-dash-tabs.ts
+
+ - name: dash find rig
+ # The grid is windowed — about 40 rows of a 5,000-row sheet exist in the
+ # DOM — so the browser's own find reports "not there" for values that
+ # are. These checks cover the matcher, the view vector (a hit must never
+ # be a row the filter is hiding) and the replace refusals.
+ shell: bento-step {0}
+ run: node scripts/test-dash-find.ts
+
+ - name: dash spreadsheet-cells rig
+ # The setCanvasCells patch, which writes the SPREADSHEET kind's sparse
+ # A1 map. Sparseness is not a size optimisation: a cleared cell has to
+ # be GONE, or an undone sheet is unequal to a fresh one and two
+ # replicas disagree about whether a cell exists. Also pins the
+ # collaboration fallback — the CRDT has never heard of this op, and
+ # localOne's default arm ships a whole-state snapshot rather than
+ # dropping it.
+ shell: bento-step {0}
+ run: node scripts/test-dash-canvascells.ts
+
+ - name: dash step engine
+ # The relational pipeline the FORMAT has described since commit one and
+ # nothing executed. Includes a performance floor at 100k rows and a
+ # HELD-HEAP comparison against a row-shaped pipeline — wall clock does
+ # not discriminate between the two designs at this size, memory does
+ # (2.5 MB against 16.8 MB), and memory is what decides whether a
+ # workbook fits at all.
+ shell: bento-step {0}
+ run: node scripts/test-dash-steps.ts
+
+ - name: dash SQL surface
+ # SQL compiles to Step[] and does not evaluate anything itself — the
+ # answer is a frame over the same columns, so it stays live rather than
+ # becoming a copy that is wrong the moment somebody edits a cell. The
+ # checks that matter are the refusals: a plain JOIN declares card:'one'
+ # so a non-unique key STOPS the pipeline instead of doubling every
+ # total, and an edit statement is refused because a query is a question.
+ shell: bento-step {0}
+ run: node scripts/test-dash-sql.ts
+
+ - name: dash spreadsheet rig
+ # Rendering and editing the SPREADSHEET kind — unbounded, sparse, typed
+ # per cell. The check that matters is that a formula BELOW the data
+ # lands in a cell that did not exist, without allocating the rows it
+ # skipped: that gesture is why the kind exists.
+ shell: bento-step {0}
+ run: node scripts/test-dash-canvas.ts
+
+ - name: dash promote/flatten rig
+ # The bridge between the two sheet kinds. The checks that matter are
+ # the ones about NOT destroying the source: promotion leaves the range
+ # alone, because a formula under the block and a cross-sheet reference
+ # into it both point by POSITION and emptying the cells would blank
+ # them silently. Also that a lifted column formula actually EVALUATES —
+ # Column.formula is a bare expression, and an "=" in front of it ships
+ # a column of #VALUE!.
+ shell: bento-step {0}
+ run: node scripts/test-dash-promote.ts
+
+ - name: dash fill rig
+ # ⌘D and the fill handle. This guards a DATA LOSS bug that shipped:
+ # seeding from the computed value wrote error OBJECTS into stored
+ # columns and flattened formulas to constants, and ⌘D sharing an
+ # implementation with the handle made it alternate two seed rows. The
+ # two gestures are separate here, and a formula fills with its
+ # references translated.
+ shell: bento-step {0}
+ run: node scripts/test-dash-fill.ts
+
+ - name: dash spreadsheet formula rig
+ # Formulas on the SPREADSHEET kind, including cross-sheet references.
+ # Sheet1!A1 used to bind to the LOCAL A1 — this sheet's number reported
+ # under another sheet's name — and ranges over a sparse sheet must cost
+ # the cells that exist, not the rectangle they span.
+ shell: bento-step {0}
+ run: node scripts/test-dash-canvasformula.ts
+
+ - name: dash action-applicability rig
+ # One table saying which actions run on which sheet kind, and a reason
+ # for every one that does not. Six toolbar buttons used to throw
+ # "grid needs a table sheet" on a spreadsheet with nothing shown; the
+ # rig fails if an action is kind-scoped without a reason string.
+ shell: bento-step {0}
+ run: node scripts/test-dash-actions.ts
+
+ - name: dash cell format and type rig
+ # Per-cell number format, coercion and appearance on a SPREADSHEET
+ # sheet. The checks that matter are the data-eating ones: 01234 must not
+ # silently become 1234, 1/2 must never become a date, an ambiguous
+ # d/m/yyyy is refused rather than guessed, and formatting twenty cells
+ # is ONE patch and ONE undo.
+ shell: bento-step {0}
+ run: node scripts/test-dash-cellprops.ts
+
+ - name: dash theme rig
+ # A stylesheet has no type system: an undeclared token is a dead rule
+ # and a light-dark() fed a length is an invalid declaration — both
+ # silent, and both had SHIPPED. --accent-ink drew nothing and every
+ # shadow in the app computed to "none". The light palette is also
+ # diffed against slides' :root so the two cannot drift one grey at a
+ # time again.
+ shell: bento-step {0}
+ run: node scripts/test-dash-theme.ts
+
+ - name: dash file write-back
+ # The single biggest data-loss risk dash shipped with: an IndexedDB
+ # snapshot was the only thing catching an hour of typing, and it is
+ # invisible, uncopyable and cleared by browsers on their own schedule.
+ # The checks that matter are the bookkeeping ones. A FAILED write must
+ # not be recorded as a baseline — record the intent and the next cycle
+ # reads "unchanged", so a permanent failure is reported once and then
+ # silently skipped forever. Also: two cycles never open concurrent
+ # writables on one handle, nothing is rethrown out of a setTimeout
+ # nobody awaits, and the refusals (read-only, template, no-handle) are
+ # ORDERED, so a read-only workbook reports the permanent reason rather
+ # than the incidental one.
+ shell: bento-step {0}
+ run: node scripts/test-dash-autosave.ts
+
+ - name: dash print
+ # Every failure mode here is silent: the page that comes out has a
+ # header, a body and a total, and looks finished whatever is missing
+ # from it. The grid is windowed at ~46 rows, so the first check builds
+ # a 5,000-row sheet and counts what reaches the paper — measured in a
+ # browser too: 3,001 printed rows from a grid holding 46. The rest pin
+ # that the printout is of the VIEW VECTOR, that the totals row is the
+ # FILTERED total from the very grid.aggregate the footer calls, that no
+ # column is ever clipped off the right edge at any wide-sheet setting,
+ # and that author data reaching markup is escaped — a workbook is
+ # untrusted input, and this path builds HTML by concatenation.
+ shell: bento-step {0}
+ run: node scripts/test-dash-print.ts
+
+ - name: dash grid frontier
+ # What exists below a dataset's last row: exactly one appender, with
+ # the ruled lattice stopping at the data. The grid used to LOOK like an
+ # infinite canvas and behave like a table — pressing "=" below the
+ # numbers opened the editor on the last DATA cell, so the universal
+ # spreadsheet gesture silently targeted real data. Typing on the
+ # frontier must append, and append ONCE: zero times restores the
+ # original bug, per-keystroke is a different one. Clicking must NOT
+ # append, since a control that grows the file when you look at it is
+ # worse than one that does nothing.
+ shell: bento-step {0}
+ run: node scripts/test-dash-frontier.ts
+
+ - name: dash grid context menus
+ # The three menus a right-click produces — cell, row-number gutter,
+ # column header — asserted from real `contextmenu` events on a mounted
+ # grid, never from the builders. Two features have shipped complete and
+ # UNREACHABLE (the conditional-format rules, and the two gutters, which
+ # did nothing at all on a right-click), and in both cases a rig that
+ # called the builder would have been green over an app with the feature
+ # invisible on screen. So the negative control here is a grid with
+ # `installGridMenus` NOT called: the same right-clicks must produce
+ # nothing. Also pinned: the labels count the selection and the ops do
+ # that many; Escape closes a menu and its listener does not outlive it;
+ # the `+` column appender exists, is absent read-only, and costs
+ # nothing until its dialog is answered; and finding 11 — a per-cell
+ # formula is carried into a new row only when the column proves it
+ # repeats, and the reader is told either way.
+ shell: bento-step {0}
+ run: node scripts/test-dash-menu.ts
+
+ - name: dash accessibility
+ # All of these fail silently to a sighted developer. The load-bearing
+ # check is aria-rowindex under virtualisation: about forty rows of a
+ # 5,000-row view exist in the DOM, so a row's position among its
+ # siblings is meaningless and the index must state its place in the
+ # FULL view. Get it wrong and a screen reader confidently announces
+ # "row 3 of 40" in a five-thousand-row sheet, which is worse than
+ # silence because it is trusted. Also guarded: activeElement after a
+ # click and after a repaint (every paint replaces innerHTML, so without
+ # restoration focus drops to BODY), one roving tab stop, and that
+ # nothing here is a live region.
+ shell: bento-step {0}
+ run: node scripts/test-dash-a11y.ts
+
+ - name: dash per-cell appearance
+ # Appearance on BOTH sheet kinds, which had drifted: the format always
+ # carried bold/colour on a spreadsheet cell and a dataset cell could
+ # carry none of it. The check worth naming mounts the REAL grid and
+ # reads the emitted markup, because the pure-function checks did not
+ # need the grid to call appearanceCss at all — measured, deleting both
+ # paint calls left 69 and 123 checks green with the feature invisible
+ # on screen. This repo shipped that shape once already (--accent-ink
+ # was a token the stylesheet never declared). Also pins that appearance
+ # cannot smuggle a value or a type onto a dataset, where the COLUMN
+ # type is authoritative, and that the CRDT splits content from
+ # presentation so bolding a cell beside a concurrent retype keeps both.
+ shell: bento-step {0}
+ run: node scripts/test-dash-cellfmt.ts
+
+ - name: dash column type vs storage
+ # Guards a shipped bug that produced a WRONG NUMBER at the end of a path
+ # dash itself recommends — the worst shape a defect can take: not a
+ # crash, not an error cell, a confident total that is wrong. Import
+ # lands a mixed column as text and advises setting the type; doing that
+ # used to move only `col.type`, so the grid right-aligned and
+ # number-formatted the values while `aggregate` skipped every one of
+ # them. Measured on a real .xlsx: footer SUM 0 against a true total of
+ # 10,308.85, a number dash returns correctly from =SUM() on a
+ # spreadsheet copy of the same rows. Three properties: converting works;
+ # undo restores the BYTES and not just the declaration (text→number→text
+ # is lossy, "1200.50" returns as "1200.5", which a typeof check cannot
+ # see); and what will not convert is refused rather than zeroed. The
+ # validator half is checked too, because store.ts can only stop this
+ # state being created — it still arrives from files saved by the buggy
+ # build and from hand-edited JSON, which PLATFORM §7 makes a way in.
+ shell: bento-step {0}
+ run: node scripts/test-dash-coltype.ts
+
+ - name: dash starter workbook
+ # The starter ships INSIDE the shell, so it is what bento.page shows and
+ # what every downloaded copy opens with — the one document in this repo
+ # a stranger is guaranteed to see — and nothing guarded it. Two families:
+ # that it is a valid, self-consistent workbook (a starter that trips
+ # validateDoc ships the app's own warning banner to every new reader on
+ # first open), and that the NUMBERS are right. The second is the one that
+ # will catch something: the Scratch sheet reads across into the dataset
+ # by ADDRESS, so reordering, inserting or hiding a column silently
+ # re-points two totals on another sheet, and nothing about that is
+ # visible in a diff. The addresses are pinned by column NAME and the
+ # totals computed through the shipping code.
+ shell: bento-step {0}
+ run: node scripts/test-dash-starter.ts
+
+ - name: dash — the off switch for a live session
+ # A polish sweep drove the app at 880px with a session running:
+ # collab.on true, the room live on the relay, and the string "Stop
+ # sharing" NOWHERE in the document — sync.css hid the toggle outright
+ # below 900px to buy width in the top bar, and that toggle is the only
+ # control that stops sharing. The nearest thing left was About's
+ # "Offline mode", which also kills the signed update check: to stop one
+ # workbook being shared you had to switch off the app's networking.
+ # The rule is narrow: a control that REPORTS nothing may stand down at a
+ # narrow width (the 390px measurement behind those rules is real and
+ # still honoured), a control that STOPS something already happening may
+ # not. Checked as CSS text because dash-dom.ts is a parser, not a layout
+ # engine, and cannot say what a viewport width does to a declaration.
+ shell: bento-step {0}
+ run: node scripts/test-dash-stopsharing.ts
+
+ - name: Grid surface rig
+ # The sheet as an OBJECT ON A SURFACE. An eight-row dataset used to
+ # fill the top 180px of a 1440x900 window and leave the rest blank in
+ # the same white as the sheet, so "the table ended here" and "the app
+ # stopped drawing" looked identical — the strongest unfinished signal
+ # the app had. The fix is not more rows (test-dash-frontier.ts owns
+ # that decision and is unchanged): it is a bounded table on a --desk
+ # ground the spreadsheet kind deliberately does not get, plus the three
+ # empty states.
+ #
+ # Half of it is CSS, which has no type system and no runtime errors, so
+ # those checks read the stylesheet as text and MEASURE the palette
+ # rather than merely requiring tokens to be present — a desk 1.02:1
+ # from the paper satisfies every structural check and renders as the
+ # defect. The other half mounts a real Grid and asserts the note is one
+ # node that survives 5,000 rows.
+ shell: bento-step {0}
+ run: node scripts/test-dash-surface.ts
+
+ - name: Data validation rig
+ # In-cell dropdowns and typed entry rules — Excel's Data Validation,
+ # which is NOT dash's validate.ts (that one asks whether a workbook
+ # agrees with itself). Two features, one English word, and a rig that
+ # confuses them tests neither.
+ #
+ # The checks that matter are the three a green suite would otherwise
+ # hide. (1) The dropdown and the invalid mark are asserted on the
+ # MARKUP A REAL GRID EMITS, through BOTH paint loops — the pure
+ # functions were all green with the feature invisible on screen, which
+ # is precisely the failure this repo shipped once already. (2) `reject`
+ # refuses AT THE KEYBOARD and nowhere else: a paste, an import, an undo
+ # and a remote CRDT op all LAND and are marked, because refusing an op
+ # that has already been committed elsewhere either diverges the
+ # replicas or silently discards a collaborator's work. Both arms are
+ # pinned, and a sabotage that leaks the refusal into the paste path
+ # turns the second one red. (3) A rule never changes existing data —
+ # what breaks it is marked, never deleted — and the mark is derived at
+ # paint rather than stored, so it cannot go stale. Also pins the .xlsx
+ # round trip in both directions, including Excel's INVERTED
+ # `showDropDown` attribute (1 hides it), which reads correctly in code
+ # that has it exactly backwards.
+ shell: bento-step {0}
+ run: node scripts/test-dash-datavalid.ts
diff --git a/.github/actions/validate-home-ios/action.yml b/.github/actions/validate-home-ios/action.yml
new file mode 100644
index 00000000..f4271db1
--- /dev/null
+++ b/.github/actions/validate-home-ios/action.yml
@@ -0,0 +1,104 @@
+# validate, home-ios slice: home/ios: the iOS host's bridge, index, release verifier, origin and docstore rigs.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-home-ios
+description: validate, home-ios slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: home/ios bridge rig
+ # The iOS host opens ANY self-contained HTML document and treats those
+ # documents as mutually untrusted, so a page-supplied filename reaching
+ # appendingPathComponent was an arbitrary write inside the container —
+ # including over another deck the user would later open and trust.
+ # Source-shape checks; the Swift half self-skips without a toolchain.
+ shell: bento-step {0}
+ run: node scripts/test-home-bridge.ts
+
+ - name: home/ios index rig
+ # The iOS text extractor is a PORT of home/webext's, and the two are held
+ # together by nothing but agreement — so this diffs them, driving the
+ # real library.js against the compiled Swift over generated edge cases
+ # and every document in the tree. A divergence means a deck is findable
+ # by a phrase on one host and not the other, which nothing else notices.
+ # This one really runs HERE: BentoIndex.swift is Foundation-only, and the
+ # runner has Swift, so the diff happens on every push rather than only on
+ # a Mac. That is the payoff for keeping UIKit out of that file.
+ shell: bento-step {0}
+ run: node scripts/test-tray-index.mjs
+
+ - name: home/ios release verifier rig
+ # Starter decks are not bundled; a new document is FETCHED from the
+ # signed release channel and written to disk as an executable page. The
+ # signature and hash checks are what make that acceptable, so this proves
+ # the verifier REFUSES — tampered payload, tampered signature, a real
+ # signature over different bytes, no signature at all. Watching it accept
+ # the live manifest proves nothing: `return true` passes that test.
+ # Unlike the index rig above this CANNOT run here — CryptoKit is
+ # Apple-only — so it probes for that module (not for swiftc, which the
+ # runner has) and skips loudly. A Mac must run it before Releases.swift
+ # changes.
+ shell: bento-step {0}
+ run: node scripts/test-tray-releases.mjs
+
+ - name: home/ios origin identity rig
+ # Which storage origin a document runs in. It used to be a hash of the
+ # file's path, so a different file that later took the same path read
+ # the previous one's recovery copy and member key. The origin follows the
+ # file's document identifier now; this compiles the real OriginIdentity
+ # and checks every rule. CryptoKit only, so it skips off Apple platforms.
+ shell: bento-step {0}
+ run: node scripts/test-home-origin.mjs
+
+ - name: home/ios docstore rig
+ # The host's per-document store: this device's collab member private key
+ # in the Keychain, the recovery copy in an app-private file, partitioned by
+ # the document's origin. Compiles the real HostDocStore; skips off Apple.
+ shell: bento-step {0}
+ run: node scripts/test-home-docstore-ios.mjs
+
+ - name: home/ios bento/connect keys rig
+ # The agent's keys: the account key, the Secure Enclave routine and consent
+ # keys, raw low-S signatures (verified in WebCrypto), never minting over a
+ # store it could not read, and the §29 biometric-enrolment notice outbox.
+ # Apple toolchains only; skips elsewhere.
+ shell: bento-step {0}
+ run: node scripts/test-home-id-keys.mjs
+
+ - name: home/ios bento/connect statements rig
+ # The Swift statements against kernel/fixtures/identity-v1.json: verdict
+ # and reason on every row, round trips, tampering, transcripts, low-S,
+ # purposes, addresses, spendCalled and the frozen display table.
+ shell: bento-step {0}
+ run: node scripts/test-home-id-statements.mjs
+
+ - name: home/ios bento/connect agent rig
+ # sign() routing and the host-stamped consent statement (§2e (A)): what
+ # the page can name, what only the host stamps, and the verifier refusing
+ # a relay, replay, payload swap or docId swap.
+ shell: bento-step {0}
+ run: node scripts/test-home-id-agent.mjs
+
+ - name: home/ios bento/connect recovery rig
+ # Argon2id (ours: RFC 9106, Node's native one on random inputs) and every
+ # byte of kernel/fixtures/recovery-v1.json: the recovery code, derivations,
+ # both key blobs, and recovered scalars checked through CryptoKit. Apple only.
+ shell: bento-step {0}
+ run: node scripts/test-home-id-recovery.mjs
+
+ - name: home/ios Spotlight rig
+ # What the system search index holds for a document and keeping it current
+ # after a save: replaced at once, delete-before-add when sealed, and
+ # entries removed for documents a walk no longer finds. Apple only.
+ shell: bento-step {0}
+ run: node scripts/test-home-spotlight.mjs
diff --git a/.github/actions/validate-home-webext/action.yml b/.github/actions/validate-home-webext/action.yml
new file mode 100644
index 00000000..d63ef55a
--- /dev/null
+++ b/.github/actions/validate-home-webext/action.yml
@@ -0,0 +1,158 @@
+# validate, home-webext slice: home/webext: the browser extension's package and rigs.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-home-webext
+description: validate, home-webext slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: WebExtension package rig
+ # Validates the store package without writing it: every file the
+ # manifest names exists, every icon is the size it claims, no unexpected
+ # file is about to ship (probe/ is four capability probes — harmless to
+ # us, alarming to a reviewer), and no permission is declared but unused.
+ # A listing rejected for a missing 128px icon costs days of review.
+ shell: bento-step {0}
+ run: node scripts/pack-webext.mjs --check
+
+ - name: WebExtension background rig
+ # The half that WRITES, and previously the untested half. Two properties
+ # it must hold: the target file comes from sender.url (browser-stamped)
+ # and never from the page, and nothing is carried between messages,
+ # because an MV3 service worker is evicted mid-save and state across that
+ # gap fails intermittently on nobody's machine but the user's.
+ shell: bento-step {0}
+ run: node scripts/test-webext-background.ts
+
+ - name: WebExtension bridge rig
+ # home/webext decides, per save, whether to write in place or hand back
+ # to the browser's own picker. Wrong in the permissive direction it
+ # overwrites the open document with no dialog — which it did once. The
+ # decision is pure logic over an options bag, so it is checkable here
+ # rather than by reloading an extension and pressing Cmd-S.
+ shell: bento-step {0}
+ run: node scripts/test-webext-bridge.ts
+
+ - name: WebExtension route rig
+ # Turning an absolute path into "where this granted folder lives", from
+ # paths the extension did not choose — browser history, for files that
+ # may have moved or never been in a grant at all. Getting it wrong does
+ # not produce a broken link; it records a folder at the wrong place and
+ # every document in it silently opens something else. So it must prove,
+ # never guess: the route resolves inside the grant AND dir.resolve()
+ # agrees with the path's own tail.
+ shell: bento-step {0}
+ run: node scripts/test-webext-route.ts
+
+ - name: WebExtension document-library rig
+ # The popup is a document browser, and everything in it is DERIVED from
+ # files on disk: the title out of the document block, the thumbnail out
+ # of the preview block, the openable path out of a learned prefix. Each
+ # is a parse against a format that moves, and each fails quietly — a row
+ # showing a filename instead of a title, or a blank square. Nothing
+ # throws, so nothing reports it.
+ #
+ # Runs AFTER the slides build on purpose: it reads the real shell, and
+ # with a document spliced in at the real offset. Hand-written fixtures
+ # would have passed the bug this replaces, where a metadata reader hunted
+ # for the document block's CLOSING tag and so found nothing in any
+ # document carrying an image.
+ shell: bento-step {0}
+ run: node scripts/test-webext-library.ts
+
+ - name: WebExtension release-trust rig
+ # Creating a document downloads an app shell and writes it to the user's
+ # disk, where they later double-click it — executable HTML they go on to
+ # trust. So the manifest's signature is checked against the key compiled
+ # into the extension, and the download against the digest that signature
+ # covers. Signature over the pin, pin over the bytes.
+ #
+ # It also reads a REAL manifest captured from the release origin, which
+ # is the check that could not be faked into passing: the shipped code
+ # read `url` off the top level of a SIGNED ENVELOPE that has no top-level
+ # url, so the + button had never worked in any version — and the rig
+ # agreed, because its fixture was written to the shape the code wanted.
+ shell: bento-step {0}
+ run: node scripts/test-webext-release.ts
+
+ - name: WebExtension update-notice rig
+ # Store installs update themselves; one loaded unpacked never will, and
+ # Chrome ignores update_url for a development install. So the GitHub
+ # route has to be told — and told in exactly one direction: a store user
+ # must never see a notice they cannot act on, and must not even cost a
+ # request. Every failure mode here is silent by nature.
+ shell: bento-step {0}
+ run: node scripts/test-webext-update.ts
+
+ - name: WebExtension placement rig
+ # A granted folder has no path; the library can only open a document
+ # by its file:// URL. Placement GUESSES paths and PROVES one by bytes
+ # and by the grant itself — the property that matters is that a wrong
+ # guess (same name, other bytes; same bytes, a copy elsewhere) is never
+ # recorded. Also the title card drawn for a document with no preview.
+ shell: bento-step {0}
+ run: node scripts/test-webext-place.ts
+
+ - name: WebExtension file-grant rig
+ # Saving in place for a document outside every granted folder: a
+ # per-file handle the extension holds, the downloads API for Downloads,
+ # the one-time offer. Each must write only the sender's own file, use a
+ # handle only when proven to be that file (name and bytes), and fail to
+ # the browser's own picker — never to nothing.
+ shell: bento-step {0}
+ run: node scripts/test-webext-filegrant.ts
+
+ - name: WebExtension save-as rig
+ # "Save a copy" and exports answered in the extension's own window, so
+ # they can land beside the document. The page supplies a name, never a
+ # place; a write lands only where the person chose and only for the
+ # document that asked; a beside-name is never a path or the original.
+ shell: bento-step {0}
+ run: node scripts/test-webext-saveas.ts
+
+ - name: WebExtension DocStore rig
+ # A document's crash recovery and member key live in the extension's
+ # origin, partitioned by the file path the browser reports. One document
+ # must never reach another's entries, a payload must never name a
+ # partition, and a moved file's recovery follows it only when the old
+ # path is gone (seen through a grant) and the content hash matches; the
+ # member key never follows.
+ shell: bento-step {0}
+ run: node scripts/test-webext-store.ts
+
+ - name: WebExtension bento/id rig
+ # The extension's statement code must be the kernel reference, unaltered
+ # (a generated type-strip, checked current), and must pass the whole
+ # conformance contract in kernel/fixtures/identity-v1.json. The
+ # passkey-wrapped account key must fail closed for the wrong passkey,
+ # credential or binding; the recovery code is 80 random bits.
+ shell: bento-step {0}
+ run: node scripts/test-webext-id.ts
+
+ - name: WebExtension localisation rig
+ # Every failure mode of a message catalogue is silent: a key the code
+ # uses but English lacks renders as the key name, a locale missing a key
+ # falls back so a German page carries English sentences, and a dropped
+ # $1 leaves a hole in a translated sentence. All of them are visible
+ # only to someone who reads that language.
+ shell: bento-step {0}
+ run: node scripts/test-webext-i18n.ts
+
+ - name: WebExtension assistant rig
+ # The Assistant is extension-only: the page holds no key, so what the
+ # extension ACCEPTS decides the feature. A frame from an iframe on a
+ # slide, a page the user never allowed, an abort naming another tab's
+ # turn, a describe or an error that echoes the key or the endpoint —
+ # every one of those is silent in a browser and loud here.
+ shell: bento-step {0}
+ run: node scripts/test-webext-assistant.ts
diff --git a/.github/actions/validate-home/action.yml b/.github/actions/validate-home/action.yml
new file mode 100644
index 00000000..4d160835
--- /dev/null
+++ b/.github/actions/validate-home/action.yml
@@ -0,0 +1,71 @@
+# validate, home slice: home/: rigs shared by every native host and the extension (launch handle, per-document store, legacy-origin inspector, tray mark, document-index corpus).
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-home
+description: validate, home slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: home launch handle rig
+ # A page in a native host held no file handle until its first save, so
+ # autosave never wrote the file. home/bridge.js now hands it over through
+ # launchQueue — lazily, so documents from older runtimes keep their first
+ # silent save — and a launch request the host cannot meet is refused,
+ # never turned into an export. Runs the real bridge against a fake host.
+ shell: bento-step {0}
+ run: node scripts/test-home-launch.mjs
+
+ - name: home per-document store rig
+ # The shared bridge relays the kernel's per-document store
+ # (kernel/src/docstore.ts) to a native host, which keeps the recovery
+ # copy and the member key out of the page's own web storage. Driven end
+ # to end here: the real bridge, the real kernel client, a fake host. It
+ # proves the store appears ONLY when the native side declares it — a
+ # store advertised and then refused would lose the member key on every
+ # reload — and that bytes round-trip as a Uint8Array the kernel accepts.
+ shell: bento-step {0}
+ run: node scripts/test-home-docstore.mjs
+
+ - name: home legacy-origin inspector rig
+ # Before an Android document adopts the storage it used under the old
+ # per-path origins, an inspector page reports which documents own data
+ # there. This runs that script as it ships (extracted from
+ # DocumentOrigin.kt) against kernel-shaped storage: every app's autosave
+ # attributed, bento-handles by key, and anything it cannot tie to a
+ # document — including bento-blobcache, which holds plaintext media —
+ # refusing adoption. The JVM tests cover the decision; only this covers
+ # the script.
+ shell: bento-step {0}
+ run: node scripts/test-home-inspector.mjs
+
+ - name: tray mark is one source
+ # tray-icon.svg is the only drawing of the mark. Everything else is
+ # generated from it: the Android launcher vectors (which have no <rect>,
+ # so each rounded corner becomes opaque path data nobody would diff), and
+ # the iOS asset catalog — the mark plus the four brand colours the app's
+ # chrome reads by name. A hex value retyped into Swift is a value that can
+ # disagree with the logo while looking almost right, which is the kind of
+ # wrong nothing notices. This fails if any of it drifts.
+ shell: bento-step {0}
+ run: node home/assets/make-icons.mjs --check
+
+ - name: document index conformance corpus
+ # home/fixtures/ is the corpus all three hosts answer — the JS reference
+ # here, the Kotlin port under Gradle, the Swift port in the rig above.
+ # This is the JS side of it, and it is the reference the other two are
+ # diffed against, so a break here is a break in the thing they agree
+ # with. It went unregistered and then unnoticed: the tray→home rename
+ # left it importing ../tray/doc-index.mjs, and a rig nobody runs cannot
+ # report its own import failure.
+ shell: bento-step {0}
+ run: node scripts/test-doc-index.mjs
diff --git a/.github/actions/validate-kernel/action.yml b/.github/actions/validate-kernel/action.yml
new file mode 100644
index 00000000..4f9906f1
--- /dev/null
+++ b/.github/actions/validate-kernel/action.yml
@@ -0,0 +1,510 @@
+# validate, kernel slice: kernel/ and the sync relay: the shared machinery every app depends on (anim, field classes, restore, identity, UI primitives, storage, save, offline, the CRDT and the sync session).
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-kernel
+description: validate, kernel slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: Which targets anim treats as elements
+ # The element/plain-object split ran on HTMLElement||SVGElement, which
+ # excludes MathML — formula symbols became plain-object tweens, with
+ # opacity assigned as a JS property and no style ever written.
+ shell: bento-step {0}
+ run: node scripts/test-anim-elements.ts
+
+ - name: Transforms are not silently ignored
+ # A CSS transform does nothing to a non-replaced inline element: it is
+ # accepted, style.transform reads back verbatim, and the box never
+ # moves. An animation on one reports perfect health and paints nothing,
+ # which is exactly how it survived eight rounds of debugging once.
+ shell: bento-step {0}
+ run: node scripts/test-anim-inline.ts
+
+ - name: Typecheck kernel (standalone)
+ # Apps also typecheck kernel transitively through their imports; this
+ # catches kernel-only errors under the kernel's own flags. It ALSO
+ # evaluates kernel/src/docfields.typecheck.ts (included via "src"): the
+ # field-class table's type-level test, whose @ts-expect-error lines fail
+ # this step if a guard is weakened (no default cell, 'per-field' only in
+ # the mode row, every mode field has a rule).
+ working-directory: slides
+ shell: bento-step {0}
+ run: node_modules/.bin/tsc -p ../kernel
+
+ - name: Field-classification rig
+ shell: bento-step {0}
+ run: node scripts/test-field-class.ts
+
+ - name: Whole-document restore rig (undo / version restore / crash recovery)
+ # applyRestore decides per field from its class, with per-field overrides,
+ # and the restore DIRECTION matters: a version restore ('back') keeps a
+ # live field; crash recovery ('recover') reconciles a live history field
+ # with the newer snapshot. Recover hooks (newestListWins for unsigned
+ # lists) vs the default (signed-safe). On recover, a field absent from a
+ # whole snapshot stays removed (deleted or cleared stays so) unless the
+ # rules opt it out (keepLiveWhenAbsent); a projection keeps the live value.
+ shell: bento-step {0}
+ run: node scripts/test-restore.ts
+
+ - name: identity agent contract
+ # bento/id: how a document finds the host's identity agent. A valid
+ # agent only, null otherwise (today's behaviour), never a throw, and
+ # once found it cannot be swapped. Contract only: nothing calls it yet.
+ shell: bento-step {0}
+ run: node scripts/test-identity.ts
+
+ - name: identity statements and conformance vectors
+ # bento/id: every signed statement (dev., bind., att., tomb., del.,
+ # cmp., cns.) and the address normal form. The reference must pass
+ # every row of kernel/fixtures/identity-v1.json, which is the contract
+ # each native host is held to, and must refuse every tampered statement.
+ shell: bento-step {0}
+ run: node scripts/test-statements.ts
+
+ - name: identity recovery code and key blobs
+ # bento/id: every host must derive the identical keys from the same
+ # recovery code and passkey PRF output. Deterministic vectors in
+ # kernel/fixtures/recovery-v1.json: Argon2id against RFC 9106, the
+ # code's printed form and forgiving parse (all five extra check symbols),
+ # every derivation, every blob re-sealed byte for byte, every refusal.
+ shell: bento-step {0}
+ run: node scripts/test-recovery.ts
+
+ - name: identity seal — one "body is sealed" predicate
+ # bento/id §E: every plaintext-to-disk guard asks isBodySealed(), not
+ # "is there a password". The identity-sealed body is a genuine bento/enc
+ # v1 envelope (kdf hkdf-kdoc) that frozen shells read as sealed; fresh
+ # salt per save; the password path unchanged; the two refuse each other.
+ shell: bento-step {0}
+ run: node scripts/test-body-seal.ts
+
+ - name: Language pack verification rig
+ # Packs come off the network, so the signature + hash-pin chain is the
+ # only thing between a hostile channel and the strings in the UI.
+ # Tampered pack, tampered index, unsigned index — each must be refused.
+ shell: bento-step {0}
+ run: node scripts/test-packs.ts
+
+ - name: Tokenizer contract
+ # The kernel's built-in highlighting tier. Renderers rebuild text from
+ # the token stream, so losslessness is corruption-or-not; and multiline
+ # tokens are declared, because a blockified token carrying \n collapses
+ # a code block to one line with no error anywhere.
+ shell: bento-step {0}
+ run: node scripts/test-tokenize.ts
+
+ - name: Shared panel primitive rig
+ # kernel/src/ui/panel.ts is the second UI primitive (after the menu):
+ # the resizable, collapsible side panel three apps hand-rolled and a
+ # fourth stubbed. Every check guards a piece of invisible behaviour each
+ # app learned alone — the no-animation-during-drag class, the RTL widen
+ # direction, a collapsed panel refusing to drag, per-viewer persistence
+ # clamped on restore, the drawer that boots shut below a phone width —
+ # plus the theming guard (every colour chain reaches a token each of the
+ # four apps defines and themes). Each is mutation-caught.
+ shell: bento-step {0}
+ run: node scripts/test-ui-panel.ts
+
+ - name: Shared dialog primitive rig
+ # kernel/src/ui/dialog.ts is the tier-3 consolidation: the modal all
+ # four apps build their About dialog on. The checks guard behaviour that
+ # lived in one app or none — focus captured on open and restored to the
+ # opener on close, a capture-phase document Escape that does not fall
+ # through to the editor behind it, backdrop dismissal that a click on the
+ # card does not trigger, and a real focus trap (Tab wraps in the card) —
+ # plus listener cleanup and the shared theming guard. Each is
+ # mutation-caught; none is visible to a developer with a mouse.
+ shell: bento-step {0}
+ run: node scripts/test-ui-dialog.ts
+
+ - name: Shared tooltip primitive rig
+ # kernel/src/ui/tooltip.ts — built ahead of a consumer (no app has a
+ # hover tooltip; all four use native title=), so the checks pin the
+ # contract chosen, not a behaviour found: shows after a delay on
+ # hover/focus, hides on leave/blur/Escape, wires aria-describedby, does
+ # not flash on a pointer passing through, and — the one that matters —
+ # renders in document.body as a fixed element so no scroll container
+ # clips it (hard-won detail 10). Behaviours mutation-caught; themed
+ # through the shared guard.
+ shell: bento-step {0}
+ run: node scripts/test-ui-tooltip.ts
+
+ - name: Shared toggle primitive rig
+ # kernel/src/ui/toggle.ts — built ahead of a consumer (the three
+ # "toggle"-named classes across the apps are a native checkbox, a
+ # disclosure block and a button group; no shared switch). The checks pin
+ # the contract chosen: a real role="switch" with aria-checked, a click
+ # toggles and fires onChange, set() updates state WITHOUT firing
+ # onChange, and it is a <button> so the platform gives it keyboard
+ # activation. Behaviours mutation-caught; themed through the shared guard
+ # (whose alias-indirection fix — a token defined as var(--other) is
+ # themed iff --other is — landed here so dash's --chrome-2: var(--hover)
+ # resolves).
+ shell: bento-step {0}
+ run: node scripts/test-ui-toggle.ts
+
+ - name: Shared menu primitive rig
+ # kernel/src/ui/menu.ts replaces four hand-rolled dropdowns, and what
+ # differed between them was all INVISIBLE: three of the four apps
+ # publish no aria-expanded at all, five of slides' eight dropdowns never
+ # dismissed on an outside press, no app closed a menu on Escape or let
+ # an arrow key move through one, and two apps added a document listener
+ # per dropdown and removed none. Each of those is a check here, because
+ # every one of them is a regression a sighted developer with a mouse
+ # would never notice.
+ shell: bento-step {0}
+ run: node scripts/test-ui-menu.ts
+
+ - name: First-page preview rig
+ # Every save writes a static render of page one for file-manager
+ # thumbnails. Two decisions in that path fail silently: an encrypted
+ # deck must never carry one, and author content must never reach the
+ # file carrying a script tag.
+ shell: bento-step {0}
+ run: node scripts/test-preview.ts
+
+ - name: Encrypted-title rig
+ # An encrypted file must not announce its subject in plaintext: the
+ # <title> and the suggested download filename both used to derive from
+ # the document title. Pins that encrypted output gets a generic title
+ # and a neutral filename (source gate, always on), with a whole-file
+ # scan where a DOM is present.
+ shell: bento-step {0}
+ run: node scripts/test-enc-title.ts
+
+ - name: Return-gate rig
+ # The web demo always starts fresh, so someone who saved from
+ # bento.page and came back saw a blank starter and read it as lost
+ # work. The gate that fixes it can be worse than the silence it
+ # replaces: firing over a real document, or offering a host that has no
+ # release (telling an Android user to install a Chrome extension). This
+ # pins both, and that the mobile rows degrade until those hosts ship.
+ shell: bento-step {0}
+ run: node scripts/test-return-gate.ts
+
+ - name: Offline-mode rig
+ # Offline mode promises "nothing leaves this computer" and was broken
+ # five ways at once (GHSA-5c3x-xqp6-g94r): a manual update check, a
+ # language-pack download, a deck's remote <video>, in-flight requests
+ # that kept running, and a second tab's socket that kept syncing.
+ #
+ # It stayed hidden because it reads as correct: an agent asked to audit
+ # it said "secure" from the docs AND from the code. So the rig does not
+ # check the call sites — it enforces the POLICY that no file outside
+ # kernel/src/net.ts may touch a network primitive at all, which is what
+ # stops the NEXT call site being wrong, plus the chokepoint's own
+ # behaviour (refusal, aborting what is already in flight, cross-tab).
+ shell: bento-step {0}
+ run: node scripts/test-offline.ts
+
+ - name: Origin-trust rig
+ # The release-manifest / sync / pack URL dev overrides live in
+ # localStorage, which is shared across all file:// documents — so they
+ # are honoured only from a real, isolated origin (sharedStorageOrigin).
+ shell: bento-step {0}
+ run: node scripts/test-origin-overrides.ts
+
+ - name: Blob content-address rig
+ # Encrypted assets are fetched by content address from a relay the
+ # threat model treats as untrusted. Nothing verified that what came
+ # back matched what was asked for, and the substitution was cached to
+ # disk, so one poisoned response persisted.
+ shell: bento-step {0}
+ run: node scripts/test-blobs.ts
+
+ - name: Save-intent rig
+ # A host polyfilling showSaveFilePicker sees only the options bag, and
+ # must tell "overwrite the open document" from "make a second file" from
+ # that alone. It could not, and a browser extension overwrote a deck.
+ # `id` is the signal; if the three purposes ever collapse to one value
+ # every host silently loses the distinction.
+ shell: bento-step {0}
+ run: node scripts/test-savepurpose.ts
+
+ - name: Remember-the-file-handle rig
+ # A deck in ~/Documents or ~/Downloads can never be covered by a
+ # directory grant (Chrome's blocklist), so it re-ran the save picker on
+ # every reopen. The FILE handle is remembered (IndexedDB by docId) and
+ # reconnected with a permission prompt inside the save gesture. Guards:
+ # name-match, denied/NotFound -> picker + drop, only a real handle (never
+ # a host polyfill), reconnect BEFORE serialize so activation stays fresh.
+ shell: bento-step {0}
+ run: node scripts/test-file-handle.ts
+
+ - name: DocStore (per-document storage under the extension)
+ # Under bento/home, the crash-recovery copy and the member key's private
+ # half live in the extension's per-document store; localStorage keeps
+ # only the public key its readers need. No host, or a host that refuses
+ # or never answers: the old storage, unchanged.
+ shell: bento-step {0}
+ run: node scripts/test-docstore.ts
+
+ - name: Guarded storage rig
+ # localStorage's absence is hostile: reading the PROPERTY throws, so
+ # `if (localStorage)` is itself the crash and one bare read at module
+ # scope takes the whole file down before it paints. Measured in a
+ # sandboxed iframe. The rig simulates each failure mode and pins the
+ # regression: importing a module that reads storage on load must not
+ # throw when storage does.
+ shell: bento-step {0}
+ run: node scripts/test-storage.ts
+
+ - name: Save queue rig
+ # kernel/src/savequeue.ts serializes writes against one file handle and
+ # acknowledges each by revision, so an edit made WHILE an async write is in
+ # flight is never marked saved and lost (the setDirty-after-write race
+ # every app had). The rig pins serialization, the detached snapshot,
+ # isCurrent() going stale on any later edit or same-id replacement, the
+ # document-swap discard, and that a failed write never poisons the queue.
+ shell: bento-step {0}
+ run: node scripts/test-savequeue.ts
+
+ - name: Autosave per-app database rig
+ # Every app shared one IndexedDB database AND one DB_VERSION, so spaces
+ # has been writing into slides' store, and a version bump by any new app
+ # would make every SHIPPED shell of every other app throw VersionError
+ # and lose autosave. Renaming without carrying the data over would empty
+ # a visible feature, so the migration is tested in both directions.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-autosave.ts --bundle --platform=node --format=esm \
+ --alias:fake-indexeddb/auto=./slides/node_modules/fake-indexeddb/auto/index.js \
+ --outfile="$RUNNER_TEMP/test-autosave.mjs"
+ BENTO_TEST_APP=bento-slides node "$RUNNER_TEMP/test-autosave.mjs"
+ BENTO_TEST_APP=bento-spaces node "$RUNNER_TEMP/test-autosave.mjs"
+
+ - name: The plaintext store refuses while sealed (bento/connect backstop)
+ # kernel/src/autosave.ts: while the body is sealed (password or identity
+ # seal), putRecovery/addVersion refuse and getRecovery/listVersions offer
+ # nothing, so an app missing one of its own guards still can't write or
+ # offer plaintext. The purge (clearRecovery/clearVersions) still works
+ # while sealed, for that document only.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-store-backstop.ts --bundle --platform=node --format=esm \
+ --alias:fake-indexeddb/auto=./slides/node_modules/fake-indexeddb/auto/index.js \
+ --outfile="$RUNNER_TEMP/test-store-backstop.mjs"
+ node "$RUNNER_TEMP/test-store-backstop.mjs"
+
+ - name: zip decompression-bomb cap
+ # readZip caps each entry's inflated output at min(declared size, a hard
+ # ceiling), aborting the stream the instant it overflows — a crafted
+ # archive that under-declares its size can no longer exhaust memory before
+ # the size check runs. Every check is mutation-proven against a neutered cap.
+ shell: bento-step {0}
+ run: node scripts/test-zip-bomb.ts
+
+ - name: relay protocol — one wire format, two clients
+ # dash's online.ts is a PORT of the transport slides uses (now moving
+ # into kernel/). The two files are separate text that nobody diffs, and
+ # ONE DEPLOYED WORKER verifies both: it pins the room id to a key and
+ # walks an owner→invite→member signature chain. If one client's idea of
+ # `inv.${pub}.${role}.${exp}` drifts, the symptom is not a red test — it
+ # is one app's users silently unable to join the other's rooms, on a
+ # relay that cannot be rolled back independently of the shells already
+ # in people's files. This diffs only what goes on the wire.
+ shell: bento-step {0}
+ run: node scripts/test-relay-protocol.ts
+
+ - name: relay broadcast rig
+ # A show is a special case of collaboration: an audience member holds
+ # an owner-signed `audience` invite and a per-show key, and the relay
+ # routes by stream. What breaks silently if this regresses: an audience
+ # socket admitted on the room token (it holds the show key, not the
+ # room key, so the compare must be skipped for the role and only the
+ # role); an audience socket that can send anything (the invite is on the
+ # same chain as a writer's, so the check is by role); an aud frame that
+ # reaches the room stream or the room's op log (show-key ciphertext
+ # persisted forever, replayed to every future collaborator as noise); a
+ # late joiner served the room's op log; show state kept in memory,
+ # which hibernation evicts mid-show; and the presenter-loss grace timer
+ # firing the DO's single alarm as the 30-day room WIPE. Each is a
+ # mutation this rig turns red on.
+ shell: bento-step {0}
+ run: node scripts/test-relay-broadcast.ts
+
+ - name: relay authorization rig
+ # Drives the real Room durable object with fake sockets and storage.
+ # What it guards: the relay stamps a fanned-out frame with exactly what
+ # it verified and never with what it did not; a socket that merely
+ # hash-matches the room's public key is challenged and handed no blob
+ # write ticket, cannot latch the room, and cannot answer with a forged,
+ # replayed or cross-room proof; revocation re-mints the ticket to
+ # proven sockets only; and a snapshot claiming a seq the room has not
+ # reached is refused rather than allowed to prune the op log. Every
+ # one of these is silent when it regresses — the relay keeps working
+ # and simply trusts more than it should.
+ shell: bento-step {0}
+ run: node scripts/test-relay-auth.ts
+
+ - name: client vouch rig — the other half of read-only
+ # Drives a REAL OnlineTransport (kernel's and dash's twin) through a
+ # fake socket in a signed room. Every copy holds the room key, so a
+ # reader can encrypt an op batch and the blind relay fans it out
+ # unstamped; the client's `vouched()` is the only thing between that
+ # frame and every live editor applying it. With `vouched` mutated to
+ # `return true`, every other rig in the tree stayed green — security
+ # found that by mutation, and this rig is the answer: unstamped ops and
+ # snapshots refused, stamped ones applied, presence unaffected, legacy
+ # r-rooms permissive. Bundled because the kernel transport uses
+ # parameter properties, which node's strip-only loader rejects.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-sync-vouch.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-sync-vouch.mjs"
+ node "$RUNNER_TEMP/test-sync-vouch.mjs"
+
+ - name: session broadcast surface rig
+ # startShow/endShow, the verb channel, and the audience's reception.
+ # What breaks silently if it regresses: the audsnap under the show key
+ # is the LIVE sync state instead of a fresh adopt of the projected doc,
+ # which leaks `stash` (deleted slides' notes) and the whole per-keystroke
+ # text history past the projection; or a local op reaches the audience
+ # without the app's projection applied. Both are mutation-caught here.
+ shell: bento-step {0}
+ run: node scripts/test-sync-show.ts
+
+ - name: CRDT property-removal rig
+ # Removing a property travels as a `set` op with `v` ABSENT, and the
+ # receiving replica threw on it: JSON.stringify(undefined) is undefined,
+ # and a debug line sliced it. Live in shipped files. The convergence rig
+ # missed it through 300 seeds because its generator assigns properties
+ # and never removes one — a property-based rig only explores the
+ # mutations it was taught.
+ shell: bento-step {0}
+ run: node scripts/test-crdt-delprop.ts
+
+ - name: CRDT convergence rig
+ # 40 seeds locally; deeper on CI where the seconds are free.
+ shell: bento-step {0}
+ run: SEEDS=300 node scripts/test-sync.ts
+
+ - name: CRDT equivalence rig (baseline vs candidate, byte for byte)
+ # Convergence is the weaker property: an engine that converges with
+ # ITSELF while minting different bytes than the shipped engine passes
+ # the step above and silently splits every bento/slides file in the
+ # field. This step asserts byte-identity instead.
+ #
+ # The baseline is a FROZEN copy of the engine as shipped
+ # (scripts/lib/sync-baseline-frozen.ts), so this run is live from here
+ # on: it compares the working engine against the bytes every file in
+ # the field was written by. REQUIRE_LIVE=1 fails the build if the
+ # candidate is ever repointed at something that resolves back to the
+ # baseline — the quiet way a gate stops gating.
+ shell: bento-step {0}
+ run: REQUIRE_LIVE=1 SEEDS=200 STEPS=60 ACTORS=4 node scripts/test-sync-equiv.ts
+
+ - name: CRDT document-shape seam
+ # The equivalence rig proves a NEGATIVE — that the parameterized engine
+ # still mints the bytes shipped files were written with — and a
+ # parameterization that quietly did nothing would pass it. This proves
+ # the positive: a second shape (pages→blocks) produces an engine that
+ # actually works, keys nodes on the composite pageId+blockId, and
+ # restores as itself. Also pins the constructor contract: the shape has
+ # no default, because a default is how a spaces call site silently ends
+ # up holding slides' shape.
+ shell: bento-step {0}
+ run: node scripts/test-sync-shape.ts
+
+ - name: bento/spaces under the shared engine
+ # Convergence for the pages/blocks binding, AND a report on whether
+ # what the replicas converge on is a legal bento/spaces document.
+ # Those are different questions: page.blocks is flat and in pre-order,
+ # while the engine merges `parent` as an ordinary register and order as
+ # a position key — two independent domains describing one tree. The
+ # format half is REPORTED, not asserted, because the fix is a decision
+ # nobody has taken yet; STRICT=1 turns it into a gate the day it is.
+ shell: bento-step {0}
+ run: SEEDS=250 STEPS=80 ACTORS=4 node scripts/test-sync-spaces.ts
+
+ - name: collaborative text on a parent node
+ # The token RGA — what lets two people type in one paragraph without
+ # destroying each other's work — was reachable only on CHILD nodes,
+ # because both shipped apps put their text there. bento/type does not:
+ # a block IS the paragraph. Bound naively it would get a
+ # last-writer-wins register for prose and lose an edit SILENTLY, with a
+ # document that stays valid and converges. Every other sync rig stayed
+ # green through that bug, so this one carries a negative control: the
+ # same scenario with the RGA off MUST lose an edit.
+ shell: bento-step {0}
+ run: node scripts/test-sync-parent-text.ts
+
+ - name: a flat document shape
+ # bento/type is one level deep — `body` holds blocks and nothing sits
+ # beneath them — so `children` is null and there is no element layer.
+ # Binds type's real shape and checks both halves: text still merges
+ # token-by-token, and the document keeps its shape. The second matters
+ # because an engine that quietly wrote `elements: []` onto every block
+ # would converge perfectly while corrupting the format.
+ shell: bento-step {0}
+ run: node scripts/test-sync-flat.ts
+
+ - name: bento/type under the shared engine
+ # Convergence for the flat ('body', null, 'text') binding, AND a report
+ # on whether what the replicas converge on is a legal bento/type
+ # document. Those are different questions: `text` merges token by token
+ # through the RGA while `marks` and `notes` — character offsets INTO
+ # that text — merge as ordinary registers, so two legal concurrent
+ # edits can converge on offsets that no longer describe the text they
+ # index. Reported, not asserted, exactly as the spaces tree question
+ # is: it is a format decision nobody has taken. STRICT=1 makes it a
+ # gate the day one is.
+ shell: bento-step {0}
+ run: SEEDS=250 STEPS=80 ACTORS=4 node scripts/test-sync-type.ts
+
+ - name: the sync session layer
+ # The session — differ hook, shadow, presence, catch-up, the empty
+ # document repair — had NO tests before it was moved into the kernel
+ # and parameterized for three apps. This was written against the
+ # implementation as it shipped and run unchanged after the move, which
+ # is the only thing that makes "behaviour is identical" a claim rather
+ # than a hope. It drives the REAL session over the REAL store through a
+ # REAL BroadcastChannel; two sessions in one process are two tabs.
+ # The last four sections bind bento/type to the same kernel session —
+ # flat document, text on the parent, a store with one listener and no
+ # dirty flag — so a surviving slides assumption shows up there.
+ shell: bento-step {0}
+ run: node --no-warnings scripts/test-sync-session.ts
+
+ - name: Room snapshot carries no capability fields
+ # Every snapshot path (relay upload, fork broadcast, re-snap, flush-time
+ # fork snap) builds from one helper that strips the never-synced fields.
+ shell: bento-step {0}
+ run: node --no-warnings scripts/test-sync-snapshot-collab.ts
+
+ - name: Remote ops and snapshots can't rewrite identity, capability or modes
+ # The never-synced set is also the receive filter (applySet and
+ # mergeSnapshot), and no prototype-shaped name reaches any object.
+ shell: bento-step {0}
+ run: node --no-warnings scripts/test-sync-inbound-docfields.ts
+
+ - name: Doc-level sync allowlist (field-class map)
+ # The other half of the never-synced set: when an app binds a class map,
+ # a peer emits only content-class doc keys and ignores non-content ones
+ # inbound, whatever the sender claims; an unknown key (a newer build's
+ # field) is applied but never re-emitted. With no map it is byte-for-byte
+ # the shipped denylist. skipDoc is the floor under both.
+ shell: bento-step {0}
+ run: node scripts/test-sync-allowlist.ts
+
+ - name: Sync override for a history-class key (shape().syncHistory)
+ # A field's copy class and its sync decision can diverge: type classes
+ # `comments` history (dropped from reader/export copies) but comments
+ # must still flow live. syncHistory names such a key — emitted and
+ # accepted though non-content, with its 1.2.7 wire shape unchanged so a
+ # bound build stays mixed-version-compatible with an unbound one.
+ # Restricted to history-class keys at runtime (shape throws) and at
+ # compile time (historySyncKeys); skipDoc is still the floor.
+ shell: bento-step {0}
+ run: node scripts/test-sync-history-override.ts
diff --git a/.github/actions/validate-shared/action.yml b/.github/actions/validate-shared/action.yml
new file mode 100644
index 00000000..18ec4bd1
--- /dev/null
+++ b/.github/actions/validate-shared/action.yml
@@ -0,0 +1,127 @@
+# validate, shared slice: The shared surface (scripts/, site tooling, i18n packs): checks that span every app. Runs LAST, after every shell is built.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-shared
+description: validate, shared slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: Language coverage
+ # Core catalogs ship inside every saved file and cannot be corrected
+ # without a release, so they must be complete. Packs are downloadable
+ # and re-publishable on their own, so they get a floor and a report.
+ shell: bento-step {0}
+ run: node scripts/test-i18n-coverage.mjs
+
+ - name: Language packs build and index cleanly
+ # Emits every pack and builds the index payload WITHOUT signing (--dry
+ # writes nothing and needs no key — signing stays local, see the header).
+ # Catches a malformed pack catalog (missing label, duplicate language,
+ # wrong app) here rather than mid-release.
+ shell: bento-step {0}
+ run: |
+ node scripts/build-i18n.mjs --packs "$RUNNER_TEMP/packs"
+ node scripts/sign-packs.mjs "$RUNNER_TEMP/packs" --dry
+
+ - name: Shell sizes
+ # TWO MECHANISMS, DELIBERATELY. This one and the advisory PR build-size
+ # comment (.github/workflows/pr-build-size*.yml) answer different
+ # questions, and deleting either as "duplicate measurement" loses a
+ # class of regression:
+ #
+ # this step — ABSOLUTE and PERSISTENT. A shell with enforce:true has
+ # a ceiling and FAILS here; a shell with enforce:false prints its
+ # drift from a committed `reference` and never fails. It is the only
+ # thing that sees SLOW drift — forty merged commits at 300 B each,
+ # where every single PR looked fine on its own.
+ # the PR comment — RELATIVE and PER-PR. It reports this PR against its
+ # own base and never fails. It is the only thing that attributes a
+ # jump to the change that caused it, and it is blind to accumulated
+ # drift.
+ #
+ # Neither subsumes the other. Rationale in docs/DECISIONS.md.
+ #
+ # Placed after ALL THREE builds on purpose: the rig skips a shell that
+ # is not built, so while this sat in the spaces section it silently
+ # measured nothing for dash. bento/spaces has NO CEILING as of
+ # 2026-08-24 (the maintainer's call; at 98.6% it had started deciding
+ # which fixes were affordable) — the step still prints its size and
+ # drift, it just no longer fails on it.
+ shell: bento-step {0}
+ run: node scripts/test-spaces-size.mjs
+
+ - name: App registry rig
+ # scripts/apps.mjs drives what a release builds, stages and signs. A
+ # release SIGNS, and the key never reaches CI, so the pipeline itself
+ # cannot be tested here — but the registry drifting from the tree can,
+ # and a wrong appId is silent: shipped shells verify it against their
+ # own configureApp() id and just stop updating.
+ shell: bento-step {0}
+ run: node scripts/test-release-apps.mjs
+
+ - name: Publish deletion-gate rig
+ # A publish assembles site/ for ONE app and mirrors it authoritatively.
+ # Measured: a spaces-shaped site/ deleted 47 live files — the signed
+ # shell, the manifest, all 22 packs — with every other gate green,
+ # because those gates are `if (existsSync(...))` and skip when the
+ # artifact is missing. Shipped files cannot recover from that.
+ shell: bento-step {0}
+ run: node scripts/test-publish-gate.mjs
+
+ - name: publish account gate — the release account is checked before the site goes live
+ # publish-site.mjs mirrored and pushed the site and THEN failed to
+ # create the GitHub release, three releases running, because gh was
+ # the work profile (a job/temp worktree). The gate runs before rsync;
+ # this rig pins the rule and the order.
+ shell: bento-step {0}
+ run: node scripts/test-publish-account.ts
+
+ - name: app payload fingerprint — a shell with no payload never passes the publish gates
+ # publish-site's shell-consistency gate hashed the shell and every deck
+ # to null when its matcher went stale, and null === null passed it while
+ # it checked nothing. One shared helper; null is "cannot tell", never a match.
+ shell: bento-step {0}
+ run: node scripts/test-apphash.ts
+
+ - name: every rig is actually run
+ # A rig nobody runs is worse than no rig, and it fails flatteringly: the
+ # file is there, the checks in it are good, git log shows it being
+ # maintained, and anyone counting coverage counts it. It just never
+ # executes, so nothing goes red and nothing says so. Five rigs landed in
+ # one afternoon — write-back, print, frontier, a11y, appearance — each
+ # written by a different agent told to write one, none of them knowing
+ # where this list lives; all five passed on disk and none were here.
+ # Also checks the reverse, since a step pointing at a deleted script
+ # fails every push for a reason unrelated to the change that triggered
+ # it, and prints the deliberate-exemption list on every run so it stays
+ # something people look at rather than somewhere failures go to hide.
+ shell: bento-step {0}
+ run: node scripts/test-ci-registered.ts
+
+ - name: Stylesheet brace balance
+ # Every tracked stylesheet's braces balance. A merge seam that eats one
+ # `}` leaves CSS that still builds — an unclosed `@media print {` makes
+ # every later rule print-only, and the app ships unstyled while tsc, the
+ # build and the shell gate all pass.
+ shell: bento-step {0}
+ run: node scripts/test-css-balance.ts
+
+ - name: A rig that skips under CI fails its step
+ # The positive control for bento-step (scripts/ci/): the exact skip lines
+ # rigs printed on main are flagged and lines merely about skipping are
+ # not; a step whose rig skips exits non-zero, end to end, including the
+ # encrypted-title rig with jsdom hidden; only the allowlisted rigs may
+ # skip, each with a reason, and each entry's rig still prints the line;
+ # and every rig step in every CI file runs through the wrapper.
+ shell: bento-step {0}
+ run: node scripts/test-ci-skips.mjs
diff --git a/.github/actions/validate-slides/action.yml b/.github/actions/validate-slides/action.yml
new file mode 100644
index 00000000..d642f6f8
--- /dev/null
+++ b/.github/actions/validate-slides/action.yml
@@ -0,0 +1,578 @@
+# validate, slides slice: bento/slides: typecheck, the single-file shell and its splice gate, and the slides rigs.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-slides
+description: validate, slides slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: i18n packed table is current
+ # The per-locale catalogs are the source of truth; slides/src/i18n/
+ # packed.ts is generated from them and is what actually ships. A stale
+ # packed.ts would silently ship yesterday's translations.
+ shell: bento-step {0}
+ run: node scripts/build-i18n.mjs --check
+
+ - name: Slides Portuguese is pt-BR; the theme picker has its own words
+ # No European-Portuguese markers (ficheiro, guardar for save,
+ # diapositivo, separador, ecrã, tu forms…) in slides' pt catalog, and the
+ # Appearance picker uses "Light mode"/"Dark mode", never the "Light"
+ # font weight ("Fino").
+ shell: bento-step {0}
+ run: node scripts/test-slides-pt-br.mjs
+
+ - name: Typecheck
+ working-directory: slides
+ shell: bento-step {0}
+ run: node_modules/.bin/tsc -b
+
+ - name: Slides save revisions
+ # An edit, panel keystroke, remote op or undo during a write keeps the
+ # deck dirty; writes queue; the CRDT stamp is taken as each one starts;
+ # ⌘S, auto-save and Update this file all write through the queue.
+ shell: bento-step {0}
+ run: node scripts/test-slides-save-revisions.ts
+
+ - name: Slides count-up number rig
+ # #584 ruling: a single dot is a decimal point (12.500), only a
+ # well-formed group with two or more separators is thousands
+ # (1.250.000 settles as authored and counts up grouped).
+ shell: bento-step {0}
+ run: node scripts/test-slides-countup-number.ts
+
+ - name: Build single-file shell
+ working-directory: slides
+ shell: bento-step {0}
+ run: npm run build:single
+
+ - name: Splice conformance gate
+ shell: bento-step {0}
+ run: node scripts/shell-gate.mjs slides/dist-single/Bento_Slides.bento.html
+
+ - name: The gate refuses a sealed TEST shell
+ # Positive control for the gate's no-test-seal check (security §31): the
+ # build:sealtest shell carries the sealed test document's key handoff,
+ # inside its deflated runtime, and must be refused for it; the release
+ # shell from the same source must pass.
+ working-directory: slides
+ shell: bento-step {0}
+ run: |
+ npm run build:sealtest
+ node ../scripts/test-seal-gate.mjs
+
+ - name: Code-morph identity engine
+ # HeckelDiff decides which token on slide N is the same token as on
+ # slide N-1; every wrong answer is a token that jumps, tears, or steals
+ # another token's journey on screen. Regressions for the three pairing
+ # bugs found in review ride along.
+ shell: bento-step {0}
+ run: node scripts/test-codediff.ts
+
+ - name: sidebar multi-select — a block move keeps order and carries states
+ # Discussion #514. The unit is a parent with its states; the old
+ # single-index splice left states behind, which this rig shows.
+ shell: bento-step {0}
+ run: node scripts/test-slides-multiselect.ts
+
+ - name: presence toasts — said once per real arrival and departure
+ # A hidden tab's heartbeat arrives once a minute, the room drops the
+ # peer and the next beat brings them back: "left" / "joined" every
+ # minute for everyone else. The grace and the quiet window are what
+ # keep that silent; this rig runs them on a manual clock.
+ shell: bento-step {0}
+ run: node scripts/test-slides-presence-toasts.ts
+
+ - name: Media autoplay rig
+ # An author set a clip's Autoplay to Off and it played anyway, every
+ # show, since media shipped in v0.9.16. render.ts wrote
+ # data-autoplay="" when off — PRESENT but empty — and Reveal decides
+ # autoplay with hasAttribute(), so it played what our own value-based
+ # selector correctly ignored. The property pinned here is that an
+ # autoplay-off element carries NO such attribute, because its presence
+ # is read by code we do not own. Measured on rendered DOM: the
+ # difference between assigning '' and not assigning is invisible to a
+ # grep. Self-skips without Chrome.
+ shell: bento-step {0}
+ run: node scripts/test-media-autoplay.ts
+
+ - name: Embed element rig
+ # The `embed` element (docs/DECISIONS.md 2026-08-19 shape): the static
+ # view always paints through the svg sanitiser; a live sandboxed frame
+ # exists only online with the offline switch off, and drops back to
+ # the view on error. Node half plus headless Chrome with a request log.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-embed.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-embed.mjs"
+ node --no-warnings "$RUNNER_TEMP/test-embed.mjs"
+
+ - name: File-open / boot document gate rig
+ # Opening a foreign .bento.html and booting a directly-opened file run
+ # bare parseDoc -> render + injectFonts with no structural gate, exposing
+ # the document-level egress the element sanitiser never sees: a
+ # slide.background url(), an -face src from an external asset value,
+ # a weight/style src-breakout. Positive controls (raw) fetch; the opened
+ # document reaches the request log zero times; unknown keys/props from a
+ # NEWER deck survive (format additivity). Browser half needs Chrome.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-fileopen-gate.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-fileopen-gate.mjs"
+ node "$RUNNER_TEMP/test-fileopen-gate.mjs"
+
+ - name: Untrusted-markup sanitizer rig
+ # Every deck is untrusted input somebody may open, paste or receive over
+ # collab, and script in that page owns the collab keys, the plaintext
+ # autosave store and the write handle to the file on disk. An audit
+ # measured `<svg onload>`, a rect `onclick`, `<img onerror>` in a
+ # foreignObject and `<form action="javascript:">` all executing.
+ #
+ # The sanitizer is an ALLOWLIST, so what this pins is the DEFAULT: the
+ # first version was a denylist that passed 40 checks with the critical
+ # still open, because the rig tested call sites with source regexes
+ # instead of the policy. These checks drive the real walk, and the
+ # browser half needs Chrome — it self-skips where there is none, so the
+ # node half still gates.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-sanitize.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-sanitize.mjs"
+ node "$RUNNER_TEMP/test-sanitize.mjs"
+
+ - name: Replace-from-JSON document gate rig
+ # The document text that arrives through window.bento.loadDoc and
+ # "Replace from JSON…" is foreign input, full or compact. It passes the
+ # structural gate (restoregate.ts sanitizeDoc): the open deck keeps its
+ # identity (docId, collab, readonly), unknown keys/props are dropped, and
+ # the document-level egress surfaces the element sanitiser never sees —
+ # slide.background url(), an @font-face src resolved from an external
+ # asset value, a weight/style src-breakout — are neutralised. Positive
+ # controls (raw, un-gated) fetch; the gated document reaches the request
+ # log zero times. Browser half needs Chrome; it self-skips otherwise.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-replace-json-gate.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-replace-json-gate.mjs"
+ node "$RUNNER_TEMP/test-replace-json-gate.mjs"
+
+ - name: Export-secrets rig
+ # "Copy document JSON" shipped the room's owner private key while the
+ # tooltip recommended pasting it into an AI chat, and "Save as
+ # template…" wrote plaintext out of a password-protected deck. Both are
+ # invisible in the product: the file looks right. This scans the source
+ # for the two shapes — an export that forgets to strip collab secrets,
+ # and a user-facing path that reaches serializeFile instead of
+ # serializeAuto — so a NEW export path cannot reintroduce either.
+ shell: bento-step {0}
+ run: node scripts/test-export-secrets.ts
+
+ - name: bento check rig (browser)
+ # scripts/bento-check.mjs is the closing half of an agent's loop: load
+ # a deck in headless Chrome and report what validate() finds, with
+ # element ids and paths, plus one PNG per slide through #480's render
+ # path and a contact sheet. The rig drives it as a child process on
+ # the built shell: a deck with an overflowing box and an off-canvas
+ # rect names both; --json, --png, exit codes; a compact document is
+ # refused in plain words on a shell without compact input. Self-skips
+ # only OUTSIDE CI where Chrome or the shell is missing.
+ shell: bento-step {0}
+ run: node scripts/test-bento-check.ts
+
+ - name: Model key tables match the format
+ # slides/src/modelkeys.generated.ts is derived from model.ts and drives
+ # validate()'s unknown-key check. A stale copy would report real
+ # properties as unknown, and an agent acting on that deletes working
+ # configuration — so the generated file is committed and pinned here.
+ shell: bento-step {0}
+ run: node scripts/build-modelkeys.mjs --check
+
+ - name: Schema is current
+ # schema/slides.json is generated from the gate's tables
+ # (slides/src/schema.ts via scripts/build-schema.mjs) and published at
+ # bento.page/schema/slides.json; a stale file would describe a format
+ # the runtime does not accept, so the committed copy is pinned here.
+ shell: bento-step {0}
+ run: node scripts/build-schema.mjs --check
+
+ - name: Document schema rig
+ # one source (file == buildSchema == window.bento.schema()); schema
+ # keys == gate keys per type; the starter deck validates and a typo
+ # does not; $schema is stripped on load and accepted by the 1.1.0 and
+ # main parseDoc (frozen); the URL is never fetched.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-slides-schema.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-schema.mjs"
+ node "$RUNNER_TEMP/test-slides-schema.mjs"
+
+ - name: Document validation rig
+ # validate() is only useful if it is trusted: the rig proves the starter
+ # deck and a realistic chart stay silent, and that a deliberately broken
+ # deck trips every check.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-validate.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-validate.mjs"
+ node "$RUNNER_TEMP/test-validate.mjs"
+
+ - name: Theme token gate
+ # Every failure this catches is INVISIBLE in the light theme, which is
+ # the one the author is looking at. A chrome surface pinned to white
+ # keeps its light background in dark and puts light text on it — the
+ # properties panel measured 1.21:1 against a 4.5 floor before this gate
+ # existed. It also stops a document token being themed (which would
+ # invert the deck) and the light palette forking from spaces and type.
+ shell: bento-step {0}
+ run: node scripts/test-slides-theme.mjs
+
+ - name: Brand palette rig
+ # themeRefs record where a colour came from so a deck can be re-branded.
+ # Three properties must hold or the feature is a liability: the
+ # derivation must be IDEMPOTENT (it runs on the doc event — one that
+ # never settles is a hang, not a wrong colour), stripping the new fields
+ # must leave every rendered value identical (every shipped shell reads
+ # the literals and always will), and an unresolvable reference must
+ # change nothing rather than writing undefined.
+ shell: bento-step {0}
+ run: node scripts/test-theme.ts
+
+ - name: Built-in layout geometry rig
+ # The built-ins are drawn against 1600x900 while the model default is
+ # 1280x720, so they used to hang 200px off the right edge of a default
+ # deck. Nothing structural could see it — the fix is arithmetic, and so
+ # is the regression.
+ shell: bento-step {0}
+ run: node scripts/test-layouts.ts
+
+ - name: slides asset-pruning rig
+ # doc.assets was append-only: delete every slide, save, and the "empty"
+ # deck was still 20 MB (#442). A save now writes a copy with the
+ # unreferenced assets dropped. Weighted toward "kept", one case per
+ # reference form, because dropping too much is the worse failure — an
+ # image gone from a file with nothing on screen to say so.
+ shell: bento-step {0}
+ run: node scripts/test-slides-assets.ts
+
+ - name: Slides built-in fonts rig
+ # The shell carries two faces; a deck names them (builtin:…) instead
+ # of embedding 86 KB the file already has. At save a deck embedding
+ # byte-identical bytes is rewritten to name them; a different font
+ # keeps its bytes; the live document is untouched; measured saving.
+ shell: bento-step {0}
+ run: node scripts/test-slides-fonts.ts
+
+ - name: Slides code colours rig
+ # theme.codePalette's editor: one row per token scope from one list
+ # (code.ts CODE_SCOPES), built-in colour shown when the deck has
+ # none, the field written only on a change; plain literals, not
+ # palette references. And accent 2–6 rows/swatches only for slots
+ # the deck carries (six identical peach swatches were not choices).
+ shell: bento-step {0}
+ run: node scripts/test-code-palette.ts
+
+ - name: Slides pagination rig
+ # Three ways a slide declines a page number (state, hidden, unnumbered)
+ # and only one of them stays in the walk; every surface — page fields,
+ # presenter counter, sidebar — asks the same predicate, and a build of
+ # morph steps reads "18, 18, 18" rather than "18, 19, 20" (#282).
+ shell: bento-step {0}
+ run: node scripts/test-slides-pagination.ts
+
+ - name: Slides reveal-steps rig
+ # fx.step, "animate on click": → reveals the next step before it
+ # leaves the slide, ← hides it; backward arrival is fully revealed;
+ # gaps are pressed through; the audience follows the presenter's
+ # step. Decisions in slides/src/steps.ts, DOM-free (#282, option 2).
+ shell: bento-step {0}
+ run: node scripts/test-slides-steps.ts
+
+ - name: Maths engine rig
+ # slides/src/maths replaced Temml (2026-09-15): never-throws contract;
+ # the 91-formula reference set matches Temml's FROZEN trees on ≥95%
+ # (scripts/fixtures/maths-reference.json; every mismatch must be a
+ # listed residual); Typst ≡ LaTeX on the shared tree; every emitted
+ # attribute is the engine's own; the symbol table has no duplicates.
+ shell: bento-step {0}
+ run: node scripts/test-maths-lite.ts
+
+ - name: Reveal authoring rig
+ # Reading order (top-to-bottom, then left-to-right, rows by vertical
+ # overlap) is deterministic; the verbs continue the slide's sequence;
+ # the badge cycle never reaches 0; and the badge layer is editor
+ # chrome that render/present/preview do not know.
+ shell: bento-step {0}
+ run: node scripts/test-slides-reveal-ui.ts
+
+ - name: Date/time field patterns rig
+ # {{date:M/D/YY}} / {{time:h:mm a}} pin a shape for every viewer
+ # (datefmt.ts): token precedence, [bracketed] literals, 12-hour
+ # tokens, locale month names; every panel preset formats; render.ts
+ # routes the argument. Bare {{date}} stays viewer-locale (#381).
+ shell: bento-step {0}
+ run: node scripts/test-slides-fields.ts
+
+ - name: Typed bullets become lists rig
+ # editor/bullets.ts bulletsToLists: glyph lines become real <ul><li>
+ # at commit (hanging indent), nesting by indent, untouched otherwise,
+ # idempotent; both paste handlers read the clipboard through
+ # editor/paste.ts (the html flavour, sanitized) -- #502, #503.
+ shell: bento-step {0}
+ run: node scripts/test-slides-bullets.ts
+
+ - name: Inline-edit listeners rig
+ # Every keydown/input/paste/blur listener a text-box or cell edit
+ # attaches carries that edit's AbortSignal, and both commits abort it —
+ # a node re-edited without a re-render used to stack listeners and
+ # paste N times.
+ shell: bento-step {0}
+ run: node scripts/test-slides-edit-listeners.ts
+
+ - name: Live-session notice wording rig
+ # A refused whole-deck snapshot (SyncNotice.snapshot, #509) is worded as
+ # the deck, never as a change or an image; the Share popover polls
+ # pendingBlobUploads() only while open; strings in every core catalog.
+ shell: bento-step {0}
+ run: node scripts/test-slides-sync-notice.ts
+
+ - name: Shell loader and carrier rig
+ # base86 payloads (scripts/lib/b86.mjs) round-trip and can never
+ # contain </script, <!--, -->, ]]> or ${; the loader inflates
+ # synchronously and runs the runtime as an inline classic script
+ # FIRST (mounted before DOMContentLoaded, as the uncompressed build
+ # is), probes and waits on nothing, falls to new Function then blob
+ # only on a refusal, installs Trusted Types policies lazily, and
+ # records window.bento.loader. The gate goes red on a hand-edited
+ # payload. The browser half drives headless Chrome with a real
+ # background tab: mounted before DCL hidden, splash gone within 50 ms
+ # of the mount there. Needs slides/node_modules and the built shell.
+ shell: bento-step {0}
+ run: node scripts/test-shell-loader.ts
+
+ - name: Maths in links rig
+ # resolveMath transforms text runs only: a `$` inside an href never
+ # pairs with one in the text, so a link whose address carries a
+ # dollar sign keeps its href (pre-existing since #465).
+ shell: bento-step {0}
+ run: node scripts/test-slides-math-href.ts
+
+ - name: Maths delimiters rig
+ # #540: \(…\) and \[…\] beside $…$ and $$…$$, escapes literal,
+ # "$5 and $10" still prose; display maths may span <br>/<div>/<p>
+ # line breaks and nothing else; the editor-only "Not rendered" hint;
+ # paste and commit keep a formula's backslashes. Real engine, DOM-free.
+ shell: bento-step {0}
+ run: node scripts/test-slides-math-delims.ts
+
+ - name: Code fence rig
+ # ``` fences in a text box: which text is a fence (closed only), the
+ # language aliases, autoformat's open-fence guard, and the elements a
+ # fenced box becomes (identity on the first part, no duplicate morph key).
+ shell: bento-step {0}
+ run: node scripts/test-slides-code-fence.ts
+
+ - name: Maths coverage rig
+ # #551: maths-lite against Temml's WHOLE vocabulary (1,237 commands and
+ # environments, frozen offline): no covered command may fall back to
+ # raw text, the rendering and tree-identical counts may not drop below
+ # the recorded floor, and every commonly typed formula renders. The
+ # check a fixed sample could not make, which is how #540 slipped by.
+ shell: bento-step {0}
+ run: node scripts/test-maths-coverage.ts
+
+ - name: Accent contrast rig
+ # The accent as text reads in both themes: every --accent-ink text use
+ # is audited against the surface behind it and reaches 4.5:1; text on
+ # the orange fill uses --accent-on; labels drawn over the slide carry a
+ # surface halo. Dark --accent-ink was #3a2a00 on dark chrome — 1.09:1.
+ shell: bento-step {0}
+ run: node scripts/test-slides-accent-contrast.ts
+
+ - name: Compact document rig
+ # The agent authoring form (#422): compactDoc/expandDoc are inverses
+ # on the starter deck, expansion equals the editor's insert helpers
+ # field for field, nested arrays flatten, ids mint deterministically,
+ # the loader gates the expanded doc, the file on disk stays full.
+ shell: bento-step {0}
+ run: node scripts/test-slides-compact.ts
+
+ - name: Agent-deck corpus rig
+ # scripts/fixtures/agent-decks/*.json — compact decks written the way
+ # agents write them (md, omitted h, nested arrays) — load through the
+ # real loader with zero dropped keys and zero validate() errors; a
+ # deliberately wrong deck reports every drop at its path with a reason.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-slides-agent-decks.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-agent-decks.mjs"
+ node "$RUNNER_TEMP/test-slides-agent-decks.mjs"
+
+ - name: Compact layouts and roles rig
+ # A compact slide names a layout and its elements carry roles: the
+ # layout's frames through model.ts applyLayout (the editor's own
+ # path), ids kept so same-layout slides morph, unknown roles fall
+ # back and are reported, explicit geometry wins, bodies stack, and
+ # AGENTS.md's layout table is checked against the code.
+ shell: bento-step {0}
+ run: node scripts/test-slides-compact-layouts.ts
+
+ - name: Gate parity rig (the load-report collector changes no decision)
+ # main's untrusted.ts frozen from git at rig time and bundled beside
+ # the branch's; every checked-in deck plus a hostile corpus goes
+ # through both with the collector OFF and the outputs must be
+ # byte-identical. Security-reviewed hunk (#486).
+ shell: bento-step {0}
+ run: |
+ git fetch --no-tags --depth=1 origin main
+ node scripts/test-gate-parity.ts
+
+ - name: Layers panel rig
+ # editor/layerrows.ts, DOM-free: rows top-first, labels per type,
+ # group indent, moveInPaintOrder == the Order buttons (front/back/±1,
+ # a group moves as one, a no-op returns the same array), highlight
+ # follows the selection; render/present never see the list (#371).
+ shell: bento-step {0}
+ run: node scripts/test-slides-layers.ts
+
+ - name: Export slides as images rig
+ # exportimages.ts decisions (DOM-free): the page set is the print set
+ # (hidden/state out, deck order), names pad NN and use the kernel's
+ # own title sanitiser, JPEG matte/PNG none, 1x/2x integer sizes; and
+ # the editor half renders via renderSlide with no PREVIEW_BUDGET tier.
+ shell: bento-step {0}
+ run: node scripts/test-slides-export-images.ts
+
+ - name: Connectors rig
+ # #302/#303/#304: one tip catalogue (tips.ts) behind the model, the
+ # gate, the panel and the markers; per-tip insets (hollow tips stop the
+ # stroke at the head); the double arrow's polygon is symmetric; a
+ # curve's end tangent and the re-route that moves only its end points;
+ # the straight connector's 1.0.2 functions byte-identical.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-slides-connectors.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-slides-connectors.mjs"
+ node --no-warnings "$RUNNER_TEMP/test-slides-connectors.mjs"
+
+ - name: Image crop rig
+ # crop.ts: {x, y, scale} → the one CSS mapping every surface uses;
+ # the frame can never show empty space; the shape gate admits the
+ # field and refuses wrong shapes; one image branch in render.ts;
+ # present tweens a crop only when both sides carry one (#319).
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-slides-crop.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-crop.mjs"
+ node "$RUNNER_TEMP/test-slides-crop.mjs"
+
+ - name: Photos shrink at insert rig
+ # editor/shrink.ts decisions, DOM-free: photo vs graphic (lossy vs
+ # lossless), the ≥20% keep rule, the 2560 px cap, svg/gif untouched,
+ # every insert path routed, model.ts untouched. The encode itself is
+ # measured in Chrome (PR #).
+ shell: bento-step {0}
+ run: node scripts/test-slides-shrink.ts
+
+ - name: Compress pictures in this deck rig
+ # editor/compressdeck.ts planning half, DOM-free: image elements only,
+ # an asset once however many elements share it, SVG/GIF/media/fonts
+ # never; applyCompress writes in place and drops the replaced asset's
+ # blob reference; the editor dry-runs first and commits once.
+ shell: bento-step {0}
+ run: node scripts/test-slides-compress-deck.ts
+
+ - name: Image aspect-ratio lock rig
+ # keepAspectRatio (#372): absent = locked, so old files resize as
+ # before; Shift is the one-drag exception either way; re-locking
+ # deletes the field and keeps the current shape; unlocking sets
+ # fit:'fill'. Also holds the set-aside parts of #372 out of the tree.
+ shell: bento-step {0}
+ run: node scripts/test-slides-aspect-lock.ts
+
+ - name: Web links and bullets rig
+ # A link is one thing in four places — isWebUrl — and every surface
+ # that lets a URL in or out asks it: the shape gate, the text
+ # sanitizer, the markdown converters, and the show before it opens a
+ # NEW tab with noopener,noreferrer. javascript:/data: are text.
+ # Bullets from "- " and "* ", indented sub-bullets. (#421, #255, #368)
+ shell: bento-step {0}
+ run: node scripts/test-slides-links.ts
+
+ - name: Audience projection rig
+ # Live broadcast: the handout, the join snapshot and every streamed op
+ # go through slides/src/audience.ts, which keeps back speaker notes
+ # and review comments and nothing else. Runs the negative control
+ # first — with the boundary emptied the rig must go red, or it is
+ # checking nothing.
+ shell: bento-step {0}
+ run: |
+ if node scripts/test-audience-projection.ts --mutate > /dev/null 2>&1; then
+ echo 'negative control passed with the boundary removed'; exit 1; fi
+ node scripts/test-audience-projection.ts
+
+ - name: Audience embed rig
+ # An embed's document can carry another deck's envelope (collab +
+ # docId); the handout, the live snapshot and every live op the real
+ # engine emits must arrive without it. Negative control first.
+ shell: bento-step {0}
+ run: |
+ if node scripts/test-audience-embed.ts --mutate > /dev/null 2>&1; then
+ echo 'negative control passed with the envelope rule emptied'; exit 1; fi
+ node scripts/test-audience-embed.ts
+
+ - name: Broadcast follow-mode rig
+ # The audience side's decisions (slides/src/follow.ts): nav by slide
+ # ID with the index only as fallback — an insert mid-talk moves nobody;
+ # follow is the viewer's, lock is the presenter's and wins; laser
+ # samples rate-limited at the source with pen-up always sent.
+ shell: bento-step {0}
+ run: node scripts/test-broadcast-follow.ts
+
+ - name: slides store rig
+ # The editor's undo/redo, selection and whole-deck replacement, at the
+ # store level rather than through the DOM. Bundled first for the same
+ # reason the spaces rigs are: store.ts imports './model' without an
+ # extension, which node's strip-only TypeScript loader will not follow,
+ # so run by hand it fails with ERR_MODULE_NOT_FOUND and looks like a
+ # broken product. It had never been registered here.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-slide-store.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-slide-store.mjs"
+ node "$RUNNER_TEMP/test-slide-store.mjs"
+
+ - name: Slides share-copy rig
+ # The view-only and editor copies (slides/src/share.ts) carry only the
+ # kernel allowlist — no private key, a fresh invite, no sync on a reader —
+ # and strip any EMBEDDED document's envelope. Runs the real builders with
+ # real keys through the ts hook, like the type rig above.
+ shell: bento-step {0}
+ run: node scripts/test-slides-share.ts
+
+ - name: Clipboard embedded-font rig
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-clipboard.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-clipboard.mjs"
+ node "$RUNNER_TEMP/test-clipboard.mjs"
+
+ - name: Restore gate rig
+ # A snapshot kept in the browser (recovery banner, Version history) is
+ # foreign input: gated like a pasted clip, and it never brings its own
+ # docId, live-session credentials or file mode.
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-slides-restore-gate.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-restore-gate.mjs"
+ node "$RUNNER_TEMP/test-slides-restore-gate.mjs"
+
+ - name: Slides sync allowlist rig
+ # Slides binds its field-class map (slides/src/docclass.ts) into
+ # SLIDES_SHAPE: every key that synced before is still content, a
+ # non-content or unknown doc key mints no op, non-content is refused
+ # inbound, and an unknown key from a peer is applied but never echoed.
+ shell: bento-step {0}
+ run: node scripts/test-slides-sync-allowlist.ts
diff --git a/.github/actions/validate-spaces/action.yml b/.github/actions/validate-spaces/action.yml
new file mode 100644
index 00000000..be7435dd
--- /dev/null
+++ b/.github/actions/validate-spaces/action.yml
@@ -0,0 +1,346 @@
+# validate, spaces slice: bento/spaces: install, typecheck, shell + splice gate, and the spaces rigs.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-spaces
+description: validate, spaces slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ - name: Spaces save revisions
+ # Typing runs and remote changes invalidate in-flight saves even while dirty.
+ shell: bento-step {0}
+ run: node scripts/test-spaces-save-revisions.ts
+
+ # spaces: a second app proving the kernel seam — same pipeline, same gate.
+ - name: Install (spaces)
+ working-directory: spaces
+ shell: bento-step {0}
+ run: npm ci
+
+ - name: Typecheck (spaces)
+ working-directory: spaces
+ shell: bento-step {0}
+ run: node_modules/.bin/tsc -b
+
+ - name: Build single-file shell (spaces)
+ working-directory: spaces
+ shell: bento-step {0}
+ run: npm run build:single
+
+ - name: Splice conformance gate (spaces)
+ shell: bento-step {0}
+ run: node scripts/shell-gate.mjs spaces/dist-single/Bento_Spaces.bento.html
+
+ - name: Spaces i18n packed table is current
+ # The per-locale catalogs are the source of truth; packed.ts is
+ # generated and is what ships inside every saved file. A core catalog
+ # cannot be corrected without a release, so an incomplete one fails the
+ # build rather than shipping a half-translated interface.
+ shell: bento-step {0}
+ run: node scripts/build-spaces-i18n.mjs --check
+
+ - name: Spaces invite rig
+ # "Invite someone…" was `saveAs('copy')`, which serializes store.doc —
+ # so everyone invited to a space received `collab.ownerPriv`, the room's
+ # ROOT key: they could write, and they could revoke the person who
+ # invited them. Nothing about the copy looked wrong. This runs the real
+ # share functions against real WebCrypto keys and asserts on the bytes:
+ # the owner private key appears NOWHERE in an invite, the invite is a
+ # separate keypair that the owner actually signed (verified the way the
+ # relay verifies it), and a view-only copy holds no signing key at all.
+ # (Bundled: the kernel transport uses parameter properties, which node's
+ # strip-only TypeScript loader refuses.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-invite.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-invite.mjs"
+ node "$RUNNER_TEMP/test-spaces-invite.mjs"
+
+ - name: Spaces copy-tier rig
+ # Every copy of a space is built by the kernel's copy table
+ # (docfields.ts projectForCopy) over spaces' exhaustive field map. This
+ # runs each real builder against one source carrying every class of
+ # field, every collab secret, in-file history and an undeclared key, and
+ # asserts the EXACT top-level key set each emits: no history or unknown
+ # key in a reader copy or Copy JSON, history kept in an invite, both
+ # kept in a duplicate. (Bundled: share.ts imports the kernel transport.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-copytiers.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-copytiers.mjs"
+ node "$RUNNER_TEMP/test-spaces-copytiers.mjs"
+
+ - name: Spaces reading-copy rig
+ # "Save a reading copy…" is the file you hand to somebody who will not
+ # edit it, and its whole value is in what the bytes do NOT contain. So
+ # this asserts on the serialized document, not on "the strip function
+ # ran": no room, no read key, no owner/writer/invite private key
+ # anywhere in the text, no comment thread (page-level, block-level or
+ # reply), no history, and the readonly flag set. Prev/Next follows the
+ # tree's order. (The field-by-field key set and the mutation controls
+ # are the copy-tier rig's.) (Bundled: share.ts imports the kernel
+ # transport.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-reading.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-reading.mjs"
+ node "$RUNNER_TEMP/test-spaces-reading.mjs"
+
+ - name: Spaces undo rig
+ # Every checkpoint used to stringify the WHOLE document: measured on a
+ # 200-page, 2.5 MB handbook, fifty edits left an undo depth of NINE,
+ # because nine snapshots exhaust the 24 MB budget. A typing run now
+ # records only its PAGE. That is fast and deep — and it is only correct
+ # while the mutation touched nothing else, so `doc` stays the default
+ # and this rig covers the cases where a wrong scope silently loses
+ # work: mixed scopes, interleaved undo/redo, and two pages edited in
+ # turn. (Bundled: store.ts imports './model' extensionless.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-undo.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-undo.mjs"
+ node "$RUNNER_TEMP/test-spaces-undo.mjs"
+
+ - name: Spaces restore-gate rig
+ # The recovery snapshot and every History entry live in IndexedDB, which
+ # every file:// document shares, so restore is foreign input. Like
+ # slides' restore gate: an entry naming another space is refused, it
+ # never brings collab/readonly/template, block html is sanitized, and
+ # junk, frozen, __proto__ and oversized entries apply nothing.
+ # (Bundled: store.ts imports './model' extensionless.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-restore-gate.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-restore-gate.mjs"
+ node "$RUNNER_TEMP/test-spaces-restore-gate.mjs"
+
+ - name: Spaces restore directions rig (several timezones)
+ # Every whole-document restore resolves through the kernel's
+ # applyRestore over one rule set (spaces/src/store.ts RESTORE_RULES):
+ # undo/redo, version restore, Replace from JSON and loadDoc go 'back'
+ # (history kept live), the recovery banner goes 'recover' (revisions
+ # follow the snapshot, the trail unions by day without counting a day
+ # twice). Undo keeps the asset pool its checkpoints omit. The trail
+ # hook does day arithmetic on labels, hence the timezone loop.
+ # (Bundled: store.ts imports './model' extensionless.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-restore.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-restore.mjs"
+ for tz in UTC Europe/Berlin Pacific/Kiritimati Pacific/Niue; do
+ echo "--- $tz"
+ TZ=$tz node "$RUNNER_TEMP/test-spaces-restore.mjs"
+ done
+
+ - name: Spaces in-file history rig
+ # doc.revisions (spaces/src/history.ts): every entry is the kernel's
+ # Revision envelope with the patch under body; what it covers is the
+ # field map's content class minus assets (footnotes, design, templates
+ # included); restore(N) is byte-identical to what was saved at N and
+ # goes through the restore gate; history is a log undo never un-records.
+ # (Bundled: store.ts imports './model' extensionless.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-history.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-history.mjs"
+ node "$RUNNER_TEMP/test-spaces-history.mjs"
+
+ - name: Spaces agent-surface rig
+ # agent.ts is ~900 lines and shipped with no coverage at all: two of the
+ # five defects an adversarial review found in round 2 lived here,
+ # including a walk over author-supplied parent links that never
+ # returned. What this pins is what makes the surface trustworthy —
+ # validate() SILENT on documents that are correct but unusual (a false
+ # positive teaches an agent to ignore warnings), every write verb
+ # refusing what it cannot honour, no verb producing a document the app
+ # itself could not produce, and every walk terminating. The termination
+ # probes run in child processes with timeouts, because a hang cannot be
+ # reported by the process it hangs.
+ shell: bento-step {0}
+ run: node scripts/test-spaces-agent.ts
+
+ - name: Spaces journal rig (several timezones)
+ # Every part of a daily note that can be wrong is wrong QUIETLY and on
+ # someone else's machine: "today" in UTC is the wrong day for hours at
+ # a time outside Greenwich, adding 86,400,000 ms is not adding a day on
+ # the two DST boundaries, and `new Date('2026-08-06')` is UTC midnight
+ # by spec. A date test that only ever runs in one timezone has not been
+ # run — so this runs in five, including a half-hour DST offset.
+ shell: bento-step {0}
+ run: |
+ for tz in UTC Europe/Berlin America/Los_Angeles Pacific/Kiritimati Australia/Lord_Howe; do
+ echo "--- $tz"
+ TZ=$tz node scripts/test-spaces-journal.ts
+ done
+
+ - name: Spaces timeline and workload rig (several timezones)
+ # A chart is a picture of data that came out of a file somebody mailed
+ # you, and every way it can be wrong is a way it stays silent about it:
+ # a bar in the wrong month still looks like a bar. Half of what this rig
+ # asserts is a date, so it runs in five timezones for the reasons
+ # journal.ts records — including a half-hour DST offset.
+ shell: bento-step {0}
+ run: |
+ for tz in UTC Europe/Berlin America/Los_Angeles Pacific/Kiritimati Australia/Lord_Howe; do
+ echo "--- $tz"
+ TZ=$tz node scripts/test-spaces-gantt.ts
+ done
+
+ - name: Magic notes evaluator (several timezones)
+ # Two failure modes, and the second is what would make the feature worse
+ # than not having it: a WRONG answer (silent, confident, in somebody's
+ # notes), and an answer where there should be none — "Meet Ana at 3" is
+ # a sentence. The parser must consume the whole line or return nothing.
+ # Dates run in several timezones for the reasons journal.ts records.
+ shell: bento-step {0}
+ run: |
+ for tz in UTC Europe/Berlin America/Los_Angeles Pacific/Kiritimati; do
+ echo "--- $tz"
+ TZ=$tz node scripts/test-spaces-calc.ts
+ done
+
+ - name: Trail, periods and progress charts (several timezones)
+ # A trail row's key is a LOCAL day, so the whole bug class here is the
+ # one the journal rig exists for. Kiritimati (UTC+14) and Niue (UTC-11)
+ # bracket every hour where "which day is it" has two answers. The rest
+ # of the rig is behavioural: it writes rows, draws the charts, and
+ # asserts that a gap draws as a gap and never as a zero.
+ # (Bundled: it reaches store.ts, whose imports are extensionless.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-trail.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-trail.mjs"
+ for tz in UTC Europe/Berlin Pacific/Kiritimati Pacific/Niue; do
+ echo "--- $tz"
+ TZ=$tz node "$RUNNER_TEMP/test-spaces-trail.mjs"
+ done
+
+ - name: Spaces Markdown round-trip rig
+ # The About dialog promises, in eight languages, that "a space is never
+ # a dead end … every page exports as Markdown". This is that sentence,
+ # checked: the starter space is exported and read back, and no page may
+ # come back with materially less text than it went in with, nor may a
+ # single block vanish entirely. Block TYPES are deliberately not
+ # asserted here — Markdown has no toggle, media embed or board, so a toggle
+ # leaving as a bullet is the format being honest, not a bug (the strict
+ # rig below holds each type to its own bar).
+ # (Bundled: the app's imports are extensionless.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-roundtrip.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-roundtrip.mjs"
+ node "$RUNNER_TEMP/test-spaces-roundtrip.mjs"
+
+ - name: Spaces Markdown strict rig
+ # The round-trip rig above checks WORDS; this checks TYPES. Every
+ # registered block type is exported and read back, and must return as
+ # the same JSON (ids aside) and re-export to the same text — or be
+ # PINNED with the reason Markdown cannot carry it yet. A pinned type
+ # that starts to round-trip fails too, so closing a gap is a deliberate
+ # edit to the rig. (Bundled: the app's imports are extensionless.)
+ shell: bento-step {0}
+ run: |
+ slides/node_modules/.bin/esbuild scripts/test-spaces-md-strict.ts --bundle --platform=node --format=esm \
+ --outfile="$RUNNER_TEMP/test-spaces-md-strict.mjs"
+ node "$RUNNER_TEMP/test-spaces-md-strict.mjs"
+
+ - name: Spaces model rig
+ # Properties that fail SILENTLY, and that a shipped file cannot be
+ # talked out of once it exists:
+ # · the load contract — an unreadable document must never be replaced
+ # by an empty one;
+ # · format additivity, and id repair derived from the BYTES, so two
+ # readers of one file agree on every id (links key on them);
+ # · untrusted html is parsed INERT — a detached div still loads what
+ # it creates, which made the sanitizer its own vector on the OPEN
+ # path;
+ # · opening a document touches no network, so a mailed space cannot
+ # carry a tracking pixel;
+ # · an encrypted space is never snapshotted to IndexedDB in the clear;
+ # · find and replace quote ONE number — what is counted is what
+ # changes.
+ # The last four are source assertions: the behaviour needs a DOM, a
+ # failing request, IndexedDB and a clock, but every one of those
+ # mistakes is made in the source.
+ shell: bento-step {0}
+ run: node scripts/test-spaces-model.ts
+
+ - name: spaces caret + nesting
+ # Which seat an arrow key lands in, and what Tab resolves to. Caret
+ # MOVEMENT needs a browser; the arithmetic under it does not, and the
+ # arithmetic is where Tab-on-the-first-list-item was silently wrong.
+ shell: bento-step {0}
+ run: node scripts/test-spaces-caret.ts
+
+ - name: Spaces chrome rig
+ # Every spaces menu is the kernel's createMenu (through
+ # spaces/src/menus.ts). This drives the BUILT shell with trusted CDP
+ # input and asserts what spaces used to get wrong invisibly: arrow keys
+ # in every menu, Escape with focus return, one menu open at a time, no
+ # listener left on the document by a menu closed with Escape (one used
+ # to close the NEXT overlay on its first click), no global shortcut
+ # under a modal, and phone menus that end inside the screen with 44px
+ # rows; and that a phone drawer, however it is shut, never becomes the
+ # desktop panel preference once the window widens again. Needs the
+ # shell built above; a skip in CI is a failure.
+ shell: bento-step {0}
+ run: node scripts/test-spaces-chrome.ts
+
+ - name: spaces aliases and unlinked mentions
+ # The assertions that matter in this one are the NEGATIVES: a page
+ # title found inside a code block, an existing link, a bare URL or the
+ # middle of a longer word must all produce NO mention, and a title full
+ # of regex metacharacters must not throw. It also asserts that a name
+ # surrounded by kana matches, which a `\b`-style boundary silently
+ # never does — a rule built for English is a total failure in ja,
+ # zh-Hans and zh-Hant rather than a partial one.
+ shell: bento-step {0}
+ run: node scripts/test-spaces-mentions.ts
+
+ - name: Mermaid flowchart ⇄ diagram rig
+ # spaces/src/diagram/: our own Mermaid flowchart parser and layered
+ # layout (the mermaid library is megabytes and nothing is fetched at
+ # runtime). Over a corpus of real README flowcharts: no overlapping
+ # nodes, every connector end exactly where slides' syncConnectors puts
+ # it, byte-identical snapshots, and mermaid → elements → mermaid
+ # semantically equal. Hostile input (caps, __proto__ ids, script in
+ # labels, pathological cycles) inside a time budget, and a size budget
+ # (needs slides' esbuild, installed above).
+ shell: bento-step {0}
+ run: node scripts/test-diagram-mermaid.ts
+
+ - name: spaces rig manifest
+ # Bookkeeping, not a ninth run of the eight steps above. scripts/
+ # test-spaces.mjs is the local entry point for the spaces suite (two of
+ # those rigs cannot be handed to node directly, and running one by hand
+ # produces a stack trace that reads like a broken product); this asserts
+ # its list is still complete in both directions — every test-spaces-*
+ # file on disk is listed there, and every rig it lists has a step in
+ # this workflow. Both omissions are invisible: an unlisted rig never
+ # runs locally, an unregistered one never runs here, and neither looks
+ # like anything but green. test-spaces.mjs itself was unregistered from
+ # the day it was written, which is how this check came to exist.
+ shell: bento-step {0}
+ run: node scripts/test-spaces.mjs --manifest
+
+ - name: the spaces binding of the sync session
+ # Only what bento/spaces answers DIFFERENTLY, because three of the five
+ # host answers are not slides' answers and each one is invisible until
+ # two people are live: a repair id that must be DERIVED (a spare blank
+ # slide is one click to delete; a spare page is a phantom), a view that
+ # clamps by page identity to the nearest surviving ANCESTOR rather than
+ # to home, and a remote op that must not raise this app's 'doc' event —
+ # which paints "Edited" and would credit a colleague's typing to you.
+ # The last section is two real sessions over a real BroadcastChannel.
+ shell: bento-step {0}
+ run: node --no-warnings scripts/test-sync-spaces-session.ts
diff --git a/.github/actions/validate-type/action.yml b/.github/actions/validate-type/action.yml
new file mode 100644
index 00000000..4f352592
--- /dev/null
+++ b/.github/actions/validate-type/action.yml
@@ -0,0 +1,286 @@
+# validate, type slice: bento/type: install, typecheck, shell + splice gate, and the type rigs.
+#
+# Part of the REQUIRED `validate` check. .github/workflows/ci.yml runs this
+# action as steps INSIDE that one job, on the same runner, after the slices
+# listed before it there — so what earlier slices installed and built is on
+# disk here. A failing step here fails `validate` and blocks the merge.
+#
+# Add a new rig's step to the slice of the zone that owns the rig, at the
+# end. Every `run:` needs `shell: bento-step {0}`: GitHub refuses a composite
+# step with no shell, and bento-step (scripts/ci/) fails the step if a rig
+# reports a skip CI does not allow (scripts/lib/ci-skips.mjs). A step here
+# counts as registered for scripts/test-ci-registered.ts.
+
+name: validate-type
+description: validate, type slice (runs inside the required validate job)
+runs:
+ using: composite
+ steps:
+ # bento/type: the word processor. Same pipeline, same gate.
+ - name: Install (type)
+ working-directory: type
+ shell: bento-step {0}
+ run: npm ci
+
+ - name: Typecheck (type)
+ working-directory: type
+ shell: bento-step {0}
+ run: node_modules/.bin/tsc -b
+
+ - name: Build single-file shell (type)
+ working-directory: type
+ shell: bento-step {0}
+ run: npm run build:single
+
+ - name: Splice conformance gate (type)
+ shell: bento-step {0}
+ run: node scripts/shell-gate.mjs type/dist-single/Bento_Type.bento.html
+
+ - name: Type inline-formatting rig
+ # A block stores plain text + marks over character ranges, and the
+ # round trip render→read must be exact: if it is not, formatting
+ # silently mutates on every re-render, which surfaces as a signed
+ # document that stops verifying. Includes a 2,000-case fuzz — it found
+ # two bugs no hand-written case did.
+ shell: bento-step {0}
+ run: node scripts/test-type-inline.ts
+
+ - name: Type model rig
+ # The load contract (an unreadable file must never become an empty one
+ # over live data), deterministic id repair, and the rule that marks and
+ # footnote anchors move together — separating them is what put a
+ # footnote marker in the middle of a word.
+ shell: bento-step {0}
+ run: node scripts/test-type-model.ts
+
+ - name: Type store rig
+ # A typed word is ONE undo press, and a scoped snapshot really is
+ # scoped: 200 edits cost ~94KB rather than ~21.7MB.
+ shell: bento-step {0}
+ run: node scripts/test-type-store.ts
+
+ - name: Type redline rig
+ # accept(all) == what they sent back, reject(all) == what you sent.
+ # Without both, "review these changes" is a lie.
+ shell: bento-step {0}
+ run: node scripts/test-type-redline.ts
+
+ - name: Type paginated-output rig
+ # The printed page count must be the one the editor computed — if print
+ # re-paginates, "page 14 paragraph 3" stops meaning anything, which is
+ # the whole reason documents like this are exchanged as PDF. Also pins
+ # that footnotes reach the page their reference lands on, and that a
+ # document's own page size is what prints.
+ shell: bento-step {0}
+ run: node scripts/test-type-print.ts
+
+ - name: Type theme rig
+ # Static checks so a theme cannot rot: both themes define the same
+ # roles, the document surface is never themed, and no chrome rule
+ # borrows a document token — that last one shipped a select at 1.92:1
+ # against a WCAG AA floor of 4.5.
+ shell: bento-step {0}
+ run: node scripts/test-type-theme.mjs
+
+ - name: bento/dash CRDT convergence
+ # The big one: randomised concurrent edits across N replicas, asserted
+ # to converge. It has caught every ordering bug in the engine, and the
+ # two it did not catch were found by widening it.
+ shell: bento-step {0}
+ run: node scripts/test-dash-sync.ts
+
+ - name: relay protocol — one wire format, two clients
+ # dash's online.ts is a PORT of the transport slides uses (now in
+ # kernel/). The two files are separate text that nobody diffs, and ONE
+ # DEPLOYED WORKER verifies both: it pins the room id to a key and walks
+ # an owner→invite→member signature chain. If one client's idea of
+ # `inv.${pub}.${role}.${exp}` drifts, the symptom is not a red test — it
+ # is one app's users silently unable to join the other's rooms, on a
+ # relay that cannot be rolled back independently of the shells already
+ # in people's files. This diffs only what goes on the wire.
+ #
+ # Written by the bento/dash work; taken here because the kernel lift is
+ # the change it guards, and it should not land after the move it exists
+ # to check. The rig FOLLOWS the twin (kernel first, then slides) and
+ # FAILS if it finds no transport at all, rather than silently comparing
+ # two empty lists — which is how its own first version passed.
+ shell: bento-step {0}
+ run: node scripts/test-relay-protocol.ts
+
+ - name: Type blocks rig
+ # Lists and tables are runs of flat blocks assembled at render;
+ # this pins the grouping, including the level clamp that once opened a
+ # billion list elements and killed the process.
+ shell: bento-step {0}
+ run: node scripts/test-type-blocks.ts
+
+ - name: Type layout rig
+ # Paragraph spacing, indents and page setup, and that a page break
+ # is honoured by the paginator rather than merely stored.
+ shell: bento-step {0}
+ run: node scripts/test-type-layout.ts
+
+ - name: Type image rig
+ # Pictures embed or reference, and an atomic block is measured as one
+ # box so pagination cannot break a page through the middle of it.
+ shell: bento-step {0}
+ run: node scripts/test-type-image.ts
+
+ - name: Type link rig
+ # Link marks round-trip, and the href allow-list holds: a document is
+ # untrusted input, and javascript: reached the page from one once.
+ shell: bento-step {0}
+ run: node scripts/test-type-link.ts
+
+ - name: Type find rig
+ # Find and replace across blocks, including the offsets that shift
+ # when a replacement changes a block's length.
+ shell: bento-step {0}
+ run: node scripts/test-type-find.ts
+
+ - name: Type toc rig
+ # Section numbering is DERIVED, never stored, so inserting a heading
+ # renumbers everything and nothing drifts.
+ shell: bento-step {0}
+ run: node scripts/test-type-toc.ts
+
+ - name: Type xref rig
+ # Captions and cross-references are atoms at an offset, so renumbering
+ # is invisible to the redline.
+ shell: bento-step {0}
+ run: node scripts/test-type-xref.ts
+
+ - name: Type cite rig
+ # Citations and the bibliography — a citation is an atom, so
+ # restyling one is not an edit to the sentence around it.
+ shell: bento-step {0}
+ run: node scripts/test-type-cite.ts
+
+ - name: Type math rig
+ # Formulas: the TeX source is the model and inline math is a mark, so
+ # a formula survives the render→read round trip intact.
+ shell: bento-step {0}
+ run: node scripts/test-type-math.ts
+
+ - name: Type comments rig
+ # Threads keep their anchors through edits, splits and merges, and
+ # editing or deleting a message never moves the text it points at.
+ shell: bento-step {0}
+ run: node scripts/test-type-comments.ts
+
+ - name: Type track rig
+ # Tracked changes as ins/del marks: accept-all gives the text as
+ # edited, reject-all the text as it was, and display modes never touch
+ # the model.
+ shell: bento-step {0}
+ run: node scripts/test-type-track.ts
+
+ - name: Type font rig
+ # Per-selection typeface and size, and the CSS allow-list that keeps a
+ # font stack from opening a second declaration in a style attribute.
+ shell: bento-step {0}
+ run: node scripts/test-type-font.ts
+
+ - name: Type autosave rig
+ # A crash must not cost the work since the last ⌘S. Pins the content
+ # key that decides whether a snapshot disagrees with the loaded file,
+ # and that an encrypted document is NEVER snapshotted — plaintext in
+ # IndexedDB beside a file whose whole point is that it is encrypted.
+ shell: bento-step {0}
+ run: node scripts/test-type-autosave.ts
+
+ - name: Type preview rig
+ # Thumbnailers run no JavaScript, so a saved file carries a still of
+ # page one plus a parser-blocking remover. Pins the ordering (nothing
+ # paintable between host and remover), that a second save REPLACES
+ # rather than appends, and that an encrypted document gets none.
+ shell: bento-step {0}
+ run: node scripts/test-type-preview.ts
+
+ - name: Type i18n rig
+ # Eight languages in one file: every catalogue holds the same keys,
+ # every {placeholder} survives translation, no key outlives the string
+ # it came from, and the packed table matches the catalogues it was
+ # built from.
+ shell: bento-step {0}
+ run: node scripts/test-type-i18n.ts
+
+ - name: Type styles rig
+ # Named paragraph styles, and the additivity rule: a document with no
+ # doc.styles must render byte-identically to before the feature.
+ shell: bento-step {0}
+ run: node scripts/test-type-styles.ts
+
+ - name: Type move rig
+ # Reordering moves whole UNITS, so a drag can never tear a table in
+ # half or drop a paragraph between two bullets.
+ shell: bento-step {0}
+ run: node scripts/test-type-move.ts
+
+ - name: Type embed rig
+ # Embedded Bento artifacts, and the render boundary that refuses a
+ # script rather than sanitising one.
+ shell: bento-step {0}
+ run: node scripts/test-type-embed.ts
+
+ - name: Type share-copy rig
+ # A view-only copy carries the room it follows and NO private key —
+ # not the owner's, not a legacy writer key, not an invite — whatever the
+ # source document held; an editor copy writes only through its own
+ # fresh, revocable invite. Every copy is minted in type/src/share.ts.
+ shell: bento-step {0}
+ run: node scripts/test-type-share.ts
+
+ - name: Type chrome rig
+ # Where controls live: nothing in two menus, no inserts in the
+ # overflow, and every element the chrome reaches for actually exists —
+ # a null lookup there has silently broken the boot twice.
+ shell: bento-step {0}
+ run: node scripts/test-type-chrome.ts
+
+ - name: Type restore-gate rig
+ # A snapshot kept in the browser (Unsaved changes banner, Version
+ # history) is foreign input: on file:// any local page can write it.
+ # Restoring one never brings its own docId, room/keys or mode, and an
+ # honest one keeps the open file's sharing. Replace from JSON — a
+ # document the person chose — is NOT gated. Counterpart of slides'.
+ shell: bento-step {0}
+ run: node scripts/test-type-restore-gate.ts
+
+ - name: Type signature-chain rig
+ # Canonical JSON and the chained signatures over it. A canonicalization
+ # bug does not crash — it silently fails valid documents or passes
+ # tampered ones — so this pins determinism, key order by UTF-16 code
+ # unit, volatile fields at every depth, and that the signer's NAME is
+ # inside the signed text (it was once only displayed beside the tick).
+ shell: bento-step {0}
+ run: node scripts/test-type-canon.ts
+
+ - name: Type compare rig
+ # Comparing with another file is a VIEW: nothing commits, and the diff
+ # runs from that file to this one. Asserts which side is <del> and which
+ # is <ins>, because a reversed diff keeps the same change count and a
+ # count-only check cannot see it.
+ shell: bento-step {0}
+ run: node scripts/test-type-compare.ts
+
+ - name: Type hanging-punctuation rig
+ # Optical margin alignment may only PAINT. A line break is held only
+ # when each line's first and last character both stay on it — a check
+ # on first characters alone passed a real reflow.
+ shell: bento-step {0}
+ run: node scripts/test-type-micro.ts
+
+ - name: Type fields and mail-merge rig
+ # Fields are atoms resolved at render, never stored resolved. Merged
+ # letters get a fresh docId each and carry no credentials, signatures,
+ # comments or revision history from the template.
+ shell: bento-step {0}
+ run: node scripts/test-type-fields.ts
+
+ - name: Type live-cells rig
+ # A field bound to an embedded sheet by row label and column heading,
+ # so inserting, reordering or sorting rows cannot re-point a sentence
+ # at a different number.
+ shell: bento-step {0}
+ run: node scripts/test-type-live.ts
diff --git a/.github/workflows/ci-dash.yml b/.github/workflows/ci-dash.yml
new file mode 100644
index 00000000..a57d3ac8
--- /dev/null
+++ b/.github/workflows/ci-dash.yml
@@ -0,0 +1,96 @@
+# CI, dash: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (dash)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+defaults:
+ run:
+ # Every step fails if a rig in it reports a skip CI does not allow
+ # (scripts/lib/ci-skips.mjs). No job here sets a working-directory, which
+ # this relative path relies on.
+ shell: bash scripts/ci/bento-step {0}
+
+jobs:
+ dash-fields-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone document
+ run: |
+ npm ci --prefix dash
+ npm run build:single --prefix dash
+ - name: Every dash field wears the suite's one field look
+ # Slides' rig, ported: every text field, select and textarea on 17
+ # surfaces, light and dark, has the 1px --line border, --field fill,
+ # 6px radius and 26px height, and the --accent-ink focus ring; each
+ # surface must show fields in its own container, and a planted
+ # browser-dressed field must be flagged.
+ run: node scripts/test-dash-fields-browser.mjs
+ - name: The dash properties panel shows only what applies
+ # Per column type on a dataset, Number format / Total / Formula appear
+ # only where they apply, with no money or formula placeholders; one
+ # Number format control on both sheet kinds (Custom… reveals the
+ # pattern, Apply to writes a cell override); unset colour wells paint
+ # the field's own fill, measured from pixels with a set-colour
+ # positive control, light and dark; bare checkboxes; a formula over
+ # Money is Money and one column never mixes grouping.
+ run: node scripts/test-dash-panel-context-browser.mjs
+
+ dash-gate-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone document
+ run: |
+ npm ci --prefix dash
+ npm run build:single --prefix dash
+ npm run build:sealtest --prefix dash
+ - name: An encrypted or unopenable dash file opens to its gate
+ # window.bento = { format, locked: true } before the password gate and
+ # the refusal page, so the shell's loader counts the app as mounted
+ # instead of re-running it and failing over the gate; unlocking
+ # replaces it with the real workbook.
+ run: node scripts/test-dash-gate-browser.mjs
+ - name: A sealed dash workbook writes no plaintext of itself
+ # bento/connect §E on the shared sealed TEST document: recovery snapshots,
+ # the version timeline, the preview, recovery read-back and drop-open
+ # all ask isBodySealed(); neutral title while sealed, matching the saved
+ # file's title. Each row has an unsealed control that shows the leak.
+ run: node scripts/test-dash-sealed-browser.mjs
diff --git a/.github/workflows/ci-home-android.yml b/.github/workflows/ci-home-android.yml
new file mode 100644
index 00000000..b8f4ea22
--- /dev/null
+++ b/.github/workflows/ci-home-android.yml
@@ -0,0 +1,51 @@
+# CI, home-android: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (home-android)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+# No bento-step default here (see the other ci-<zone>.yml files): this job runs
+# Gradle, which prints SKIPPED as an ordinary task outcome, not a rig skip.
+
+jobs:
+ home-android-unit:
+ runs-on: ubuntu-latest
+ timeout-minutes: 20
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-java@v4
+ with:
+ distribution: temurin
+ java-version: 17
+ # RecoveryTest cross-checks Bouncy Castle's Argon2id against Node's native
+ # one on random cases every run (security §35), and never skips without it.
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Android host unit tests
+ # The JVM rigs for home/android: which web origin a document may run
+ # under (a different file at a path a document used before must never
+ # read its storage), the signed new-document verifier, and the Kotlin
+ # port of the document index against home/fixtures. They need no
+ # emulator, and until this job nothing ran them — the corpus note in
+ # .github/actions/validate-home/action.yml said "the Kotlin port under Gradle" of a step that did not exist.
+ # The runner image ships the Android SDK (ANDROID_HOME); the wrapper is
+ # pinned at 8.14.3 because AGP 8 cannot run on Gradle 9.6+.
+ working-directory: home/android
+ run: ./gradlew --no-daemon testDebugUnitTest
diff --git a/.github/workflows/ci-home-desktop.yml b/.github/workflows/ci-home-desktop.yml
new file mode 100644
index 00000000..eee675fb
--- /dev/null
+++ b/.github/workflows/ci-home-desktop.yml
@@ -0,0 +1,60 @@
+# CI, home-desktop: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (home-desktop)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+jobs:
+ home-desktop-agent:
+ runs-on: ubuntu-24.04
+ timeout-minutes: 20
+ steps:
+ - uses: actions/checkout@v4
+ - name: Desktop agent against the bento/id vectors
+ # home/desktop/agent is the Windows/Linux identity agent core. Its
+ # statements port must reach every verdict AND reason in
+ # kernel/fixtures/identity-v1.json (re-read every run, never pinned), plus
+ # builder round-trips, three tamperings per accepted row, spendCalled
+ # on every cns row, and the frozen display table. A missing fixture
+ # fails; it never skips.
+ working-directory: home/desktop/agent
+ run: cargo test
+ - name: Desktop agent TPM rigs (two software TPMs)
+ # The Linux key store against a real TPM 2.0 (swtpm): the routine key
+ # signs inside the TPM; the consent key and the sealed account key need
+ # the PIN on every use (a wrong PIN is the TPM's own AUTH_FAIL); the key
+ # files are useless on a SECOND TPM (cannot be copied off the machine);
+ # and a second connection without the PIN gets neither, while the
+ # routine key stays usable, which is the stated desktop residual.
+ working-directory: home/desktop/agent
+ run: |
+ sudo apt-get update -qq
+ sudo apt-get install -y -qq libtss2-dev swtpm swtpm-tools >/dev/null
+ ./tpm-rig.sh
+ - name: Desktop agent no-TPM keyring rigs (gnome-keyring)
+ # On a Linux machine without a usable TPM the agent falls back to the
+ # Secret Service. Against a real gnome-keyring in a D-Bus session: the
+ # routine key signs and verifies; there is no consent key, so consent is
+ # refused (AAL3 routed elsewhere); wipe removes the keys; and the stated
+ # exposure is asserted: a second connection reads the account key with
+ # no prompt once the keyring is unlocked.
+ working-directory: home/desktop/agent
+ run: |
+ sudo apt-get install -y -qq gnome-keyring dbus >/dev/null
+ ./keyring-rig.sh
diff --git a/.github/workflows/ci-home-ios.yml b/.github/workflows/ci-home-ios.yml
new file mode 100644
index 00000000..7eb594e6
--- /dev/null
+++ b/.github/workflows/ci-home-ios.yml
@@ -0,0 +1,79 @@
+# CI, home-ios: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (home-ios)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+jobs:
+ home-ios-swift:
+ # The home/ios Swift rigs need CryptoKit, Security and LocalAuthentication,
+ # so on the ubuntu validate job they print SKIPPED and pass. Here they run
+ # for real, and a rig that reports SKIPPED FAILS the step, so a missing
+ # toolchain can never pass quietly.
+ runs-on: macos-latest
+ timeout-minutes: 20
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Toolchain
+ run: sw_vers && xcrun swiftc --version
+ - name: Swift rigs (a skip fails)
+ shell: bash
+ run: |
+ set -o pipefail
+ rigs=(
+ test-tray-releases.mjs
+ test-home-origin.mjs
+ test-home-docstore-ios.mjs
+ test-home-id-keys.mjs
+ test-home-id-statements.mjs
+ test-home-id-agent.mjs
+ test-home-id-recovery.mjs
+ test-home-spotlight.mjs
+ )
+ for rig in "${rigs[@]}"; do
+ echo "::group::$rig"
+ node "scripts/$rig" | tee "$RUNNER_TEMP/rig.out"
+ echo "::endgroup::"
+ if grep -q 'SKIPPED' "$RUNNER_TEMP/rig.out"; then echo "::error::$rig skipped on macOS"; exit 1; fi
+ done
+
+ home-ios-simulator:
+ # Builds the iOS app and drives it on a simulator: the app-switcher snapshot
+ # iOS writes to disk shows nothing of a sealed document. The rig reads back
+ # the snapshots iOS itself wrote; a skip fails here too.
+ runs-on: macos-latest
+ timeout-minutes: 30
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Toolchain
+ run: |
+ brew install xcodegen
+ sw_vers && xcodebuild -version && xcrun simctl list runtimes
+ - name: Snapshot cover (a skip fails)
+ shell: bash
+ run: |
+ set -o pipefail
+ node scripts/test-home-snapshot-cover.mjs | tee "$RUNNER_TEMP/rig.out"
+ if grep -q 'SKIPPED' "$RUNNER_TEMP/rig.out"; then echo "::error::snapshot cover skipped on macOS"; exit 1; fi
diff --git a/.github/workflows/ci-home.yml b/.github/workflows/ci-home.yml
new file mode 100644
index 00000000..ff38b47b
--- /dev/null
+++ b/.github/workflows/ci-home.yml
@@ -0,0 +1,53 @@
+# CI, home: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (home)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+defaults:
+ run:
+ # Every step fails if a rig in it reports a skip CI does not allow
+ # (scripts/lib/ci-skips.mjs). No job here sets a working-directory, which
+ # this relative path relies on.
+ shell: bash scripts/ci/bento-step {0}
+
+jobs:
+ home-origin-probe-browser:
+ # The probe that decides whether a file opened for the first time may keep
+ # the storage origin it had before origins followed the file. It runs in
+ # WebKit on iOS, so it's tested in WebKit, against storage laid out the way
+ # the kernel lays it out AND against a real slides deck's own autosave.
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps webkit
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the slides shell the real-deck case opens
+ run: |
+ npm ci --prefix slides
+ npm run build:single --prefix slides
+ - name: Origin probe in WebKit
+ run: node scripts/test-home-origin-probe.mjs
diff --git a/.github/workflows/ci-slides.yml b/.github/workflows/ci-slides.yml
new file mode 100644
index 00000000..c99e0950
--- /dev/null
+++ b/.github/workflows/ci-slides.yml
@@ -0,0 +1,186 @@
+# CI, slides: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (slides)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+defaults:
+ run:
+ # Every step fails if a rig in it reports a skip CI does not allow
+ # (scripts/lib/ci-skips.mjs). No job here sets a working-directory, which
+ # this relative path relies on.
+ shell: bash scripts/ci/bento-step {0}
+
+jobs:
+ slides-font-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone documents
+ run: |
+ npm ci --prefix slides
+ npm run build:single --prefix slides
+ npm run build:sealtest --prefix slides
+ - name: The sealed TEST document in Chromium
+ # bento/id §E (security §31): the shared helper boots the build:sealtest
+ # shell with the identity seal set before the app's own boot, proves it
+ # took, and the saved file carries an identity-sealed envelope, a
+ # neutral <title> and filename, no preview, and no plaintext; the
+ # unsealed control shows the same checks can see a leak.
+ run: node scripts/test-sealed-boot.mjs
+ - name: A sealed slides deck keeps its content out of IndexedDB in Chromium
+ # The autosave and ⌘S checkpoints write no recovery copy or version for
+ # a deck sealed by identity; the password menu stays keyed to the
+ # password; the unsealed control shows the scan sees a leak.
+ run: node scripts/test-slides-sealed-guards-browser.mjs
+ - name: Exercise the packaged documents in Chromium
+ # Real UI and serialization, offline; delayed mock writes expose save races.
+ run: |
+ node scripts/test-slides-font-lifecycle-browser.mjs
+ - name: Write chrome follows the copy's role in Chromium
+ # canWriteDeck is an allowlist that fails closed: an audience, reader or
+ # unknown-role copy arriving in a running editor (dropped, loadDoc) gets
+ # no write actions and is locked; owner and writer copies keep theirs.
+ run: node scripts/test-slides-audience-gate-browser.mjs
+ - name: PowerPoint converter links in Chromium
+ # Save as → Import PowerPoint… (/convert?from=pptx) and Export for
+ # PowerPoint… (/convert), in that order after Replace from JSON…, each
+ # opens only its URL in a new tab with no opener, and says it needs
+ # the network.
+ run: node scripts/test-slides-import-link-browser.mjs
+ - name: The unsupported-browser notice names the app in Chromium
+ # Each app's shell, built with the flags its own build:single passes,
+ # says what it is ("a bento/slides presentation", …) — it said "a
+ # bento/dash spreadsheet" in every app.
+ run: node scripts/test-shell-unsupported-notice-browser.mjs
+ - name: Under-specified documents boot in Chromium
+ # parseDoc fills required fields only where absent and drops elements
+ # that cannot render; unknown keys and element types survive (additivity).
+ run: node scripts/test-slides-minimal-doc-browser.mjs
+ - name: A table with no style opens in Chromium
+ # A full document whose table omits `style` (absent, null, a string)
+ # loads by file, loadDoc and Replace from JSON, gets the theme's table
+ # style, and selecting it opens the table panel without a page error.
+ run: node scripts/test-slides-table-nostyle-browser.mjs
+ - name: Top bar in Chromium
+ # 30px row and 44px phone targets, the wordmark as a named button, Save
+ # primary in both themes, and N language rebuilds leaving one set of
+ # window/document listeners and bar observers.
+ run: node scripts/test-slides-topbar-browser.mjs
+ - name: One field look in Chromium
+ # Every chrome text field, select and textarea (each element kind's
+ # panel, About, the save-as dialogs, Share, comments) has the shared
+ # field look and amber focus ring in both themes, never the UA's dress.
+ run: node scripts/test-slides-fields-browser.mjs
+ - name: A password-protected deck opens in Chromium
+ # One password gate and no loader failure card (1.2.0–1.2.8 showed
+ # three gates under "every loader path was refused"); wrong then right
+ # password; the same with only the blob import allowed; the ⌘S re-save
+ # and the self-update re-splice open again.
+ run: node scripts/test-slides-encrypted-open-browser.mjs
+ - name: The loader reads what the app published in Chromium
+ # Toy shells from the real postbuild: an app that is running, locked at
+ # a gate, or refused (and threw) runs ONCE and gets no loader card; only
+ # an app that published nothing does. Every path, blob only, import.meta.
+ run: node scripts/test-shell-loader-published-browser.mjs
+ - name: Top bar holds still in Chromium
+ # #546: a real auto-save "Saved" flash and a file-chip change (rename to
+ # the file's name, then undo) leave Undo/Redo exactly where they were,
+ # on the desktop and the folded phone bar.
+ run: node scripts/test-slides-topbar-stable-browser.mjs
+ - name: Chrome rulings in Chromium
+ # D2 menu descriptions (readable both themes, ARIA-wired, scroll on a
+ # short window), D4 dialog titles, D8 help shortcuts, the compact Save
+ # caret, phone menu rows, the designed focus ring, dark menu shadow.
+ run: node scripts/test-slides-chrome-rulings-browser.mjs
+ - name: Code in a text box in Chromium
+ # Real typing: a ``` fence becomes a Code element (in place, or split
+ # out of the text around it), select + ` wraps lines in <code>, pasted
+ # fences convert, and an unclosed fence stays text.
+ run: node scripts/test-slides-code-fence-browser.mjs
+ - name: Copy several slides in Chromium
+ # Two selected thumbnails → ⌘C copies both, in order; a Shift-click
+ # range across a parent copies parents only, never its states; plural
+ # and singular toasts.
+ run: node scripts/test-slides-copy-slides-browser.mjs
+ - name: Rounded tables in Chromium
+ # A rounded table whose rows outgrow its box shows its last row (#494),
+ # keeps rounded corners on its real bottom, and a short one still
+ # fills its box; tables without a radius are unchanged.
+ run: node scripts/test-slides-table-radius-browser.mjs
+ - name: Paste position in Chromium
+ # ⌘C then ⌘V onto another slide keeps the element's position; onto the
+ # source slide it steps +20 and cascades (#569).
+ run: node scripts/test-slides-paste-position-browser.mjs
+ - name: Save queue in Chromium
+ # Real ⌘S and auto-save with the file write held open: an edit made
+ # during a write stays dirty, writes never overlap, the dot goes out
+ # only when the deck on screen is the one on disk.
+ run: node scripts/test-slides-save-browser.mjs
+ - name: Recovery-off notice in Chromium
+ # Under a per-document store host that refuses the recovery copy, the
+ # save status says crash recovery is off (approved wording), once, held
+ # long enough to read; the dot stops claiming a backup; a host that
+ # keeps the copy gets no message; never for an encrypted deck.
+ run: node scripts/test-slides-recovery-off-browser.mjs
+ - name: Save a copy and the older-snapshot banner in Chromium
+ # "Save a copy…" says "Copy saved — you are still editing the original",
+ # keeps the chip, title and dot on the original, and the next ⌘S writes
+ # the original with no picker; an older recovery snapshot gets the
+ # warning banner (Keep the file is the default and deletes nothing), a
+ # newer one the plain banner that claims nothing.
+ run: node scripts/test-slides-save-copy-browser.mjs
+ - name: Ghost Cut in Chromium
+ # ⇧⌘X fades the selection by CSS (shadowed elements too) and copies it;
+ # a ghost is never selected and the pointer passes through it; Esc
+ # restores; paste moves it to the pointer in one undo step, across
+ # slides, without two elements sharing an id on one slide.
+ run: node scripts/test-slides-ghost-cut-browser.mjs
+ - name: Bullet indent in Chromium
+ # Tab / Shift+Tab nest and un-nest list items (and typed bullets) while
+ # editing, with the caret kept and ⌘Z right after; the panel's Indent /
+ # Outdent do the same; committed, one undo step; Tab outside a list —
+ # a plain box, a table cell — is unchanged.
+ run: node scripts/test-slides-bullet-indent-browser.mjs
+ - name: Leaving an inline code run in Chromium
+ # A text box that already ends a line in `code` (reopened, pasted):
+ # typing at the end of that line is plain text, at the box's end or
+ # before a line break; opening and closing a box changes nothing.
+ run: node scripts/test-slides-code-run-exit-browser.mjs
+ - name: Connectors route on every slide in Chromium
+ # #493: a deck saved or loaded with stale connector endpoints opens with
+ # every slide's connectors on their elements' borders (thumbnail too),
+ # without dirtying the deck or making an undo step.
+ run: node scripts/test-slides-connectors-browser.mjs
+ - name: Caret at the start of a line in Chromium
+ # #547: with the caret at a text box's left edge, nothing paints over
+ # it — the editing ring is an outline held off the box, Moveable's
+ # leftover lines are hidden for the edit, and a screenshot of the strip
+ # beside the caret has no ring-blue in it; the text does not move.
+ run: node scripts/test-slides-caret-ring-browser.mjs
diff --git a/.github/workflows/ci-spaces.yml b/.github/workflows/ci-spaces.yml
new file mode 100644
index 00000000..4b0015bc
--- /dev/null
+++ b/.github/workflows/ci-spaces.yml
@@ -0,0 +1,90 @@
+# CI, spaces: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (spaces)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+defaults:
+ run:
+ # Every step fails if a rig in it reports a skip CI does not allow
+ # (scripts/lib/ci-skips.mjs). No job here sets a working-directory, which
+ # this relative path relies on.
+ shell: bash scripts/ci/bento-step {0}
+
+jobs:
+ spaces-save-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone documents
+ run: |
+ npm ci --prefix spaces
+ npm run build:single --prefix spaces
+ npm run build:sealtest --prefix spaces
+ - name: Exercise the packaged documents in Chromium
+ # Real UI and serialization, offline; delayed mock writes expose save races.
+ run: |
+ node scripts/test-spaces-save-browser.mjs
+ - name: A sealed space writes nothing readable (spaces, Chromium)
+ # The build:sealtest shell booted identity-sealed through the shared
+ # helper, plus a password space: no recovery snapshot or version in
+ # IndexedDB (also across a reload), no preview and no plaintext in the
+ # saved file, a neutral tab title, no recovery-off notice. The unsealed
+ # control shows each check can see a leak.
+ run: node scripts/test-spaces-sealed-browser.mjs
+ - name: One field look in Chromium (spaces)
+ # Port of slides' fields rig: every chrome text field, select and
+ # textarea (inspector incl. "Also known as", dialogs, view popovers,
+ # pickers, Share, comments, a designed space, the password gate) has
+ # the shared field look and amber focus ring in light, dark and
+ # OS-dark, never the UA's dress. "Also known as" shipped in it.
+ run: node scripts/test-spaces-fields-browser.mjs
+ - name: An encrypted space opens (one password gate, no loader failure)
+ run: node scripts/test-spaces-encrypted-browser.mjs
+ - name: Spaces recovery banner and recovery-off notice in Chromium
+ # An older recovery snapshot gets the warning with "Keep the file" the
+ # focused default (keeping deletes nothing; "Restore anyway" restores);
+ # a newer or equal one the plain banner that claims nothing; a host
+ # that refuses the recovery copy gets the notice once, held to read;
+ # pt and de show slides' words. Planted in bento-spaces-autosave.
+ run: node scripts/test-spaces-recovery-browser.mjs
+ - name: bento/id privacy notice and web deletion page (build rules + Chromium)
+ # A publishing build refuses any page still carrying a __PLACEHOLDER__;
+ # the deletion page's CSP pins its exact inline script and style and
+ # lets it reach only the directory. In Chromium with the API mocked:
+ # the start → code → done flow, its refusals, and that it never says
+ # whether an address exists.
+ run: node scripts/test-id-pages-browser.mjs
+ - name: bento.page passkey association files never publish a placeholder
+ # scripts/well-known.mjs fills /.well-known/apple-app-site-association
+ # and assetlinks.json from site-src/well-known/ once the Apple team id
+ # and the Play signing fingerprint exist. It writes only what it was
+ # given, refuses a malformed value, and never emits a placeholder: the
+ # platforms cache these files, so a wrong one is worse than none.
+ run: node scripts/test-well-known.ts
diff --git a/.github/workflows/ci-type.yml b/.github/workflows/ci-type.yml
new file mode 100644
index 00000000..f1eb6bf5
--- /dev/null
+++ b/.github/workflows/ci-type.yml
@@ -0,0 +1,139 @@
+# CI, type: this zone's own jobs — validate, never release (see ci.yml's header).
+#
+# These jobs are NOT the required check. Only `validate` (ci.yml) gates a
+# merge; a job here reports beside it, exactly as it did when it lived in
+# ci.yml. Keep each job's id unchanged — the id IS the check name.
+#
+# Each job checks out and builds what it needs for itself. Add this zone's
+# new jobs here, at the end; never in ci.yml.
+
+name: CI (type)
+
+on:
+ pull_request:
+ push:
+ branches: [main]
+
+concurrency:
+ # The same rule as ci.yml, whose comment explains it: PR runs collapse onto
+ # the tip, every commit on main keeps its own run.
+ group: ci-${{ github.workflow }}-${{ github.ref }}${{ github.ref == 'refs/heads/main' && format('-{0}', github.sha) || '' }}
+ cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
+
+defaults:
+ run:
+ # Every step fails if a rig in it reports a skip CI does not allow
+ # (scripts/lib/ci-skips.mjs). No job here sets a working-directory, which
+ # this relative path relies on.
+ shell: bash scripts/ci/bento-step {0}
+
+jobs:
+ type-boot-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone document
+ run: |
+ npm ci --prefix type
+ npm run build:single --prefix type
+ - name: Type boots on the loader's inline path; fields wiring still works
+ run: node scripts/test-type-boot-browser.mjs
+
+ type-find-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone document
+ run: |
+ npm ci --prefix type
+ npm run build:single --prefix type
+ - name: Find opens from the button, Cmd-F and Ctrl-F
+ # The find box lives in Navigate → Results; a selector naming a tab
+ # that no longer existed made both do nothing, silently.
+ run: node scripts/test-type-find-browser.mjs
+
+ type-cantopen-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone document
+ run: |
+ npm ci --prefix type
+ npm run build:single --prefix type
+ - name: The can't-open message shows the file's details as text
+ run: node scripts/test-type-cantopen-browser.mjs
+
+ type-fields-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the tested standalone document
+ run: |
+ npm ci --prefix type
+ npm run build:single --prefix type
+ - name: Every chrome field wears the suite's one field look, light and dark
+ # The THE FIELD block copied from slides: border, fill, radius, height and
+ # the focus ring, measured on twelve real surfaces, plus a planted
+ # browser-default field that must be flagged.
+ run: node scripts/test-type-fields-browser.mjs
+
+ type-sealed-browser:
+ runs-on: ubuntu-latest
+ timeout-minutes: 15
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ - name: Install browser test runtime
+ # Pinned outside app packages: browser automation is not shipped in documents.
+ run: |
+ npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
+ "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
+ echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
+ - name: Build the sealed TEST shell
+ run: |
+ npm ci --prefix type
+ npm run build:sealtest --prefix type
+ - name: A sealed document leaves no plaintext and shows a neutral title
+ run: node scripts/test-type-sealed-browser.mjs
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0f8ef302..58e8beca 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -35,27 +35,6 @@ concurrency:
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
jobs:
- type-boot-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone document
- run: |
- npm ci --prefix type
- npm run build:single --prefix type
- - name: Type boots on the loader's inline path; fields wiring still works
- run: node scripts/test-type-boot-browser.mjs
-
validate:
runs-on: ubuntu-latest
timeout-minutes: 15
@@ -78,2953 +57,59 @@ jobs:
working-directory: slides
run: npm ci
- - name: Which targets anim treats as elements
- # The element/plain-object split ran on HTMLElement||SVGElement, which
- # excludes MathML — formula symbols became plain-object tweens, with
- # opacity assigned as a JS property and no style ever written.
- run: node scripts/test-anim-elements.ts
-
- - name: Transforms are not silently ignored
- # A CSS transform does nothing to a non-replaced inline element: it is
- # accepted, style.transform reads back verbatim, and the box never
- # moves. An animation on one reports perfect health and paints nothing,
- # which is exactly how it survived eight rounds of debugging once.
- run: node scripts/test-anim-inline.ts
-
- - name: i18n packed table is current
- # The per-locale catalogs are the source of truth; slides/src/i18n/
- # packed.ts is generated from them and is what actually ships. A stale
- # packed.ts would silently ship yesterday's translations.
- run: node scripts/build-i18n.mjs --check
-
- - name: Language coverage
- # Core catalogs ship inside every saved file and cannot be corrected
- # without a release, so they must be complete. Packs are downloadable
- # and re-publishable on their own, so they get a floor and a report.
- run: node scripts/test-i18n-coverage.mjs
- - name: Slides Portuguese is pt-BR; the theme picker has its own words
- # No European-Portuguese markers (ficheiro, guardar for save,
- # diapositivo, separador, ecrã, tu forms…) in slides' pt catalog, and the
- # Appearance picker uses "Light mode"/"Dark mode", never the "Light"
- # font weight ("Fino").
- run: node scripts/test-slides-pt-br.mjs
-
- - name: Language packs build and index cleanly
- # Emits every pack and builds the index payload WITHOUT signing (--dry
- # writes nothing and needs no key — signing stays local, see the header).
- # Catches a malformed pack catalog (missing label, duplicate language,
- # wrong app) here rather than mid-release.
- run: |
- node scripts/build-i18n.mjs --packs "$RUNNER_TEMP/packs"
- node scripts/sign-packs.mjs "$RUNNER_TEMP/packs" --dry
-
- - name: Typecheck
- working-directory: slides
- run: node_modules/.bin/tsc -b
-
- - name: Spaces save revisions
- # Typing runs and remote changes invalidate in-flight saves even while dirty.
- run: node scripts/test-spaces-save-revisions.ts
-
- - name: Slides save revisions
- # An edit, panel keystroke, remote op or undo during a write keeps the
- # deck dirty; writes queue; the CRDT stamp is taken as each one starts;
- # ⌘S, auto-save and Update this file all write through the queue.
- run: node scripts/test-slides-save-revisions.ts
-
- - name: Slides count-up number rig
- # #584 ruling: a single dot is a decimal point (12.500), only a
- # well-formed group with two or more separators is thousands
- # (1.250.000 settles as authored and counts up grouped).
- run: node scripts/test-slides-countup-number.ts
-
- - name: Typecheck kernel (standalone)
- # Apps also typecheck kernel transitively through their imports; this
- # catches kernel-only errors under the kernel's own flags. It ALSO
- # evaluates kernel/src/docfields.typecheck.ts (included via "src"): the
- # field-class table's type-level test, whose @ts-expect-error lines fail
- # this step if a guard is weakened (no default cell, 'per-field' only in
- # the mode row, every mode field has a rule).
- working-directory: slides
- run: node_modules/.bin/tsc -p ../kernel
-
- - name: Field-classification rig
- run: node scripts/test-field-class.ts
-
- - name: Whole-document restore rig (undo / version restore / crash recovery)
- # applyRestore decides per field from its class, with per-field overrides,
- # and the restore DIRECTION matters: a version restore ('back') keeps a
- # live field; crash recovery ('recover') reconciles a live history field
- # with the newer snapshot. Recover hooks (newestListWins for unsigned
- # lists) vs the default (signed-safe). On recover, a field absent from a
- # whole snapshot stays removed (deleted or cleared stays so) unless the
- # rules opt it out (keepLiveWhenAbsent); a projection keeps the live value.
- run: node scripts/test-restore.ts
-
- - name: identity agent contract
- # bento/id: how a document finds the host's identity agent. A valid
- # agent only, null otherwise (today's behaviour), never a throw, and
- # once found it cannot be swapped. Contract only: nothing calls it yet.
- run: node scripts/test-identity.ts
-
- - name: identity statements and conformance vectors
- # bento/id: every signed statement (dev., bind., att., tomb., del.,
- # cmp., cns.) and the address normal form. The reference must pass
- # every row of kernel/fixtures/identity-v1.json, which is the contract
- # each native host is held to, and must refuse every tampered statement.
- run: node scripts/test-statements.ts
-
- - name: identity recovery code and key blobs
- # bento/id: every host must derive the identical keys from the same
- # recovery code and passkey PRF output. Deterministic vectors in
- # kernel/fixtures/recovery-v1.json: Argon2id against RFC 9106, the
- # code's printed form and forgiving parse (all five extra check symbols),
- # every derivation, every blob re-sealed byte for byte, every refusal.
- run: node scripts/test-recovery.ts
-
- - name: identity seal — one "body is sealed" predicate
- # bento/id §E: every plaintext-to-disk guard asks isBodySealed(), not
- # "is there a password". The identity-sealed body is a genuine bento/enc
- # v1 envelope (kdf hkdf-kdoc) that frozen shells read as sealed; fresh
- # salt per save; the password path unchanged; the two refuse each other.
- run: node scripts/test-body-seal.ts
-
- - name: Typecheck convert (standalone)
- # convert/ is a library beside the apps (the CLI and bento.page/import
- # use it; no shell does), so no app's tsc -b reaches it. Its own flags,
- # its own pass — the same as kernel's.
- working-directory: slides
- run: node_modules/.bin/tsc -p ../convert
-
- - name: Build single-file shell
- working-directory: slides
- run: npm run build:single
-
- - name: Splice conformance gate
- run: node scripts/shell-gate.mjs slides/dist-single/Bento_Slides.bento.html
-
- - name: The gate refuses a sealed TEST shell
- # Positive control for the gate's no-test-seal check (security §31): the
- # build:sealtest shell carries the sealed test document's key handoff,
- # inside its deflated runtime, and must be refused for it; the release
- # shell from the same source must pass.
- working-directory: slides
- run: |
- npm run build:sealtest
- node ../scripts/test-seal-gate.mjs
-
- # spaces: a second app proving the kernel seam — same pipeline, same gate.
- - name: Install (spaces)
- working-directory: spaces
- run: npm ci
-
- - name: Typecheck (spaces)
- working-directory: spaces
- run: node_modules/.bin/tsc -b
-
- - name: Build single-file shell (spaces)
- working-directory: spaces
- run: npm run build:single
-
- - name: Splice conformance gate (spaces)
- run: node scripts/shell-gate.mjs spaces/dist-single/Bento_Spaces.bento.html
-
- - name: Spaces i18n packed table is current
- # The per-locale catalogs are the source of truth; packed.ts is
- # generated and is what ships inside every saved file. A core catalog
- # cannot be corrected without a release, so an incomplete one fails the
- # build rather than shipping a half-translated interface.
- run: node scripts/build-spaces-i18n.mjs --check
-
- - name: Spaces invite rig
- # "Invite someone…" was `saveAs('copy')`, which serializes store.doc —
- # so everyone invited to a space received `collab.ownerPriv`, the room's
- # ROOT key: they could write, and they could revoke the person who
- # invited them. Nothing about the copy looked wrong. This runs the real
- # share functions against real WebCrypto keys and asserts on the bytes:
- # the owner private key appears NOWHERE in an invite, the invite is a
- # separate keypair that the owner actually signed (verified the way the
- # relay verifies it), and a view-only copy holds no signing key at all.
- # (Bundled: the kernel transport uses parameter properties, which node's
- # strip-only TypeScript loader refuses.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-invite.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-invite.mjs"
- node "$RUNNER_TEMP/test-spaces-invite.mjs"
-
- - name: Spaces copy-tier rig
- # Every copy of a space is built by the kernel's copy table
- # (docfields.ts projectForCopy) over spaces' exhaustive field map. This
- # runs each real builder against one source carrying every class of
- # field, every collab secret, in-file history and an undeclared key, and
- # asserts the EXACT top-level key set each emits: no history or unknown
- # key in a reader copy or Copy JSON, history kept in an invite, both
- # kept in a duplicate. (Bundled: share.ts imports the kernel transport.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-copytiers.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-copytiers.mjs"
- node "$RUNNER_TEMP/test-spaces-copytiers.mjs"
-
- - name: Spaces reading-copy rig
- # "Save a reading copy…" is the file you hand to somebody who will not
- # edit it, and its whole value is in what the bytes do NOT contain. So
- # this asserts on the serialized document, not on "the strip function
- # ran": no room, no read key, no owner/writer/invite private key
- # anywhere in the text, no comment thread (page-level, block-level or
- # reply), no history, and the readonly flag set. Prev/Next follows the
- # tree's order. (The field-by-field key set and the mutation controls
- # are the copy-tier rig's.) (Bundled: share.ts imports the kernel
- # transport.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-reading.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-reading.mjs"
- node "$RUNNER_TEMP/test-spaces-reading.mjs"
-
- - name: Spaces undo rig
- # Every checkpoint used to stringify the WHOLE document: measured on a
- # 200-page, 2.5 MB handbook, fifty edits left an undo depth of NINE,
- # because nine snapshots exhaust the 24 MB budget. A typing run now
- # records only its PAGE. That is fast and deep — and it is only correct
- # while the mutation touched nothing else, so `doc` stays the default
- # and this rig covers the cases where a wrong scope silently loses
- # work: mixed scopes, interleaved undo/redo, and two pages edited in
- # turn. (Bundled: store.ts imports './model' extensionless.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-undo.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-undo.mjs"
- node "$RUNNER_TEMP/test-spaces-undo.mjs"
-
- - name: Spaces restore-gate rig
- # The recovery snapshot and every History entry live in IndexedDB, which
- # every file:// document shares, so restore is foreign input. Like
- # slides' restore gate: an entry naming another space is refused, it
- # never brings collab/readonly/template, block html is sanitized, and
- # junk, frozen, __proto__ and oversized entries apply nothing.
- # (Bundled: store.ts imports './model' extensionless.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-restore-gate.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-restore-gate.mjs"
- node "$RUNNER_TEMP/test-spaces-restore-gate.mjs"
-
- - name: Spaces restore directions rig (several timezones)
- # Every whole-document restore resolves through the kernel's
- # applyRestore over one rule set (spaces/src/store.ts RESTORE_RULES):
- # undo/redo, version restore, Replace from JSON and loadDoc go 'back'
- # (history kept live), the recovery banner goes 'recover' (revisions
- # follow the snapshot, the trail unions by day without counting a day
- # twice). Undo keeps the asset pool its checkpoints omit. The trail
- # hook does day arithmetic on labels, hence the timezone loop.
- # (Bundled: store.ts imports './model' extensionless.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-restore.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-restore.mjs"
- for tz in UTC Europe/Berlin Pacific/Kiritimati Pacific/Niue; do
- echo "--- $tz"
- TZ=$tz node "$RUNNER_TEMP/test-spaces-restore.mjs"
- done
-
- - name: Spaces in-file history rig
- # doc.revisions (spaces/src/history.ts): every entry is the kernel's
- # Revision envelope with the patch under body; what it covers is the
- # field map's content class minus assets (footnotes, design, templates
- # included); restore(N) is byte-identical to what was saved at N and
- # goes through the restore gate; history is a log undo never un-records.
- # (Bundled: store.ts imports './model' extensionless.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-history.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-history.mjs"
- node "$RUNNER_TEMP/test-spaces-history.mjs"
-
- - name: Spaces agent-surface rig
- # agent.ts is ~900 lines and shipped with no coverage at all: two of the
- # five defects an adversarial review found in round 2 lived here,
- # including a walk over author-supplied parent links that never
- # returned. What this pins is what makes the surface trustworthy —
- # validate() SILENT on documents that are correct but unusual (a false
- # positive teaches an agent to ignore warnings), every write verb
- # refusing what it cannot honour, no verb producing a document the app
- # itself could not produce, and every walk terminating. The termination
- # probes run in child processes with timeouts, because a hang cannot be
- # reported by the process it hangs.
- run: node scripts/test-spaces-agent.ts
-
- - name: Spaces journal rig (several timezones)
- # Every part of a daily note that can be wrong is wrong QUIETLY and on
- # someone else's machine: "today" in UTC is the wrong day for hours at
- # a time outside Greenwich, adding 86,400,000 ms is not adding a day on
- # the two DST boundaries, and `new Date('2026-08-06')` is UTC midnight
- # by spec. A date test that only ever runs in one timezone has not been
- # run — so this runs in five, including a half-hour DST offset.
- run: |
- for tz in UTC Europe/Berlin America/Los_Angeles Pacific/Kiritimati Australia/Lord_Howe; do
- echo "--- $tz"
- TZ=$tz node scripts/test-spaces-journal.ts
- done
-
- - name: Spaces timeline and workload rig (several timezones)
- # A chart is a picture of data that came out of a file somebody mailed
- # you, and every way it can be wrong is a way it stays silent about it:
- # a bar in the wrong month still looks like a bar. Half of what this rig
- # asserts is a date, so it runs in five timezones for the reasons
- # journal.ts records — including a half-hour DST offset.
- run: |
- for tz in UTC Europe/Berlin America/Los_Angeles Pacific/Kiritimati Australia/Lord_Howe; do
- echo "--- $tz"
- TZ=$tz node scripts/test-spaces-gantt.ts
- done
-
- - name: Magic notes evaluator (several timezones)
- # Two failure modes, and the second is what would make the feature worse
- # than not having it: a WRONG answer (silent, confident, in somebody's
- # notes), and an answer where there should be none — "Meet Ana at 3" is
- # a sentence. The parser must consume the whole line or return nothing.
- # Dates run in several timezones for the reasons journal.ts records.
- run: |
- for tz in UTC Europe/Berlin America/Los_Angeles Pacific/Kiritimati; do
- echo "--- $tz"
- TZ=$tz node scripts/test-spaces-calc.ts
- done
-
- - name: Trail, periods and progress charts (several timezones)
- # A trail row's key is a LOCAL day, so the whole bug class here is the
- # one the journal rig exists for. Kiritimati (UTC+14) and Niue (UTC-11)
- # bracket every hour where "which day is it" has two answers. The rest
- # of the rig is behavioural: it writes rows, draws the charts, and
- # asserts that a gap draws as a gap and never as a zero.
- # (Bundled: it reaches store.ts, whose imports are extensionless.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-trail.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-trail.mjs"
- for tz in UTC Europe/Berlin Pacific/Kiritimati Pacific/Niue; do
- echo "--- $tz"
- TZ=$tz node "$RUNNER_TEMP/test-spaces-trail.mjs"
- done
-
- - name: Spaces Markdown round-trip rig
- # The About dialog promises, in eight languages, that "a space is never
- # a dead end … every page exports as Markdown". This is that sentence,
- # checked: the starter space is exported and read back, and no page may
- # come back with materially less text than it went in with, nor may a
- # single block vanish entirely. Block TYPES are deliberately not
- # asserted here — Markdown has no toggle, media embed or board, so a toggle
- # leaving as a bullet is the format being honest, not a bug (the strict
- # rig below holds each type to its own bar).
- # (Bundled: the app's imports are extensionless.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-roundtrip.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-roundtrip.mjs"
- node "$RUNNER_TEMP/test-spaces-roundtrip.mjs"
-
- - name: Spaces Markdown strict rig
- # The round-trip rig above checks WORDS; this checks TYPES. Every
- # registered block type is exported and read back, and must return as
- # the same JSON (ids aside) and re-export to the same text — or be
- # PINNED with the reason Markdown cannot carry it yet. A pinned type
- # that starts to round-trip fails too, so closing a gap is a deliberate
- # edit to the rig. (Bundled: the app's imports are extensionless.)
- run: |
- slides/node_modules/.bin/esbuild scripts/test-spaces-md-strict.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-spaces-md-strict.mjs"
- node "$RUNNER_TEMP/test-spaces-md-strict.mjs"
-
- - name: Spaces model rig
- # Properties that fail SILENTLY, and that a shipped file cannot be
- # talked out of once it exists:
- # · the load contract — an unreadable document must never be replaced
- # by an empty one;
- # · format additivity, and id repair derived from the BYTES, so two
- # readers of one file agree on every id (links key on them);
- # · untrusted html is parsed INERT — a detached div still loads what
- # it creates, which made the sanitizer its own vector on the OPEN
- # path;
- # · opening a document touches no network, so a mailed space cannot
- # carry a tracking pixel;
- # · an encrypted space is never snapshotted to IndexedDB in the clear;
- # · find and replace quote ONE number — what is counted is what
- # changes.
- # The last four are source assertions: the behaviour needs a DOM, a
- # failing request, IndexedDB and a clock, but every one of those
- # mistakes is made in the source.
- run: node scripts/test-spaces-model.ts
-
- - name: spaces caret + nesting
- # Which seat an arrow key lands in, and what Tab resolves to. Caret
- # MOVEMENT needs a browser; the arithmetic under it does not, and the
- # arithmetic is where Tab-on-the-first-list-item was silently wrong.
- run: node scripts/test-spaces-caret.ts
-
- - name: Spaces chrome rig
- # Every spaces menu is the kernel's createMenu (through
- # spaces/src/menus.ts). This drives the BUILT shell with trusted CDP
- # input and asserts what spaces used to get wrong invisibly: arrow keys
- # in every menu, Escape with focus return, one menu open at a time, no
- # listener left on the document by a menu closed with Escape (one used
- # to close the NEXT overlay on its first click), no global shortcut
- # under a modal, and phone menus that end inside the screen with 44px
- # rows; and that a phone drawer, however it is shut, never becomes the
- # desktop panel preference once the window widens again. Needs the
- # shell built above; a skip in CI is a failure.
- run: node scripts/test-spaces-chrome.ts
-
- - name: spaces aliases and unlinked mentions
- # The assertions that matter in this one are the NEGATIVES: a page
- # title found inside a code block, an existing link, a bare URL or the
- # middle of a longer word must all produce NO mention, and a title full
- # of regex metacharacters must not throw. It also asserts that a name
- # surrounded by kana matches, which a `\b`-style boundary silently
- # never does — a rule built for English is a total failure in ja,
- # zh-Hans and zh-Hant rather than a partial one.
- run: node scripts/test-spaces-mentions.ts
-
- - name: Mermaid flowchart ⇄ diagram rig
- # spaces/src/diagram/: our own Mermaid flowchart parser and layered
- # layout (the mermaid library is megabytes and nothing is fetched at
- # runtime). Over a corpus of real README flowcharts: no overlapping
- # nodes, every connector end exactly where slides' syncConnectors puts
- # it, byte-identical snapshots, and mermaid → elements → mermaid
- # semantically equal. Hostile input (caps, __proto__ ids, script in
- # labels, pathological cycles) inside a time budget, and a size budget
- # (needs slides' esbuild, installed above).
- run: node scripts/test-diagram-mermaid.ts
-
- - name: spaces rig manifest
- # Bookkeeping, not a ninth run of the eight steps above. scripts/
- # test-spaces.mjs is the local entry point for the spaces suite (two of
- # those rigs cannot be handed to node directly, and running one by hand
- # produces a stack trace that reads like a broken product); this asserts
- # its list is still complete in both directions — every test-spaces-*
- # file on disk is listed there, and every rig it lists has a step in
- # this workflow. Both omissions are invisible: an unlisted rig never
- # runs locally, an unregistered one never runs here, and neither looks
- # like anything but green. test-spaces.mjs itself was unregistered from
- # the day it was written, which is how this check came to exist.
- run: node scripts/test-spaces.mjs --manifest
-
- # dash: the data app — same pipeline, same gate.
- - name: Install (dash)
- working-directory: dash
- run: npm ci
-
- - name: Typecheck (dash)
- working-directory: dash
- run: node_modules/.bin/tsc -b
-
- - name: Build single-file shell (dash)
- working-directory: dash
- run: npm run build:single
-
- - name: Splice conformance gate (dash)
- run: node scripts/shell-gate.mjs dash/dist-single/Bento_Dash.bento.html
-
- - name: Release channel rehearsal (dash)
- # Cuts a COMPLETE release — the real release.mjs, staged into a temp
- # directory — with a throwaway key this step generates and discards, and
- # then verifies the artifacts with kernel/src/update.ts itself, the code
- # every shipped file runs, with only the embedded public key swapped.
- # The point is the REFUSALS: a tampered manifest, a manifest signed for
- # another app, a downgrade replay and a one-bit-flipped shell must each
- # be rejected, and the conformance gate must refuse a shell whose doc
- # block closes its own script. A signing pipeline cannot be tested by
- # signing (the key never reaches CI), but this is everything except.
- run: node scripts/test-release-channel.mjs --app dash
- - name: Shell sizes
- # TWO MECHANISMS, DELIBERATELY. This one and the advisory PR build-size
- # comment (.github/workflows/pr-build-size*.yml) answer different
- # questions, and deleting either as "duplicate measurement" loses a
- # class of regression:
- #
- # this step — ABSOLUTE and PERSISTENT. A shell with enforce:true has
- # a ceiling and FAILS here; a shell with enforce:false prints its
- # drift from a committed `reference` and never fails. It is the only
- # thing that sees SLOW drift — forty merged commits at 300 B each,
- # where every single PR looked fine on its own.
- # the PR comment — RELATIVE and PER-PR. It reports this PR against its
- # own base and never fails. It is the only thing that attributes a
- # jump to the change that caused it, and it is blind to accumulated
- # drift.
- #
- # Neither subsumes the other. Rationale in docs/DECISIONS.md.
- #
- # Placed after ALL THREE builds on purpose: the rig skips a shell that
- # is not built, so while this sat in the spaces section it silently
- # measured nothing for dash. bento/spaces has NO CEILING as of
- # 2026-08-24 (the maintainer's call; at 98.6% it had started deciding
- # which fixes were affordable) — the step still prints its size and
- # drift, it just no longer fails on it.
- run: node scripts/test-spaces-size.mjs
-
- - name: Language pack verification rig
- # Packs come off the network, so the signature + hash-pin chain is the
- # only thing between a hostile channel and the strings in the UI.
- # Tampered pack, tampered index, unsigned index — each must be refused.
- run: node scripts/test-packs.ts
-
- - name: Tokenizer contract
- # The kernel's built-in highlighting tier. Renderers rebuild text from
- # the token stream, so losslessness is corruption-or-not; and multiline
- # tokens are declared, because a blockified token carrying \n collapses
- # a code block to one line with no error anywhere.
- run: node scripts/test-tokenize.ts
-
- - name: Code-morph identity engine
- # HeckelDiff decides which token on slide N is the same token as on
- # slide N-1; every wrong answer is a token that jumps, tears, or steals
- # another token's journey on screen. Regressions for the three pairing
- # bugs found in review ride along.
- run: node scripts/test-codediff.ts
-
- - name: Shared panel primitive rig
- # kernel/src/ui/panel.ts is the second UI primitive (after the menu):
- # the resizable, collapsible side panel three apps hand-rolled and a
- # fourth stubbed. Every check guards a piece of invisible behaviour each
- # app learned alone — the no-animation-during-drag class, the RTL widen
- # direction, a collapsed panel refusing to drag, per-viewer persistence
- # clamped on restore, the drawer that boots shut below a phone width —
- # plus the theming guard (every colour chain reaches a token each of the
- # four apps defines and themes). Each is mutation-caught.
- run: node scripts/test-ui-panel.ts
- - name: Shared dialog primitive rig
- # kernel/src/ui/dialog.ts is the tier-3 consolidation: the modal all
- # four apps build their About dialog on. The checks guard behaviour that
- # lived in one app or none — focus captured on open and restored to the
- # opener on close, a capture-phase document Escape that does not fall
- # through to the editor behind it, backdrop dismissal that a click on the
- # card does not trigger, and a real focus trap (Tab wraps in the card) —
- # plus listener cleanup and the shared theming guard. Each is
- # mutation-caught; none is visible to a developer with a mouse.
- run: node scripts/test-ui-dialog.ts
- - name: Shared tooltip primitive rig
- # kernel/src/ui/tooltip.ts — built ahead of a consumer (no app has a
- # hover tooltip; all four use native title=), so the checks pin the
- # contract chosen, not a behaviour found: shows after a delay on
- # hover/focus, hides on leave/blur/Escape, wires aria-describedby, does
- # not flash on a pointer passing through, and — the one that matters —
- # renders in document.body as a fixed element so no scroll container
- # clips it (hard-won detail 10). Behaviours mutation-caught; themed
- # through the shared guard.
- run: node scripts/test-ui-tooltip.ts
- - name: Shared toggle primitive rig
- # kernel/src/ui/toggle.ts — built ahead of a consumer (the three
- # "toggle"-named classes across the apps are a native checkbox, a
- # disclosure block and a button group; no shared switch). The checks pin
- # the contract chosen: a real role="switch" with aria-checked, a click
- # toggles and fires onChange, set() updates state WITHOUT firing
- # onChange, and it is a <button> so the platform gives it keyboard
- # activation. Behaviours mutation-caught; themed through the shared guard
- # (whose alias-indirection fix — a token defined as var(--other) is
- # themed iff --other is — landed here so dash's --chrome-2: var(--hover)
- # resolves).
- run: node scripts/test-ui-toggle.ts
- - name: Shared menu primitive rig
- # kernel/src/ui/menu.ts replaces four hand-rolled dropdowns, and what
- # differed between them was all INVISIBLE: three of the four apps
- # publish no aria-expanded at all, five of slides' eight dropdowns never
- # dismissed on an outside press, no app closed a menu on Escape or let
- # an arrow key move through one, and two apps added a document listener
- # per dropdown and removed none. Each of those is a check here, because
- # every one of them is a regression a sighted developer with a mouse
- # would never notice.
- run: node scripts/test-ui-menu.ts
-
- - name: First-page preview rig
- # Every save writes a static render of page one for file-manager
- # thumbnails. Two decisions in that path fail silently: an encrypted
- # deck must never carry one, and author content must never reach the
- # file carrying a script tag.
- run: node scripts/test-preview.ts
-
- - name: Encrypted-title rig
- # An encrypted file must not announce its subject in plaintext: the
- # <title> and the suggested download filename both used to derive from
- # the document title. Pins that encrypted output gets a generic title
- # and a neutral filename (source gate, always on), with a whole-file
- # scan where a DOM is present.
- run: node scripts/test-enc-title.ts
-
- - name: sidebar multi-select — a block move keeps order and carries states
- # Discussion #514. The unit is a parent with its states; the old
- # single-index splice left states behind, which this rig shows.
- run: node scripts/test-slides-multiselect.ts
-
- - name: presence toasts — said once per real arrival and departure
- # A hidden tab's heartbeat arrives once a minute, the room drops the
- # peer and the next beat brings them back: "left" / "joined" every
- # minute for everyone else. The grace and the quiet window are what
- # keep that silent; this rig runs them on a manual clock.
- run: node scripts/test-slides-presence-toasts.ts
-
- - name: Media autoplay rig
- # An author set a clip's Autoplay to Off and it played anyway, every
- # show, since media shipped in v0.9.16. render.ts wrote
- # data-autoplay="" when off — PRESENT but empty — and Reveal decides
- # autoplay with hasAttribute(), so it played what our own value-based
- # selector correctly ignored. The property pinned here is that an
- # autoplay-off element carries NO such attribute, because its presence
- # is read by code we do not own. Measured on rendered DOM: the
- # difference between assigning '' and not assigning is invisible to a
- # grep. Self-skips without Chrome.
- run: node scripts/test-media-autoplay.ts
-
- - name: Return-gate rig
- # The web demo always starts fresh, so someone who saved from
- # bento.page and came back saw a blank starter and read it as lost
- # work. The gate that fixes it can be worse than the silence it
- # replaces: firing over a real document, or offering a host that has no
- # release (telling an Android user to install a Chrome extension). This
- # pins both, and that the mobile rows degrade until those hosts ship.
- run: node scripts/test-return-gate.ts
-
- - name: Offline-mode rig
- # Offline mode promises "nothing leaves this computer" and was broken
- # five ways at once (GHSA-5c3x-xqp6-g94r): a manual update check, a
- # language-pack download, a deck's remote <video>, in-flight requests
- # that kept running, and a second tab's socket that kept syncing.
- #
- # It stayed hidden because it reads as correct: an agent asked to audit
- # it said "secure" from the docs AND from the code. So the rig does not
- # check the call sites — it enforces the POLICY that no file outside
- # kernel/src/net.ts may touch a network primitive at all, which is what
- # stops the NEXT call site being wrong, plus the chokepoint's own
- # behaviour (refusal, aborting what is already in flight, cross-tab).
- run: node scripts/test-offline.ts
-
- - name: Origin-trust rig
- # The release-manifest / sync / pack URL dev overrides live in
- # localStorage, which is shared across all file:// documents — so they
- # are honoured only from a real, isolated origin (sharedStorageOrigin).
- run: node scripts/test-origin-overrides.ts
-
- - name: Embed element rig
- # The `embed` element (docs/DECISIONS.md 2026-08-19 shape): the static
- # view always paints through the svg sanitiser; a live sandboxed frame
- # exists only online with the offline switch off, and drops back to
- # the view on error. Node half plus headless Chrome with a request log.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-embed.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-embed.mjs"
- node --no-warnings "$RUNNER_TEMP/test-embed.mjs"
-
- - name: File-open / boot document gate rig
- # Opening a foreign .bento.html and booting a directly-opened file run
- # bare parseDoc -> render + injectFonts with no structural gate, exposing
- # the document-level egress the element sanitiser never sees: a
- # slide.background url(), an -face src from an external asset value,
- # a weight/style src-breakout. Positive controls (raw) fetch; the opened
- # document reaches the request log zero times; unknown keys/props from a
- # NEWER deck survive (format additivity). Browser half needs Chrome.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-fileopen-gate.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-fileopen-gate.mjs"
- node "$RUNNER_TEMP/test-fileopen-gate.mjs"
-
- - name: Untrusted-markup sanitizer rig
- # Every deck is untrusted input somebody may open, paste or receive over
- # collab, and script in that page owns the collab keys, the plaintext
- # autosave store and the write handle to the file on disk. An audit
- # measured `<svg onload>`, a rect `onclick`, `<img onerror>` in a
- # foreignObject and `<form action="javascript:">` all executing.
- #
- # The sanitizer is an ALLOWLIST, so what this pins is the DEFAULT: the
- # first version was a denylist that passed 40 checks with the critical
- # still open, because the rig tested call sites with source regexes
- # instead of the policy. These checks drive the real walk, and the
- # browser half needs Chrome — it self-skips where there is none, so the
- # node half still gates.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-sanitize.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-sanitize.mjs"
- node "$RUNNER_TEMP/test-sanitize.mjs"
-
- - name: Replace-from-JSON document gate rig
- # The document text that arrives through window.bento.loadDoc and
- # "Replace from JSON…" is foreign input, full or compact. It passes the
- # structural gate (restoregate.ts sanitizeDoc): the open deck keeps its
- # identity (docId, collab, readonly), unknown keys/props are dropped, and
- # the document-level egress surfaces the element sanitiser never sees —
- # slide.background url(), an @font-face src resolved from an external
- # asset value, a weight/style src-breakout — are neutralised. Positive
- # controls (raw, un-gated) fetch; the gated document reaches the request
- # log zero times. Browser half needs Chrome; it self-skips otherwise.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-replace-json-gate.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-replace-json-gate.mjs"
- node "$RUNNER_TEMP/test-replace-json-gate.mjs"
-
- - name: Export-secrets rig
- # "Copy document JSON" shipped the room's owner private key while the
- # tooltip recommended pasting it into an AI chat, and "Save as
- # template…" wrote plaintext out of a password-protected deck. Both are
- # invisible in the product: the file looks right. This scans the source
- # for the two shapes — an export that forgets to strip collab secrets,
- # and a user-facing path that reaches serializeFile instead of
- # serializeAuto — so a NEW export path cannot reintroduce either.
- run: node scripts/test-export-secrets.ts
-
- - name: bento check rig (browser)
- # scripts/bento-check.mjs is the closing half of an agent's loop: load
- # a deck in headless Chrome and report what validate() finds, with
- # element ids and paths, plus one PNG per slide through #480's render
- # path and a contact sheet. The rig drives it as a child process on
- # the built shell: a deck with an overflowing box and an off-canvas
- # rect names both; --json, --png, exit codes; a compact document is
- # refused in plain words on a shell without compact input. Self-skips
- # only OUTSIDE CI where Chrome or the shell is missing.
- run: node scripts/test-bento-check.ts
-
- - name: Blob content-address rig
- # Encrypted assets are fetched by content address from a relay the
- # threat model treats as untrusted. Nothing verified that what came
- # back matched what was asked for, and the substitution was cached to
- # disk, so one poisoned response persisted.
- run: node scripts/test-blobs.ts
-
- - name: home/ios bridge rig
- # The iOS host opens ANY self-contained HTML document and treats those
- # documents as mutually untrusted, so a page-supplied filename reaching
- # appendingPathComponent was an arbitrary write inside the container —
- # including over another deck the user would later open and trust.
- # Source-shape checks; the Swift half self-skips without a toolchain.
- run: node scripts/test-home-bridge.ts
-
- - name: home launch handle rig
- # A page in a native host held no file handle until its first save, so
- # autosave never wrote the file. home/bridge.js now hands it over through
- # launchQueue — lazily, so documents from older runtimes keep their first
- # silent save — and a launch request the host cannot meet is refused,
- # never turned into an export. Runs the real bridge against a fake host.
- run: node scripts/test-home-launch.mjs
- - name: home per-document store rig
- # The shared bridge relays the kernel's per-document store
- # (kernel/src/docstore.ts) to a native host, which keeps the recovery
- # copy and the member key out of the page's own web storage. Driven end
- # to end here: the real bridge, the real kernel client, a fake host. It
- # proves the store appears ONLY when the native side declares it — a
- # store advertised and then refused would lose the member key on every
- # reload — and that bytes round-trip as a Uint8Array the kernel accepts.
- run: node scripts/test-home-docstore.mjs
- - name: home legacy-origin inspector rig
- # Before an Android document adopts the storage it used under the old
- # per-path origins, an inspector page reports which documents own data
- # there. This runs that script as it ships (extracted from
- # DocumentOrigin.kt) against kernel-shaped storage: every app's autosave
- # attributed, bento-handles by key, and anything it cannot tie to a
- # document — including bento-blobcache, which holds plaintext media —
- # refusing adoption. The JVM tests cover the decision; only this covers
- # the script.
- run: node scripts/test-home-inspector.mjs
-
- - name: tray mark is one source
- # tray-icon.svg is the only drawing of the mark. Everything else is
- # generated from it: the Android launcher vectors (which have no <rect>,
- # so each rounded corner becomes opaque path data nobody would diff), and
- # the iOS asset catalog — the mark plus the four brand colours the app's
- # chrome reads by name. A hex value retyped into Swift is a value that can
- # disagree with the logo while looking almost right, which is the kind of
- # wrong nothing notices. This fails if any of it drifts.
- run: node home/assets/make-icons.mjs --check
-
- - name: home/ios index rig
- # The iOS text extractor is a PORT of home/webext's, and the two are held
- # together by nothing but agreement — so this diffs them, driving the
- # real library.js against the compiled Swift over generated edge cases
- # and every document in the tree. A divergence means a deck is findable
- # by a phrase on one host and not the other, which nothing else notices.
- # This one really runs HERE: BentoIndex.swift is Foundation-only, and the
- # runner has Swift, so the diff happens on every push rather than only on
- # a Mac. That is the payoff for keeping UIKit out of that file.
- run: node scripts/test-tray-index.mjs
-
- - name: document index conformance corpus
- # home/fixtures/ is the corpus all three hosts answer — the JS reference
- # here, the Kotlin port under Gradle, the Swift port in the rig above.
- # This is the JS side of it, and it is the reference the other two are
- # diffed against, so a break here is a break in the thing they agree
- # with. It went unregistered and then unnoticed: the tray→home rename
- # left it importing ../tray/doc-index.mjs, and a rig nobody runs cannot
- # report its own import failure.
- run: node scripts/test-doc-index.mjs
-
- - name: home/ios release verifier rig
- # Starter decks are not bundled; a new document is FETCHED from the
- # signed release channel and written to disk as an executable page. The
- # signature and hash checks are what make that acceptable, so this proves
- # the verifier REFUSES — tampered payload, tampered signature, a real
- # signature over different bytes, no signature at all. Watching it accept
- # the live manifest proves nothing: `return true` passes that test.
- # Unlike the index rig above this CANNOT run here — CryptoKit is
- # Apple-only — so it probes for that module (not for swiftc, which the
- # runner has) and skips loudly. A Mac must run it before Releases.swift
- # changes.
- run: node scripts/test-tray-releases.mjs
-
- - name: home/ios origin identity rig
- # Which storage origin a document runs in. It used to be a hash of the
- # file's path, so a different file that later took the same path read
- # the previous one's recovery copy and member key. The origin follows the
- # file's document identifier now; this compiles the real OriginIdentity
- # and checks every rule. CryptoKit only, so it skips off Apple platforms.
- run: node scripts/test-home-origin.mjs
-
- - name: home/ios docstore rig
- # The host's per-document store: this device's collab member private key
- # in the Keychain, the recovery copy in an app-private file, partitioned by
- # the document's origin. Compiles the real HostDocStore; skips off Apple.
- run: node scripts/test-home-docstore-ios.mjs
-
- - name: home/ios bento/connect keys rig
- # The agent's keys: the account key, the Secure Enclave routine and consent
- # keys, raw low-S signatures (verified in WebCrypto), never minting over a
- # store it could not read, and the §29 biometric-enrolment notice outbox.
- # Apple toolchains only; skips elsewhere.
- run: node scripts/test-home-id-keys.mjs
-
- - name: home/ios bento/connect statements rig
- # The Swift statements against kernel/fixtures/identity-v1.json: verdict
- # and reason on every row, round trips, tampering, transcripts, low-S,
- # purposes, addresses, spendCalled and the frozen display table.
- run: node scripts/test-home-id-statements.mjs
-
- - name: home/ios bento/connect agent rig
- # sign() routing and the host-stamped consent statement (§2e (A)): what
- # the page can name, what only the host stamps, and the verifier refusing
- # a relay, replay, payload swap or docId swap.
- run: node scripts/test-home-id-agent.mjs
-
- - name: home/ios bento/connect recovery rig
- # Argon2id (ours: RFC 9106, Node's native one on random inputs) and every
- # byte of kernel/fixtures/recovery-v1.json: the recovery code, derivations,
- # both key blobs, and recovered scalars checked through CryptoKit. Apple only.
- run: node scripts/test-home-id-recovery.mjs
-
- - name: home/ios Spotlight rig
- # What the system search index holds for a document and keeping it current
- # after a save: replaced at once, delete-before-add when sealed, and
- # entries removed for documents a walk no longer finds. Apple only.
- run: node scripts/test-home-spotlight.mjs
-
- - name: WebExtension package rig
- # Validates the store package without writing it: every file the
- # manifest names exists, every icon is the size it claims, no unexpected
- # file is about to ship (probe/ is four capability probes — harmless to
- # us, alarming to a reviewer), and no permission is declared but unused.
- # A listing rejected for a missing 128px icon costs days of review.
- run: node scripts/pack-webext.mjs --check
-
- - name: WebExtension background rig
- # The half that WRITES, and previously the untested half. Two properties
- # it must hold: the target file comes from sender.url (browser-stamped)
- # and never from the page, and nothing is carried between messages,
- # because an MV3 service worker is evicted mid-save and state across that
- # gap fails intermittently on nobody's machine but the user's.
- run: node scripts/test-webext-background.ts
-
- - name: WebExtension bridge rig
- # home/webext decides, per save, whether to write in place or hand back
- # to the browser's own picker. Wrong in the permissive direction it
- # overwrites the open document with no dialog — which it did once. The
- # decision is pure logic over an options bag, so it is checkable here
- # rather than by reloading an extension and pressing Cmd-S.
- run: node scripts/test-webext-bridge.ts
-
- - name: WebExtension route rig
- # Turning an absolute path into "where this granted folder lives", from
- # paths the extension did not choose — browser history, for files that
- # may have moved or never been in a grant at all. Getting it wrong does
- # not produce a broken link; it records a folder at the wrong place and
- # every document in it silently opens something else. So it must prove,
- # never guess: the route resolves inside the grant AND dir.resolve()
- # agrees with the path's own tail.
- run: node scripts/test-webext-route.ts
-
- - name: WebExtension document-library rig
- # The popup is a document browser, and everything in it is DERIVED from
- # files on disk: the title out of the document block, the thumbnail out
- # of the preview block, the openable path out of a learned prefix. Each
- # is a parse against a format that moves, and each fails quietly — a row
- # showing a filename instead of a title, or a blank square. Nothing
- # throws, so nothing reports it.
- #
- # Runs AFTER the slides build on purpose: it reads the real shell, and
- # with a document spliced in at the real offset. Hand-written fixtures
- # would have passed the bug this replaces, where a metadata reader hunted
- # for the document block's CLOSING tag and so found nothing in any
- # document carrying an image.
- run: node scripts/test-webext-library.ts
-
- - name: WebExtension release-trust rig
- # Creating a document downloads an app shell and writes it to the user's
- # disk, where they later double-click it — executable HTML they go on to
- # trust. So the manifest's signature is checked against the key compiled
- # into the extension, and the download against the digest that signature
- # covers. Signature over the pin, pin over the bytes.
- #
- # It also reads a REAL manifest captured from the release origin, which
- # is the check that could not be faked into passing: the shipped code
- # read `url` off the top level of a SIGNED ENVELOPE that has no top-level
- # url, so the + button had never worked in any version — and the rig
- # agreed, because its fixture was written to the shape the code wanted.
- run: node scripts/test-webext-release.ts
-
- - name: WebExtension update-notice rig
- # Store installs update themselves; one loaded unpacked never will, and
- # Chrome ignores update_url for a development install. So the GitHub
- # route has to be told — and told in exactly one direction: a store user
- # must never see a notice they cannot act on, and must not even cost a
- # request. Every failure mode here is silent by nature.
- run: node scripts/test-webext-update.ts
-
- - name: WebExtension placement rig
- # A granted folder has no path; the library can only open a document
- # by its file:// URL. Placement GUESSES paths and PROVES one by bytes
- # and by the grant itself — the property that matters is that a wrong
- # guess (same name, other bytes; same bytes, a copy elsewhere) is never
- # recorded. Also the title card drawn for a document with no preview.
- run: node scripts/test-webext-place.ts
-
- - name: WebExtension file-grant rig
- # Saving in place for a document outside every granted folder: a
- # per-file handle the extension holds, the downloads API for Downloads,
- # the one-time offer. Each must write only the sender's own file, use a
- # handle only when proven to be that file (name and bytes), and fail to
- # the browser's own picker — never to nothing.
- run: node scripts/test-webext-filegrant.ts
-
- - name: WebExtension save-as rig
- # "Save a copy" and exports answered in the extension's own window, so
- # they can land beside the document. The page supplies a name, never a
- # place; a write lands only where the person chose and only for the
- # document that asked; a beside-name is never a path or the original.
- run: node scripts/test-webext-saveas.ts
-
- - name: WebExtension DocStore rig
- # A document's crash recovery and member key live in the extension's
- # origin, partitioned by the file path the browser reports. One document
- # must never reach another's entries, a payload must never name a
- # partition, and a moved file's recovery follows it only when the old
- # path is gone (seen through a grant) and the content hash matches; the
- # member key never follows.
- run: node scripts/test-webext-store.ts
-
- - name: WebExtension bento/id rig
- # The extension's statement code must be the kernel reference, unaltered
- # (a generated type-strip, checked current), and must pass the whole
- # conformance contract in kernel/fixtures/identity-v1.json. The
- # passkey-wrapped account key must fail closed for the wrong passkey,
- # credential or binding; the recovery code is 80 random bits.
- run: node scripts/test-webext-id.ts
-
- - name: WebExtension localisation rig
- # Every failure mode of a message catalogue is silent: a key the code
- # uses but English lacks renders as the key name, a locale missing a key
- # falls back so a German page carries English sentences, and a dropped
- # $1 leaves a hole in a translated sentence. All of them are visible
- # only to someone who reads that language.
- run: node scripts/test-webext-i18n.ts
-
- - name: WebExtension assistant rig
- # The Assistant is extension-only: the page holds no key, so what the
- # extension ACCEPTS decides the feature. A frame from an iframe on a
- # slide, a page the user never allowed, an abort naming another tab's
- # turn, a describe or an error that echoes the key or the endpoint —
- # every one of those is silent in a browser and loud here.
- run: node scripts/test-webext-assistant.ts
-
- - name: Save-intent rig
- # A host polyfilling showSaveFilePicker sees only the options bag, and
- # must tell "overwrite the open document" from "make a second file" from
- # that alone. It could not, and a browser extension overwrote a deck.
- # `id` is the signal; if the three purposes ever collapse to one value
- # every host silently loses the distinction.
- run: node scripts/test-savepurpose.ts
-
- - name: Remember-the-file-handle rig
- # A deck in ~/Documents or ~/Downloads can never be covered by a
- # directory grant (Chrome's blocklist), so it re-ran the save picker on
- # every reopen. The FILE handle is remembered (IndexedDB by docId) and
- # reconnected with a permission prompt inside the save gesture. Guards:
- # name-match, denied/NotFound -> picker + drop, only a real handle (never
- # a host polyfill), reconnect BEFORE serialize so activation stays fresh.
- run: node scripts/test-file-handle.ts
-
- - name: DocStore (per-document storage under the extension)
- # Under bento/home, the crash-recovery copy and the member key's private
- # half live in the extension's per-document store; localStorage keeps
- # only the public key its readers need. No host, or a host that refuses
- # or never answers: the old storage, unchanged.
- run: node scripts/test-docstore.ts
-
- - name: Guarded storage rig
- # localStorage's absence is hostile: reading the PROPERTY throws, so
- # `if (localStorage)` is itself the crash and one bare read at module
- # scope takes the whole file down before it paints. Measured in a
- # sandboxed iframe. The rig simulates each failure mode and pins the
- # regression: importing a module that reads storage on load must not
- # throw when storage does.
- run: node scripts/test-storage.ts
-
- - name: Save queue rig
- # kernel/src/savequeue.ts serializes writes against one file handle and
- # acknowledges each by revision, so an edit made WHILE an async write is in
- # flight is never marked saved and lost (the setDirty-after-write race
- # every app had). The rig pins serialization, the detached snapshot,
- # isCurrent() going stale on any later edit or same-id replacement, the
- # document-swap discard, and that a failed write never poisons the queue.
- run: node scripts/test-savequeue.ts
-
- - name: App registry rig
- # scripts/apps.mjs drives what a release builds, stages and signs. A
- # release SIGNS, and the key never reaches CI, so the pipeline itself
- # cannot be tested here — but the registry drifting from the tree can,
- # and a wrong appId is silent: shipped shells verify it against their
- # own configureApp() id and just stop updating.
- run: node scripts/test-release-apps.mjs
-
- - name: Autosave per-app database rig
- # Every app shared one IndexedDB database AND one DB_VERSION, so spaces
- # has been writing into slides' store, and a version bump by any new app
- # would make every SHIPPED shell of every other app throw VersionError
- # and lose autosave. Renaming without carrying the data over would empty
- # a visible feature, so the migration is tested in both directions.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-autosave.ts --bundle --platform=node --format=esm \
- --alias:fake-indexeddb/auto=./slides/node_modules/fake-indexeddb/auto/index.js \
- --outfile="$RUNNER_TEMP/test-autosave.mjs"
- BENTO_TEST_APP=bento-slides node "$RUNNER_TEMP/test-autosave.mjs"
- BENTO_TEST_APP=bento-spaces node "$RUNNER_TEMP/test-autosave.mjs"
-
-
- - name: The plaintext store refuses while sealed (bento/connect backstop)
- # kernel/src/autosave.ts: while the body is sealed (password or identity
- # seal), putRecovery/addVersion refuse and getRecovery/listVersions offer
- # nothing, so an app missing one of its own guards still can't write or
- # offer plaintext. The purge (clearRecovery/clearVersions) still works
- # while sealed, for that document only.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-store-backstop.ts --bundle --platform=node --format=esm \
- --alias:fake-indexeddb/auto=./slides/node_modules/fake-indexeddb/auto/index.js \
- --outfile="$RUNNER_TEMP/test-store-backstop.mjs"
- node "$RUNNER_TEMP/test-store-backstop.mjs"
-
- - name: Publish deletion-gate rig
- # A publish assembles site/ for ONE app and mirrors it authoritatively.
- # Measured: a spaces-shaped site/ deleted 47 live files — the signed
- # shell, the manifest, all 22 packs — with every other gate green,
- # because those gates are `if (existsSync(...))` and skip when the
- # artifact is missing. Shipped files cannot recover from that.
- run: node scripts/test-publish-gate.mjs
-
- - name: Model key tables match the format
- # slides/src/modelkeys.generated.ts is derived from model.ts and drives
- # validate()'s unknown-key check. A stale copy would report real
- # properties as unknown, and an agent acting on that deletes working
- # configuration — so the generated file is committed and pinned here.
- run: node scripts/build-modelkeys.mjs --check
-
- - name: Schema is current
- # schema/slides.json is generated from the gate's tables
- # (slides/src/schema.ts via scripts/build-schema.mjs) and published at
- # bento.page/schema/slides.json; a stale file would describe a format
- # the runtime does not accept, so the committed copy is pinned here.
- run: node scripts/build-schema.mjs --check
-
- - name: Document schema rig
- # one source (file == buildSchema == window.bento.schema()); schema
- # keys == gate keys per type; the starter deck validates and a typo
- # does not; $schema is stripped on load and accepted by the 1.1.0 and
- # main parseDoc (frozen); the URL is never fetched.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-slides-schema.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-schema.mjs"
- node "$RUNNER_TEMP/test-slides-schema.mjs"
-
- - name: Document validation rig
- # validate() is only useful if it is trusted: the rig proves the starter
- # deck and a realistic chart stay silent, and that a deliberately broken
- # deck trips every check.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-validate.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-validate.mjs"
- node "$RUNNER_TEMP/test-validate.mjs"
-
- - name: bento/dash model rig
- # The format is permanent — additive forever, no server to migrate a
- # single file. Two failures are unrecoverable once files exist: dropping
- # a field this build does not recognise, and letting anything but an
- # ABSENT block reach the starter document (which then overwrites live
- # data on the first save). Both are asserted from both sides.
- run: node scripts/test-dash-model.ts
-
- - name: bento/dash store + undo rig
- # Undo is a patch log rather than document snapshots, which buys history
- # that costs what the EDIT costs — and risks a failure a snapshot cannot
- # have: an inverse that does not restore what it displaced. Every op is
- # checked apply → undo → identical, because that failure is silent.
- run: node scripts/test-dash-store.ts
-
- - name: bento/dash import rig
- # Import is where a data tool does its damage, because every mistake is
- # SILENT: the file opens, the grid fills, the totals compute, and the
- # numbers are wrong. Two guards matter most and are checked from both
- # sides — an undecidable date order is REFUSED rather than guessed, and
- # the decimal convention is decided per COLUMN from the whole column.
- run: node scripts/test-dash-import.ts
-
- - name: bento/dash formula rig
- # A wrong number is the worst failure a spreadsheet has, and the
- # dangerous ones are plausible rather than loud: an error that becomes a
- # zero, a cycle that resolves to something, a column computed before the
- # column it depends on. All three are asserted, each with a control.
- run: node scripts/test-dash-formula.ts
-
- - name: bento/dash chart rig
- # A tile names columns and derives its series at render, so the whole
- # surface worth testing is the derivation. The failure that matters most
- # is a missing value drawn as a zero — "we sold nothing" instead of "we
- # do not know".
- run: node scripts/test-dash-chart.ts
-
- # ── the rest of bento/dash. Each of these asserts a way a spreadsheet can
- # be CONFIDENTLY WRONG, which is the failure that matters here: nobody
- # re-derives a number by hand, so a wrong one is not caught by the person
- # relying on it. Each rig argues its own case in its header; the lines
- # below say why it gates a merge.
- - name: bento/dash function pack
- # Lookups, multi-criteria, finance, statistics — including the three
- # places we deliberately depart from Excel because Excel's default is a
- # trap: an approximate VLOOKUP on unsorted data, an IRR that converges
- # on nothing, a PERCENTILE that clamps instead of refusing.
- run: node scripts/test-dash-functions.ts
-
- - name: bento/dash cell formulas
- # Evaluation ORDER. A cell computed before the cell it reads writes a
- # stale number into the document, looking authoritative.
- run: node scripts/test-dash-cellformula.ts
-
- - name: bento/dash A1 references
- # `$` pins against a COPY and not against structure, and a reference
- # into a deleted row is #REF! rather than whatever slid up into it.
- run: node scripts/test-dash-a1.ts
-
- - name: bento/dash defined names
- # A name is a redirection, and every way it can go wrong reports a
- # NUMBER: substituted inside quoted text or after a sheet's `!`,
- # outranking a column of the same name, spelled like a cell address and
- # therefore never consulted, or DROPPED when its rows are deleted
- # instead of becoming #REF!. Ends by mounting the real grid, because an
- # engine the app never passes the name table to is invisible.
- run: node scripts/test-dash-names.ts
-
- - name: bento/dash array formulas and spill
- # A spilled cell is COMPUTED, not stored: it must never reach the file,
- # a collision must BLOCK with #SPILL! rather than overwrite, two spills
- # wanting one cell must pick the same winner on every machine, and the
- # shape must survive the operators (2×3, not 6×1 — the wrong answer is
- # right in the only cell anybody checks). Datasets deliberately do not
- # spill; a column formula is the columnar answer to the same need.
- run: node scripts/test-dash-spill.ts
-
- - name: bento/dash cross-sheet references and what row 1 means
- # Both halves of one boundary. A per-CELL formula reaches another sheet
- # from EITHER kind of sheet — it used to work on a spreadsheet and
- # answer #REF! on a dataset in the same workbook, which was two call
- # sites rather than a decision. A COLUMN formula still may not, and now
- # names the boundary instead of calling a sheet in the tab strip an
- # unknown name: reaching across is either a position that moves or a
- # join with no key, and dash has `join`. Then the trap underneath: an A1
- # row is the row the addressed sheet paints in its own gutter, so a
- # dataset's row 1 is its first DATA row and a spreadsheet copy of it is
- # one lower — safe only because the conversion shifts LOCAL references
- # and leaves QUALIFIED ones alone. That last one is measured against
- # both sheets, because it is the part that would rot in silence.
- run: node scripts/test-dash-xsheet.ts
-
- - name: bento/dash pivot
- # Subtotals are COMPUTED, not summed: an average of averages is a
- # different number, and a distinct count does not add up.
- run: node scripts/test-dash-pivot.ts
-
- - name: bento/dash dashboard
- # Cross-filter selections compose, and the categories of a column
- # PARTITION the sheet — no row dropped, none counted twice.
- run: node scripts/test-dash-dashboard.ts
-
- - name: bento/dash data story
- # A gap tweens as a gap. Interpolating an absent quarter through zero is
- # the animation telling a lie about the data.
- run: node scripts/test-dash-story.ts
-
- - name: bento/dash filter and sort
- run: node scripts/test-dash-filter.ts
-
- - name: bento/dash filtering is REACHABLE
- # The engine rig above proves sixteen predicates over an order vector;
- # the app used to offer ONE of them per column — a free-text "Contains"
- # box you had to already know the answer to spell into. This one drives
- # the column menu over a real DOM: it opens the value checklist on a
- # mounted grid, CLICKS a checkbox, and asserts the row indices
- # `store.order` ends up holding — plus that a truncated list never
- # pre-ticks itself, that a column's list honours the other columns'
- # filters and not its own, and that none of it dirties the document.
- run: node scripts/test-dash-filterui.ts
-
- - name: bento/dash rows and columns
- # Structure, and the rid watermark — a rid must never be minted twice,
- # which is collaboration's correctness precondition.
- run: node scripts/test-dash-rowcol.ts
-
- - name: bento/dash selection and clipboard
- run: node scripts/test-dash-select.ts
-
- - name: bento/dash data entry through the real editor
- # Widget⇥12⇥4.50⏎ has to come home to column A. select.ts had the
- # Tab-run model and test-dash-select.ts proved it; the editor's finish()
- # never called it. This one drives typeInto + the cell's own onkeydown.
- run: node scripts/test-dash-entry.ts
-
- - name: bento/dash cross-sheet structure
- # Insert a row on Pipeline and =SUM(Pipeline!D1:D8) on Scratch has to
- # widen. a1.ts had the scope rule; Grid.shiftFormulas walked one sheet.
- run: node scripts/test-dash-xshift.ts
-
- - name: bento/dash sharing state
- # Start/stop/rotate sharing mark the workbook unsaved (a rotation is
- # revocation and must reach the file); only a writer copy offers write
- # auth or calls itself an Editor — an allowlist, failing closed.
- run: node scripts/test-dash-share-dirty.ts
-
- - name: bento/dash sync inbound
- # A peer cannot set this copy's room, docId, readonly, template,
- # format, version or policy — by relay op, by snapshot, or by a frame
- # injected on the same-origin BroadcastChannel.
- run: node scripts/test-dash-sync-inbound.ts
-
- - name: bento/dash room snapshot and inbound fields
- # A dash room snapshot carries no never-synced field (collab first); a
- # remote op or snapshot can't adopt one; no prototype-shaped name off the
- # wire reaches any object, and a prototype-named actor can't throw.
- run: node scripts/test-dash-snapshot-collab.ts
-
- - name: bento/dash save race (kernel SaveQueue)
- # The unsaved dot goes out only for the revision that was written; a
- # dropped file's handle swap waits for the write in flight; an in-place
- # update stops the old shell from writing again. Each guard is
- # sabotaged in the PR that introduced it; the rig carries two controls
- # that reproduce the bugs without the guard.
- run: node scripts/test-dash-save-revisions.ts
-
- - name: bento/dash conditional formatting
- run: node scripts/test-dash-condfmt.ts
-
- - name: bento/dash conditional formatting is REACHABLE
- # The engine rig above passes on six rule kinds; the app used to build
- # two of them, so "highlight cells greater than N" was missing from a
- # product that had already shipped it. This one drives the panel section
- # with panels.ts's own KIT over a real DOM and asserts the rule OBJECT
- # that would reach the document — plus that the menu and the panel
- # actually mount it, which is what makes the rest of it visible.
- run: node scripts/test-dash-condfmtui.ts
-
- - name: bento/dash a formula column is typed by what it returns
- # It used to be born `number`, hardcoded: a formula splitting surnames
- # out of "Lastname, Firstname" produced a NUMBER column of text that
- # filtered, sorted, exported and totalled wrongly. Inference is by the
- # JS type of the computed values, never their appearance — a numeric
- # STRING typed number is the SUM 0 bug (test-dash-coltype.ts) arriving
- # by a new door, and that is asserted by name.
- run: node scripts/test-dash-computedtype.ts
-
- - name: bento/dash paste special
- # Values only must land the COMPUTED value and NEVER an error object —
- # the same class of damage scripts/test-dash-fill.ts records, reached
- # from the other side. Also: formats-only cannot move a number (the
- # column is summed before and after), a copied formula's relative refs
- # translate while $A$1 does not and a CUT one does not translate at
- # all, and transpose is REFUSED on a dataset because its columns are
- # typed. Last section reads main.ts: the chord must reach the command,
- # and the clip must be snapshotted BEFORE ⌘X clears the selection.
- run: node scripts/test-dash-pastespecial.ts
-
- - name: bento/dash text to columns
- # The split reuses import.ts's delimiter parser and its type inference,
- # so "Smith, John" quoted stays one field and an undecidable date
- # column lands as TEXT rather than eleven months out. The overwrite is
- # named before it happens. And the outcome is checked in the DOCUMENT:
- # patches are committed to a real Store, the source column survives,
- # and re-running the recorded step reproduces the same bytes.
- run: node scripts/test-dash-tocolumns.ts
-
- - name: bento/dash side panels
- run: node scripts/test-dash-panels.ts
-
- - name: bento/dash panel rhythm
- # The panel's spacing has been reported broken three times. This pins
- # the numbers — one row height, one pitch, one gutter, one radius — and
- # refuses a second spelling of any of them, so the next drift is a build
- # failure rather than a fourth screenshot.
- run: node scripts/test-dash-panelrhythm.ts
-
- - name: bento/dash About dialog
- run: node scripts/test-dash-about.ts
-
- - name: bento/dash dialog surfaces
- # The About dialog held eight sections and measured 1361px in a 429px
- # viewport — 3.2 screens. It is two surfaces now (About = what travels
- # in the file; Settings = what this reader's browser remembers) plus the
- # password, which moved to the Save menu with the other instructions
- # about how the file gets written. This holds the seam AND the size:
- # each surface fits a laptop screen without scrolling, measured through
- # a box model of about.css calibrated against that 1361px.
- run: node scripts/test-dash-surfaces.ts
-
- - name: bento/dash thumbnail preview
- # An encrypted workbook NEVER gets a preview — a plaintext title beside
- # the ciphertext is the leak the password exists to prevent.
- run: node scripts/test-dash-preview.ts
-
- - name: convert engine rigs
- # The pptx importer's resolver is where real decks' fidelity lives --
- # 91% of colour and 71% of run properties are indirect, and every hop
- # fails silently (a backwards clrMap still renders, just dark-on-dark).
- # Negative controls proven against mutated implementations; load.ts is
- # the gate that matters for import: every emitted document must pass the
- # REAL slides parseDoc with zero validateDoc errors. The runner also
- # covers the `bento convert` CLI (it needs the shell built above and
- # Chrome for "it opens"; neither may skip in CI), the delivery chain
- # behind bento.page/import (signature, pin, version floor, untrusted-
- # input gate, zip limits, exactly two requests), the built page's CSP,
- # and the boundary: no app imports convert/, and the engine touches no
- # DOM global.
- run: node scripts/test-convert.ts
-
- - name: bento/dash zip
- # Verified against real unzip implementations, not only our own reader:
- # a reader and a writer that share a bug agree with each other perfectly.
- run: node scripts/test-dash-zip.ts
-
- - name: zip decompression-bomb cap
- # readZip caps each entry's inflated output at min(declared size, a hard
- # ceiling), aborting the stream the instant it overflows — a crafted
- # archive that under-declares its size can no longer exhaust memory before
- # the size check runs. Every check is mutation-proven against a neutered cap.
- run: node scripts/test-zip-bomb.ts
-
- - name: bento/dash xlsx
- # Both 1900 date epochs, including the leap-year bug — getting it wrong
- # shifts every date by four years, silently.
- run: node scripts/test-dash-xlsx.ts
-
- - name: bento/dash xlsx — what an import carries and what it says it dropped
- # The gate that lost a number: `=SUM(RentCells)/B5` has no `!`, no `[`
- # and no unknown function, so a bare defined name sailed through and
- # the cell painted #NAME? over the 0.61 Excel had computed. Also pins
- # the header-under-a-merged-title repair, and the freeze, per-cell
- # format and Excel-table totals row that used to be dropped in silence.
- # Builds real .xlsx bytes — the gate only ever sees real formula text.
- run: node scripts/test-dash-xlsx-carry.ts
-
- - name: bento/dash WebGL
- run: node scripts/test-dash-gl.ts
-
- - name: bento/dash 3D scenes
- run: node scripts/test-dash-viz3d.ts
-
- - name: bento/dash CRDT convergence
- # The big one: randomised concurrent edits across N replicas, asserted
- # to converge. It has caught every ordering bug in the engine, and the
- # two it did not catch were found by widening it.
- run: node scripts/test-dash-sync.ts
-
- - name: dash spreadsheet convergence rig
- # The SPREADSHEET kind's own rig, separate from the dataset one because
- # it is a different convergence problem: a dataset row has a rid, and a
- # spreadsheet cell has only its address. It also pins the snapshot
- # FALLBACK — a patch that would move cells must mint zero ops and arm
- # the whole-state path, because two replicas shifting addresses
- # concurrently renumber each other's writes and no ordering repairs it.
- run: node scripts/test-dash-canvassync.ts
-
- - name: relay protocol — one wire format, two clients
- # dash's online.ts is a PORT of the transport slides uses (now moving
- # into kernel/). The two files are separate text that nobody diffs, and
- # ONE DEPLOYED WORKER verifies both: it pins the room id to a key and
- # walks an owner→invite→member signature chain. If one client's idea of
- # `inv.${pub}.${role}.${exp}` drifts, the symptom is not a red test — it
- # is one app's users silently unable to join the other's rooms, on a
- # relay that cannot be rolled back independently of the shells already
- # in people's files. This diffs only what goes on the wire.
- run: node scripts/test-relay-protocol.ts
-
- - name: relay broadcast rig
- # A show is a special case of collaboration: an audience member holds
- # an owner-signed `audience` invite and a per-show key, and the relay
- # routes by stream. What breaks silently if this regresses: an audience
- # socket admitted on the room token (it holds the show key, not the
- # room key, so the compare must be skipped for the role and only the
- # role); an audience socket that can send anything (the invite is on the
- # same chain as a writer's, so the check is by role); an aud frame that
- # reaches the room stream or the room's op log (show-key ciphertext
- # persisted forever, replayed to every future collaborator as noise); a
- # late joiner served the room's op log; show state kept in memory,
- # which hibernation evicts mid-show; and the presenter-loss grace timer
- # firing the DO's single alarm as the 30-day room WIPE. Each is a
- # mutation this rig turns red on.
- run: node scripts/test-relay-broadcast.ts
-
- - name: relay authorization rig
- # Drives the real Room durable object with fake sockets and storage.
- # What it guards: the relay stamps a fanned-out frame with exactly what
- # it verified and never with what it did not; a socket that merely
- # hash-matches the room's public key is challenged and handed no blob
- # write ticket, cannot latch the room, and cannot answer with a forged,
- # replayed or cross-room proof; revocation re-mints the ticket to
- # proven sockets only; and a snapshot claiming a seq the room has not
- # reached is refused rather than allowed to prune the op log. Every
- # one of these is silent when it regresses — the relay keeps working
- # and simply trusts more than it should.
- run: node scripts/test-relay-auth.ts
-
- - name: publish account gate — the release account is checked before the site goes live
- # publish-site.mjs mirrored and pushed the site and THEN failed to
- # create the GitHub release, three releases running, because gh was
- # the work profile (a job/temp worktree). The gate runs before rsync;
- # this rig pins the rule and the order.
- run: node scripts/test-publish-account.ts
-
- - name: app payload fingerprint — a shell with no payload never passes the publish gates
- # publish-site's shell-consistency gate hashed the shell and every deck
- # to null when its matcher went stale, and null === null passed it while
- # it checked nothing. One shared helper; null is "cannot tell", never a match.
- run: node scripts/test-apphash.ts
-
- - name: client vouch rig — the other half of read-only
- # Drives a REAL OnlineTransport (kernel's and dash's twin) through a
- # fake socket in a signed room. Every copy holds the room key, so a
- # reader can encrypt an op batch and the blind relay fans it out
- # unstamped; the client's `vouched()` is the only thing between that
- # frame and every live editor applying it. With `vouched` mutated to
- # `return true`, every other rig in the tree stayed green — security
- # found that by mutation, and this rig is the answer: unstamped ops and
- # snapshots refused, stamped ones applied, presence unaffected, legacy
- # r-rooms permissive. Bundled because the kernel transport uses
- # parameter properties, which node's strip-only loader rejects.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-sync-vouch.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-sync-vouch.mjs"
- node "$RUNNER_TEMP/test-sync-vouch.mjs"
-
- - name: session broadcast surface rig
- # startShow/endShow, the verb channel, and the audience's reception.
- # What breaks silently if it regresses: the audsnap under the show key
- # is the LIVE sync state instead of a fresh adopt of the projected doc,
- # which leaks `stash` (deleted slides' notes) and the whole per-keystroke
- # text history past the projection; or a local op reaches the audience
- # without the app's projection applied. Both are mutation-caught here.
- run: node scripts/test-sync-show.ts
-
- - name: dash validator rig
- # 109 checks over the shapes that read as DATA rather than as damage —
- # a column shorter than the sheet has rows, a dictionary index past the
- # end of its dict. Nothing here refuses to load a workbook; the point is
- # that the user is told, because neither of those looks wrong on screen.
- run: node scripts/test-dash-validate.ts
-
- - name: dash comments rig
- # A thread anchors to colId + rid, never a position, so it survives a
- # sort. The checks that matter are the ORPHAN ones: a deleted row must
- # leave the thread dead and saying so, not silently re-pointed at
- # whoever inherited the row number.
- run: node scripts/test-dash-comments.ts
-
- - name: dash recovery rig
- # Every branch of the offer/no-offer decision, with no DOM and no
- # IndexedDB in it. A snapshot that cannot be parsed is not offered — a
- # Restore button that hands the app a document it will then refuse is a
- # dead end wearing a live button.
- run: node scripts/test-dash-recovery.ts
-
- - name: dash CSV export rig
- # Text starting = + - @ tab or CR is exported with a leading quote, so
- # opening the CSV in a spreadsheet never runs it as a formula.
- run: node scripts/test-dash-csv-export.ts
-
- - name: dash i18n rig
- # A core catalog ships inside every saved workbook and cannot be patched
- # without a release, so drift has to fail here rather than in the field:
- # a catalog key the source no longer contains is a dead translation, and
- # a {placeholder} a translation dropped is a sentence with a hole in it.
- run: node scripts/test-dash-i18n.ts
-
- - name: dash sheet-tabs rig
- # Sheet order is the tab order and it lives in the DOCUMENT, so a
- # reorder is an undoable patch whose inverse carries the ORIGINAL index
- # — one undo puts a dragged tab back where it was, not at the end. Also
- # guards that deleting the shown sheet steps to another TABLE sheet.
- run: node scripts/test-dash-tabs.ts
-
- - name: dash find rig
- # The grid is windowed — about 40 rows of a 5,000-row sheet exist in the
- # DOM — so the browser's own find reports "not there" for values that
- # are. These checks cover the matcher, the view vector (a hit must never
- # be a row the filter is hiding) and the replace refusals.
- run: node scripts/test-dash-find.ts
-
- - name: dash spreadsheet-cells rig
- # The setCanvasCells patch, which writes the SPREADSHEET kind's sparse
- # A1 map. Sparseness is not a size optimisation: a cleared cell has to
- # be GONE, or an undone sheet is unequal to a fresh one and two
- # replicas disagree about whether a cell exists. Also pins the
- # collaboration fallback — the CRDT has never heard of this op, and
- # localOne's default arm ships a whole-state snapshot rather than
- # dropping it.
- run: node scripts/test-dash-canvascells.ts
-
- - name: dash step engine
- # The relational pipeline the FORMAT has described since commit one and
- # nothing executed. Includes a performance floor at 100k rows and a
- # HELD-HEAP comparison against a row-shaped pipeline — wall clock does
- # not discriminate between the two designs at this size, memory does
- # (2.5 MB against 16.8 MB), and memory is what decides whether a
- # workbook fits at all.
- run: node scripts/test-dash-steps.ts
-
- - name: dash SQL surface
- # SQL compiles to Step[] and does not evaluate anything itself — the
- # answer is a frame over the same columns, so it stays live rather than
- # becoming a copy that is wrong the moment somebody edits a cell. The
- # checks that matter are the refusals: a plain JOIN declares card:'one'
- # so a non-unique key STOPS the pipeline instead of doubling every
- # total, and an edit statement is refused because a query is a question.
- run: node scripts/test-dash-sql.ts
-
- - name: dash spreadsheet rig
- # Rendering and editing the SPREADSHEET kind — unbounded, sparse, typed
- # per cell. The check that matters is that a formula BELOW the data
- # lands in a cell that did not exist, without allocating the rows it
- # skipped: that gesture is why the kind exists.
- run: node scripts/test-dash-canvas.ts
-
- - name: dash promote/flatten rig
- # The bridge between the two sheet kinds. The checks that matter are
- # the ones about NOT destroying the source: promotion leaves the range
- # alone, because a formula under the block and a cross-sheet reference
- # into it both point by POSITION and emptying the cells would blank
- # them silently. Also that a lifted column formula actually EVALUATES —
- # Column.formula is a bare expression, and an "=" in front of it ships
- # a column of #VALUE!.
- run: node scripts/test-dash-promote.ts
-
- - name: dash fill rig
- # ⌘D and the fill handle. This guards a DATA LOSS bug that shipped:
- # seeding from the computed value wrote error OBJECTS into stored
- # columns and flattened formulas to constants, and ⌘D sharing an
- # implementation with the handle made it alternate two seed rows. The
- # two gestures are separate here, and a formula fills with its
- # references translated.
- run: node scripts/test-dash-fill.ts
-
- - name: dash spreadsheet formula rig
- # Formulas on the SPREADSHEET kind, including cross-sheet references.
- # Sheet1!A1 used to bind to the LOCAL A1 — this sheet's number reported
- # under another sheet's name — and ranges over a sparse sheet must cost
- # the cells that exist, not the rectangle they span.
- run: node scripts/test-dash-canvasformula.ts
-
- - name: dash action-applicability rig
- # One table saying which actions run on which sheet kind, and a reason
- # for every one that does not. Six toolbar buttons used to throw
- # "grid needs a table sheet" on a spreadsheet with nothing shown; the
- # rig fails if an action is kind-scoped without a reason string.
- run: node scripts/test-dash-actions.ts
-
- - name: dash cell format and type rig
- # Per-cell number format, coercion and appearance on a SPREADSHEET
- # sheet. The checks that matter are the data-eating ones: 01234 must not
- # silently become 1234, 1/2 must never become a date, an ambiguous
- # d/m/yyyy is refused rather than guessed, and formatting twenty cells
- # is ONE patch and ONE undo.
- run: node scripts/test-dash-cellprops.ts
-
- - name: dash theme rig
- # A stylesheet has no type system: an undeclared token is a dead rule
- # and a light-dark() fed a length is an invalid declaration — both
- # silent, and both had SHIPPED. --accent-ink drew nothing and every
- # shadow in the app computed to "none". The light palette is also
- # diffed against slides' :root so the two cannot drift one grey at a
- # time again.
- run: node scripts/test-dash-theme.ts
-
- - name: dash file write-back
- # The single biggest data-loss risk dash shipped with: an IndexedDB
- # snapshot was the only thing catching an hour of typing, and it is
- # invisible, uncopyable and cleared by browsers on their own schedule.
- # The checks that matter are the bookkeeping ones. A FAILED write must
- # not be recorded as a baseline — record the intent and the next cycle
- # reads "unchanged", so a permanent failure is reported once and then
- # silently skipped forever. Also: two cycles never open concurrent
- # writables on one handle, nothing is rethrown out of a setTimeout
- # nobody awaits, and the refusals (read-only, template, no-handle) are
- # ORDERED, so a read-only workbook reports the permanent reason rather
- # than the incidental one.
- run: node scripts/test-dash-autosave.ts
-
- - name: dash print
- # Every failure mode here is silent: the page that comes out has a
- # header, a body and a total, and looks finished whatever is missing
- # from it. The grid is windowed at ~46 rows, so the first check builds
- # a 5,000-row sheet and counts what reaches the paper — measured in a
- # browser too: 3,001 printed rows from a grid holding 46. The rest pin
- # that the printout is of the VIEW VECTOR, that the totals row is the
- # FILTERED total from the very grid.aggregate the footer calls, that no
- # column is ever clipped off the right edge at any wide-sheet setting,
- # and that author data reaching markup is escaped — a workbook is
- # untrusted input, and this path builds HTML by concatenation.
- run: node scripts/test-dash-print.ts
-
- - name: dash grid frontier
- # What exists below a dataset's last row: exactly one appender, with
- # the ruled lattice stopping at the data. The grid used to LOOK like an
- # infinite canvas and behave like a table — pressing "=" below the
- # numbers opened the editor on the last DATA cell, so the universal
- # spreadsheet gesture silently targeted real data. Typing on the
- # frontier must append, and append ONCE: zero times restores the
- # original bug, per-keystroke is a different one. Clicking must NOT
- # append, since a control that grows the file when you look at it is
- # worse than one that does nothing.
- run: node scripts/test-dash-frontier.ts
-
- - name: dash grid context menus
- # The three menus a right-click produces — cell, row-number gutter,
- # column header — asserted from real `contextmenu` events on a mounted
- # grid, never from the builders. Two features have shipped complete and
- # UNREACHABLE (the conditional-format rules, and the two gutters, which
- # did nothing at all on a right-click), and in both cases a rig that
- # called the builder would have been green over an app with the feature
- # invisible on screen. So the negative control here is a grid with
- # `installGridMenus` NOT called: the same right-clicks must produce
- # nothing. Also pinned: the labels count the selection and the ops do
- # that many; Escape closes a menu and its listener does not outlive it;
- # the `+` column appender exists, is absent read-only, and costs
- # nothing until its dialog is answered; and finding 11 — a per-cell
- # formula is carried into a new row only when the column proves it
- # repeats, and the reader is told either way.
- run: node scripts/test-dash-menu.ts
-
- - name: dash accessibility
- # All of these fail silently to a sighted developer. The load-bearing
- # check is aria-rowindex under virtualisation: about forty rows of a
- # 5,000-row view exist in the DOM, so a row's position among its
- # siblings is meaningless and the index must state its place in the
- # FULL view. Get it wrong and a screen reader confidently announces
- # "row 3 of 40" in a five-thousand-row sheet, which is worse than
- # silence because it is trusted. Also guarded: activeElement after a
- # click and after a repaint (every paint replaces innerHTML, so without
- # restoration focus drops to BODY), one roving tab stop, and that
- # nothing here is a live region.
- run: node scripts/test-dash-a11y.ts
-
- - name: dash per-cell appearance
- # Appearance on BOTH sheet kinds, which had drifted: the format always
- # carried bold/colour on a spreadsheet cell and a dataset cell could
- # carry none of it. The check worth naming mounts the REAL grid and
- # reads the emitted markup, because the pure-function checks did not
- # need the grid to call appearanceCss at all — measured, deleting both
- # paint calls left 69 and 123 checks green with the feature invisible
- # on screen. This repo shipped that shape once already (--accent-ink
- # was a token the stylesheet never declared). Also pins that appearance
- # cannot smuggle a value or a type onto a dataset, where the COLUMN
- # type is authoritative, and that the CRDT splits content from
- # presentation so bolding a cell beside a concurrent retype keeps both.
- run: node scripts/test-dash-cellfmt.ts
-
- - name: dash column type vs storage
- # Guards a shipped bug that produced a WRONG NUMBER at the end of a path
- # dash itself recommends — the worst shape a defect can take: not a
- # crash, not an error cell, a confident total that is wrong. Import
- # lands a mixed column as text and advises setting the type; doing that
- # used to move only `col.type`, so the grid right-aligned and
- # number-formatted the values while `aggregate` skipped every one of
- # them. Measured on a real .xlsx: footer SUM 0 against a true total of
- # 10,308.85, a number dash returns correctly from =SUM() on a
- # spreadsheet copy of the same rows. Three properties: converting works;
- # undo restores the BYTES and not just the declaration (text→number→text
- # is lossy, "1200.50" returns as "1200.5", which a typeof check cannot
- # see); and what will not convert is refused rather than zeroed. The
- # validator half is checked too, because store.ts can only stop this
- # state being created — it still arrives from files saved by the buggy
- # build and from hand-edited JSON, which PLATFORM §7 makes a way in.
- run: node scripts/test-dash-coltype.ts
-
- - name: dash starter workbook
- # The starter ships INSIDE the shell, so it is what bento.page shows and
- # what every downloaded copy opens with — the one document in this repo
- # a stranger is guaranteed to see — and nothing guarded it. Two families:
- # that it is a valid, self-consistent workbook (a starter that trips
- # validateDoc ships the app's own warning banner to every new reader on
- # first open), and that the NUMBERS are right. The second is the one that
- # will catch something: the Scratch sheet reads across into the dataset
- # by ADDRESS, so reordering, inserting or hiding a column silently
- # re-points two totals on another sheet, and nothing about that is
- # visible in a diff. The addresses are pinned by column NAME and the
- # totals computed through the shipping code.
- run: node scripts/test-dash-starter.ts
-
- - name: dash — the off switch for a live session
- # A polish sweep drove the app at 880px with a session running:
- # collab.on true, the room live on the relay, and the string "Stop
- # sharing" NOWHERE in the document — sync.css hid the toggle outright
- # below 900px to buy width in the top bar, and that toggle is the only
- # control that stops sharing. The nearest thing left was About's
- # "Offline mode", which also kills the signed update check: to stop one
- # workbook being shared you had to switch off the app's networking.
- # The rule is narrow: a control that REPORTS nothing may stand down at a
- # narrow width (the 390px measurement behind those rules is real and
- # still honoured), a control that STOPS something already happening may
- # not. Checked as CSS text because dash-dom.ts is a parser, not a layout
- # engine, and cannot say what a viewport width does to a declaration.
- run: node scripts/test-dash-stopsharing.ts
-
- - name: Grid surface rig
- # The sheet as an OBJECT ON A SURFACE. An eight-row dataset used to
- # fill the top 180px of a 1440x900 window and leave the rest blank in
- # the same white as the sheet, so "the table ended here" and "the app
- # stopped drawing" looked identical — the strongest unfinished signal
- # the app had. The fix is not more rows (test-dash-frontier.ts owns
- # that decision and is unchanged): it is a bounded table on a --desk
- # ground the spreadsheet kind deliberately does not get, plus the three
- # empty states.
- #
- # Half of it is CSS, which has no type system and no runtime errors, so
- # those checks read the stylesheet as text and MEASURE the palette
- # rather than merely requiring tokens to be present — a desk 1.02:1
- # from the paper satisfies every structural check and renders as the
- # defect. The other half mounts a real Grid and asserts the note is one
- # node that survives 5,000 rows.
- run: node scripts/test-dash-surface.ts
-
- - name: Data validation rig
- # In-cell dropdowns and typed entry rules — Excel's Data Validation,
- # which is NOT dash's validate.ts (that one asks whether a workbook
- # agrees with itself). Two features, one English word, and a rig that
- # confuses them tests neither.
- #
- # The checks that matter are the three a green suite would otherwise
- # hide. (1) The dropdown and the invalid mark are asserted on the
- # MARKUP A REAL GRID EMITS, through BOTH paint loops — the pure
- # functions were all green with the feature invisible on screen, which
- # is precisely the failure this repo shipped once already. (2) `reject`
- # refuses AT THE KEYBOARD and nowhere else: a paste, an import, an undo
- # and a remote CRDT op all LAND and are marked, because refusing an op
- # that has already been committed elsewhere either diverges the
- # replicas or silently discards a collaborator's work. Both arms are
- # pinned, and a sabotage that leaks the refusal into the paste path
- # turns the second one red. (3) A rule never changes existing data —
- # what breaks it is marked, never deleted — and the mark is derived at
- # paint rather than stored, so it cannot go stale. Also pins the .xlsx
- # round trip in both directions, including Excel's INVERTED
- # `showDropDown` attribute (1 hides it), which reads correctly in code
- # that has it exactly backwards.
- run: node scripts/test-dash-datavalid.ts
-
- - name: every rig is actually run
- # A rig nobody runs is worse than no rig, and it fails flatteringly: the
- # file is there, the checks in it are good, git log shows it being
- # maintained, and anyone counting coverage counts it. It just never
- # executes, so nothing goes red and nothing says so. Five rigs landed in
- # one afternoon — write-back, print, frontier, a11y, appearance — each
- # written by a different agent told to write one, none of them knowing
- # where this list lives; all five passed on disk and none were here.
- # Also checks the reverse, since a step pointing at a deleted script
- # fails every push for a reason unrelated to the change that triggered
- # it, and prints the deliberate-exemption list on every run so it stays
- # something people look at rather than somewhere failures go to hide.
- run: node scripts/test-ci-registered.ts
- - name: Theme token gate
- # Every failure this catches is INVISIBLE in the light theme, which is
- # the one the author is looking at. A chrome surface pinned to white
- # keeps its light background in dark and puts light text on it — the
- # properties panel measured 1.21:1 against a 4.5 floor before this gate
- # existed. It also stops a document token being themed (which would
- # invert the deck) and the light palette forking from spaces and type.
- run: node scripts/test-slides-theme.mjs
-
- - name: Brand palette rig
- # themeRefs record where a colour came from so a deck can be re-branded.
- # Three properties must hold or the feature is a liability: the
- # derivation must be IDEMPOTENT (it runs on the doc event — one that
- # never settles is a hang, not a wrong colour), stripping the new fields
- # must leave every rendered value identical (every shipped shell reads
- # the literals and always will), and an unresolvable reference must
- # change nothing rather than writing undefined.
- run: node scripts/test-theme.ts
-
- - name: Built-in layout geometry rig
- # The built-ins are drawn against 1600x900 while the model default is
- # 1280x720, so they used to hang 200px off the right edge of a default
- # deck. Nothing structural could see it — the fix is arithmetic, and so
- # is the regression.
- run: node scripts/test-layouts.ts
-
- - name: slides asset-pruning rig
- # doc.assets was append-only: delete every slide, save, and the "empty"
- # deck was still 20 MB (#442). A save now writes a copy with the
- # unreferenced assets dropped. Weighted toward "kept", one case per
- # reference form, because dropping too much is the worse failure — an
- # image gone from a file with nothing on screen to say so.
- run: node scripts/test-slides-assets.ts
-
- - name: Slides built-in fonts rig
- # The shell carries two faces; a deck names them (builtin:…) instead
- # of embedding 86 KB the file already has. At save a deck embedding
- # byte-identical bytes is rewritten to name them; a different font
- # keeps its bytes; the live document is untouched; measured saving.
- run: node scripts/test-slides-fonts.ts
-
- - name: Slides code colours rig
- # theme.codePalette's editor: one row per token scope from one list
- # (code.ts CODE_SCOPES), built-in colour shown when the deck has
- # none, the field written only on a change; plain literals, not
- # palette references. And accent 2–6 rows/swatches only for slots
- # the deck carries (six identical peach swatches were not choices).
- run: node scripts/test-code-palette.ts
-
- - name: Slides pagination rig
- # Three ways a slide declines a page number (state, hidden, unnumbered)
- # and only one of them stays in the walk; every surface — page fields,
- # presenter counter, sidebar — asks the same predicate, and a build of
- # morph steps reads "18, 18, 18" rather than "18, 19, 20" (#282).
- run: node scripts/test-slides-pagination.ts
-
- - name: Slides reveal-steps rig
- # fx.step, "animate on click": → reveals the next step before it
- # leaves the slide, ← hides it; backward arrival is fully revealed;
- # gaps are pressed through; the audience follows the presenter's
- # step. Decisions in slides/src/steps.ts, DOM-free (#282, option 2).
- run: node scripts/test-slides-steps.ts
-
- - name: Maths engine rig
- # slides/src/maths replaced Temml (2026-09-15): never-throws contract;
- # the 91-formula reference set matches Temml's FROZEN trees on ≥95%
- # (scripts/fixtures/maths-reference.json; every mismatch must be a
- # listed residual); Typst ≡ LaTeX on the shared tree; every emitted
- # attribute is the engine's own; the symbol table has no duplicates.
- run: node scripts/test-maths-lite.ts
-
- - name: Reveal authoring rig
- # Reading order (top-to-bottom, then left-to-right, rows by vertical
- # overlap) is deterministic; the verbs continue the slide's sequence;
- # the badge cycle never reaches 0; and the badge layer is editor
- # chrome that render/present/preview do not know.
- run: node scripts/test-slides-reveal-ui.ts
-
- - name: Date/time field patterns rig
- # {{date:M/D/YY}} / {{time:h:mm a}} pin a shape for every viewer
- # (datefmt.ts): token precedence, [bracketed] literals, 12-hour
- # tokens, locale month names; every panel preset formats; render.ts
- # routes the argument. Bare {{date}} stays viewer-locale (#381).
- run: node scripts/test-slides-fields.ts
-
- - name: Typed bullets become lists rig
- # editor/bullets.ts bulletsToLists: glyph lines become real <ul><li>
- # at commit (hanging indent), nesting by indent, untouched otherwise,
- # idempotent; both paste handlers read the clipboard through
- # editor/paste.ts (the html flavour, sanitized) -- #502, #503.
- run: node scripts/test-slides-bullets.ts
- - name: Inline-edit listeners rig
- # Every keydown/input/paste/blur listener a text-box or cell edit
- # attaches carries that edit's AbortSignal, and both commits abort it —
- # a node re-edited without a re-render used to stack listeners and
- # paste N times.
- run: node scripts/test-slides-edit-listeners.ts
-
- - name: Live-session notice wording rig
- # A refused whole-deck snapshot (SyncNotice.snapshot, #509) is worded as
- # the deck, never as a change or an image; the Share popover polls
- # pendingBlobUploads() only while open; strings in every core catalog.
- run: node scripts/test-slides-sync-notice.ts
-
- - name: Shell loader and carrier rig
- # base86 payloads (scripts/lib/b86.mjs) round-trip and can never
- # contain </script, <!--, -->, ]]> or ${; the loader inflates
- # synchronously and runs the runtime as an inline classic script
- # FIRST (mounted before DOMContentLoaded, as the uncompressed build
- # is), probes and waits on nothing, falls to new Function then blob
- # only on a refusal, installs Trusted Types policies lazily, and
- # records window.bento.loader. The gate goes red on a hand-edited
- # payload. The browser half drives headless Chrome with a real
- # background tab: mounted before DCL hidden, splash gone within 50 ms
- # of the mount there. Needs slides/node_modules and the built shell.
- run: node scripts/test-shell-loader.ts
-
- - name: Maths in links rig
- # resolveMath transforms text runs only: a `$` inside an href never
- # pairs with one in the text, so a link whose address carries a
- # dollar sign keeps its href (pre-existing since #465).
- run: node scripts/test-slides-math-href.ts
- - name: Maths delimiters rig
- # #540: \(…\) and \[…\] beside $…$ and $$…$$, escapes literal,
- # "$5 and $10" still prose; display maths may span <br>/<div>/<p>
- # line breaks and nothing else; the editor-only "Not rendered" hint;
- # paste and commit keep a formula's backslashes. Real engine, DOM-free.
- run: node scripts/test-slides-math-delims.ts
- - name: Code fence rig
- # ``` fences in a text box: which text is a fence (closed only), the
- # language aliases, autoformat's open-fence guard, and the elements a
- # fenced box becomes (identity on the first part, no duplicate morph key).
- run: node scripts/test-slides-code-fence.ts
- - name: Maths coverage rig
- # #551: maths-lite against Temml's WHOLE vocabulary (1,237 commands and
- # environments, frozen offline): no covered command may fall back to
- # raw text, the rendering and tree-identical counts may not drop below
- # the recorded floor, and every commonly typed formula renders. The
- # check a fixed sample could not make, which is how #540 slipped by.
- run: node scripts/test-maths-coverage.ts
- - name: Accent contrast rig
- # The accent as text reads in both themes: every --accent-ink text use
- # is audited against the surface behind it and reaches 4.5:1; text on
- # the orange fill uses --accent-on; labels drawn over the slide carry a
- # surface halo. Dark --accent-ink was #3a2a00 on dark chrome — 1.09:1.
- run: node scripts/test-slides-accent-contrast.ts
- - name: Compact document rig
- # The agent authoring form (#422): compactDoc/expandDoc are inverses
- # on the starter deck, expansion equals the editor's insert helpers
- # field for field, nested arrays flatten, ids mint deterministically,
- # the loader gates the expanded doc, the file on disk stays full.
- run: node scripts/test-slides-compact.ts
-
- - name: Agent-deck corpus rig
- # scripts/fixtures/agent-decks/*.json — compact decks written the way
- # agents write them (md, omitted h, nested arrays) — load through the
- # real loader with zero dropped keys and zero validate() errors; a
- # deliberately wrong deck reports every drop at its path with a reason.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-slides-agent-decks.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-agent-decks.mjs"
- node "$RUNNER_TEMP/test-slides-agent-decks.mjs"
-
- - name: Compact layouts and roles rig
- # A compact slide names a layout and its elements carry roles: the
- # layout's frames through model.ts applyLayout (the editor's own
- # path), ids kept so same-layout slides morph, unknown roles fall
- # back and are reported, explicit geometry wins, bodies stack, and
- # AGENTS.md's layout table is checked against the code.
- run: node scripts/test-slides-compact-layouts.ts
-
- - name: Gate parity rig (the load-report collector changes no decision)
- # main's untrusted.ts frozen from git at rig time and bundled beside
- # the branch's; every checked-in deck plus a hostile corpus goes
- # through both with the collector OFF and the outputs must be
- # byte-identical. Security-reviewed hunk (#486).
- run: |
- git fetch --no-tags --depth=1 origin main
- node scripts/test-gate-parity.ts
-
- - name: Layers panel rig
- # editor/layerrows.ts, DOM-free: rows top-first, labels per type,
- # group indent, moveInPaintOrder == the Order buttons (front/back/±1,
- # a group moves as one, a no-op returns the same array), highlight
- # follows the selection; render/present never see the list (#371).
- run: node scripts/test-slides-layers.ts
- - name: Export slides as images rig
- # exportimages.ts decisions (DOM-free): the page set is the print set
- # (hidden/state out, deck order), names pad NN and use the kernel's
- # own title sanitiser, JPEG matte/PNG none, 1x/2x integer sizes; and
- # the editor half renders via renderSlide with no PREVIEW_BUDGET tier.
- run: node scripts/test-slides-export-images.ts
- - name: Connectors rig
- # #302/#303/#304: one tip catalogue (tips.ts) behind the model, the
- # gate, the panel and the markers; per-tip insets (hollow tips stop the
- # stroke at the head); the double arrow's polygon is symmetric; a
- # curve's end tangent and the re-route that moves only its end points;
- # the straight connector's 1.0.2 functions byte-identical.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-slides-connectors.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-slides-connectors.mjs"
- node --no-warnings "$RUNNER_TEMP/test-slides-connectors.mjs"
-
- - name: Image crop rig
- # crop.ts: {x, y, scale} → the one CSS mapping every surface uses;
- # the frame can never show empty space; the shape gate admits the
- # field and refuses wrong shapes; one image branch in render.ts;
- # present tweens a crop only when both sides carry one (#319).
- run: |
- slides/node_modules/.bin/esbuild scripts/test-slides-crop.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-crop.mjs"
- node "$RUNNER_TEMP/test-slides-crop.mjs"
- - name: Photos shrink at insert rig
- # editor/shrink.ts decisions, DOM-free: photo vs graphic (lossy vs
- # lossless), the ≥20% keep rule, the 2560 px cap, svg/gif untouched,
- # every insert path routed, model.ts untouched. The encode itself is
- # measured in Chrome (PR #).
- run: node scripts/test-slides-shrink.ts
-
- - name: Compress pictures in this deck rig
- # editor/compressdeck.ts planning half, DOM-free: image elements only,
- # an asset once however many elements share it, SVG/GIF/media/fonts
- # never; applyCompress writes in place and drops the replaced asset's
- # blob reference; the editor dry-runs first and commits once.
- run: node scripts/test-slides-compress-deck.ts
- - name: Image aspect-ratio lock rig
- # keepAspectRatio (#372): absent = locked, so old files resize as
- # before; Shift is the one-drag exception either way; re-locking
- # deletes the field and keeps the current shape; unlocking sets
- # fit:'fill'. Also holds the set-aside parts of #372 out of the tree.
- run: node scripts/test-slides-aspect-lock.ts
-
- - name: Web links and bullets rig
- # A link is one thing in four places — isWebUrl — and every surface
- # that lets a URL in or out asks it: the shape gate, the text
- # sanitizer, the markdown converters, and the show before it opens a
- # NEW tab with noopener,noreferrer. javascript:/data: are text.
- # Bullets from "- " and "* ", indented sub-bullets. (#421, #255, #368)
- run: node scripts/test-slides-links.ts
-
- - name: Audience projection rig
- # Live broadcast: the handout, the join snapshot and every streamed op
- # go through slides/src/audience.ts, which keeps back speaker notes
- # and review comments and nothing else. Runs the negative control
- # first — with the boundary emptied the rig must go red, or it is
- # checking nothing.
- run: |
- if node scripts/test-audience-projection.ts --mutate > /dev/null 2>&1; then
- echo 'negative control passed with the boundary removed'; exit 1; fi
- node scripts/test-audience-projection.ts
-
- - name: Audience embed rig
- # An embed's document can carry another deck's envelope (collab +
- # docId); the handout, the live snapshot and every live op the real
- # engine emits must arrive without it. Negative control first.
- run: |
- if node scripts/test-audience-embed.ts --mutate > /dev/null 2>&1; then
- echo 'negative control passed with the envelope rule emptied'; exit 1; fi
- node scripts/test-audience-embed.ts
-
- - name: Broadcast follow-mode rig
- # The audience side's decisions (slides/src/follow.ts): nav by slide
- # ID with the index only as fallback — an insert mid-talk moves nobody;
- # follow is the viewer's, lock is the presenter's and wins; laser
- # samples rate-limited at the source with pen-up always sent.
- run: node scripts/test-broadcast-follow.ts
-
- - name: slides store rig
- # The editor's undo/redo, selection and whole-deck replacement, at the
- # store level rather than through the DOM. Bundled first for the same
- # reason the spaces rigs are: store.ts imports './model' without an
- # extension, which node's strip-only TypeScript loader will not follow,
- # so run by hand it fails with ERR_MODULE_NOT_FOUND and looks like a
- # broken product. It had never been registered here.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-slide-store.ts --bundle --platform=node --format=esm \
- --outfile="$RUNNER_TEMP/test-slide-store.mjs"
- node "$RUNNER_TEMP/test-slide-store.mjs"
-
- # bento/type: the word processor. Same pipeline, same gate.
- - name: Install (type)
- working-directory: type
- run: npm ci
-
- - name: Typecheck (type)
- working-directory: type
- run: node_modules/.bin/tsc -b
-
- - name: Build single-file shell (type)
- working-directory: type
- run: npm run build:single
-
- - name: Splice conformance gate (type)
- run: node scripts/shell-gate.mjs type/dist-single/Bento_Type.bento.html
-
- - name: Type inline-formatting rig
- # A block stores plain text + marks over character ranges, and the
- # round trip render→read must be exact: if it is not, formatting
- # silently mutates on every re-render, which surfaces as a signed
- # document that stops verifying. Includes a 2,000-case fuzz — it found
- # two bugs no hand-written case did.
- run: node scripts/test-type-inline.ts
-
- - name: Type model rig
- # The load contract (an unreadable file must never become an empty one
- # over live data), deterministic id repair, and the rule that marks and
- # footnote anchors move together — separating them is what put a
- # footnote marker in the middle of a word.
- run: node scripts/test-type-model.ts
-
- - name: Type store rig
- # A typed word is ONE undo press, and a scoped snapshot really is
- # scoped: 200 edits cost ~94KB rather than ~21.7MB.
- run: node scripts/test-type-store.ts
-
- - name: Type redline rig
- # accept(all) == what they sent back, reject(all) == what you sent.
- # Without both, "review these changes" is a lie.
- run: node scripts/test-type-redline.ts
-
- - name: Type paginated-output rig
- # The printed page count must be the one the editor computed — if print
- # re-paginates, "page 14 paragraph 3" stops meaning anything, which is
- # the whole reason documents like this are exchanged as PDF. Also pins
- # that footnotes reach the page their reference lands on, and that a
- # document's own page size is what prints.
- run: node scripts/test-type-print.ts
-
- - name: Type theme rig
- # Static checks so a theme cannot rot: both themes define the same
- # roles, the document surface is never themed, and no chrome rule
- # borrows a document token — that last one shipped a select at 1.92:1
- # against a WCAG AA floor of 4.5.
- run: node scripts/test-type-theme.mjs
-
- - name: bento/dash CRDT convergence
- # The big one: randomised concurrent edits across N replicas, asserted
- # to converge. It has caught every ordering bug in the engine, and the
- # two it did not catch were found by widening it.
- run: node scripts/test-dash-sync.ts
-
- - name: relay protocol — one wire format, two clients
- # dash's online.ts is a PORT of the transport slides uses (now in
- # kernel/). The two files are separate text that nobody diffs, and ONE
- # DEPLOYED WORKER verifies both: it pins the room id to a key and walks
- # an owner→invite→member signature chain. If one client's idea of
- # `inv.${pub}.${role}.${exp}` drifts, the symptom is not a red test — it
- # is one app's users silently unable to join the other's rooms, on a
- # relay that cannot be rolled back independently of the shells already
- # in people's files. This diffs only what goes on the wire.
- #
- # Written by the bento/dash work; taken here because the kernel lift is
- # the change it guards, and it should not land after the move it exists
- # to check. The rig FOLLOWS the twin (kernel first, then slides) and
- # FAILS if it finds no transport at all, rather than silently comparing
- # two empty lists — which is how its own first version passed.
- run: node scripts/test-relay-protocol.ts
-
- - name: Type blocks rig
- # Lists and tables are runs of flat blocks assembled at render;
- # this pins the grouping, including the level clamp that once opened a
- # billion list elements and killed the process.
- run: node scripts/test-type-blocks.ts
-
- - name: Type layout rig
- # Paragraph spacing, indents and page setup, and that a page break
- # is honoured by the paginator rather than merely stored.
- run: node scripts/test-type-layout.ts
-
- - name: Type image rig
- # Pictures embed or reference, and an atomic block is measured as one
- # box so pagination cannot break a page through the middle of it.
- run: node scripts/test-type-image.ts
-
- - name: Type link rig
- # Link marks round-trip, and the href allow-list holds: a document is
- # untrusted input, and javascript: reached the page from one once.
- run: node scripts/test-type-link.ts
-
- - name: Type find rig
- # Find and replace across blocks, including the offsets that shift
- # when a replacement changes a block's length.
- run: node scripts/test-type-find.ts
-
- - name: Type toc rig
- # Section numbering is DERIVED, never stored, so inserting a heading
- # renumbers everything and nothing drifts.
- run: node scripts/test-type-toc.ts
-
- - name: Type xref rig
- # Captions and cross-references are atoms at an offset, so renumbering
- # is invisible to the redline.
- run: node scripts/test-type-xref.ts
-
- - name: Type cite rig
- # Citations and the bibliography — a citation is an atom, so
- # restyling one is not an edit to the sentence around it.
- run: node scripts/test-type-cite.ts
-
- - name: Type math rig
- # Formulas: the TeX source is the model and inline math is a mark, so
- # a formula survives the render→read round trip intact.
- run: node scripts/test-type-math.ts
-
- - name: Type comments rig
- # Threads keep their anchors through edits, splits and merges, and
- # editing or deleting a message never moves the text it points at.
- run: node scripts/test-type-comments.ts
-
- - name: Type track rig
- # Tracked changes as ins/del marks: accept-all gives the text as
- # edited, reject-all the text as it was, and display modes never touch
- # the model.
- run: node scripts/test-type-track.ts
-
- - name: Type font rig
- # Per-selection typeface and size, and the CSS allow-list that keeps a
- # font stack from opening a second declaration in a style attribute.
- run: node scripts/test-type-font.ts
-
- - name: Type autosave rig
- # A crash must not cost the work since the last ⌘S. Pins the content
- # key that decides whether a snapshot disagrees with the loaded file,
- # and that an encrypted document is NEVER snapshotted — plaintext in
- # IndexedDB beside a file whose whole point is that it is encrypted.
- run: node scripts/test-type-autosave.ts
-
- - name: Type preview rig
- # Thumbnailers run no JavaScript, so a saved file carries a still of
- # page one plus a parser-blocking remover. Pins the ordering (nothing
- # paintable between host and remover), that a second save REPLACES
- # rather than appends, and that an encrypted document gets none.
- run: node scripts/test-type-preview.ts
-
- - name: Type i18n rig
- # Eight languages in one file: every catalogue holds the same keys,
- # every {placeholder} survives translation, no key outlives the string
- # it came from, and the packed table matches the catalogues it was
- # built from.
- run: node scripts/test-type-i18n.ts
-
- - name: Type styles rig
- # Named paragraph styles, and the additivity rule: a document with no
- # doc.styles must render byte-identically to before the feature.
- run: node scripts/test-type-styles.ts
-
- - name: Type move rig
- # Reordering moves whole UNITS, so a drag can never tear a table in
- # half or drop a paragraph between two bullets.
- run: node scripts/test-type-move.ts
-
- - name: Type embed rig
- # Embedded Bento artifacts, and the render boundary that refuses a
- # script rather than sanitising one.
- run: node scripts/test-type-embed.ts
-
- - name: Type share-copy rig
- # A view-only copy carries the room it follows and NO private key —
- # not the owner's, not a legacy writer key, not an invite — whatever the
- # source document held; an editor copy writes only through its own
- # fresh, revocable invite. Every copy is minted in type/src/share.ts.
- run: node scripts/test-type-share.ts
-
- - name: Slides share-copy rig
- # The view-only and editor copies (slides/src/share.ts) carry only the
- # kernel allowlist — no private key, a fresh invite, no sync on a reader —
- # and strip any EMBEDDED document's envelope. Runs the real builders with
- # real keys through the ts hook, like the type rig above.
- run: node scripts/test-slides-share.ts
-
- - name: Stylesheet brace balance
- # Every tracked stylesheet's braces balance. A merge seam that eats one
- # `}` leaves CSS that still builds — an unclosed `@media print {` makes
- # every later rule print-only, and the app ships unstyled while tsc, the
- # build and the shell gate all pass.
- run: node scripts/test-css-balance.ts
-
- - name: Type chrome rig
- # Where controls live: nothing in two menus, no inserts in the
- # overflow, and every element the chrome reaches for actually exists —
- # a null lookup there has silently broken the boot twice.
- run: node scripts/test-type-chrome.ts
-
- - name: Type restore-gate rig
- # A snapshot kept in the browser (Unsaved changes banner, Version
- # history) is foreign input: on file:// any local page can write it.
- # Restoring one never brings its own docId, room/keys or mode, and an
- # honest one keeps the open file's sharing. Replace from JSON — a
- # document the person chose — is NOT gated. Counterpart of slides'.
- run: node scripts/test-type-restore-gate.ts
-
- - name: Type signature-chain rig
- # Canonical JSON and the chained signatures over it. A canonicalization
- # bug does not crash — it silently fails valid documents or passes
- # tampered ones — so this pins determinism, key order by UTF-16 code
- # unit, volatile fields at every depth, and that the signer's NAME is
- # inside the signed text (it was once only displayed beside the tick).
- run: node scripts/test-type-canon.ts
-
- - name: Type compare rig
- # Comparing with another file is a VIEW: nothing commits, and the diff
- # runs from that file to this one. Asserts which side is <del> and which
- # is <ins>, because a reversed diff keeps the same change count and a
- # count-only check cannot see it.
- run: node scripts/test-type-compare.ts
-
- - name: Type hanging-punctuation rig
- # Optical margin alignment may only PAINT. A line break is held only
- # when each line's first and last character both stay on it — a check
- # on first characters alone passed a real reflow.
- run: node scripts/test-type-micro.ts
-
- - name: Type fields and mail-merge rig
- # Fields are atoms resolved at render, never stored resolved. Merged
- # letters get a fresh docId each and carry no credentials, signatures,
- # comments or revision history from the template.
- run: node scripts/test-type-fields.ts
-
- - name: Type live-cells rig
- # A field bound to an embedded sheet by row label and column heading,
- # so inserting, reordering or sorting rows cannot re-point a sentence
- # at a different number.
- run: node scripts/test-type-live.ts
-
- - name: Clipboard embedded-font rig
- run: |
- slides/node_modules/.bin/esbuild scripts/test-clipboard.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-clipboard.mjs"
- node "$RUNNER_TEMP/test-clipboard.mjs"
-
- - name: Restore gate rig
- # A snapshot kept in the browser (recovery banner, Version history) is
- # foreign input: gated like a pasted clip, and it never brings its own
- # docId, live-session credentials or file mode.
- run: |
- slides/node_modules/.bin/esbuild scripts/test-slides-restore-gate.ts --bundle --platform=node --format=esm --outfile="$RUNNER_TEMP/test-slides-restore-gate.mjs"
- node "$RUNNER_TEMP/test-slides-restore-gate.mjs"
-
- - name: CRDT property-removal rig
- # Removing a property travels as a `set` op with `v` ABSENT, and the
- # receiving replica threw on it: JSON.stringify(undefined) is undefined,
- # and a debug line sliced it. Live in shipped files. The convergence rig
- # missed it through 300 seeds because its generator assigns properties
- # and never removes one — a property-based rig only explores the
- # mutations it was taught.
- run: node scripts/test-crdt-delprop.ts
-
- - name: CRDT convergence rig
- # 40 seeds locally; deeper on CI where the seconds are free.
- run: SEEDS=300 node scripts/test-sync.ts
-
- - name: CRDT equivalence rig (baseline vs candidate, byte for byte)
- # Convergence is the weaker property: an engine that converges with
- # ITSELF while minting different bytes than the shipped engine passes
- # the step above and silently splits every bento/slides file in the
- # field. This step asserts byte-identity instead.
- #
- # The baseline is a FROZEN copy of the engine as shipped
- # (scripts/lib/sync-baseline-frozen.ts), so this run is live from here
- # on: it compares the working engine against the bytes every file in
- # the field was written by. REQUIRE_LIVE=1 fails the build if the
- # candidate is ever repointed at something that resolves back to the
- # baseline — the quiet way a gate stops gating.
- run: REQUIRE_LIVE=1 SEEDS=200 STEPS=60 ACTORS=4 node scripts/test-sync-equiv.ts
-
- - name: CRDT document-shape seam
- # The equivalence rig proves a NEGATIVE — that the parameterized engine
- # still mints the bytes shipped files were written with — and a
- # parameterization that quietly did nothing would pass it. This proves
- # the positive: a second shape (pages→blocks) produces an engine that
- # actually works, keys nodes on the composite pageId+blockId, and
- # restores as itself. Also pins the constructor contract: the shape has
- # no default, because a default is how a spaces call site silently ends
- # up holding slides' shape.
- run: node scripts/test-sync-shape.ts
-
- - name: bento/spaces under the shared engine
- # Convergence for the pages/blocks binding, AND a report on whether
- # what the replicas converge on is a legal bento/spaces document.
- # Those are different questions: page.blocks is flat and in pre-order,
- # while the engine merges `parent` as an ordinary register and order as
- # a position key — two independent domains describing one tree. The
- # format half is REPORTED, not asserted, because the fix is a decision
- # nobody has taken yet; STRICT=1 turns it into a gate the day it is.
- run: SEEDS=250 STEPS=80 ACTORS=4 node scripts/test-sync-spaces.ts
-
- - name: collaborative text on a parent node
- # The token RGA — what lets two people type in one paragraph without
- # destroying each other's work — was reachable only on CHILD nodes,
- # because both shipped apps put their text there. bento/type does not:
- # a block IS the paragraph. Bound naively it would get a
- # last-writer-wins register for prose and lose an edit SILENTLY, with a
- # document that stays valid and converges. Every other sync rig stayed
- # green through that bug, so this one carries a negative control: the
- # same scenario with the RGA off MUST lose an edit.
- run: node scripts/test-sync-parent-text.ts
-
- - name: a flat document shape
- # bento/type is one level deep — `body` holds blocks and nothing sits
- # beneath them — so `children` is null and there is no element layer.
- # Binds type's real shape and checks both halves: text still merges
- # token-by-token, and the document keeps its shape. The second matters
- # because an engine that quietly wrote `elements: []` onto every block
- # would converge perfectly while corrupting the format.
- run: node scripts/test-sync-flat.ts
-
- - name: bento/type under the shared engine
- # Convergence for the flat ('body', null, 'text') binding, AND a report
- # on whether what the replicas converge on is a legal bento/type
- # document. Those are different questions: `text` merges token by token
- # through the RGA while `marks` and `notes` — character offsets INTO
- # that text — merge as ordinary registers, so two legal concurrent
- # edits can converge on offsets that no longer describe the text they
- # index. Reported, not asserted, exactly as the spaces tree question
- # is: it is a format decision nobody has taken. STRICT=1 makes it a
- # gate the day one is.
- run: SEEDS=250 STEPS=80 ACTORS=4 node scripts/test-sync-type.ts
-
- - name: the sync session layer
- # The session — differ hook, shadow, presence, catch-up, the empty
- # document repair — had NO tests before it was moved into the kernel
- # and parameterized for three apps. This was written against the
- # implementation as it shipped and run unchanged after the move, which
- # is the only thing that makes "behaviour is identical" a claim rather
- # than a hope. It drives the REAL session over the REAL store through a
- # REAL BroadcastChannel; two sessions in one process are two tabs.
- # The last four sections bind bento/type to the same kernel session —
- # flat document, text on the parent, a store with one listener and no
- # dirty flag — so a surviving slides assumption shows up there.
- run: node --no-warnings scripts/test-sync-session.ts
-
- - name: Room snapshot carries no capability fields
- # Every snapshot path (relay upload, fork broadcast, re-snap, flush-time
- # fork snap) builds from one helper that strips the never-synced fields.
- run: node --no-warnings scripts/test-sync-snapshot-collab.ts
-
- - name: Remote ops and snapshots can't rewrite identity, capability or modes
- # The never-synced set is also the receive filter (applySet and
- # mergeSnapshot), and no prototype-shaped name reaches any object.
- run: node --no-warnings scripts/test-sync-inbound-docfields.ts
-
- - name: Doc-level sync allowlist (field-class map)
- # The other half of the never-synced set: when an app binds a class map,
- # a peer emits only content-class doc keys and ignores non-content ones
- # inbound, whatever the sender claims; an unknown key (a newer build's
- # field) is applied but never re-emitted. With no map it is byte-for-byte
- # the shipped denylist. skipDoc is the floor under both.
- run: node scripts/test-sync-allowlist.ts
-
- - name: Sync override for a history-class key (shape().syncHistory)
- # A field's copy class and its sync decision can diverge: type classes
- # `comments` history (dropped from reader/export copies) but comments
- # must still flow live. syncHistory names such a key — emitted and
- # accepted though non-content, with its 1.2.7 wire shape unchanged so a
- # bound build stays mixed-version-compatible with an unbound one.
- # Restricted to history-class keys at runtime (shape throws) and at
- # compile time (historySyncKeys); skipDoc is still the floor.
- run: node scripts/test-sync-history-override.ts
-
- - name: Slides sync allowlist rig
- # Slides binds its field-class map (slides/src/docclass.ts) into
- # SLIDES_SHAPE: every key that synced before is still content, a
- # non-content or unknown doc key mints no op, non-content is refused
- # inbound, and an unknown key from a peer is applied but never echoed.
- run: node scripts/test-slides-sync-allowlist.ts
-
- - name: the spaces binding of the sync session
- # Only what bento/spaces answers DIFFERENTLY, because three of the five
- # host answers are not slides' answers and each one is invisible until
- # two people are live: a repair id that must be DERIVED (a spare blank
- # slide is one click to delete; a spare page is a phantom), a view that
- # clamps by page identity to the nearest surviving ANCESTOR rather than
- # to home, and a remote op that must not raise this app's 'doc' event —
- # which paints "Edited" and would credit a colleague's typing to you.
- # The last section is two real sessions over a real BroadcastChannel.
- run: node --no-warnings scripts/test-sync-spaces-session.ts
-
- home-android-unit:
- runs-on: ubuntu-latest
- timeout-minutes: 20
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-java@v4
- with:
- distribution: temurin
- java-version: 17
- # RecoveryTest cross-checks Bouncy Castle's Argon2id against Node's native
- # one on random cases every run (security §35), and never skips without it.
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Android host unit tests
- # The JVM rigs for home/android: which web origin a document may run
- # under (a different file at a path a document used before must never
- # read its storage), the signed new-document verifier, and the Kotlin
- # port of the document index against home/fixtures. They need no
- # emulator, and until this job nothing ran them — the corpus note above
- # said "the Kotlin port under Gradle" of a step that did not exist.
- # The runner image ships the Android SDK (ANDROID_HOME); the wrapper is
- # pinned at 8.14.3 because AGP 8 cannot run on Gradle 9.6+.
- working-directory: home/android
- run: ./gradlew --no-daemon testDebugUnitTest
-
- type-find-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone document
- run: |
- npm ci --prefix type
- npm run build:single --prefix type
- - name: Find opens from the button, Cmd-F and Ctrl-F
- # The find box lives in Navigate → Results; a selector naming a tab
- # that no longer existed made both do nothing, silently.
- run: node scripts/test-type-find-browser.mjs
-
- slides-font-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone documents
- run: |
- npm ci --prefix slides
- npm run build:single --prefix slides
- npm run build:sealtest --prefix slides
- - name: The sealed TEST document in Chromium
- # bento/id §E (security §31): the shared helper boots the build:sealtest
- # shell with the identity seal set before the app's own boot, proves it
- # took, and the saved file carries an identity-sealed envelope, a
- # neutral <title> and filename, no preview, and no plaintext; the
- # unsealed control shows the same checks can see a leak.
- run: node scripts/test-sealed-boot.mjs
- - name: A sealed slides deck keeps its content out of IndexedDB in Chromium
- # The autosave and ⌘S checkpoints write no recovery copy or version for
- # a deck sealed by identity; the password menu stays keyed to the
- # password; the unsealed control shows the scan sees a leak.
- run: node scripts/test-slides-sealed-guards-browser.mjs
- - name: Exercise the packaged documents in Chromium
- # Real UI and serialization, offline; delayed mock writes expose save races.
- run: |
- node scripts/test-slides-font-lifecycle-browser.mjs
- - name: Write chrome follows the copy's role in Chromium
- # canWriteDeck is an allowlist that fails closed: an audience, reader or
- # unknown-role copy arriving in a running editor (dropped, loadDoc) gets
- # no write actions and is locked; owner and writer copies keep theirs.
- run: node scripts/test-slides-audience-gate-browser.mjs
- - name: PowerPoint converter links in Chromium
- # Save as → Import PowerPoint… (/convert?from=pptx) and Export for
- # PowerPoint… (/convert), in that order after Replace from JSON…, each
- # opens only its URL in a new tab with no opener, and says it needs
- # the network.
- run: node scripts/test-slides-import-link-browser.mjs
- - name: The unsupported-browser notice names the app in Chromium
- # Each app's shell, built with the flags its own build:single passes,
- # says what it is ("a bento/slides presentation", …) — it said "a
- # bento/dash spreadsheet" in every app.
- run: node scripts/test-shell-unsupported-notice-browser.mjs
- - name: Under-specified documents boot in Chromium
- # parseDoc fills required fields only where absent and drops elements
- # that cannot render; unknown keys and element types survive (additivity).
- run: node scripts/test-slides-minimal-doc-browser.mjs
- - name: A table with no style opens in Chromium
- # A full document whose table omits `style` (absent, null, a string)
- # loads by file, loadDoc and Replace from JSON, gets the theme's table
- # style, and selecting it opens the table panel without a page error.
- run: node scripts/test-slides-table-nostyle-browser.mjs
- - name: Top bar in Chromium
- # 30px row and 44px phone targets, the wordmark as a named button, Save
- # primary in both themes, and N language rebuilds leaving one set of
- # window/document listeners and bar observers.
- run: node scripts/test-slides-topbar-browser.mjs
- - name: One field look in Chromium
- # Every chrome text field, select and textarea (each element kind's
- # panel, About, the save-as dialogs, Share, comments) has the shared
- # field look and amber focus ring in both themes, never the UA's dress.
- run: node scripts/test-slides-fields-browser.mjs
- - name: A password-protected deck opens in Chromium
- # One password gate and no loader failure card (1.2.0–1.2.8 showed
- # three gates under "every loader path was refused"); wrong then right
- # password; the same with only the blob import allowed; the ⌘S re-save
- # and the self-update re-splice open again.
- run: node scripts/test-slides-encrypted-open-browser.mjs
- - name: The loader reads what the app published in Chromium
- # Toy shells from the real postbuild: an app that is running, locked at
- # a gate, or refused (and threw) runs ONCE and gets no loader card; only
- # an app that published nothing does. Every path, blob only, import.meta.
- run: node scripts/test-shell-loader-published-browser.mjs
- - name: Top bar holds still in Chromium
- # #546: a real auto-save "Saved" flash and a file-chip change (rename to
- # the file's name, then undo) leave Undo/Redo exactly where they were,
- # on the desktop and the folded phone bar.
- run: node scripts/test-slides-topbar-stable-browser.mjs
- - name: Chrome rulings in Chromium
- # D2 menu descriptions (readable both themes, ARIA-wired, scroll on a
- # short window), D4 dialog titles, D8 help shortcuts, the compact Save
- # caret, phone menu rows, the designed focus ring, dark menu shadow.
- run: node scripts/test-slides-chrome-rulings-browser.mjs
- - name: Code in a text box in Chromium
- # Real typing: a ``` fence becomes a Code element (in place, or split
- # out of the text around it), select + ` wraps lines in <code>, pasted
- # fences convert, and an unclosed fence stays text.
- run: node scripts/test-slides-code-fence-browser.mjs
- - name: Copy several slides in Chromium
- # Two selected thumbnails → ⌘C copies both, in order; a Shift-click
- # range across a parent copies parents only, never its states; plural
- # and singular toasts.
- run: node scripts/test-slides-copy-slides-browser.mjs
- - name: Rounded tables in Chromium
- # A rounded table whose rows outgrow its box shows its last row (#494),
- # keeps rounded corners on its real bottom, and a short one still
- # fills its box; tables without a radius are unchanged.
- run: node scripts/test-slides-table-radius-browser.mjs
- - name: Paste position in Chromium
- # ⌘C then ⌘V onto another slide keeps the element's position; onto the
- # source slide it steps +20 and cascades (#569).
- run: node scripts/test-slides-paste-position-browser.mjs
- - name: Save queue in Chromium
- # Real ⌘S and auto-save with the file write held open: an edit made
- # during a write stays dirty, writes never overlap, the dot goes out
- # only when the deck on screen is the one on disk.
- run: node scripts/test-slides-save-browser.mjs
- - name: Recovery-off notice in Chromium
- # Under a per-document store host that refuses the recovery copy, the
- # save status says crash recovery is off (approved wording), once, held
- # long enough to read; the dot stops claiming a backup; a host that
- # keeps the copy gets no message; never for an encrypted deck.
- run: node scripts/test-slides-recovery-off-browser.mjs
- - name: Save a copy and the older-snapshot banner in Chromium
- # "Save a copy…" says "Copy saved — you are still editing the original",
- # keeps the chip, title and dot on the original, and the next ⌘S writes
- # the original with no picker; an older recovery snapshot gets the
- # warning banner (Keep the file is the default and deletes nothing), a
- # newer one the plain banner that claims nothing.
- run: node scripts/test-slides-save-copy-browser.mjs
- - name: Ghost Cut in Chromium
- # ⇧⌘X fades the selection by CSS (shadowed elements too) and copies it;
- # a ghost is never selected and the pointer passes through it; Esc
- # restores; paste moves it to the pointer in one undo step, across
- # slides, without two elements sharing an id on one slide.
- run: node scripts/test-slides-ghost-cut-browser.mjs
- - name: Bullet indent in Chromium
- # Tab / Shift+Tab nest and un-nest list items (and typed bullets) while
- # editing, with the caret kept and ⌘Z right after; the panel's Indent /
- # Outdent do the same; committed, one undo step; Tab outside a list —
- # a plain box, a table cell — is unchanged.
- run: node scripts/test-slides-bullet-indent-browser.mjs
- - name: Leaving an inline code run in Chromium
- # A text box that already ends a line in `code` (reopened, pasted):
- # typing at the end of that line is plain text, at the box's end or
- # before a line break; opening and closing a box changes nothing.
- run: node scripts/test-slides-code-run-exit-browser.mjs
- - name: Connectors route on every slide in Chromium
- # #493: a deck saved or loaded with stale connector endpoints opens with
- # every slide's connectors on their elements' borders (thumbnail too),
- # without dirtying the deck or making an undo step.
- run: node scripts/test-slides-connectors-browser.mjs
- - name: Caret at the start of a line in Chromium
- # #547: with the caret at a text box's left edge, nothing paints over
- # it — the editing ring is an outline held off the box, Moveable's
- # leftover lines are hidden for the edit, and a screenshot of the strip
- # beside the caret has no ring-blue in it; the text does not move.
- run: node scripts/test-slides-caret-ring-browser.mjs
-
- dash-fields-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone document
- run: |
- npm ci --prefix dash
- npm run build:single --prefix dash
- - name: Every dash field wears the suite's one field look
- # Slides' rig, ported: every text field, select and textarea on 17
- # surfaces, light and dark, has the 1px --line border, --field fill,
- # 6px radius and 26px height, and the --accent-ink focus ring; each
- # surface must show fields in its own container, and a planted
- # browser-dressed field must be flagged.
- run: node scripts/test-dash-fields-browser.mjs
- - name: The dash properties panel shows only what applies
- # Per column type on a dataset, Number format / Total / Formula appear
- # only where they apply, with no money or formula placeholders; one
- # Number format control on both sheet kinds (Custom… reveals the
- # pattern, Apply to writes a cell override); unset colour wells paint
- # the field's own fill, measured from pixels with a set-colour
- # positive control, light and dark; bare checkboxes; a formula over
- # Money is Money and one column never mixes grouping.
- run: node scripts/test-dash-panel-context-browser.mjs
-
- dash-gate-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone document
- run: |
- npm ci --prefix dash
- npm run build:single --prefix dash
- npm run build:sealtest --prefix dash
- - name: An encrypted or unopenable dash file opens to its gate
- # window.bento = { format, locked: true } before the password gate and
- # the refusal page, so the shell's loader counts the app as mounted
- # instead of re-running it and failing over the gate; unlocking
- # replaces it with the real workbook.
- run: node scripts/test-dash-gate-browser.mjs
- - name: A sealed dash workbook writes no plaintext of itself
- # bento/connect §E on the shared sealed TEST document: recovery snapshots,
- # the version timeline, the preview, recovery read-back and drop-open
- # all ask isBodySealed(); neutral title while sealed, matching the saved
- # file's title. Each row has an unsealed control that shows the leak.
- run: node scripts/test-dash-sealed-browser.mjs
-
- home-ios-swift:
- # The home/ios Swift rigs need CryptoKit, Security and LocalAuthentication,
- # so on the ubuntu validate job they print SKIPPED and pass. Here they run
- # for real, and a rig that reports SKIPPED FAILS the step, so a missing
- # toolchain can never pass quietly.
- runs-on: macos-latest
- timeout-minutes: 20
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Toolchain
- run: sw_vers && xcrun swiftc --version
- - name: Swift rigs (a skip fails)
- shell: bash
- run: |
- set -o pipefail
- rigs=(
- test-tray-releases.mjs
- test-home-origin.mjs
- test-home-docstore-ios.mjs
- test-home-id-keys.mjs
- test-home-id-statements.mjs
- test-home-id-agent.mjs
- test-home-id-recovery.mjs
- test-home-spotlight.mjs
- )
- for rig in "${rigs[@]}"; do
- echo "::group::$rig"
- node "scripts/$rig" | tee "$RUNNER_TEMP/rig.out"
- echo "::endgroup::"
- if grep -q 'SKIPPED' "$RUNNER_TEMP/rig.out"; then echo "::error::$rig skipped on macOS"; exit 1; fi
- done
-
- home-ios-simulator:
- # Builds the iOS app and drives it on a simulator: the app-switcher snapshot
- # iOS writes to disk shows nothing of a sealed document. The rig reads back
- # the snapshots iOS itself wrote; a skip fails here too.
- runs-on: macos-latest
- timeout-minutes: 30
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Toolchain
- run: |
- brew install xcodegen
- sw_vers && xcodebuild -version && xcrun simctl list runtimes
- - name: Snapshot cover (a skip fails)
- shell: bash
- run: |
- set -o pipefail
- node scripts/test-home-snapshot-cover.mjs | tee "$RUNNER_TEMP/rig.out"
- if grep -q 'SKIPPED' "$RUNNER_TEMP/rig.out"; then echo "::error::snapshot cover skipped on macOS"; exit 1; fi
-
- home-origin-probe-browser:
- # The probe that decides whether a file opened for the first time may keep
- # the storage origin it had before origins followed the file. It runs in
- # WebKit on iOS, so it's tested in WebKit, against storage laid out the way
- # the kernel lays it out AND against a real slides deck's own autosave.
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps webkit
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the slides shell the real-deck case opens
- run: |
- npm ci --prefix slides
- npm run build:single --prefix slides
- - name: Origin probe in WebKit
- run: node scripts/test-home-origin-probe.mjs
-
- type-cantopen-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone document
- run: |
- npm ci --prefix type
- npm run build:single --prefix type
- - name: The can't-open message shows the file's details as text
- run: node scripts/test-type-cantopen-browser.mjs
-
- spaces-save-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone documents
- run: |
- npm ci --prefix spaces
- npm run build:single --prefix spaces
- npm run build:sealtest --prefix spaces
- - name: Exercise the packaged documents in Chromium
- # Real UI and serialization, offline; delayed mock writes expose save races.
- run: |
- node scripts/test-spaces-save-browser.mjs
- - name: A sealed space writes nothing readable (spaces, Chromium)
- # The build:sealtest shell booted identity-sealed through the shared
- # helper, plus a password space: no recovery snapshot or version in
- # IndexedDB (also across a reload), no preview and no plaintext in the
- # saved file, a neutral tab title, no recovery-off notice. The unsealed
- # control shows each check can see a leak.
- run: node scripts/test-spaces-sealed-browser.mjs
- - name: One field look in Chromium (spaces)
- # Port of slides' fields rig: every chrome text field, select and
- # textarea (inspector incl. "Also known as", dialogs, view popovers,
- # pickers, Share, comments, a designed space, the password gate) has
- # the shared field look and amber focus ring in light, dark and
- # OS-dark, never the UA's dress. "Also known as" shipped in it.
- run: node scripts/test-spaces-fields-browser.mjs
- - name: An encrypted space opens (one password gate, no loader failure)
- run: node scripts/test-spaces-encrypted-browser.mjs
- - name: Spaces recovery banner and recovery-off notice in Chromium
- # An older recovery snapshot gets the warning with "Keep the file" the
- # focused default (keeping deletes nothing; "Restore anyway" restores);
- # a newer or equal one the plain banner that claims nothing; a host
- # that refuses the recovery copy gets the notice once, held to read;
- # pt and de show slides' words. Planted in bento-spaces-autosave.
- run: node scripts/test-spaces-recovery-browser.mjs
- - name: bento/id privacy notice and web deletion page (build rules + Chromium)
- # A publishing build refuses any page still carrying a __PLACEHOLDER__;
- # the deletion page's CSP pins its exact inline script and style and
- # lets it reach only the directory. In Chromium with the API mocked:
- # the start → code → done flow, its refusals, and that it never says
- # whether an address exists.
- run: node scripts/test-id-pages-browser.mjs
- - name: bento.page passkey association files never publish a placeholder
- # scripts/well-known.mjs fills /.well-known/apple-app-site-association
- # and assetlinks.json from site-src/well-known/ once the Apple team id
- # and the Play signing fingerprint exist. It writes only what it was
- # given, refuses a malformed value, and never emits a placeholder: the
- # platforms cache these files, so a wrong one is worse than none.
- run: node scripts/test-well-known.ts
-
- type-fields-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the tested standalone document
- run: |
- npm ci --prefix type
- npm run build:single --prefix type
- - name: Every chrome field wears the suite's one field look, light and dark
- # The THE FIELD block copied from slides: border, fill, radius, height and
- # the focus ring, measured on twelve real surfaces, plus a planted
- # browser-default field that must be flagged.
- run: node scripts/test-type-fields-browser.mjs
-
- home-desktop-agent:
- runs-on: ubuntu-24.04
- timeout-minutes: 20
- steps:
- - uses: actions/checkout@v4
- - name: Desktop agent against the bento/id vectors
- # home/desktop/agent is the Windows/Linux identity agent core. Its
- # statements port must reach every verdict AND reason in
- # kernel/fixtures/identity-v1.json (re-read every run, never pinned), plus
- # builder round-trips, three tamperings per accepted row, spendCalled
- # on every cns row, and the frozen display table. A missing fixture
- # fails; it never skips.
- working-directory: home/desktop/agent
- run: cargo test
- - name: Desktop agent TPM rigs (two software TPMs)
- # The Linux key store against a real TPM 2.0 (swtpm): the routine key
- # signs inside the TPM; the consent key and the sealed account key need
- # the PIN on every use (a wrong PIN is the TPM's own AUTH_FAIL); the key
- # files are useless on a SECOND TPM (cannot be copied off the machine);
- # and a second connection without the PIN gets neither, while the
- # routine key stays usable, which is the stated desktop residual.
- working-directory: home/desktop/agent
- run: |
- sudo apt-get update -qq
- sudo apt-get install -y -qq libtss2-dev swtpm swtpm-tools >/dev/null
- ./tpm-rig.sh
- - name: Desktop agent no-TPM keyring rigs (gnome-keyring)
- # On a Linux machine without a usable TPM the agent falls back to the
- # Secret Service. Against a real gnome-keyring in a D-Bus session: the
- # routine key signs and verifies; there is no consent key, so consent is
- # refused (AAL3 routed elsewhere); wipe removes the keys; and the stated
- # exposure is asserted: a second connection reads the account key with
- # no prompt once the keyring is unlocked.
- working-directory: home/desktop/agent
- run: |
- sudo apt-get install -y -qq gnome-keyring dbus >/dev/null
- ./keyring-rig.sh
-
- type-sealed-browser:
- runs-on: ubuntu-latest
- timeout-minutes: 15
- steps:
- - uses: actions/checkout@v4
- - uses: actions/setup-node@v4
- with:
- node-version: 24
- - name: Install browser test runtime
- # Pinned outside app packages: browser automation is not shipped in documents.
- run: |
- npm install --prefix "$RUNNER_TEMP/bento-browser" --no-package-lock --ignore-scripts [email protected]
- "$RUNNER_TEMP/bento-browser/node_modules/.bin/playwright" install --with-deps chromium
- echo "PLAYWRIGHT_MODULE=$RUNNER_TEMP/bento-browser/node_modules/playwright/index.mjs" >> "$GITHUB_ENV"
- - name: Build the sealed TEST shell
- run: |
- npm ci --prefix type
- npm run build:sealtest --prefix type
- - name: A sealed document leaves no plaintext and shows a neutral title
- run: node scripts/test-type-sealed-browser.mjs
+ - name: Install jsdom for the rigs' DOM halves
+ # Pinned outside the app packages, like the browser runtime in the
+ # ci-<zone>.yml jobs: jsdom is test tooling, never shipped in a document.
+ # The encrypted-title, type preview and type font rigs import it from
+ # the repo root. Until this step existed they skipped in every run.
+ run: npm install --prefix "$GITHUB_WORKSPACE" --no-save --no-package-lock --no-audit --no-fund [email protected]
+
+ - name: Rig steps fail on a skip
+ # Puts scripts/ci on PATH, so every slice step below can declare
+ # `shell: bento-step {0}`: a rig that reports a skip CI does not allow
+ # fails its step. Reasoning and allowlist: scripts/lib/ci-skips.mjs.
+ run: echo "$GITHUB_WORKSPACE/scripts/ci" >> "$GITHUB_PATH"
+
+ # Everything below is still THIS job — the required `validate` check —
+ # run as composite actions, one per zone, each in
+ # .github/actions/validate-<zone>/action.yml. They run in this order on
+ # this runner, so a slice can use whatever the slices before it installed
+ # and built: each app slice builds its own shell, and the slices after
+ # the apps (convert, kernel, home, shared) can rely on all four shells.
+ #
+ # A new rig goes at the END of its own zone's slice, never in this file:
+ # this file used to hold every step, and every zone appending at the
+ # same few anchors made nearly every open PR conflict with the next
+ # merge. This list changes only when a slice is added.
+ #
+ # A zone's jobs that are NOT part of the required check live in
+ # .github/workflows/ci-<zone>.yml, each job id unchanged.
+ - name: validate (slides)
+ uses: ./.github/actions/validate-slides
+
+ - name: validate (spaces)
+ uses: ./.github/actions/validate-spaces
+
+ - name: validate (dash)
+ uses: ./.github/actions/validate-dash
+
+ - name: validate (type)
+ uses: ./.github/actions/validate-type
+
+ - name: validate (convert)
+ uses: ./.github/actions/validate-convert
+
+ - name: validate (kernel)
+ uses: ./.github/actions/validate-kernel
+
+ - name: validate (home-ios)
+ uses: ./.github/actions/validate-home-ios
+
+ - name: validate (home)
+ uses: ./.github/actions/validate-home
+
+ - name: validate (home-webext)
+ uses: ./.github/actions/validate-home-webext
+
+ - name: validate (shared)
+ uses: ./.github/actions/validate-shared
diff --git a/docs/DECISIONS.md b/docs/DECISIONS.md
index 05055aa3..8aef1e7c 100644
--- a/docs/DECISIONS.md
+++ b/docs/DECISIONS.md
@@ -11486,3 +11486,61 @@ not yet saved is already a secret. The payload is a bare boolean, fire-and-forge
and not deduplicated: the host can only ADD blanking, so a missed `true` is the
only failure and a redundant post costs nothing. Hosts that don't declare
`'seal'` are sent nothing.
+
+## 2026-10-18 — CI is split by zone; `validate` stays one required job
+
+`.github/workflows/ci.yml` held every CI step, and every zone added its rig at
+the same few places: the end of its section of `validate`, or after the last
+job. So nearly every open PR conflicted with whichever PR merged before it. The
+file is now split by zone, and nothing about merging changes:
+
+- **The required check is still `validate`, and it is still ONE job.** Its
+ steps live in composite actions, one per zone
+ (`.github/actions/validate-<zone>/action.yml`). `ci.yml` runs them in order
+ on the same runner. Each app's slice builds its own shell, and the convert,
+ kernel, home and shared slices run after all four apps, so every step has at
+ least what was installed and built before it ran in the old order. Composite
+ actions were chosen over reusable workflows because reusable workflows would
+ make each zone a separate job. That would rename checks, rebuild every shell
+ once per job, and turn `validate` into an aggregator, where a skipped
+ dependency reads as success.
+- **Jobs outside `validate` live in `.github/workflows/ci-<zone>.yml`**, with
+ their job ids unchanged (the job id is the check name). Like before, they
+ are not required checks.
+- **Where a new rig goes:** at the end of your own zone's slice, or as a job in
+ your zone's `ci-<zone>.yml`. Never in `ci.yml`, which changes only when a
+ slice is added. Composite steps must say `shell:` on every `run:`.
+- `scripts/test-ci-registered.ts` and `test-spaces.mjs --manifest` read all of
+ it through `scripts/lib/ci-files.mjs`. An action counts only if a workflow
+ runs it, and the rig fails on an action nobody uses or a rig-running workflow
+ with no `pull_request` trigger. Those are the two silent holes a split opens.
+
+What this costs: in the Actions UI, a failing `validate` names the zone slice.
+To find the failing step inside it, open that slice's log.
+
+
+## 2026-10-18 — Under CI, a rig that skips fails its step
+
+A rig that can't run what it needs prints a skip line and exits 0, so its step
+went green. Three rigs had skipped in every CI run since they were written:
+encrypted-title (the #742 guard for shipped slides), type preview and type
+font. All three print "skipped: jsdom is not installed", and CI never
+installed jsdom.
+
+- `validate` installs a pinned jsdom at the repo root, as test tooling (it
+ never ships in a document). All three rigs now run.
+- Every rig step runs under `scripts/ci/bento-step`: the `shell:` of every
+ validate slice step, and the default shell of the `ci-<zone>.yml` jobs.
+ It runs the script as `shell: bash` would, then fails the step on any
+ output line that reads as a skip. The one exception is
+ `ci-home-android.yml`, where Gradle prints SKIPPED as a task outcome.
+- **The allowlist** (`ALLOWED_SKIPS` in `scripts/lib/ci-skips.mjs`) names the
+ rig, the exact line and the reason. It holds the dash xlsx/zip interop
+ checks, which need LibreOffice or a real Excel-made workbook, and, on Linux
+ only, the three home/ios Swift rigs, which need Apple frameworks and run for
+ real on a macOS job. An allowed line counts only in its own rig's step.
+- `scripts/test-ci-skips.mjs` is the positive control. It checks the detector
+ against the exact lines from a real main run, and runs the wrapper end to
+ end, including the encrypted-title rig with jsdom hidden, which must turn the
+ step red. It also checks that every allowlist entry's rig still prints its
+ line, and that every rig step in every CI file runs through the wrapper.
diff --git a/scripts/ci/bento-step b/scripts/ci/bento-step
new file mode 100755
index 00000000..dac26866
--- /dev/null
+++ b/scripts/ci/bento-step
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+# SPDX-License-Identifier: MIT
+# Copyright (c) 2026 The Bento authors
+# The shell every CI rig step runs under: `shell: bento-step {0}`.
+#
+# It runs the step's script exactly as `shell: bash` would (bash, -e, pipefail,
+# no profile), shows its output as it goes, and then FAILS THE STEP if any line
+# reads as a rig reporting a skip, unless scripts/lib/ci-skips.mjs allowlists
+# that skip. A rig that skips exits 0, so without this its step is green while
+# it checked nothing. The reasoning, and the allowlist, are in ci-skips.mjs.
+set -uo pipefail
+script="$1"
+here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+out="$(mktemp)"
+bash --noprofile --norc -eo pipefail "$script" 2>&1 | tee "$out"
+status=${PIPESTATUS[0]}
+if [ "$status" -ne 0 ]; then rm -f "$out"; exit "$status"; fi
+node "$here/skip-check.mjs" "$script" "$out"
+status=$?
+rm -f "$out"
+exit "$status"
diff --git a/scripts/ci/skip-check.mjs b/scripts/ci/skip-check.mjs
new file mode 100644
index 00000000..d6df611a
--- /dev/null
+++ b/scripts/ci/skip-check.mjs
@@ -0,0 +1,18 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// node skip-check.mjs <step script> <step output>: bento-step's verdict.
+// Exits 1 on any skip the allowlist does not cover. See ../lib/ci-skips.mjs.
+import { readFileSync } from 'node:fs'
+import { check } from '../lib/ci-skips.mjs'
+
+const [scriptPath, outPath] = process.argv.slice(2)
+const found = check(readFileSync(scriptPath, 'utf8'), readFileSync(outPath, 'utf8'))
+const bad = found.filter((f) => !f.entry)
+for (const f of found.filter((x) => x.entry)) console.log(`::notice::allowed skip (${f.entry.rig}): ${f.line} — ${f.entry.why}`)
+if (bad.length) {
+ for (const f of bad) console.log(`::error::a rig skipped under CI: ${f.line}`)
+ console.log(`\n${bad.length} skip(s) under CI. A skipped rig checked nothing, so this step fails.`)
+ console.log('Give the rig what it needs in CI (install it, build it), or, if CI genuinely cannot,')
+ console.log('add an entry with the reason to ALLOWED_SKIPS in scripts/lib/ci-skips.mjs.')
+ process.exit(1)
+}
diff --git a/scripts/lib/ci-files.mjs b/scripts/lib/ci-files.mjs
new file mode 100644
index 00000000..7f2dcd28
--- /dev/null
+++ b/scripts/lib/ci-files.mjs
@@ -0,0 +1,62 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// Which files make up CI, read as TEXT — for the registration checks
+// (scripts/test-ci-registered.ts, scripts/test-spaces.mjs --manifest).
+//
+// CI used to be one file, .github/workflows/ci.yml. It is now:
+// .github/workflows/*.yml every workflow (ci.yml holds the
+// required `validate` job; ci-<zone>.yml
+// hold each zone's other jobs)
+// .github/actions/validate-<zone>/action.yml
+// the zone slices `validate` runs as
+// composite actions, inside that job
+//
+// A step in an action file runs ONLY if some workflow says
+// `uses: ./.github/actions/<name>`. So `ciText` counts an action's text only
+// when a workflow uses it: an action nobody calls is a file of steps that never
+// execute, and treating it as registration would be the silent pass these
+// checks exist to prevent. `unusedActions` names them so the rig can fail.
+
+import { existsSync, readdirSync, readFileSync } from 'node:fs'
+import { join } from 'node:path'
+
+export const WORKFLOWS_DIR = '.github/workflows'
+export const ACTIONS_DIR = '.github/actions'
+
+export function ciFiles(root) {
+ const wdir = join(root, WORKFLOWS_DIR)
+ const workflows = existsSync(wdir)
+ ? readdirSync(wdir).filter((f) => /\.ya?ml$/.test(f)).sort()
+ .map((f) => ({ path: `${WORKFLOWS_DIR}/${f}`, text: readFileSync(join(wdir, f), 'utf8') }))
+ : []
+ const adir = join(root, ACTIONS_DIR)
+ const actions = existsSync(adir)
+ ? readdirSync(adir).sort()
+ .filter((d) => existsSync(join(adir, d, 'action.yml')))
+ .map((d) => ({ name: d, path: `${ACTIONS_DIR}/${d}/action.yml`, text: readFileSync(join(adir, d, 'action.yml'), 'utf8') }))
+ : []
+ // `uses: ./.github/actions/<name>` from a workflow or from another action.
+ const usesOf = (text) => [...text.matchAll(/^\s*(?:-\s+)?uses:\s*\.\/\.github\/actions\/([A-Za-z0-9._-]+)\s*$/gm)].map((m) => m[1])
+ const used = new Set()
+ const frontier = workflows.flatMap((w) => usesOf(w.text))
+ while (frontier.length) {
+ const n = frontier.pop()
+ if (used.has(n)) continue
+ used.add(n)
+ const a = actions.find((x) => x.name === n)
+ if (a) frontier.push(...usesOf(a.text))
+ }
+ return {
+ workflows,
+ actions,
+ usedActions: actions.filter((a) => used.has(a.name)),
+ unusedActions: actions.filter((a) => !used.has(a.name)),
+ missingActions: [...used].filter((n) => !actions.some((a) => a.name === n)).sort(),
+ }
+}
+
+/** Every workflow, plus every action a workflow actually runs, as one text. */
+export function ciText(root) {
+ const f = ciFiles(root)
+ return [...f.workflows, ...f.usedActions].map((x) => `# ---- ${x.path}\n${x.text}`).join('\n')
+}
diff --git a/scripts/lib/ci-skips.mjs b/scripts/lib/ci-skips.mjs
new file mode 100644
index 00000000..6d4cd95d
--- /dev/null
+++ b/scripts/lib/ci-skips.mjs
@@ -0,0 +1,113 @@
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// Under CI, a rig that reports a SKIP fails its step, unless the skip is on
+// the allowlist below.
+//
+// WHY. A rig that skips prints a line and exits 0, so its step is green, and a
+// green step reads as "checked". On main in October 2026, three rigs had
+// skipped in every CI run since they were written: the encrypted-title rig
+// (the #742 regression guard for shipped slides), the type preview rig and the
+// type font rig. All three print "skipped: jsdom is not installed", and CI never
+// installed jsdom. Nothing went red, so nothing said so. Each rig was right to
+// skip on a laptop without jsdom. What was missing was a rule that CI is never
+// that laptop.
+//
+// HOW. Every validate step runs through scripts/ci/bento-step (the `shell:` of
+// every composite step, and the default shell of the ci-<zone>.yml jobs that
+// run rigs), which keeps the step's output and hands it to `check` here. Any
+// line that reads as a skip report fails the step, unless an allowlist entry
+// below covers it.
+//
+// THE ALLOWLIST is a hazard and is meant to look like one, as in
+// test-ci-registered.ts. Each entry names the rig, the exact skip line, and why
+// CI cannot provide what the rig needs. scripts/test-ci-skips.mjs checks that
+// every entry's rig still exists and still prints that line, so an entry
+// can't outlive its reason quietly.
+
+/** A line that reports a skip, in any of the shapes the rigs print. */
+export function isSkipLine(raw) {
+ const line = raw.replace(/\x1b\[[0-9;]*m/g, '').trim()
+ // A CHECK whose subject is skipping ("ok a lapsed folder is skipped") is a
+ // pass, and a section header ("=== a SKIPPED level …") is a title.
+ if (/^(ok|✓|PASS|FAIL|===)(\s|$)/.test(line)) return false
+ return (
+ /\bSKIP(PED)?\b/.test(line) || // " SKIP no real .xlsx", "tray releases: SKIPPED —", "⚠ SKIPPED —"
+ /^(skip|skipped)\b/i.test(line) || // " skip needs Chrome …"
+ /^(--|\.\.)\s+skipped\b/i.test(line) || // " -- skipped: jsdom …", " .. skipped real-shell checks"
+ /—\s*skipped\b/i.test(line) || // "— skipped: jsdom is not installed —"
+ /\(skipped\)/i.test(line) // "0/0 checks passed (skipped)"
+ )
+}
+
+const notMac = () => process.platform !== 'darwin'
+
+/**
+ * Skips CI tolerates, each with its reason. `rig` must be named by the step's
+ * script; `line` must match the skip line. `when` limits an entry to the
+ * platforms where it is true.
+ */
+export const ALLOWED_SKIPS = [
+ {
+ rig: 'scripts/test-dash-xlsx.ts',
+ line: /SKIP\s+LibreOffice is not installed/,
+ why: 'the "does Excel\'s own reader open it" interop check needs LibreOffice, which the ubuntu runner does not ship; the format checks above it still gate',
+ },
+ {
+ rig: 'scripts/test-dash-xlsx.ts',
+ line: /SKIP\s+no real \.xlsx to import/,
+ why: 'needs a real Excel-made .xlsx, which the repo deliberately does not commit; the generated-workbook checks still gate',
+ },
+ {
+ rig: 'scripts/test-dash-zip.ts',
+ line: /SKIP\s+no real \.xlsx on this machine to read/,
+ why: 'same: no real Excel-made .xlsx in CI; the zip reader is still checked against unzip and python3',
+ },
+ {
+ rig: 'scripts/test-tray-releases.mjs',
+ line: /tray releases: SKIPPED — no CryptoKit/,
+ when: notMac,
+ why: 'Swift with CryptoKit exists only on Apple platforms; on the ubuntu validate job this rig can only skip (the macOS home-ios job runs it for real, and a skip fails there)',
+ },
+ {
+ rig: 'scripts/test-home-origin.mjs',
+ line: /home origin: SKIPPED — no CryptoKit/,
+ when: notMac,
+ why: 'Swift with CryptoKit exists only on Apple platforms (see test-tray-releases)',
+ },
+ {
+ rig: 'scripts/test-home-docstore-ios.mjs',
+ line: /home docstore \(iOS\): SKIPPED — no Swift toolchain with the Security framework/,
+ when: notMac,
+ why: 'the Security framework exists only on Apple platforms (see test-tray-releases)',
+ },
+ ...['keys', 'statements', 'agent', 'recovery'].map((n) => ({
+ rig: `scripts/test-home-id-${n}.mjs`,
+ line: new RegExp(`home id ${n}: SKIPPED — needs an Apple toolchain`),
+ when: notMac,
+ why: 'the bento/id Swift core needs CryptoKit and Security, Apple platforms only (see test-tray-releases)',
+ })),
+ {
+ rig: 'scripts/test-home-spotlight.mjs',
+ line: /home spotlight: SKIPPED — needs an Apple toolchain/,
+ when: notMac,
+ why: 'the Spotlight index code is Swift against Apple frameworks, Apple platforms only (see test-tray-releases)',
+ },
+]
+
+/** The rigs allowed to skip off macOS must run, unskipped, on the macOS job. */
+export const MAC_JOB = '.github/workflows/ci-home-ios.yml'
+
+/**
+ * Check one step's output. `script` is the step's script text (which rigs it
+ * runs); returns the skip lines, each with the allowlist entry that covers it
+ * (or null).
+ */
+export function check(script, output, allow = ALLOWED_SKIPS) {
+ const found = []
+ for (const line of output.split(/\r?\n/)) {
+ if (!isSkipLine(line)) continue
+ const entry = allow.find((a) => script.includes(a.rig) && a.line.test(line) && (!a.when || a.when())) || null
+ found.push({ line: line.trim(), entry })
+ }
+ return found
+}
diff --git a/scripts/test-ci-registered.ts b/scripts/test-ci-registered.ts
index 393c073b..4c989468 100644
--- a/scripts/test-ci-registered.ts
+++ b/scripts/test-ci-registered.ts
@@ -28,9 +28,10 @@
// pointing at a script that no longer exists is a step that fails on every push
// for a reason unrelated to the change that triggered it.
-import { readFileSync, readdirSync, existsSync } from 'node:fs'
+import { readdirSync, existsSync } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { dirname, join } from 'node:path'
+import { ciFiles, ciText } from './lib/ci-files.mjs'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const workflow = join(root, '.github/workflows/ci.yml')
@@ -44,10 +45,35 @@ function ok(cond: boolean, msg: string) {
}
if (!existsSync(workflow)) {
- console.log('FAIL .github/workflows/ci.yml does not exist. Nothing runs anything.')
+ console.log('FAIL .github/workflows/ci.yml does not exist. Nothing runs the required check.')
process.exit(1)
}
-const ci = readFileSync(workflow, 'utf8')
+// CI is SEVERAL files now (scripts/lib/ci-files.mjs says which): ci.yml, each
+// zone's ci-<zone>.yml, and the validate-<zone> composite actions that ci.yml's
+// required `validate` job runs. Splitting it was what stopped every zone
+// appending at the same few anchors of one file. The check is unchanged —
+// does CI mention the filename — over all of it.
+const files = ciFiles(root)
+const ci = ciText(root)
+
+console.log('CI is made of')
+for (const w of files.workflows) console.log(` · ${w.path}`)
+for (const a of files.usedActions) console.log(` · ${a.path}`)
+console.log('')
+ok(files.workflows.length > 0 && files.usedActions.length > 0,
+ 'the workflows and the validate actions are found (this check is what stops a vacuous green)')
+// An action no workflow runs is a file of steps that never execute: a rig
+// "registered" there would pass this check and never run. That is the new hole
+// a split opens, so it is closed here rather than trusted.
+for (const a of files.unusedActions) ok(false, `${a.path} is run by a workflow (nothing uses ./.github/actions/${a.name})`)
+for (const n of files.missingActions) ok(false, `./.github/actions/${n} exists (a workflow uses it)`)
+// A workflow file with no pull_request trigger never runs on a PR, so its
+// rigs never gate one. Every workflow that runs a rig must be triggered by one.
+for (const w of files.workflows) {
+ if (!/node scripts\//.test(w.text)) continue
+ ok(/^on:\s*$[\s\S]*?^\s{2}pull_request:/m.test(w.text) || /^on:.*pull_request/m.test(w.text),
+ `${w.path} runs on pull_request`)
+}
// A rig is a `scripts/test-*.ts|mjs`. Library code under scripts/lib/ is not a
// rig and is exercised by the rigs that import it.
@@ -123,9 +149,11 @@ for (const ref of [...new Set(referenced)].sort()) {
console.log(`\n${checks - failures}/${checks} checks passed`)
if (failures) {
console.log(`
-A rig that CI does not run is not coverage. Add a step for it in
-.github/workflows/ci.yml — with a comment saying what the checks are FOR, the
-way the ones around it do, because the next person reading a red build needs to
-know what broke and why it mattered enough to guard.`)
+A rig that CI does not run is not coverage. Add a step for it at the END of
+your zone's slice, .github/actions/validate-<zone>/action.yml (part of the
+required check), or as a job in .github/workflows/ci-<zone>.yml — never in
+ci.yml. Give it a comment saying what the checks are FOR, the way the ones
+around it do, because the next person reading a red build needs to know what
+broke and why it mattered enough to guard.`)
process.exit(1)
}
diff --git a/scripts/test-ci-skips.mjs b/scripts/test-ci-skips.mjs
new file mode 100644
index 00000000..c58afc83
--- /dev/null
+++ b/scripts/test-ci-skips.mjs
@@ -0,0 +1,151 @@
+#!/usr/bin/env node
+// SPDX-License-Identifier: MIT
+// Copyright (c) 2026 The Bento authors
+// Under CI, a rig that reports a skip fails its step (scripts/lib/ci-skips.mjs,
+// enforced by scripts/ci/bento-step). This rig is that rule's positive control.
+//
+// node scripts/test-ci-skips.mjs
+//
+// A rule that fails on skips can itself pass vacuously, in three ways, and
+// each has a section here:
+// 1. the detector misses a skip shape. Fixtures are the EXACT lines the rigs
+// printed in a real main run (39144711453), plus lines that only mention
+// skipping and must stay green;
+// 2. the wrapper does not actually turn a skip red. It is run end to end on
+// scripts that skip, and must exit non-zero;
+// 3. a step is not run through the wrapper at all. Every rig step in every
+// CI file must be.
+
+import { spawnSync } from 'node:child_process'
+import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { dirname, join } from 'node:path'
+import { fileURLToPath } from 'node:url'
+import { ALLOWED_SKIPS, MAC_JOB, check, isSkipLine } from './lib/ci-skips.mjs'
+import { ciFiles } from './lib/ci-files.mjs'
+
+const root = join(dirname(fileURLToPath(import.meta.url)), '..')
+let checks = 0
+let failures = 0
+function ok(cond, msg) {
+ checks++
+ if (!cond) { failures++; console.log(` FAIL ${msg}`) } else console.log(` ok ${msg}`)
+}
+
+console.log('the detector: every skip shape the rigs actually printed in CI')
+const REAL = [
+ ['scripts/test-enc-title.ts', '— skipped: jsdom is not installed —'],
+ ['scripts/test-type-preview.ts', '— skipped: jsdom is not installed —'],
+ ['scripts/test-type-font.ts', ' -- skipped: jsdom is not installed (the browser check below covers it)'],
+ ['scripts/test-tray-releases.mjs', 'tray releases: SKIPPED — no CryptoKit on this machine (Apple platforms only).'],
+ ['scripts/test-home-origin.mjs', 'home origin: SKIPPED — no CryptoKit on this machine (Apple platforms only).'],
+ ['scripts/test-home-docstore-ios.mjs', 'home docstore (iOS): SKIPPED — no Swift toolchain with the Security framework here.'],
+ ['scripts/test-home-id-keys.mjs', 'home id keys: SKIPPED — needs an Apple toolchain (CryptoKit, Security).'],
+ ['scripts/test-dash-zip.ts', ' SKIP no real .xlsx on this machine to read'],
+ ['scripts/test-dash-xlsx.ts', ' SKIP LibreOffice is not installed — the "does it open" check needs it'],
+ ['scripts/test-dash-xlsx.ts', ' SKIP no real .xlsx to import'],
+]
+for (const [, line] of REAL) ok(isSkipLine(line), `flagged: ${line.trim()}`)
+// Other shapes in the rigs' source, not seen in CI today.
+for (const line of [
+ ' ⚠ SKIPPED — no Chrome found. Set BENTO_CHROME to a binary to run this section;',
+ ' skip needs Chrome (BENTO_CHROME) and the built shell (spaces/dist-single/Bento_Spaces.bento.html)',
+ ' .. skipped real-shell checks (no dist-single build present)',
+ '0/0 checks passed (skipped)',
+]) ok(isSkipLine(line), `flagged: ${line.trim()}`)
+
+console.log('\nthe detector: lines ABOUT skipping are checks, not skips (all from that run)')
+for (const line of [
+ ' ok a lapsed folder is skipped rather than throwing, so one bad grant cannot empty the list',
+ ' ok next, from ON a change, SKIPS it and finds the next one — so pressing next twice always advances',
+ '=== a SKIPPED level numbers with a zero, and is not promoted ===',
+ ' ✓ an ARCHIVED page is skipped, as the sidebar leaves it out',
+ ' ok the sync shape skips trail (and revisions) outright',
+ 'docContentKey: counts content + history, excludes capability + bookkeeping, skips absent',
+ ' (planted builder that skips projectForCopy — these rows MUST fail:)',
+ 'indentTarget — Tab, including every case a happy path skips',
+ '=== the skipDoc floor is checked first at the gate too (defence in depth) ===',
+]) ok(!isSkipLine(line), `not flagged: ${line.trim()}`)
+
+console.log('\nthe allowlist: who may skip, and only with their own rig')
+const mac = process.platform === 'darwin'
+for (const [rig, line] of REAL) {
+ const [f] = check(`node ${rig}`, line)
+ const allowed = /dash-(xlsx|zip)/.test(rig) || (!mac && /tray-releases|home-origin|home-docstore-ios|home-id-|home-spotlight/.test(rig))
+ ok(!!f && !!f.entry === allowed, `${allowed ? 'allowed' : 'REFUSED'}: ${rig} — ${line.trim().slice(0, 50)}`)
+}
+const [borrowed] = check('node scripts/test-enc-title.ts', ' SKIP LibreOffice is not installed — the "does it open" check needs it')
+ok(!!borrowed && !borrowed.entry, "a dash rig's allowed skip line, printed by ANOTHER rig's step, is refused")
+for (const a of ALLOWED_SKIPS) {
+ // An entry whose rig is gone, or whose rig no longer prints the line, is a
+ // hole with no reason left. Both are checked rather than trusted.
+ const p = join(root, a.rig)
+ ok(existsSync(p), `${a.rig} still exists, so its entry is about something`)
+ ok(existsSync(p) && a.line.test(readFileSync(p, 'utf8')), `${a.rig} still prints ${a.line}`)
+ ok(typeof a.why === 'string' && a.why.length > 40, `${a.rig}: the entry says why CI cannot provide what it needs`)
+}
+
+// An Apple-only rig may skip on Linux ONLY because the macOS job runs it for
+// real. If it is not in that job, it runs nowhere, and its entry is a hole.
+const macJob = existsSync(join(root, MAC_JOB)) ? readFileSync(join(root, MAC_JOB), 'utf8') : ''
+for (const a of ALLOWED_SKIPS.filter((x) => x.when)) {
+ const base = a.rig.replace(/^scripts\//, '')
+ ok(/runs-on: macos/.test(macJob) && macJob.includes(base), `${base} may skip off macOS because ${MAC_JOB} runs it on macOS`)
+}
+
+console.log('\nthe wrapper: a skip turns the step red, end to end')
+const step = join(root, 'scripts/ci/bento-step')
+const tmp = mkdtempSync(join(tmpdir(), 'ci-skips-'))
+function runStep(body) {
+ const f = join(tmp, `step-${checks}.sh`)
+ writeFileSync(f, body)
+ return spawnSync('bash', [step, f], { encoding: 'utf8', cwd: root })
+}
+try {
+ let r = runStep('echo " ok a check"\necho "1/1 checks passed"\n')
+ ok(r.status === 0, `a clean step passes (exit ${r.status})`)
+ r = runStep('# node scripts/test-enc-title.ts\necho "— skipped: jsdom is not installed —"\n')
+ ok(r.status === 1, `a step whose rig skipped FAILS (exit ${r.status})`)
+ ok(/::error::a rig skipped under CI/.test(r.stdout), 'and says so as a CI error annotation')
+ r = runStep('# node scripts/test-dash-xlsx.ts\necho " SKIP LibreOffice is not installed — the \\"does it open\\" check needs it"\n')
+ ok(r.status === 0, `an allowlisted skip passes (exit ${r.status})`)
+ ok(/::notice::allowed skip/.test(r.stdout), 'and is still reported, as a notice')
+ r = runStep('echo " SKIP unexplained"\nexit 3\n')
+ ok(r.status === 3, `a failing step keeps its own exit code (exit ${r.status})`)
+ r = runStep('false | true\necho " ok reached"\n')
+ ok(r.status !== 0, `pipefail holds, as under shell: bash (exit ${r.status})`)
+ r = runStep('false\necho " ok reached"\n')
+ ok(r.status !== 0 && !/reached/.test(r.stdout), `-e holds: the first failing command ends the step (exit ${r.status})`)
+ // The real thing, when a rig can be made to skip: the encrypted-title rig with
+ // jsdom made unresolvable (its import is caught and it prints the skip).
+ // Driven through the same wrapper.
+ r = runStep('node --import "data:text/javascript,import{registerHooks}from\'node:module\';registerHooks({resolve(s,c,n){if(s===\'jsdom\')throw new Error(\'hidden\');return n(s,c)}})" scripts/test-enc-title.ts\n')
+ ok(/skipped: jsdom is not installed/.test(r.stdout), 'the encrypted-title rig, with jsdom hidden, prints its skip line')
+ ok(r.status === 1, `and the wrapper turns that real rig's step RED (exit ${r.status})`)
+} finally {
+ rmSync(tmp, { recursive: true, force: true })
+}
+
+console.log('\nthe wiring: every rig step runs through the wrapper')
+const files = ciFiles(root)
+for (const a of files.usedActions) {
+ const steps = a.text.split(/\n(?= - )/).filter((s) => /^ run:/m.test(s))
+ const bare = steps.filter((s) => !/^ shell: bento-step \{0\}$/m.test(s))
+ ok(steps.length > 0 && bare.length === 0,
+ `${a.path}: all ${steps.length} run steps use shell: bento-step {0}${bare.length ? ` (not: ${bare.map((s) => (s.match(/name: (.*)/) || [])[1]).join(', ')})` : ''}`)
+}
+const ci = files.workflows.find((w) => w.path.endsWith('/ci.yml'))
+ok(!!ci && /echo "\$GITHUB_WORKSPACE\/scripts\/ci" >> "\$GITHUB_PATH"/.test(ci.text) &&
+ ci.text.indexOf('scripts/ci" >> "$GITHUB_PATH"') < ci.text.indexOf('uses: ./.github/actions/validate-'),
+ 'ci.yml puts scripts/ci on PATH before the first validate slice')
+ok(!!ci && /jsdom@\d+\.\d+\.\d+/.test(ci.text), 'ci.yml installs a pinned jsdom for the DOM halves')
+for (const w of files.workflows) {
+ if (!/^name: CI \(/m.test(w.text) || !/node scripts\//.test(w.text)) continue
+ if (w.path.endsWith('ci-home-android.yml')) continue // Gradle prints SKIPPED as a task outcome; see that file
+ if (w.path.endsWith('ci-home-ios.yml')) continue // macOS jobs with their own skip check (#777), where nothing may skip
+ ok(/^defaults:\n run:\n(?: #.*\n)* shell: bash scripts\/ci\/bento-step \{0\}$/m.test(w.text) && !/^\s+shell: bash\s*$/m.test(w.text),
+ `${w.path}: its jobs run through bento-step`)
+}
+
+console.log(`\n${checks - failures}/${checks} checks passed`)
+if (failures) process.exit(1)
diff --git a/scripts/test-spaces.mjs b/scripts/test-spaces.mjs
index c8770e57..71c44f0f 100755
--- a/scripts/test-spaces.mjs
+++ b/scripts/test-spaces.mjs
@@ -32,6 +32,7 @@ import { existsSync, mkdtempSync, readFileSync, rmSync, readdirSync } from 'node
import { tmpdir } from 'node:os'
import { join, dirname } from 'node:path'
import { fileURLToPath } from 'node:url'
+import { ciText } from './lib/ci-files.mjs'
const root = join(dirname(fileURLToPath(import.meta.url)), '..')
const esbuild = join(root, 'slides/node_modules/.bin/esbuild')
@@ -127,7 +128,10 @@ if (missing.length) {
// withheld all eight rigs from someone who asked for the rigs and never
// mentioned CI, and told them about CI registration instead. Measured: zero
// rig-output lines. Found by bento-team-home-ios.
+// CI is several files (scripts/lib/ci-files.mjs); spaces' steps live in
+// .github/actions/validate-spaces/action.yml, which ci.yml's validate job runs.
const WORKFLOW = '.github/workflows/ci.yml'
+const WHERE = 'CI (.github/workflows/ + the validate actions they run)'
const argv = process.argv.slice(2)
if (argv.includes('--manifest')) {
@@ -144,14 +148,14 @@ if (argv.includes('--manifest')) {
console.error('the whole of what --manifest does. Run it from a full checkout.')
process.exit(2)
}
- const ci = readFileSync(join(root, WORKFLOW), 'utf8')
+ const ci = ciText(root)
const unregistered = RIGS.filter((r) => !ci.includes(r.file.replace(/^scripts\//, '')))
if (unregistered.length) {
- console.error(`these spaces rigs are not registered in ${WORKFLOW}: ${unregistered.map((r) => r.name).join(', ')}`)
- console.error('A rig nobody runs is not a rig. Add a step for each, or remove it from RIGS.')
+ console.error(`these spaces rigs are not registered in ${WHERE}: ${unregistered.map((r) => r.name).join(', ')}`)
+ console.error('A rig nobody runs is not a rig. Add a step for each to .github/actions/validate-spaces/action.yml, or remove it from RIGS.')
process.exit(2)
}
- console.log(`manifest ok — ${RIGS.length} spaces rigs, all listed here and all registered in ${WORKFLOW}`)
+ console.log(`manifest ok — ${RIGS.length} spaces rigs, all listed here and all registered in ${WHERE}`)
process.exit(0)
}