Repository navigation
W0: remove the 0.13 command line from rebuild, CLI stub and dependency check - #184
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>
…-check validate_set, validate_do and validate_get check a request against a device description and its state before anything reaches the camera. One refusal order for the whole request: invalid, unsupported, out_of_range, conflict, asleep, then path order. check_value covers Fit::Write and Fit::State; check_description reports the flaws of an inconsistent description. Fixes #173 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
obsbot_proto::schema::protocol_schema builds the draft 2020-12 schema (oneOf Request and ServerMessage, $defs including Description) from the protocol types; schema_text is the file content. tests/schema.rs fails when schema/protocol-2.json is missing or differs, and rewrites it when OBSBOT_REGENERATE is set. A second test checks that $defs holds every envelope, the description types and all 12 error codes. Fixes #174 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nd hand-over
Adds tests/golden/session.jsonl, errors.jsonl and hotplug.jsonl ("> " client
lines, "< " daemon lines, "#" comments) and tests/transcripts.rs. The test
round-trips every line byte for byte, checks that errors.jsonl holds the 12
error codes in the order of 4.1, that revs only go up per entry and a state
event names a listed device, that the hand-over is devices with replaced_by,
devices without the old entry, then state, and that no golden file names a
product id other than fef9 or the synthetic fa0x ids.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…try types Adds obsbot_device::contract (design spec 8.2, 10.3 W0, plan task 5): camera.rs (Camera, CameraError, Tier, Group, LiveTier, Need, Identity, Target, Ctx, Motion, Frame, SendEntry, SendTable), transport.rs (Transport, ControlRange, OnAir), bus.rs (UsbId, IdentitySource, ModelEntry, Registry, Lookup, Found, Bus) and the conformance stub that task 7 fills. The carried code is untouched. Fixes #176 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Deletes the 0.13 cli, client, daemon and proto modules of the obsbot4linux crate, the CLI surface guard of stage G (tests/cli_surface.rs and its fixture) and legacy/full_status.rs of obsbot-device. legacy/state.rs and legacy/current_pose.rs stay. main.rs becomes a stub that prints a message and exits 1; the only dependency of the CLI crate is obsbot-proto. scripts/check-cli-deps.sh reads cargo metadata and fails when the CLI's [dependencies] contain obsbot-device or obsbot4linuxd (spec section 3); the test job of ci.yml runs it. The scripted test double loses Answer::Rejected: only the removed full_status tests constructed it. Fixes #177 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The dependency check piped cargo metadata into jq, so a failing cargo metadata gave jq empty input and the script exited 0. The output is now captured first (set -e aborts on failure) and an empty dependency list is an error. The legacy module doc still said the 0.13 daemon and CLI use it; they are removed, the carried Tiny 2 Lite flows are the only users. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
nofuturekid
force-pushed
the
fix/177-w0-6-cli-cut
branch
from
November 13, 2026 17:19
5bab1ec to
7eec085
Compare
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 #177
Stacked on #179 (the base stays
rebuild; until #179 lands, its commit shows in this diff too). Plan Task 6 ofdocs/superpowers/plans/2026-11-13-obsbot4linux-w0-contracts.md. No camera I/O and no byte sent to a camera changes: the removed code is the 0.13 command line, daemon, client, protocol and full status; the carried device code and its byte guard are untouched.What changed
crates/obsbot4linux/src/{cli,client,daemon,proto}.rs,crates/obsbot-device/src/legacy/full_status.rs(and itspub modline), and stage G's CLI guardcrates/obsbot4linux/tests/cli_surface.rswithtests/fixtures/cli-surface.txt.legacy/state.rsandlegacy/current_pose.rsare unchanged.crates/obsbot4linux/src/main.rsis the plan's stub (message on stderr, exit 1).[dependencies]of the CLI crate isobsbot-protoonly;Cargo.lockfollows.scripts/check-cli-deps.sh(cargo metadata and jq): fails when the CLI's[dependencies]containobsbot-deviceorobsbot4linuxd. New stepscripts/check-cli-deps.shin jobtestofci.yml, aftercargo test.Adaptations to the plan (the plan is corrected afterwards)
tests/cli_surface.rs(+ fixture), as the plan says "G's--helpcomparison among them";crates/obsbot4linux/tests/is now gone.crates/obsbot-device/src/scripted.rs: the variantAnswer::Rejectedand its match arm are removed. Only the removedfull_statustests constructed it, socargo clippy --all-targets -- -D warningsfails withvariant Rejected is never constructedwithout this. The real parsing of a rejected answer stays covered byfamily/frame.rsandfamily/exchange.rs(Error::Rejected(COMMAND, -3)), which do not use the double's variant.scripts/check-cli-deps.sh: the last line isecho "CLI dependencies: $(printf '%s' "$deps" | paste -sd' ' -)"instead ofprintf '%s ' $deps. The plan's line failsshellcheck(SC2086) and prints a trailing space; this one passes shellcheck and prints exactlyCLI dependencies: obsbot-proto.scripts/check-cli-deps.sh(fix round):cargo metadatais captured in a variable before it goes tojq, and an empty dependency list is an error, so a failingcargo metadatano longer ends in exit 0. Mutation:obsbot4linuxd.workspace = truein the CLI's[dependencies]now exits 101 with cargo's error (before: exit 0);obsbot-device.workspace = truestill prints the spec message and exits 1.crates/obsbot-device/src/legacy/mod.rs: the module doc no longer says the 0.13 daemon and CLI use it; it names the carried Tiny 2 Lite flows (state,current_pose) as the users until track A rewrites them.git grepexpectation is met forcrates/. Two lines indocs/center-parity.md(18 and 172) still namelegacy/full_status.rs(CAPABILITIES); the plan does not list that file for this task, so it is left for the docs task.Removed tests (34) and why none covered code that stays
Each one tested the removed code. One caveat: the four
full_status_withtests also ran the carried read methodsaudio_volume,live_pose,zoom_factor,statusandtrackingthrough the scripted device (for example audio 55, pose 25/10, zoom 2.0). Their decoders keep their own unit tests; the end-to-end test ofCamera::audio_volumegoes away with this removal (no other caller or test remains) until track A rewrites the reads.legacy/full_status.rs(7):hand_serialises_area_and_a_null_return,zone_serialises_with_return_as_key,model_and_device_are_top_level_keys(serialisation ofFullStatus,ZoneInfo),a_rejected_tracking_query_gives_tracking_null_and_the_rest_of_the_status,an_answered_tracking_query_is_in_the_status,any_other_tracking_error_fails_the_whole_read,the_target_is_asked_only_while_ai_tracking_is_on(all four callfull_status_with, removed with the file; the camera methods it called are covered by their own tests infamily/andmodels/tiny2lite/).obsbot4linux/src/cli.rs(7):led_keeps_its_plain_brightness_and_gains_blink,startup_set_takes_ai_alone_or_with_a_pose_and_only_verified_modes,wake_without_arguments_still_wakes,exposure_manual_takes_time_and_gain_and_volume_is_bounded,gimbal_and_zoom_keep_their_syntax_and_gain_subcommands,framing_commands_parse,detect_prints_the_model_and_the_streaming_node(clap parsing of the 0.13 command line).obsbot4linux/src/client.rs(2):watch_fails_when_the_daemon_goes_away,watch_ends_normally_when_its_reader_goes_away(0.13 socket client).obsbot4linux/src/daemon.rs(12):a_lost_camera_is_announced_once_with_null_model_and_device,a_change_announces_nothing_until_the_camera_is_read_again,identity_is_kept_once_answered_and_dropped_with_the_camera,target_box_jitter_is_not_a_change_but_detected_is,reads_are_told_from_the_parsed_command_not_from_argv,stops_keep_the_zone_cache_other_moves_drop_it,preset_changes_drop_the_cache_so_the_new_list_is_broadcast,the_pose_is_polled_while_any_connection_wants_it,repeated_on_from_one_connection_needs_only_one_off,live_pose_is_a_request_for_the_connection_not_a_camera_command,a_second_daemon_does_not_take_over_the_socket,a_stale_socket_is_replaced(0.13 daemon loop and socket handling).obsbot4linux/src/proto.rs(4):request_and_response_serialise_as_documented,every_client_gets_the_event_and_new_clients_the_last_state,a_closed_client_is_dropped_and_does_not_stop_the_broadcast,a_client_that_does_not_read_is_disconnected(0.13 wire protocol and broadcast).obsbot4linux/tests/cli_surface.rs(2):help_texts_are_unchanged,version_is_the_package_version(compare the 0.13--helptexts with a fixture; the binary no longer has them).obsbot-device/tests/byte_guard.rs(the byte guard of the carried device code) stays and passes. Device lib tests: 164 pass (171 before: the 7 removed above).Verification (CARGO_TARGET_DIR outside the repo, nice, -j 3)
cargo fmt --check: clean.cargo clippy --workspace --all-targets --locked -- -D warnings: clean.cargo test --workspace --locked: all pass (device 164, byte_guard 1, proto 10 + types 4).cargo build --workspace: succeeds.scripts/check-cli-deps.sh: printsCLI dependencies: obsbot-proto, exit 0.obsbot-device.workspace = trueadded to the CLI's[dependencies]the script printsthe obsbot4linux CLI depends on obsbot-device; only obsbot-proto is allowed (spec section 3)and exits 1; reverted.cargo run -q -p obsbot4linux: printsobsbot4linux: the 1.0 command line is not built yet (stage W0 of the 1.0 rebuild), exit 1 (the binary was run once, without any device access: the stub opens nothing).actionlint .github/workflows/ci.ymlandshellcheck scripts/check-cli-deps.sh: clean.git grep -n 'full_status\|FullStatus\|ZoneInfo\|CAPABILITIES' crates/: no match.requiredcheck and the packaging jobs are green at the previous head; its log shows the new step printingCLI dependencies: obsbot-proto.AI-assisted (Claude Code).
🤖 Generated with Claude Code