Skip to content

Refactor atomic action target contracts - #444

Merged
yuecideng merged 1 commit into
mainfrom
refactor/atomic-action-target-contracts
Jul 31, 2026
Merged

Refactor atomic action target contracts#444
yuecideng merged 1 commit into
mainfrom
refactor/atomic-action-target-contracts

Conversation

@yuecideng

@yuecideng yuecideng commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Description

This PR refactors atomic-action target and runtime-state contracts to make ownership and extension boundaries explicit.

  • Keep only framework-level target abstractions in core.py and colocate action-specific target dataclasses with their primitive implementations.
  • Add the open ActionTarget marker and a neutral ObjectActionTarget(semantics) base for object-centric actions without introducing a generic, ambiguous pose field.
  • Re-export concrete targets from the package root and expose BuiltinTarget as the closed union of built-in executable target contracts.
  • Split action-specific contracts such as PlaceTarget and PressTarget; keep CoordinatedPickmentTarget as a compatibility alias for CoordinatedPickTarget.
  • Track held objects in WorldState by control part, separating runtime held-object state from desired action targets.
  • Update tutorials, benchmarks, tests, public documentation, and agent context for the new APIs.
  • Add a dedicated atomic_actions.targets API-reference page and include concrete Target contracts in the primitives autosummary, following the module documentation structure introduced by Complete API reference module descriptions and stale listings #445.

The target hierarchy is motivated in part by the shared object-semantics requirements surfaced in #432: actions can share the minimal semantic-object contract while retaining precise action-specific pose roles.

The branch is rebased onto origin/main at 21091106 (including #441 and #445).

Dependencies: None.

Related: #432

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which improves an existing functionality)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (existing functionality will not work without user modification)
  • Documentation update

Migration notes

  • Import concrete targets from embodichain.lab.sim.atomic_actions, not atomic_actions.core.
  • Use PlaceTarget for Place and PressTarget for Press.
  • Use semantics= when constructing CoordinatedPickTarget.
  • Read and update held objects through WorldState.held_objects and WorldState.coordinated_held_objects, keyed by control part.

Validation

  • black --check --diff --color ./ — 531 files unchanged.
  • pytest -q tests/sim/atomic_actions — 173 passed, 1 skipped.
  • Pickup and coordinated-pickment tutorial CLI smoke checks passed after the rebase.
  • Coordinated-pickment headless CPU tutorial completed successfully with a (1, 96, 16) trajectory.
  • Sphinx HTML documentation build completed successfully; the generated Target API page contains ObjectActionTarget, and existing repository warnings remain.
  • 32 changed Python files passed header, future-import, __all__, and diff-whitespace checks.

Screenshots

Not applicable; this is an API and architecture refactor.

Checklist

  • I have run the black . command to format the code base.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my change is effective.
  • Dependencies have been updated, if applicable.

Copilot AI review requested due to automatic review settings July 31, 2026 04:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yuecideng yuecideng added refactor breaking atomic action atomic action related functionality docs Improvements or additions to documentation labels Jul 31, 2026
@yuecideng
yuecideng requested a review from matafela July 31, 2026 05:53
Move action-specific target classes beside their primitives, add a shared object target base, and track held objects by control part. Update tutorials, benchmarks, tests, documentation, and agent context for the new contracts.
@yuecideng
yuecideng force-pushed the refactor/atomic-action-target-contracts branch from 9346444 to 2319d6e Compare July 31, 2026 06:05
Copilot AI review requested due to automatic review settings July 31, 2026 06:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@yuecideng
yuecideng merged commit 2e24733 into main Jul 31, 2026
4 checks passed
@yuecideng
yuecideng deleted the refactor/atomic-action-target-contracts branch July 31, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

atomic action atomic action related functionality breaking docs Improvements or additions to documentation refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants