ASELSANMicrokernel
S78 · SOURCE-BOUND GATE EVIDENCE

G8f direct raw 24 leading NUL nedeniyle evidence-integrity kapısında reddedildi

S78 UART capture kapısı → kendi G8F same-descriptor helper kodu Bu sayfa yalnız S78 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

S78Komut / fiziksel sözleşmeOperations id exactsource SHA exact

operation: rpi5-g8f-direct-raw-leading-nul-rejected

script/Makefile/config · Operations · 2 exact excerpt

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

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

tam C fonksiyonuL47–L239
scripts/capture-rpi5-g8f-uart10.c::main
int main(int argc, char **argv) {
    if (argc != 3) {
        fprintf(stderr, "usage: %s DEVICE OUTPUT\n", argv[0]);
        return 2;
    }

    const char *device = argv[1];
    const char *output = argv[2];
    const char terminal_marker[] = "ASELSAN/BOOT8F ";
    const size_t marker_len = sizeof(terminal_marker) - 1;
    size_t marker_progress = 0;
    bool terminal_seen = false;
    double terminal_seen_at = 0.0;

    signal(SIGINT, request_stop);
    signal(SIGTERM, request_stop);

    int serial_fd = open(device, O_RDWR | O_NOCTTY | O_NONBLOCK);
    if (serial_fd < 0) {
        perror("open serial device");
        return 2;
    }

    struct termios settings;
    if (tcgetattr(serial_fd, &settings) != 0) {
        perror("tcgetattr before configure");
        close(serial_fd);
        return 2;
    }

    cfmakeraw(&settings);
    settings.c_cflag &= (tcflag_t)~(PARENB | CSTOPB | CSIZE);
    settings.c_cflag |= CS8 | CLOCAL | CREAD;
#ifdef CRTSCTS
    settings.c_cflag &= (tcflag_t)~CRTSCTS;
#endif
    settings.c_iflag &= (tcflag_t)~(IXON | IXOFF | IXANY);
    settings.c_cc[VMIN] = 0;
    settings.c_cc[VTIME] = 0;
    if (cfsetispeed(&settings, B115200) != 0 ||
        cfsetospeed(&settings, B115200) != 0) {
        perror("cfset speed");
        close(serial_fd);
        return 2;
    }
    if (tcsetattr(serial_fd, TCSANOW, &settings) != 0) {
        perror("tcsetattr");
        close(serial_fd);
        return 2;
    }

    struct termios effective;
    if (tcgetattr(serial_fd, &effective) != 0) {
        perror("tcgetattr after configure");
        close(serial_fd);
        return 2;
    }

    bool raw_ok = (effective.c_lflag & (ICANON | ECHO | ISIG | IEXTEN)) == 0 &&
                  (effective.c_oflag & OPOST) == 0;
    bool bits_ok = (effective.c_cflag & CSIZE) == CS8 &&
                   (effective.c_cflag & (PARENB | CSTOPB)) == 0;
    bool flow_ok = (effective.c_iflag & (IXON | IXOFF | IXANY)) == 0;
#ifdef CRTSCTS
    flow_ok = flow_ok && (effective.c_cflag & CRTSCTS) == 0;
#endif
    bool speed_ok = cfgetispeed(&effective) == B115200 &&
                    cfgetospeed(&effective) == B115200;
    if (!raw_ok || !bits_ok || !flow_ok || !speed_ok) {
        fprintf(stderr,
                "effective termios mismatch raw=%s bits8n1=%s flow_off=%s speed=%s\n",
                raw_ok ? "true" : "false",
                bits_ok ? "true" : "false",
                flow_ok ? "true" : "false",
                speed_ok ? "true" : "false");
        close(serial_fd);
        return 2;
    }

    if (tcflush(serial_fd, TCIFLUSH) != 0) {
        perror("tcflush TCIFLUSH");
        close(serial_fd);
        return 2;
    }

    int output_fd = open(output, O_WRONLY | O_CREAT | O_EXCL, 0600);
    if (output_fd < 0) {
        perror("open raw output");
        close(serial_fd);
        return 2;
    }

    printf("device=%s\n", device);
    printf("same_descriptor=true fd=%d\n", serial_fd);
    printf("effective_baud_115200=true ispeed=%lu ospeed=%lu\n",
           (unsigned long)cfgetispeed(&effective),
           (unsigned long)cfgetospeed(&effective));
    printf("format=8N1 raw=true flow_control=false\n");
    printf("input_flushed=true method=TCIFLUSH\n");
    printf("capture_path=%s\n", output);
    printf("capture_armed=YES\n");
    fflush(stdout);

    const double started_at = monotonic_seconds();
    uint64_t total_bytes = 0;
    uint8_t buffer[4096];
    int result = 0;

    while (!stop_requested) {
        double now = monotonic_seconds();
        if (terminal_seen && now - terminal_seen_at >= 3.0) {
            printf("terminal_grace_complete=true\n");
            break;
        }
        if (now - started_at >= 3600.0) {
            fprintf(stderr, "capture_timeout=YES elapsed_seconds=3600\n");
            result = 3;
            break;
        }

        struct pollfd pfd = {.fd = serial_fd, .events = POLLIN, .revents = 0};
        int polled = poll(&pfd, 1, 250);
        if (polled < 0) {
            if (errno == EINTR) {
                continue;
            }
            perror("poll serial");
            result = 2;
            break;
        }
        if (polled == 0) {
            continue;
        }
        if ((pfd.revents & (POLLERR | POLLNVAL)) != 0) {
            fprintf(stderr, "serial poll failure revents=0x%x\n", pfd.revents);
            result = 2;
            break;
        }

        for (;;) {
            ssize_t got = read(serial_fd, buffer, sizeof(buffer));
            if (got < 0) {
                if (errno == EINTR) {
                    continue;
                }
                if (errno == EAGAIN || errno == EWOULDBLOCK) {
                    break;
                }
                perror("read serial");
                result = 2;
                stop_requested = 1;
                break;
            }
            if (got == 0) {
                break;
            }

            write_all(output_fd, buffer, (size_t)got);
            total_bytes += (uint64_t)got;
            for (ssize_t i = 0; i < got && !terminal_seen; ++i) {
                uint8_t byte = buffer[i];
                if (byte == (uint8_t)terminal_marker[marker_progress]) {
                    marker_progress++;
                    if (marker_progress == marker_len) {
                        terminal_seen = true;
                        terminal_seen_at = monotonic_seconds();
                        printf("terminal_marker_seen=ASELSAN/BOOT8F bytes=%llu\n",
                               (unsigned long long)total_bytes);
                        fflush(stdout);
                    }
                } else {
                    marker_progress = byte == (uint8_t)terminal_marker[0] ? 1 : 0;
                }
            }
        }
    }

    if (fsync(output_fd) != 0) {
        perror("fsync raw output");
        result = 2;
    }
    if (fchmod(output_fd, 0444) != 0) {
        perror("fchmod raw output");
        result = 2;
    }
    close(output_fd);
    close(serial_fd);
    printf("capture_closed=true terminal_seen=%s exact_bytes=%llu mode=0444\n",
           terminal_seen ? "true" : "false",
           (unsigned long long)total_bytes);
    fflush(stdout);
    return result;
}
snippet sha256: 64fd279c4975file sha256: 58e8fb940ad0
02 · Kapı kimlik kaydı

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

