From e91b83ccfcdea3f64b6c8b03493ff11b3e293686 Mon Sep 17 00:00:00 2001 From: forhappy Date: Sat, 12 Sep 2026 00:19:21 -0700 Subject: [PATCH] fix(history): raise authoritative graph limit --- CHANGELOG.md | 5 +++++ COMPATIBILITY.md | 8 ++++++++ crates/compass-history/src/validate.rs | 8 +++++++- docs/guides/versioned-history.md | 6 ++++++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8a56d02a..d09baef81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ ## Unreleased +- Raise the immutable-history aggregate authoritative-evidence limit from + 512 MiB to 5 GiB so large repositories can publish, validate, and compare + complete realizations while retaining the existing per-record and record-count + bounds. + - Make `compass review` text and Markdown easier to scan by shortening commit and report references, using plain-language status labels, and summarizing witness relationships without printing opaque graph-node IDs. Canonical JSON diff --git a/COMPATIBILITY.md b/COMPATIBILITY.md index fbe4a2e46..3265c7cfc 100644 --- a/COMPATIBILITY.md +++ b/COMPATIBILITY.md @@ -94,6 +94,14 @@ history profiles, and cache identities. ## Evolving contracts +Immutable history now accepts up to 5 GiB of aggregate authoritative key and +value bytes per realization, raised from 512 MiB. The history schema and +canonical encoding are unchanged, as are the per-key, per-value, per-tree, +JSON-depth, job, and diagnostic bounds. Readers from older Compass releases +continue to reject a realization whose authoritative content exceeds 512 MiB; +deploy a reader containing this limit widening before sharing larger +realizations. + The closed route-stage vocabulary used by `compass.graph/1`, `compass.query/1`, and `compass.framework-context/1` now includes the additive `dependency` and `security` values. The query contract manifest and fingerprint diff --git a/crates/compass-history/src/validate.rs b/crates/compass-history/src/validate.rs index 890efa636..0b6e609a2 100644 --- a/crates/compass-history/src/validate.rs +++ b/crates/compass-history/src/validate.rs @@ -12,7 +12,7 @@ use crate::{ type Records = Vec<(Vec, Vec)>; -pub const MAX_AUTHORITATIVE_BYTES: u64 = 512 * 1024 * 1024; +pub const MAX_AUTHORITATIVE_BYTES: u64 = 5 * 1024 * 1024 * 1024; pub const MAX_KEY_BYTES: usize = 1024 * 1024; pub const MAX_RECORD_VALUE_BYTES: usize = 64 * 1024 * 1024; pub const MAX_RECORDS_PER_TREE: u64 = 10_000_000; @@ -594,6 +594,12 @@ mod tests { } } + #[test] + fn authoritative_history_limit_is_five_gibibytes() { + assert_eq!(MAX_AUTHORITATIVE_BYTES, 5_368_709_120); + assert!(!exceeds_limit(616_211_608, MAX_AUTHORITATIVE_BYTES)); + } + #[test] fn repeated_resource_limit_failures_collapse_to_the_largest_observation() { let mut problems = Vec::new(); diff --git a/docs/guides/versioned-history.md b/docs/guides/versioned-history.md index 89768457d..a1541c46b 100644 --- a/docs/guides/versioned-history.md +++ b/docs/guides/versioned-history.md @@ -403,6 +403,12 @@ Export equivalence is semantic and canonical. JSON object or record ordering that does not affect meaning is not a contract; graph structure, attributes, multiplicity, duplicate id-less hyperedges, and authoritative bytes are. +Each immutable realization accepts at most 5 GiB of aggregate authoritative +key and value bytes. Per-record and record-count limits remain independently +enforced, and crossing any limit fails publication rather than exposing a +partial realization. Compass releases with the former 512 MiB ceiling cannot +read a realization above that older bound. + ## 8. Choose a preferred realization When a commit has multiple valid realizations: