Skip to content

feat(uuid-v8): shared Rust generator for ADR-008 profiles T and C (P1) - #1245

Merged
hyperpolymath merged 1 commit into
mainfrom
claude/new-session-th4e9w
Oct 14, 2026
Merged

hyperpolymath merged 1 commit into
mainfrom
claude/new-session-th4e9w

Conversation

@hyperpolymath

Copy link
Copy Markdown
Owner

Summary

Adds tools/uuid-v8 (crate estate-uuid-v8, MPL-2.0). It is the Rust member of ADR-008 phase P1, "shared profile T and C generators per estate language", and produces the same ids as scripts/uuid-v8.js. It unblocks the per-repo UUID v8 migration (P3) for the estate's Rust repositories, starting with echidna, echidnabot and proof-burrower, whose ids.rs modules still mint v7 ids and bare-JCS v8 content ids.

What it provides

  • profile_t(): a library v7 with the version nibble set to 8, the only bit operation ADR-008 permits. It is strictly increasing within a process.
  • profile_c(domain, name) / profile_c_bytes(domain, bytes): bytes 0..15 of SHA-256(domain ":" name), with version 8 and variant 10. The domain rule is the same as in uuid-v8.js: non-empty printable ASCII without :.
  • from_deed_body("domain:name"): profile C from a deed #u8 body, split on the first :.
  • from_v7(id): the P2 alias, flipping only the version nibble.
  • A uuid-v8 binary with the same interface and exit codes as uuid-v8.js.

Consumers pin it as a git dependency: estate-uuid-v8 = { git = "https://github.com/hyperpolymath/standards", rev = "<commit>" }.

Tests

cargo test:

  • profile C is checked against vectors from the independent sha256sum oracle in scripts/tests/bun/uuid-v8-gen-test.sh, not from this code;
  • profile T is checked for layout, timestamp, and order over 10,000 ids;
  • from_v7, and the domain rules with planted negatives.

scripts/tests/rust/uuid-v8-rs-test.sh runs the binary three ways:

  • against the same oracle;
  • against uuid-v8.js, when bun is present;
  • through check-uuid-v8.sh --strict.

Locally:

cargo test                                  → 6 passed
cargo clippy --all-targets -- -D warnings   → clean
bash scripts/tests/rust/uuid-v8-rs-test.sh  → PASS=20 FAIL=0 (rust = oracle = bun on all 5 vectors)
mutant: variant mask 0x3f → 0x7f            → profile_c_matches_the_independent_oracle and deed_body tests FAIL

