Repository navigation
docs(trios-chat): port conventions for .t27 specs and the swap layout - #1826
dmitrii-f-t27 wants to merge 2 commits into
Conversation
Refs #1824 Adds docs/chat/T27_PORT_CONVENTIONS.md: spec location and module line, ASCII text, the D5 verdict (payload-free enum, Ok first, named struct), types and constructs that gen-rust lowers to compiling Rust, tests, behaviour fidelity, checks 0-14, swap layout with the interim adapter (D4), crypto boundary, banned claims and toolchain traps. Own lane only (D2). Every t27 snippet passes t27c test-report (0 vacuous), its gen-rust output compiles with rustc 1.94.0, and t27c coverage prints Untested: 0, with t27c built from gHashTag/t27 master 67cbf82849e4 and Zig 0.16.0. L16 rationale: clippy -D warnings already fails at base 8b229e9 and ci.yml skips it; this PR changes no Rust source.
Summary by t27-beesThis PR adds a comprehensive conventions document ( Worth a look
Read: 1 files, +579 -0, the whole diff. Head |
…nventions Refs #1824 - Section 0 defines D6 (quirks of the original: preserve; pending owner answer, recommendation preserve), which section 6 cites. - Section 7 is now three bash blocks that run as written: FILL values with an example (NAMES for check 2), each expected result in a "# expected:" comment, and check 12 repeats the seal guard (only from the t27 worktree root with the repo-relative spec path; git status shows exactly the expected seal file; read the tests field). - Sections 4 and 8 state the measured lowering: []const u64 becomes Vec<u64> by value, so the adapter keeps &[u64] and passes .to_vec(). The t27 snippets and the Rust adapter are unchanged; re-checked with t27c from gHashTag/t27 master 67cbf82849e4, Zig 0.16.0, rustc 1.94.0. The section 7 blocks were run in bash on the section 3 template. L16 rationale: clippy -D warnings already fails at base 8b229e9 and ci.yml skips it; this PR changes no Rust source.
|
Review points checked one by one; changes in 6b93cf5:
The t27 snippets and the Rust adapter are byte-identical to 40617b6 and were re-checked (test-report 4/4, 9/9, 4/4, 0 vacuous; rustc exit 0; Dmitrii Fedorov (@dmitrii-f-t27) |
Closes #1824
Part of the epic #1812.
What
Adds
docs/chat/T27_PORT_CONVENTIONS.md: the rules every agent follows when it writes a trios-chat.t27spec in gHashTag/t27 or swaps generated code intocrates/trios-chat/. Sections: owner decisions in force; spec location and module line; ASCII text; the verdict; types, bytes and constructs; tests; behaviour fidelity; checks 0-14; swap layout; crypto boundary; words we do not use; toolchain traps; how the snippets were checked.Owner decisions recorded (2026-10-11): D5 = a named verdict struct with a payload-free enum,
Okfirst; D2 = own lane only (every port is written by agents acting as dmitrii-f-t27; no Queen fallback); D4 = interim hand-written adapters.Documentation only. No Rust source, no
Cargo.toml/Cargo.lock, no CODEOWNERS file changes, no.shfiles.L16 rationale: clippy -D warnings already fails at base 8b229e9 and ci.yml skips it; this PR changes no Rust source.
What changed against the draft after compile-checking
self. gen-rust keeps the name and rustc rejects it ("selfparameter is only allowed in associated functions"). The document now saystype_method(t: *T, ...).@log2is float-only in Zig (integer argument: BLOCKED); forf64Zig passes and the Rust gets@log2verbatim (parse error).\x00escapes and raw UTF-8 in strings are wrong in both backends (test-reportfails), not only in Rust.use x::a::f;now resolves when the spec path has aspecs/directory above it (t27c splicesfinto the generated file); from inside the directory with a bare file name it is still BLOCKED. Helpers stay inline.Snippet checks
t27c binary built from gHashTag/t27 master
67cbf82849e40a74e5cc92d4a25c764dc5862f90(2026-10-10; not rebuilt for this PR). Between that commit and the current master39d5af36b86cno change touchesbootstrap/src/compiler.rs(checked with the GitHub compare API). Zig 0.16.0, rustc 1.94.0, bash. Each fencedt27block of the document was extracted to its own file by a script (the doc has 3t27blocks and 1rustblock) and run as below.Section 8 adapter (the
rustblock, extracted as is) plus anXxxErrorenum and 4 tests, next to the gen-rust output of snippet 1 int27gen/xxx_guard.rs:The "Do not write" column of section 4 was re-measured with the same binary on minimal probe specs (one construct each):
[]const u8parameter ->&'static str(E0277);[]const [4]u8and[]const []const u8-> Zig BLOCKED + Rust parse error;[3][]const u8->Vec<const u8>(parse error);u64::MAX-> Zig BLOCKED "type u64 has no members";const x: u128 = a;and the i128 form -> E0308;a as u128-> parse error "unknown cast target type"; usize into a u64 field -> E0308;@as(u64, p)with p: u128 -> Zig BLOCKED;@as(u8, @intCast(x))-> E0282; untyped[_]u8{..}local -> Zig BLOCKED "cannot cast pointer to tuple"; methods inside a struct -> Zig BLOCKED, spec-status NOFN;.Variantoutside return -> E0425; generics -> BLOCKED; closures and HashMap -> parse error. The gen-rust repro specs are filed in gHashTag/t27#8891.The three bash blocks of section 7 (added in 6b93cf5) were run as written on the section 3 template in a scratch git tree: every
# expected:value matched, the seal file wassrc_port::trios::crates::trios-chat::rings::CR-CHAT-99::src::xxx_guard.json, tests fieldpassed 4, total 4, failed 0, vacuous 0.Not verified here: the section 7 checks on a real port, and the swap layout of section 8 inside the real trios workspace (no ring was swapped by this PR); the measured adapter sizes are quoted from the 2026-10-10 scratch drafts.
Dmitrii Fedorov (@dmitrii-f-t27)