ASELSANMicrokernel
S708 · SOURCE-BOUND GATE EVIDENCE

S708 · Üretim platformu ve izolasyon · Kabul sözleşmesi kaydı

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

S708Focused kod testiOperations id exactsource SHA exacttest target exact

operation: g8l-s708-r2-production-platform-isolation-contract-partial

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–L555
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s708_r2_production_platform_isolation_contract.rs::S708 r2 production platform isolation contract implementation
#![allow(unexpected_cfgs)]
#![allow(dead_code)]

//! S708 starts the S708-S899 product-acceptance readiness ledger.
//!
//! Three published release tracks share this one fail-closed ledger: the R2
//! secure field phone (S708-S758), the R2 -> R3 widening transition
//! (S759-S836) and the R3 broad consumer ecosystem (S837-S899).
//!
//! The chain tip is S707, the terminal gate of the S576-S707 R2
//! field-acceptance range.  Everything this range stands on is carried
//! read-only: the two retained physical observations (S571 and S575) are
//! copied, never re-earned, and R2 field acceptance stays false.
//!
//! Every gate in the range is a simulation-only acceptance model.  After the
//! S546 root cause (a never-executed CPU1 ledger silently blocking the
//! physical boot path) and the S569 decoupling remediation, no module here is
//! linked into the board-rpi5 kernel and none adds a production callsite.  A
//! receipt never claims a new runtime or physical observation, never claims
//! operator or external acceptance, and never completes a release track.

use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s576_r2_scheduler_exclusion_runtime_contract::{
    S576_EVIDENCE_TRANSPORT, S576_RETAINED_PHYSICAL_OBSERVATIONS,
    S576_RETAINED_RUNTIME_BASELINES, S576_SUPPORTED_PROFILE, S576_TARGET_ARCH,
    S576_TO_S707_LINKED_INTO_BOARD_RPI5, S576_TO_S707_R2_FIELD_ACCEPTANCE_COMPLETE,
};
use crate::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s707_r2_field_acceptance_matrix_field_release_boundary::{
    RUNBOOK_EXECUTED_IN_S707, S707_ACCEPTANCE_COMPLETE, S707_SEQUENCE,
};

pub const S708_FIRST_SEQUENCE: usize = 708;
pub const S899_LAST_SEQUENCE: usize = 899;
pub const S708_TO_S899_GATE_COUNT: usize = S899_LAST_SEQUENCE - S708_FIRST_SEQUENCE + 1;
pub const S708_TO_S899_BLOCK_COUNT: usize = 19;
pub const S708_TARGET_CPU: usize = 1;
pub const S708_CHAIN_TIP_SEQUENCE: usize = S707_SEQUENCE;
pub const S708_TO_S899_LINKED_INTO_BOARD_RPI5: bool = false;
pub const S708_TO_S899_PRODUCTION_CALLSITES: usize = 0;
pub const S708_SUPPORTED_PROFILE: &str = S576_SUPPORTED_PROFILE;
pub const S708_TARGET_ARCH: &str = S576_TARGET_ARCH;
pub const S708_EVIDENCE_TRANSPORT: &str = S576_EVIDENCE_TRANSPORT;

pub const S708_TRACK_R2_FIRST: usize = 708;
pub const S708_TRACK_R2_LAST: usize = 758;
pub const S708_TRACK_R2_TO_R3_FIRST: usize = 759;
pub const S708_TRACK_R2_TO_R3_LAST: usize = 836;
pub const S708_TRACK_R3_FIRST: usize = 837;
pub const S708_TRACK_R3_LAST: usize = 899;

/// Read-only carry of what the S571 and S575 physical runs established.  No
/// gate in this range re-earns, extends or re-counts them.
pub const S708_RETAINED_RUNTIME_BASELINES: usize = S576_RETAINED_RUNTIME_BASELINES;
pub const S708_RETAINED_PHYSICAL_OBSERVATIONS: usize = S576_RETAINED_PHYSICAL_OBSERVATIONS;

/// What remains explicitly unfinished at the chain tip and must not be
/// silently promoted anywhere in this range.
pub const S708_R2_FIELD_ACCEPTANCE_COMPLETE: bool = S576_TO_S707_R2_FIELD_ACCEPTANCE_COMPLETE;
pub const S708_CHAIN_TIP_ACCEPTANCE_COMPLETE: bool = S707_ACCEPTANCE_COMPLETE;
pub const S708_CHAIN_TIP_LINKED_INTO_BOARD_RPI5: bool = S576_TO_S707_LINKED_INTO_BOARD_RPI5;
pub const S708_CHAIN_TIP_RUNBOOK_EXECUTED: bool = RUNBOOK_EXECUTED_IN_S707;

