Skip to content

factory: key each formal leg on its own closure and run it in a closure copy - #131

Merged
afflom merged 3 commits into
mainfrom
claude/project-thread-lnqf2y
Nov 11, 2026
Merged

afflom merged 3 commits into
mainfrom
claude/project-thread-lnqf2y

Conversation

@afflom

@afflom afflom commented Nov 10, 2026

Copy link
Copy Markdown
Member

Requested by Alex · project thread

Follow-up to #128. PrismPM #586 keys each obligation on its own declared inputs and runs it in a copy of its closure. The formal bootstrap legs now do both.

What changes

  • Per-leg inputs (factory/graph.json):
    • artifacts reads the LexLean project only: src/ and its project files.
    • varint reads the import closure of Uorc.Varint and Uorc.VarintContract.
    • integrity reads the import closure of every Uorc.Integrity module plus Uorc.Wire.ArchiveIntegrity and Uorc.Wire.OwnedRead (99 of 340 modules), along with validation/integrity/ and standards/.
    • claims and reproducibility keep the formal set.
    • Effect: a registry or claims edit no longer re-runs integrity (~37 min on Key every CI and release obligation on its own inputs (factory route) #128's run) or varint. A model, features or CONFORMANCE change no longer re-runs artifacts (~71 min).
  • Closure copy: a new step, factory.mjs materialize, deletes every tracked file a leg does not declare before the leg runs, so an undeclared input fails the leg.
    • It found one already: just model-write reads README.md, which the old formal scope left out. It is declared now.
  • New input kinds:
    • closure:ROOTS@DIRS takes several roots, and Dir.* roots.
    • manifest:PATH declares a Cargo manifest without its crate. The copy gives that crate's targets empty files, so legs that build xtask resolve the workspace without reading product code.
    • The formal set now declares Cargo.toml and Cargo.lock, which every formal leg reads through cargo.
  • Export record: generated/rust/factory.identity is re-recorded because the export input is now spelled closure:Uorc.Client@client/src,src. The closure content is unchanged.

Checked locally, in closure copies (LexLean 0.4.0, Lean 4.32.1)

  • varint: passes ("3 varint defects rejected by their owning kernel declarations").
  • integrity: the full recipe passes, all node tests and the canonical runtime.
  • artifacts: lexlean check --all on its closure reports the same 340-module source identity CI reports (80aec32e…).
  • claims and reproducibility: the xtask tests compile, and model-write regenerates identical projections.
  • node --test scripts/factory.test.mjs: 7 pass. tests/sdk-preflight: 17 pass. audit-source-authority: passes. actionlint: clean.

Generated by Claude Code

…re copy

PrismPM #586 keys each obligation on its own declared inputs and runs it in
a copy of its closure. The formal legs now do both:

- artifacts reads the LexLean project (src/ and its project files) only;
  varint the import closure of Uorc.Varint and Uorc.VarintContract; integrity
  the import closure of every Uorc.Integrity module and the two Wire modules
  it binds (99 of 340 modules), validation/integrity/ and standards/. A
  registry or claims edit no longer re-runs integrity or varint; a model,
  features or CONFORMANCE change no longer re-runs artifacts.
- closure:ROOTS@DIRS inputs take several roots and Dir.* roots; manifest:PATH
  inputs declare a Cargo manifest without its crate, so legs that build xtask
  resolve the workspace without reading the product crates' code.
- factory.mjs materialize deletes every tracked file a leg does not declare
  (stubbing the manifest-only crates' targets) before the leg runs, so an
  undeclared input fails the leg. It found one: just model-write reads
  README.md, which the formal scope left out; it is declared now.
- The formal scope now declares Cargo.toml and Cargo.lock, which every formal
  leg reads through cargo.

Checked locally in closure copies (LexLean 0.4.0, Lean 4.32.1): varint passes;
integrity passes in full (all node tests and the canonical runtime);
artifacts' closure checks 340 modules with the same source identity CI
reports; claims' xtask tests compile and model-write regenerates the same
projections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LdDSxZc5dyuEbM7w7
@afflom afflom self-assigned this Nov 10, 2026
claude and others added 2 commits November 10, 2026 23:49
Keeps #129's formal exclusions (vendor/hologram-brand/, scripts/site.)
and excludes scripts/site. from the scripts set too: only the rest legs
run site.test.mjs, and they read the whole tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LdDSxZc5dyuEbM7w7
@afflom
afflom merged commit 367de79 into main Nov 11, 2026
14 checks passed
afflom pushed a commit that referenced this pull request Nov 11, 2026
The formal and scripts sets exclude the page acceptance and its workflow;
the pages obligation and its gate edge sit beside #131's per-leg inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk
afflom pushed a commit that referenced this pull request Nov 11, 2026
…0.4.0

The export identity is re-recorded under #131's closure rule (the exported
client sources are unchanged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3Mtk8bNt1Y8AGfBfPY
afflom pushed a commit that referenced this pull request Nov 11, 2026
…e model

#131's legs run on a checkout materialized to their inputs, and the formal
set excluded web/, so reproducibility found the check-model projection
web/index.html missing (URP004). The page is rendered from
src/Uorc/Page.lex.tex, so it belongs with the formal inputs; the rest of
web/ stays out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk
afflom added a commit that referenced this pull request Nov 11, 2026
…h browser acceptance (#132)

* Prism model: ncm's plasticity as the neuromorphic standard; Pages closure v2

Uorc.Neuromorphic (src/Uorc/Neuromorphic.lex.tex) states the plasticity of
every learning part of the ncm coder as the Prism neuromorphic standard, in
the codec's own integer (offset) form, with kernel-checked bounds:

- hebbianBoundsHold: every mixer weight stays within +-2^22 under the
  bounded Hebbian rule; potentiation never lowers and depression never
  raises a weight.
- plasticityBoundsHold: the plasticity 24 + 104*4096/(4096+pos) lies in
  [24, 128] per 65536 (closed vectors 128, 76, 25, 24 by decide).
- laneFitHolds: |x * err * plasticity| <= 1,073,217,536 < 2^31, so the
  SIMD kernels' 32-bit lanes cannot overflow, and one bit changes a weight
  by at most 16,376.
- slot plasticity: rates 131072/(2n+3) lie in [510, 43690], a slot never
  steps past its gap to the coded bit, and consolidates at count 127.
- refinementBoundsHold: probability-map points stay within 16 bits.

The products are proved through `scale`, the product by its recursion
(scaleIsMultiply bridges it to `*`), with each bound carried in one
induction, since omega has no nonlinear arithmetic.

The native coder reads the model's constants from ncm::standard (byte
identical output); tests/neuromorphic.rs holds them equal to the model's and
the theorem inventory complete. Registered as UC-NEU-01 (kernel_theorem).

The Pages site becomes a Prism browser closure v2 (PrismPM SPEC 1.2.1):
index.html, app.css, app.js, uorc.js, uorc_bg.wasm, provenance.json and the
ten Hologram brand files (fonts, licences, icons, manifest.webmanifest),
flat and same-origin, installable, with no remote load. The brand files are
vendored byte-identical to PrismPM's (vendor/hologram-brand).
scripts/site.mjs assembles and checks the closure (provenance.json names
every file's SHA-256); release.yml uses it and `just test` runs its tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3MmVJi8mhN3UZ6rgwH

* Pages client: Prism product model of the page, generated from it, with browser acceptance

src/Uorc/Page.lex.tex states the page in Prism's product-modeling vocabulary
(Foundation.Arch stakeholders, features, journeys and UML state machine;
Foundation.Qual requirements and measures; the text/3 workbench's operations,
fields, examples, error hints, sections, usage, links and labels), registered
as UC-WEB-01. repo-model checks it as PrismPM checks its own (PP2014-PP2017,
one initial state, closed triggers, reachability, closed sets) and renders
web/index.html from it; app.js interprets the embedded model.

The codec runs in a module worker (uorc.js), with progress, Cancel, typed
error hints and recovery from a stopped worker. In-memory decoding no longer
spawns threads, which trapped WebAssembly on Verify, every example and every
folder archive. The wasm client builds with SIMD128 (1.34x, same bytes).

scripts/page-acceptance.mjs drives the built site in headless Chrome over the
DevTools protocol: every journey, all 17 acceptance cases, all 11 transitions,
controls checked against the model in every state, gated quality measures.
CI runs it in pages-client.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Pages client acceptance is a factory obligation keyed on its own inputs

The page acceptance runs as obligation `pages` (factory/graph.json): its
identity covers the client set, the wasm crate, web/, the brand files and the
two site scripts, so other changes find its receipt and skip it. The release
gate needs it, and factory.yml records its receipts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* pages-client: read the single-obligation route outputs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Pages client: folders stream through the frame operations

compressTreeBlob and decompressTreeBlob run a file tree a frame at a time
(FrameEncoder::objects over the tree layout; decoded frames split at their
object lengths), so a folder of any size never sits whole in wasm memory.
The wasm test checks the streamed tree equals the library's compress_tree
bytes and restores the same entries. The model's features name the new
calls, and the acceptance checks that every uorc.* call a feature names
exists in the shipped uorc.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Page acceptance: all-zero frames are reference frames again (#134)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* factory: the formal set holds web/index.html, a projection of the page model

#131's legs run on a checkout materialized to their inputs, and the formal
set excluded web/, so reproducibility found the check-model projection
web/index.html missing (URP004). The page is rendered from
src/Uorc/Page.lex.tex, so it belongs with the formal inputs; the rest of
web/ stays out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Page acceptance: the page restores the released v0.2.0 and v0.3.0 archives

New acceptance case decompress-released (feature decompressArchive): every
archive in crates/uorc/tests/compat is restored in the browser to its
original bytes. Measured against ncm v4 (#133): 18 cases pass; compress
178 KB/s, decompress 467 KB/s, worker memory 215 MiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: report /tmp use before PrismPM's native regeneration

The rest legs fail with ENOSPC while PrismPM's template check builds the
regeneration copy in the SDK container's 2 GiB /tmp; locally the copy and
its build peak at 0.72 GB both at the last green revision and now. Print
what holds /tmp at that point so the cause is measured, not guessed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: run PrismPM's template check before the xtask audit

Measured in the rest leg: when PrismPM's native regeneration starts,
/tmp (2 GiB tmpfs in the SDK container) already holds 1.2 GB, all of it
/tmp/prismpm-cargo-1001, the debug xtask build audit-bootstrap leaves
there. The regeneration copies the tree (0.13 GB) and builds it from
scratch (0.72 GB at peak, measured in a 2 GiB tmpfs), so the lexlean
rlib write hits ENOSPC. Running the template check first gives it an
empty /tmp; both checks still run and must pass. Drops the /tmp report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: report /tmp, tree sizes and cargo environment before the template check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: build PrismPM's native regeneration in the workspace target

Measured in the rest leg: the SDK container's /tmp is a 2 GiB tmpfs and
CARGO_HOME (/tmp/prismpm-cargo-1001) already holds 1.1 GiB of it when the
template check starts. Native regeneration copies the tree there (0.13 GB)
and built it from scratch beside the copy (0.69 GiB at peak), which ran
out of space writing the lexlean rlib. With CARGO_TARGET_DIR at the
workspace's target on disk the build reuses audit-bootstrap's compiled
dependencies, rebuilds the workspace crates from the staged sources, and
/tmp holds only the copy (measured in a 2 GiB tmpfs: 0.13 GB, 4 s instead
of 43 s). Restores the original order and drops the diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* model-write: build into the target the template check names, not beside the staged copy

PrismPM runs model-write in a copy of the tree staged in the SDK's /tmp
(a 2 GiB tmpfs of which CARGO_HOME holds 1.1 GiB) with a cleared
environment that keeps only PATH, the toolchain homes, HOME and
XDG_CACHE_HOME, so CARGO_TARGET_DIR (8032234) never reached it. The
template check now leaves .tmp/model-write-target, which is copied with
the tree, and model-write builds into that directory (the workspace's
target on disk) when the note is there and into target otherwise.
Simulated with the same cleared environment in a 2 GiB tmpfs: /tmp holds
only the 0.13 GB copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: the staged regeneration builds in a target directory of its own

On e6399ae the template check passed, but the next recipe (validate) ran
the xtask binary the staged copy had built into the workspace's target:
cargo took it as current, and it read sources at the copy's deleted
/tmp path. The note now names target/regeneration, still on the
workspace's disk and shared with nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

---------

Co-authored-by: Claude <noreply@anthropic.com>
afflom added a commit that referenced this pull request Nov 11, 2026
…ounded decode memory (#140)

* Prism model: ncm's plasticity as the neuromorphic standard; Pages closure v2

Uorc.Neuromorphic (src/Uorc/Neuromorphic.lex.tex) states the plasticity of
every learning part of the ncm coder as the Prism neuromorphic standard, in
the codec's own integer (offset) form, with kernel-checked bounds:

- hebbianBoundsHold: every mixer weight stays within +-2^22 under the
  bounded Hebbian rule; potentiation never lowers and depression never
  raises a weight.
- plasticityBoundsHold: the plasticity 24 + 104*4096/(4096+pos) lies in
  [24, 128] per 65536 (closed vectors 128, 76, 25, 24 by decide).
- laneFitHolds: |x * err * plasticity| <= 1,073,217,536 < 2^31, so the
  SIMD kernels' 32-bit lanes cannot overflow, and one bit changes a weight
  by at most 16,376.
- slot plasticity: rates 131072/(2n+3) lie in [510, 43690], a slot never
  steps past its gap to the coded bit, and consolidates at count 127.
- refinementBoundsHold: probability-map points stay within 16 bits.

The products are proved through `scale`, the product by its recursion
(scaleIsMultiply bridges it to `*`), with each bound carried in one
induction, since omega has no nonlinear arithmetic.

The native coder reads the model's constants from ncm::standard (byte
identical output); tests/neuromorphic.rs holds them equal to the model's and
the theorem inventory complete. Registered as UC-NEU-01 (kernel_theorem).

The Pages site becomes a Prism browser closure v2 (PrismPM SPEC 1.2.1):
index.html, app.css, app.js, uorc.js, uorc_bg.wasm, provenance.json and the
ten Hologram brand files (fonts, licences, icons, manifest.webmanifest),
flat and same-origin, installable, with no remote load. The brand files are
vendored byte-identical to PrismPM's (vendor/hologram-brand).
scripts/site.mjs assembles and checks the closure (provenance.json names
every file's SHA-256); release.yml uses it and `just test` runs its tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3MmVJi8mhN3UZ6rgwH

* Pages client: Prism product model of the page, generated from it, with browser acceptance

src/Uorc/Page.lex.tex states the page in Prism's product-modeling vocabulary
(Foundation.Arch stakeholders, features, journeys and UML state machine;
Foundation.Qual requirements and measures; the text/3 workbench's operations,
fields, examples, error hints, sections, usage, links and labels), registered
as UC-WEB-01. repo-model checks it as PrismPM checks its own (PP2014-PP2017,
one initial state, closed triggers, reachability, closed sets) and renders
web/index.html from it; app.js interprets the embedded model.

The codec runs in a module worker (uorc.js), with progress, Cancel, typed
error hints and recovery from a stopped worker. In-memory decoding no longer
spawns threads, which trapped WebAssembly on Verify, every example and every
folder archive. The wasm client builds with SIMD128 (1.34x, same bytes).

scripts/page-acceptance.mjs drives the built site in headless Chrome over the
DevTools protocol: every journey, all 17 acceptance cases, all 11 transitions,
controls checked against the model in every state, gated quality measures.
CI runs it in pages-client.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Pages client acceptance is a factory obligation keyed on its own inputs

The page acceptance runs as obligation `pages` (factory/graph.json): its
identity covers the client set, the wasm crate, web/, the brand files and the
two site scripts, so other changes find its receipt and skip it. The release
gate needs it, and factory.yml records its receipts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* pages-client: read the single-obligation route outputs

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Pages client: folders stream through the frame operations

compressTreeBlob and decompressTreeBlob run a file tree a frame at a time
(FrameEncoder::objects over the tree layout; decoded frames split at their
object lengths), so a folder of any size never sits whole in wasm memory.
The wasm test checks the streamed tree equals the library's compress_tree
bytes and restores the same entries. The model's features name the new
calls, and the acceptance checks that every uorc.* call a feature names
exists in the shipped uorc.js.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Page acceptance: all-zero frames are reference frames again (#134)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* factory: the formal set holds web/index.html, a projection of the page model

#131's legs run on a checkout materialized to their inputs, and the formal
set excluded web/, so reproducibility found the check-model projection
web/index.html missing (URP004). The page is rendered from
src/Uorc/Page.lex.tex, so it belongs with the formal inputs; the rest of
web/ stays out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Page acceptance: the page restores the released v0.2.0 and v0.3.0 archives

New acceptance case decompress-released (feature decompressArchive): every
archive in crates/uorc/tests/compat is restored in the browser to its
original bytes. Measured against ncm v4 (#133): 18 cases pass; compress
178 KB/s, decompress 467 KB/s, worker memory 215 MiB.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: report /tmp use before PrismPM's native regeneration

The rest legs fail with ENOSPC while PrismPM's template check builds the
regeneration copy in the SDK container's 2 GiB /tmp; locally the copy and
its build peak at 0.72 GB both at the last green revision and now. Print
what holds /tmp at that point so the cause is measured, not guessed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: run PrismPM's template check before the xtask audit

Measured in the rest leg: when PrismPM's native regeneration starts,
/tmp (2 GiB tmpfs in the SDK container) already holds 1.2 GB, all of it
/tmp/prismpm-cargo-1001, the debug xtask build audit-bootstrap leaves
there. The regeneration copies the tree (0.13 GB) and builds it from
scratch (0.72 GB at peak, measured in a 2 GiB tmpfs), so the lexlean
rlib write hits ENOSPC. Running the template check first gives it an
empty /tmp; both checks still run and must pass. Drops the /tmp report.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: report /tmp, tree sizes and cargo environment before the template check

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: build PrismPM's native regeneration in the workspace target

Measured in the rest leg: the SDK container's /tmp is a 2 GiB tmpfs and
CARGO_HOME (/tmp/prismpm-cargo-1001) already holds 1.1 GiB of it when the
template check starts. Native regeneration copies the tree there (0.13 GB)
and built it from scratch beside the copy (0.69 GiB at peak), which ran
out of space writing the lexlean rlib. With CARGO_TARGET_DIR at the
workspace's target on disk the build reuses audit-bootstrap's compiled
dependencies, rebuilds the workspace crates from the staged sources, and
/tmp holds only the copy (measured in a 2 GiB tmpfs: 0.13 GB, 4 s instead
of 43 s). Restores the original order and drops the diagnostics.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* model-write: build into the target the template check names, not beside the staged copy

PrismPM runs model-write in a copy of the tree staged in the SDK's /tmp
(a 2 GiB tmpfs of which CARGO_HOME holds 1.1 GiB) with a cleared
environment that keeps only PATH, the toolchain homes, HOME and
XDG_CACHE_HOME, so CARGO_TARGET_DIR (8032234) never reached it. The
template check now leaves .tmp/model-write-target, which is copied with
the tree, and model-write builds into that directory (the workspace's
target on disk) when the note is there and into target otherwise.
Simulated with the same cleared environment in a 2 GiB tmpfs: /tmp holds
only the 0.13 GB copy.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* template-check: the staged regeneration builds in a target directory of its own

On e6399ae the template check passed, but the next recipe (validate) ran
the xtask binary the staged copy had built into the workspace's target:
cargo took it as current, and it read sources at the copy's deleted
/tmp path. The note now names target/regeneration, still on the
workspace's disk and shared with nothing else.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* uorc: code a planned frame one strategy at a time, with a progress tick

The portfolio's strategy coding is lifted out of compress_pieces as
compress_strategy and choose (same bounds, same tie rule, same raw
fallback), and FrameEncoder gains plan/plan_end, which cut frames and
finish repeats without coding the rest (Planned::code codes one). The
wasm crate exports plan_frame, plan_end, code_frame (one strategy or the
whole frame) and choose_frame, so the page can code frames and strategies
on several workers and write the library's bytes; a test checks that
stream equals uorc::compress. ncm calls a thread-local progress hook once
per 64 KiB of each coding or decoding pass; the wasm crate forwards it to
the page's uorc.progress import. All 64 uorc tests pass unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Pages: a worker pool on the visitor's cores, progress within a frame

The page's worker plans each frame with the library and a pool of workers
(one per core, at most 16, two per GiB of device memory, one shared module)
codes the frame's two portfolio strategies side by side; the library's rule
keeps one, so archives equal uorc::compress. ncm reports progress every
64 KiB, so the bar moves within an 8 MiB frame.

The page model adds requirements useTheCores and progressWithinFrame and
gated measures coresUnused (0) and progressGap (at most 2 s), and states the
throughput before and after on the same 10 MiB (4 vCPU, headless Chromium):
compress 168 -> 369 KB/s, decompress 563 -> 561 KB/s (every frame of that
input is a window frame, so decoding stays sequential, as natively).
Acceptance: 18 cases pass, 10 measures within their gates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* ncm: decode a window frame without copying the window, and keep only the output

The archive layer joined the window's frames into one buffer and the
model copied that buffer again into its history. The model now takes the
history as pieces and copies the frames once, and the decoded output gives
back the history's share of its buffer (the next frame's window holds the
output). Same bytes: the uorc tests pass.

Measured in Node (WebAssembly, SIMD128), streams of distinct 8 MiB frames:
decode memory 241/257/257 MiB before for 3/6/12 frames, 237/237 MiB after
for 3/6 frames.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

* Pages: bound decode memory across frames, and keep the progress bar moving

ncm: in WebAssembly, whose memory never shrinks, a model's tables (about
100 MiB for an 8 MiB frame) are kept for the next model of the same size
instead of being allocated again; that had left the allocator's free space
in pieces and memory grew with the frame count. Measured in Node on
distinct 8 MiB frames: decode 226 / 250 / 250 MiB for 3 / 6 / 12 frames
(241 / 257 / 257 before). Same bytes.

Progress (gate progressGap, 2 s): the acceptance found two stalls over 2 s.
The page's worker now codes alone until two pool workers have loaded, so
the first file does not wait on their start; a short last frame, coded
when the stream ends, now reports its passes; ncm reports every 16 KiB;
and a frame's share keeps moving through passes beyond the usual three.
Longest stall now 552 ms; 18 cases pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3N6Mcveqrwnu6XBiYk

---------

Co-authored-by: Claude <noreply@anthropic.com>
afflom pushed a commit that referenced this pull request Nov 11, 2026
#131 was squash-merged; this takes main's tree as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LdDSxZc5dyuEbM7w7
afflom added a commit that referenced this pull request Nov 11, 2026
* factory: key each formal leg on its own closure and run it in a closure copy

PrismPM #586 keys each obligation on its own declared inputs and runs it in
a copy of its closure. The formal legs now do both:

- artifacts reads the LexLean project (src/ and its project files) only;
  varint the import closure of Uorc.Varint and Uorc.VarintContract; integrity
  the import closure of every Uorc.Integrity module and the two Wire modules
  it binds (99 of 340 modules), validation/integrity/ and standards/. A
  registry or claims edit no longer re-runs integrity or varint; a model,
  features or CONFORMANCE change no longer re-runs artifacts.
- closure:ROOTS@DIRS inputs take several roots and Dir.* roots; manifest:PATH
  inputs declare a Cargo manifest without its crate, so legs that build xtask
  resolve the workspace without reading the product crates' code.
- factory.mjs materialize deletes every tracked file a leg does not declare
  (stubbing the manifest-only crates' targets) before the leg runs, so an
  undeclared input fails the leg. It found one: just model-write reads
  README.md, which the formal scope left out; it is declared now.
- The formal scope now declares Cargo.toml and Cargo.lock, which every formal
  leg reads through cargo.

Checked locally in closure copies (LexLean 0.4.0, Lean 4.32.1): varint passes;
integrity passes in full (all node tests and the canonical runtime);
artifacts' closure checks 340 modules with the same source identity CI
reports; claims' xtask tests compile and model-write regenerates the same
projections.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LdDSxZc5dyuEbM7w7

* Merge main (v0.4.0, fc151ec and later) into the release-velocity branch

#131 was squash-merged; this takes main's tree as is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LdDSxZc5dyuEbM7w7

* release: deploy Pages when publish passed, even with proved build stages skipped

v0.4.0's tag run proved native, wasm and bench from receipts and skipped
them; GitHub then skipped 'deploy pages' too, because a job whose
ancestor was skipped is skipped unless its condition calls a status
function. Gate it on always() and publish's own result.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013Asa3LdDSxZc5dyuEbM7w7

---------

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants