Repository navigation
feat(trios-chat): swap pilot, five guards run t27c gen-rust output behind adapters - #1896
dmitrii-f-t27 wants to merge 8 commits into
Conversation
The root Cargo.toml lists the 12 trios-chat ring crates but not the shim crates/trios-chat, so cargo refused to build it and e2e_chat_25, falsifier_runner and tests/r_chat_guard.rs never ran in CI. Cargo.lock gains only the trios-chat package entry. Refs #1814 L16 rationale: clippy -D warnings already fails at base 8b229e9 and ci.yml skips it; this PR changes no Rust source.
…golden Test names per package (cargo test -- --list) and pass counts for 12 of the 13 chat packages, e2e_chat_25 PASS list (25/25), falsifier_runner stdout, exit code (1) and skipped corpus lines (400), and golden_vectors output (3722 lines, identical on two runs). trios-chat-br-io-chat-07 is not measured yet and follows in a separate commit. Refs #1825 L16 rationale: clippy -D warnings already fails at base 8b229e9 and ci.yml skips it; this change adds only data files.
…pters Closes #1895 key_package_expiry_guard (CR-CHAT-01), epoch_rollover_wraparound_guard (CR-CHAT-02), ratchet_tree_resolution_guard and unmerged_leaves_bound_guard (CR-CHAT-03), cover_decoy_ratio_governor (CR-CHAT-07): the decision logic is now rings/<R>/src/t27gen/<stem>.rs, byte-identical `t27c gen-rust` output of the merged gHashTag/t27 specs at 5e5493cabbb9 (t27c-bootstrap@0.5.2+5e5493cab). Each sha256 equals the seal's gen_hash_rust and is recorded in T27_PIN. The original files keep their pub consts (original types), error enums, docs and #[cfg(test)] modules byte for byte; the function body is an interim adapter that maps the generated verdict to Result. Generated items stay private (mod t27gen). The four ring manifests declare the `serde` feature value for check-cfg, because the generated derives carry #[cfg_attr(feature = "serde", ...)] and that lint fires before item-level allows apply. Ring suites equal golden/test-names: CR-CHAT-01 476/476, CR-CHAT-02 431, CR-CHAT-03 520, CR-CHAT-07 381. e2e_chat_25, falsifier_runner and golden_vectors output identical to golden/. t27_pin 5 rows, r_chat_guard 3/3. L16 rationale: clippy -D warnings already fails at base 8b229e9 and ci.yml skips it; the generated code sits inside #[allow] mod t27gen.
…he swap pilot Refs #1895
Summary by t27-beesThis PR replaces five hand-written chat guards with Worth a look
Read: 41 files, +11130 -116, a summary only: the diff is larger than 4000 changed lines, so it was not read line by line. Head |
Closes #1895
Part of #1812 (Trinity Secure Chat written once in .t27).
Stacked on #1820 and #1827 and contains their commits (workspace member, golden baseline, T27_PIN). Merge order: 1820, then 1827, then this PR. Own commits: 5cc43d7 (the swap) and ea88625 (merge of the updated 1827 branch, which adds the BR-IO-CHAT-07 baseline; no file of the swap changed).
What it does
Swaps 5 trios-chat guards to
t27c gen-rustoutput. t27 SHA5e5493cabbb99f21f8f9f6e3a00150fb3eb0d230, t27ct27c-bootstrap@0.5.2+5e5493cab(built from that tree).crates/trios-chat/rings/...)t27gen/<stem>.rs= sealgen_hash_rustCR-CHAT-01/src/key_package_expiry_guard.rs8d2546de...a469CR-CHAT-02/src/epoch_rollover_wraparound_guard.rs3760df6b...f085CR-CHAT-03/src/ratchet_tree_resolution_guard.rsabcaf63f...907aCR-CHAT-03/src/unmerged_leaves_bound_guard.rs868119eb...d7db6CR-CHAT-07/src/cover_decoy_ratio_governor.rs27399ff1...835fTime: about 8 minutes for the 5 files, starting from the scratch adapter drafts of 2026-10-10 (writing, composing, building, testing). Without drafts, expect more.
Layout (as in
docs/chat/T27_PORT_CONVENTIONS.md, PR #1826):rings/<R>/src/t27gen/<stem>.rs: byte-identical gen-rust output, never edited; header "NOT LOWERED BY THIS BACKEND ... do not read this file as verified" kept.rings/<R>/src/<stem>.rs: original pub consts with original types (values read fromt27gen), error enums with derives and#[non_exhaustive], docs, and the original#[cfg(test)]module byte for byte. The body is an adapter:matchover the generated verdict back toResult<(), E>.mod t27genis private.T27_PIN: 5 rows (file, spec, t27 SHA, built_by, sha256, seal file).Cargo.tomlfiles get[lints.rust] unexpected_cfgswithcheck-cfg = ['cfg(feature, values("serde"))']: the generated derives carry#[cfg_attr(feature = "serde", ...)], and that lint fires during cfg evaluation, before the#[allow]onmod t27genapplies. The derive stays off. No rootCargo.toml/Cargo.lockchange in this commit.Checks on 5cc43d7 (local: cargo 1.94.0, rustc 1.94.0, repository Cargo.lock,
--offline)Mutation proof (one comparison flipped in each
t27gen/file, module tests run, file regenerated witht27c gen-rust, thencmp):Required checks (no-js-check, Test, Constitutional Enforcement, guard): see the checks of this PR.
The generated files are not hand-edited. Decision logic generated by t27c; no constant-time or equivalence claim beyond the tests listed.
L16 rationale: clippy -D warnings already fails at base 8b229e9 and ci.yml skips it; the generated code sits inside
#[allow]mod t27gen.Dmitrii Fedorov (@dmitrii-f-t27)