Skip to content

feat: carry collaboration config in the protocol crate (lockstep) - #35

Merged
saucam merged 1 commit into
mainfrom
feat/collab-protocol-lockstep
Jul 26, 2026
Merged

feat: carry collaboration config in the protocol crate (lockstep)#35
saucam merged 1 commit into
mainfrom
feat/collab-protocol-lockstep

Conversation

@saucam

@saucam saucam commented Jul 26, 2026

Copy link
Copy Markdown
Collaborator

Lockstep half of the daemon change in highflame-ai/codeoid#248 (collaborative sessions P1a). CONTRIBUTING requires this crate to move in the same change set as the daemon's packages/protocol/.

What changed

  • session.rsCollaborationConfig + CollaborationRole, camelCase on the wire; optional collaboration on SessionInfo.
  • client.rs — optional collaboration on ClientMessage::SessionCreate.
  • lib.rs — re-export the two new types.
  • app.rs — the TUI's session_create_message builder passes None. The collaborative create dialog is a later phase; this only keeps the builder compiling.
  • Six SessionInfo test fixtures gain collaboration: None.

name and provider_id are plain Strings rather than enums on purpose: the role taxonomy is data on the daemon side, so a new role like security-reviewer must not require a release of this crate to parse.

PROTOCOL_VERSION deliberately not bumped

It stays at 1 on both sides.

CONTRIBUTING says "if you change codeoid-protocol, bump PROTOCOL_VERSION", but its very next sentence says the protocol is additive-safe, and lib.rs scopes the bump to "any breaking change." This change is purely additive — new optional fields with #[serde(default, skip_serializing_if = "Option::is_none")].

Bumping only this crate would manufacture a version-mismatch warning on every connect against a daemon that is otherwise fully compatible. Happy to bump both sides if you read the rule the other way — it's a one-line change in each repo.

Verification

  • cargo build, cargo clippy --all-targets, and cargo test --workspace all green — 316 tests. No new clippy warnings (the result_large_err ones in codeoid-client are pre-existing).
  • Note cargo build alone does not compile tests; the fixture breakage only surfaced under --all-targets.
  • The existing wire_format camelCase test walks nested objects and arrays, so populating the SessionInfo fixture with a two-role collaboration genuinely asserts collaboration.roles[N].providerId serializes as camelCase. Not a vacuous fixture edit — a rename_all slip on either new struct fails that test.

🤖 Generated with Claude Code

Lockstep half of the daemon's "collaboration config on session.create"
(collaborative sessions P1a). CONTRIBUTING requires the Rust protocol crate
to move in the same change set as `packages/protocol/`.

- session.rs: CollaborationConfig + CollaborationRole, camelCase on the wire.
  `name` and `provider_id` are plain strings, not enums — the role taxonomy is
  data on the daemon side, so a new role like "security-reviewer" must not
  need a release of this crate to parse.
- client.rs: optional `collaboration` on ClientMessage::SessionCreate.
- session.rs: optional `collaboration` on SessionInfo.
- app.rs: the TUI's create path passes None — the collaborative create dialog
  is a later phase; this only keeps the frame builder compiling.

PROTOCOL_VERSION deliberately NOT bumped. It stays at 1 on both sides. The
change is purely additive (new optional fields), which CONTRIBUTING calls
additive-safe and lib.rs scopes the bump to "any breaking change". Bumping
only this crate would manufacture a version-mismatch warning on every connect
against a daemon that is otherwise fully compatible.

Verified: the existing wire_format camelCase test walks nested objects AND
arrays, so populating the SessionInfo fixture with a two-role collaboration
genuinely asserts `collaboration.roles[N].providerId` serializes camelCase —
it is not a vacuous fixture change.

cargo build + clippy + test green across the workspace (314 tests).
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@saucam
saucam merged commit 5d65ea1 into main Jul 26, 2026
3 checks passed
saucam added a commit that referenced this pull request Jul 26, 2026
Lockstep half of the daemon's P1b (highflame-ai/codeoid#250-ish — collaboration
role-children). CONTRIBUTING requires this crate to move with the daemon's
packages/protocol.

- `write: Option<bool>` on CollaborationRole. None/false = read-only; the
  daemon turns that into a leaf identity with no write scope plus a hard tool
  deny at its fence, so a reviewer provably cannot write. Opt-in per role.
- New `CollaborationRoleRef` + `collaboration_role` on SessionInfo: parent
  session id, role name, ordinal, write. The mirror of `collaboration` (set on
  the orchestrating parent), so the TUI can group a fleet without inferring it
  from session names.
- Six SessionInfo fixtures gain `collaboration_role: None`.

PROTOCOL_VERSION stays at 1 on both sides, same reasoning as #35: purely
additive optional fields, which CONTRIBUTING calls additive-safe and lib.rs
scopes the bump to breaking changes. Bumping one side alone would manufacture a
mismatch warning against a fully compatible daemon.

The wire_format SessionInfo fixture now populates collaboration_role (a real
session is either a parent or a child, never both — populated anyway so the
recursive camelCase walker visits parentSessionId/roleName and would catch a
rename_all slip).

cargo build + clippy + test green: 354 tests, no new clippy warnings (7 before,
7 after on codeoid-protocol).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants