Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ members = [
"crates/trios-chat/rings/BR-OUTPUT-CHAT",
"crates/trios-chat/rings/BR-IO-CHAT-05",
"crates/trios-chat/rings/BR-IO-CHAT-07",
"crates/trios-chat",
# Rust backend consolidation (Wave 0) — domain scaffolds
"crates/trios-agent-loop",
"crates/trios-agent-loop/rings/AL-00",
Expand Down
7 changes: 7 additions & 0 deletions crates/trios-chat/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ path = "src/bin/e2e_chat_25.rs"
name = "falsifier_runner"
path = "src/bin/falsifier_runner.rs"

# Deterministic behaviour vectors (no OsRng); output frozen in golden/vectors.txt.
[[bin]]
name = "golden_vectors"
path = "src/bin/golden_vectors.rs"

[dependencies]
# Re-export ring — the only allowed runtime dep.
trios-chat-br-output = { path = "rings/BR-OUTPUT-CHAT" }
Expand All @@ -37,3 +42,5 @@ serde_json = { workspace = true }

[dev-dependencies]
rand = { workspace = true }
# tests/t27_pin.rs: SHA-256 of each vendored t27c gen-rust file listed in T27_PIN.
sha2 = "0.10"
29 changes: 29 additions & 0 deletions crates/trios-chat/T27_EXCEPTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# T27 exceptions: files that stay hand-written Rust

**Status: proposed, pending owner decision D11.** Nothing in this list is
approved yet. Until it is, every file below is still counted as "not ported".

Plan: every file of `crates/trios-chat` is either written once in `.t27` and
swapped for `t27c gen-rust` output (see `T27_PIN`), or listed here with a
reason. Law L0 PURPOSE (`docs/T27-CONSTITUTION.md` in gHashTag/t27) names the
seed (t27c) and the interface as the exceptions; the rows below argue why each
file is interface, glue or an acceptance gate rather than logic.

Line counts: `git show 8b229e9489ee:crates/trios-chat/<file> | wc -l`.

| File (under `crates/trios-chat/`) | Category | Reason | What would lift it | Lines of Rust kept |
|---|---|---|---|---:|
| `rings/BR-IO-CHAT-05/src/entities/chat_envelope.rs` | io-plumbing | SeaORM `DeriveEntityModel` struct for the `chat_envelope` table; the derive macros are the interface to SeaORM, no decision logic. Stage-9 (I/O) dependency. | t27c support for emitting SeaORM entities, or a generated schema module the ring includes. | 46 |
| `rings/BR-IO-CHAT-05/src/entities/mod.rs` | glue | One `pub mod` line plus docs. | Nothing to port; it disappears if the entities move to generated code. | 6 |
| `rings/BR-IO-CHAT-05/src/lib.rs` | glue | Module declarations and re-exports of `Migrator`, `AsyncStore`, `PgChatStore`. | Nothing to port. | 31 |
| `rings/BR-IO-CHAT-05/src/migrations/m2026_05_09_000001_create_chat_envelope.rs` | migration | sea-orm-migration `MigrationTrait` (async DDL). Stage-9 (I/O) dependency; migrations are append-only history. | t27c support for async/DDL output; a new migration written in .t27 from then on. | 87 |
| `rings/BR-IO-CHAT-05/src/migrations/mod.rs` | io-plumbing | `MigratorTrait` impl listing the migrations (async-trait). | Same as the migration row. | 22 |
| `rings/CR-CHAT-06/src/lib.rs` | glue | 42 `pub mod` lines and their `pub use` re-exports; no functions, no tests. | Nothing to port. | 254 |
| `src/lib.rs` | glue | The shim: `pub use trios_chat_br_output::*;` plus docs. | Nothing to port. | 29 |
| `src/bin/e2e_chat_25.rs` | bin gate | The acceptance binary (25 PASS/FAIL checks over OsRng keys) that proves a swap kept behaviour; it must stay independent of the code it judges. | Never, while it is the swap gate. | 265 |
| **Total** | | | | **740** |

Not in this list yet (decided in later waves, see the trios epic): crypto call
sites inside the adapters (x25519-dalek, ed25519-dalek, chacha20poly1305,
ml-kem, hkdf/hmac, sha2, subtle, zeroize, rand_core) and the injection deny
table, if its flat-table probe fails.
19 changes: 19 additions & 0 deletions crates/trios-chat/T27_PIN
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# T27_PIN: t27c gen-rust files vendored into crates/trios-chat.
#
# One row per vendored file (rings/<R>/src/t27gen/<stem>.rs). Columns are
# separated by " | ":
# file path relative to crates/trios-chat/
# spec path .t27 spec path in gHashTag/t27
# t27 SHA 40-hex gHashTag/t27 commit the spec was generated from
# t27c built_by the built_by string of the t27c that generated the file
# sha256 64-hex lowercase SHA-256 of the vendored file (always filled)
# seal file .trinity/seals/<file>.json on that t27 SHA, or "unsealed on master"
#
# tests/t27_pin.rs recomputes the sha256 of every row. Lines starting with '#'
# and blank lines are ignored.
file | spec path | t27 SHA | t27c built_by | sha256 | seal file
rings/CR-CHAT-01/src/t27gen/key_package_expiry_guard.rs | specs/port/trios/crates/trios-chat/rings/CR-CHAT-01/src/key_package_expiry_guard.t27 | 5e5493cabbb99f21f8f9f6e3a00150fb3eb0d230 | t27c-bootstrap@0.5.2+5e5493cab | 8d2546de4d8190f114e46cb2b78c765099d4897c9444a869f3ba2cae5f83a469 | src_port::trios::crates::trios-chat::rings::CR-CHAT-01::src::key_package_expiry_guard.json
rings/CR-CHAT-02/src/t27gen/epoch_rollover_wraparound_guard.rs | specs/port/trios/crates/trios-chat/rings/CR-CHAT-02/src/epoch_rollover_wraparound_guard.t27 | 5e5493cabbb99f21f8f9f6e3a00150fb3eb0d230 | t27c-bootstrap@0.5.2+5e5493cab | 3760df6b099c9707630cc63f6d3ed619cbd43b7703a80f52c6ee04aa23a9f085 | src_port::epoch_rollover_wraparound_guard.json
rings/CR-CHAT-03/src/t27gen/ratchet_tree_resolution_guard.rs | specs/port/trios/crates/trios-chat/rings/CR-CHAT-03/src/ratchet_tree_resolution_guard.t27 | 5e5493cabbb99f21f8f9f6e3a00150fb3eb0d230 | t27c-bootstrap@0.5.2+5e5493cab | abcaf63f0885ca8e86b8e107171df4a8472f7a37b6ca04921c1799a9e40e907a | src_port::ratchet_tree_resolution_guard.json
rings/CR-CHAT-03/src/t27gen/unmerged_leaves_bound_guard.rs | specs/port/trios/crates/trios-chat/rings/CR-CHAT-03/src/unmerged_leaves_bound_guard.t27 | 5e5493cabbb99f21f8f9f6e3a00150fb3eb0d230 | t27c-bootstrap@0.5.2+5e5493cab | 868119eb230928668fbacd538d007340e597e46ea077ab99270d034f089d7db6 | src_port::unmerged_leaves_bound_guard.json
rings/CR-CHAT-07/src/t27gen/cover_decoy_ratio_governor.rs | specs/port/trios/crates/trios-chat/rings/CR-CHAT-07/src/cover_decoy_ratio_governor.t27 | 5e5493cabbb99f21f8f9f6e3a00150fb3eb0d230 | t27c-bootstrap@0.5.2+5e5493cab | 27399ff1575851a119ecc0bc4ca1fc2527a4bf089ad0831e157233a61859835f | src_port::cover_decoy_ratio_governor.json
25 changes: 25 additions & 0 deletions crates/trios-chat/golden/e2e_pass.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
PASS T01_identity_bundle_keys_distinct
PASS T02_safety_number_symmetric
PASS T03_prekey_bundle_verifies
PASS T04_prekey_tampered_rejected
PASS T05_ratchet_chain_advances
PASS T06_ratchet_replay_rejected
PASS T07_ratchet_rollback_rejected
PASS T08_sealed_roundtrip
PASS T09_sealed_wrong_recipient_fails
PASS T10_sealed_tamper_rejected
PASS T11_padding_classes_exact
PASS T12_padding_no_short_leak
PASS T13_padding_unpad_roundtrip
PASS T14_capability_issue_verify
PASS T15_capability_expired_rejected
PASS T16_capability_wrong_signer_rejected
PASS T17_capability_scope_enforced
PASS T18_tool_manifest_signed
PASS T19_tool_manifest_tamper_detected
PASS T20_injection_basic_blocked
PASS T21_injection_benign_passes
PASS T22_trust_levels_distinct
PASS T23_laws_count_12
PASS T24_protocol_version_v1
PASS T25_full_pipeline_smoke
1 change: 1 addition & 0 deletions crates/trios-chat/golden/falsifier.exit
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
1 change: 1 addition & 0 deletions crates/trios-chat/golden/falsifier.skips
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
400
Loading
Loading