pub const S708_ACCEPTANCE_DOMAINS: [&str; S708_TO_S899_BLOCK_COUNT] = [
    "production_platform_isolation",
    "field_phone_functions_resilience",
    "trust_chain_data_protection",
    "ab_ota_recovery_key_lifecycle",
    "mdm_manufacturing_field_operations",
    "acceptance_certification_closeout",
    "wide_sdk_third_party_apps",
    "wifi_bluetooth_accessories",
    "camera_sensor_gpu_isp_media",
    "accessibility_localization",
    "regional_operator_device_matrix",
    "field_operations_product_family_scale",
    "sdk_abi_developer_platform",
    "third_party_app_ecosystem",
    "wireless_accessory_classes",
    "camera_sensor_gpu_isp_pipeline",
    "accessibility_localization_coverage",
    "regional_operator_device_compatibility",
    "product_family_operations_scale",
];

pub const S708_TRACKS: [&str; S708_TO_S899_BLOCK_COUNT] = [
    "R2", "R2", "R2", "R2", "R2", "R2", "R2->R3", "R2->R3", "R2->R3", "R2->R3", "R2->R3", "R2->R3",
    "R3", "R3", "R3", "R3", "R3", "R3", "R3",
];

pub const S708_PHASE_LABELS: [&str; S708_TO_S899_BLOCK_COUNT] = [
    "R2.1", "R2.2", "R2.3", "R2.4", "R2.5", "R2.6", "T1", "T2", "T3", "T4", "T5", "T6", "R3.1",
    "R3.2", "R3.3", "R3.4", "R3.5", "R3.6", "R3.7",
];

pub const S708_STEPS_BY_BLOCK: [usize; S708_TO_S899_BLOCK_COUNT] = [
    8, 8, 8, 7, 7, 13, 13, 13, 13, 13, 13, 13, 9, 9, 9, 9, 9, 9, 9,
];

pub const S708_EXTERNAL_AUTHORITY_REQUIRED_BY_BLOCK: [bool; S708_TO_S899_BLOCK_COUNT] = [
    false, true, true, false, true, true, false, true, false, false, true, true, false, false,
    true, false, false, true, true,
];

/// Every block in every track ultimately needs its own physical observation.
pub const S708_PHYSICAL_EVIDENCE_REQUIRED_BY_BLOCK: [bool; S708_TO_S899_BLOCK_COUNT] =
    [true; S708_TO_S899_BLOCK_COUNT];

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lProductAcceptanceStep {
    ContractRegistration,
    InstrumentationBinding,
    ProviderPreflight,
    BoundedModelCallsite,
    FaultMatrixRegistration,
    MissingObservationJournal,
    FailClosedReconciliation,
    OpenBoundaryPublication,
    CrossProfileRegressionGuard,
    RepeatCampaignDefinition,
    LongSoakCampaignDefinition,
    OperatorAcceptanceBinding,
    IndependentAssessmentBinding,
}

impl G8lProductAcceptanceStep {
    pub const fn ordinal(self) -> usize {
        match self {
            Self::ContractRegistration => 1,
            Self::InstrumentationBinding => 2,
            Self::ProviderPreflight => 3,
            Self::BoundedModelCallsite => 4,
            Self::FaultMatrixRegistration => 5,
            Self::MissingObservationJournal => 6,
            Self::FailClosedReconciliation => 7,
            Self::OpenBoundaryPublication => 8,
            Self::CrossProfileRegressionGuard => 9,
            Self::RepeatCampaignDefinition => 10,
            Self::LongSoakCampaignDefinition => 11,
            Self::OperatorAcceptanceBinding => 12,
            Self::IndependentAssessmentBinding => 13,
        }
    }

    pub const fn slug(self) -> &'static str {
        match self {
            Self::ContractRegistration => "contract",
            Self::InstrumentationBinding => "instrumentation",
            Self::ProviderPreflight => "preflight",
            Self::BoundedModelCallsite => "callsite",
            Self::FaultMatrixRegistration => "fault_matrix",
            Self::MissingObservationJournal => "journal",
            Self::FailClosedReconciliation => "reconciliation",
            Self::OpenBoundaryPublication => "boundary",
            Self::CrossProfileRegressionGuard => "regression_guard",
            Self::RepeatCampaignDefinition => "repeat_campaign",
            Self::LongSoakCampaignDefinition => "long_soak",
            Self::OperatorAcceptanceBinding => "operator_acceptance",
            Self::IndependentAssessmentBinding => "independent_assessment",
        }
    }
}

const fn step_for(index: usize) -> G8lProductAcceptanceStep {
    match index {
        0 => G8lProductAcceptanceStep::ContractRegistration,
        1 => G8lProductAcceptanceStep::InstrumentationBinding,
        2 => G8lProductAcceptanceStep::ProviderPreflight,
        3 => G8lProductAcceptanceStep::BoundedModelCallsite,
        4 => G8lProductAcceptanceStep::FaultMatrixRegistration,
        5 => G8lProductAcceptanceStep::MissingObservationJournal,
        6 => G8lProductAcceptanceStep::FailClosedReconciliation,
        7 => G8lProductAcceptanceStep::OpenBoundaryPublication,
        8 => G8lProductAcceptanceStep::CrossProfileRegressionGuard,
        9 => G8lProductAcceptanceStep::RepeatCampaignDefinition,
        10 => G8lProductAcceptanceStep::LongSoakCampaignDefinition,
        11 => G8lProductAcceptanceStep::OperatorAcceptanceBinding,
        _ => G8lProductAcceptanceStep::IndependentAssessmentBinding,
    }
}

