code wiki / _hdl_build / nx_pattern_emit7_demo.nx
nx_pattern_emit7_demo.nx source
↩ module page · 28 lines · 1340 B
1// nx_pattern_emit7_demo.nx -- the TEAM authoring the WIRE_TLV core (no Claude logic). _pe_tlv =
2// the TLS-extension wire shape (type_w=2, len_w=2, type-first) -- the exact layout of the
3// ClientHello extension block the browser arc's B2 rung walks. ALSO proves the refusal rails:
4// a 3-byte width and a type_first=2 spec must be REFUSED, not authored. license_tier: ORIGINAL
5import "nx_pattern_emit7.nx"
6import "nx_syscalls.nx"
7
8func d7_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
9
10func main() -> i64 {
11 let a: i64 = pe7_author_wire_tlv("_pe_tlv" as *u8,
12 "runtime/_hdl_build/_pe_tlv.nx" as *u8,
13 "runtime/_hdl_build/_pe_tlv_test.nx" as *u8,
14 2, 2, 1)
15 let r1: i64 = pe7_author_wire_tlv("_pe_badw" as *u8,
16 "/tmp/_pe_badw.nx" as *u8, "/tmp/_pe_badw_test.nx" as *u8,
17 2, 3, 1)
18 let r2: i64 = pe7_author_wire_tlv("_pe_badtf" as *u8,
19 "/tmp/_pe_badtf.nx" as *u8, "/tmp/_pe_badtf_test.nx" as *u8,
20 2, 2, 2)
21 if a == 1 { if r1 == 0 { if r2 == 0 {
22 d7_w("TEAM AUTHORED CORE: _pe_tlv (WIRE_TLV 2/2 type-first = TLS extension shape) + bad-width and bad-order specs REFUSED -- verify with Engineer\n" as *u8)
23 sys_exit(0)
24 } } }
25 d7_w("author failed (or refusal rail broken)\n" as *u8)
26 sys_exit(1)
27 return 1
28}