Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
71e7530
Prism model: ncm's plasticity as the neuromorphic standard; Pages clo…
claude Nov 10, 2026
ce21a83
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 10, 2026
4d1e0f9
Pages client: Prism product model of the page, generated from it, wit…
claude Nov 10, 2026
9caee8f
Pages client acceptance is a factory obligation keyed on its own inputs
claude Nov 10, 2026
e0e2e30
pages-client: read the single-obligation route outputs
claude Nov 10, 2026
02a0fc0
Merge main (#129 squash, tree identical to the stacked base)
claude Nov 10, 2026
8b7b037
Merge main (#130, repeats at any offset) into the pages client
claude Nov 11, 2026
cbe2df8
Pages client: folders stream through the frame operations
claude Nov 11, 2026
0399607
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
cccf80f
Page acceptance: all-zero frames are reference frames again (#134)
claude Nov 11, 2026
aca17b9
Merge main (#131 per-leg closures, #134) into the pages client
claude Nov 11, 2026
69e3e0d
factory: the formal set holds web/index.html, a projection of the pag…
claude Nov 11, 2026
0ce33f1
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
2df0067
Page acceptance: the page restores the released v0.2.0 and v0.3.0 arc…
claude Nov 11, 2026
208149f
template-check: report /tmp use before PrismPM's native regeneration
claude Nov 11, 2026
d7d1ea9
template-check: run PrismPM's template check before the xtask audit
claude Nov 11, 2026
60c4aef
template-check: report /tmp, tree sizes and cargo environment before …
claude Nov 11, 2026
8032234
template-check: build PrismPM's native regeneration in the workspace …
claude Nov 11, 2026
e6399ae
model-write: build into the target the template check names, not besi…
claude Nov 11, 2026
7c7aa57
template-check: the staged regeneration builds in a target directory …
claude Nov 11, 2026
da13c97
uorc: the performance vocabulary (step measure, codec point, corpus κ)
claude Nov 11, 2026
64cb8bc
uorc: an x86-filtered frame costs the same steps as its profile
claude Nov 11, 2026
3243fdf
Product model v0.5: codec point per frame, claims and engine state in…
claude Nov 11, 2026
ce37140
Restore the generated client crates cargo fmt touched
claude Nov 11, 2026
589605b
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
499acd6
inspect and the page mark an x86-filtered frame's profile word
claude Nov 11, 2026
9d8ad49
Merge main (v0.4.0, #138, #140); read the real claim register and eng…
claude Nov 11, 2026
220edd2
Merge main (#137 claim register) into the product model lane
claude Nov 11, 2026
151f950
Merge remote-tracking branch 'origin/main' into claude/project-thread…
claude Nov 11, 2026
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 .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,8 @@ jobs:
rm -rf "dist/$name"
done
# The site is a browser closure v2: the page, the brand files, provenance.
node scripts/site.mjs site --wasm build/wasm/uorc.wasm --version "$TAG" --bench bench
# model.json beside it: the theorems, claims and engine state the page shows.
node scripts/site.mjs site --wasm build/wasm/uorc.wasm --version "$TAG" --bench bench --frontier claims/frontier.toml --model-notes model.md
name="uorc-${TAG}-wasm"
mkdir -p "dist/$name"
cp site/uorc_bg.wasm "dist/$name/uorc.wasm"
Expand All @@ -390,6 +391,7 @@ jobs:
Cargo.toml Cargo.lock rust-toolchain.toml crates/uorc crates/uorc-wasm generated/rust LICENSE-APACHE LICENSE-MIT
cp bench/bench.json "dist/uorc-${TAG}-bench.json"
cp claims/frontier.toml "dist/uorc-${TAG}-frontier.toml"
cp site/model.json "dist/uorc-${TAG}-model.json"
(cd dist && sha256sum uorc-*-wasm.tar.gz uorc-*-src.tar.gz *.json *.toml > SHA256SUMS-wasm-src)
ls -la dist
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
Expand All @@ -405,7 +407,7 @@ jobs:
GH_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
{ printf 'uorc %s\n\n' "$TAG"; printf 'Client: https://%s.github.io/%s/\n\n' "${GITHUB_REPOSITORY_OWNER,,}" "${GITHUB_REPOSITORY#*/}"; cat claims/frontier/frontier.md; echo; cat bench/bench.md; } > notes.md
{ printf 'uorc %s\n\n' "$TAG"; printf 'Client: https://%s.github.io/%s/\n\n' "${GITHUB_REPOSITORY_OWNER,,}" "${GITHUB_REPOSITORY#*/}"; cat claims/frontier/frontier.md; echo; cat model.md; echo; cat bench/bench.md; } > notes.md
if gh release view "$TAG" >/dev/null 2>&1; then
gh release upload "$TAG" dist/* --clobber
else
Expand Down
2 changes: 2 additions & 0 deletions CONFORMANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ The three honesty levels (R2):
| ID | Level | Statement |
| --- | --- | --- |
| `UC-WEB-01` | `build` | The Pages client is generated from and conforms to its Prism product model in Uorc.Page: stakeholders, features with their calls and acceptance cases, journeys, the page's UML state machine, operations, fields, controls, examples, error hints, sections, usage, links and quality measures. The generated page holds exactly the modeled elements, and a real browser walks every journey, takes every modeled transition, checks every control's enabled state in every state it reaches and holds every gated quality measure. |
| `UC-WEB-02` | `build` | The product shows the codec as a point of its modelled space: uorc inspect, the library's Info JSON and the Pages client name each frame's codec point (basis, ncm profile word, consolidated model state, lanes and its κ) and the exact steps its decode takes, as Uorc.Performance defines them, from the header alone; the page's model view shows the release's performance theorems, its closed claims with codec point, corpus κ, bytes, steps and the factory's decision, and the engine's tick, rule30 register and weights, exactly as the release publishes them in model.json. |

## performance-theorems

Expand Down Expand Up @@ -196,3 +197,4 @@ The three honesty levels (R2):
| `UC-PERF-07` | `build` | `kernel_theorem` | `not_measured` | A trial abandoned at a bound is modelled as a trial of at most the bound's bytes. For every list of trials and every raw length, the portfolio of trials abandoned at the raw length settles to the same size as the portfolio of complete trials (boundedPortfolioSettlesTheSame), and a trial no smaller than one already kept changes neither the kept bytes nor the kept steps (skippedTrial theorems): a search that stops a candidate once it cannot win, or skips one known to be no smaller, writes an archive of the same size for fewer compress steps. |
| `UC-PERF-08` | `build` | `kernel_theorem` | `not_measured` | Choosing by fewer bytes and then fewer steps, from the raw frame and any list of trials, keeps a trial that is no later in that order than every trial in the list and than the raw frame (chosenIsLeast, chosenIsNoWorseThanRaw), has exactly the size the bytes-only rule settles to (chosenKeepsTheSize), and is dominated by no trial it is no later than (leastIsUndominated); a trial no earlier than the kept one changes nothing (excludedTrial theorems). The rule lowers decode steps on byte ties at no cost in size. The released client breaks byte ties by schedule order until its model export adopts this rule. |
| `UC-PERF-09` | `build` | `kernel_theorem` | `not_measured` | The potential of a codec point is its bytes plus its steps. Consolidating a candidate into an incumbent lowers the potential by exactly the candidate's gain (consolidationSpendsItsGain), which is positive exactly when the candidate dominates, and over any sequence of candidates the potential never rises (potentialNeverRises). The potential is a natural number, so an engine that consolidates only dominating candidates never regresses and consolidates at most as many times as its first potential. |
| `UC-WEB-02` | `build` | `build_evidence` | `not_measured` | The product shows the codec as a point of its modelled space: uorc inspect, the library's Info JSON and the Pages client name each frame's codec point (basis, ncm profile word, consolidated model state, lanes and its κ) and the exact steps its decode takes, as Uorc.Performance defines them, from the header alone; the page's model view shows the release's performance theorems, its closed claims with codec point, corpus κ, bytes, steps and the factory's decision, and the engine's tick, rule30 register and weights, exactly as the release publishes them in model.json. |
92 changes: 91 additions & 1 deletion crates/model/src/page.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ pub const ERROR_CODES: &[&str] = &[
"budget", "overflow", "decode", "mismatch", "stopped", "load",
];
/// The tables the page draws.
pub const TABLES: &[&str] = &["inspect", "examples"];
pub const TABLES: &[&str] = &["inspect", "examples", "theorems", "claims", "weights"];
/// The tables of the model view, each filled from the release's `model.json`,
/// with the label of its heading.
const MODEL_TABLES: &[(&str, &str)] = &[
("theorems", "theorems"),
("claims", "claims"),
("weights", "engine"),
];

/// One row: the definition's name and its record's fields as JSON.
#[derive(Debug, Clone, PartialEq)]
Expand Down Expand Up @@ -435,6 +442,11 @@ impl PageModel {
)));
}
}
for table in TABLES {
if !self.of("Column").iter().any(|c| c.str("table") == *table) {
return Err(inconsistent(format!("table `{table}` has no column")));
}
}
let codes = unique("ErrorHint", "code")?;
if codes != ERROR_CODES.iter().map(ToString::to_string).collect() {
return Err(inconsistent(format!(
Expand Down Expand Up @@ -666,6 +678,39 @@ impl PageModel {
}
h.push_str("</tr></thead><tbody></tbody></table></div>\n</section>\n");

// What the codec claims: the release's theorems, closed claims and
// engine state, which app.js reads from the published model.json.
let _ = write!(
h,
"<section id=\"model\" aria-labelledby=\"model-title\" data-empty=\"{}\">\n<h2 id=\"model-title\">{}</h2>\n<p>{}</p>\n",
esc(labels.str("unpublished")),
esc(labels.str("model")),
esc(labels.str("modelHelp"))
);
for (table, heading) in MODEL_TABLES {
let _ = writeln!(
h,
"<h3 id=\"model-{table}-title\">{}</h3>",
esc(labels.str(heading))
);
if *table == "weights" {
h.push_str("<p id=\"model-engine\"></p>\n");
}
let _ = write!(
h,
"<div class=\"table-wrap\"><table id=\"model-{table}\" aria-labelledby=\"model-{table}-title\"><thead><tr>"
);
for column in self
.sorted("Column")
.into_iter()
.filter(|c| c.str("table") == *table)
{
let _ = write!(h, "<th scope=\"col\">{}</th>", esc(column.str("label")));
}
h.push_str("</tr></thead><tbody></tbody></table></div>\n");
}
h.push_str("</section>\n");

// What the page does, and usage elsewhere.
for section in self.sorted("Section") {
let _ = write!(
Expand Down Expand Up @@ -764,6 +809,45 @@ mod tests {
assert!(page.contains("id=\"page-model\""));
}

/// The model view: one table per model table with the model's columns,
/// the engine line, and the inspect table carries the codec point columns.
#[test]
fn the_model_view_holds_every_model_table_uc_web_02() {
let model = PageModel::load(&root()).expect("the page model checks");
let page = model.render();
assert!(page.contains("<section id=\"model\""));
assert!(page.contains("id=\"model-engine\""));
for (table, _) in MODEL_TABLES {
assert!(page.contains(&format!("id=\"model-{table}\"")));
for column in model
.of("Column")
.iter()
.filter(|c| c.str("table") == *table)
{
assert!(page.contains(&format!(
"<th scope=\"col\">{}</th>",
esc(column.str("label"))
)));
}
}
let keys: BTreeSet<&str> = model
.of("Column")
.iter()
.filter(|c| c.str("table") == "inspect")
.map(|c| c.str("key"))
.collect();
for key in [
"codec_point",
"steps",
"state",
"lanes",
"ncm_profile",
"claims",
] {
assert!(keys.contains(key), "inspect shows no {key}");
}
}

/// Each Prism check rejects its planted defect.
#[test]
fn planted_model_defects_are_rejected_uc_web_01() {
Expand Down Expand Up @@ -811,6 +895,12 @@ mod tests {
("uncovered error", |m| {
m.rows.get_mut("ErrorHint").expect("rows").pop();
}),
("table without columns", |m| {
m.rows
.get_mut("Column")
.expect("rows")
.retain(|c| c.str("table") != "weights");
}),
("remote link", |m| {
set(m, "Link", 0, "href", Value::from("https://example.com/"))
}),
Expand Down
31 changes: 30 additions & 1 deletion crates/uorc/src/bin/uorc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ restore keeps the files it completed). An existing output is never replaced
unless --force is given.

inspect reads every frame header and checks each integrity seal without
decoding. verify decodes without keeping the output and checks integrity and
decoding, and names each frame's codec point (basis, profile word, model
state, lanes, and its κ) and the exact steps its decode takes. verify decodes without keeping the output and checks integrity and
declared lengths, and, given an original, that the archive reproduces it byte
for byte. All commands stream, so memory stays bounded whatever the size.

Expand Down Expand Up @@ -758,10 +759,38 @@ fn describe(info: &uorc::Info) -> String {
}
},
);
let point = uorc::performance::CodecPoint::of(info);
let hex = |b: &[u8]| b.iter().map(|x| format!("{x:02x}")).collect::<String>();
let codec = format!(
"profile word {}\n\
model state {}\n\
lanes {}\n\
steps {}\n\
codec point {}",
info.ncm_profile.map_or_else(
|| "none".to_owned(),
|p| match info.representation {
uorc::Representation::NcmX86 => format!("0x{p:05x} x86"),
_ => format!("0x{p:05x}"),
}
),
if point.state == [0; 32] {
"none".to_owned()
} else {
hex(&point.state)
},
point.lanes,
uorc::performance::frame_steps(info).map_or_else(
|| "not modelled for this representation".to_owned(),
|s| s.to_string()
),
hex(&point.kappa()),
);
format!(
"format {} (machine profile {})\n\
scope {scope}\n\
representation {}\n\
{codec}\n\
objects {} ({} bytes)\n\
body {} bytes\n\
archive {} bytes\n\
Expand Down
14 changes: 12 additions & 2 deletions crates/uorc/src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ impl Info {

/// One JSON object describing the archive (no external JSON dependency).
pub fn to_json(&self) -> String {
let point = crate::performance::CodecPoint::of(self);
let lengths: Vec<String> = self.object_lengths.iter().map(u64::to_string).collect();
format!(
"{{\"format\":{},\"profile\":{},\"scope\":\"{}\",\"basis\":{},\"representation\":\"{}\",\"ncm_profile\":{},\"window\":{},\
\"objects\":{},\"object_lengths\":[{}],\"output_bytes\":{},\"body_bytes\":{},\
\"archive_bytes\":{},\"integrity\":\"{}\",\"digest\":\"{}\",\"integrity_ok\":{},\"steps\":{}}}",
\"archive_bytes\":{},\"integrity\":\"{}\",\"digest\":\"{}\",\"integrity_ok\":{},\
\"state\":{},\"lanes\":{},\"steps\":{},\"codec_point\":\"{}\"}}",
self.format,
self.profile,
if self.basis.is_some() { "conditional" } else { "self-contained" },
Expand All @@ -122,7 +124,15 @@ impl Info {
self.integrity_profile(),
self.digest_hex(),
self.integrity_ok,
crate::performance::frame_steps(self).map_or_else(|| "null".to_owned(), |n| n.to_string()),
if point.state == [0; 32] {
"null".to_owned()
} else {
format!("\"{}\"", hex(&point.state))
},
point.lanes,
crate::performance::frame_steps(self)
.map_or_else(|| "null".to_owned(), |s| s.to_string()),
hex(&point.kappa()),
)
}
}
Expand Down
46 changes: 46 additions & 0 deletions crates/uorc/tests/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,52 @@ fn inspect_reads_the_header_without_decoding() {
assert_eq!(code(&uorc(&["inspect", s(&input)])), 4);
}

/// UC-WEB-02: inspect names each frame's codec point and the exact steps its
/// decode takes, as `uorc::performance` reads them from the header, in JSON
/// and in text, for an ncm frame and a raw frame.
#[test]
fn inspect_names_each_frames_codec_point_uc_web_02() {
let dir = scratch("inspect-point");
let text: Vec<u8> = TEXT.iter().copied().cycle().take(20_000).collect();
let mut x = 0x9e37_79b9_7f4a_7c15u64;
let noise: Vec<u8> = (0..4000)
.map(|_| {
x ^= x << 13;
x ^= x >> 7;
x ^= x << 17;
(x >> 56) as u8
})
.collect();
for (name, data) in [("t.txt", &text), ("n.bin", &noise)] {
let input = dir.join(name);
fs::write(&input, data).unwrap();
assert_eq!(code(&uorc(&["compress", s(&input)])), 0);
let archive = dir.join(format!("{name}.uorc"));
let shown = uorc(&["inspect", "--json", s(&archive)]);
assert_eq!(code(&shown), 0, "{shown:?}");
let json = String::from_utf8(shown.stdout).unwrap();
let text = String::from_utf8(uorc(&["inspect", s(&archive)]).stdout).unwrap();
let coding = if name == "t.txt" { "ncm" } else { "raw" };
assert!(
json.contains(&format!("\"representation\":\"{coding}\"")),
"{json}"
);
for frame in uorc::frames(&fs::read(&archive).unwrap()).unwrap() {
let info = uorc::inspect(frame).unwrap();
let point = uorc::performance::CodecPoint::of(&info);
let kappa: String = point.kappa().iter().map(|b| format!("{b:02x}")).collect();
let steps = uorc::performance::frame_steps(&info).expect("modelled steps");
assert!(
json.contains(&format!("\"steps\":{steps},\"codec_point\":\"{kappa}\"")),
"{json}"
);
assert!(json.contains("\"state\":null,\"lanes\":1"), "{json}");
assert!(text.contains(&format!("codec point {kappa}")), "{text}");
assert!(text.contains(&format!("steps {steps}")), "{text}");
}
}
}

#[test]
fn verify_checks_integrity_and_the_original() {
let dir = scratch("verify");
Expand Down
Loading
Loading