ASELSANMicrokernel
S297 · SOURCE-BOUND GATE EVIDENCE

G8l: start-first-task writer-authority audit

Operations --test hedefi → test hedefiyle aynı adlı uygulama/model modülü → kaynak kesiti Bu sayfa yalnız S297 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

S297Focused kod testiOperations id exactsource SHA exacttest target exact

operation: g8l-s297-start-first-task-writer-authority-audit-partial

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

sequence-bound=true · implementation-bound=true
01 · Testin bağlı olduğu uygulama/model kodu

Kapının yürüttüğü gerçek kaynak

tam Rust öğesiL22–L90
kernel/src/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s297_start_first_task_writer_authority_audit.rs::S297_WHOLE_SCHEDULER_GUARDED_SITES

pub const S297_WRITER_BOUNDARY_SITES: usize = 1;
pub const S297_WRITER_AUTHORITY_SITES: usize = 0;
pub const S297_DIRECT_SCHEDULER_ACCESS_SITES: usize = S296_DIRECT_SCHEDULER_ACCESS_SITES;
pub const S297_IMMUTABLE_READ_SITES: usize = S296_IMMUTABLE_READ_SITES;
pub const S297_WHOLE_SCHEDULER_GUARDED_SITES: usize = S296_WHOLE_SCHEDULER_GUARDED_SITES;
pub const S297_WHOLE_SCHEDULER_UNROUTED_SITES: usize = S296_WHOLE_SCHEDULER_UNROUTED_SITES;
pub const S297_OPEN_WRITER_SITES: usize = S296_OPEN_WRITER_SITES;

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS297SchedulerWriterAuthorityAuditOutcome {
    Idle,
    AwaitingWriterAuthority {
        request_id: u64,
        guarded_sites: usize,
        writer_sites: usize,
    },
}

#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum G8lS297SchedulerWriterAuthorityAuditError {
    S296(G8lS296SchedulerWriterAuthorityAuditError),
    S245(G8lS245ExclusionAdmissionRequestError),
    PriorCoverageDrift {
        guarded_sites: usize,
        unrouted_sites: usize,
    },
}

/// Revalidate the prior fail-closed authority boundary without taking
/// admission or constructing a production exclusive wrapper.
pub fn preflight_s297_scheduler_writer_authority(
    caller_cpu: usize,
    request: Option<G8lS245WholeSchedulerExclusionAdmissionRequestView>,
) -> Result<G8lS297SchedulerWriterAuthorityAuditOutcome, G8lS297SchedulerWriterAuthorityAuditError>
{
    match preflight_s296_scheduler_writer_authority(caller_cpu, request)
        .map_err(G8lS297SchedulerWriterAuthorityAuditError::S296)?
    {
        G8lS296SchedulerWriterAuthorityAuditOutcome::Idle => {
            Ok(G8lS297SchedulerWriterAuthorityAuditOutcome::Idle)
        }
        G8lS296SchedulerWriterAuthorityAuditOutcome::AwaitingWriterAuthority {
            request_id,
            guarded_sites,
            writer_sites,
        } if guarded_sites == S297_WHOLE_SCHEDULER_GUARDED_SITES
            && writer_sites == S297_OPEN_WRITER_SITES =>
        {
            Ok(
                G8lS297SchedulerWriterAuthorityAuditOutcome::AwaitingWriterAuthority {
                    request_id,
                    guarded_sites,
                    writer_sites,
                },
            )
        }
        G8lS296SchedulerWriterAuthorityAuditOutcome::AwaitingWriterAuthority {
            guarded_sites,
            writer_sites: _,
            ..
        } => Err(
            G8lS297SchedulerWriterAuthorityAuditError::PriorCoverageDrift {
                guarded_sites,
                unrouted_sites: S297_DIRECT_SCHEDULER_ACCESS_SITES - guarded_sites,
            },
        ),
    }
}
snippet sha256: 62baca65fa9afile sha256: 3256a2330154
02 · Doğrulayan test kodu

Operations komutuna bağlı focused test

tam Rust öğesiL128–L150
simulation/tests/g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s297_start_first_task_writer_authority_audit.rs::s297_start_first_task_has_one_alias_and_one_ready_queue_selection

