ASELSANMicrokernel
S122 · SOURCE-BOUND GATE EVIDENCE

S122 gerçek same-descriptor UART10 pre-arm VERIFIED

Operations komutu/kapı ailesi → gerçek repository yürütme sözleşmesi Bu sayfa yalnız S122 kapısına aittir; komşu kapıların kaynakları bu kabulün içine katılmaz.

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

operation: rpi5-g8h-s122-uart-prearm-verified

script/Makefile/config · Operations · 2 exact excerpt

sequence-bound=true · implementation-bound=false
01 · Yürütme sözleşmesi

Gerçek script / Makefile / config kaynağı

tam dosyaL1–L608
scripts/capture-rpi5-g8h-uart10.c::capture-rpi5-g8h-uart10.c
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <termios.h>
#include <time.h>
#include <unistd.h>

#ifndef CAPTURE_TIMEOUT_SECONDS
#define CAPTURE_TIMEOUT_SECONDS 3600.0
#endif
#ifndef TERMINAL_GRACE_SECONDS
#define TERMINAL_GRACE_SECONDS 3.0
#endif
#ifndef MAX_CAPTURE_BYTES
#define MAX_CAPTURE_BYTES (64ULL * 1024ULL * 1024ULL)
#endif
#define READ_BUFFER_BYTES 4096
#define MAX_DRAIN_READS 64

static volatile sig_atomic_t stop_requested = 0;

static void request_stop(int signo) {
    (void)signo;
    stop_requested = 1;
}

static bool monotonic_seconds(double *value) {
    struct timespec ts;
    if (clock_gettime(CLOCK_MONOTONIC, &ts) != 0) {
        perror("clock_gettime");
        return false;
    }
    *value = (double)ts.tv_sec + (double)ts.tv_nsec / 1000000000.0;
    return true;
}

static bool write_all(int fd, const uint8_t *buf, size_t len) {
    while (len != 0) {
        ssize_t written = write(fd, buf, len);
        if (written < 0) {
            if (errno == EINTR) {
                continue;
            }
            perror("write raw capture");
            return false;
        }
        if (written == 0) {
            fprintf(stderr, "write raw capture returned zero\n");
            return false;
        }
        buf += (size_t)written;
        len -= (size_t)written;
    }
    return true;
}

/*
 * Keep the byte preceding a full marker as well as the marker itself.  A
 * sliding window is deliberately used instead of a progress counter: every
 * possible overlapping suffix is reconsidered at each byte and the state is
 * retained across read(2) boundaries.
 */
#define TERMINAL_MARKER "ASELSAN/BOOT8H "
#define TERMINAL_MARKER_BYTES (sizeof(TERMINAL_MARKER) - 1)
#define MARKER_WINDOW_CAPACITY (TERMINAL_MARKER_BYTES + 1)

struct marker_window {
    uint8_t bytes[MARKER_WINDOW_CAPACITY];
    size_t count;
    uint64_t bytes_scanned;
};

static void marker_window_push(struct marker_window *window, uint8_t byte) {
    if (window->count < MARKER_WINDOW_CAPACITY) {
        window->bytes[window->count++] = byte;
    } else {
        memmove(window->bytes,
                window->bytes + 1,
                MARKER_WINDOW_CAPACITY - 1);
        window->bytes[MARKER_WINDOW_CAPACITY - 1] = byte;
    }
    window->bytes_scanned++;
}

static bool marker_window_matches(const struct marker_window *window,
                                  uint64_t *marker_start_offset,
                                  uint64_t *marker_end_offset) {
    if (window->count < TERMINAL_MARKER_BYTES) {
        return false;
    }

    const size_t marker_at = window->count - TERMINAL_MARKER_BYTES;
    const uint8_t *marker_window = window->bytes + marker_at;
    if (memcmp(marker_window, TERMINAL_MARKER, TERMINAL_MARKER_BYTES) != 0) {
        return false;
    }

    *marker_end_offset = window->bytes_scanned;
    *marker_start_offset = *marker_end_offset - TERMINAL_MARKER_BYTES;
    const bool line_boundary =
        *marker_start_offset == 0 ||
        (marker_at == 1 && window->bytes[0] == (uint8_t)'\n');
    return line_boundary;
}

static bool install_signal_handlers(void) {
    struct sigaction action;
    memset(&action, 0, sizeof(action));
    action.sa_handler = request_stop;
    sigemptyset(&action.sa_mask);
    if (sigaction(SIGHUP, &action, NULL) != 0 ||
        sigaction(SIGINT, &action, NULL) != 0 ||
        sigaction(SIGTERM, &action, NULL) != 0) {
        perror("sigaction");
        return false;
    }

    struct sigaction ignore_pipe;
    memset(&ignore_pipe, 0, sizeof(ignore_pipe));
    ignore_pipe.sa_handler = SIG_IGN;
    sigemptyset(&ignore_pipe.sa_mask);
    if (sigaction(SIGPIPE, &ignore_pipe, NULL) != 0) {
        perror("sigaction SIGPIPE");
        return false;
    }
    return true;
}

int main(int argc, char **argv) {
    int result = 2;
    int serial_fd = -1;
    int output_fd = -1;
    bool output_opened = false;
    bool output_closed = false;
    bool output_mode_locked = false;
    bool output_identity_armed = false;
    bool terminal_seen = false;
    bool terminal_grace_complete = false;
    bool finalization_ok = true;
    uint64_t total_bytes = 0;
    uint64_t terminal_marker_start_offset = 0;
    uint64_t terminal_marker_end_offset = 0;
    double terminal_seen_at = 0.0;
    struct marker_window scanner = {{0}, 0, 0};
    struct stat armed_output;
    memset(&armed_output, 0, sizeof(armed_output));

    if (argc != 3) {
        fprintf(stderr, "usage: %s DEVICE OUTPUT\n", argv[0]);
        return 2;
    }
    if (!install_signal_handlers()) {
        return 2;
    }

    const char *device = argv[1];
    const char *output = argv[2];

    serial_fd = open(device, O_RDWR | O_NOCTTY | O_NONBLOCK);
    if (serial_fd < 0) {
        perror("open serial device");
        return 2;
    }
    if (!isatty(serial_fd)) {
        fprintf(stderr, "serial device is not a tty\n");
        goto finalize;
    }
#ifdef TIOCEXCL
    if (ioctl(serial_fd, TIOCEXCL) != 0) {
        perror("ioctl TIOCEXCL");
        goto finalize;
    }
#else
#error "TIOCEXCL is required for the G8h capture helper"
#endif
    struct termios settings;
    if (tcgetattr(serial_fd, &settings) != 0) {
        perror("tcgetattr before configure");
        goto finalize;
    }

    cfmakeraw(&settings);
    settings.c_iflag &= (tcflag_t)~(IGNBRK | BRKINT | PARMRK | INPCK |
                                    ISTRIP | INLCR | IGNCR | ICRNL);
    settings.c_oflag &= (tcflag_t)~OPOST;
    settings.c_lflag &=
        (tcflag_t)~(ICANON | ECHO | ECHONL | ISIG | IEXTEN);
    settings.c_cflag &= (tcflag_t)~(PARENB | CSTOPB | CSIZE);
    settings.c_cflag |= CS8 | CLOCAL | CREAD;
#ifdef CRTSCTS
    settings.c_cflag &= (tcflag_t)~CRTSCTS;
#endif
#ifdef CCTS_OFLOW
    settings.c_cflag &= (tcflag_t)~CCTS_OFLOW;
#endif
#ifdef CRTS_IFLOW
    settings.c_cflag &= (tcflag_t)~CRTS_IFLOW;
#endif
#ifdef CDTR_IFLOW
    settings.c_cflag &= (tcflag_t)~CDTR_IFLOW;
#endif
#ifdef CDSR_OFLOW
    settings.c_cflag &= (tcflag_t)~CDSR_OFLOW;
#endif
#ifdef CCAR_OFLOW
    settings.c_cflag &= (tcflag_t)~CCAR_OFLOW;
#endif
#ifdef MDMBUF
    settings.c_cflag &= (tcflag_t)~MDMBUF;
#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");
        goto finalize;
    }
    if (tcsetattr(serial_fd, TCSANOW, &settings) != 0) {
        perror("tcsetattr");
        goto finalize;
    }

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

    const bool raw_ok =
        (effective.c_lflag & (ICANON | ECHO | ISIG | IEXTEN)) == 0 &&
        (effective.c_oflag & OPOST) == 0 &&
        (effective.c_iflag &
         (IGNBRK | BRKINT | PARMRK | INPCK | ISTRIP | INLCR | IGNCR |
          ICRNL)) == 0 &&
        (effective.c_lflag & ECHONL) == 0;
    const bool bits_ok = (effective.c_cflag & CSIZE) == CS8 &&
                         (effective.c_cflag & (PARENB | CSTOPB)) == 0 &&
                         (effective.c_cflag & (CLOCAL | CREAD)) ==
                             (CLOCAL | CREAD) &&
                         effective.c_cc[VMIN] == 0 &&
                         effective.c_cc[VTIME] == 0;
    bool flow_ok = (effective.c_iflag & (IXON | IXOFF | IXANY)) == 0;
#ifdef CRTSCTS
    flow_ok = flow_ok && (effective.c_cflag & CRTSCTS) == 0;
#endif
#ifdef CCTS_OFLOW
    flow_ok = flow_ok && (effective.c_cflag & CCTS_OFLOW) == 0;
#endif
#ifdef CRTS_IFLOW
    flow_ok = flow_ok && (effective.c_cflag & CRTS_IFLOW) == 0;
#endif
#ifdef CDTR_IFLOW
    flow_ok = flow_ok && (effective.c_cflag & CDTR_IFLOW) == 0;
#endif
#ifdef CDSR_OFLOW
    flow_ok = flow_ok && (effective.c_cflag & CDSR_OFLOW) == 0;
#endif
#ifdef CCAR_OFLOW
    flow_ok = flow_ok && (effective.c_cflag & CCAR_OFLOW) == 0;
#endif
#ifdef MDMBUF
    flow_ok = flow_ok && (effective.c_cflag & MDMBUF) == 0;
#endif
    const 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 iflag=0x%lx oflag=0x%lx "
                "lflag=0x%lx cflag=0x%lx vmin=%u vtime=%u\n",
                raw_ok ? "true" : "false",
                bits_ok ? "true" : "false",
                flow_ok ? "true" : "false",
                speed_ok ? "true" : "false",
                (unsigned long)effective.c_iflag,
                (unsigned long)effective.c_oflag,
                (unsigned long)effective.c_lflag,
                (unsigned long)effective.c_cflag,
                (unsigned int)effective.c_cc[VMIN],
                (unsigned int)effective.c_cc[VTIME]);
        goto finalize;
    }

    if (tcflush(serial_fd, TCIFLUSH) != 0) {
        perror("tcflush TCIFLUSH");
        goto finalize;
    }
    if (stop_requested) {
        fprintf(stderr, "capture_signal_before_arm=YES\n");
        result = 4;
        goto finalize;
    }

    output_fd = open(output, O_WRONLY | O_CREAT | O_EXCL, 0600);
    if (output_fd < 0) {
        perror("open raw output");
        goto finalize;
    }
    output_opened = true;
    if (fchmod(output_fd, 0600) != 0) {
        perror("fchmod armed raw output");
        goto finalize;
    }
    if (fstat(output_fd, &armed_output) != 0) {
        perror("fstat armed raw output");
        goto finalize;
    }
    if (!S_ISREG(armed_output.st_mode) ||
        (armed_output.st_mode & 07777) != 0600 ||
        armed_output.st_nlink != 1 || armed_output.st_size != 0) {
        fprintf(stderr, "armed raw output identity/mode/size mismatch\n");
        goto finalize;
    }
    output_identity_armed = true;

    double started_at = 0.0;
    if (!monotonic_seconds(&started_at)) {
        goto finalize;
    }
    if (stop_requested) {
        fprintf(stderr, "capture_signal_before_arm=YES\n");
        result = 4;
        goto finalize;
    }

    printf("device=%s\n", device);
    printf("same_descriptor=true fd=%d "
           "exclusive_request=TIOCEXCL_APPLIED\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("effective_termios_masks iflag=0x%lx oflag=0x%lx "
           "lflag=0x%lx cflag=0x%lx vmin=%u vtime=%u\n",
           (unsigned long)effective.c_iflag,
           (unsigned long)effective.c_oflag,
           (unsigned long)effective.c_lflag,
           (unsigned long)effective.c_cflag,
           (unsigned int)effective.c_cc[VMIN],
           (unsigned int)effective.c_cc[VTIME]);
    printf("input_flushed=true method=TCIFLUSH\n");
    printf("capture_path=%s\n", output);
    printf("capture_identity device=%llu inode=%llu initial_bytes=0 "
           "mode=0600 nlink=1\n",
           (unsigned long long)armed_output.st_dev,
           (unsigned long long)armed_output.st_ino);
    printf("capture_armed=YES\n");
    if (fflush(stdout) != 0) {
        perror("fflush capture_armed");
        goto finalize;
    }

    uint8_t buffer[READ_BUFFER_BYTES];
    result = 3;
    for (;;) {
        double now = 0.0;
        if (!monotonic_seconds(&now)) {
            result = 2;
            break;
        }
        bool grace_deadline_reached =
            terminal_seen && now - terminal_seen_at >= TERMINAL_GRACE_SECONDS;
        if (!grace_deadline_reached && stop_requested) {
            fprintf(stderr, "capture_signal_before_complete=YES\n");
            result = 4;
            break;
        }
        if (!grace_deadline_reached &&
            now - started_at >= CAPTURE_TIMEOUT_SECONDS) {
            fprintf(stderr,
                    "capture_timeout=YES limit_seconds=%.3f\n",
                    CAPTURE_TIMEOUT_SECONDS);
            result = 3;
            break;
        }

        struct pollfd pfd = {.fd = serial_fd, .events = POLLIN, .revents = 0};
        const int polled = poll(&pfd, 1, grace_deadline_reached ? 0 : 250);
        if (polled < 0) {
            if (errno == EINTR) {
                continue;
            }
            perror("poll serial");
            result = 2;
            break;
        }
        if (polled == 0) {
            if (grace_deadline_reached) {
                terminal_grace_complete = true;
                printf("terminal_grace_complete=true seconds=3\n");
                break;
            }
            continue;
        }
        const bool poll_error = (pfd.revents & (POLLERR | POLLNVAL)) != 0;
        const bool hangup_pending = (pfd.revents & POLLHUP) != 0;
        if ((pfd.revents & POLLIN) == 0 && !hangup_pending && !poll_error) {
            continue;
        }

        bool drain_stopped = false;
        bool drain_exhausted = true;
        for (unsigned int drain_reads = 0; drain_reads < MAX_DRAIN_READS;
             ++drain_reads) {
            const ssize_t got = read(serial_fd, buffer, sizeof(buffer));
            if (got < 0) {
                if (errno == EINTR) {
                    continue;
                }
                if (errno == EAGAIN || errno == EWOULDBLOCK) {
                    drain_exhausted = false;
                    break;
                }
                perror("read serial");
                result = 2;
                break;
            }
            if (got == 0) {
                /* VMIN=0 makes zero a completed drain, not an EOF signal. */
                drain_exhausted = false;
                break;
            }

            if (total_bytes > MAX_CAPTURE_BYTES ||
                (uint64_t)got > MAX_CAPTURE_BYTES - total_bytes) {
                fprintf(stderr,
                        "capture_size_limit_exceeded=YES limit_bytes=%llu "
                        "bytes_before_chunk=%llu rejected_chunk_bytes=%llu\n",
                        (unsigned long long)MAX_CAPTURE_BYTES,
                        (unsigned long long)total_bytes,
                        (unsigned long long)got);
                result = 3;
                drain_stopped = true;
                break;
            }
            if (!write_all(output_fd, buffer, (size_t)got)) {
                result = 2;
                break;
            }
            total_bytes += (uint64_t)got;
            for (ssize_t i = 0; i < got; ++i) {
                marker_window_push(&scanner, buffer[i]);
                if (!terminal_seen &&
                    marker_window_matches(&scanner,
                                          &terminal_marker_start_offset,
                                          &terminal_marker_end_offset)) {
                    terminal_seen = true;
                    if (!monotonic_seconds(&terminal_seen_at)) {
                        result = 2;
                        drain_stopped = true;
                        break;
                    }
                    printf("terminal_marker_seen=ASELSAN/BOOT8H "
                           "start_offset=%llu end_offset=%llu\n",
                           (unsigned long long)terminal_marker_start_offset,
                           (unsigned long long)terminal_marker_end_offset);
                    if (fflush(stdout) != 0) {
                        perror("fflush terminal marker");
                        result = 2;
                        drain_stopped = true;
                        break;
                    }
                }
            }
            if (drain_stopped || result == 2) {
                break;
            }

            double drain_now = 0.0;
            if (!monotonic_seconds(&drain_now)) {
                result = 2;
                drain_stopped = true;
                break;
            }
            grace_deadline_reached =
                terminal_seen &&
                drain_now - terminal_seen_at >= TERMINAL_GRACE_SECONDS;
            if (!grace_deadline_reached && stop_requested) {
                fprintf(stderr, "capture_signal_before_complete=YES\n");
                result = 4;
                drain_stopped = true;
                break;
            }
            if (!grace_deadline_reached &&
                drain_now - started_at >= CAPTURE_TIMEOUT_SECONDS) {
                fprintf(stderr,
                        "capture_timeout=YES limit_seconds=%.3f\n",
                        CAPTURE_TIMEOUT_SECONDS);
                result = 3;
                drain_stopped = true;
                break;
            }
        }
        if (drain_stopped || result == 2 || result == 4) {
            break;
        }
        if (poll_error) {
            fprintf(stderr, "serial poll failure revents=0x%x\n", pfd.revents);
            result = 2;
            break;
        }
        if (hangup_pending && !grace_deadline_reached) {
            fprintf(stderr, "serial_hangup_before_complete=YES\n");
            result = 3;
            break;
        }
        if (grace_deadline_reached) {
            if (drain_exhausted) {
                fprintf(stderr, "terminal_grace_drain_saturated=YES\n");
                result = 3;
                break;
            }
            terminal_grace_complete = true;
            printf("terminal_grace_complete=true seconds=3\n");
            break;
        }
    }

    if (terminal_seen && terminal_grace_complete) {
        result = 0;
    } else if (result == 0) {
        result = 3;
    }

finalize:
    if (output_opened) {
        if (fsync(output_fd) != 0) {
            perror("fsync raw output before chmod");
            finalization_ok = false;
        }
        if (fchmod(output_fd, 0444) != 0) {
            perror("fchmod raw output");
            finalization_ok = false;
        } else {
            output_mode_locked = true;
        }
        if (fsync(output_fd) != 0) {
            perror("fsync raw output after chmod");
            finalization_ok = false;
        }
        struct stat finalized_output;
        if (fstat(output_fd, &finalized_output) != 0) {
            perror("fstat finalized raw output");
            finalization_ok = false;
            output_mode_locked = false;
        } else if (!output_identity_armed ||
                   !S_ISREG(finalized_output.st_mode) ||
                   (finalized_output.st_mode & 07777) != 0444 ||
                   finalized_output.st_nlink != 1 ||
                   finalized_output.st_size < 0 ||
                   finalized_output.st_dev != armed_output.st_dev ||
                   finalized_output.st_ino != armed_output.st_ino ||
                   (uint64_t)finalized_output.st_size != total_bytes) {
            fprintf(stderr,
                    "finalized raw output identity/mode/size mismatch\n");
            finalization_ok = false;
            output_mode_locked = false;
        }
        if (close(output_fd) != 0) {
            perror("close raw output");
            finalization_ok = false;
        } else {
            output_closed = true;
        }
        output_fd = -1;
    }
    if (serial_fd >= 0 && close(serial_fd) != 0) {
        perror("close serial device");
        finalization_ok = false;
    }
    serial_fd = -1;

    if (!finalization_ok) {
        result = 2;
    }
    const bool output_durable = output_opened && output_closed &&
                                output_identity_armed && output_mode_locked &&
                                finalization_ok;
    const bool success = result == 0 && terminal_seen &&
                         terminal_grace_complete && output_durable;
    if (!success && result == 0) {
        result = 3;
    }
    const int report_status =
        printf("capture_closed=%s terminal_seen=%s grace_complete=%s "
               "exact_bytes=%llu mode=%s durable=%s success=%s\n",
           output_closed ? "true" : "false",
           terminal_seen ? "true" : "false",
           terminal_grace_complete ? "true" : "false",
           (unsigned long long)total_bytes,
           output_mode_locked ? "0444" : "UNLOCKED",
           output_durable ? "true" : "false",
           success ? "true" : "false");
    if (report_status < 0 || fflush(stdout) != 0) {
        result = 2;
    }
    return result;
}
snippet sha256: 6e438d260bbefile sha256: 6e438d260bbe
02 · Kapı kimlik kaydı

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

tam Operations kaydıL27075–L27154
website/src/lib/operations.ts::rpi5-g8h-s122-uart-prearm-verified
  {
    id: "rpi5-g8h-s122-uart-prearm-verified",
    date: "2026-08-23",
    sequence: 122,
    status: "verified",
    title: "S122 gerçek same-descriptor UART10 pre-arm VERIFIED",
    summary:
      "Pi güçsüz ve S100 kart takılı kalırken yalnız Raspberry Pi Debug Probe UART10 yolu açıldı. Fresh üç örnekte `/dev/cu.usbmodem214402` + `/dev/tty.usbmodem214402` aynı IOSerial/USB parent kimliğinde, holder=0 ve 3/3 stable doğrulandı. S121 source hash'i ile iki temiz helper build'i byte-equal çıktıktan sonra helper yalnız bir kez başlatıldı: PID 4516, serial FD 3 ve raw FD 4; aynı descriptor üzerinde TIOCEXCL, effective 115200/8N1/raw/flow-off, TCIFLUSH, `capture_identity` ve `capture_armed=YES` doğrulandı. Raw arm anında initial_bytes=0 yayımladı; üç post-arm örnekte aynı dev/inode üzerinde 1 B `00`, mode 0600 ve nlink1 olarak açık/değişebilir kaldı. Pi'ye güç verilmedi, disk erişimi yapılmadı ve BOOT8H çalıştırılmadı. S123 tek power/capture için ayrı exact yetki kapısıdır.",
    evidence: [
      "Fresh pre-open audit 3/3: Debug Probe VID/PID/rev `0x2e8a/0x000c/0x0101`, serial `E6647C74033F9131`, location `0x02144000`, 12 Mbps; callout/tty aynı IOSerial parent altında, başka usbmodem çifti yok ve holders=0.",
      "S121 source identity yeniden doğrulandı: 20525 B / `6e438d260bbecde7c9cdeeb371f3b9edfd567b108533671a2b59287d4adc56cd`. İki fresh temiz binary byte-equal: 35048 B / `f21d002741bc3e4d327a64d229945e2857067046b94421835f80d9b265349df2`.",
      "Tek gerçek helper süreci PID 4516'dır. Serial FD 3 exact `/dev/cu.usbmodem214402` callout'una, raw FD 4 fresh capture'a bağlıdır; `same_descriptor=true`, `TIOCEXCL_APPLIED`, effective baud 115200, 8N1, raw=true, flow_control=false ve `input_flushed=true method=TCIFLUSH` sıralı yayımlandı.",
      "Helper stdout 527 B exact sıralı arm kaydıdır ve `capture_armed=YES` ile biter; stderr 0 B'dır. Helper kapanmadı ve terminal BOOT8H marker'ı oluşmadı.",
      "Emitted `capture_identity`: device 16777231, inode 22679159, initial_bytes=0, mode 0600, nlink1. Üç post-arm örnek 08:29:43Z, 08:29:48Z ve 08:29:54Z'de 3/3 stable; raw aynı kimlikte size=1 ve hex=`00` kaldı.",
      "S122 sırasında REAL_BLOCK_DEVICE_OPEN=0, DISK_ACCESS=0, FORMAT=0, EJECT=0, PI_POWER=0 ve PHYSICAL_BOOT8H=0 olarak korundu.",
      "Kalıcı kanıt: `evidence/rpi5/g8h/sequence-122-uart-prearm/README.md`.",
    ],
    commands: [
      "<fresh 3-sample USB/IOSerial same-parent identity + holder=0 audit>",
      "cc <frozen-flags> capture-rpi5-g8h-uart10.c <clean-build-A/clean-build-B> && cmp <clean-build-A> <clean-build-B>",
      "<clean-build-A>/capture-rpi5-g8h-uart10 /dev/cu.usbmodem214402 <fresh-mutable-raw>",
      "<3-sample live PID/FD/raw/USB continuity audit; helper remains armed>",
    ],
    terminalSessions: [
      {
        id: "s122-fresh-preopen-identity",
        title: "Fresh USB/IOSerial same-parent + holder-free audit",
        commandLines: [
          "<three fresh system_profiler/IORegistry/stat/lsof samples>",
        ],
        outputLines: [
          "S122_PREOPEN_IDENTITY=PASS samples=3/3 span_seconds=8 endpoint_open=NO holders=0",
          "vid_pid_rev=0x2e8a/0x000c/0x0101 serial=E6647C74033F9131 location=0x02144000 same_parent=YES",
        ],
        exitCode: 0,
        outputMode: "selected",
      },
      {
        id: "s122-source-clean-rebuild",
        title: "S121 source + iki fresh clean helper equality",
        commandLines: [
          "shasum -a 256 scripts/capture-rpi5-g8h-uart10.c",
          "cc <frozen-flags> <build-A> && cc <frozen-flags> <build-B> && cmp <build-A> <build-B>",
        ],
        outputLines: [
          "S122_SOURCE_IDENTITY=PASS bytes=20525 sha256=6e438d260bbecde7c9cdeeb371f3b9edfd567b108533671a2b59287d4adc56cd",
          "S122_CLEAN_REBUILD=PASS builds=2/2 cmp=PASS bytes=35048 sha256=f21d002741bc3e4d327a64d229945e2857067046b94421835f80d9b265349df2",
        ],
        exitCode: 0,
        outputMode: "selected",
      },
      {
        id: "s122-live-prearm-audit",
        title: "Tek helper arm + üç live post-arm audit",
        commandLines: [
          "<single authorized helper launch on /dev/cu.usbmodem214402>",
          "<three read-only post-arm continuity samples>",
        ],
        outputLines: [
          "PID=4516 serial_fd=3 raw_fd=4 same_descriptor=true TIOCEXCL_APPLIED",
          "effective_baud_115200=true format=8N1 raw=true flow_control=false input_flushed=true method=TCIFLUSH",
          "capture_identity device=16777231 inode=22679159 initial_bytes=0 mode=0600 nlink=1",
          "capture_armed=YES",
          "S122_POSTARM=PASS samples=3/3 span_seconds=10 raw_size=1 raw_hex=00 helper_alive=YES power=0",
        ],
        exitCode: 0,
        outputMode: "selected",
        outputNote:
          "exit 0 yalnız tamamlanan post-arm audit'e aittir; PID 4516 helper süreci canlı ve raw açık/değişebilir bırakılmıştır.",
      },
    ],
    terminalSessionsNote:
      "S122 gerçek UART pre-arm operasyonudur. Gösterilen helper satırları 527 B stdout'un seçili exact alanlarıdır; helper exit/close yapmadı. 1 B `00` raw mode0600 açık ve değişebilir olduğundan kabul edilmiş immutable fiziksel raw değildir.",
    limitations: [
      "S122 yalnız verified pre-power arm'dır: helper PID 4516 canlıdır; terminal marker yok, capture close yok, mode0444 promotion yok, validator yok ve PHYSICAL_BOOT8H=0'dır.",
      "Raw'ın 1 B `00` / mode0600 durumu canlı transport başlangıcıdır; düzenlenmez, dondurulmaz ve kabul edilmiş fiziksel kanıt olarak sunulmaz.",
      "Son boot/runtime PASS S92 BOOT8G, son storage/media PASS S119, placement S120 USER-REPORTED ve host hazırlığı S121 olarak korunur.",
      "S122 kapsamında DISK_ACCESS=0, FORMAT=0, EJECT=0 ve PI_POWER=0'dır. S123 tek power-on/capture ancak ayrı exact kullanıcı yetkisiyle açılır; retry yoktur.",
    ],
  },
snippet sha256: 812961bc67c3file sha256: 9726dbf00f84
Kayıtlı yürütme/kanıt komutu
<fresh 3-sample USB/IOSerial same-parent identity + holder=0 audit>
Registry schema v5 · generator website/scripts/generate-code-gates.mjs · Tam SHA-256: 91d38c7b6222f0b4c117be786454853543da55a160e543d9b951057cc20dcc06