Skip to content

Commit c63a013

Browse files
committed
fix: clarify Matrix E2EE prototype gates
1 parent 2797ed3 commit c63a013

5 files changed

Lines changed: 23 additions & 9 deletions

File tree

crates/calciforge/src/channels/matrix.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -654,8 +654,11 @@ pub async fn run(
654654
.await
655655
.with_context(|| format!("Matrix: room '{room_id_str}' not accessible"))?;
656656

657-
let is_encrypted =
658-
check_room_encryption(&homeserver, &room_id_str, &http, &auth_header).await;
657+
let is_encrypted = if channel.matrix_e2ee == MatrixE2eeMode::Off {
658+
false
659+
} else {
660+
check_room_encryption(&homeserver, &room_id_str, &http, &auth_header).await
661+
};
659662
if let Some(error) = matrix_e2ee_startup_error(channel.matrix_e2ee, true, is_encrypted) {
660663
anyhow::bail!("{error}");
661664
}

crates/calciforge/src/channels/matrix_e2ee.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@ use std::path::Path;
88

99
use matrix_sdk::Client;
1010

11-
// Kept compile-gated until the Matrix channel loop is SDK-backed.
12-
#[allow(dead_code)]
11+
#[cfg_attr(
12+
not(test),
13+
expect(
14+
dead_code,
15+
reason = "experimental SDK scaffold is compile-gated until the Matrix loop is SDK-backed"
16+
)
17+
)]
1318
pub fn e2ee_client_builder(
1419
homeserver: &str,
1520
store_path: impl AsRef<Path>,

crates/calciforge/src/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ pub struct ChannelConfig {
398398
/// Matrix end-to-end encryption handling.
399399
///
400400
/// The production Matrix channel is still raw Client-Server API. Use
401-
/// `warn` to keep today's behavior, `require` to fail closed when the
402-
/// configured room is not encrypted, or `experimental-sdk` only on builds
403-
/// compiled with `channel-matrix-e2ee`.
401+
/// `warn` to keep today's behavior, `require` to fail closed unless an
402+
/// SDK-backed encrypted runtime is available, or `experimental-sdk` only
403+
/// on builds compiled with `channel-matrix-e2ee`.
404404
#[serde(default)]
405405
pub matrix_e2ee: MatrixE2eeMode,
406406

crates/calciforge/src/config/validator.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ fn validate_channels(config: &CalciforgeConfig, result: &mut ValidationResult) {
269269
}
270270
if channel.enabled && channel.allowed_users.is_empty() {
271271
result.add_error(
272-
"Matrix channel requires at least one allowed_user when enabled"
272+
"Matrix channel requires at least one allowed_users entry when enabled"
273273
.to_string(),
274274
);
275275
}
@@ -281,6 +281,12 @@ fn validate_channels(config: &CalciforgeConfig, result: &mut ValidationResult) {
281281
.to_string(),
282282
);
283283
}
284+
if channel.matrix_e2ee_store_passphrase_file.is_some() {
285+
result.add_warning(
286+
"Matrix channel sets matrix_e2ee_store_passphrase_file, but matrix_e2ee is not experimental-sdk; the passphrase file will be ignored"
287+
.to_string(),
288+
);
289+
}
284290
}
285291
MatrixE2eeMode::Require => {
286292
if channel.enabled && channel.room_id.is_none() {

docs/adr/0003-matrix-e2ee-prototype.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ title: "ADR 0003: Matrix E2EE Prototype"
55

66
# ADR 0003: Matrix E2EE Prototype
77

8-
Status: Experimental branch note
8+
Status: Experimental
99

1010
Date: 2026-05-12
1111

0 commit comments

Comments
 (0)