Skip to content

W0: remove the 0.13 command line from rebuild, CLI stub and dependency check - #184

Merged
nofuturekid merged 7 commits into
rebuildfrom
fix/177-w0-6-cli-cut
Nov 13, 2026
Merged

nofuturekid merged 7 commits into
rebuildfrom
fix/177-w0-6-cli-cut

Conversation

@nofuturekid

@nofuturekid nofuturekid commented Nov 13, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #177

Stacked on #179 (the base stays rebuild; until #179 lands, its commit shows in this diff too). Plan Task 6 of docs/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

  • Deleted crates/obsbot4linux/src/{cli,client,daemon,proto}.rs, crates/obsbot-device/src/legacy/full_status.rs (and its pub mod line), and stage G's CLI guard crates/obsbot4linux/tests/cli_surface.rs with tests/fixtures/cli-surface.txt. legacy/state.rs and legacy/current_pose.rs are unchanged.
  • crates/obsbot4linux/src/main.rs is the plan's stub (message on stderr, exit 1). [dependencies] of the CLI crate is obsbot-proto only; Cargo.lock follows.
  • New scripts/check-cli-deps.sh (cargo metadata and jq): fails when the CLI's [dependencies] contain obsbot-device or obsbot4linuxd. New step scripts/check-cli-deps.sh in job test of ci.yml, after cargo test.
  • No CHANGELOG line: nothing here is visible to a user of a release.

Adaptations to the plan (the plan is corrected afterwards)

  1. Stage G's tests of the old command line were tests/cli_surface.rs (+ fixture), as the plan says "G's --help comparison among them"; crates/obsbot4linux/tests/ is now gone.
  2. crates/obsbot-device/src/scripted.rs: the variant Answer::Rejected and its match arm are removed. Only the removed full_status tests constructed it, so cargo clippy --all-targets -- -D warnings fails with variant Rejected is never constructed without this. The real parsing of a rejected answer stays covered by family/frame.rs and family/exchange.rs (Error::Rejected(COMMAND, -3)), which do not use the double's variant.
  3. scripts/check-cli-deps.sh: the last line is echo "CLI dependencies: $(printf '%s' "$deps" | paste -sd' ' -)" instead of printf '%s ' $deps. The plan's line fails shellcheck (SC2086) and prints a trailing space; this one passes shellcheck and prints exactly CLI dependencies: obsbot-proto.
  4. scripts/check-cli-deps.sh (fix round): cargo metadata is captured in a variable before it goes to jq, and an empty dependency list is an error, so a failing cargo metadata no longer ends in exit 0. Mutation: obsbot4linuxd.workspace = true in the CLI's [dependencies] now exits 101 with cargo's error (before: exit 0); obsbot-device.workspace = true still prints the spec message and exits 1.
  5. 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.
  6. The plan's git grep expectation is met for crates/. Two lines in docs/center-parity.md (18 and 172) still name legacy/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_with tests also ran the carried read methods audio_volume, live_pose, zoom_factor, status and tracking through 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 of Camera::audio_volume goes 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 of FullStatus, 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 call full_status_with, removed with the file; the camera methods it called are covered by their own tests in family/ and models/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 --help texts 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: prints CLI dependencies: obsbot-proto, exit 0.
  • Mutation: with obsbot-device.workspace = true added to the CLI's [dependencies] the script prints the obsbot4linux CLI depends on obsbot-device; only obsbot-proto is allowed (spec section 3) and exits 1; reverted.
  • cargo run -q -p obsbot4linux: prints obsbot4linux: 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.yml and shellcheck scripts/check-cli-deps.sh: clean.
  • git grep -n 'full_status\|FullStatus\|ZoneInfo\|CAPABILITIES' crates/: no match.
  • CI: the required check and the packaging jobs are green at the previous head; its log shows the new step printing CLI dependencies: obsbot-proto.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

nofuturekid and others added 2 commits November 13, 2026 17:54
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>
@nofuturekid nofuturekid added the enhancement New feature or request label Nov 13, 2026
nofuturekid and others added 5 commits November 13, 2026 18:18
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
nofuturekid merged commit 7eec085 into rebuild Nov 13, 2026
21 checks passed
@nofuturekid
nofuturekid deleted the fix/177-w0-6-cli-cut branch November 13, 2026 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant