Skip to content

feat: scene-layout JSON export and rig files for operator tools#31

Merged
aris-zhu merged 2 commits into
mainfrom
feat/scene-layout-json
Jul 22, 2026
Merged

feat: scene-layout JSON export and rig files for operator tools#31
aris-zhu merged 2 commits into
mainfrom
feat/scene-layout-json

Conversation

@aris-zhu

Copy link
Copy Markdown
Contributor

What

Adds a machine-readable placement layer for operator setup tools and simulator adapters, per the design discussed in-session:

  • Scene-layout JSON (generated, never hand-edited): export_scene_layout(instance_id, eval_seed=0, epoch=0) derives the trial seed exactly as eval() does (derive_seed(eval_seed, crc32(instance_id), epoch)) and projects build_blueprint() into a versioned JSON contract. Coordinates are single-source and frame-local: each object carries frame ("bench" or a parent object name) plus xy_cm; no resolved duplicates.
  • Rig JSON (hand-authored, one per lab): anchors the bench frame to the two arm bases; the loader enforces the binding handedness convention (left arm base x < 0 < right arm base x). Reference file at rigs/yam-bimanual.json.
  • Strict loaders returning frozen dataclasses with field-specific errors; unknown keys and unknown layout_versions rejected.
  • JSON Schemas (draft 2020-12) shipped as package data for external tools; a test sweep validates all 50 exported instances against the schema (jsonschema in the dev extra only).
  • CLI: kitchenbench-layout <instance_id> [--eval-seed N] [--epoch N] [-o FILE], byte-identical output for identical inputs.
  • Docs: docs/layouts.md (formats, frame convention, determinism story).

specs.py remains the single source of truth; the JSON is a regenerable projection pinned by kitchenbench_version + sim_contract_version. Nothing under sim/, specs.py, or instances.py changed.

Verification

  • ruff check / ruff format --check: clean
  • mypy (strict): clean
  • pytest --cov: 376 passed, 100% coverage
  • mkdocs build --strict: clean
  • CLI determinism: two runs diff byte-identical

🤖 Generated with Claude Code

https://claude.ai/code/session_01KXT3ha5z8tirtRQSFbHgae

aris-zhu and others added 2 commits July 21, 2026 20:01
Add a deterministic scene-layout JSON contract (a regenerable projection
of an instance at a given eval_seed/epoch, single-source frame-local
coordinates) plus a hand-authored per-lab rig format that anchors the
bench frame to the two arm bases. specs.py stays the source of truth;
the JSON is generated, never edited.

- layout.py: export_scene_layout, canonical serializer, strict loaders
  (frozen dataclasses, field-specific errors, bench-handedness check),
  kitchenbench-layout CLI ([project.scripts])
- schemas/: draft 2020-12 JSON Schemas shipped as package data
- rigs/yam-bimanual.json: reference rig
- docs/layouts.md: formats, frame convention, determinism story
- tests: determinism, seed alignment, blueprint fidelity, 50-instance
  schema sweep (jsonschema, dev extra only), loader rejections, CLI

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KXT3ha5z8tirtRQSFbHgae
@aris-zhu
aris-zhu merged commit 2b60489 into main Jul 22, 2026
13 checks passed
@aris-zhu
aris-zhu deleted the feat/scene-layout-json branch July 22, 2026 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant