Skip to content

policy_client: config schema + SdkConfig wiring#249

Open
shantanuparab-tr wants to merge 5 commits into
mainfrom
06-15-policy-client-01-config-schema
Open

policy_client: config schema + SdkConfig wiring#249
shantanuparab-tr wants to merge 5 commits into
mainfrom
06-15-policy-client-01-config-schema

Conversation

@shantanuparab-tr

@shantanuparab-tr shantanuparab-tr commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

First PR in the PolicyClient stack — the SDK bridge that drives Trossen arms from a remote inference server (openpi or LeRobot). This PR adds only the configuration schema so the rest of the stack has a validated config type to build against; no runtime code or dependencies yet.

Stack: part of the PolicyClient stack, based on #248. Each PR is a self-contained component; the stack tip equals the validated working integration. Review bottom-up.

Changes

  • In include/trossen_sdk/configuration/types/hardware/policy_client_config.hpp: new PolicyClientConfig schema — transport selection (transport name + opaque transport_config), joint_layout (per-arm groups with joint_names), record subscriptions, and playback/timing knobs (drain_threshold, inference_hz, output EMA alphas). Defaults preserve the openpi flow (transport defaults to openpi_ws).
  • In include/trossen_sdk/configuration/sdk_config.hpp + src/configuration/sdk_config.cpp: carry HardwareConfig.policy_clients (zero or more) through from_json, with duplicate-id validation and per-entry error context.
  • In tests/test_policy_client_config.cpp + tests/CMakeLists.txt: parse/validation coverage. The schema is header-only, so this test builds without the policy-client build gate.

Test Plan

Breaking Changes

None. policy_clients is a new optional HardwareConfig array; existing configs load unchanged.

Related

Based on #248 (auto-retargets to main when it merges). Followed by #250#255. No TDS ticket — experimental subsystem; design lives in the external policy_client_docs.

