Skip to content

artifact: one UOR address scheme for every content identity (UOR-native, piece 2) - #506

Draft
humuhumu33 wants to merge 6 commits into
release/v0.4from
uor/address-scheme
Draft

humuhumu33 wants to merge 6 commits into
release/v0.4from
uor/address-scheme

Conversation

@humuhumu33

@humuhumu33 humuhumu33 commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

One address scheme for every content identity LexLean records: a UOR address is sha256: plus the SHA-256 of an artifact's canonical bytes. Every recorded identity already is that digest, so no recorded byte moves.

Where the scheme comes from

The UOR Foundation has no single address definition for raw bytes. All its sources write an address as <alg>:<64 lowercase hex> over canonical bytes. They differ on the hash and on whether the kind is tagged inside the hash:

  • uor-addr CONFORMANCE.md:46-48, the closest thing to a normative contract, JSON only: sha256: + hex(SHA-256(JCS+NFC(json))), a 71-byte label, no kind inside the hash.
  • uor-jcs-nfc SPEC.md v1.1 (draft): the same sha256: label.
  • PrismPM ADR-015 (accepted, raw blobs): blake3: + hex(BLAKE3(bytes)).
  • UOR-Framework u:digest: blake3 is primary, sha256 secondary.
  • UOR-GNAF draft.2 (vendored in LexLean): §14.1 assigns no address profile, and §14.3 requires a typed domain per object kind.

This PR takes sha256:. Each kind's canonical bytes are the message LexLean already hashes:

  • Framed kinds (source, semantic, build, attestation, PDF recipe, tree, compiler semantics) start with their domain and a NUL, so kinds are separated inside the hash, as GNAF §14.3 asks.
  • File kinds are the file's bytes.

The result: every identity ever recorded is already its UOR address without the prefix, and the label is uor-addr's form. A unit test shows that LexLean's canonical JSON of {"foo":"bar"} has uor-addr's published address, sha256:7a38bf81…. Choosing BLAKE3 instead would re-address every lock, manifest, package, record and attestation. That choice is the maintainer's.

What changed

  • artifact::content_id writes each recipe once, over a sink: a SHA-256 state for the identity, or a buffer for the canonical bytes (*_frames, Framed<S>). FramedHasher keeps its API. The identity and the canonical bytes cannot differ.
  • artifact::address provides:
    • Address: sha256: display, and a strict parse that refuses another algorithm, upper-case hex, or a wrong length.
    • Kind, with each kind's domain.
    • One function per artifact kind returning its canonical bytes: file, tree, compiler_semantics, project_config, source, semantic, build, attestation, pdf_recipe, rust_program.
    • identities, the canonical bytes of all of a checked project's identities.
  • The hidden api::content_identities(&Engine, &CheckRequest) exposes them for a project. It is a free function, because §24.1 (CL-13) fixes the Engine's public methods at seven.
  • lexlean::compiler_semantics_files(language) returns the rows of the embedded tree; the compiler-semantics ID is now computed from the same rows.
  • SPEC.md §21.10 defines UOR addresses and tabulates every kind's canonical bytes and where it is recorded.

AR-15

AR-15 recomputes every recorded identity with its own SHA-256, independent of the compiler's digest, and requires equality:

  • for each of the 26 committed projects with a build manifest: the manifest's source_id, semantic_id, build_id and compiler.semantics_id, the lock's compiler_semantics and every workspace_file, and every build output committed beside the manifest, with its length;
  • for each of the 164 committed Rust packages: every file, the program, and the compiler_semantics the package was exported under.

Result: 2,100 identities across 26 projects and 164 packages, all equal.

The plant is a copy of nat-add-zero whose theorem label changed while it kept the committed manifest. AR-15 names its source_id and build_id as stale.

