ASELSANMicrokernel
S572 · SOURCE-BOUND GATE EVIDENCE

S572 · R2 supported-profile runtime kanıtı baseline kaydı

tam S572 implementation modülü → Operations --test hedefi ile bağlı tam focused test → ayrı Operations kaydı Bu sayfa yalnız S572 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

S572Focused kod testiOperations id exactsource SHA exacttest target exact

operation: g8l-s572-r2-supported-profile-runtime-evidence-baseline

uygulama/model · focused test · Operations · 3 exact excerpt

sequence-bound=true · implementation-bound=true
01 · Yürütme / doğrulama kodu

Kapının gerçek repository sözleşmesi

tam dosyaL1–L321
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline.rs::S572 r2 supported profile runtime evidence baseline implementation
//! S572 opens the R1 -> R2 transition by importing the immutable S571
//! Raspberry Pi 5 UART observation as the first supported-profile runtime
//! evidence baseline.
//!
//! This gate is deliberately read-only. It binds the exact board-rpi5
//! profile, S570 image, S571 raw capture, evidence manifest and closeout log;
//! reclassifies the real raw marker matrix; and publishes one idempotent
//! provenance receipt. It does not rerun S571, write an SD card, open UART,
//! power hardware or create a new runtime/physical observation.
//!
//! One retained physical observation is a baseline, not a repeat campaign.
//! Independent physical repeats, visible scanout/input, cross-profile
//! coverage and R2 field acceptance therefore remain explicitly open.

#![allow(dead_code)]

use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s571_r1_frozen_manifest_physical_boot_uart_run::{
    classify_s571_raw, count_s571_markers, G8lS571MarkerCounts, G8lS571PhysicalVerdict,
    S571_BOOT_TO_UI_PHYSICALLY_OBSERVED, S571_CANDIDATE_IMAGE_BYTES,
    S571_CANDIDATE_IMAGE_SHA256, S571_CLOSEOUT_LOG_BYTES, S571_CLOSEOUT_LOG_SHA256,
    S571_EVIDENCE_MANIFEST_BYTES, S571_EVIDENCE_MANIFEST_SHA256, S571_PHYSICAL_GATE_STATUS,
    S571_PHYSICAL_INPUT_OBSERVED, S571_PHYSICAL_OBSERVATIONS, S571_RAW_BYTES,
    S571_RAW_LINK_COUNT, S571_RAW_MODE_OCTAL, S571_RAW_SHA256, S571_SEQUENCE,
    S571_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS, S571_VISIBLE_SCANOUT_OBSERVED,
};

pub const S572_SEQUENCE: usize = 572;
pub const S572_EXPECTED_PREDECESSOR: usize = S571_SEQUENCE;
pub const S572_R2_TRANSITION_FIRST: usize = 572;
pub const S572_R2_TRANSITION_LAST: usize = 707;
pub const S572_R2_WORKSTREAM_ORDINAL: usize = 1;
pub const S572_ACCEPTANCE_DOMAIN: &str = "supported_profile_runtime_evidence";
pub const S572_GATE_STATUS: &str = "PASS";
pub const S572_SUPPORTED_PROFILE: &str = "board-rpi5";
pub const S572_TARGET_ARCH: &str = "aarch64";
pub const S572_EVIDENCE_TRANSPORT: &str = "uart-115200-8n1";
pub const S572_SOURCE_OBSERVATION_SEQUENCE: usize = S571_SEQUENCE;
pub const S572_RETAINED_RUNTIME_BASELINES: usize = S571_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS;
pub const S572_RETAINED_PHYSICAL_OBSERVATIONS: usize = S571_PHYSICAL_OBSERVATIONS;
pub const S572_NEW_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS: usize = 0;
pub const S572_NEW_PHYSICAL_OBSERVATIONS: usize = 0;
pub const S572_INDEPENDENT_PHYSICAL_REPEATS: usize = 0;
pub const S572_HOST_REPLAY_VALIDATIONS: usize = 1;
pub const S572_PHYSICAL_OR_DEVICE_OPERATIONS: usize = 0;
pub const S572_SD_WRITES: usize = 0;
pub const S572_UART_OPENS: usize = 0;
pub const S572_POWER_TRANSITIONS: usize = 0;
pub const S572_NEW_IMMUTABLE_RAW_CAPTURES: usize = 0;
pub const S572_BOOT_TO_UI_BASELINE_RETAINED: bool = S571_BOOT_TO_UI_PHYSICALLY_OBSERVED;
pub const S572_VISIBLE_SCANOUT_OBSERVED: bool = S571_VISIBLE_SCANOUT_OBSERVED;
pub const S572_PHYSICAL_INPUT_OBSERVED: bool = S571_PHYSICAL_INPUT_OBSERVED;
pub const S572_CROSS_PROFILE_COVERAGE_COMPLETE: bool = false;
pub const S572_REPEATABILITY_COMPLETE: bool = false;
pub const S572_R2_FIELD_ACCEPTANCE_COMPLETE: bool = false;
pub const S572_AUTOMATIC_PROMOTION: bool = false;
pub const RUNBOOK_EXECUTED_IN_S572: bool = false;