const fn block_position(offset: usize) -> Option<(usize, usize)> {
    let mut block = 0;
    let mut consumed = 0;
    while block < S708_TO_S899_BLOCK_COUNT {
        let steps = S708_STEPS_BY_BLOCK[block];
        if offset < consumed + steps {
            return Some((block, offset - consumed));
        }
        consumed += steps;
        block += 1;
    }
    None
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lProductAcceptanceGateDescriptor {
    pub sequence: usize,
    pub predecessor_sequence: usize,
    pub track: &'static str,
    pub phase: &'static str,
    pub block_ordinal: usize,
    pub block_step_count: usize,
    pub step_ordinal: usize,
    pub acceptance_domain: &'static str,
    pub step: G8lProductAcceptanceStep,
    pub runtime_evidence_required: bool,
    pub physical_evidence_required: bool,
    pub external_authority_required: bool,
}

pub const fn canonical_s708_to_s899_acceptance_descriptor(
    sequence: usize,
) -> Option<G8lProductAcceptanceGateDescriptor> {
    if sequence < S708_FIRST_SEQUENCE || sequence > S899_LAST_SEQUENCE {
        return None;
    }
    let Some((block_index, step_index)) = block_position(sequence - S708_FIRST_SEQUENCE) else {
        return None;
    };
    Some(G8lProductAcceptanceGateDescriptor {
        sequence,
        predecessor_sequence: sequence - 1,
        track: S708_TRACKS[block_index],
        phase: S708_PHASE_LABELS[block_index],
        block_ordinal: block_index + 1,
        block_step_count: S708_STEPS_BY_BLOCK[block_index],
        step_ordinal: step_index + 1,
        acceptance_domain: S708_ACCEPTANCE_DOMAINS[block_index],
        step: step_for(step_index),
        runtime_evidence_required: true,
        physical_evidence_required: S708_PHYSICAL_EVIDENCE_REQUIRED_BY_BLOCK[block_index],
        external_authority_required: S708_EXTERNAL_AUTHORITY_REQUIRED_BY_BLOCK[block_index],
    })
}

/// The exact S707 chain-tip facts this range is allowed to stand on.
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lProductAcceptanceAnchor {
    pub chain_tip_sequence: usize,
    pub supported_profile: &'static str,
    pub target_arch: &'static str,
    pub evidence_transport: &'static str,
    pub retained_runtime_baselines: usize,
    pub retained_physical_observations: usize,
    pub linked_into_board_rpi5: bool,
    pub r2_field_acceptance_complete: bool,
    pub chain_tip_acceptance_complete: bool,
    pub chain_tip_runbook_executed: bool,
}

pub const S708_CANONICAL_ANCHOR: G8lProductAcceptanceAnchor = G8lProductAcceptanceAnchor {
    chain_tip_sequence: S708_CHAIN_TIP_SEQUENCE,
    supported_profile: S708_SUPPORTED_PROFILE,
    target_arch: S708_TARGET_ARCH,
    evidence_transport: S708_EVIDENCE_TRANSPORT,
    retained_runtime_baselines: S708_RETAINED_RUNTIME_BASELINES,
    retained_physical_observations: S708_RETAINED_PHYSICAL_OBSERVATIONS,
    linked_into_board_rpi5: S708_CHAIN_TIP_LINKED_INTO_BOARD_RPI5,
    r2_field_acceptance_complete: S708_R2_FIELD_ACCEPTANCE_COMPLETE,
    chain_tip_acceptance_complete: S708_CHAIN_TIP_ACCEPTANCE_COMPLETE,
    chain_tip_runbook_executed: S708_CHAIN_TIP_RUNBOOK_EXECUTED,
};

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lProductAcceptanceReceipt {
    pub sequence: usize,
    pub predecessor_sequence: usize,
    pub track: &'static str,
    pub phase: &'static str,
    pub block_ordinal: usize,
    pub step_ordinal: usize,
    pub acceptance_domain: &'static str,
    pub chain_tip_sequence: usize,
    pub retained_runtime_baselines: usize,
    pub retained_physical_observations: usize,
    pub completed_block_count: usize,
    pub source_gate_complete: bool,
    pub runtime_evidence_required: bool,
    pub physical_evidence_required: bool,
    pub external_authority_required: bool,
    pub new_supported_profile_runtime_observations: usize,
    pub new_physical_observations: usize,
    pub operator_authority_received: bool,
    pub external_authority_received: bool,
    pub linked_into_board_rpi5: bool,
    pub cross_profile_coverage_complete: bool,
    pub acceptance_complete: bool,
    pub r2_field_acceptance_complete: bool,
    pub release_track_complete: bool,
    pub runbook_executed: bool,
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct G8lProductAcceptanceLedgerSnapshot {
    pub chain_tip_sequence: usize,
    pub last_completed_sequence: usize,
    pub completed_block_count: usize,
    pub retained_runtime_baselines: usize,
    pub retained_physical_observations: usize,
    pub new_supported_profile_runtime_observations: usize,
    pub new_physical_observations: usize,
    pub operator_authorizations: usize,
    pub external_acceptances: usize,
    pub r2_field_acceptance_complete: bool,
    pub r3_ecosystem_acceptance_complete: bool,
}

#[derive(Debug)]
pub struct G8lProductAcceptanceLedger {
    chain_tip_sequence: usize,
    retained_runtime_baselines: usize,
    retained_physical_observations: usize,
    last_completed_sequence: usize,
    completed_block_count: usize,
    last_receipt: Option<G8lProductAcceptanceReceipt>,
}

impl G8lProductAcceptanceLedger {
    pub fn from_s707(
        caller_cpu: usize,
        anchor: G8lProductAcceptanceAnchor,
    ) -> Result<Self, G8lProductAcceptanceError> {
        if caller_cpu != S708_TARGET_CPU {
            return Err(G8lProductAcceptanceError::WrongCpu);
        }
        if anchor.r2_field_acceptance_complete
            || anchor.chain_tip_acceptance_complete
            || anchor.linked_into_board_rpi5
            || anchor.chain_tip_runbook_executed
        {
            return Err(G8lProductAcceptanceError::PrematureAcceptanceClaim);
        }
        if anchor.chain_tip_sequence != S708_CHAIN_TIP_SEQUENCE
            || !str_eq(anchor.supported_profile, S708_SUPPORTED_PROFILE)
            || !str_eq(anchor.target_arch, S708_TARGET_ARCH)
            || !str_eq(anchor.evidence_transport, S708_EVIDENCE_TRANSPORT)
            || anchor.retained_runtime_baselines != S708_RETAINED_RUNTIME_BASELINES
            || anchor.retained_physical_observations != S708_RETAINED_PHYSICAL_OBSERVATIONS
        {
            return Err(G8lProductAcceptanceError::ChainTipDrift);
        }
        Ok(Self {
            chain_tip_sequence: anchor.chain_tip_sequence,
            retained_runtime_baselines: anchor.retained_runtime_baselines,
            retained_physical_observations: anchor.retained_physical_observations,
            last_completed_sequence: S708_CHAIN_TIP_SEQUENCE,
            completed_block_count: 0,
            last_receipt: None,
        })
    }

    pub const fn chain_tip_sequence(&self) -> usize {
        self.chain_tip_sequence
    }

    pub const fn last_completed_sequence(&self) -> usize {
        self.last_completed_sequence
    }

    pub const fn completed_block_count(&self) -> usize {
        self.completed_block_count
    }

    pub const fn last_receipt(&self) -> Option<G8lProductAcceptanceReceipt> {
        self.last_receipt
    }

    pub const fn snapshot(&self) -> G8lProductAcceptanceLedgerSnapshot {
        G8lProductAcceptanceLedgerSnapshot {
            chain_tip_sequence: self.chain_tip_sequence,
            last_completed_sequence: self.last_completed_sequence,
            completed_block_count: self.completed_block_count,
            retained_runtime_baselines: self.retained_runtime_baselines,
            retained_physical_observations: self.retained_physical_observations,
            new_supported_profile_runtime_observations: 0,
            new_physical_observations: 0,
            operator_authorizations: 0,
            external_acceptances: 0,
            r2_field_acceptance_complete: false,
            r3_ecosystem_acceptance_complete: false,
        }
    }
}

const fn str_eq(left: &str, right: &str) -> bool {
    let left = left.as_bytes();
    let right = right.as_bytes();
    if left.len() != right.len() {
        return false;
    }
    let mut index = 0;
    while index < left.len() {
        if left[index] != right[index] {
            return false;
        }
        index += 1;
    }
    true
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lProductAcceptanceError {
    WrongCpu,
    ChainTipDrift,
    PrematureAcceptanceClaim,
    SequenceOutOfRange,
    DescriptorDrift,
}

impl G8lProductAcceptanceError {
    pub const fn diagnostic_code(self) -> u64 {
        match self {
            Self::WrongCpu => 0x5378_01,
            Self::ChainTipDrift => 0x5378_02,
            Self::PrematureAcceptanceClaim => 0x5378_03,
            Self::SequenceOutOfRange => 0x5378_04,
            Self::DescriptorDrift => 0x5378_05,
        }
    }
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lProductAcceptanceOutcome {
    AwaitingS707,
    AwaitingPredecessor {
        sequence: usize,
        expected_predecessor: usize,
        observed_predecessor: usize,
    },
    Advanced(G8lProductAcceptanceReceipt),
    Retained(G8lProductAcceptanceReceipt),
    AlreadyCompleted {
        requested_sequence: usize,
        last_completed_sequence: usize,
    },
}

pub fn advance_s708_to_s899_model_acceptance_gate(
    ledger: &mut G8lProductAcceptanceLedger,
    caller_cpu: usize,
    descriptor: G8lProductAcceptanceGateDescriptor,
) -> Result<G8lProductAcceptanceOutcome, G8lProductAcceptanceError> {
    if caller_cpu != S708_TARGET_CPU {
        return Err(G8lProductAcceptanceError::WrongCpu);
    }
    let canonical = canonical_s708_to_s899_acceptance_descriptor(descriptor.sequence)
        .ok_or(G8lProductAcceptanceError::SequenceOutOfRange)?;
    if canonical != descriptor || descriptor.step.ordinal() != descriptor.step_ordinal {
        return Err(G8lProductAcceptanceError::DescriptorDrift);
    }
    if descriptor.sequence < ledger.last_completed_sequence {
        return Ok(G8lProductAcceptanceOutcome::AlreadyCompleted {
            requested_sequence: descriptor.sequence,
            last_completed_sequence: ledger.last_completed_sequence,
        });
    }
    if descriptor.sequence == ledger.last_completed_sequence {
        if let Some(receipt) = ledger.last_receipt {
            if receipt.sequence == descriptor.sequence {
                return Ok(G8lProductAcceptanceOutcome::Retained(receipt));
            }
        }
        return Ok(G8lProductAcceptanceOutcome::AlreadyCompleted {
            requested_sequence: descriptor.sequence,
            last_completed_sequence: ledger.last_completed_sequence,
        });
    }
    if ledger.last_completed_sequence != descriptor.predecessor_sequence {
        return Ok(G8lProductAcceptanceOutcome::AwaitingPredecessor {
            sequence: descriptor.sequence,
            expected_predecessor: descriptor.predecessor_sequence,
            observed_predecessor: ledger.last_completed_sequence,
        });
    }
    let completed_block_count = if descriptor.step_ordinal == descriptor.block_step_count {
        descriptor.block_ordinal
    } else {
        descriptor.block_ordinal - 1
    };
    let receipt = G8lProductAcceptanceReceipt {
        sequence: descriptor.sequence,
        predecessor_sequence: descriptor.predecessor_sequence,
        track: descriptor.track,
        phase: descriptor.phase,
        block_ordinal: descriptor.block_ordinal,
        step_ordinal: descriptor.step_ordinal,
        acceptance_domain: descriptor.acceptance_domain,
        chain_tip_sequence: ledger.chain_tip_sequence,
        retained_runtime_baselines: ledger.retained_runtime_baselines,
        retained_physical_observations: ledger.retained_physical_observations,
        completed_block_count,
        source_gate_complete: true,
        runtime_evidence_required: descriptor.runtime_evidence_required,
        physical_evidence_required: descriptor.physical_evidence_required,
        external_authority_required: descriptor.external_authority_required,
        new_supported_profile_runtime_observations: 0,
        new_physical_observations: 0,
        operator_authority_received: false,
        external_authority_received: false,
        linked_into_board_rpi5: S708_TO_S899_LINKED_INTO_BOARD_RPI5,
        cross_profile_coverage_complete: false,
        acceptance_complete: false,
        r2_field_acceptance_complete: false,
        release_track_complete: false,
        runbook_executed: false,
    };
    ledger.last_completed_sequence = descriptor.sequence;
    ledger.completed_block_count = completed_block_count;
    ledger.last_receipt = Some(receipt);
    Ok(G8lProductAcceptanceOutcome::Advanced(receipt))
}

pub const S708_SEQUENCE: usize = 708;
pub const S708_EXPECTED_PREDECESSOR: usize = S708_CHAIN_TIP_SEQUENCE;
pub const S708_TRACK: &str = "R2";
pub const S708_PHASE: &str = "R2.1";
pub const S708_BLOCK_ORDINAL: usize = 1;
pub const S708_BLOCK_STEP_COUNT: usize = 8;
pub const S708_STEP_ORDINAL: usize = 1;
pub const S708_ACCEPTANCE_DOMAIN: &str = "production_platform_isolation";
pub const S708_LINKED_INTO_BOARD_RPI5: bool = S708_TO_S899_LINKED_INTO_BOARD_RPI5;
pub const S708_NEW_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS: usize = 0;
pub const S708_NEW_PHYSICAL_OBSERVATIONS: usize = 0;
pub const S708_OPERATOR_AUTHORIZATIONS: usize = 0;
pub const S708_EXTERNAL_ACCEPTANCES: usize = 0;
pub const S708_PHYSICAL_OR_DEVICE_OPERATIONS: usize = 0;
pub const S708_ACCEPTANCE_COMPLETE: bool = false;
pub const S708_RELEASE_TRACK_COMPLETE: bool = false;
pub const RUNBOOK_EXECUTED_IN_S708: bool = false;

pub const S708_DESCRIPTOR: G8lProductAcceptanceGateDescriptor =
    G8lProductAcceptanceGateDescriptor {
        sequence: S708_SEQUENCE,
        predecessor_sequence: S708_EXPECTED_PREDECESSOR,
        track: S708_TRACK,
        phase: S708_PHASE,
        block_ordinal: S708_BLOCK_ORDINAL,
        block_step_count: S708_BLOCK_STEP_COUNT,
        step_ordinal: S708_STEP_ORDINAL,
        acceptance_domain: S708_ACCEPTANCE_DOMAIN,
        step: G8lProductAcceptanceStep::ContractRegistration,
        runtime_evidence_required: true,
        physical_evidence_required: true,
        external_authority_required: false,
    };

pub type G8lS708AcceptanceGateOutcome = G8lProductAcceptanceOutcome;
pub type G8lS708AcceptanceGateError = G8lProductAcceptanceError;

pub fn service_s708_model_r2_production_platform_isolation_contract(
    ledger: &mut G8lProductAcceptanceLedger,
    caller_cpu: usize,
) -> Result<G8lS708AcceptanceGateOutcome, G8lS708AcceptanceGateError> {
    advance_s708_to_s899_model_acceptance_gate(ledger, caller_cpu, S708_DESCRIPTOR)
}
snippet sha256: 9d5effdd8332file sha256: 9d5effdd8332
02 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam dosyaL1–L226
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s708_r2_production_platform_isolation_contract.rs::S708 r2 production platform isolation contract focused tests
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s708_r2_production_platform_isolation_contract::{
    advance_s708_to_s899_model_acceptance_gate,
    canonical_s708_to_s899_acceptance_descriptor, G8lProductAcceptanceAnchor,
    G8lProductAcceptanceError, G8lProductAcceptanceLedger, G8lProductAcceptanceOutcome,
    S708_CANONICAL_ANCHOR, S708_CHAIN_TIP_SEQUENCE, S708_FIRST_SEQUENCE, S899_LAST_SEQUENCE,
};
use aselsan_microkernel_simulation::g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s708_r2_production_platform_isolation_contract as gate;

fn product_anchor() -> G8lProductAcceptanceAnchor {
    S708_CANONICAL_ANCHOR
}

fn acceptance_ledger() -> G8lProductAcceptanceLedger {
    G8lProductAcceptanceLedger::from_s707(1, product_anchor()).unwrap()
}

fn advance_before(ledger: &mut G8lProductAcceptanceLedger, sequence: usize) {
    for predecessor in S708_FIRST_SEQUENCE..sequence {
        let descriptor = canonical_s708_to_s899_acceptance_descriptor(predecessor).unwrap();
        assert!(matches!(
            advance_s708_to_s899_model_acceptance_gate(ledger, 1, descriptor),
            Ok(G8lProductAcceptanceOutcome::Advanced(_))
        ));
    }
}

#[test]
fn s708_descriptor_is_exact_and_canonical() {
    assert_eq!(gate::S708_SEQUENCE, 708);
    assert_eq!(gate::S708_EXPECTED_PREDECESSOR, 707);
    assert_eq!(gate::S708_TRACK, "R2");
    assert_eq!(gate::S708_PHASE, "R2.1");
    assert_eq!(gate::S708_BLOCK_ORDINAL, 1);
    assert_eq!(gate::S708_BLOCK_STEP_COUNT, 8);
    assert_eq!(gate::S708_STEP_ORDINAL, 1);
    assert_eq!(
        gate::S708_ACCEPTANCE_DOMAIN,
        "production_platform_isolation"
    );
    assert_eq!(gate::S708_DESCRIPTOR.external_authority_required, false);
    assert!(gate::S708_DESCRIPTOR.physical_evidence_required);
    assert_eq!(
        canonical_s708_to_s899_acceptance_descriptor(708),
        Some(gate::S708_DESCRIPTOR)
    );
}

#[test]
fn s708_is_cpu1_scoped_and_waits_for_exact_predecessor() {
    let mut ledger = acceptance_ledger();
    assert_eq!(
        gate::service_s708_model_r2_production_platform_isolation_contract(&mut ledger, 0),
        Err(G8lProductAcceptanceError::WrongCpu)
    );
    assert_eq!(ledger.last_completed_sequence(), S708_CHAIN_TIP_SEQUENCE);
    if 708 == S708_FIRST_SEQUENCE {
        let future = canonical_s708_to_s899_acceptance_descriptor(709).unwrap();
        assert!(matches!(
            advance_s708_to_s899_model_acceptance_gate(&mut ledger, 1, future),
            Ok(G8lProductAcceptanceOutcome::AwaitingPredecessor {
                expected_predecessor: 708,
                observed_predecessor: 707,
                ..
            })
        ));
    } else {
        assert!(matches!(
            gate::service_s708_model_r2_production_platform_isolation_contract(&mut ledger, 1),
            Ok(G8lProductAcceptanceOutcome::AwaitingPredecessor {
                sequence: 708,
                expected_predecessor: 707,
                observed_predecessor: 707,
            })
        ));
    }
}

#[test]
fn s708_advances_once_with_non_acceptance_receipt() {
    let mut ledger = acceptance_ledger();
    advance_before(&mut ledger, 708);
    let G8lProductAcceptanceOutcome::Advanced(receipt) =
        gate::service_s708_model_r2_production_platform_isolation_contract(&mut ledger, 1).unwrap()
    else {
        panic!("S708 must advance")
    };
    assert_eq!((receipt.sequence, receipt.predecessor_sequence), (708, 707));
    assert_eq!(receipt.track, "R2");
    assert_eq!(receipt.phase, "R2.1");
    assert_eq!((receipt.block_ordinal, receipt.step_ordinal), (1, 1));
    assert_eq!(receipt.acceptance_domain, "production_platform_isolation");
    assert_eq!(receipt.completed_block_count, 0);
    assert_eq!(receipt.chain_tip_sequence, 707);
    assert_eq!(receipt.retained_runtime_baselines, 2);
    assert_eq!(receipt.retained_physical_observations, 2);
    assert!(receipt.source_gate_complete);
    assert!(receipt.runtime_evidence_required);
    assert!(receipt.physical_evidence_required);
    assert_eq!(receipt.new_supported_profile_runtime_observations, 0);
    assert_eq!(receipt.new_physical_observations, 0);
    assert!(!receipt.operator_authority_received);
    assert!(!receipt.external_authority_received);
    assert!(!receipt.linked_into_board_rpi5);
    assert!(!receipt.cross_profile_coverage_complete);
    assert!(!receipt.acceptance_complete);
    assert!(!receipt.r2_field_acceptance_complete);
    assert!(!receipt.release_track_complete);
    assert!(!receipt.runbook_executed);
}

#[test]
fn s708_replay_is_idempotent_and_historical_reentry_does_not_mutate() {
    let mut ledger = acceptance_ledger();
    advance_before(&mut ledger, 708);
    let G8lProductAcceptanceOutcome::Advanced(receipt) =
        gate::service_s708_model_r2_production_platform_isolation_contract(&mut ledger, 1).unwrap()
    else {
        panic!("advance")
    };
    assert_eq!(
        gate::service_s708_model_r2_production_platform_isolation_contract(&mut ledger, 1),
        Ok(G8lProductAcceptanceOutcome::Retained(receipt))
    );
    if 708 < S899_LAST_SEQUENCE {
        let next = canonical_s708_to_s899_acceptance_descriptor(708 + 1).unwrap();
        assert!(matches!(
            advance_s708_to_s899_model_acceptance_gate(&mut ledger, 1, next),
            Ok(G8lProductAcceptanceOutcome::Advanced(_))
        ));
        assert_eq!(
            gate::service_s708_model_r2_production_platform_isolation_contract(&mut ledger, 1),
            Ok(G8lProductAcceptanceOutcome::AlreadyCompleted {
                requested_sequence: 708,
                last_completed_sequence: 708 + 1,
            })
        );
    }
}

#[test]
fn s708_open_claim_boundary_is_preserved() {
    assert_eq!(gate::S708_NEW_SUPPORTED_PROFILE_RUNTIME_OBSERVATIONS, 0);
    assert_eq!(gate::S708_NEW_PHYSICAL_OBSERVATIONS, 0);
    assert_eq!(gate::S708_OPERATOR_AUTHORIZATIONS, 0);
    assert_eq!(gate::S708_EXTERNAL_ACCEPTANCES, 0);
    assert_eq!(gate::S708_PHYSICAL_OR_DEVICE_OPERATIONS, 0);
    assert!(!gate::S708_ACCEPTANCE_COMPLETE);
    assert!(!gate::S708_RELEASE_TRACK_COMPLETE);
    assert!(!gate::S708_LINKED_INTO_BOARD_RPI5);
    assert!(!gate::RUNBOOK_EXECUTED_IN_S708);
}

#[test]
fn s708_is_simulation_only_and_adds_no_production_callsite() {
    const TARGET: &str = "g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s708_r2_production_platform_isolation_contract";
    let source = include_str!("../../kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s708_r2_production_platform_isolation_contract.rs");
    let kernel_registry = include_str!("../../kernel/src/main.rs");
    let simulation_registry = include_str!("../src/lib.rs");
    let exceptions = include_str!("../../kernel/src/arch/aarch64/exceptions.rs");
    assert!(source.contains("pub const S708_DESCRIPTOR"));
    assert_eq!(
        simulation_registry
            .matches(&format!("pub mod {TARGET};"))
            .count(),
        1
    );
    assert_eq!(
        kernel_registry.matches(&format!("mod {TARGET};")).count(),
        0
    );
    assert_eq!(exceptions.matches(TARGET).count(), 0);
    assert_eq!(exceptions.matches("service_s708_").count(), 0);
}

#[test]
fn s708_descriptor_mutation_fails_before_ledger_advance() {
    let mut ledger = acceptance_ledger();
    advance_before(&mut ledger, 708);
    let before = ledger.last_completed_sequence();
    let mut drift = gate::S708_DESCRIPTOR;
    drift.block_ordinal += 1;
    assert_eq!(
        advance_s708_to_s899_model_acceptance_gate(&mut ledger, 1, drift),
        Err(G8lProductAcceptanceError::DescriptorDrift)
    );
    assert_eq!(ledger.last_completed_sequence(), before);
}

#[test]
fn s708_rejects_premature_acceptance_and_chain_tip_drift() {
    let mut promoted: G8lProductAcceptanceAnchor = S708_CANONICAL_ANCHOR;
    promoted.r2_field_acceptance_complete = true;
    assert_eq!(
        G8lProductAcceptanceLedger::from_s707(1, promoted).err(),
        Some(G8lProductAcceptanceError::PrematureAcceptanceClaim)
    );
    let mut linked: G8lProductAcceptanceAnchor = S708_CANONICAL_ANCHOR;
    linked.linked_into_board_rpi5 = true;
    assert_eq!(
        G8lProductAcceptanceLedger::from_s707(1, linked).err(),
        Some(G8lProductAcceptanceError::PrematureAcceptanceClaim)
    );
    let mut ran: G8lProductAcceptanceAnchor = S708_CANONICAL_ANCHOR;
    ran.chain_tip_runbook_executed = true;
    assert_eq!(
        G8lProductAcceptanceLedger::from_s707(1, ran).err(),
        Some(G8lProductAcceptanceError::PrematureAcceptanceClaim)
    );
    let mut invented: G8lProductAcceptanceAnchor = S708_CANONICAL_ANCHOR;
    invented.retained_physical_observations = 3;
    assert_eq!(
        G8lProductAcceptanceLedger::from_s707(1, invented).err(),
        Some(G8lProductAcceptanceError::ChainTipDrift)
    );
    let mut moved: G8lProductAcceptanceAnchor = S708_CANONICAL_ANCHOR;
    moved.chain_tip_sequence = 706;
    assert_eq!(
        G8lProductAcceptanceLedger::from_s707(1, moved).err(),
        Some(G8lProductAcceptanceError::ChainTipDrift)
    );
    assert_eq!(
        G8lProductAcceptanceLedger::from_s707(0, S708_CANONICAL_ANCHOR).err(),
        Some(G8lProductAcceptanceError::WrongCpu)
    );
}
snippet sha256: 67e059ae74b7file sha256: 67e059ae74b7
03 · Kapı kimlik kaydı

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

tam Operations kaydıL32–L58
website/src/lib/s708-s899-gate-specs.generated.ts::g8l-s708-r2-production-platform-isolation-contract-partial
  {
    id: "g8l-s708-r2-production-platform-isolation-contract-partial",
    sequence: 708,
    slug: "r2_production_platform_isolation_contract",
    title: "Production platform and isolation · Acceptance contract registration",
    titleTr: "Üretim platformu ve izolasyon · Kabul sözleşmesi kaydı",
    track: "R2",
    trackTitle: "Secure field phone",
    trackTitleTr: "Güvenli saha telefonu",
    phase: "R2.1",
    focusedTests: 8,
    sourceBytes: 22681,
    sourceSha256: "9d5effdd8332e3c116d5764916fe2aa46752b719b0aa688e0d99751316a8fb39",
    testBytes: 9406,
    testSha256: "67e059ae74b74db2cf3ab4a7bd8bc4b5f3101b44ebd36dd8478a34abc81bce67",
    blockOrdinal: 1,
    blockCount: 19,
    blockTitle: "Production platform and isolation",
    blockTitleTr: "Üretim platformu ve izolasyon",
    blockStepCount: 8,
    stepOrdinal: 1,
    stepTitle: "Acceptance contract registration",
    stepTitleTr: "Kabul sözleşmesi kaydı",
    externalAuthorityRequired: false,
    acceptance: "S708, Güvenli saha telefonu izinin R2.1 fazındaki Üretim platformu ve izolasyon bloğunun 1/8 Kabul sözleşmesi kaydı adımını exact S707 predecessor sonrasında ayrı typed descriptor ile fail-closed olarak kaydeder.",
    retainedBoundary: "Bu yalnız fail-closed software readiness kaydıdır. S571/S575 fiziksel gözlemleri salt-okunur taşınır (retained=2); yeni runtime/fiziksel gözlem=0, operatör yetkisi=0, dış kabul=0, cross-profile kapsam=false, acceptance_complete=false, release_track_complete=false, board-rpi5 kernel'e link=false ve RUNBOOK_EXECUTED_IN_S708=NO kalır. Bu faz dış kabul otoritesi gerektirmez; fiziksel gözlem yine de zorunludur.",
  },
snippet sha256: 27ef94de004bfile sha256: b4ce50234670
Focused test komutu
CARGO_INCREMENTAL=0 cargo test -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s708_r2_production_platform_isolation_contract -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S708-Production-platform-and-isolation-·-Acceptance-contract-registration-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 3050638b71a684d8f8f947a8a6faa237a17fa8db5dc0db04fb207b668b462af9