Limits:

  • The four tooling fixtures (tests/tooling/*) render as embedded projects, so for them AR-15 holds the build ID to the build recipe over their recorded source and semantic IDs, plus their compiler-semantics ID and outputs. The tooling cases already reproduce their source and semantic IDs.
  • Declaration IDs (expected/build/declarations) are not in AR-15 yet; their recipe is in declaration_id.rs.
  • AR-15 takes about 9 minutes locally, almost all of it checking the bootstrap and Atlas projects.

What does not change

No recorded identity, lock, manifest, package, record or attestation moves, and the compiler-semantics ID is unchanged.

Gates run locally

All run in WSL on release/v0.4 26e5e0a:

  • cargo fmt --check
  • workspace clippy -D warnings
  • lexlean lib tests address and content_id
  • validate-model (494 IDs) and validate-spec-links
  • the 17 RP cases
  • --test bdd
  • both Python suites
  • conformance_ar_15: 361 s, 2,100 identities, plant refused

The register grows from 493 to 494 IDs: README, the SPEC total, spec_links.rs and RP-07's row count all move with it.

No full-gate dispatch has run yet.

🤖 Generated with Claude Code

A UOR address is `sha256:` and the SHA-256 of an artifact's canonical
bytes (SPEC.md §21.10), the label form of the UOR Foundation's uor-addr.
Every identity LexLean records is already that digest, so no recorded
byte moves.

content_id writes each recipe once over a sink, a SHA-256 state or a
buffer (Framed<S>, *_frames), so an identity and its canonical bytes
cannot differ. artifact::address has one function per artifact kind
returning its canonical bytes, Address with the sha256: label and a
strict parse, and identities() for a checked project, which
Engine::identities exposes. A unit test holds LexLean's canonical JSON of
{"foo":"bar"} to uor-addr's published address.

AR-15 recomputes with its own SHA-256 every identity the 26 committed
build manifests, their locks and outputs, and the 164 committed Rust
packages record (2,100 in all) and requires each to equal the recorded
one; a copy whose source changed under the committed manifest has its
source and build IDs named.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@afflom afflom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bounded review at82241baa. Keeping the existing SHA-256 identities and adding an explicit address label is the appropriate compatibility direction here; no BLAKE3 migration or producer regeneration is requested. The inspected shared-sink refactor preserves the existing frame recipes and avoids separate implementations of digest and canonical bytes. Two claims need correction before acceptance:

P2 — Make tooling evidence ownership explicit. artifacts.rs:816–835 handles tests/tooling by recomputing build_id from the recorded source_id and semantic_id, checking compiler semantics/outputs, then returning. It does not independently establish those two recorded IDs. The body candidly says the existing tooling cases reproduce them, while AR-15/§21.10 promise every recorded identity without that qualification. Connect those existing exact-source obligations explicitly to the claimed evidence and scope AR-15 accurately. Reuse their evidence; do not add duplicate tooling builds or a second universal gate merely to repair the wording.

P2 — Correct the cross-kind domain guarantee. §21.10 says two framed kinds never share an address, but Tree and CompilerSemantics deliberately share lexlean-tree-v1; raw file bytes can also equal a framed message. Kind is external to the address. Describe byte-content identity and the typing supplied by recorded fields accurately, and distinguish that from GNAF's per-kind domain requirement. A forced identity migration is not necessary to make this proposal honest.

Owner-reported2,100 comparisons are scoped local evidence, not independently reproduced here. Default proof/kernel/axiom-policy checks remain; source review does not establish final acceptance. Existing owner retains the corrections and qualification, and #468/#316 do not gain a new prerequisite or replacement executable.

The canonical bytes of a project's identities are a hidden free function,
api::content_identities, and not an Engine method: §24.1 fixes the
Engine's public entry points at seven.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@humuhumu33

Copy link
Copy Markdown
Contributor Author

Full gate: dispatch run 43472800451 on be991d5 (merged with release/v0.4 b8b6e86, after RB-24) is running.

AR-15 passed locally on this tree: 2,100 identities across 26 projects and 164 packages. Register is 495 IDs (RB-24 added one).

@afflom afflom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CL13 API-shape correction is credited at be991d5: the identity helper is now a hidden free function rather than an eighth Engine entry point, with the existing AR15 call site updated. The focused delta does not resolve the two findings in review5884058513: tooling source/semantic IDs still rely on separate evidence while the normative claim is unqualified, and the cross-kind guarantee still exceeds the shared Tree/CompilerSemantics domain and raw-byte addressing behavior. Align the claims and explicitly name existing evidence owners; no digest migration, duplicate tooling build or new universal gate is requested.

For this PR and companion #498, the newly started manual runs remain scoped to their exact b8b6-based heads. Both drafts currently conflict with actual release fd7cedd (#499 and #474), so those runs cannot qualify the future reconciled tree. #498's previously reviewed inventory/selected-RUSTC/import-order findings also remain unchanged. Please disposition the small source/claim findings, compose actual release history while retaining applicable products, and update the bodies before resulting-head readiness and acceptance. Preserve the running gates and their results; this review requests no cancellation, rerun, competing patch or blanket identity wave. Independent sequencing receipt pr498-506-current-sequencing records the delta and limits.

@afflom afflom left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current-head delta review: 1ae9d4a integrates actual release 6a02d2c with ordered parents be991d5 + 6a02d2c. The previous release-integration blocker is resolved. The hidden free-function CL13 correction and unchanged identity recipes retain credit; this integration adds no language/schema/product change requiring another identity producer.

The two findings from review5884058513 remain: artifacts.rs:812–835 computes tooling build identity over recorded source/semantic IDs, while §21.10/AR-15 remain unqualified; address.rs still shares the Tree/CompilerSemantics domain, so the claimed cross-kind separation exceeds the byte-address behavior. The smallest owner correction is to name and bind the existing tooling evidence obligations and accurately describe byte identity plus external field typing. Reuse that evidence; no digest migration, duplicate tooling build or replacement universal gate is requested.

Update the body’s old base/count/no-dispatch narrative, then qualify the corrected final head. Current CI43525943926/repro43525943909 are pending, and earlier canceled/manual results do not establish this tree’s full acceptance. Independent bounded receipt: pr506-1ae9-owner-delta/receipt.json. Existing owner retains implementation and landing; no competing patch or CI-control action.

This branch has not been deployed

No deployments
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