#[test]
fn s297_start_first_task_has_one_alias_and_one_ready_queue_selection() {
    let source = include_str!("../../kernel/src/task/scheduler.rs");
    let boundary = start_first_task_boundary(source);
    assert_eq!(boundary.matches("addr_of_mut!(SCHEDULER)").count(), 1);
    assert_eq!(boundary.matches("sched.ready_queue.pop()").count(), 1);
    assert_eq!(
        boundary.matches("context_switch(&mut dummy, ctx)").count(),
        1
    );
    for required in [
        "let sched = &mut *core::ptr::addr_of_mut!(SCHEDULER)",
        "if let Some(prio_first) = sched.ready_queue.pop()",
        "let mut first = prio_first.task",
        "first.state = TaskState::Running",
    ] {
        assert!(
            boundary.contains(required),
            "missing S297 selection token: {required}"
        );
    }
}
snippet sha256: fcd13adb6ba5file sha256: 4ec497e13f20
03 · Kapı kimlik kaydı

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

tam Operations kaydıL16450–L16506
website/src/lib/operations.ts::g8l-s297-start-first-task-writer-authority-audit-partial
  {
    id: "g8l-s297-start-first-task-writer-authority-audit-partial",
    date: "2026-08-26",
    sequence: 297,
    status: "passed",
    umbrella_status: "partial",
    title: "G8l: start-first-task writer-authority audit",
    summary:
      "S297 focused 15/15 PASS ile start_first_task içindeki tek explicit mutable scheduler aliasını kaynakta doğrular. Tek ready-queue selection task'i Running yapar; current task ve time slice publication sonrasında address space hazırlanır, ilk context_switch çalışır ve beklenmeyen dönüş unreachable ile kapanır. Boş ready queue yolu uyarıdan sonra WFI idle loop'unda fail-closed kalır. Bu production migration değildir. Writer authority yalnız model gate'inin exclusive lease'iyle mümkündür, reader lease'i writer'ı açmaz. Production inventory 113 direct / 44 immutable guarded / 69 open writer olarak değişmez ve production exclusive wrapper, provider authority, whole-scheduler exclusion veya scheduler mutation üretilmez.",
    evidence: [
      "S297 focused kaynak/model kapısı iki bağımsız koşuda 15/15 PASS verdi: 130 B / SHA-256 0447f2fe9dc6fdf30815a6962cf23d978425e51bef2acde1efb27e5da13a78b3.",
      "start_first_task içindeki tek addr_of_mut!(SCHEDULER) writer boundary'si audit edilir. ready_queue.pop, TaskState::Running, current_task ve ticks_until_preempt publication, prepare_task_for_context_switch, dummy context, context_switch ve unreachable sırası; boş queue uyarısı + allocation-free WFI idle loop'u kaynakta görünür.",
      "Model gate reader membership exclusive writer authority'yi ExclusiveBusy ile bloklar; reader bırakıldıktan sonra non-zero token'lı exclusive lease alınır. Bu host/model evidence'tır.",
      "S296 authority preflight yeniden doğrulanır; pending S245 request korunur ve sonuç AwaitingWriterAuthority { guarded_sites: 44, writer_sites: 69 } olarak döner.",
      "Dört AArch64 profil derlemesi iki koşuda byte-equal exit 0 verdi: QEMU 110646 B / 1d7f5520, RPi4 149371 B / 1241924b, RPi5 405800 B / 61e0dc4c ve RPi5+SMP 405742 B / 121af094. Warning header'ları sırasıyla 291, 389, 830 ve 830'dur; zero-warning iddiası değildir.",
      "Birleşik board-rpi5,board-qemu özellikleri iki koşuda beklenen exit 101, 18590 B / e80c5d98, 17 error ve 22 warning header ile fail-closed kaldı; S297 writer boundary'si iki board profilinin birlikte etkinleşmesini açmaz.",
      "S238–S297 dependency matrisi iki koşuda 61 grup / 839/839 PASS; ham loglar byte-equal 7852 B / 736992ad80a368b3b7238d2b214d5ce5da3392f22fc56d7adb7a3081e5d28e20, süre-normalize özetler byte-equal 7974 B / 323595c68f250ca0d13211680a550167cf12f13dee1b998335593ffe51372f0f. Bu production writer-authority invocation kanıtı değildir.",
      "Ortak make verify-qemu iki koşuda PASS verdi: 116222 B / e017cd57 ve 116139 B / 72e53d79; W^X 31/31, S271 GRAPH_ABSENT=YES, RuntimePmm baseline, EL0 x4096, IPC 20/20, tek beklenen S142 fatal containment ve SEC5 korunur. Bu ortak smoke S297 production writer invocation kanıtı değildir.",
      "Exact yedi tarihsel G8h assertion adıyla dışlandığında workspace iki koşuda 259 sonuç grubu / 2626 PASS / 7 filtered verdi: ham loglar 61149 B / 971db2c3 ve ab6c112d, süre-normalize 25004 B özet byte-equal / SHA-256 6143e2946430295ee29a2af4ba13f7a04930c51380c5b1d08e33902ee3203702. Filtresiz koşu exit 101, 56371 B / 29691538 ile frozen S96 exceptions.S identity kapısında RED kaldı; full-workspace GREEN iddia edilmez.",
      "S297 production exclusive wrapper, provider authority, whole-scheduler exclusion, QEMU runtime fixture veya scheduler mutation iddiası eklemez; physical/device operations=0 ve RUNBOOK_EXECUTED_IN_S297=NO.",
    ],
    commands: [
      "cargo test --quiet -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s297_start_first_task_writer_authority_audit -- --test-threads=1",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-qemu",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi4",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --no-default-features --features board-rpi5,smp",
      "cargo check --quiet -p aselsan_kernel --target aarch64-unknown-none --features board-rpi5",
      "make verify-qemu",
    ],
    terminalSessions: [
      {
        id: "g8l-s297-start-first-task-writer-authority-audit",
        title: "G8l S297 start-first-task writer-authority audit",
        commandLines: [
          "cargo test --quiet -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s297_start_first_task_writer_authority_audit -- --test-threads=1",
        ],
        outputLines: [
          "test result: ok; S297 focused 1 group / 15 passed; 0 failed",
          "repeat-stable quiet output: 130 B / 0447f2fe9dc6fdf30815a6962cf23d978425e51bef2acde1efb27e5da13a78b3",
          "start-first-task writer authority remains model-only: reader blocks exclusive lease; first-task publication/switch and empty-queue WFI ordering are source-audited while 69 production writer sites remain open",
          "dependency: S238–S297 · 61 groups · 839/839 PASS; workspace: 259 groups · 2626 PASS · 7 historical filtered",
        ],
        exitCode: 0,
        outputMode: "selected",
      },
    ],
    terminalSessionsNote:
      "S297 kaynak/model fail-closed authority boundary'sidir; production writer guard/migration, QEMU fixture mutation ve fiziksel/device execution claim edilmez.",
    limitations: [
      "S297 yalnız start_first_task içindeki tek explicit mutable scheduler aliasını audit eder; toplam 69 production writer site açık kalır.",
      "Exclusive lease yalnız host/model gate'inde test edilir; production exclusive wrapper, provider authority ve whole-scheduler exclusion açık kalır.",
      "S238–S297 dependency matrisi exact 61 grup / 839/839 PASS'tir; bu production writer authority invocation kanıtı değildir.",
      "Filtresiz workspace frozen S96 identity kapısında RED'dir; workspace umbrella GREEN iddia edilmez.",
      "Supported-profile runtime invocation, Generic SMP ve fiziksel RPi kabulü açık kalır; S297 physical/device operations=0 ve RUNBOOK_EXECUTED_IN_S297=NO.",
    ],
  },
snippet sha256: 040ebe92288cfile sha256: 9726dbf00f84
Focused test komutu
cargo test --quiet -p aselsan_microkernel_simulation --test g8l_target_dispatch_scheduler_owner_scheduler_mutation_production_migration_lifecycle_s297_start_first_task_writer_authority_audit -- --test-threads=1
proof: docs/M8.1-RPi5-G8l-S297-Start-First-Task-Writer-Authority-Audit-Proof.md
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 91d38c7b6222f0b4c117be786454853543da55a160e543d9b951057cc20dcc06