Repository navigation
Freeze the trios-chat behaviour baseline at 8b229e9: test names, e2e PASS list, falsifier output, golden vectors, pin test #1825
Description
Part of #1812. Needs #1814 first (shim added to the workspace members; PR #1820).
Why
Every later swap replaces hand-written logic with generated code. The only proof that behaviour did not change is a frozen record of what the crate does today, checked again after each swap. t27c gen-rust does not lower tests, so the original tests and these golden files are the oracle.
Add under crates/trios-chat/
golden/test-names/<package>.txt- the output ofcargo test -p <package> -- --list 2>/dev/null | grep ': test$' | sortfor each of the 12 ring packages and the shimtrios-chat, plus agolden/test-names/counts.txtwith pass counts. Package names: trios-chat-cr-chat-00 ... trios-chat-cr-chat-07, trios-chat-cr-chat-laws, trios-chat-br-output, trios-chat-br-io-chat-05, trios-chat-br-io-chat-07, trios-chat.golden/e2e_pass.txt- the PASS/FAIL lines ofcargo run -p trios-chat --bin e2e_chat_25(25 checks). The bin usesOsRng, so only the PASS/FAIL lines are compared, not bytes.golden/falsifier.stdout,golden/falsifier.skips(count ofskip bad lineon stderr) andgolden/falsifier.exitforcargo run -p trios-chat --bin falsifier_runner.src/bin/golden_vectors.rsandgolden/vectors.txt. The bin prints, deterministically:laws_hash();pad_class/unpadfor payload lengths 0, 1, 252, 253, 1020, 4093, 16380, 16381;dest_hashof a fixed X25519 public key;- a sealed envelope built with fixed secrets and nonce
[1; 12](exact bytes); Chain::from_root(RootKey([7; 32]), b"send")and the first Nsend_next()keys, nonces and counters;dh_stepanddh_kem_stepoutputs;recv_acceptsequences that cover replay, rollback and skipped paths;PrekeyBundleBody::canonical_bytes,CapabilityTokenandToolManifestsigning bytes;- the
validate_outputverdict and matched pattern for every line ofcorpus/prompt_injection.jsonlplus a few benign strings.
T27_PIN- empty table with columns: file, spec path, t27 SHA, t27c built_by, sha256 (always), seal file (orunsealed on master, a separate column).tests/t27_pin.rs- for every row ofT27_PIN, computes sha256 of the vendored file with thesha2crate and compares. With an empty table it passes trivially. Addssha2 = "0.10"under[dev-dependencies]ofcrates/trios-chat/Cargo.toml(the rings already use 0.10).
6a.tests/laws_hash.rs- asserts thattrios_chat::r_chat::laws_hash()equalsd8c962d0cfe111bf72f9d59f2296baf015ff5c9f0390cf807b7cc08c706f3a98, so the later LAWS swap does not add a test to the frozen test list.T27_EXCEPTIONS.md- the files that stay hand-written Rust, each with category, reason and what would lift it. Proposed list, marked "proposed, pending owner decision D11" until it is approved:rings/BR-IO-CHAT-05/src/entities/chat_envelope.rs,rings/BR-IO-CHAT-05/src/entities/mod.rs,rings/BR-IO-CHAT-05/src/lib.rs,rings/BR-IO-CHAT-05/src/migrations/m2026_05_09_000001_create_chat_envelope.rs,rings/BR-IO-CHAT-05/src/migrations/mod.rs,src/lib.rs,rings/CR-CHAT-06/src/lib.rs,src/bin/e2e_chat_25.rs.
No .sh files: ROADMAP operational invariant L1 forbids them, so the pin check is a Rust test.
Numbers measured in a scratch workspace (to be replaced by the lockfile run)
The scratch run used a copy of crates/trios-chat at 8b229e9, a minimal workspace manifest, rustc 1.94.0 and fresh crates.io resolution, not this repository's Cargo.lock. Do not quote these numbers until the lockfile run confirms them.
| Package | Tests passed (scratch) |
|---|---|
| CR-CHAT-00 | 9 |
| CR-CHAT-01 | 476 |
| CR-CHAT-02 | 431 |
| CR-CHAT-03 | 520 |
| CR-CHAT-04 | 395 |
| CR-CHAT-05 | 436 |
| CR-CHAT-06 | 404 |
| CR-CHAT-07 | 381 |
| CR-CHAT-LAWS | 4 |
| BR-OUTPUT-CHAT | 4 |
| BR-IO-CHAT-07 | 6 (tokio tests, paused clock) |
| BR-IO-CHAT-05 | 1 (returns early without DATABASE_URL, so it checks nothing; owner decision D12) |
| trios-chat r_chat_guard | 3 |
| Total | 3,070 |
- e2e_chat_25: 25/25 PASS, exit 0.
- falsifier_runner: 3147/3200 blocked, 400 lines skipped (
prompt/expectedkeys instead ofpayload/expected_block), exit 1. Categories below 95%: confirmation_tag_chain 44/50, sender_data_header_encryption 36/50, group_context_extensions_consistency 36/50, leaf_node_signature_validation 31/50. - laws_hash:
d8c962d0cfe111bf72f9d59f2296baf015ff5c9f0390cf807b7cc08c706f3a98(recomputed 2026-10-10).
Acceptance criteria
cargo run -p trios-chat --bin golden_vectors | diff - crates/trios-chat/golden/vectors.txtprints nothing, and a second run prints nothing too (deterministic).- For every package,
cargo test -p <pkg> -- --list 2>/dev/null | grep ': test$' | sort | diff - crates/trios-chat/golden/test-names/<pkg>.txtprints nothing. cargo run -p trios-chat --bin e2e_chat_25 | grep -E 'PASS|FAIL' | diff - crates/trios-chat/golden/e2e_pass.txtprints nothing.cargo run -p trios-chat --bin falsifier_runner > "$OUT/f.out" 2> "$OUT/f.err"; echo $?prints the code ingolden/falsifier.exit;diff "$OUT/f.out" crates/trios-chat/golden/falsifier.stdoutprints nothing;grep -c 'skip bad line' "$OUT/f.err"equalsgolden/falsifier.skips.cargo test -p trios-chat --test t27_pinpasses;cargo test -p trios-chat --test laws_hashpasses.find crates/trios-chat -name '*.sh' | wc -lprints0.- The required checks
no-js-check,Test,Constitutional Enforcementandguardare green on the latest SHA. The PR body starts with aClosesline for this issue and carries an "L16 rationale:" line for clippy (trios LAWS L3, L16).
Out of scope
Fixing any behaviour. Each quirk found is recorded in a separate behaviour-quirks issue under the epic (not filed yet) and fixed, if the owner decides so, in its own earlier PR.
Dmitrii Fedorov (@dmitrii-f-t27)
Activity
style(trios-chat): golden_vectors source is ASCII-only (unicode escap…
test(trios-chat): add BR-IO-CHAT-07 to the frozen baseline (6/6)