feat(domain): R5.6 fingerprint switch to sha256-rfc8785-validated-v1
The Rust pipeline is the official seed writer (pnpm import:equine); sheet-ref.json and report-migration-map.json carry 12d78872...74e2 and the v1 block, the only two seed files changed. 27c7383c...2660 stays a registered alias, honoured only through LoadedSheet::recognises_historical_stamp (verified v1, recomputed document). M1: the snapshot of an old report keeps its stamp; export, archive reader strict. Historical oracles run in their pre-switch context; equivalence is crate-private.
This commit is contained in:
1 parent
59521dc195
commit
9e87016399
31 files changed
+2331
-154
No files matched your search
@@ -2,6 +2,7 @@
|
||||
//! current label next to the archived one, `!! UNRESOLVED` with the reason where the sheet
|
||||
//! cannot place an item. Every untrusted string goes through [`esc`].
|
||||
|
||||
use crate::domain::sheet::fingerprint::Equivalence;
|
||||
use serde::Deserialize;
|
||||
use serde_json::Value;
|
||||
|
||||
@@ -346,13 +347,33 @@ fn archive_line(outcome: &ArchiveReadOutcome) -> Vec<String> {
|
||||
|
||||
fn sheet_line(report: &Report, sheet: &LoadedSheet) -> String {
|
||||
let reference = &sheet.reference;
|
||||
let same_sheet = report.sheet.sheet_id == reference.sheet_id
|
||||
&& report.sheet.document_sha256 == reference.document_sha256;
|
||||
let same = if report.sheet.document_sha256 == reference.document_sha256 {
|
||||
Equivalence::Identical
|
||||
} else if sheet
|
||||
.recognises_historical_stamp(&report.sheet.sheet_id, &report.sheet.document_sha256)
|
||||
{
|
||||
// The registered historical value of this sheet's verified, recomputed content (R5.6).
|
||||
Equivalence::TrustedAlias
|
||||
} else {
|
||||
Equivalence::Different
|
||||
};
|
||||
let same_sheet = report.sheet.sheet_id == reference.sheet_id && same.same_document();
|
||||
if same_sheet {
|
||||
let status = match sheet.status {
|
||||
SheetStatus::Draft => "draft",
|
||||
SheetStatus::Published => "published",
|
||||
};
|
||||
if same == Equivalence::TrustedAlias {
|
||||
// Same content under the registered historical fingerprint: both raw values shown.
|
||||
let stamped: String = report.sheet.document_sha256.chars().take(12).collect();
|
||||
let current: String = reference.document_sha256.chars().take(12).collect();
|
||||
return format!(
|
||||
"sheet {} ({status}, matches the bundled sheet through the trusted alias: report sha {}…, sheet sha {}…)",
|
||||
esc(&reference.sheet_id),
|
||||
esc(&stamped),
|
||||
esc(¤t)
|
||||
);
|
||||
}
|
||||
return format!(
|
||||
"sheet {} ({status}, matches the bundled sheet)",
|
||||
esc(&reference.sheet_id)
|
||||
|
||||
Reference in new issue
Block a user