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

@@ -89,7 +89,7 @@ fingerprint) is later. No merge, no release, no deploy.
Decided: convention confirmed; compiled registry the only authority, bound to sheet + content; five consumers
(adds `pdf/compare/lines.rs`); Rust the only generator, `pnpm import:equine` → Rust, TypeScript kept as
`import:equine:legacy` until R5.7; no visible change, no migration message. Prepared (RUST.md §11.19):
module + tests committed inert; the switch as `.claude/tasks/plans/r5-6-switch.patch`, rehearsed green.
module + tests committed inert; the switch as `.claude/tasks/plans/r5-6-switch.patch` (applies cleanly; on the current seed 4 `curation` tests fail as expected, with the seed switched 3 more: RUST.md §11.19; the earlier "rehearsed green" covered the five consumers only).
Still to decide at the switch signal:
1. `loaded.rs` + `facade.rs` (sheet load refuses a contradicting block): outside the five approved files,
@@ -97,7 +97,10 @@ Still to decide at the switch signal:
2. The two `curation_draft` cases move to a declared rule for `sheet-ref.json` and `report-migration-map.json`
(fingerprint field and block only), the R5.1 oracles untouched.
Switch procedure (on the signal): apply the patch; move the fingerprint after the drawings bound; declared
3. M1 (security): the export's snapshot reference on an alias match: the report's own stamp (recommended), re-stamp at rebase, or accept with an N-1 test.
4. M2 remainder: refuse a `sheet-ref.json` without a fingerprint block after the switch (every test sheet then needs one).
Switch procedure (on the signal): apply the patch; move the fingerprint after the drawings bound and keep the drawings-bound fixture valid; declared rules for the O7 oracle and the switched-seed preconditions; declared
rule in `curation_draft`; `pnpm import:equine` → `scripts/import-equine.sh`, TS as `import:equine:legacy`;
`import-equine --out` into an empty folder, diff reviewed (only the two files of §11.19), copied over `draft/`;
`--check` 0 differences; `pnpm rust:check`, `pnpm check:all`, security, fresh verifier; owner device check
+28 -6
View File
@@ -9,6 +9,27 @@ index a9140e4..aaeef54 100644
+# Written by the Rust pipeline (`pnpm r5:import-equine`, R5.6): byte-exact, never reformatted.
+supabase/seed/anatomical-sheets/equine/legacy-import/
+supabase/seed/anatomical-sheets/equine/draft/
diff --git a/crates/core/src/bin/report_compare.rs b/crates/core/src/bin/report_compare.rs
index 59cf060..91b34ef 100644
--- a/crates/core/src/bin/report_compare.rs
+++ b/crates/core/src/bin/report_compare.rs
@@ -37,6 +37,8 @@ struct SeedRef {
document_sha256: String,
schema_version: f64,
species_id: String,
+ #[serde(default)]
+ fingerprint: Option<faunosteo_core::domain::sheet::loaded::DeclaredFingerprint>,
}
fn seed_json<T: for<'de> Deserialize<'de>>(name: &str) -> Result<T, String> {
@@ -58,6 +60,7 @@ fn load_sheet() -> Result<LoadedSheet, String> {
document_sha256: reference.document_sha256,
schema_version,
species_id: reference.species_id,
+ fingerprint: reference.fingerprint,
},
document: seed_json("document.json")?,
migration_map: seed_json("report-migration-map.json")?,
diff --git a/crates/core/src/curation/draft/pipeline.rs b/crates/core/src/curation/draft/pipeline.rs
index 19126aa..12bcaf5 100644
--- a/crates/core/src/curation/draft/pipeline.rs
@@ -129,7 +150,7 @@ index 9281642..b5012be 100644
report: report.clone(),
unresolved_zones: 0,
diff --git a/crates/core/src/domain/sheet/loaded.rs b/crates/core/src/domain/sheet/loaded.rs
index 4065978..aa88299 100644
index 4065978..e6fd44d 100644
--- a/crates/core/src/domain/sheet/loaded.rs
+++ b/crates/core/src/domain/sheet/loaded.rs
@@ -2,6 +2,7 @@
@@ -140,7 +161,7 @@ index 4065978..aa88299 100644
use std::collections::HashMap;
use serde::Deserialize;
@@ -33,6 +34,15 @@ pub struct BundledRef {
@@ -33,6 +34,16 @@ pub struct BundledRef {
pub document_sha256: String,
pub schema_version: JsInt,
pub species_id: String,
@@ -150,13 +171,14 @@ index 4065978..aa88299 100644
+}
+
+#[derive(Debug, Clone, Deserialize)]
+#[serde(deny_unknown_fields)]
+pub struct DeclaredFingerprint {
+ pub convention: String,
+ pub aliases: Vec<String>,
}
/// A loaded, indexed sheet.
@@ -76,6 +86,8 @@ pub enum LoadError {
@@ -76,6 +87,8 @@ pub enum LoadError {
Shape(serde_json::Error),
/// The document has no main view.
NoMainView,
@@ -165,7 +187,7 @@ index 4065978..aa88299 100644
}
impl From<serde_json::Error> for LoadError {
@@ -102,6 +114,15 @@ impl LoadedSheet {
@@ -102,6 +115,15 @@ impl LoadedSheet {
.map(|(id, text)| (id.clone(), read_drawing(text)))
.collect();
let r = data.reference;
@@ -261,11 +283,11 @@ index 120249a..6a4bfe5 100644
if report.observations.len() > MAX_OBSERVATIONS {
diff --git a/crates/core/tests/fingerprint_consumers.rs b/crates/core/tests/fingerprint_consumers.rs
new file mode 100644
index 0000000..bda5a2e
index 0000000..39a5775
--- /dev/null
+++ b/crates/core/tests/fingerprint_consumers.rs
@@ -0,0 +1,69 @@
+//! R5.6 switch rehearsal (part of `.claude/tasks/plans/r5-6-consumers.patch`, not committed
+//! R5.6 switch rehearsal (part of `.claude/tasks/plans/r5-6-switch.patch`, not committed
+//! active): with the loaded sheet stamped with the canonical `v1` value, a report or an archive
+//! stamped with the registered historical value is the same document (no rebase, archive kept);
+//! a real content change, a forged value or another sheet still differ.