Both commands run in deed-conformance.yml beside the bun generator test, with new path triggers for tools/uuid-v8/** and scripts/tests/rust/**. No new actions are used, so actions.lock is unchanged.

Not in this PR

  • The Zig, Elixir and Julia generators that P1 also names.
  • Any change to ADR-008's text.
  • One note for the record: ADR-008's campaign plan cites "AGENTS.md §5e" for batch caps, but AGENTS.adoc here has no §5e.

🤖 Generated with Claude Code

https://claude.ai/code/session_019a95kk88TZ1iegsBK3kox3


Generated by Claude Code

tools/uuid-v8 (crate estate-uuid-v8, MPL-2.0): the Rust member of the
"shared profile T and C generators per estate language" in ADR-008 P1,
producing the same ids as scripts/uuid-v8.js.

- profile_t(): library v7 with the version nibble set to 8 (the only bit
  operation ADR-008 permits); strictly increasing within a process.
- profile_c(domain, name) / profile_c_bytes(): bytes 0..15 of
  SHA-256(domain ":" name), version 8, variant 10; domain is non-empty
  printable ASCII without ':' (same rule as uuid-v8.js).
- from_deed_body("domain:name"): splits on the first ':'.
- from_v7(id): the P2 alias, flipping only the version nibble.
- uuid-v8 binary with uuid-v8.js's interface and exit codes.

Tests: cargo test checks profile C against vectors from the independent
sha256sum oracle of scripts/tests/bun/uuid-v8-gen-test.sh (a variant-mask
mutant fails two of them), plus T layout/order/timestamp, from_v7 and the
domain rules. scripts/tests/rust/uuid-v8-rs-test.sh runs the binary
against the same oracle, against uuid-v8.js (bun) and through
check-uuid-v8.sh --strict: 20/20 locally. Both run in
deed-conformance.yml; no new actions, so actions.lock is unchanged.

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

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 006501dc-6484-4cbb-9385-84b1b2af7272
📥 Commits

Reviewing files that changed from the base of the PR and between b26d3fb and 080f085.

⛔ Files ignored due to path filters: 1
  • tools/uuid-v8/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing: 6
  • .github/workflows/deed-conformance.yml
  • scripts/tests/rust/uuid-v8-rs-test.sh
  • tools/uuid-v8/Cargo.toml
  • tools/uuid-v8/README.adoc
  • tools/uuid-v8/src/lib.rs
  • tools/uuid-v8/src/main.rs
 _______________________________________________________
< Once upon a dream, I found all the bugs in your code. >
 -------------------------------------------------------
  \
   \   \
        \ /\
        ( )
      .( o ).
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • 🔴 Error committing to branch - (🔄 Check to retry)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

K9 contract conformance

run https://github.com/hyperpolymath/standards/actions/runs/38538027495

K9 normative contract typecheck

k9_contract.ncl typechecks

K9 contract self-test

== the bash mirrors cannot drift from the normative contract ==
ok   leash_levels mirrors k9_contract.ncl
ok   core_capabilities mirrors k9_contract.ncl
ok   contract_version mirrors k9_contract.ncl
ok   schema_major mirrors k9_contract.ncl
== capability arithmetic (§8) ==
ok   capability_ok fs.read accepted
ok   capability_ok rollback.apply accepted
ok   capability_ok x-acme.gpu.alloc accepted
ok   capability_ok x-acme rejected
ok   capability_ok x-.gpu rejected
ok   capability_ok fs.delete rejected
ok   capability_ok  rejected
== the extractor ==
ok   extracts pedigree.security.leash
ok   extracts pedigree.component_type
ok   extracts pedigree.metadata.name
ok   pedigree leash is not reported as top-level leash
ok   required_capabilities for a quiet component
ok   required_capabilities follows allow_network
== the envelope strip keeps line numbers (§3.6) ==
ok   line 1 becomes a comment
ok   line count is preserved
ok   schema_version stays on line 5
== L3: signature presence is not verification (§10) ==
ok   no verifier -> K9-C001 is SKIPPED, never a pass
ok   the skip states presence does not authorise 'Hunt
ok   verifier accepts -> verdict 'Verified, no K9-C001 finding
ok   verifier refuses -> K9-C001 error, verdict 'Rejected
== the fixture runner's attribution cannot be fooled by a filename ==
ok   every extracted finding is well-formed rule+layer
ok   the rule that really fired is attributed
ok   a rule named only in the filename is NOT attributed
ok   K9-C001 is present as a skipped finding
ok   and that same finding is NOT extractable as a rejection
== the dialect discriminator agrees with the coordination grammar (§4.3) ==
ok   magic file opening '---' is coordination
ok   magic file opening 'metadata:' is coordination
ok   plain file opening '---' is unclaimed
ok   plain file opening 'metadata:' is unclaimed
== no Nickel reserved word is used as an identifier ==
ok   the contract and all 27 fixtures avoid Nickel's reserved words

self-test: all assertions passed

K9 conformance fixtures

== positive controls (must pass) ==
ok   extension-capability.k9.ncl
ok   extension-fields.k9.ncl
ok   hunt-fully-granted.k9.ncl
ok   kennel-data.k9.ncl
ok   library-base.ncl
ok   yard-typed-config.k9.ncl

== negative controls (must fail, by the named rule) ==
ok   L0-K9-E001-bad-magic.k9.ncl (rejected by K9-E001 at L0)
ok   L0-K9-E002-nul-byte.k9.ncl (rejected by K9-E002 at L0)
ok   L0-K9-E003-crlf.k9.ncl (rejected by K9-E003 at L0)
ok   L0-K9-E004-no-spdx.k9.ncl (rejected by K9-E004 at L0)
ok   L0-K9-E005-unclaimed-body.k9.ncl (rejected by K9-E005 at L0)
ok   L0-K9-S012-library-with-pedigree.ncl (rejected by K9-S012 at L0)
ok   L0-K9-S014-stray-leash.ncl (rejected by K9-S014 at L0)
ok   L1-K9-S001-no-pedigree.k9.ncl (rejected by K9-S001 at L1)
ok   L1-K9-S002-wrong-major.k9.ncl (rejected by K9-S002 at L1)
ok   L1-K9-S003-todo-component-type.k9.ncl (rejected by K9-S003 at L1)
ok   L1-K9-S004-unknown-leash.k9.ncl (rejected by K9-S004 at L1)
ok   L1-K9-S005-missing-name.k9.ncl (rejected by K9-S005 at L1)
ok   L1-K9-S006-unknown-capability.k9.ncl (rejected by K9-S006 at L1)
ok   L1-K9-S007-ungranted-flag.k9.ncl (rejected by K9-S007 at L1)
ok   L1-K9-S008-hunt-signature-not-required.k9.ncl (rejected by K9-S008 at L1)
ok   L1-K9-S009-hunt-no-signature-block.k9.ncl (rejected by K9-S009 at L1)
ok   L1-K9-S010-hunt-empty-side-effects.k9.ncl (rejected by K9-S010 at L1)
ok   L1-K9-S011-recipes-at-yard.k9.ncl (rejected by K9-S011 at L1)
ok   L1-K9-S013-dangling-import.k9.ncl (rejected by K9-S013 at L1)
ok   L2-K9-N001-two-segment-version.k9.ncl (rejected by K9-N001 at L2)
ok   L2-K9-N001-wrong-field-type.k9.ncl (rejected by K9-N001 at L2)

fixtures: 6 positive, 21 negative (0 needing nickel), 0 failure(s)

K9 corpus conformance (L2)

[validate-k9] 14 conforming, 0 grandfathered (layer all, contract v1.0.0)

@sonarqubecloud

Copy link
Copy Markdown

@hyperpolymath
hyperpolymath marked this pull request as ready for review October 14, 2026 08:59
@hyperpolymath
hyperpolymath merged commit 3daaad2 into main Oct 14, 2026
68 checks passed
@hyperpolymath
hyperpolymath deleted the claude/new-session-th4e9w branch October 14, 2026 09:04
@coderabbitai

coderabbitai Bot commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

❌ Failed to create Coding Agent finishing-touch task. Please try again.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

❌ Failed to create Coding Agent finishing-touch task. Please try again.

@coderabbitai

coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Add Carrot credits or activate Agent usage billing to use Autofix

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