pub const S572_CANDIDATE_IMAGE_BYTES: u64 = S571_CANDIDATE_IMAGE_BYTES;
pub const S572_CANDIDATE_IMAGE_SHA256: &str = S571_CANDIDATE_IMAGE_SHA256;
pub const S572_RAW_BYTES: u64 = S571_RAW_BYTES;
pub const S572_RAW_SHA256: &str = S571_RAW_SHA256;
pub const S572_RAW_FNV1A64: u64 = 0xdd63_b389_8666_dc73;
pub const S572_RAW_MODE_OCTAL: &str = S571_RAW_MODE_OCTAL;
pub const S572_RAW_LINK_COUNT: usize = S571_RAW_LINK_COUNT;
pub const S572_EVIDENCE_MANIFEST_BYTES: u64 = S571_EVIDENCE_MANIFEST_BYTES;
pub const S572_EVIDENCE_MANIFEST_SHA256: &str = S571_EVIDENCE_MANIFEST_SHA256;
pub const S572_CLOSEOUT_LOG_BYTES: u64 = S571_CLOSEOUT_LOG_BYTES;
pub const S572_CLOSEOUT_LOG_SHA256: &str = S571_CLOSEOUT_LOG_SHA256;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lS572ArtifactIdentity {
    pub bytes: u64,
    pub sha256: &'static str,
}

