Skip to content

Swap pilot: five chat guards run t27c gen-rust output behind adapters; original tests unchanged #1895

Open

Description

@dmitrii-f-t27

Part of #1812. Uses the baseline of #1825 (PR #1827).

Goal

Prove the swap end to end on the 5 trios-chat ports that are already merged in gHashTag/t27 and whose t27c gen-rust output compiles. Record the cost per file (minutes and adapter lines) so the remaining waves are estimated from measurements.

Files

Original file (under crates/trios-chat/) t27 spec (merged in gHashTag/t27) Seal on t27 master Generated verdict shape
rings/CR-CHAT-01/src/key_package_expiry_guard.rs PR 8187 src_port::trios::crates::trios-chat::rings::CR-CHAT-01::src::key_package_expiry_guard.json i32 codes KPX_OK..KPX_ZERO_LIFETIME
rings/CR-CHAT-02/src/epoch_rollover_wraparound_guard.rs PR 7647 src_port::epoch_rollover_wraparound_guard.json enum with an extra Ok variant
rings/CR-CHAT-03/src/ratchet_tree_resolution_guard.rs PR 8461 src_port::ratchet_tree_resolution_guard.json struct { ok, error }; RTRS_MAX_RESOLUTION is u32 in the port, usize in the original
rings/CR-CHAT-03/src/unmerged_leaves_bound_guard.rs PR 8445 src_port::unmerged_leaves_bound_guard.json i32 codes
rings/CR-CHAT-07/src/cover_decoy_ratio_governor.rs PR 7969 src_port::cover_decoy_ratio_governor.json i32 codes

Files this PR touches

Owner work done by dmitrii-f-t27 in PR (linked below); not a bee task, please do not shape or dispatch it.

  • crates/trios-chat/rings/CR-CHAT-01/src/key_package_expiry_guard.rs
  • crates/trios-chat/rings/CR-CHAT-01/src/t27gen/key_package_expiry_guard.rs
  • crates/trios-chat/rings/CR-CHAT-02/src/epoch_rollover_wraparound_guard.rs
  • crates/trios-chat/rings/CR-CHAT-02/src/t27gen/epoch_rollover_wraparound_guard.rs
  • crates/trios-chat/rings/CR-CHAT-03/src/ratchet_tree_resolution_guard.rs
  • crates/trios-chat/rings/CR-CHAT-03/src/t27gen/ratchet_tree_resolution_guard.rs
  • crates/trios-chat/rings/CR-CHAT-03/src/unmerged_leaves_bound_guard.rs
  • crates/trios-chat/rings/CR-CHAT-03/src/t27gen/unmerged_leaves_bound_guard.rs
  • crates/trios-chat/rings/CR-CHAT-07/src/cover_decoy_ratio_governor.rs
  • crates/trios-chat/rings/CR-CHAT-07/src/t27gen/cover_decoy_ratio_governor.rs
  • crates/trios-chat/rings/CR-CHAT-01/Cargo.toml, CR-CHAT-02/Cargo.toml, CR-CHAT-03/Cargo.toml, CR-CHAT-07/Cargo.toml (only a [lints.rust] check-cfg entry)
  • crates/trios-chat/T27_PIN

User Scenarios

  • Given the five original guard files at trios 8b229e9489ee, when their logic is replaced by t27c gen-rust output behind an adapter, then every original test of the four rings passes unchanged and the frozen e2e, falsifier and vector outputs are identical.
  • Given a vendored generated file, when one comparison in it is flipped, then at least one original test fails; when it is regenerated, all pass again.

Requirements

  • FR-001: each rings/<R>/src/t27gen/<stem>.rs MUST be byte-identical to t27c gen-rust output at the t27 SHA recorded in T27_PIN, and its sha256 MUST equal the seal's gen_hash_rust.
  • FR-002: each rings/<R>/src/<stem>.rs MUST keep the original pub consts (original types), error enums with derives and #[non_exhaustive], docs and the original #[cfg(test)] module byte for byte.
  • FR-003: generated items MUST stay private (mod t27gen, never pub mod).
  • FR-004: no new compiler warnings outside mod t27gen.

Success Criteria

  1. For each of trios-chat-cr-chat-01, -02, -03, -07: cargo test -p <pkg> -- --list 2>/dev/null | grep ': test$' | sort | diff - crates/trios-chat/golden/test-names/<pkg>.txt prints nothing, and cargo test -p <pkg> reports the baseline count with 0 failed.
  2. For each swapped file: diff <(git show 8b229e9489ee:crates/trios-chat/rings/<R>/src/<stem>.rs | sed -n '/^#.cfg(test)./,$p') <(sed -n '/^#.cfg(test)./,$p' crates/trios-chat/rings/<R>/src/<stem>.rs) prints nothing.
  3. $T27C gen-rust <spec> | cmp - crates/trios-chat/rings/<R>/src/t27gen/<stem>.rs is silent with t27c built at the pinned SHA; shasum -a 256 of each vendored file equals the seal's gen_hash_rust.
  4. cargo test -p trios-chat --test t27_pin passes (5 rows); cargo test -p trios-chat --test r_chat_guard gives 3/3.
  5. e2e_chat_25 PASS list, falsifier_runner stdout and exit code, and golden_vectors output are identical to golden/.
  6. Mutation proof for all 5 files: flipping one comparison in each t27gen/ file makes at least 1 original test fail; regenerating restores all tests, and cmp against fresh gen-rust output is silent. Counts in the PR.
  7. Minutes and adapter lines per file are recorded in the PR and copied to the epic.
  8. The required checks no-js-check, Test, Constitutional Enforcement and guard are green on the latest SHA.

Not in this issue

  • The t27 issues 7634, 8366 and 8125 stay open although their PRs merged; closing them needs triage rights on gHashTag/t27.
  • The ratchet_tree_resolution_guard spec asserts only ok / not ok. Making its tests assert the exact variant is a W1 follow-up in gHashTag/t27.

Dmitrii Fedorov (@dmitrii-f-t27)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions