v0.2.13-pre.005

This commit is contained in:
2026-08-28 05:24:26 +02:00
parent 0ee28eeb95
commit 29f27ae109
9 changed files with 529 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
// file: crates/ksp-interface-lib/tests/dependency_boundary.rs
// version: 3
// version: 4
//! Dependency and passive-surface canaries for the Interface foundation.
@@ -45,7 +45,7 @@ fn pre_002_manifest_has_exact_core_only_runtime_dependency() {
}
#[test]
fn pre_004_surface_remains_passive_without_codecs_or_runtime_logging() {
fn pre_005_surface_remains_passive_without_codecs_or_runtime_logging() {
let crate_root = include_str!("../src/lib.rs");
assert!(crate_root.contains("ProgramAccountMeta"));
assert!(crate_root.contains("MAX_PROGRAM_INSTRUCTION_ACCOUNTS"));
@@ -83,3 +83,49 @@ fn manifest_dependency_names(section: &str) -> std::vec::Vec<&str> {
names.sort_unstable();
return names;
}
#[test]
fn pre_005_all_production_sources_preserve_the_dependency_firewall() {
let production_sources = [
include_str!("../src/error.rs"),
include_str!("../src/lib.rs"),
include_str!("../src/program_account_meta.rs"),
include_str!("../src/program_instruction.rs"),
];
for source in production_sources {
for forbidden in [
"borsh::",
"bincode::",
"ksp_config_lib::",
"ksp_logging_lib::",
"ksp_offchain_transport_lib::",
"ksp_onchain_transport_lib::",
"ksp_program_api::",
"ksp_program_lib::",
"ksp_store_api::",
"ksp_store_lib::",
"ksp_wallet_lib::",
"reqwest::",
"serde::",
"serde_json::",
"solana_instruction::",
"tauri::",
"tokio::",
"tonic::",
"tracing::",
"wincode::",
] {
assert!(!source.contains(forbidden), "forbidden production dependency path detected: {forbidden}");
}
}
return;
}
#[test]
fn pre_005_instruction_source_has_no_narrowing_cast_or_hidden_codec_entry_point() {
let instruction_source = include_str!("../src/program_instruction.rs");
for forbidden in [" as u8", " as u16", " as u32", " as u64", "serialize", "deserialize", "encode", "decode"] {
assert!(!instruction_source.contains(forbidden), "forbidden instruction implementation pattern detected: {forbidden}");
}
return;
}