Skip to content

Commit 7fd2768

Browse files
committed
fix(embodiments): restore omission detection in verify script; correct migration formula in docs
Address Codex review feedback on #308: - verify_embodiment_structure.sh validated whatever list_presets() returned, so an accidentally dropped preset file (e.g. quadcopter, which has no configs/ dev copy) passed the preflight silently. Keep a required-minimum set checked as a SUBSET of what ships: omissions fail the check, while new presets still validate automatically without editing the script. - schema.json description and docs/embodiment_schema.md documented the legacy fractional rtc_execution_horizon migration as int(v x chunk_size) (truncation), but EmbodimentConfig.from_dict() rounds: round(v x chunk_size), minimum 1. Document the actual behavior (v=0.25, chunk_size=30 migrates to 8, not 7). No behavior change; the shipped presets' migrated values are unaffected.
1 parent bc3c0b0 commit 7fd2768

3 files changed

Lines changed: 12 additions & 7 deletions

File tree

docs/embodiment_schema.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ List of camera streams the model expects (1–8 cameras).
8383
|---|---|---|---|
8484
| `frequency_hz` | float | 0–1000 (exclusive 0) | Robot control loop rate. |
8585
| `chunk_size` | int | 1–200 | Actions in a single inference chunk. |
86-
| `rtc_execution_horizon` | int | 1–`chunk_size` | Integer count of actions to lock during RTC replan. Legacy fractional values (0 < v < 1) auto-migrate to `int(v × chunk_size)` at load with a one-time deprecation warning; schema v2 will reject them. |
86+
| `rtc_execution_horizon` | int | 1–`chunk_size` | Integer count of actions to lock during RTC replan. Legacy fractional values (0 < v < 1) auto-migrate to `round(v × chunk_size)` (minimum 1) at load with a one-time deprecation warning; schema v2 will reject them. |
8787

8888
**Cross-field rules (warnings, not blocking):**
8989
- `rtc_execution_horizon < 1` (else `rtc-horizon-too-short` warning — RTC degenerates below one action)

scripts/verify_embodiment_structure.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,16 @@ from tether.embodiments import EmbodimentConfig, list_presets
4242
from tether.embodiments.validate import validate_embodiment_config
4343
4444
presets = list_presets()
45-
# Don't hard-code the expected preset list — it already drifted once when
46-
# quadcopter shipped, and hard-coding it here would break again on the
47-
# next preset. Validate whatever the package actually ships.
48-
if not presets:
49-
print(" ✗ list_presets() returned no presets — package presets dir missing?")
45+
# Two checks, not one: a required-minimum SUBSET (catches an accidentally
46+
# dropped preset file — an equality check broke when quadcopter shipped,
47+
# but no check at all lets packaging omissions pass silently) plus dynamic
48+
# validation of everything else that ships. New presets validate
49+
# automatically in the loop below; add them to REQUIRED when they should
50+
# be omission-protected too.
51+
REQUIRED = {"franka", "so100", "ur5", "quadcopter"}
52+
missing = REQUIRED - set(presets)
53+
if missing:
54+
print(f" ✗ required package presets missing: {sorted(missing)}")
5055
sys.exit(1)
5156
5257
for name in presets:

src/tether/embodiments/schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@
168168
"type": "number",
169169
"minimum": 0,
170170
"maximum": 1000,
171-
"description": "Integer count of actions to lock during RTC replan. Per ADR 2026-04-25-auto-calibration-architecture decision #8. Legacy fractional values (0 < value < 1) auto-migrate to int(value * chunk_size) at load time with a one-time deprecation warning. Schema v2 will reject fractional values."
171+
"description": "Integer count of actions to lock during RTC replan. Per ADR 2026-04-25-auto-calibration-architecture decision #8. Legacy fractional values (0 < value < 1) auto-migrate to round(value * chunk_size), minimum 1, at load time with a one-time deprecation warning. Schema v2 will reject fractional values."
172172
}
173173
}
174174
},

0 commit comments

Comments
 (0)