487 lines
27 KiB
Rust
487 lines
27 KiB
Rust
// file: crates/ksp-worker-raw-transaction-ingest-lib/tests/release_completeness.rs
|
|
// version: 34
|
|
|
|
//! Release-completeness canaries through the `v0.3.15-pre.004` WebSocket capability-enforcement tranche.
|
|
|
|
#[test]
|
|
fn pre_010_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,
|
|
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
|
};
|
|
let mut names = std::vec::Vec::new();
|
|
for entry in entries {
|
|
let entry = match entry {
|
|
std::result::Result::Ok(value) => value,
|
|
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
|
};
|
|
let file_type = match entry.file_type() {
|
|
std::result::Result::Ok(value) => value,
|
|
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
|
};
|
|
if !file_type.is_file() {
|
|
continue;
|
|
}
|
|
let name = match entry.file_name().into_string() {
|
|
std::result::Result::Ok(value) => value,
|
|
std::result::Result::Err(_) => continue,
|
|
};
|
|
if name.ends_with(".rs") {
|
|
names.push(name);
|
|
}
|
|
}
|
|
names.sort_unstable();
|
|
assert_eq!(
|
|
names,
|
|
std::vec![
|
|
"admission.rs",
|
|
"constants.rs",
|
|
"continuity.rs",
|
|
"error.rs",
|
|
"identity.rs",
|
|
"lib.rs",
|
|
"persistence.rs",
|
|
"runtime.rs",
|
|
"runtime_resources.rs",
|
|
"settings.rs",
|
|
"snapshot.rs",
|
|
]
|
|
);
|
|
return std::result::Result::Ok(());
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_011_public_root_export_inventory_is_exact() {
|
|
let root = include_str!("../src/lib.rs");
|
|
let mut exports = std::vec::Vec::new();
|
|
for line in root.lines() {
|
|
let line = line.trim();
|
|
if !line.starts_with("pub use ") {
|
|
continue;
|
|
}
|
|
let path = line.trim_start_matches("pub use ").trim_end_matches(';');
|
|
let name = match path.rsplit("::").next() {
|
|
std::option::Option::Some(value) => value,
|
|
std::option::Option::None => continue,
|
|
};
|
|
exports.push(name);
|
|
}
|
|
exports.sort_unstable();
|
|
assert_eq!(
|
|
exports,
|
|
std::vec![
|
|
"DEFAULT_RAW_TRANSACTION_INGEST_ADMISSION_QUEUE_CAPACITY",
|
|
"DEFAULT_RAW_TRANSACTION_INGEST_HTTP_POLL_INTERVAL",
|
|
"DEFAULT_RAW_TRANSACTION_INGEST_HTTP_POLL_MAX_BLOCKS_PER_CYCLE",
|
|
"DEFAULT_RAW_TRANSACTION_INGEST_PERSISTENCE_CONCURRENCY",
|
|
"DEFAULT_RAW_TRANSACTION_INGEST_SHUTDOWN_DRAIN_TIMEOUT",
|
|
"ERROR_CODE_RAW_TRANSACTION_INGEST_CONTENT_CONFLICT",
|
|
"ERROR_CODE_RAW_TRANSACTION_INGEST_COUNTER_EXHAUSTED",
|
|
"ERROR_CODE_RAW_TRANSACTION_INGEST_DRAIN_TIMEOUT",
|
|
"ERROR_CODE_RAW_TRANSACTION_INGEST_RUNTIME_INVALID",
|
|
"ERROR_CODE_RAW_TRANSACTION_INGEST_SETTINGS_INVALID",
|
|
"ERROR_CODE_RAW_TRANSACTION_INGEST_SOURCE_FAILED",
|
|
"ERROR_CODE_RAW_TRANSACTION_INGEST_STORE_FAILED",
|
|
"MAX_RAW_TRANSACTION_INGEST_ADMISSION_QUEUE_CAPACITY",
|
|
"MAX_RAW_TRANSACTION_INGEST_HTTP_POLL_INTERVAL",
|
|
"MAX_RAW_TRANSACTION_INGEST_HTTP_POLL_MAX_BLOCKS_PER_CYCLE",
|
|
"MAX_RAW_TRANSACTION_INGEST_LIVE_SOURCES",
|
|
"MAX_RAW_TRANSACTION_INGEST_PERSISTENCE_CONCURRENCY",
|
|
"MAX_RAW_TRANSACTION_INGEST_SHUTDOWN_DRAIN_TIMEOUT",
|
|
"MIN_RAW_TRANSACTION_INGEST_ADMISSION_QUEUE_CAPACITY",
|
|
"MIN_RAW_TRANSACTION_INGEST_HTTP_POLL_INTERVAL",
|
|
"MIN_RAW_TRANSACTION_INGEST_HTTP_POLL_MAX_BLOCKS_PER_CYCLE",
|
|
"MIN_RAW_TRANSACTION_INGEST_PERSISTENCE_CONCURRENCY",
|
|
"MIN_RAW_TRANSACTION_INGEST_SHUTDOWN_DRAIN_TIMEOUT",
|
|
"RAW_TRANSACTION_INGEST_WORKER_KIND_CODE",
|
|
"RawTransactionIngestGapId",
|
|
"RawTransactionIngestGapReason",
|
|
"RawTransactionIngestGapSnapshot",
|
|
"RawTransactionIngestGapState",
|
|
"RawTransactionIngestHandle",
|
|
"RawTransactionIngestHeliusTransactionSource",
|
|
"RawTransactionIngestHttpBlockPollingSource",
|
|
"RawTransactionIngestRepairMethod",
|
|
"RawTransactionIngestRuntimeResources",
|
|
"RawTransactionIngestSettings",
|
|
"RawTransactionIngestSnapshot",
|
|
"RawTransactionIngestSnapshotFuture",
|
|
"RawTransactionIngestSnapshotSource",
|
|
"RawTransactionIngestSourceState",
|
|
"RawTransactionIngestStandardBlockSource",
|
|
"RawTransactionIngestStandardLogsSource",
|
|
"RawTransactionIngestTerminalFuture",
|
|
"RawTransactionIngestWorker",
|
|
"RawTransactionIngestYellowstoneSource",
|
|
]
|
|
);
|
|
assert!(!root.contains("pub mod "));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn pre_010_external_hardening_suite_is_present_and_scoped() {
|
|
let hardening = include_str!("hardening.rs");
|
|
for required in [
|
|
"pre_010_external_error_codes_are_stable_unique_and_domain_scoped",
|
|
"pre_010_debug_and_settings_errors_redact_worker_identity_and_invalid_values",
|
|
"v0_3_12_pre_002_manifest_dependency_surface_opens_only_transport_and_remains_backend_neutral",
|
|
"v0_3_12_pre_003_private_signal_debug_and_shape_do_not_expose_signature_filters_or_payload",
|
|
"v0_3_12_pre_004_hydration_provenance_and_remote_material_are_bounded_and_redacted",
|
|
"v0_3_12_pre_005_block_and_continuity_shapes_are_bounded_redacted_and_raw_separated",
|
|
"pre_010_source_visibility_contract_uses_crate_root_for_shared_items",
|
|
"pre_010_production_surface_has_no_historical_backfill_or_retriever_contract",
|
|
"v0_3_12_pre_002_production_sources_keep_transport_confined_to_runtime_resources",
|
|
"v0_3_12_pre_006_runtime_resource_contract_opens_one_supervised_transport_source",
|
|
"v0_3_12_pre_006_source_coalescence_is_bounded_stop_preemptible_and_redacted",
|
|
"v0_3_12_pre_007_processing_frontier_is_bounded_processing_only_and_redacted",
|
|
"v0_3_12_pre_008_reconnect_projection_is_source_neutral_bounded_and_contains_no_replay_material",
|
|
"v0_3_12_pre_009_hydration_retry_ownership_and_no_orphan_cleanup_are_explicit",
|
|
"pre_010_lower_layers_have_no_dependency_return_to_concrete_worker",
|
|
"v0_3_12_pre_002_public_root_exposes_contract_types_without_transport_implementation_paths",
|
|
"v0_3_13_pre_003_standard_logs_redaction_and_reference_only_contract_are_explicit",
|
|
"v0_3_13_pre_004_standard_block_redaction_version_and_null_guards_are_explicit",
|
|
"v0_3_13_pre_005_helius_transaction_redaction_full_reference_and_tier_neutrality_are_explicit",
|
|
"v0_3_13_pre_006_http_block_polling_is_bounded_run_local_stop_preemptible_and_redacted",
|
|
"v0_3_13_pre_007_multi_source_supervisor_is_fail_closed_joined_and_does_not_publish_source_identity",
|
|
"v0_3_13_pre_008_cross_source_convergence_is_bounded_conflict_checked_and_private",
|
|
"v0_3_13_pre_009_duplicate_storm_disagreement_and_starvation_guards_are_explicit",
|
|
"v0_3_13_pre_010_multi_source_health_is_conservative_counted_and_redacted",
|
|
"v0_3_13_pre_011_shutdown_races_are_bounded_joined_atomic_and_counter_safe",
|
|
"v0_3_14_pre_002_continuity_contracts_are_private_bounded_and_io_free",
|
|
"v0_3_14_pre_003_websocket_continuity_observation_reuses_transport_snapshot_sources_only",
|
|
] {
|
|
assert!(hardening.contains(required), "required pre.010 hardening canary missing: {required}");
|
|
}
|
|
let dependency_boundary = include_str!("dependency_boundary.rs");
|
|
assert!(dependency_boundary.contains("pre_002_manifest_dependency_surface_is_exact"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_006_source_surface_hardens_shutdown_and_faults_without_backend_edges"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_006_productive_source_uses_transport_session_bounded_coalescence_and_existing_admission"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_002_manifest_opens_only_the_onchain_transport_live_source_edge"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_003_transaction_and_status_adapters_are_private_and_transport_facade_only"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_004_hydration_contract_uses_only_transport_facade_common_raw_and_existing_ingress"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_005_block_and_continuity_adapters_remain_private_and_transport_facade_only"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_007_processing_frontier_remains_run_local_and_backend_neutral_after_continuity_extension"));
|
|
assert!(dependency_boundary.contains("v0_3_12_pre_008_worker_observes_transport_reconnect_replay_and_faults_only_on_proven_retention_gap"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_003_standard_logs_source_reuses_transport_facades_and_common_hydration_only"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_004_standard_block_source_is_direct_raw_and_transport_facade_only"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_005_helius_transaction_source_reuses_transport_facade_and_common_hydration_only"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_006_http_block_polling_reuses_transport_facades_without_becoming_backfill"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_007_multi_source_supervisor_and_inventory_remain_private_bounded_and_source_neutral"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_008_cross_source_convergence_reuses_store_and_transport_facades_only"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_009_global_bounds_and_fairness_stay_inside_worker_facades"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_010_multi_source_snapshot_health_remains_source_neutral_and_backend_free"));
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_011_shutdown_race_hardening_stays_inside_worker_and_existing_facades"));
|
|
let public_api = include_str!("public_api.rs");
|
|
assert!(public_api.contains("pre_003_kind_code_and_settings_are_consumable_from_crate_root"));
|
|
assert!(public_api.contains("pre_004_start_handle_and_terminal_future_are_consumable_without_public_join_handle"));
|
|
assert!(public_api.contains("pre_008_snapshot_surface_and_common_projection_are_public_and_stable"));
|
|
assert!(public_api.contains("pre_009_source_and_drain_timeout_error_codes_are_public_and_stable"));
|
|
assert!(public_api.contains("v0_3_12_pre_002_runtime_resource_types_are_consumable_without_client_escape_hatch"));
|
|
assert!(public_api.contains("v0_3_13_pre_002_multi_source_runtime_resource_surface_is_bounded_and_source_neutral"));
|
|
assert!(public_api.contains("v0_3_13_pre_003_standard_logs_runtime_resource_surface_is_typed_and_transport_owned"));
|
|
assert!(public_api.contains("v0_3_13_pre_004_standard_block_runtime_resource_surface_is_typed_and_transport_owned"));
|
|
assert!(public_api.contains("v0_3_13_pre_006_http_block_polling_runtime_resource_surface_is_bounded_and_transport_owned"));
|
|
assert!(public_api.contains("v0_3_13_pre_007_source_inventory_and_logical_keys_remain_private"));
|
|
assert!(public_api.contains("v0_3_13_pre_008_convergence_cache_registry_and_source_keys_remain_private"));
|
|
assert!(public_api.contains("v0_3_13_pre_009_fairness_budgets_semaphore_and_canonical_state_remain_private"));
|
|
assert!(public_api.contains("v0_3_13_pre_010_multi_source_snapshot_counts_are_public_and_source_neutral"));
|
|
assert!(public_api.contains("v0_3_13_pre_011_race_hardening_adds_no_public_runtime_or_source_identity_surface"));
|
|
assert!(public_api.contains("v0_3_12_pre_007_processing_frontier_snapshot_getters_are_public_and_processing_only"));
|
|
assert!(public_api.contains("pre_008_snapshot_surface_and_common_projection_are_public_and_stable"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_12_pre_010_cross_layer_completeness_suite_is_present_and_exact() -> std::io::Result<()> {
|
|
let test_root = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("tests");
|
|
let entries = match std::fs::read_dir(test_root) {
|
|
std::result::Result::Ok(value) => value,
|
|
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
|
};
|
|
let mut names = std::vec::Vec::new();
|
|
for entry in entries {
|
|
let entry = match entry {
|
|
std::result::Result::Ok(value) => value,
|
|
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
|
};
|
|
let file_type = match entry.file_type() {
|
|
std::result::Result::Ok(value) => value,
|
|
std::result::Result::Err(error) => return std::result::Result::Err(error),
|
|
};
|
|
if !file_type.is_file() {
|
|
continue;
|
|
}
|
|
let name = match entry.file_name().into_string() {
|
|
std::result::Result::Ok(value) => value,
|
|
std::result::Result::Err(_) => continue,
|
|
};
|
|
if name.ends_with(".rs") {
|
|
names.push(name);
|
|
}
|
|
}
|
|
names.sort_unstable();
|
|
assert_eq!(names, std::vec!["cross_layer_completeness.rs", "dependency_boundary.rs", "hardening.rs", "public_api.rs", "release_completeness.rs"]);
|
|
let cross_layer = include_str!("cross_layer_completeness.rs");
|
|
for required in [
|
|
"v0_3_12_pre_010_dependency_firewall_is_exact_across_transport_worker_common_raw_store",
|
|
"v0_3_12_pre_010_legacy_v0_fixture_matrix_is_exact_across_transport_worker_and_common_raw",
|
|
"v0_3_12_pre_010_redaction_scanner_matrix_is_present_across_all_layers",
|
|
"v0_3_12_pre_010_public_roots_keep_implementation_modules_private",
|
|
] {
|
|
assert!(cross_layer.contains(required), "required pre.010 cross-layer canary missing: {required}");
|
|
}
|
|
return std::result::Result::Ok(());
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_13_pre_012_cross_layer_completeness_security_inventory_is_exact() {
|
|
let cross_layer = include_str!("cross_layer_completeness.rs");
|
|
for required in [
|
|
"v0_3_13_pre_012_all_five_live_source_families_share_one_worker_common_raw_store_pipeline",
|
|
"v0_3_13_pre_012_legacy_v0_v1_is_proven_from_transport_through_worker_common_raw_to_store",
|
|
"v0_3_13_pre_012_yellowstone_non_regression_covers_identity_v1_reconnect_gap_and_worker_hydration",
|
|
"v0_3_13_pre_012_security_redaction_matrix_covers_all_live_sources_and_lower_layers",
|
|
] {
|
|
assert!(cross_layer.contains(required), "required pre.012 cross-layer canary missing: {required}");
|
|
}
|
|
let dependency_boundary = include_str!("dependency_boundary.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let public_api = include_str!("public_api.rs");
|
|
assert!(dependency_boundary.contains("v0_3_13_pre_012_cross_layer_closure_does_not_expand_worker_dependency_graph"));
|
|
assert!(hardening.contains("v0_3_13_pre_012_cross_layer_security_closure_is_complete_and_source_neutral"));
|
|
assert!(public_api.contains("v0_3_13_pre_012_completeness_closure_adds_no_public_implementation_surface"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_004_native_replay_evidence_canaries_are_present_without_public_replay_ownership() {
|
|
let hardening = include_str!("hardening.rs");
|
|
let resources = include_str!("../src/runtime_resources.rs");
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
assert!(hardening.contains("v0_3_14_pre_004_yellowstone_replay_evidence_is_transport_owned_and_fail_closed_without_coverage_proof"));
|
|
assert!(resource_tests.contains("v0_3_14_pre_004_replay_delivery_is_not_coverage_and_unproven_coverage_fails_closed"));
|
|
assert!(resources.contains("source.replay_coverage_unproven"));
|
|
assert!(!root.contains("ReplayInfo"));
|
|
assert!(!root.contains("from_slot"));
|
|
assert!(!root.contains("set_from_slot"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_005_redundant_coverage_canaries_are_present_without_public_surface_growth() {
|
|
let continuity_tests = include_str!("../unit_tests/continuity.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"pre_005_scope_relations_are_exact_superset_and_cross_family_conservative",
|
|
"pre_005_coverage_epoch_requires_distinct_source_same_commitment_and_full_range",
|
|
"pre_005_cross_family_exact_scopes_never_become_redundant_by_fingerprint_alone",
|
|
"pre_005_coverage_epoch_ledger_is_bounded_monotone_and_capability_bound",
|
|
] {
|
|
assert!(continuity_tests.contains(required), "required pre.005 continuity proof canary missing: {required}");
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_005_redundant_coverage_requires_exact_or_superset_proof_over_full_range"));
|
|
assert!(!root.contains("pub use self::continuity::RawTransactionIngestCoverageEpoch"));
|
|
assert!(!root.contains("pub use self::continuity::RawTransactionIngestCoverageRelation"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_006_bounded_http_discovery_canaries_are_present_without_backfill_or_public_surface_growth() {
|
|
let hardening = include_str!("hardening.rs");
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"v0_3_14_pre_006_http_scan_capabilities_prefer_closed_range_and_require_safe_fallback",
|
|
"v0_3_14_pre_006_http_scan_capability_detection_is_role_local_and_io_free",
|
|
"v0_3_14_pre_006_http_discovery_window_is_inclusive_bounded_and_overflow_safe",
|
|
"v0_3_14_pre_006_closed_range_discovery_proves_skipped_slots_only_inside_exact_window",
|
|
"v0_3_14_pre_006_with_limit_discovery_never_uses_tip_alone_as_tail_coverage_proof",
|
|
] {
|
|
assert!(resource_tests.contains(required), "required pre.006 HTTP discovery canary missing: {required}");
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_006_http_discovery_is_bounded_prefers_closed_range_and_never_uses_tip_alone_as_coverage"));
|
|
assert!(!root.contains("pub use self::runtime_resources::RawTransactionIngestHttpDiscovery"));
|
|
assert!(!root.contains("backfill"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_007_known_reference_hydration_canaries_are_present_without_second_registry_or_public_surface_growth() {
|
|
let continuity_tests = include_str!("../unit_tests/continuity.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"pre_007_known_reference_obligation_preserves_exact_reference_slot_and_commitment",
|
|
"v0_3_14_pre_007_known_reference_hydration_reuses_global_registry_and_available_material",
|
|
"v0_3_14_pre_007_missing_known_reference_remains_open_without_block_capability",
|
|
"v0_3_14_pre_007_missing_known_reference_prefers_same_role_block_slot_when_supported",
|
|
] {
|
|
assert!(continuity_tests.contains(required) || resource_tests.contains(required), "required pre.007 canary missing: {required}");
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_007_known_reference_hydration_reuses_one_registry_and_preserves_missing_obligation"));
|
|
assert!(!root.contains("pub use self::continuity::RawTransactionIngestKnownReferenceObligation"));
|
|
assert!(!root.contains("pub use self::runtime_resources::RawTransactionIngestKnownReference"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_008_reconciliation_canaries_are_present_without_public_surface_or_respawn_growth() {
|
|
let continuity_tests = include_str!("../unit_tests/continuity.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"pre_008_continuity_frontier_is_gap_aware_and_recovers_after_redundant_proof",
|
|
"pre_008_source_loss_requires_full_active_target_coverage",
|
|
"pre_008_open_gap_without_proven_epoch_blocks_redundant_source_continuation",
|
|
"pre_008_known_reference_missing_moves_to_continuity_ledger_and_reconciles_from_proven_full_ledger_epoch",
|
|
"v0_3_14_pre_008_proven_full_ledger_epoch_survives_filtered_peer_loss_without_worker_respawn",
|
|
"v0_3_14_pre_008_only_classified_source_loss_enters_coverage_decision",
|
|
] {
|
|
assert!(continuity_tests.contains(required) || resource_tests.contains(required), "required pre.008 canary missing: {required}");
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_008_reconciliation_and_source_loss_are_target_coverage_gated_without_respawn"));
|
|
assert!(!root.contains("pub use self::continuity::RawTransactionIngestSourceLossDecision"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_009_health_policy_canaries_are_present_without_public_source_identity_growth() {
|
|
let continuity_tests = include_str!("../unit_tests/continuity.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let snapshot_tests = include_str!("../unit_tests/snapshot.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"pre_009_health_projection_distinguishes_future_coverage_from_open_gap_reconciliation",
|
|
"pre_009_health_projection_rejects_duplicate_and_unknown_active_sources",
|
|
"v0_3_14_pre_009_inventory_health_projection_tracks_reconciled_coverage",
|
|
"v0_3_14_pre_009_health_requires_present_and_future_coverage_before_healthy",
|
|
] {
|
|
assert!(
|
|
continuity_tests.contains(required) || resource_tests.contains(required) || snapshot_tests.contains(required),
|
|
"required pre.009 health canary missing: {required}"
|
|
);
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_009_health_policy_is_present_future_coverage_gated_and_source_neutral"));
|
|
assert!(!root.contains("SourceHealthByKey"));
|
|
assert!(!root.contains("pub use self::continuity::RawTransactionIngestTargetCoverage"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_010_repair_fairness_canaries_are_present_without_public_or_pipeline_growth() {
|
|
let hardening = include_str!("hardening.rs");
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"v0_3_14_pre_010_fair_scheduler_alternates_nominal_and_repair_with_bounded_burst",
|
|
"v0_3_14_pre_010_fair_waiter_bound_is_checked_and_released_without_reserved_capacity",
|
|
"v0_3_14_pre_010_nominal_and_repair_hydration_share_one_capacity_one_permit_pool",
|
|
"v0_3_14_pre_010_repair_only_progresses_when_existing_capacity_is_one",
|
|
] {
|
|
assert!(resource_tests.contains(required), "required pre.010 fairness canary missing: {required}");
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_010_repair_fairness_shares_existing_bounds_without_second_pipeline"));
|
|
assert!(!root.contains("RawTransactionIngestTrafficClass"));
|
|
assert!(!root.contains("RawTransactionIngestFairTurnGate"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_011_gap_observability_canaries_are_present_without_source_identity_growth() {
|
|
let continuity_tests = include_str!("../unit_tests/continuity.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let public_api = include_str!("public_api.rs");
|
|
let snapshot_tests = include_str!("../unit_tests/snapshot.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"pre_011_gap_observability_projects_open_and_recent_repaired_entries",
|
|
"v0_3_14_pre_011_snapshot_carries_checked_gap_observability",
|
|
"v0_3_14_pre_011_gap_observability_is_public_bounded_and_source_neutral",
|
|
] {
|
|
assert!(
|
|
continuity_tests.contains(required) || snapshot_tests.contains(required) || public_api.contains(required),
|
|
"required pre.011 observability canary missing: {required}"
|
|
);
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_011_gap_observability_is_bounded_checked_and_redacted"));
|
|
for required in [
|
|
"RawTransactionIngestGapId",
|
|
"RawTransactionIngestGapReason",
|
|
"RawTransactionIngestGapSnapshot",
|
|
"RawTransactionIngestGapState",
|
|
"RawTransactionIngestRepairMethod",
|
|
] {
|
|
assert!(root.contains(required), "required pre.011 public type missing: {required}");
|
|
}
|
|
assert!(!root.contains("source_key"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_012_shutdown_race_canaries_cover_bounded_source_and_worker_drains() {
|
|
let dependency_boundary = include_str!("dependency_boundary.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
for required in [
|
|
"v0_3_14_pre_012_source_fault_preserves_first_fault_and_aborts_non_cooperative_sibling",
|
|
"v0_3_14_pre_012_stop_aborts_non_cooperative_source_after_bounded_drain",
|
|
] {
|
|
assert!(resource_tests.contains(required), "required pre.012 source shutdown canary missing: {required}");
|
|
}
|
|
assert!(hardening.contains("v0_3_14_pre_012_shutdown_races_are_bounded_across_source_and_worker_drains"));
|
|
assert!(dependency_boundary.contains("v0_3_14_pre_012_shutdown_hardening_stays_worker_local_and_facade_only"));
|
|
assert!(!root.contains("RawTransactionIngestShutdown"));
|
|
assert!(!root.contains("SourceDrain"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_14_pre_013_cross_layer_closure_canaries_are_complete_without_behavior_or_surface_growth() {
|
|
let cross_layer = include_str!("cross_layer_completeness.rs");
|
|
let dependency_boundary = include_str!("dependency_boundary.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let public_api = include_str!("public_api.rs");
|
|
for required in [
|
|
"v0_3_14_pre_013_gap_repair_closure_keeps_one_transport_worker_common_raw_store_pipeline",
|
|
"v0_3_14_pre_013_security_redaction_covers_gap_repair_and_terminal_paths",
|
|
"v0_3_14_pre_013_legacy_v0_v1_remains_proven_after_gap_repair_hardening",
|
|
"v0_3_14_pre_013_worker_and_backfill_remain_independent_producers",
|
|
] {
|
|
assert!(cross_layer.contains(required), "required pre.013 cross-layer canary missing: {required}");
|
|
}
|
|
assert!(dependency_boundary.contains("v0_3_14_pre_013_cross_layer_closure_keeps_dependency_and_producer_boundaries_exact"));
|
|
assert!(hardening.contains("v0_3_14_pre_013_cross_layer_completeness_security_closure_is_exact_and_redacted"));
|
|
assert!(public_api.contains("v0_3_14_pre_013_completeness_closure_adds_no_public_surface"));
|
|
assert!(include_str!("../src/lib.rs").contains("RawTransactionIngestGapSnapshot"));
|
|
assert!(include_str!("../src/lib.rs").contains("RawTransactionIngestWorker"));
|
|
return;
|
|
}
|
|
|
|
#[test]
|
|
fn v0_3_15_pre_004_websocket_capability_enforcement_canaries_are_complete_without_public_surface_growth() {
|
|
let resource_tests = include_str!("../unit_tests/runtime_resources.rs");
|
|
let hardening = include_str!("hardening.rs");
|
|
let root = include_str!("../src/lib.rs");
|
|
assert!(resource_tests.contains("v0_3_15_pre_004_websocket_route_constructors_require_explicit_capability_before_io"));
|
|
assert!(hardening.contains("v0_3_15_pre_004_websocket_source_constructors_enforce_transport_capabilities_before_io"));
|
|
for required in [
|
|
"runtime_resources.standard_logs_capability_missing",
|
|
"runtime_resources.standard_block_capability_missing",
|
|
"runtime_resources.helius_transaction_capability_missing",
|
|
] {
|
|
assert!(resource_tests.contains(required), "required pre.004 route-constructor canary missing: {required}");
|
|
}
|
|
assert!(!root.contains("WsSubscriptionKind"));
|
|
assert!(!root.contains("subscription_capabilities"));
|
|
assert!(!root.contains("supports_subscription"));
|
|
return;
|
|
}
|