Skip to content
Merged
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
15 changes: 15 additions & 0 deletions crates/codeoid-protocol/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,21 @@ pub struct CollaborationRole {
/// to. Write authority is opt-in per role.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub write: Option<bool>,
/// Goal-blackboard artifact kinds this role may READ — `spec`, `research`,
/// `adr`, `task-list`, `diff`, `findings`, or `extra/<key>`.
///
/// `None` = the daemon's default profile for this role name; a role with no
/// profile and no declaration reads nothing. This is what makes reviewer
/// independence structural: `review` reads `diff`+`spec` and NOT
/// `research` or its peers' `findings`.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub reads: Option<Vec<String>>,
/// Artifact kinds this role may WRITE. `None` = the default profile for
/// this role name. A role writing a multi-writer kind (`findings`) writes
/// into its own slot, chosen daemon-side, so one reviewer can never
/// overwrite another's.
#[serde(default, skip_serializing_if = "Option::is_none")]
pub writes: Option<Vec<String>>,
}

/// Set on a role-CHILD of a collaborative session: which collaboration it
Expand Down
4 changes: 4 additions & 0 deletions crates/codeoid-protocol/tests/wire_format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ fn sample_session_info() -> SessionInfo {
count: None,
purpose: None,
write: None,
reads: None,
writes: None,
},
codeoid_protocol::CollaborationRole {
name: "review".into(),
Expand All @@ -136,6 +138,8 @@ fn sample_session_info() -> SessionInfo {
count: Some(3),
purpose: Some("independent critique".into()),
write: Some(false),
reads: Some(vec!["spec".into(), "diff".into()]),
writes: Some(vec!["findings".into()]),
},
],
}),
Expand Down
Loading