v0.3.6-pre.007

This commit is contained in:
2026-09-01 14:47:23 +02:00
parent be0032e76b
commit 138395ac35
11 changed files with 916 additions and 36 deletions

View File

@@ -1,10 +1,10 @@
// file: crates/ksp-job-backfill-lib/tests/dependency_boundary.rs
// version: 2
// version: 3
//! Dependency firewall canaries for Backfill discovery and RAW v1 conversion.
//! Dependency firewall canaries through Backfill Store persistence.
#[test]
fn pre_006_manifest_uses_only_planned_ksp_edges_and_backend_neutral_store() {
fn pre_007_manifest_uses_only_planned_ksp_edges_and_backend_neutral_store() {
let manifest = include_str!("../Cargo.toml");
for required in [
"ksp-core-lib = { path = \"../ksp-core-lib\" }",
@@ -36,7 +36,7 @@ fn pre_006_manifest_uses_only_planned_ksp_edges_and_backend_neutral_store() {
}
#[test]
fn pre_006_production_sources_keep_transport_and_store_in_their_owned_layers() {
fn pre_007_production_sources_keep_transport_and_store_in_their_owned_layers() {
let non_conversion_sources = [
include_str!("../src/constants.rs"),
include_str!("../src/discovery.rs"),
@@ -62,6 +62,15 @@ fn pre_006_production_sources_keep_transport_and_store_in_their_owned_layers() {
for forbidden in ["ksp_config_lib::", "ksp_interface_lib::", "ksp_store_api::", "ksp_store_postgres_lib::", "reqwest::", "std::env", "tonic::"] {
assert!(!conversion.contains(forbidden), "forbidden RAW conversion path detected: {forbidden}");
}
let persistence = include_str!("../src/persistence.rs");
assert!(persistence.contains("persist_raw_transaction_acquisition"));
assert!(persistence.contains("RawTransactionAcquisitionMode::Normal"));
assert!(persistence.contains("ERROR_CODE_RAW_CONFLICT"));
assert!(!persistence.contains("record_raw_transaction_observation"));
assert!(!persistence.contains("RawTransactionAcquisitionMode::ForceRehydrate"));
for forbidden in ["ksp_config_lib::", "ksp_interface_lib::", "ksp_store_api::", "ksp_store_postgres_lib::", "reqwest::", "std::env", "tonic::"] {
assert!(!persistence.contains(forbidden), "forbidden Store persistence path detected: {forbidden}");
}
let discovery = include_str!("../src/discovery.rs");
assert!(discovery.contains("get_signatures_for_address"));
assert!(!discovery.contains("execute_standard_rpc"));

View File

@@ -1,7 +1,7 @@
// file: crates/ksp-job-backfill-lib/tests/public_api.rs
// version: 2
// version: 3
//! Public API canaries for bounded Backfill discovery and RAW v1 conversion.
//! Public API canaries for bounded Backfill discovery, RAW v1 conversion and Store persistence.
#[test]
fn pre_005_request_scope_and_discovery_contracts_are_available_from_crate_root() {
@@ -86,3 +86,13 @@ fn pre_006_raw_conversion_contract_is_available_from_crate_root() {
assert_eq!(ksp_job_backfill_lib::ERROR_CODE_BACKFILL_RAW_CONVERSION_INVALID, ksp_core_lib::ErrorCode::new("job_backfill", "raw_conversion_invalid"));
return;
}
#[test]
fn pre_007_store_persistence_contract_is_available_from_crate_root() {
let _persist = ksp_job_backfill_lib::persist_backfill_hydration;
let _outcome: std::option::Option<ksp_job_backfill_lib::BackfillPersistenceOutcome> = std::option::Option::None;
let _entity = ksp_job_backfill_lib::BackfillEntityPersistence::AlreadyPresent;
let _observation = ksp_job_backfill_lib::BackfillObservationPersistence::AlreadyPresent;
assert_eq!(ksp_job_backfill_lib::ERROR_CODE_BACKFILL_PERSISTENCE_INVALID, ksp_core_lib::ErrorCode::new("job_backfill", "persistence_invalid"));
return;
}

View File

@@ -1,10 +1,10 @@
// file: crates/ksp-job-backfill-lib/tests/release_completeness.rs
// version: 2
// version: 3
//! Completeness canaries for the `pre.006` Backfill RAW conversion tranche.
//! Completeness canaries through the `pre.007` Backfill Store persistence tranche.
#[test]
fn pre_006_production_module_inventory_is_exact() -> std::io::Result<()> {
fn pre_007_production_module_inventory_is_exact() -> std::io::Result<()> {
let source_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("src");
let entries = match std::fs::read_dir(source_root) {
std::result::Result::Ok(value) => value,
@@ -32,12 +32,12 @@ fn pre_006_production_module_inventory_is_exact() -> std::io::Result<()> {
}
}
names.sort_unstable();
assert_eq!(names, std::vec!["constants.rs", "conversion.rs", "discovery.rs", "error.rs", "lib.rs", "request.rs"]);
assert_eq!(names, std::vec!["constants.rs", "conversion.rs", "discovery.rs", "error.rs", "lib.rs", "persistence.rs", "request.rs"]);
return std::result::Result::Ok(());
}
#[test]
fn pre_006_surface_adds_raw_conversion_without_persistence_or_checkpoint_runtime() {
fn pre_007_surface_adds_store_persistence_without_checkpoint_runtime() {
let root = include_str!("../src/lib.rs");
for required in [
"BackfillCandidate",
@@ -56,11 +56,16 @@ fn pre_006_surface_adds_raw_conversion_without_persistence_or_checkpoint_runtime
"RAW_TRANSACTION_FORMAT_ID",
"RAW_TRANSACTION_FORMAT_VERSION",
"ERROR_CODE_BACKFILL_RAW_CONVERSION_INVALID",
"BackfillPersistenceOutcome",
"BackfillEntityPersistence",
"BackfillObservationPersistence",
"persist_backfill_hydration",
"ERROR_CODE_BACKFILL_PERSISTENCE_INVALID",
] {
assert!(root.contains(required), "required pre.006 public contract missing: {required}");
}
for forbidden in ["persist_raw_transaction_acquisition", "BackfillCheckpoint", "BackfillJobHandle", "JobSnapshotSource"] {
assert!(!root.contains(forbidden), "later Backfill tranche leaked into pre.006: {forbidden}");
for forbidden in ["BackfillCheckpoint", "BackfillJobHandle", "JobSnapshotSource"] {
assert!(!root.contains(forbidden), "later Backfill tranche leaked into pre.007: {forbidden}");
}
assert!(!root.contains("pub mod "));
return;