fix(domain): R5.6 prep gates, strict declared block, patch builds, docs corrected

v1 refuses a non-hex or historical value (NotCanonical); the switch patch now builds
report-compare and refuses unknown block keys; RUST.md 11.19 states the measured
rehearsal (4 + 3 expected failures) instead of a green claim.
This commit is contained in:
bchanot committed 2026-10-24 14:57:44 +02:00
1 parent 3b9a395d43
commit 943a25a98f
10 files changed
+280 -18

No files matched your search

+11 -2
View File
@@ -3,8 +3,8 @@
//! generated file uses this module until the owner's switch signal (RUST.md §11.19).
//!
//! The value is the SHA-256 of the RFC 8785 (JCS) text of the validated document: the strict
//! typed reading of the R2 contract (`AnatomicalSheetDocument`, Zod's defaults filled, unknown
//! keys dropped) with zero integrity issue, serialised back. JCS: members sorted recursively by
//! typed reading of the R2 contract (`AnatomicalSheetDocument`, Zod's defaults filled, the
//! strict shape refusing unknown keys) with zero integrity issue, serialised back. JCS: members sorted recursively by
//! the UTF-16 code units of their names, numbers as ECMAScript `Number::toString`, strings with
//! the `JSON.stringify` escape set and every other character kept as is (no Unicode
//! normalisation), no whitespace, UTF-8. `v1` freezes these rules and the validation.
@@ -82,6 +82,8 @@ pub enum AliasRefusal {
UnknownConvention(String),
/// A declared alias the registry does not bind to this sheet and canonical value.
Untrusted(String),
/// The value declared under `v1` is not a 64-hex value, or is itself a historical alias.
NotCanonical(String),
}
/// Checks what a `sheet-ref.json` declares (descriptive only): the convention must be `v1` and
@@ -96,6 +98,13 @@ pub fn check_declared(
if convention != FINGERPRINT_CONVENTION {
return Err(AliasRefusal::UnknownConvention(convention.to_owned()));
}
let hex = canonical.len() == 64
&& canonical
.bytes()
.all(|b| matches!(b, b'0'..=b'9' | b'a'..=b'f'));
if !hex || TRUSTED_ALIASES.iter().any(|entry| entry.alias == canonical) {
return Err(AliasRefusal::NotCanonical(canonical.to_owned()));
}
for alias in aliases {
let trusted = TRUSTED_ALIASES.iter().any(|entry| {
entry.sheet_id == sheet_id && entry.canonical == canonical && entry.alias == alias