@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-01-config-schema branch from cfd49b9 to e435235 Compare June 15, 2026 18:45
@shantanuparab-tr shantanuparab-tr added the enhancement New feature or request label Jun 15, 2026 — with Graphite App
@shantanuparab-tr shantanuparab-tr self-assigned this Jun 15, 2026
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-01-config-schema branch from e435235 to edb331d Compare June 16, 2026 21:51
@shantanuparab-tr
shantanuparab-tr changed the base branch from 06-09-hardware-episode-lifecycle to graphite-base/249 June 16, 2026 21:56
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-01-config-schema branch from edb331d to 1aac9de Compare June 16, 2026 21:57
@graphite-app
graphite-app Bot changed the base branch from graphite-base/249 to main June 16, 2026 21:57
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-01-config-schema branch from 1aac9de to 9ae754e Compare June 16, 2026 21:57
Comment thread include/trossen_sdk/configuration/types/hardware/policy_client_config.hpp Outdated
Comment thread include/trossen_sdk/configuration/types/hardware/policy_client_config.hpp Outdated
PolicyClientConfig (transport name, transport_config, joint_layout,
subscriptions, drain_threshold, inference_hz, output filters) and its
HardwareConfig.policy_clients wiring + duplicate-id validation. Header-only
schema, so the parse test builds without the policy-client build gate.
Two subscriptions with distinct record_id but the same obs_key parsed
cleanly, then silently collided at pack time (the second overwrote the
first in the observation dict, dropping one arm's state with no error).
Mirror the existing record_id dedup with an obs_key uniqueness check.

Addresses review finding PR249-F1.
…hema

Address Luke's review comments on #249:
- server_url: give openpi/lerobot_grpc endpoints as plain examples instead
  of describing lerobot_grpc as 'planned' (it ships in #252 — the comment
  had gone stale).
- drain_threshold: remove the internal 'slice L5' development artifact,
  keeping the inline fact (consumed by the drain-threshold firing logic).
Copilot AI review requested due to automatic review settings July 16, 2026 15:12
@shantanuparab-tr
shantanuparab-tr force-pushed the 06-15-policy-client-01-config-schema branch from 9ae754e to a2311ea Compare July 16, 2026 15:12
shantanuparab-tr added a commit that referenced this pull request Jul 16, 2026
…nsport

Same class of artifact Luke flagged on #249, found in #252 during a sweep —
and gone stale: the file header called this an 'L3 skeleton' and the connect
path claimed 'L3 ships a placeholder payload; L4 ships the pickled
RemotePolicyConfig'. policy_setup_bytes_() returns the real pickled
RemotePolicyConfig, so the comment misdescribed the shipped code. Describe the
actual handshake and payload path; drop the internal slice references.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the initial configuration schema and SDK config wiring for the upcoming PolicyClient hardware component stack, enabling validated config parsing (and tests) without introducing runtime policy-client dependencies yet.

Changes:

  • Introduces PolicyClientConfig schema (transport selection, subscriptions, joint layout, timing/playback knobs) with validation.
  • Wires HardwareConfig.policy_clients through HardwareConfig::from_json() including duplicate-id validation and indexed error context.
  • Adds test_policy_client_config and CMake integration to cover parsing/validation.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
include/trossen_sdk/configuration/types/hardware/policy_client_config.hpp New header-only PolicyClientConfig schema + validation logic.
include/trossen_sdk/configuration/sdk_config.hpp Adds HardwareConfig::policy_clients and includes the new schema header.
src/configuration/sdk_config.cpp Parses hardware.policy_clients, adds per-index error context, validates duplicate ids.
tests/test_policy_client_config.cpp New unit tests for PolicyClientConfig and HardwareConfig::policy_clients parsing/validation.
tests/CMakeLists.txt Adds test_policy_client_config target and registers it with CTest via gtest_discover_tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread include/trossen_sdk/configuration/types/hardware/policy_client_config.hpp Outdated
Comment thread include/trossen_sdk/configuration/types/hardware/policy_client_config.hpp Outdated
Comment thread tests/test_policy_client_config.cpp
Comment thread tests/test_policy_client_config.cpp
Address Copilot's post-review comments on #249:
- Replace the non-ASCII drain-threshold symbol (theta) and an en-dash range
  separator with ASCII, for source-encoding portability.
- Note that the JSON 'type' field selects this schema at the hardware-registry
  level and is not parsed by from_json(), so readers don't expect it here.
shantanuparab-tr added a commit that referenced this pull request Jul 16, 2026
…nsport

Same class of artifact Luke flagged on #249, found in #252 during a sweep —
and gone stale: the file header called this an 'L3 skeleton' and the connect
path claimed 'L3 ships a placeholder payload; L4 ships the pickled
RemotePolicyConfig'. policy_setup_bytes_() returns the real pickled
RemotePolicyConfig, so the comment misdescribed the shipped code. Describe the
actual handshake and payload path; drop the internal slice references.
shantanuparab-tr added a commit that referenced this pull request Jul 17, 2026
…nsport

Same class of artifact Luke flagged on #249, found in #252 during a sweep —
and gone stale: the file header called this an 'L3 skeleton' and the connect
path claimed 'L3 ships a placeholder payload; L4 ships the pickled
RemotePolicyConfig'. policy_setup_bytes_() returns the real pickled
RemotePolicyConfig, so the comment misdescribed the shipped code. Describe the
actual handshake and payload path; drop the internal slice references.
…example

Replace non-ASCII characters in the PolicyClientConfig comments and tests with
ASCII, and remove the 'type' field from the JSON doc example since from_json()
does not parse it.
shantanuparab-tr added a commit that referenced this pull request Jul 17, 2026
…nsport

Same class of artifact Luke flagged on #249, found in #252 during a sweep —
and gone stale: the file header called this an 'L3 skeleton' and the connect
path claimed 'L3 ships a placeholder payload; L4 ships the pickled
RemotePolicyConfig'. policy_setup_bytes_() returns the real pickled
RemotePolicyConfig, so the comment misdescribed the shipped code. Describe the
actual handshake and payload path; drop the internal slice references.
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.

3 participants