Repository navigation
W0: protocol 2 types in obsbot-proto - #179
Merged
Merged
Conversation
Adds the crate crates/obsbot-proto with the protocol 2 envelopes (request, reply, event, error), the device and description types with their builders, state and patch types with path helpers, the id and value helpers, and stubs for client, validate (holding Refusal) and schema. Maps are sorted, integral numbers are written without a fraction, and public enums carry a catch-all variant so additive values of a newer daemon still parse. tests/types.rs round-trips every line of tests/golden/types.jsonl byte for byte through its type. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This was referenced Nov 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #178
Task 1 of docs/superpowers/plans/2026-11-13-obsbot4linux-w0-contracts.md.
What changed
crates/obsbot-proto(serde, serde_json, schemars):ids,values,description(types and builders),state(State, Patch, path helpers),message(Request withfrom_line, Reply, Event, ErrorBody, ErrorCode), and stubs forclient,validate(holdingRefusal) andschema.Cargo.toml: membercrates/obsbot-proto; workspace dependenciesobsbot-protoandschemars = "1.2".Cargo.lockgains schemars and its dependencies.tests/types.rswithtests/golden/types.jsonl: every golden line round-trips byte for byte through its type (24 type names).Adaptations to the plan
Cargo.tomllists its members explicitly (nocrates/*glob), so"crates/obsbot-proto"was added tomembers.serdeandserde_jsonwere already in[workspace.dependencies]in the plan's form. No other adaptation was needed.Verification
cargo test -p obsbot-proto --test typesfailed to compile (unresolvedVerb,Support, ... ), as the plan expects.cargo test -p obsbot-proto: 10 unit tests (ids 2, values 4, state 4) and 4 tests intests/types.rspass.cargo test --locked: all pass (171 + 25 + 10 + 4 + 2 + 1 tests).cargo fmt --check: clean.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.Support,SettingType,Unit,ErrorCodevalues and an unknown event type parse (additive_values_from_a_newer_daemon_still_parse).values::numberno longer writes integral numbers as integers:integral_numbers_are_written_without_a_fractionandrounding_removes_float_noisefail.Support::Othermade#[serde(skip)]instead of#[serde(untagged)]:every_golden_line_round_trips_byte_equalandadditive_values_from_a_newer_daemon_still_parsefail.Contract note (spec 10.1): these types are the protocol 2 contract; later tasks and tracks build on them without changing them.