code wiki / _hdl_build / nx_seat_drive.nx

nx_seat_drive.nx

buildroot/runtime/_hdl_build/nx_seat_drive.nx

8152 B188 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind tooltopic seat
docsdependenciesstructsconstsfunctions

about

nx_seat_drive.nx -- S2 SEAT-PROTOCOL DRIVER (agent-seat system, 2026-07-20). Runs the seat lifecycle around a lane-configured work step so a NON-CLAUDE seat (local maker ensemble, cron, any executor) closes rungs through the same protocol and gates as a Claude seat: CHECKIN -> WORK -> VERIFY(gate) -> CHECKOUT, with an append-only journal (fa_appendz, torn-proof) as the resume/standup surface. Single responsibility: the PROTOCOL. The work itself, its success gate, and the hub verbs are all LANE CONFIG DATA (no magic behavior, rule 11/22). argv: <lanefile> lanefile = KEY=VALUE lines (LF). Required: ws= actor= journal= workelf= workartifact= gateelf= Optional: workarg1..workarg3, gatearg1..gatearg2, checkinelf= checkinarg1=, checkoutelf= checkoutarg1= Hub-verb convention: checkin/checkout elfs are invoked as <elf> [argN] <ws> <actor> so a live wrapper (nx_seat checkin over tools/call) and a fixture both fit. ARTIFACT-TRUTH (banked law): the work step is judged by its DECLARED artifact (workartifact unlinked before the run, must exist non-empty after), not only by wait4 status. A work step that "succeeds" without producing its artifact is REFUSED. exit: 0 OK | 2 config | 3 checkin-refused (fail-closed) | 4 work-fail | 5 gate-RED 6 artifact-missing | 7 checkout-fail license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 5 imports · 0 importers

nx_seat_drive_lib.nx nx_seg_store.nx nx_deploy_lib.nx nx_framed_append.nx nx_syscalls.nx nx_seat_drive.nx

imports: nx_seat_drive_lib.nxnx_seg_store.nxnx_deploy_lib.nxnx_framed_append.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sd_w sys_write sys_exit sys_mmap dp_read sys_openat_rd sys_read sys_close sd_val sys_mmap ↻ sd_cat sd_frame sys_mmap ↻ sd_cat ↻ sd_num sys_mmap ↻ fa_appendz fa_append sys_mmap ↻ sys_openat_append sys_flock fa_write_all sys_write ↻ sys_close ↻ fa_len sys_write ↻ dep_run_capture sys_fork sys_openat_wr sys_dup3 sys_mmap ↻ sys_execve_clean sys_close ↻ sys_execve sys_exit ↻ sys_wait4 sys_unlinkat ss_writefile sys_openat_wr ↻

structs

none

consts

27const SD_MAGIC_1048576: i64 = 1048576
29const SD_CONF_CAP: i64 = 65536
30const SD_REC_CAP: i64 = 2048

functions

33func sd_frame(journal: *u8, ws: *u8, actor: *u8, tag: *u8, rcflag: i64, rc: i64) -> i64
52func main(argc: i64, argv: *i64) -> i64