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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "UOR PrismPM SDK",
"image": "ghcr.io/afflom/prismpm-sdk-patched@sha256:3dfa5f7284ace57c08bfe8d2effe2e08ab41da1a53f5820d48cccd498bd528c3",
"image": "ghcr.io/afflom/prismpm-sdk-patched@sha256:a4dcef3614f6f8934b5993126e20213ce2141104d9e763eb6035c62d9da9bf55",
"containerUser": "root",
"workspaceMount": "source=${localWorkspaceFolder},target=${localWorkspaceFolder},type=bind",
"workspaceFolder": "${localWorkspaceFolder}",
Expand Down
2 changes: 1 addition & 1 deletion app/lexlean.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
spec = "lexlean/lock/2"
language = "1.2"
compiler_semantics = "1427f8b629013648a480454d67202788f2303f5396f1d7c70a7c350ddab6f694"
compiler_semantics = "e1b2447a28c98f87a7782a4fd4786044db3fff53fd2a76dbd5e4071fd6a6721d"
project_config_sha256 = "8b3c490b17ac750164c783e125b402aca92932354a45c9e7fc461b92162fecf7"
lean_toolchain = "leanprover/lean4:v4.32.1"

Expand Down
2 changes: 1 addition & 1 deletion builder/assets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const ASSETS = {
};
export const TEMPLATE = {
"CONFORMANCE.md": "<!-- @generated by `cargo xtask check-model --write` from model/ids.toml. -->\n<!-- Do not edit. R1: the model is the single source. -->\n\n# CONFORMANCE\n\nThe conformance ID register. Every test name ends in its ID; a test whose\nID is not listed here fails `cargo xtask check-model`, and so does an ID\nlisted here with no scenario and no test (`CM-02`).\n\nThe three honesty levels (R2):\n\n| Level | Meaning |\n| --- | --- |\n| `some-true` | A fact reproduced from an authority. **Not established here.** |\n| `build` | Constructed here and validated against its oracle. Evidence, not a proof. |\n| `open` | Measured and reported. **Never asserted.** |\n\n`cargo xtask audit-limits` fails if any code path returns an error the\nmodel does not sanction.\n\n## contract\n\n| ID | Level | Statement |\n| --- | --- | --- |\n| `TC-01` | `build` | The checker answers conformant exactly when every universal policy file's observed digest equals its locked digest |\n\n## Cited authorities\n\nNever re-derived, vendored, or gated on.\n\n| Authority | Citation | Evidence here |\n| --- | --- | --- |\n\n## Claims that are not conformance IDs\n\n| ID | Level | Claim |\n| --- | --- | --- |\n",
"app/lexlean.lock": "spec = \"lexlean/lock/2\"\nlanguage = \"1.2\"\ncompiler_semantics = \"1427f8b629013648a480454d67202788f2303f5396f1d7c70a7c350ddab6f694\"\nproject_config_sha256 = \"44475e174dc4699998fcc1b2e75f64a1ed9f36793a54c6c48b3b2dd23e639b07\"\nlean_toolchain = \"leanprover/lean4:v4.32.1\"\n\n[[workspace_file]]\npath = \"lake-manifest.json\"\nsha256 = \"844ae8a35919b438d5c89942af185bba00feddfc344964847a315a11fe332010\"\n\n[[workspace_file]]\npath = \"lakefile.toml\"\nsha256 = \"0e0f9d7e4709abbc21eac20b5f9c476c2916ff041f87535bda594b02a9bacf9f\"\n\n[[workspace_file]]\npath = \"lean-toolchain\"\nsha256 = \"8e3538e0ab5f81a3ee04927d8838c8c674e0e112838b4b3ce87ec218143276af\"\n\n[[package]]\nid = \"lexlean.core\"\nversion = \"1.2.0\"\nkind = \"builtin\"\nsource = \"embedded\"\nrevision = \"compiler-semantics\"\ntree_sha256 = \"827317cae68c162f3a96c8a8de4e53ab348e7d3724fd2b834fa85ecde1a1b392\"\nmanifest_sha256 = \"271079763d269cc873531f515e56da960cd6321393b9460ff0e617666fa01d71\"\nimports = []\n\n[[package]]\nid = \"lexlean.std.bool\"\nversion = \"1.2.0\"\nkind = \"builtin\"\nsource = \"embedded\"\nrevision = \"compiler-semantics\"\ntree_sha256 = \"3bc0fb09d706ffa7d5a1363302ea87c049acc7c7dcafde63c62682620c11be9b\"\nmanifest_sha256 = \"de58de2cf18a7a5a62d8c20649139d6dfe1f7b16b3130c75f150fbac5440a71e\"\nimports = [\"lexlean.core@1.2.0\"]\n\n[[package]]\nid = \"lexlean.std.nat\"\nversion = \"1.2.0\"\nkind = \"builtin\"\nsource = \"embedded\"\nrevision = \"compiler-semantics\"\ntree_sha256 = \"e0db021e01b91d651c43921d66f6b0023c8efbf17cac2ec53192ce5305e4e1ac\"\nmanifest_sha256 = \"6fb446b39e3c1c18a5f10cfa1f7aa2bd431837719eb0eb7489aadf452c9420a7\"\nimports = [\"lexlean.core@1.2.0\", \"lexlean.std.bool@1.2.0\"]\n\n[[package]]\nid = \"prism.arch\"\nversion = \"1.0.0\"\nkind = \"path\"\nsource = \"language/prism.arch\"\nrevision = \"none\"\ntree_sha256 = \"a5b1aa879a00c8f86100410c1ec1af4e2e983838f30e6dc82b3e989b0df65e2c\"\nmanifest_sha256 = \"14c95df8b512edacacdb1788b58ae90cf573b4e3f1dca0e41074bfde5a380c9f\"\nimports = [\"lexlean.core@1.2.0\", \"lexlean.std.bool@1.2.0\", \"lexlean.std.nat@1.2.0\"]\n",
"app/lexlean.lock": "spec = \"lexlean/lock/2\"\nlanguage = \"1.2\"\ncompiler_semantics = \"e1b2447a28c98f87a7782a4fd4786044db3fff53fd2a76dbd5e4071fd6a6721d\"\nproject_config_sha256 = \"44475e174dc4699998fcc1b2e75f64a1ed9f36793a54c6c48b3b2dd23e639b07\"\nlean_toolchain = \"leanprover/lean4:v4.32.1\"\n\n[[workspace_file]]\npath = \"lake-manifest.json\"\nsha256 = \"844ae8a35919b438d5c89942af185bba00feddfc344964847a315a11fe332010\"\n\n[[workspace_file]]\npath = \"lakefile.toml\"\nsha256 = \"0e0f9d7e4709abbc21eac20b5f9c476c2916ff041f87535bda594b02a9bacf9f\"\n\n[[workspace_file]]\npath = \"lean-toolchain\"\nsha256 = \"8e3538e0ab5f81a3ee04927d8838c8c674e0e112838b4b3ce87ec218143276af\"\n\n[[package]]\nid = \"lexlean.core\"\nversion = \"1.2.0\"\nkind = \"builtin\"\nsource = \"embedded\"\nrevision = \"compiler-semantics\"\ntree_sha256 = \"827317cae68c162f3a96c8a8de4e53ab348e7d3724fd2b834fa85ecde1a1b392\"\nmanifest_sha256 = \"271079763d269cc873531f515e56da960cd6321393b9460ff0e617666fa01d71\"\nimports = []\n\n[[package]]\nid = \"lexlean.std.bool\"\nversion = \"1.2.0\"\nkind = \"builtin\"\nsource = \"embedded\"\nrevision = \"compiler-semantics\"\ntree_sha256 = \"3bc0fb09d706ffa7d5a1363302ea87c049acc7c7dcafde63c62682620c11be9b\"\nmanifest_sha256 = \"de58de2cf18a7a5a62d8c20649139d6dfe1f7b16b3130c75f150fbac5440a71e\"\nimports = [\"lexlean.core@1.2.0\"]\n\n[[package]]\nid = \"lexlean.std.nat\"\nversion = \"1.2.0\"\nkind = \"builtin\"\nsource = \"embedded\"\nrevision = \"compiler-semantics\"\ntree_sha256 = \"e0db021e01b91d651c43921d66f6b0023c8efbf17cac2ec53192ce5305e4e1ac\"\nmanifest_sha256 = \"6fb446b39e3c1c18a5f10cfa1f7aa2bd431837719eb0eb7489aadf452c9420a7\"\nimports = [\"lexlean.core@1.2.0\", \"lexlean.std.bool@1.2.0\"]\n\n[[package]]\nid = \"prism.arch\"\nversion = \"1.0.0\"\nkind = \"path\"\nsource = \"language/prism.arch\"\nrevision = \"none\"\ntree_sha256 = \"a5b1aa879a00c8f86100410c1ec1af4e2e983838f30e6dc82b3e989b0df65e2c\"\nmanifest_sha256 = \"14c95df8b512edacacdb1788b58ae90cf573b4e3f1dca0e41074bfde5a380c9f\"\nimports = [\"lexlean.core@1.2.0\", \"lexlean.std.bool@1.2.0\", \"lexlean.std.nat@1.2.0\"]\n",
"app/lexlean.toml": "spec = \"lexlean/project/1\"\nname = \"prism-template-contract\"\nlanguage = \"1.2\"\nmodule_prefix = \"PrismTemplateContract\"\nsource_roots = [\"src\"]\nentrypoints = [\"src/Contract.lex.tex\"]\nbuild_root = \".lexlean\"\nlockfile = \"lexlean.lock\"\nlean_workspace = \".\"\nlean_toolchain = \"leanprover/lean4:v4.32.1\"\n\n[[lexicon_source]]\npackage = \"lexlean.std.nat\"\nkind = \"builtin\"\n\n[[lexicon_source]]\npackage = \"prism.arch\"\nkind = \"path\"\npath = \"language/prism.arch\"\n\n[limits]\nmax_file_bytes = 4194304\nmax_total_source_bytes = 67108864\nmax_primitive_atoms = 2000000\nmax_token_lattice_edges = 4000000\nmax_parse_states = 4000000\nmax_ir_nodes = 2000000\nmax_scope_depth = 1024\nmax_import_depth = 128\nmax_diagnostics = 256\nmax_child_output_bytes = 16777216\nchild_timeout_ms = 300000\n",
"app/prismpm.toml": "spec = \"prismpm/project/1\"\nproject = \"TemplateContract\"\nlexlean_project = \"lexlean.toml\"\nbuild_root = \".prism\"\n\n[limits]\nmax_holo_bytes = 16777216\nmax_entities = 100000\nmax_diagnostics = 256\n",
"model/ids.toml": "# model/ids.toml --- the conformance ID register.\n#\n# Every ID this repository claims, in one place, so that nothing is referenced\n# without being defined. `CONFORMANCE.md` is generated from this file. A test\n# whose name ends in an ID not listed here fails `check-model`, and an ID listed\n# here with no scenario and no test fails it too (CM-02).\n#\n# `level` is the honesty level (R2):\n# some-true a fact reproduced from an authority; not established here\n# build constructed here and validated against its oracle\n# open measured and reported, never asserted\n#\n# Every row here has a scenario in `features/suites/` and a test whose name ends\n# in the ID, lowercased with underscores (R3, CM-02). There is no \"pending\"\n# state: a capability that is not built does not get a row, and every row in this\n# file is built.\n#\n# The first row is the template's own Prism application in `app/` (TC-01).\n# A capability starts with a row here; `just new-capability` writes the row,\n# its scenario and its failing test in the order `AGENTS.md` sets out.\n\nspec = \"template/1\"\n\n[[id]]\nid = \"TC-01\"\nlevel = \"build\"\nsuite = \"contract\"\nstatement = \"The checker answers conformant exactly when every universal policy file's observed digest equals its locked digest\"\n",
Expand Down
13 changes: 9 additions & 4 deletions builder/pack.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@
* assets/lock-packages.toml
* the [[package]] section `lexlean lock` writes for the
* language packages above, captured in the pinned SDK
*
* The template's lock takes the compiler semantics this repository's own
* app/lexlean.lock is locked to, which the pinned SDK's `lexlean lock`
* writes, so every generated app follows a compiler change in the SDK.
*/
import { readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
import { dirname, join, relative } from 'node:path';
Expand All @@ -27,15 +31,16 @@ const walk = (dir) =>
});
const table = (root) => Object.fromEntries(walk(join(here, root)).map((p) => [relative(join(here, root), p).split('\\').join('/'), readFileSync(p, 'utf8')]));

const semantics = (lock) => lock.replace(/^compiler_semantics = .*$/m, /^compiler_semantics = "[0-9a-f]{64}"$/m.exec(readFileSync(join(here, '..', 'app', 'lexlean.lock'), 'utf8'))[0]);

export function render() {
const lines = [
return [
'// @generated by builder/pack.mjs from builder/assets/. Do not edit.',
`export const ASSETS = ${JSON.stringify(table('assets/app'), null, 1)};`,
`export const TEMPLATE = ${JSON.stringify(table('assets/template'), null, 1)};`,
`export const TEMPLATE = ${JSON.stringify(Object.fromEntries(Object.entries(table('assets/template')).map(([path, text]) => [path, path === 'app/lexlean.lock' ? semantics(text) : text])), null, 1)};`,
`export const LOCK_PACKAGES = ${JSON.stringify(readFileSync(join(here, 'assets/lock-packages.toml'), 'utf8'))};`,
'',
];
return lines.join('\n');
].join('\n');
}

if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
Expand Down
2 changes: 1 addition & 1 deletion prismpm.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion template.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"contract_digest":"sha256:67a3292cfe6e6400bc18718b6a62e8741dec8d6d6b062cb0e4077fc8d9b616f5","policy_files":[{"path":".devcontainer/devcontainer.json","sha256":"sha256:77df0fd0a87ace0f9f71959055ffd05c14bcd3758f96c5ecf9d70ee6f376bf8f"},{"path":".github/workflows/bootstrap.yml","sha256":"sha256:029b7b321b2807f1878ffff5759b6d9c1e1e8ded445a6d750d7ae1ccfe787b9b"},{"path":"AGENTS.md","sha256":"sha256:9a1fe3f73ab2963812c35976909c331292e1ca39ce47c0711ec1aafe8b869d87"},{"path":"VERIFICATION.md","sha256":"sha256:0912821fea354276fff5faa2b6b6ded0cdf4ef86112ad035b41a0a7a0513bd21"},{"path":"prismpm.lock","sha256":"sha256:3dbd6a1bcb6f145f35f61e5e265495a1a6c9e071f4b2c6c89ae68f35eb600c02"},{"path":"template-contract.json","sha256":"sha256:67a3292cfe6e6400bc18718b6a62e8741dec8d6d6b062cb0e4077fc8d9b616f5"}],"policy_tree_sha256":"sha256:a8ed749f594e2abd6147a31ceabebc60bf134a00cb7bfd7e6c97c9229baba2cf","schema":"uor/template-lock/1","sdk_image":"ghcr.io/afflom/prismpm-sdk-patched@sha256:3dfa5f7284ace57c08bfe8d2effe2e08ab41da1a53f5820d48cccd498bd528c3","template_repository":"https://github.com/UOR-Foundation/template","template_revision":"174a56ce74d140f4a130bf29b1e7ba100321cbca"}
{"contract_digest":"sha256:67a3292cfe6e6400bc18718b6a62e8741dec8d6d6b062cb0e4077fc8d9b616f5","policy_files":[{"path":".devcontainer/devcontainer.json","sha256":"sha256:3dcad3b8fa8b45e9afefeb86c11ca16bbc96e16dad9d6094d8dff3c851683410"},{"path":".github/workflows/bootstrap.yml","sha256":"sha256:029b7b321b2807f1878ffff5759b6d9c1e1e8ded445a6d750d7ae1ccfe787b9b"},{"path":"AGENTS.md","sha256":"sha256:9a1fe3f73ab2963812c35976909c331292e1ca39ce47c0711ec1aafe8b869d87"},{"path":"VERIFICATION.md","sha256":"sha256:0912821fea354276fff5faa2b6b6ded0cdf4ef86112ad035b41a0a7a0513bd21"},{"path":"prismpm.lock","sha256":"sha256:6d61c85152fa0b0f306e499b5c491ff0f2727296a320eb008e1f7165bb5b5207"},{"path":"template-contract.json","sha256":"sha256:67a3292cfe6e6400bc18718b6a62e8741dec8d6d6b062cb0e4077fc8d9b616f5"}],"policy_tree_sha256":"sha256:fdc18e473dd22b6c4fb938169bdc297843b40785fc67473145bc16d7a6229535","schema":"uor/template-lock/1","sdk_image":"ghcr.io/afflom/prismpm-sdk-patched@sha256:a4dcef3614f6f8934b5993126e20213ce2141104d9e763eb6035c62d9da9bf55","template_repository":"https://github.com/UOR-Foundation/template","template_revision":"174a56ce74d140f4a130bf29b1e7ba100321cbca"}
Loading