pub const fn s572_identity(bytes: u64, sha256: &'static str) -> G8lS572ArtifactIdentity {
    G8lS572ArtifactIdentity { bytes, sha256 }
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lS572SupportedProfileObservation<'a> {
    pub predecessor_sequence: usize,
    pub predecessor_passed: bool,
    pub source_observation_sequence: usize,
    pub source_physical_status: &'a str,
    pub profile: &'a str,
    pub target_arch: &'a str,
    pub transport: &'a str,
    pub candidate: G8lS572ArtifactIdentity,
    pub raw: G8lS572ArtifactIdentity,
    pub evidence_manifest: G8lS572ArtifactIdentity,
    pub closeout_log: G8lS572ArtifactIdentity,
    pub raw_mode_octal: &'a str,
    pub raw_link_count: usize,
    pub retained_runtime_baselines: usize,
    pub retained_physical_observations: usize,
    pub new_runtime_observations: usize,
    pub new_physical_observations: usize,
    pub independent_physical_repeats: usize,
    pub physical_or_device_operations: usize,
    pub visible_scanout_observed: bool,
    pub physical_input_observed: bool,
    pub r2_field_acceptance_complete: bool,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lS572SupportedProfileReceipt {
    pub sequence: usize,
    pub predecessor_sequence: usize,
    pub status: &'static str,
    pub acceptance_domain: &'static str,
    pub source_observation_sequence: usize,
    pub profile: &'static str,
    pub target_arch: &'static str,
    pub transport: &'static str,
    pub candidate: G8lS572ArtifactIdentity,
    pub raw: G8lS572ArtifactIdentity,
    pub marker_counts: G8lS571MarkerCounts,
    pub retained_runtime_baselines: usize,
    pub retained_physical_observations: usize,
    pub new_runtime_observations: usize,
    pub new_physical_observations: usize,
    pub independent_physical_repeats: usize,
    pub host_replay_validations: usize,
    pub physical_or_device_operations: usize,
    pub boot_to_ui_baseline_retained: bool,
    pub visible_scanout_observed: bool,
    pub physical_input_observed: bool,
    pub cross_profile_coverage_complete: bool,
    pub repeatability_complete: bool,
    pub r2_field_acceptance_complete: bool,
    pub runbook_executed: bool,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lS572SupportedProfileState {
    receipt: Option<G8lS572SupportedProfileReceipt>,
}

impl G8lS572SupportedProfileState {
    pub const fn new() -> Self {
        Self { receipt: None }
    }

    pub const fn receipt(&self) -> Option<G8lS572SupportedProfileReceipt> {
        self.receipt
    }
}

impl Default for G8lS572SupportedProfileState {
    fn default() -> Self {
        Self::new()
    }
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS572SupportedProfileOutcome {
    BaselineRecorded(G8lS572SupportedProfileReceipt),
    BaselineRetained(G8lS572SupportedProfileReceipt),
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS572SupportedProfileError {
    PredecessorRejected,
    SourceObservationRejected,
    ProfileDrift,
    CandidateIdentityDrift,
    RawIdentityDrift,
    EvidenceIdentityDrift,
    ImmutabilityDrift,
    RawClassifierRejected,
    RetainedObservationDrift,
    NewObservationOverclaim,
    BoundaryOverclaim,
    PublishedStateDrift,
}

impl G8lS572SupportedProfileError {
    pub const fn diagnostic_code(self) -> u64 {
        match self {
            Self::PredecessorRejected => 0x5721_01,
            Self::SourceObservationRejected => 0x5721_02,
            Self::ProfileDrift => 0x5721_03,
            Self::CandidateIdentityDrift => 0x5721_04,
            Self::RawIdentityDrift => 0x5721_05,
            Self::EvidenceIdentityDrift => 0x5721_06,
            Self::ImmutabilityDrift => 0x5721_07,
            Self::RawClassifierRejected => 0x5721_08,
            Self::RetainedObservationDrift => 0x5721_09,
            Self::NewObservationOverclaim => 0x5721_0a,
            Self::BoundaryOverclaim => 0x5721_0b,
            Self::PublishedStateDrift => 0x5721_0c,
        }
    }
}

fn identity_eq(left: G8lS572ArtifactIdentity, right: G8lS572ArtifactIdentity) -> bool {
    left == right
}

pub fn s572_fnv1a64(bytes: &[u8]) -> u64 {
    let mut digest = 0xcbf2_9ce4_8422_2325_u64;
    for byte in bytes {
        digest ^= u64::from(*byte);
        digest = digest.wrapping_mul(0x0000_0100_0000_01b3);
    }
    digest
}

pub fn service_s572_model_supported_profile_runtime_evidence_baseline(
    state: &mut G8lS572SupportedProfileState,
    observation: G8lS572SupportedProfileObservation<'_>,
    raw: &[u8],
) -> Result<G8lS572SupportedProfileOutcome, G8lS572SupportedProfileError> {
    if observation.predecessor_sequence != S572_EXPECTED_PREDECESSOR
        || !observation.predecessor_passed
    {
        return Err(G8lS572SupportedProfileError::PredecessorRejected);
    }
    if observation.source_observation_sequence != S572_SOURCE_OBSERVATION_SEQUENCE
        || observation.source_physical_status != S571_PHYSICAL_GATE_STATUS
    {
        return Err(G8lS572SupportedProfileError::SourceObservationRejected);
    }
    if observation.profile != S572_SUPPORTED_PROFILE
        || observation.target_arch != S572_TARGET_ARCH
        || observation.transport != S572_EVIDENCE_TRANSPORT
    {
        return Err(G8lS572SupportedProfileError::ProfileDrift);
    }
    if !identity_eq(
        observation.candidate,
        s572_identity(S572_CANDIDATE_IMAGE_BYTES, S572_CANDIDATE_IMAGE_SHA256),
    ) {
        return Err(G8lS572SupportedProfileError::CandidateIdentityDrift);
    }
    if raw.len() as u64 != S572_RAW_BYTES
        || s572_fnv1a64(raw) != S572_RAW_FNV1A64
        || !identity_eq(
            observation.raw,
            s572_identity(S572_RAW_BYTES, S572_RAW_SHA256),
        )
    {
        return Err(G8lS572SupportedProfileError::RawIdentityDrift);
    }
    if !identity_eq(
        observation.evidence_manifest,
        s572_identity(S572_EVIDENCE_MANIFEST_BYTES, S572_EVIDENCE_MANIFEST_SHA256),
    ) || !identity_eq(
        observation.closeout_log,
        s572_identity(S572_CLOSEOUT_LOG_BYTES, S572_CLOSEOUT_LOG_SHA256),
    ) {
        return Err(G8lS572SupportedProfileError::EvidenceIdentityDrift);
    }
    if observation.raw_mode_octal != S572_RAW_MODE_OCTAL
        || observation.raw_link_count != S572_RAW_LINK_COUNT
    {
        return Err(G8lS572SupportedProfileError::ImmutabilityDrift);
    }
    if classify_s571_raw(raw) != G8lS571PhysicalVerdict::Pass {
        return Err(G8lS572SupportedProfileError::RawClassifierRejected);
    }
    if observation.retained_runtime_baselines != S572_RETAINED_RUNTIME_BASELINES
        || observation.retained_physical_observations != S572_RETAINED_PHYSICAL_OBSERVATIONS
    {
        return Err(G8lS572SupportedProfileError::RetainedObservationDrift);
    }
    if observation.new_runtime_observations != S572_NEW_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS
        || observation.new_physical_observations != S572_NEW_PHYSICAL_OBSERVATIONS
        || observation.independent_physical_repeats != S572_INDEPENDENT_PHYSICAL_REPEATS
        || observation.physical_or_device_operations != S572_PHYSICAL_OR_DEVICE_OPERATIONS
    {
        return Err(G8lS572SupportedProfileError::NewObservationOverclaim);
    }
    if observation.visible_scanout_observed != S572_VISIBLE_SCANOUT_OBSERVED
        || observation.physical_input_observed != S572_PHYSICAL_INPUT_OBSERVED
        || observation.r2_field_acceptance_complete != S572_R2_FIELD_ACCEPTANCE_COMPLETE
    {
        return Err(G8lS572SupportedProfileError::BoundaryOverclaim);
    }

    let receipt = G8lS572SupportedProfileReceipt {
        sequence: S572_SEQUENCE,
        predecessor_sequence: observation.predecessor_sequence,
        status: S572_GATE_STATUS,
        acceptance_domain: S572_ACCEPTANCE_DOMAIN,
        source_observation_sequence: observation.source_observation_sequence,
        profile: S572_SUPPORTED_PROFILE,
        target_arch: S572_TARGET_ARCH,
        transport: S572_EVIDENCE_TRANSPORT,
        candidate: observation.candidate,
        raw: observation.raw,
        marker_counts: count_s571_markers(raw),
        retained_runtime_baselines: observation.retained_runtime_baselines,
        retained_physical_observations: observation.retained_physical_observations,
        new_runtime_observations: observation.new_runtime_observations,
        new_physical_observations: observation.new_physical_observations,
        independent_physical_repeats: observation.independent_physical_repeats,
        host_replay_validations: S572_HOST_REPLAY_VALIDATIONS,
        physical_or_device_operations: observation.physical_or_device_operations,
        boot_to_ui_baseline_retained: S572_BOOT_TO_UI_BASELINE_RETAINED,
        visible_scanout_observed: observation.visible_scanout_observed,
        physical_input_observed: observation.physical_input_observed,
        cross_profile_coverage_complete: S572_CROSS_PROFILE_COVERAGE_COMPLETE,
        repeatability_complete: S572_REPEATABILITY_COMPLETE,
        r2_field_acceptance_complete: observation.r2_field_acceptance_complete,
        runbook_executed: RUNBOOK_EXECUTED_IN_S572,
    };

    match state.receipt {
        None => {
            state.receipt = Some(receipt);
            Ok(G8lS572SupportedProfileOutcome::BaselineRecorded(receipt))
        }
        Some(existing) if existing == receipt => {
            Ok(G8lS572SupportedProfileOutcome::BaselineRetained(existing))
        }
        Some(_) => Err(G8lS572SupportedProfileError::PublishedStateDrift),
    }
}
snippet sha256: 698a706a546bfile sha256: 698a706a546b
02 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam dosyaL1–L459
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline.rs::S572 r2 supported profile runtime evidence baseline focused tests
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s571_r1_frozen_manifest_physical_boot_uart_run::{
    classify_s571_raw, G8lS571PhysicalVerdict, S571_PHYSICAL_GATE_STATUS,
};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline::*;
use sha2::{Digest, Sha256};
use std::collections::HashSet;
use std::fs;
use std::os::unix::fs::{MetadataExt, PermissionsExt};
use std::path::{Path, PathBuf};

const SOURCE: &str = include_str!(
    "../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline.rs"
);
const MAIN: &str = include_str!("../../kernel/src/main.rs");
const SIMULATION_LIB: &str = include_str!("../src/lib.rs");
const RAW: &[u8] =
    include_bytes!("../../evidence/rpi5/r1/sequence-571-physical-boot-uart/s571-uart.raw");
const MANIFEST: &[u8] =
    include_bytes!("../../evidence/rpi5/r1/sequence-571-physical-boot-uart/EVIDENCE_SHA256SUMS");
const CLOSEOUT: &[u8] =
    include_bytes!("../../evidence/rpi5/r1/sequence-571-physical-boot-uart/s571-run-closeout.log");
const EVIDENCE_README: &str =
    include_str!("../../evidence/rpi5/r1/sequence-571-physical-boot-uart/README.md");
const PACKAGE_IMAGE: &[u8] = include_bytes!(
    "../../evidence/rpi5/r1/sequence-570-candidate-freeze/package/aselsanos-rpi5.img"
);

fn repository_root() -> PathBuf {
    Path::new(env!("CARGO_MANIFEST_DIR")).join("..")
}

fn sha256(bytes: &[u8]) -> String {
    format!("{:x}", Sha256::digest(bytes))
}

fn observation() -> G8lS572SupportedProfileObservation<'static> {
    G8lS572SupportedProfileObservation {
        predecessor_sequence: 571,
        predecessor_passed: true,
        source_observation_sequence: 571,
        source_physical_status: S571_PHYSICAL_GATE_STATUS,
        profile: S572_SUPPORTED_PROFILE,
        target_arch: S572_TARGET_ARCH,
        transport: S572_EVIDENCE_TRANSPORT,
        candidate: s572_identity(S572_CANDIDATE_IMAGE_BYTES, S572_CANDIDATE_IMAGE_SHA256),
        raw: s572_identity(S572_RAW_BYTES, S572_RAW_SHA256),
        evidence_manifest: s572_identity(
            S572_EVIDENCE_MANIFEST_BYTES,
            S572_EVIDENCE_MANIFEST_SHA256,
        ),
        closeout_log: s572_identity(S572_CLOSEOUT_LOG_BYTES, S572_CLOSEOUT_LOG_SHA256),
        raw_mode_octal: S572_RAW_MODE_OCTAL,
        raw_link_count: S572_RAW_LINK_COUNT,
        retained_runtime_baselines: S572_RETAINED_RUNTIME_BASELINES,
        retained_physical_observations: S572_RETAINED_PHYSICAL_OBSERVATIONS,
        new_runtime_observations: S572_NEW_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS,
        new_physical_observations: S572_NEW_PHYSICAL_OBSERVATIONS,
        independent_physical_repeats: S572_INDEPENDENT_PHYSICAL_REPEATS,
        physical_or_device_operations: S572_PHYSICAL_OR_DEVICE_OPERATIONS,
        visible_scanout_observed: S572_VISIBLE_SCANOUT_OBSERVED,
        physical_input_observed: S572_PHYSICAL_INPUT_OBSERVED,
        r2_field_acceptance_complete: S572_R2_FIELD_ACCEPTANCE_COMPLETE,
    }
}

#[test]
fn sequence_profile_and_r2_boundary_are_exact() {
    assert_eq!(S572_SEQUENCE, 572);
    assert_eq!(S572_EXPECTED_PREDECESSOR, 571);
    assert_eq!(S572_R2_TRANSITION_FIRST, 572);
    assert_eq!(S572_R2_TRANSITION_LAST, 707);
    assert_eq!(S572_R2_WORKSTREAM_ORDINAL, 1);
    assert_eq!(S572_ACCEPTANCE_DOMAIN, "supported_profile_runtime_evidence");
    assert_eq!(S572_GATE_STATUS, "PASS");
    assert_eq!(S572_SUPPORTED_PROFILE, "board-rpi5");
    assert_eq!(S572_TARGET_ARCH, "aarch64");
    assert_eq!(S572_EVIDENCE_TRANSPORT, "uart-115200-8n1");
}

#[test]
fn retained_and_new_observation_counts_are_not_conflated() {
    assert_eq!(S572_RETAINED_RUNTIME_BASELINES, 1);
    assert_eq!(S572_RETAINED_PHYSICAL_OBSERVATIONS, 1);
    assert_eq!(S572_NEW_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS, 0);
    assert_eq!(S572_NEW_PHYSICAL_OBSERVATIONS, 0);
    assert_eq!(S572_INDEPENDENT_PHYSICAL_REPEATS, 0);
    assert_eq!(S572_HOST_REPLAY_VALIDATIONS, 1);
    assert_eq!(S572_PHYSICAL_OR_DEVICE_OPERATIONS, 0);
    assert_eq!(S572_SD_WRITES, 0);
    assert_eq!(S572_UART_OPENS, 0);
    assert_eq!(S572_POWER_TRANSITIONS, 0);
    assert_eq!(S572_NEW_IMMUTABLE_RAW_CAPTURES, 0);
    assert!(!RUNBOOK_EXECUTED_IN_S572);
}

#[test]
fn product_boundaries_remain_open() {
    assert!(S572_BOOT_TO_UI_BASELINE_RETAINED);
    assert!(!S572_VISIBLE_SCANOUT_OBSERVED);
    assert!(!S572_PHYSICAL_INPUT_OBSERVED);
    assert!(!S572_CROSS_PROFILE_COVERAGE_COMPLETE);
    assert!(!S572_REPEATABILITY_COMPLETE);
    assert!(!S572_R2_FIELD_ACCEPTANCE_COMPLETE);
    assert!(!S572_AUTOMATIC_PROMOTION);
}

#[test]
fn host_model_is_simulation_only_and_has_no_device_authority() {
    let module = "g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline";
    assert!(!MAIN.contains(module));
    assert_eq!(
        SIMULATION_LIB
            .matches(&format!("pub mod {module};"))
            .count(),
        1
    );
    for forbidden in [
        "unsafe {",
        "asm!(",
        "global_asm!(",
        "kprintln!(",
        "std::process",
        "diskutil",
        "TIOCEXCL",
        "tcsetattr",
        "File::create",
        "OpenOptions",
    ] {
        assert!(
            !SOURCE.contains(forbidden),
            "forbidden surface: {forbidden}"
        );
    }
}

#[test]
fn diagnostic_codes_are_unique_and_nonzero() {
    let errors = [
        G8lS572SupportedProfileError::PredecessorRejected,
        G8lS572SupportedProfileError::SourceObservationRejected,
        G8lS572SupportedProfileError::ProfileDrift,
        G8lS572SupportedProfileError::CandidateIdentityDrift,
        G8lS572SupportedProfileError::RawIdentityDrift,
        G8lS572SupportedProfileError::EvidenceIdentityDrift,
        G8lS572SupportedProfileError::ImmutabilityDrift,
        G8lS572SupportedProfileError::RawClassifierRejected,
        G8lS572SupportedProfileError::RetainedObservationDrift,
        G8lS572SupportedProfileError::NewObservationOverclaim,
        G8lS572SupportedProfileError::BoundaryOverclaim,
        G8lS572SupportedProfileError::PublishedStateDrift,
    ];
    let mut unique = HashSet::new();
    for code in errors
        .into_iter()
        .map(G8lS572SupportedProfileError::diagnostic_code)
    {
        assert_ne!(code, 0);
        assert!(unique.insert(code));
    }
    assert_eq!(unique.len(), 12);
}

#[test]
fn exact_s571_evidence_records_supported_profile_baseline() {
    let mut state = G8lS572SupportedProfileState::new();
    let G8lS572SupportedProfileOutcome::BaselineRecorded(receipt) =
        service_s572_model_supported_profile_runtime_evidence_baseline(
            &mut state,
            observation(),
            RAW,
        )
        .unwrap()
    else {
        panic!("first exact import must record baseline")
    };
    assert_eq!(receipt.sequence, 572);
    assert_eq!(receipt.predecessor_sequence, 571);
    assert_eq!(receipt.source_observation_sequence, 571);
    assert_eq!(receipt.profile, "board-rpi5");
    assert_eq!(receipt.target_arch, "aarch64");
    assert_eq!(receipt.transport, "uart-115200-8n1");
    assert_eq!(receipt.marker_counts.boot8g, 1);
    assert_eq!(receipt.marker_counts.boot8h, 1);
    assert_eq!(receipt.marker_counts.handoff, 1);
    assert_eq!(receipt.marker_counts.route, 1);
    assert_eq!(receipt.marker_counts.required, 1);
    assert_eq!(receipt.marker_counts.g8h_error, 0);
    assert_eq!(receipt.marker_counts.s541_error, 0);
    assert_eq!(receipt.marker_counts.s538_error, 0);
    assert_eq!(receipt.marker_counts.panic, 0);
    assert_eq!(receipt.marker_counts.unknown_irq, 0);
    assert_eq!(receipt.retained_runtime_baselines, 1);
    assert_eq!(receipt.retained_physical_observations, 1);
    assert_eq!(receipt.new_runtime_observations, 0);
    assert_eq!(receipt.new_physical_observations, 0);
    assert_eq!(receipt.independent_physical_repeats, 0);
    assert_eq!(receipt.host_replay_validations, 1);
    assert_eq!(receipt.physical_or_device_operations, 0);
    assert!(receipt.boot_to_ui_baseline_retained);
    assert!(!receipt.visible_scanout_observed);
    assert!(!receipt.physical_input_observed);
    assert!(!receipt.cross_profile_coverage_complete);
    assert!(!receipt.repeatability_complete);
    assert!(!receipt.r2_field_acceptance_complete);
    assert!(!receipt.runbook_executed);
    assert_eq!(state.receipt(), Some(receipt));
}

#[test]
fn exact_replay_is_idempotent_and_not_counted_as_physical_repeat() {
    let mut state = G8lS572SupportedProfileState::new();
    let G8lS572SupportedProfileOutcome::BaselineRecorded(receipt) =
        service_s572_model_supported_profile_runtime_evidence_baseline(
            &mut state,
            observation(),
            RAW,
        )
        .unwrap()
    else {
        panic!("first record")
    };
    assert_eq!(
        service_s572_model_supported_profile_runtime_evidence_baseline(
            &mut state,
            observation(),
            RAW,
        ),
        Ok(G8lS572SupportedProfileOutcome::BaselineRetained(receipt))
    );
    assert_eq!(receipt.independent_physical_repeats, 0);
    assert_eq!(receipt.new_physical_observations, 0);
}

#[test]
fn predecessor_and_source_status_drift_fail_closed() {
    let cases = [
        (0usize, G8lS572SupportedProfileError::PredecessorRejected),
        (1, G8lS572SupportedProfileError::PredecessorRejected),
        (2, G8lS572SupportedProfileError::SourceObservationRejected),
        (3, G8lS572SupportedProfileError::SourceObservationRejected),
    ];
    for (case, expected) in cases {
        let mut observed = observation();
        match case {
            0 => observed.predecessor_sequence = 570,
            1 => observed.predecessor_passed = false,
            2 => observed.source_observation_sequence = 570,
            3 => observed.source_physical_status = "RED",
            _ => unreachable!(),
        }
        let mut state = G8lS572SupportedProfileState::new();
        assert_eq!(
            service_s572_model_supported_profile_runtime_evidence_baseline(
                &mut state, observed, RAW,
            ),
            Err(expected)
        );
        assert_eq!(state.receipt(), None);
    }
}

#[test]
fn profile_transport_drift_fails_closed() {
    for case in 0..3 {
        let mut observed = observation();
        match case {
            0 => observed.profile = "board-qemu",
            1 => observed.target_arch = "x86_64",
            2 => observed.transport = "synthetic-host-log",
            _ => unreachable!(),
        }
        let mut state = G8lS572SupportedProfileState::new();
        assert_eq!(
            service_s572_model_supported_profile_runtime_evidence_baseline(
                &mut state, observed, RAW,
            ),
            Err(G8lS572SupportedProfileError::ProfileDrift)
        );
    }
}

#[test]
fn candidate_raw_and_evidence_identity_drift_fail_closed() {
    let cases = [
        (0usize, G8lS572SupportedProfileError::CandidateIdentityDrift),
        (1, G8lS572SupportedProfileError::RawIdentityDrift),
        (2, G8lS572SupportedProfileError::EvidenceIdentityDrift),
        (3, G8lS572SupportedProfileError::EvidenceIdentityDrift),
    ];
    for (case, expected) in cases {
        let mut observed = observation();
        match case {
            0 => observed.candidate.bytes += 1,
            1 => observed.raw.sha256 = S572_CANDIDATE_IMAGE_SHA256,
            2 => observed.evidence_manifest.bytes += 1,
            3 => observed.closeout_log.sha256 = S572_RAW_SHA256,
            _ => unreachable!(),
        }
        let mut state = G8lS572SupportedProfileState::new();
        assert_eq!(
            service_s572_model_supported_profile_runtime_evidence_baseline(
                &mut state, observed, RAW,
            ),
            Err(expected)
        );
    }
}

#[test]
fn raw_immutability_metadata_drift_fails_closed() {
    for case in 0..2 {
        let mut observed = observation();
        match case {
            0 => observed.raw_mode_octal = "0644",
            1 => observed.raw_link_count = 2,
            _ => unreachable!(),
        }
        let mut state = G8lS572SupportedProfileState::new();
        assert_eq!(
            service_s572_model_supported_profile_runtime_evidence_baseline(
                &mut state, observed, RAW,
            ),
            Err(G8lS572SupportedProfileError::ImmutabilityDrift)
        );
    }
}

#[test]
fn altered_raw_bytes_fail_before_publication() {
    let mut altered = RAW.to_vec();
    altered[100] ^= 0x01;
    assert_ne!(s572_fnv1a64(&altered), S572_RAW_FNV1A64);
    let mut state = G8lS572SupportedProfileState::new();
    assert_eq!(
        service_s572_model_supported_profile_runtime_evidence_baseline(
            &mut state,
            observation(),
            &altered,
        ),
        Err(G8lS572SupportedProfileError::RawIdentityDrift)
    );
    assert_eq!(state.receipt(), None);
}

#[test]
fn retained_count_drift_and_new_observation_overclaims_fail_closed() {
    let mut retained = observation();
    retained.retained_runtime_baselines = 0;
    let mut state = G8lS572SupportedProfileState::new();
    assert_eq!(
        service_s572_model_supported_profile_runtime_evidence_baseline(&mut state, retained, RAW,),
        Err(G8lS572SupportedProfileError::RetainedObservationDrift)
    );

    for case in 0..4 {
        let mut observed = observation();
        match case {
            0 => observed.new_runtime_observations = 1,
            1 => observed.new_physical_observations = 1,
            2 => observed.independent_physical_repeats = 1,
            3 => observed.physical_or_device_operations = 1,
            _ => unreachable!(),
        }
        let mut state = G8lS572SupportedProfileState::new();
        assert_eq!(
            service_s572_model_supported_profile_runtime_evidence_baseline(
                &mut state, observed, RAW,
            ),
            Err(G8lS572SupportedProfileError::NewObservationOverclaim)
        );
    }
}

#[test]
fn scanout_input_and_field_acceptance_overclaims_fail_closed() {
    for case in 0..3 {
        let mut observed = observation();
        match case {
            0 => observed.visible_scanout_observed = true,
            1 => observed.physical_input_observed = true,
            2 => observed.r2_field_acceptance_complete = true,
            _ => unreachable!(),
        }
        let mut state = G8lS572SupportedProfileState::new();
        assert_eq!(
            service_s572_model_supported_profile_runtime_evidence_baseline(
                &mut state, observed, RAW,
            ),
            Err(G8lS572SupportedProfileError::BoundaryOverclaim)
        );
    }
}

#[test]
fn real_candidate_raw_manifest_and_closeout_identities_are_exact() {
    assert_eq!(PACKAGE_IMAGE.len() as u64, S572_CANDIDATE_IMAGE_BYTES);
    assert_eq!(sha256(PACKAGE_IMAGE), S572_CANDIDATE_IMAGE_SHA256);
    assert_eq!(RAW.len() as u64, S572_RAW_BYTES);
    assert_eq!(sha256(RAW), S572_RAW_SHA256);
    assert_eq!(s572_fnv1a64(RAW), S572_RAW_FNV1A64);
    assert_eq!(MANIFEST.len() as u64, S572_EVIDENCE_MANIFEST_BYTES);
    assert_eq!(sha256(MANIFEST), S572_EVIDENCE_MANIFEST_SHA256);
    assert_eq!(CLOSEOUT.len() as u64, S572_CLOSEOUT_LOG_BYTES);
    assert_eq!(sha256(CLOSEOUT), S572_CLOSEOUT_LOG_SHA256);
    assert_eq!(classify_s571_raw(RAW), G8lS571PhysicalVerdict::Pass);
}

#[test]
fn evidence_manifest_rehashes_all_seven_retained_artifacts() {
    let evidence_directory =
        repository_root().join("evidence/rpi5/r1/sequence-571-physical-boot-uart");
    let manifest = std::str::from_utf8(MANIFEST).unwrap();
    let mut names = HashSet::new();
    let mut entries = 0;
    for line in manifest.lines() {
        let (expected, name) = line.split_once("  ").expect("sha256sum line");
        assert_eq!(expected.len(), 64);
        assert!(names.insert(name));
        let bytes = fs::read(evidence_directory.join(name)).unwrap();
        assert_eq!(sha256(&bytes), expected, "manifest drift: {name}");
        entries += 1;
    }
    assert_eq!(entries, 7);
}

#[test]
fn retained_raw_is_regular_read_only_single_link_file() {
    let path =
        repository_root().join("evidence/rpi5/r1/sequence-571-physical-boot-uart/s571-uart.raw");
    let metadata = fs::symlink_metadata(path).unwrap();
    assert!(metadata.file_type().is_file());
    assert!(!metadata.file_type().is_symlink());
    assert_eq!(metadata.permissions().mode() & 0o777, 0o444);
    assert_eq!(metadata.nlink(), 1);
}

#[test]
fn historical_evidence_declares_pass_and_honest_nonclaims() {
    for required in [
        "Physical gate status: PASS",
        "RERUN_FORBIDDEN=YES",
        "SCANOUT=NOT_OBSERVED",
        "INPUT=NOT_OBSERVED",
        "Overall R1 product acceptance: not complete",
    ] {
        assert!(EVIDENCE_README.contains(required), "{required}");
    }
    let closeout = std::str::from_utf8(CLOSEOUT).unwrap();
    for required in [
        "PHYSICAL_GATE_VERDICT=PASS",
        "VISIBLE_SCANOUT_OBSERVED=NO",
        "PHYSICAL_INPUT_OBSERVED=NO",
        "R1_OVERALL_ACCEPTANCE_COMPLETE=NO",
        "POWER_TRANSITIONS_INDEPENDENTLY_OBSERVED=0",
    ] {
        assert!(closeout.contains(required), "{required}");
    }
}
snippet sha256: 9fd817e1d50bfile sha256: 9fd817e1d50b
03 · Kapı kimlik kaydı

Operations sıra, kimlik ve başlık bağı

tam Operations kaydıL1550–L1631
website/src/lib/operations.ts::g8l-s572-r2-supported-profile-runtime-evidence-baseline
  {
    id: "g8l-s572-r2-supported-profile-runtime-evidence-baseline",
    date: "2026-08-31",
    sequence: 572,
    status: "passed",
    umbrella_status: "partial",
    title: "S572 · R2 supported-profile runtime kanıtı baseline kaydı",
    summary:
      "S572 dar kapısı PASS'tir. S571'in tek-seferlik fiziksel Raspberry Pi 5 UART PASS kaydı, board-rpi5/aarch64/uart-115200-8n1 supported-profile runtime baseline'ı olarak salt-okunur içeri alındı. Exact S570 image, 20947 B raw, yedi girdili evidence manifesti, closeout ve gerçek marker matrisi tekrar doğrulandı. S572 yeni SD/UART/güç işlemi veya fiziksel gözlem yapmadı; host replay bağımsız fiziksel tekrar sayılmadığı için repeatability, cross-profile coverage, görünür scanout/input ve R2 saha kabulü false kalır.",
    evidence: [
      "S572 R1→R2 geçişinin 1. iş alanını açar: acceptance domain=supported_profile_runtime_evidence, profile=board-rpi5, arch=aarch64 ve transport=uart-115200-8n1.",
      "Kaynak gözlem S571 physical PASS'tir; retained runtime baseline/physical observation=1/1, S572 new runtime/physical observation=0/0'dır.",
      "Exact candidate 945920 B / a24f4d24e838cd7d1a6b2ff217d864e9c4b08f12ce7dd165b302e8073a980b04 olarak korunur.",
      "Exact raw 20947 B / 8eba34fcd970d7b5dd276690013b5513ec426020c915356d98d6e5bf0b4e1c83 / FNV-1a64 0xdd63b3898666dc73 / mode 0444 / nlink=1 olarak yeniden doğrulandı.",
      "EVIDENCE_SHA256SUMS 606 B / 7887075a7c152e6491cc6fd520179efd9b92a0aa73f0a05331f55d98e796c5d3 ve yedi girdinin tamamı bağımsız tekrar hashlenerek PASS verdi.",
      "Closeout 1319 B / 1b3557cb63999d7b98073392cbfeea16cc6739e3cde02a03c977bcf39ba7cdad kimliğine bağlıdır; S571 RERUN_FORBIDDEN=YES sınırı korunur.",
      "Gerçek raw matrisi BOOT8G/BOOT8H/S541 handoff/S538 route/BOOT_TO_UI_READY=1/1/1/1/1; G8HERR/S541ERR/S538ERR/panic/unknown-IRQ=0/0/0/0/0'dır.",
      "Focused test 1 grup / 18 passed / 0 failed / 0 ignored / 0 filtered verdi.",
      "Implementation 13627 B / 698a706a546b468f5dc213b04dd748b6ffdd2abd867c8943cbe93e102b15d99d; focused test 17514 B / 9fd817e1d50b59962309fb77da130cf7cc082a35d94ccd4711d2a5965cf208d5; proof 4355 B / f7c6f009efd5255967dd34865bdfd063a139560d3c86948ec232428b6568f5be SHA-256'dır.",
      "physical/device operations=0; SD/UART/power/new-raw=0/0/0/0 ve RUNBOOK_EXECUTED_IN_S572=NO'dur.",
      "Independent physical repeats=0, cross-profile coverage=false, repeatability=false, visible scanout/input=false/false, R2 field acceptance=false ve automatic promotion=false'dur.",
    ],
    commands: [
      "CARGO_INCREMENTAL=0 cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline -- --test-threads=1",
      "shasum -a 256 evidence/rpi5/r1/sequence-571-physical-boot-uart/s571-uart.raw",
      "cd evidence/rpi5/r1/sequence-571-physical-boot-uart && shasum -a 256 -c EVIDENCE_SHA256SUMS",
      "python3 scripts/render-project-status.py --check",
      "node website/scripts/generate-code-gates.mjs --check",
    ],
    terminalSessions: [
      {
        id: "s572-focused",
        title: "S572 supported-profile baseline focused kabulü",
        commandLines: [
          "CARGO_INCREMENTAL=0 cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline -- --test-threads=1",
        ],
        outputLines: [
          "test result: ok. 18 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out",
          "retained runtime/physical=1/1; new runtime/physical=0/0; physical/device operations=0",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
      {
        id: "s572-read-only-evidence-replay",
        title: "S572 S571 kanıt zinciri salt-okunur replay",
        commandLines: [
          "shasum -a 256 evidence/rpi5/r1/sequence-571-physical-boot-uart/s571-uart.raw",
          "cd evidence/rpi5/r1/sequence-571-physical-boot-uart && shasum -a 256 -c EVIDENCE_SHA256SUMS",
        ],
        outputLines: [
          "raw=20947 B / 8eba34fcd970d7b5dd276690013b5513ec426020c915356d98d6e5bf0b4e1c83 / mode=0444 / nlink=1",
          "EVIDENCE_SHA256SUMS: 7/7 PASS",
          "host replay validations=1; independent physical repeats=0",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
      {
        id: "s572-manifest-publication",
        title: "S572 manifest ve Code/Operations yerel yayın bağı",
        commandLines: [
          "python3 scripts/render-project-status.py --check",
          "node website/scripts/generate-code-gates.mjs --check",
        ],
        outputLines: [
          "project status renderer: PASS",
          "S572 source + focused test + proof + Operations record: exact identity-bound",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
    ],
    limitations: [
      "S572 yeni bir fiziksel koşu değildir; S571 raw'ını ve provenance zincirini salt-okunur taşır.",
      "Aynı immutable raw'ın yeniden hashlenmesi bağımsız cihaz tekrarı veya uzun soak kanıtı değildir.",
      "S571 retained one-shot lock değişmez ve yeniden kullanılamaz.",
      "Visible scanout ve physical input gözlenmemiştir; ekran/touch PASS iddiası yoktur.",
      "Cross-profile coverage, repeatability ve R2 field acceptance tamamlanmamıştır.",
      "RUNBOOK_EXECUTED_IN_S572=NO; physical/device operations=0.",
    ],
  },
snippet sha256: c631bfcdb1ddfile sha256: 9726dbf00f84
Focused test komutu
CARGO_INCREMENTAL=0 cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s572_r2_supported_profile_runtime_evidence_baseline -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S572-R2-Supported-Profile-Runtime-Evidence-Baseline-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 3050638b71a684d8f8f947a8a6faa237a17fa8db5dc0db04fb207b668b462af9