commit 6ab7fe71a96aa8741f95eaf0c8b577622f0091c7
parent 3dc0337cb58d58fbccdba67e49fd494fbcea6676
Author: triesap <tyson@radroots.org>
Date: Mon, 6 Jul 2026 07:01:29 +0000
contract: neutralize knowledge public surface vectors
- Rename the knowledge conformance vector to public_surface.v1.json and update suite, id, and kind names.
- Point xtask and codec manifest tests at the knowledge_public_surface vector.
- Add knowledge vector inventory validation for the active public conformance set.
- Rename version policy rules to release_integrity to remove active compatibility framing.
Diffstat:
6 files changed, 154 insertions(+), 113 deletions(-)
diff --git a/contracts/conformance/vectors/knowledge/public_surface.v1.json b/contracts/conformance/vectors/knowledge/public_surface.v1.json
@@ -0,0 +1,73 @@
+{
+ "suite": "knowledge_public_surface",
+ "contract_version": "0.1.0",
+ "vectors": [
+ {
+ "id": "knowledge_source_public_surface_valid_001",
+ "kind": "knowledge.public_surface.valid",
+ "input": {
+ "fixture": "knowledge_source_valid"
+ },
+ "expected": {
+ "contract_id": "radroots.knowledge.source.v1",
+ "operation": "build_validate_decode_expose"
+ }
+ },
+ {
+ "id": "knowledge_claim_public_surface_valid_002",
+ "kind": "knowledge.public_surface.valid",
+ "input": {
+ "fixture": "knowledge_claim_valid"
+ },
+ "expected": {
+ "contract_id": "radroots.knowledge.claim.v1",
+ "operation": "build_validate_decode_expose"
+ }
+ },
+ {
+ "id": "knowledge_review_public_surface_valid_003",
+ "kind": "knowledge.public_surface.valid",
+ "input": {
+ "fixture": "knowledge_review_valid"
+ },
+ "expected": {
+ "contract_id": "radroots.knowledge.review.v1",
+ "operation": "build_validate_decode_expose"
+ }
+ },
+ {
+ "id": "knowledge_field_report_public_surface_valid_004",
+ "kind": "knowledge.public_surface.valid",
+ "input": {
+ "fixture": "knowledge_field_report_valid"
+ },
+ "expected": {
+ "contract_id": "radroots.knowledge.field_report.v1",
+ "operation": "build_validate_decode_expose"
+ }
+ },
+ {
+ "id": "wiki_article_public_surface_valid_005",
+ "kind": "knowledge.public_surface.valid",
+ "input": {
+ "fixture": "wiki_article_valid"
+ },
+ "expected": {
+ "contract_id": "radroots.wiki.article.v1",
+ "operation": "build_validate_decode_expose"
+ }
+ },
+ {
+ "id": "knowledge_claim_sdk_builder_public_surface_valid_006",
+ "kind": "knowledge.sdk_builder_event.valid",
+ "input": {
+ "sdk": "radroots_sdk",
+ "builder": "RadrootsKnowledgeClaimBuilder"
+ },
+ "expected": {
+ "contract_id": "radroots.knowledge.claim.v1",
+ "operation": "build_event_validate_decode_expose"
+ }
+ }
+ ]
+}
diff --git a/contracts/conformance/vectors/knowledge/regenproto_compatibility.v1.json b/contracts/conformance/vectors/knowledge/regenproto_compatibility.v1.json
@@ -1,73 +0,0 @@
-{
- "suite": "knowledge_downstream_compatibility",
- "contract_version": "0.1.0",
- "vectors": [
- {
- "id": "knowledge_source_downstream_valid_001",
- "kind": "knowledge.downstream_compatibility.valid",
- "input": {
- "fixture": "knowledge_source_valid"
- },
- "expected": {
- "contract_id": "radroots.knowledge.source.v1",
- "operation": "build_validate_decode_expose"
- }
- },
- {
- "id": "knowledge_claim_downstream_valid_002",
- "kind": "knowledge.downstream_compatibility.valid",
- "input": {
- "fixture": "knowledge_claim_valid"
- },
- "expected": {
- "contract_id": "radroots.knowledge.claim.v1",
- "operation": "build_validate_decode_expose"
- }
- },
- {
- "id": "knowledge_review_downstream_valid_003",
- "kind": "knowledge.downstream_compatibility.valid",
- "input": {
- "fixture": "knowledge_review_valid"
- },
- "expected": {
- "contract_id": "radroots.knowledge.review.v1",
- "operation": "build_validate_decode_expose"
- }
- },
- {
- "id": "knowledge_field_report_downstream_valid_004",
- "kind": "knowledge.downstream_compatibility.valid",
- "input": {
- "fixture": "knowledge_field_report_valid"
- },
- "expected": {
- "contract_id": "radroots.knowledge.field_report.v1",
- "operation": "build_validate_decode_expose"
- }
- },
- {
- "id": "wiki_article_downstream_valid_005",
- "kind": "knowledge.downstream_compatibility.valid",
- "input": {
- "fixture": "wiki_article_valid"
- },
- "expected": {
- "contract_id": "radroots.wiki.article.v1",
- "operation": "build_validate_decode_expose"
- }
- },
- {
- "id": "knowledge_claim_sdk_builder_downstream_valid_006",
- "kind": "knowledge.sdk_builder_event.valid",
- "input": {
- "sdk": "radroots_sdk",
- "builder": "RadrootsKnowledgeClaimBuilder"
- },
- "expected": {
- "contract_id": "radroots.knowledge.claim.v1",
- "operation": "build_event_validate_decode_expose"
- }
- }
- ]
-}
diff --git a/contracts/version.toml b/contracts/version.toml
@@ -24,7 +24,7 @@ patch_on = [
"fix_packaging_metadata",
]
-[compatibility]
+[release_integrity]
requires_conformance_pass = true
requires_contract_manifest_diff = true
requires_release_notes = true
diff --git a/crates/events_codec/tests/knowledge_fixtures.rs b/crates/events_codec/tests/knowledge_fixtures.rs
@@ -471,7 +471,7 @@ fn immutable_knowledge_contracts_are_regular_events() {
}
#[test]
-fn verified_decode_exposes_representative_downstream_compatibility_events() {
+fn verified_decode_exposes_representative_public_surface_events() {
let fixture_ids = [
"wiki_article_valid",
"wiki_redirect_valid",
diff --git a/crates/events_codec/tests/knowledge_manifest.rs b/crates/events_codec/tests/knowledge_manifest.rs
@@ -23,9 +23,8 @@ const MANIFEST_JSON: &str =
include_str!("../../../contracts/knowledge/knowledge_event_contract_manifest.v2.json");
const MANIFEST_SHA256: &str =
include_str!("../../../contracts/knowledge/knowledge_event_contract_manifest.v2.sha256");
-const REGENPROTO_COMPATIBILITY_VECTOR: &str = include_str!(
- "../../../contracts/conformance/vectors/knowledge/regenproto_compatibility.v1.json"
-);
+const KNOWLEDGE_PUBLIC_SURFACE_VECTOR: &str =
+ include_str!("../../../contracts/conformance/vectors/knowledge/public_surface.v1.json");
const MVP_SUPPORT_CONTRACT_IDS: &[&str] = &[
"radroots.wiki.article.v1",
@@ -230,9 +229,9 @@ fn knowledge_manifest_preserves_regular_immutable_classification() {
}
#[test]
-fn regenproto_compatibility_vector_stays_generalized() {
- let value: serde_json::Value = serde_json::from_str(REGENPROTO_COMPATIBILITY_VECTOR).unwrap();
- assert_eq!(value["suite"], "knowledge_downstream_compatibility");
+fn knowledge_manifest_public_surface_vector_stays_generalized() {
+ let value: serde_json::Value = serde_json::from_str(KNOWLEDGE_PUBLIC_SURFACE_VECTOR).unwrap();
+ assert_eq!(value["suite"], "knowledge_public_surface");
let ids = value["vectors"]
.as_array()
.unwrap()
@@ -242,17 +241,17 @@ fn regenproto_compatibility_vector_stays_generalized() {
assert_eq!(
ids,
[
- "knowledge_claim_downstream_valid_002",
- "knowledge_field_report_downstream_valid_004",
- "knowledge_review_downstream_valid_003",
- "knowledge_source_downstream_valid_001",
- "knowledge_claim_sdk_builder_downstream_valid_006",
- "wiki_article_downstream_valid_005",
+ "knowledge_claim_public_surface_valid_002",
+ "knowledge_field_report_public_surface_valid_004",
+ "knowledge_review_public_surface_valid_003",
+ "knowledge_source_public_surface_valid_001",
+ "knowledge_claim_sdk_builder_public_surface_valid_006",
+ "wiki_article_public_surface_valid_005",
]
.into_iter()
.collect()
);
for forbidden in ["dao", "token", "reputation", "score", "canon_synthesis"] {
- assert!(!REGENPROTO_COMPATIBILITY_VECTOR.contains(forbidden));
+ assert!(!KNOWLEDGE_PUBLIC_SURFACE_VECTOR.contains(forbidden));
}
}
diff --git a/tools/xtask/src/contract.rs b/tools/xtask/src/contract.rs
@@ -18,8 +18,8 @@ const KNOWLEDGE_MANIFEST_SHA256_RELATIVE: &str =
"contracts/knowledge/knowledge_event_contract_manifest.v2.sha256";
const KNOWLEDGE_MANIFEST_AND_DECODE_RELATIVE: &str =
"contracts/conformance/vectors/knowledge/manifest_and_decode.v1.json";
-const KNOWLEDGE_REGENPROTO_COMPATIBILITY_RELATIVE: &str =
- "contracts/conformance/vectors/knowledge/regenproto_compatibility.v1.json";
+const KNOWLEDGE_PUBLIC_SURFACE_RELATIVE: &str =
+ "contracts/conformance/vectors/knowledge/public_surface.v1.json";
const KNOWLEDGE_MVP_SUPPORT_CONTRACT_IDS: [&str; 8] = [
"radroots.wiki.article.v1",
"radroots.wiki.redirect.v1",
@@ -173,7 +173,7 @@ pub struct PublicOperationConformance {
pub struct VersionPolicy {
pub contract: VersionContract,
pub semver: SemverRules,
- pub compatibility: CompatibilityRules,
+ pub release_integrity: ReleaseIntegrityRules,
}
#[derive(Debug, Deserialize)]
@@ -193,7 +193,7 @@ pub struct SemverRules {
#[derive(Debug, Deserialize)]
#[serde(deny_unknown_fields)]
-pub struct CompatibilityRules {
+pub struct ReleaseIntegrityRules {
pub requires_conformance_pass: bool,
pub requires_contract_manifest_diff: bool,
pub requires_release_notes: bool,
@@ -2117,6 +2117,7 @@ pub fn validate_knowledge_contract_manifest(workspace_root: &Path) -> Result<(),
}
validate_knowledge_manifest_witnesses(workspace_root, &actual_json)?;
+ validate_knowledge_conformance_vector_inventory(workspace_root)?;
let bundle = load_contract_bundle(workspace_root)?;
validate_conformance_vector_file(
@@ -2124,12 +2125,42 @@ pub fn validate_knowledge_contract_manifest(workspace_root: &Path) -> Result<(),
&bundle.manifest.contract.version,
)?;
validate_conformance_vector_file(
- &workspace_root.join(KNOWLEDGE_REGENPROTO_COMPATIBILITY_RELATIVE),
+ &workspace_root.join(KNOWLEDGE_PUBLIC_SURFACE_RELATIVE),
&bundle.manifest.contract.version,
)?;
Ok(())
}
+fn validate_knowledge_conformance_vector_inventory(workspace_root: &Path) -> Result<(), String> {
+ let expected = BTreeSet::from([
+ KNOWLEDGE_MANIFEST_AND_DECODE_RELATIVE.to_owned(),
+ KNOWLEDGE_PUBLIC_SURFACE_RELATIVE.to_owned(),
+ ]);
+ let mut paths = Vec::new();
+ collect_conformance_vector_paths(
+ &workspace_root.join("contracts/conformance/vectors/knowledge"),
+ &mut paths,
+ )?;
+ let mut actual = BTreeSet::new();
+ for path in paths {
+ let relative = path.strip_prefix(workspace_root).map_err(|error| {
+ format!(
+ "knowledge conformance vector {} is outside workspace root {}: {error}",
+ path.display(),
+ workspace_root.display()
+ )
+ })?;
+ actual.insert(relative.to_string_lossy().replace('\\', "/"));
+ }
+ if actual != expected {
+ return Err(format!(
+ "knowledge conformance vector inventory mismatch: expected {:?}, found {:?}",
+ expected, actual
+ ));
+ }
+ Ok(())
+}
+
fn validate_knowledge_manifest_witnesses(
workspace_root: &Path,
actual_json: &str,
@@ -3570,14 +3601,18 @@ fn validate_contract_bundle_with_release_policy_override(
{
return Err("version.semver rules must all be non-empty".to_string());
}
- if !bundle.version.compatibility.requires_conformance_pass {
- return Err("compatibility.requires_conformance_pass must be true".to_string());
+ if !bundle.version.release_integrity.requires_conformance_pass {
+ return Err("release_integrity.requires_conformance_pass must be true".to_string());
}
- if !bundle.version.compatibility.requires_contract_manifest_diff {
- return Err("compatibility.requires_contract_manifest_diff must be true".to_string());
+ if !bundle
+ .version
+ .release_integrity
+ .requires_contract_manifest_diff
+ {
+ return Err("release_integrity.requires_contract_manifest_diff must be true".to_string());
}
- if !bundle.version.compatibility.requires_release_notes {
- return Err("compatibility.requires_release_notes must be true".to_string());
+ if !bundle.version.release_integrity.requires_release_notes {
+ return Err("release_integrity.requires_release_notes must be true".to_string());
}
validate_policy_metadata(&bundle.manifest.policy)?;
let workspace_root = bundle
@@ -3909,14 +3944,18 @@ pub fn validate_contract_bundle(bundle: &ContractBundle) -> Result<(), String> {
{
return Err("version.semver rules must all be non-empty".to_string());
}
- if !bundle.version.compatibility.requires_conformance_pass {
- return Err("compatibility.requires_conformance_pass must be true".to_string());
+ if !bundle.version.release_integrity.requires_conformance_pass {
+ return Err("release_integrity.requires_conformance_pass must be true".to_string());
}
- if !bundle.version.compatibility.requires_contract_manifest_diff {
- return Err("compatibility.requires_contract_manifest_diff must be true".to_string());
+ if !bundle
+ .version
+ .release_integrity
+ .requires_contract_manifest_diff
+ {
+ return Err("release_integrity.requires_contract_manifest_diff must be true".to_string());
}
- if !bundle.version.compatibility.requires_release_notes {
- return Err("compatibility.requires_release_notes must be true".to_string());
+ if !bundle.version.release_integrity.requires_release_notes {
+ return Err("release_integrity.requires_release_notes must be true".to_string());
}
validate_policy_metadata(&bundle.manifest.policy)?;
let workspace_root = bundle
@@ -4164,7 +4203,7 @@ major_on = ["breaking"]
minor_on = ["feature"]
patch_on = ["fix"]
-[compatibility]
+[release_integrity]
requires_conformance_pass = true
requires_contract_manifest_diff = true
requires_release_notes = true
@@ -5647,21 +5686,24 @@ edition = "2024"
bundle.version.semver.patch_on.clear();
});
assert_bundle_error(
- "compatibility.requires_conformance_pass must be true",
+ "release_integrity.requires_conformance_pass must be true",
|bundle| {
- bundle.version.compatibility.requires_conformance_pass = false;
+ bundle.version.release_integrity.requires_conformance_pass = false;
},
);
assert_bundle_error(
- "compatibility.requires_contract_manifest_diff must be true",
+ "release_integrity.requires_contract_manifest_diff must be true",
|bundle| {
- bundle.version.compatibility.requires_contract_manifest_diff = false;
+ bundle
+ .version
+ .release_integrity
+ .requires_contract_manifest_diff = false;
},
);
assert_bundle_error(
- "compatibility.requires_release_notes must be true",
+ "release_integrity.requires_release_notes must be true",
|bundle| {
- bundle.version.compatibility.requires_release_notes = false;
+ bundle.version.release_integrity.requires_release_notes = false;
},
);
assert_bundle_error("contract policy flags must all be true", |bundle| {
@@ -6423,7 +6465,7 @@ major_on = ["breaking"]
minor_on = ["feature"]
patch_on = ["fix"]
-[compatibility]
+[release_integrity]
requires_conformance_pass = true
requires_contract_manifest_diff = true
requires_release_notes = true