Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,14 +158,16 @@ first. Every instance gets the same page; an app edits one file.
a test or a mirror. The frame draws in its own shadow root and brings the
brand's tokens to a page that has none, so any host can mount it.
- **The page around it, locked.** Everything else on the page (the cards,
renderer, loader, service worker and the page gates) is pinned by
renderer, loader, service worker, the page gates, the frame's panels in
`frame/` and the Prism id in `identity/`) is pinned by
`frame.lock`, as `brand.lock` pins the brand: reviewed bytes that change
only when an app chooses to. `node bootstrap/frame-sync.mjs --check` runs
in `pages.yml` before the build, and an app takes a newer page with
`--pin <template commit>`, which reads the template's `frame.lock` at that
commit, fetches every file, refuses any whose bytes differ and records the
pin. Which files a frame has is the target's to say: its `frame-sync.mjs`,
matched to its lock, names them (inside `bootstrap/` and `site/` only), so
matched to its lock, names them (inside `bootstrap/`, `site/`, `frame/` and
`identity/` only), so
a newer frame can add a file; one the target dropped is left in place and
reported. A `frame-sync.mjs` older than this rule refuses a lock with files
it does not know; fetch the target's script once, then pin:
Expand Down
27 changes: 27 additions & 0 deletions TEMPLATE-VERIFICATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ or test is added without the other two.

| `audit-limits` | a shipped crate returns `Result<_, E>` for an `E` no register row declares; a declared `E` whose negative test does not exist; one whose negative test is not a registered ID | all rejected |
| `audit-deferral` | a deferral marker in a crate and in the gate's own source | both rejected |
| `audit-prism` | a new `site/planted.mjs`; one line added to `frame/panels.mjs`, which the template's own `frame.lock` (no source) does not exempt | both rejected: `1 new non-Prism file(s): site/planted.mjs`; `non-Prism implementation grew by 1 lines (13441 to 13442); grown: frame/panels.mjs +1` |
| honesty meta-gate | an ID with no test | rejected |
| `contract_tc_01` | `Conformant` drops the `bootstrap` conjunct, or `dispatch` answers on `true` instead of `conformant` | both rejected |
| `prismpm verify` | an acceptance vector set without the exact guest-allocation boundary | rejected (PP2009) |
Expand Down Expand Up @@ -448,6 +449,32 @@ setting the first width in the hashed stylesheet), and `app.mjs` crossed the
unminified-JavaScript allowance (2,458 bytes against 2,048, fixed by moving
the spec into `site/spec.mjs`, loaded on first open, and shortening comments).

## Only Prism is implemented

Rule: a product is a Prism model, so behavior is written in LexLean and built
by PrismPM; every other language that executes may only shrink. `audit-prism`
(`xtask/src/audit.rs`, part of `xtask validate`) counts tracked `.rs`, `.ts`,
`.tsx`, `.mts`, `.cts`, `.js`, `.mjs`, `.cjs`, `.jsx`, `.css`, `.scss`, `.c`,
`.h`, `.cpp`, `.html`, `.py`, `.sh`, `.bash`, `.awk` and host `.lean` lines that
are neither blank nor comments, and refuses a non-Prism file the commit's first
parent lacks and any net growth over the parent. The ceiling is measured, not
recorded: a pull request's merge commit has the base branch as first parent,
main has the previous main, so each removal lowers it as it merges. A shallow
clone fails. It is the shrink-only ratchet of `afflom/rule30` and
`afflom/verdant-resonance`, first landed in `UOR-Foundation/foundry#214`.

Output a Prism lock binds to an upstream is Prism's and is not counted while
its bytes match: an app's `frame.lock`, which names the template commit, and
`identity/stitch.lock`, which names the stitch commit whose model generates the
Prism id. The template's own `frame.lock` names no source, so here the frame is
counted like any other implementation. The ratchet starts at the commit that
installs it: a parent whose `xtask/src/audit.rs` has no `pub mod prism` set no
ceiling, so this change records 13,441 lines in 77 files.

The frame's panels (`frame/`) and the Prism id (`identity/`) are now part of
the frame list, so an app's `frame.lock` binds them and `--pin` delivers them.
An app on an older `frame-sync.mjs` takes this one first (see the README).

## A newer frame may add a file

`frame-sync.mjs --pin` judged a target commit's lock by this checkout's own
Expand Down
45 changes: 41 additions & 4 deletions bootstrap/frame-sync.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const SPEC = "prism/frame-lock/1";
const RAW = (process.env.PRISM_TEMPLATE_RAW ?? `https://raw.githubusercontent.com/${TEMPLATE}`).replace(/\/$/, "");

// Every file of the frame. A lock must list exactly these, so dropping one
// from the lock cannot take it out of the gate.
// from the lock cannot take it out of the gate. The frame's panels (frame/)
// and the Prism id it signs in with (identity/) are the frame too: an app
// takes them from the template by the same pin and edits none of them.
const FRAME = [
"bootstrap/frame-sync.mjs",
"bootstrap/icons.py",
Expand All @@ -44,6 +46,40 @@ const FRAME = [
"bootstrap/screens.mjs",
"bootstrap/weight.mjs",
"bootstrap/worker-runtime.mjs",
"frame/backdrops/0wFwSZn6I-I-thumb.jpg",
"frame/backdrops/0wFwSZn6I-I.jpg",
"frame/backdrops/9wH624ALFQA-thumb.jpg",
"frame/backdrops/9wH624ALFQA.jpg",
"frame/backdrops/E0AHdsENmDg-thumb.jpg",
"frame/backdrops/E0AHdsENmDg.jpg",
"frame/backdrops/Q1p7bh3SHj8-thumb.jpg",
"frame/backdrops/Q1p7bh3SHj8.jpg",
"frame/backdrops/RF4p4rTM-2s-thumb.jpg",
"frame/backdrops/RF4p4rTM-2s.jpg",
"frame/backdrops/cZgVpseeazg-thumb.jpg",
"frame/backdrops/cZgVpseeazg.jpg",
"frame/backdrops/oMcTmNHclZI-thumb.jpg",
"frame/backdrops/oMcTmNHclZI.jpg",
"frame/backdrops/qtRF_RxCAo0-thumb.jpg",
"frame/backdrops/qtRF_RxCAo0.jpg",
"frame/backdrops/t7EL2iG3jMc-thumb.jpg",
"frame/backdrops/t7EL2iG3jMc.jpg",
"frame/frame.css",
"frame/frame.mjs",
"frame/panels.css",
"frame/panels.mjs",
"frame/publish.mjs",
"frame/unsplash/.gitignore",
"frame/unsplash/README.md",
"frame/unsplash/worker.mjs",
"frame/unsplash/wrangler.toml",
"identity/PROTOCOL.md",
"identity/README.md",
"identity/dev.mjs",
"identity/prism-id.mjs",
"identity/stitch-sync.mjs",
"identity/stitch.lock",
"identity/test.mjs",
"lighthouserc.json",
"site/app.mjs",
"site/guest-worker.mjs",
Expand Down Expand Up @@ -108,9 +144,10 @@ function frameOf(source) {
const list = source.match(/^const FRAME = \[([\s\S]*?)\];/m)?.[1];
return list ? [...list.matchAll(/"([^"]+)"/g)].map((m) => m[1]) : null;
}
// A frame file is a page file or a page gate: under bootstrap/ or site/, or
// lighthouserc.json, and never outside the repository.
const framePath = (path) => /^(?:(?:bootstrap|site)\/[\w.-]+(?:\/[\w.-]+)*|lighthouserc\.json)$/.test(path) && !path.split("/").includes("..");
// A frame file is a page file, a page gate, a frame panel or the Prism id:
// under bootstrap/, site/, frame/ or identity/, or lighthouserc.json, and
// never outside the repository.
const framePath = (path) => /^(?:(?:bootstrap|site|frame|identity)\/[\w.-]+(?:\/[\w.-]+)*|lighthouserc\.json)$/.test(path) && !path.split("/").includes("..");

// The target is judged by its own frame, not this one: a newer template may
// add a frame file this script has never heard of. Its frame-sync.mjs must be
Expand Down
138 changes: 137 additions & 1 deletion frame.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": [
{
"path": "bootstrap/frame-sync.mjs",
"sha256": "5d874908a8f5813b6f7c1004ec0e73ec03584139bf7ac8ffabb2ad5c0eeee7af"
"sha256": "b321f177db28da08326cd90cdc522f02bac960fffc5ca187bc3d81d6492881e5"
},
{
"path": "bootstrap/icons.py",
Expand Down Expand Up @@ -37,6 +37,142 @@
"path": "bootstrap/worker-runtime.mjs",
"sha256": "0f9fbb6ec4db48fb7f7c4b779a0494e95d5411e868b36e1e163e5173fcc34557"
},
{
"path": "frame/backdrops/0wFwSZn6I-I-thumb.jpg",
"sha256": "c8961c9ccbbd9bdaee0a88f2027377381212b14644ff2bee70c6007459eac71d"
},
{
"path": "frame/backdrops/0wFwSZn6I-I.jpg",
"sha256": "d616103b46592c280e76d9d695badb8032d6c03f68b5c303ce1e0bd65165b0e8"
},
{
"path": "frame/backdrops/9wH624ALFQA-thumb.jpg",
"sha256": "6b39d5ba401eff06271c185cca078a395bf6fa4836f253ec074fd4c149cd4a66"
},
{
"path": "frame/backdrops/9wH624ALFQA.jpg",
"sha256": "ba35adf7f14f9a37838c6cb35f81795f8030f8a7bb0f992f28502e03d5c6e82c"
},
{
"path": "frame/backdrops/E0AHdsENmDg-thumb.jpg",
"sha256": "e2cd6180c72ddb1d9e1f7838204c94e79ae127b11ba625447b7a70b6bbb0773a"
},
{
"path": "frame/backdrops/E0AHdsENmDg.jpg",
"sha256": "e43adbb89d2ec19ca6ef570f6bfae4ac6daf39a31348a9c73d5edee573a588f1"
},
{
"path": "frame/backdrops/Q1p7bh3SHj8-thumb.jpg",
"sha256": "234cbde53f0217585749554b772df6e613bba795dfec18347e1f00f8f33fa3f9"
},
{
"path": "frame/backdrops/Q1p7bh3SHj8.jpg",
"sha256": "99e71e2c73a4b3e19fb98108f9dce81f8c81b71cb0c8de3e2afc9649f744f881"
},
{
"path": "frame/backdrops/RF4p4rTM-2s-thumb.jpg",
"sha256": "ed50607638da713b855be09e3c99cb051bf6d87c1cab1d147888412bbde22e20"
},
{
"path": "frame/backdrops/RF4p4rTM-2s.jpg",
"sha256": "e007bac1d872fb541d27181442500d371b27d39aea3fc48db7f757f77a1caa05"
},
{
"path": "frame/backdrops/cZgVpseeazg-thumb.jpg",
"sha256": "8f107db205151bab41e10df89d7fffe9a13caab11c775d623e2e108f6f04c25e"
},
{
"path": "frame/backdrops/cZgVpseeazg.jpg",
"sha256": "b061c0f02fbded1a50a006ad4d8ecd4af0718e042dbbef6326d92cf7dc80a00f"
},
{
"path": "frame/backdrops/oMcTmNHclZI-thumb.jpg",
"sha256": "5de0d7fa4c32c83bea4360602ef751cd0f97d1fa46f77f4e3010bb237ed4aa5a"
},
{
"path": "frame/backdrops/oMcTmNHclZI.jpg",
"sha256": "413274ffeb758961fa77f0eec0d9c71526a0cb54333edb92f17e5896b1e8bbec"
},
{
"path": "frame/backdrops/qtRF_RxCAo0-thumb.jpg",
"sha256": "4bd016b2ad3a6119d08139e61346081ad18781fba39df7a8026f5f31333dbaa3"
},
{
"path": "frame/backdrops/qtRF_RxCAo0.jpg",
"sha256": "be36adbed5035b15a41206d64812754dae4c246324af525059372385dedc18b7"
},
{
"path": "frame/backdrops/t7EL2iG3jMc-thumb.jpg",
"sha256": "db1465c0d30a65e5d4279a4644dc1d6a488c378b4bb43fcde714f6fbb251af7f"
},
{
"path": "frame/backdrops/t7EL2iG3jMc.jpg",
"sha256": "6f59cde71fb09b6a5faa92b1f9a77c0a300c0e4f9e6469574e54e14e85801d29"
},
{
"path": "frame/frame.css",
"sha256": "c7470fdcbdb0ca9c6e2a634b6ec4ba9f1ed87c39b737f91e082b8c6466ab91f4"
},
{
"path": "frame/frame.mjs",
"sha256": "208994058dcc6c70a91d590c345cb4956eda3532096f298f0a21f809f11672c1"
},
{
"path": "frame/panels.css",
"sha256": "9b6bcd85303139ddaac9b2cbde7b7d3ef61d34da336874774073124b2560d8ce"
},
{
"path": "frame/panels.mjs",
"sha256": "f2db1617f0a6d14e4447c54bafc7aeb45c7cb152b0f5a0b27b5615f8ce8d7b92"
},
{
"path": "frame/publish.mjs",
"sha256": "faaaca350d15e0a0fb90311f810f1cf322ec790d6e0739c90489caa5cd857dd9"
},
{
"path": "frame/unsplash/.gitignore",
"sha256": "f7041b5e6a86198e0b2dc26f8c45a303e4b75ccfd783928d935f6212ace66b49"
},
{
"path": "frame/unsplash/README.md",
"sha256": "1cc50248e5565a8c57be54bc98caa62b243c0032de1ba69e6df8be379a17ed1c"
},
{
"path": "frame/unsplash/worker.mjs",
"sha256": "fe0b48820ecf03c6ee440dd5bc647e16a81f70e27fc7b09890429309f067b1de"
},
{
"path": "frame/unsplash/wrangler.toml",
"sha256": "90969e5589949ba52a523733d2178ca711f2794094bda8d65b105d3590865b1f"
},
{
"path": "identity/PROTOCOL.md",
"sha256": "1e3a042a4a100683e0df5bc8210c367785e844feb63cd561d591979733e7ff82"
},
{
"path": "identity/README.md",
"sha256": "351d9387fbc8fac0123f13a2e03e03aba8a4c0aed8e38f6040973bec4246fef1"
},
{
"path": "identity/dev.mjs",
"sha256": "422bb2f4eba2f7aef47d6ffab1dabd1699c92eef0883e9c651f8e0a3f63beac0"
},
{
"path": "identity/prism-id.mjs",
"sha256": "68482230e97b35a042295ec003687e745b34ba92275f0fc6a671bc1510f6d0d0"
},
{
"path": "identity/stitch-sync.mjs",
"sha256": "65f88ef47fc11ab4d9adcac1488169cf169d1bc69e80f5406e90e71ae367f4a1"
},
{
"path": "identity/stitch.lock",
"sha256": "0ecf5b500675c268d486bbd111246f2087ce0ec79c57540fe635089c6d7a3d0c"
},
{
"path": "identity/test.mjs",
"sha256": "21cb6924014c80f378abf5d07720a203c7e62aa99ffd38e05f6d8376153317f9"
},
{
"path": "lighthouserc.json",
"sha256": "85aa0f6219cb8396b34f5b461c1d4d7b149e4cc1674cbd2f0100c5b5e16636d9"
Expand Down
Loading
Loading