feat(broker): adopt running-process v1 broker session for the daemon wire#327
Merged
Conversation
…wire Bump running-process to 4.3.0 and migrate the clud daemon's broker frame lane onto the frozen v1 adoption API (zackees/running-process#436). - Add a WireMode { JsonLegacy, ProstV1 } selector at the daemon boundary. RUNNING_PROCESS_DISABLE=1 forces json-legacy + the direct TCP endpoint; every other launch uses prost-v1. Both arms decode into the same internal DaemonRequest/DaemonResponse model via wire_prost. - Replace the raw connect_to_backend/FrameClient path with BrokerSession::adopt: Hello sends service_name="clud", protocol 1..=1, client_lib_name="running-process", and wanted_version = the clud daemon version; clud payloads still ride the 0x7C4C frame lane. - Classify adoption failures through the typed RefusalKind enum (VersionUnsupported/VersionBlocked/ServiceUnknown/RateLimited/ ShuttingDown/Other) before degrading to the authoritative TCP wire. - Build the SHARED_BROKER ServiceDefinition through ServiceDefinitionBuilder, declaring min_version 2.0.0 and a consumer label, and publish a CacheManifest (runtime/lock/config/log roots) via CacheManifestBuilder at daemon bringup. - Surface wire_mode, min_version, and adopts_broker_session in the `daemon running-process` diagnostics (JSON + human output). The RUNNING_PROCESS_FAKE_BACKEND seam moved behind running-process's off-by-default test-seams feature in 4.3.0 (upstream #433 R4), so the seam test enables it via a dev-dependency only. Cargo unifies that into the cargo test build but not into `cargo build --bin clud`, keeping the production binary seam-free per the upstream rule. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
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.
Summary
Migrates the clud daemon's broker frame lane onto the frozen v1 running-process adoption API and bumps
running-process4.2.0 → 4.3.0. Implements zackees/running-process#436.WireMode { JsonLegacy, ProstV1 }selector at the daemon boundary.RUNNING_PROCESS_DISABLE=1forcesjson-legacy+ the direct TCP endpoint; every other launch usesprost-v1. Both arms decode into the same internalDaemonRequest/DaemonResponsemodel via the existingwire_prostadapters.BrokerSession::adoptreplaces the rawconnect_to_backend/FrameClientpath. Hello sendsservice_name="clud", protocol1..=1,client_lib_name="running-process", andwanted_version= the clud daemon version. clud payloads still ride the0x7C4Cframe lane; on any miss the call degrades to the authoritative legacy JSON-over-TCP wire.RefusalKindclassification (VersionUnsupported/VersionBlocked/ServiceUnknown/RateLimited/ShuttingDown/Other) logs the cause of a broker refusal before falling back, instead of silently swallowing it.ServiceDefinitionBuilderbuilds theSHARED_BROKERdefinition declaringmin_version2.0.0and aconsumer=cludlabel;CacheManifestBuilderpublishes the runtime/lock/config/log roots at daemon bringup.clud daemon running-process [--json]now surfaceswire_mode,min_version, andadopts_broker_session.The
RUNNING_PROCESS_FAKE_BACKENDseam moved behind running-process's off-by-defaulttest-seamsfeature in 4.3.0 (upstream #433 R4). The seam test enables it via a dev-dependency only — Cargo unifies that intocargo testbut not intocargo build --bin clud, so the production binary stays seam-free per the upstream rule.Test plan
cargo test -p clud --lib daemon::rp_broker— 10/10 pass (against published 4.3.0), incl. newwire_mode_select_maps_the_disable_hatch,publish_cache_manifest_records_clud_roots_and_round_trips, strengthened servicedef test (min_version 2.0.0 + consumer label), and the now-fixedfake_backend_seam_overrides_cached_endpoint.cargo test -p clud --lib daemon::— 120/120 pass (incl. allwire_prostJSON/prost parity tests).bash lint— clean (cargo fmt --check,clippy -D warnings, ruff).cargo build --bin cludverified seam-free (cargo tree -e normalshows notest-seamsedge).Note: one unrelated timing-flaky test (
process_tree::kill_tree_terminates_real_descendant_on_windows) tripped its threshold under serial full-suite load on a cold cache; it passes in isolation and is unrelated to these changes.Refs zackees/running-process#436
🤖 Generated with Claude Code