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
20 changes: 12 additions & 8 deletions .github/lexlean-ci/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -345,10 +345,10 @@ sdk_copies_agree() {
status=1
fi
done
if diff -rq language/prism.arch "$scratch/language/prism.arch"; then
echo "language/prism.arch equals the SDK's"
if diff -rq conformance/language/prism.arch "$scratch/language/prism.arch"; then
echo "conformance/language/prism.arch equals the SDK's"
else
echo "language/prism.arch differs from the SDK's at $rev" >&2
echo "conformance/language/prism.arch differs from the SDK's at $rev" >&2
status=1
fi
rm -rf "$scratch"
Expand Down Expand Up @@ -414,30 +414,34 @@ run_oracle_tests() {
# of the export beside the build. The build id is the step output `build`.
build_conformance() {
local id
prismpm build | tee "${RUNNER_TEMP:?}/prismpm-build.log"
# conformance/ is the Prism project root (PrismPM takes the consumer's Cargo workspace
# root to be the project root); the sources it shares with the main project are
# staged into it first.
bash conformance/stage-shared.sh
(cd conformance && prismpm build) | tee "${RUNNER_TEMP:?}/prismpm-build.log"
id=$(sed -n 's/^build published: \([0-9a-f]\{64\}\)$/\1/p' "$RUNNER_TEMP/prismpm-build.log" | tail -n 1)
if [[ -z $id ]]; then
echo "prismpm build did not print 'build published: <id>'" >&2
return 1
fi
echo "build=$id" >>"${GITHUB_OUTPUT:-/dev/null}"
bash conformance/lay-out.sh ".prism/build/$id" "$RUNNER_TEMP/production-result.json"
bash conformance/lay-out.sh "conformance/.prism/build/$id" "$RUNNER_TEMP/production-result.json"
}

# check_core_identity: a rebuild reproduces the recorded identity of the core.
check_core_identity() {
local main conformance
main=$(sed -n 's/^compiler_semantics = "\(.*\)"$/\1/p' lexlean.lock)
conformance=$(sed -n 's/^compiler_semantics = "\(.*\)"$/\1/p' lexlean.conformance.lock)
conformance=$(sed -n 's/^compiler_semantics = "\(.*\)"$/\1/p' conformance/lexlean.conformance.lock)
echo "lexlean.lock records compiler-semantics $main"
echo "lexlean.conformance.lock records $conformance"
echo "conformance/lexlean.conformance.lock records $conformance"
if [[ -z $main || $main != "$conformance" ]]; then
echo "The two locks were made by different compilers; .github/lexlean.rev is the one pin." >&2
return 1
fi
node conformance/oracle/identity.mjs \
--result "${RUNNER_TEMP:?}/production-result.json" \
--lock lexlean.conformance.lock \
--lock conformance/lexlean.conformance.lock \
--package conformance/mcp_conformance_core \
--reference crates/lifecycle-oracle/generated/mcp_conformance/provenance.json \
--check conformance/core-identity.json
Expand Down
10 changes: 5 additions & 5 deletions .github/lexlean.rev
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
# Move this line together with `lexlean lock`, in one commit: the lock is made by
# the compiler this line names.
#
# Currently: UOR-Foundation/LexLean PR #292 (SM-37, `nested_induction`) at 0b0c95d96,
# stacked on PR #284 (DF-19, the recursive family of a nested type) at 9d0896b18,
# on release/v0.4. Both are accepted by the maintainer and wait for a release; the
# pin moves to a LexLean release before any release of this repository.
rev = 0b0c95d96ad544723dceee31e936c5d0b27445cf
# Currently: the head of UOR-Foundation/LexLean release/v0.4 at 5dccf9e5b (version
# 0.4.0), which carries SM-37 (`nested_induction`) and DF-19 (the recursive family
# of a nested type). The v0.4.0 release tag (e0b74b81e) does not; the pin moves to
# a LexLean release that does before any release of this repository.
rev = 5dccf9e5ba20d91d81f4f702f46a79e8b363bfb6
18 changes: 9 additions & 9 deletions .github/prismpm.rev
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# The PrismPM revision `prismpm build` is made by in .github/workflows/lexlean.yml,
# the only place it is written (AGENTS.md R1), like .github/lexlean.rev. The
# workflow builds `prismpm` at this commit and builds the conformance server
# application with it (conformance/, prismpm.toml).
# application with it (conformance/, the Prism project root; conformance/prismpm.toml).
#
# The LexLean it is built with is not the one PrismPM vendors but the revision of
# .github/lexlean.rev, so one pin drives both tools: the vendored lexlean (cee0fbade)
# cannot read this repository's sources (LLP2001 on `term_cases`, src/Json.lex.tex:230),
# and `JsonWriteLaws` uses `nested_induction`, which only SM-37 and later has. Nothing
# in PrismPM changes; the workflow replaces vendor/lexlean in its own copy of the tree
# (.github/lexlean-ci/lib.sh, `install_prismpm`; CI.md).
# .github/lexlean.rev, so one pin drives both tools: the vendored lexlean (e0b74b81e,
# the v0.4.0 tag) lacks SM-37, and `JsonWriteLaws` uses `nested_induction`, which
# only SM-37 and later has. Nothing in PrismPM changes; the workflow replaces
# vendor/lexlean in its own copy of the tree (.github/lexlean-ci/lib.sh, `install_prismpm`; CI.md).
#
# The pin moves to the PrismPM SDK release before MCP v0.1.0, and that release must
# pin a LexLean release that contains SM-37.
#
# Currently: UOR-Foundation/PrismPM#339 at its head, the `ServerApplication` model,
# the server build and the host packages.
rev = f5927bf46b92179d807ee6bf987f024b2f5a4e7e
# Currently: PrismPM main at 585ee8eb3 (version 0.4.0), whose workspace requires
# lexlean 0.4.0, the version of .github/lexlean.rev; #339 (version 0.3.0) cannot
# take it.
rev = 585ee8eb3123e624a189edbcba1001b6b7c57855
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,7 @@ criterion/
/conformance/mcp-conformance-host-api/
/conformance/mcp-conformance-host/
/conformance/target/
/conformance/shared/
/conformance/.prism/
/conformance/.lexlean/
/conformance/.lake/
8 changes: 4 additions & 4 deletions CI.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,17 @@ checks out that commit, refuses any other, requires every vendored file under
CF-07 and the provenance tests (LC-12) fail when one of them does not.

`.github/prismpm.rev` is the only place the PrismPM revision is written. It names
PrismPM#339 at its head, and it moves to the PrismPM SDK release before MCP v0.1.0.
PrismPM main at `585ee8eb3` (version 0.4.0), and it moves to the PrismPM SDK release before MCP v0.1.0.

**One LexLean pin drives both tools.** PrismPM vendors its own LexLean (`cee0fbade` at
#339's head), which cannot read this repository's sources and has no `nested_induction`.
**One LexLean pin drives both tools.** PrismPM vendors its own LexLean (`e0b74b81e`, the
v0.4.0 tag), which has no `nested_induction`.
Development imports commits, so `install_prismpm` builds `prismpm` from a copy of the PrismPM
tree at the pinned revision whose `vendor/lexlean` is the package `cargo package` makes of
the LexLean tree at `.github/lexlean.rev`. Nothing in PrismPM changes, `Cargo.lock` is
PrismPM's own (`--locked`), and the binary is accepted only when `$PRISMPM_ROOT/pins` names
both revisions, which are also the cache key. The profile is debug, because PrismPM's release
profile is killed for memory on a 7 GB runner. The compiler that certifies the core is then the
compiler `lexlean.lock` was made with, and CI checks it twice: `lexlean.conformance.lock` and
compiler `lexlean.lock` was made with, and CI checks it twice: `conformance/lexlean.conformance.lock` and
`lexlean.lock` record the same `compiler_semantics`, and the production result `prismpm build`
writes names that same compiler (`conformance/oracle/identity.mjs`).

Expand Down
21 changes: 11 additions & 10 deletions CONFORMANCE-RUN.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ is evidence for what it checks, not a proof about the core.
| Part | Where |
| --- | --- |
| The declaration, a PrismPM `ServerApplication` whose core is `UorMcp.ConformanceFixture.conformanceRun`, the step serve over the fixture provider | `conformance/src/Application.lex.tex`, generated from the vectors of the pinned scenarios: `cargo run -p lifecycle-oracle --example conformance_application -- --write` |
| The LexLean and PrismPM projects the declaration is built in | `lexlean.conformance.toml`, `lexlean.conformance.lock`, `prismpm.toml`; the main project (`lexlean.toml`) does not see them |
| The copies of PrismPM's `Foundation.Bytes`, `Foundation.Server.V1.Model` and the `prism.arch` lexicon | `conformance/src/Foundation`, `language/prism.arch`; byte for byte the files at the revision of `.github/prismpm.rev` (authority `A-PRISMPM-SERVER-APPLICATION`) |
| The LexLean and PrismPM projects the declaration is built in | `conformance/lexlean.conformance.toml`, `conformance/lexlean.conformance.lock`, `conformance/prismpm.toml`; `conformance/` is the Prism project root, because PrismPM takes the consumer's Cargo workspace root to be the project root, and `conformance/stage-shared.sh` copies the sources it shares with the main project (`src/`, `language/mcp.core`) into `conformance/shared/`, which git ignores, because LexLean accepts no path that leaves its project; the main project (`lexlean.toml`) does not see any of it |
| The copies of PrismPM's `Foundation.Bytes`, `Foundation.Server.V1.Model` and the `prism.arch` lexicon | `conformance/src/Foundation`, `conformance/language/prism.arch`; byte for byte the files at the revision of `.github/prismpm.rev` (authority `A-PRISMPM-SERVER-APPLICATION`) |
| The binding: the host effects `tool.calls` (the count of `tools/call` requests in the last 60 s), `clock.now`, `task.id`, `task.table` and `request.state.key` (the 32-byte key that seals and opens a `requestState`, held for the life of the process), which fill the request frame, and `task.store`, which the core requests to store the task table | `conformance/bindings/mcp-binding` |
| The consumer workspace: the generated core and host packages beside the binding | `conformance/Cargo.toml`; the three generated packages are not committed |
| The oracles | `conformance/oracle/`: `server-suite.mjs`, `recorder.mjs`, `verdict.mjs`, `schema-oracle.mjs`, `identity.mjs`, `fetch-suite.sh` |
Expand All @@ -35,14 +35,15 @@ The adapter enforces only what PrismPM's model states: loopback, the origins `lo
```sh
bash conformance/oracle/fetch-suite.sh "$SUITE" # the pinned commit, then npm ci
( . .github/lexlean-ci/lib.sh && PRISMPM_ROOT="$PRISMPM" install_prismpm ) # PrismPM at .github/prismpm.rev, built with the LexLean of .github/lexlean.rev
PATH="$PRISMPM/bin:$PATH" prismpm build # prints: build published: <id>
bash conformance/lay-out.sh .prism/build/<id> production-result.json
bash conformance/stage-shared.sh # src and language/mcp.core into conformance/shared
(cd conformance && PATH="$PRISMPM/bin:$PATH" prismpm build) # prints: build published: <id>
bash conformance/lay-out.sh conformance/.prism/build/<id> production-result.json
(cd conformance && cargo build --release --locked)
node conformance/oracle/server-suite.mjs --suite-root "$SUITE" --out out \
"$PWD/conformance/target/release/mcp-conformance-host" serve
node conformance/oracle/schema-oracle.mjs --suite-root "$SUITE" \
crates/lifecycle-oracle/suite/mcp-spec-80041ab0a139a8f4fb3adbc99f7ae9113ea59671/schema/2026-07-28/schema.json out/transcript.json
node conformance/oracle/identity.mjs --result production-result.json --lock lexlean.conformance.lock \
node conformance/oracle/identity.mjs --result production-result.json --lock conformance/lexlean.conformance.lock \
--package conformance/mcp_conformance_core \
--reference crates/lifecycle-oracle/generated/mcp_lifecycle/provenance.json --check conformance/core-identity.json
```
Expand Down Expand Up @@ -280,12 +281,12 @@ The pin move (MCP#44) was checked with a stale pin planted in one place at a tim

## The PrismPM pin, and what slice 3 still needs

`.github/prismpm.rev` names PrismPM#339 at its head, `f5927bf46b92179d807ee6bf987f024b2f5a4e7e`.
Nothing in PrismPM changes. #339 vendors LexLean `cee0fbade`, which cannot read this repository's
sources (`LLP2001` on `term_cases`, `src/Json.lex.tex:230`) and has no `nested_induction`, so for
`.github/prismpm.rev` names PrismPM main at `585ee8eb3123e624a189edbcba1001b6b7c57855` (version 0.4.0).
Nothing in PrismPM changes. PrismPM vendors LexLean `e0b74b81e` (the v0.4.0 tag), which has no
`nested_induction`, so for
development `install_prismpm` builds `prismpm` from a copy of the PrismPM tree whose
`vendor/lexlean` is the package `cargo package` makes of the LexLean tree at `.github/lexlean.rev`
(`0b0c95d96`, SM-37). One pin drives both tools. `Cargo.lock` is PrismPM's own (`--locked`). The
(`5dccf9e5b`, release/v0.4 head, with SM-37). One pin drives both tools. `Cargo.lock` is PrismPM's own (`--locked`). The
compiler that certifies the core is then the compiler both locks were made with, and CI checks that:
`lexlean.lock` and `lexlean.conformance.lock` record the same `compiler_semantics`, and so does the
production result of `prismpm build`. The generated `src/lib.rs` of the core is byte for byte the
Expand All @@ -298,7 +299,7 @@ For PrismPM slice 3:

* the vendored LexLean has to read MCP's sources, which needs SM-37 (`nested_induction`) or a
release that contains it;
* the build controller reads the LexLean build root as `.lexlean`, so `lexlean.conformance.toml`
* the build controller reads the LexLean build root as `.lexlean`, so `conformance/lexlean.conformance.toml`
sets `build_root = ".lexlean"`;
* `prismpm verify` of a server application is still PP2014;
* the release profile of `prismpm` (thin LTO, one codegen unit) is killed for memory on a 7 GB
Expand Down
2 changes: 1 addition & 1 deletion CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ Never re-derived, vendored, or gated on.
| `A-RFC6901` | P. Bryan, K. Zyp, M. Nottingham (eds.), RFC 6901, April 2013, section 3 (syntax) and section 5 (the escapes ~0 and ~1), https://www.rfc-editor.org/rfc/rfc6901 | `TL-10` |
| `A-WHATWG-SSE` | WHATWG, HTML Living Standard, section 9.2 (Server-sent events), 9.2.5 (the text/event-stream MIME type and its authoring notes) and 9.2.6 (interpreting an event stream), https://html.spec.whatwg.org/multipage/server-sent-events.html | `SH-01` |
| `A-MCP-EXT-TASKS` | https://github.com/modelcontextprotocol/ext-tasks at commit 899c1bbc869567670093face3591b39c28ce3219 (2026-10-09): specification/2026-07-28/tasks.md, schema/2026-07-28/schema.json and LICENSE, vendored under crates/lifecycle-oracle/suite; the proposal is docs/seps/2663-tasks-extension.mdx of https://github.com/modelcontextprotocol/modelcontextprotocol at commit 80041ab0a139a8f4fb3adbc99f7ae9113ea59671, which is not vendored | `TK-01`, `TK-02`, `TK-03`, `TK-04`, `TK-05`, `TK-06`, `TK-07`, `TK-08`, `TK-09`, `TK-10`, `TK-11`, `TK-12`, `TK-13`, `TK-16` |
| `A-PRISMPM-SERVER-APPLICATION` | https://github.com/UOR-Foundation/PrismPM at commit f5927bf46b92179d807ee6bf987f024b2f5a4e7e (pull request 339): stdlib/src/Foundation/Bytes.lex.tex, stdlib/src/Foundation/Server/V1/Model.lex.tex and the lexicon package language/prism.arch, copied under conformance/src/Foundation and language/prism.arch; .github/prismpm.rev pins this commit | `CF-01`, `CF-02`, `CF-06`, `CF-07` |
| `A-PRISMPM-SERVER-APPLICATION` | https://github.com/UOR-Foundation/PrismPM at commit 585ee8eb3123e624a189edbcba1001b6b7c57855 (main): stdlib/src/Foundation/Bytes.lex.tex, stdlib/src/Foundation/Server/V1/Model.lex.tex and the lexicon package language/prism.arch, copied under conformance/src/Foundation and conformance/language/prism.arch; .github/prismpm.rev pins this commit | `CF-01`, `CF-02`, `CF-06`, `CF-07` |
| `A-RFC2104` | H. Krawczyk, M. Bellare, R. Canetti, RFC 2104, February 1997, section 2 (definition of HMAC), https://www.rfc-editor.org/rfc/rfc2104 | `IR-11`, `IR-15` |
| `A-RFC4231` | M. Nystrom, RFC 4231, December 2005, section 4 (test vectors), test cases 1, 2, 3, 4, 6 and 7, https://www.rfc-editor.org/rfc/rfc4231 | `IR-15` |
| `A-FIPS-180-4` | NIST, FIPS PUB 180-4, August 2015, section 6.2 (SHA-256), https://csrc.nist.gov/pubs/fips/180-4/upd1/final | `IR-15` |
Expand Down
4 changes: 2 additions & 2 deletions JSON-CODEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ semantic ID and the SHA-256 of `lexlean.lock` it was exported from (SPEC section
`cargo xtask export` writes those pins and the target digest, runs
`lexlean production build --request` and replaces the package in
`crates/json-oracle/generated/mcp_json_codec` with the export. The lock was made with the compiler
pinned in `.github/lexlean.rev` (LexLean PR #292 at `0b0c95d96`, on PR #284, on
`release/v0.4`; see [CI.md](CI.md)).
pinned in `.github/lexlean.rev` (the head of LexLean
`release/v0.4` at `5dccf9e5b`; see [CI.md](CI.md)).

## Decisions

Expand Down
4 changes: 2 additions & 2 deletions LIFECYCLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ crates/lifecycle-oracle/generated/mcp_lifecycle` is empty), and the `lexlean / e
job of CI repeats the comparison for every `generated/request.json`. The package records
the semantic ID of the sources it states in `provenance.json` (`sources`), which equals
the `semantic` ID that `lexlean check` prints for the tree. The lock was made
with the compiler pinned in `.github/lexlean.rev` (LexLean PR #292 at `0b0c95d96`, on PR
#284, on `release/v0.4`; see [CI.md](CI.md)).
with the compiler pinned in `.github/lexlean.rev` (the head of LexLean
`release/v0.4` at `5dccf9e5b`; see [CI.md](CI.md)).

## The boundary encoding

Expand Down
4 changes: 2 additions & 2 deletions conformance/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# The consumer workspace of the conformance build (`prismpm build` at the repository
# root, then `conformance/lay-out.sh`): the core package and the two host packages
# The consumer workspace of the conformance build (`prismpm build` in conformance/, the Prism project root, after
# `conformance/stage-shared.sh`, then `conformance/lay-out.sh`): the core package and the two host packages
# that PrismPM generates, laid beside the binding crate this repository owns. The
# members are listed exactly, no glob, as PrismPM's `server_host::workspace::verify`
# requires; the three generated packages are not committed (.gitignore) and exist
Expand Down
20 changes: 10 additions & 10 deletions conformance/core-identity.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"version": "1.0.0",
"export": "run",
"target": {
"digest": "25e8eba5c28e98c5787c168bb517113e55de605e8e3cd7a517efd914dbc8b73c",
"digest": "f5095d80d7771c6ab6a6aa4c38fdce0621322c9d1e5b6f85435a4f2dbd410b35",
"id": "rust-std"
},
"files": [
Expand All @@ -18,30 +18,30 @@
},
{
"path": "package.json",
"sha256": "4f45ade550d1dc3188913bb5b2a2d85d351ca68a5d8dfd0a4dcffb591531bce5",
"sha256": "6ee79ea317634469862d6ab058f4e83e5e4bc7ab0ce204bcf88f7c000fea7f0b",
"byte_length": 1657582
},
{
"path": "provenance.json",
"sha256": "36bf9af8e8127a4b85804cdd58651ffe072cab8bb18e9291a11dcce37860dc67",
"sha256": "3d7d84d96af943651a771ac066ebaf08f7c7eca94af1a9d35cbe8437284269a5",
"byte_length": 673
},
{
"path": "src/lib.rs",
"sha256": "4bf53ec38117fdde5f0f5c7c6bb8a04c6a90fde3ea6d52b735d44ce3267529d7",
"byte_length": 849797
"sha256": "aaf619ddda094b86acc54bd28d23de7ab3124004a7c51beb6ab275e5096d8d73",
"byte_length": 853119
}
]
},
"source": {
"source_id": "173967136b995e5d9e89e4d77bdaa55cbd08149e3a26eb71833f3fd7eb3d28c5",
"semantic_id": "5e01f4ad62bcf83c56a1091449c2dc1edc9218c095c5a3257ac4166507e85bd2",
"lock_sha256": "348f5ea5f678a956b7809c2c346f7889746a15d23faa7fc694c7f5f62105f482"
"source_id": "2fd43d9a404906eb6918c47fb4c8b9b22bcb8d383db61820d8b6ff496db94cdd",
"semantic_id": "0a5db87952c8056f612571dd9610bd4924f5adad8cd557d07d12ffe37fc71cda",
"lock_sha256": "e59199cd5c9249aef04c0f35ac65548e0f1381c0bddd2e4eab107b08afdfc82b"
},
"compiler": {
"lean_toolchain": "leanprover/lean4:v4.32.1",
"semantics": "81a5f530241bed4ca42585e2345d91be731fe46121284fbe4c199ea356489b10",
"version": "0.3.0"
"semantics": "635a25acb886587f8777525e778092e9599d1f2df26da59403ee39e9e299151a",
"version": "0.4.0"
},
"same_program_as": {
"package": "mcp_conformance",
Expand Down
1 change: 1 addition & 0 deletions conformance/lake-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"1.2.0","packagesDir":".lake/packages","packages":[],"name":"UorMcp","lakeDir":".lake","fixedToolchain":false}
6 changes: 6 additions & 0 deletions conformance/lakefile.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
name = "UorMcp"
version = "0.1.0"
defaultTargets = ["UorMcp"]

[[lean_lib]]
name = "UorMcp"
17 changes: 17 additions & 0 deletions conformance/language/prism.arch/entries/arch-feature.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
spec = "lexlean/entry/1"
id = "arch-feature"
category = "label-word"
surface_arity = 0
frame = "atom"

[denotation]
kind = "document"
module = "Foundation.Arch"
component = "Feature"

[[form]]
id = "arch-feature"
channel = "text"
surface = "feature"
canonical_source = true
features = ["sentence-case", "singular"]
Loading
Loading