tam Operations kaydıL29976–L30085
website/src/lib/operations.ts::rpi5-g8f-direct-raw-leading-nul-rejected
  {
    id: "rpi5-g8f-direct-raw-leading-nul-rejected",
    date: "2026-08-21",
    sequence: 78,
    status: "observed",
    title:
      "G8f direct raw 24 leading NUL nedeniyle evidence-integrity kapısında reddedildi",
    summary:
      "Sıra 77 sonrasında kullanıcı Pi'nin tamamen kapalı olduğunu teyit edip probe bağlantısını sabitledi. Bağımsız pre-arm audit kartın Mac'te absent olduğunu, USB/IOSerial kimlik ve inode'un üç örnek/sekiz saniye boyunca stabil kaldığını, portun boş ve bounded kernel hata sayılarının sıfır olduğunu doğruladı. Yeni exclusive raw yolunda helper güçten önce arm edildi; transport kopmadan BOOT8F terminal marker'ını gördü, grace'i tamamladı ve exit 0 ile exact 17.386 bayt salt-okunur raw üretti. Ancak authoritative validator doğrudan ve değiştirilmemiş raw üzerinde yalnız `leading NUL prefix exceeds capture allowance: observed 24, maximum 5` nedeniyle exit 1 verdi. Frozen limit değiştirilmedi, raw kırpılmadı/düzenlenmedi. Exact 24 leading NUL'ı yalnız process stream'de atlayan, dosya oluşturmayan tanısal koşu semantic validator ve bağımsız stage audit'te GO verdi; bu diagnostic GO direct-raw STOP'u geçersiz kılmaz. Kayıt bir evidence-integrity rejection'dır; firmware error veya fiziksel BOOT8F PASS değildir. Pi hâlâ kullanıcı bildirimiyle powered durumdadır ve yeni power-cut teyidi yoktur; yeni power-cycle/raw ile direct leading NUL ≤ 5 sağlanmadan retry kabul edilemez.",
    evidence: [
      "Kullanıcı Pi'yi tamamen kapattığını ve probe bağlantısını sabitlediğini teyit etti; pre-arm audit exact Sıra 76 kartını Mac'te absent doğruladı.",
      "USB object 0x100004496, session 783935390455, address 7, serial E6647C74033F9131 ve location 0x02144000; IOSerial object 0x1000044a7 ve callout `/dev/cu.usbmodem214402` olarak exact eşleşti.",
      "Üç örnek/sekiz saniye boyunca USB/IOSerial kimlikleri ve inode stabil, `lsof` free ve bounded disconnect/transaction error sayıları 0/0 kaldı.",
      "Helper kaynağı exact 7.244 B / 58e8fb940ad0b17adf3b895a13b844647e8524d99136874ef2b4bedc1ff23e90; binary exact 35.112 B / 5e0f78f60b2ddb7ff5cf5d1c446cf17260cbde023f9ad6270524b74463cabedc olarak değişmeden eşleşti.",
      "Yeni exclusive raw yolunda helper tek open yaptı; `same_descriptor=true fd=3`, effective 115200/8N1/raw/flow-off, `TCIFLUSH` ve kullanıcı power-on bildiriminden önce `capture_armed=YES` doğrulandı.",
      "Helper exit 0: `terminal_marker_seen=ASELSAN/BOOT8F bytes=16471`, `terminal_grace_complete=true`, `capture_closed=true terminal_seen=true exact_bytes=17386 mode=0444`.",
      "Capture boyunca USB disconnect ve transaction error sayıları 0/0'dır; helper kapanışı sonrasındaki tek endpoint-abort normal close teardown'ıdır, hardware disconnect değildir.",
      "Immutable direct raw exact 17.386 B / f72c5f477d643a0a1a67e6c17fb91ac230e4d7ec78f434dccc2cfef146d94954 ve mode 0444'tür.",
      "Raw byte audit: NUL=24 ve tamamı leading prefix'te; non-leading NUL=0. CR/LF/CRLF=248/248/248, bare CR/LF=0/0, NUL'sız UTF-8 PASS, other control=0 ve final CRLF PASS.",
      "Authoritative validator unchanged direct raw üzerinde exit 1 verdi ve tek kök neden exact `leading NUL prefix exceeds capture allowance: observed 24, maximum 5` oldu.",
      "Frozen maximum 5 değiştirilmedi; immutable raw trim/edit/rewrite edilmedi ve normalize edilmiş evidence dosyası oluşturulmadı.",
      "Immutable marker offsets BOOT8E=15173, G8F0=15640, G8F1=16058 ve BOOT8F=16445; dördünün count'u 1, error/G8FERR/panic/unknown-IRQ count'ları 0'dır.",
      "Yalnız tanı için exact 24 leading NUL'ı process stream'de atlayan ve dosya oluşturmayan aynı validator exit 0 verdi: release/ack=1/1, ack_ticks=0, proof_ticks=1, cpu1_irqs=0, new_sgi=0, new_gic_writes=0, boot8f_tick=1005.",
      "Bağımsız stage audit G7a–G8f 50 marker'ı canonical sırada doğruladı; SEC1..SEC13 ticks=100..1300 ve drift=0, BOOT8E 1000→release 1004→ack 1004→BOOT8F 1005, SEV=2 ve bütün new-work sayaçları 0 PASS verdi.",
      "Diagnostic semantic GO direct-raw framing STOP'unu ve physical acceptance reddini geçersiz kılmaz.",
      "Evidence arşivi `evidence/rpi5/g8f/sequence-78-leading-nul-rejected/`; README exact 4.200 B / 1a5f75a0538773a32776519fa3b23b4ac640754106b0e4aebd047506cf1f923f.",
      "Arşiv SHA256SUMS exact 292 B / a05d3355a502e2c2b59663f84334a92281ee1b3205179d5aa648378463622127; raw/helper kaynak/helper binary 0444, manifest ve temporary→archive cmp PASS'tir.",
      "G8f staged proof exact 25.566 B / adcad487b04c8e00a1fb0fe661e3202728a78612ec693a643d6a549c1f4a099f; direct-raw framing STOP ile diagnostic semantic sonucu ayrı tutar.",
    ],
    terminalSessionsNote:
      "Oturumlar stabil pre-arm, temiz transport capture, authoritative unchanged-direct-raw reddi ve dosyasız diagnostic semantic audit'i ayrı gösterir. Direct validator exit 1 fiziksel kabul STOP'udur; firmware error sonucu değildir.",
    terminalSessions: [
      {
        id: "g8f-seq78-stable-prearm-go",
        title: "Güçsüz Pi, sabit probe ve üç-örnek pre-arm kapısı",
        commandLines: [
          "verify the Pi is user-confirmed off, the card is absent from the Mac and the probe connection is secured",
          "sample USB object, IOSerial object and device inode three times over eight seconds",
          "verify lsof-free, bounded kernel errors zero and frozen helper hashes",
          "open one new exclusive raw and publish capture_armed=YES before user power-on",
        ],
        outputLines: [
          "USB=0x100004496 session=783935390455 address=7 serial=E6647C74033F9131 location=0x02144000",
          "IOSerial=0x1000044a7 callout=/dev/cu.usbmodem214402 · samples=3/8 s · identity+inode stable",
          "lsof=FREE · bounded disconnect/transaction errors=0/0 · helper source/binary exact=PASS",
          "same_descriptor=true fd=3 · 115200/8N1/raw/flow-off · TCIFLUSH · capture_armed=YES before power",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
      {
        id: "g8f-seq78-clean-transport-capture",
        title: "BOOT8F terminal marker'ına ulaşan temiz helper capture",
        commandLines: [
          "capture the powered-on Pi into the new exclusive sequence-78 raw path",
          "verify transport counters and close the immutable raw read-only",
        ],
        outputLines: [
          "terminal_marker_seen=ASELSAN/BOOT8F bytes=16471",
          "terminal_grace_complete=true",
          "capture_closed=true terminal_seen=true exact_bytes=17386 mode=0444",
          "USB disconnect/transaction errors=0/0 · helper exit=0",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
      {
        id: "g8f-seq78-authoritative-direct-raw-reject",
        title: "Unchanged direct raw üzerinde tek-kök-neden framing reddi",
        commandLines: [
          "run the authoritative strict G8f validator directly on the immutable 17386-byte raw",
          "audit NUL placement, CRLF framing, UTF-8, controls and marker offsets without modifying the file",
        ],
        outputLines: [
          "leading NUL prefix exceeds capture allowance: observed 24, maximum 5",
          "only validator error=leading NUL 24>5 · direct raw unchanged · limit unchanged",
          "NUL total/leading/nonleading=24/24/0 · CRLF=248 · bare CR/LF=0/0 · UTF8=PASS · final CRLF=PASS",
          "BOOT8E/G8F0/G8F1/BOOT8F count=1/1/1/1 · errors/panic/unknownIRQ=0",
        ],
        exitCode: 1,
        outputMode: "complete",
      },
      {
        id: "g8f-seq78-diagnostic-semantic-audit",
        title: "Dosyasız prefix-skip diagnostic ve bağımsız stage audit",
        commandLines: [
          "stream the raw while skipping exactly 24 leading NUL bytes in-process; create no output file",
          "run the same validator and the independent G7a-G8f stage audit on that diagnostic stream",
          "archive only the original raw and exact helper copies; verify SHA256SUMS, cmp and mode 0444",
        ],
        outputLines: [
          "diagnostic validator exit=0 · release/ack=1/1 · ack_ticks=0 · proof_ticks=1 · boot8f_tick=1005",
          "G7a-G8f markers=50 ordered · SEC1..SEC13=100..1300 drift=0 · BOOT8E/release/ack/BOOT8F=1000/1004/1004/1005",
          "SEV=2 · cpu1_irqs/new_sgi/new_gic_writes/all new work=0",
          "diagnostic GO cannot override direct-raw STOP · archive manifest/cmp/mode0444=PASS",
        ],
        exitCode: 0,
        outputMode: "complete",
      },
    ],
    limitations: [
      "Bu unchanged-direct-raw evidence-integrity reddidir; firmware error değildir ve fiziksel G8f/BOOT8F PASS değildir.",
      "Dosyasız process-stream diagnostic semantic GO yalnız teşhistir; frozen direct-raw leading-NUL kapısını geçersiz kılamaz.",
      "Reddedilen raw trim/edit/rewrite edilemez, yeni capture ile birleştirilemez ve physical PASS kanıtı olarak kullanılamaz.",
      "Pi kullanıcı bildirimiyle hâlâ powered durumdadır ve yeni power-cut teyidi yoktur; retry yeni temiz power-cycle, yeni exclusive raw ve direct leading NUL ≤ 5 gerektirir.",
      "Generic SMP runtime kapalıdır; bu transport/evidence gözlemi scheduler, timer, migration veya shootdown güvenliği kanıtı değildir.",
      "Website yayını yalnız canonical custom domain üzerinden doğrulanır; bu ortamda pages.dev direct smoke için başarı iddia edilmez.",
      "Wrangler yayını dirty/untracked workspace'ten ve stale 47d22c9 source etiketiyle yapılır; canlı artifact hash'i doğrulansa da Git-provider provenance kurulmuş sayılmaz.",
    ],
  },
snippet sha256: 800717bc017cfile sha256: 9726dbf00f84
Kayıtlı yürütme/kanıt komutu
verify the Pi is user-confirmed off, the card is absent from the Mac and the probe connection is secured
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 91d38c7b6222f0b4c117be786454853543da55a160e543d9b951057cc20dcc06