Skip to content

Simplify declarative skill foundation code - #523

Merged
yuecideng merged 2 commits into
mainfrom
refactor/simplify-phase1-foundation
Aug 19, 2026
Merged

Simplify declarative skill foundation code#523
yuecideng merged 2 commits into
mainfrom
refactor/simplify-phase1-foundation

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

This PR simplifies the declarative skill foundation introduced in #487 without changing public APIs or binding behavior.

  • adds shared builders for motion-only and manipulation resource slots used by nine built-in atomic actions;
  • reuses profile rejection diagnostics as the single resource-matching implementation, removing a duplicate matcher; and
  • updates the declarative expert-program plan to record the completed Phase 1 foundation and the remaining Phase 2 adoption work.

The refactor removes repeated endpoint, routing, command, and disjointness declarations while keeping each skill's capability and command requirements explicit.

Dependencies: None. PR #487 and PR #519 are already in main.

Refs #474

Type of change

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

Screenshots

Not applicable.

Validation

  • black --check --diff --color ./ — 666 files unchanged
  • pytest -q tests/sim/skills/test_profiles.py tests/sim/atomic_actions/test_core.py tests/sim/atomic_actions/test_actions.py — 123 passed
  • Apache headers, future annotations, and module exports checked for all 11 changed Python files
  • Full test suite not run; focused atomic-action and profile coverage exercises the affected behavior

Checklist

  • The codebase passes Black formatting checks.
  • I have made corresponding changes to the documentation.
  • I have added tests that prove my change is effective. Existing tests cover this behavior-preserving refactor.
  • Dependencies have been updated, if applicable. No dependency changes were required.

@yuecideng yuecideng added refactor atomic action atomic action related functionality labels Aug 19, 2026
@greptile-apps

greptile-apps Bot commented Aug 19, 2026

Copy link
Copy Markdown

Greptile Summary

The PR consolidates repeated atomic-action binding declarations and reuses profile rejection diagnostics for resource matching without changing the represented contracts.

  • Adds shared builders for motion-only and manipulation resource slots.
  • Migrates nine built-in atomic actions to the shared declarations.
  • Removes the duplicate resource matcher from robot skill profiles.
  • Updates the declarative expert-program plan to reflect completed Phase 1 work.

Confidence Score: 5/5

The PR appears safe to merge because the refactor preserves the represented binding contracts and resource-selection conditions.

The shared builders reproduce the prior endpoint, capability, routing, command, and disjointness declarations, while the consolidated matcher rejects resources under the same conditions as the removed implementation.

Important Files Changed

Filename Overview
embodichain/lab/sim/atomic_actions/primitives/_binding_contracts.py Introduces normalized builders that preserve the existing motion and manipulation slot structures.
embodichain/lab/sim/skills/profiles.py Reuses the diagnostic rejection implementation for candidate filtering while retaining the former matching checks.
embodichain/lab/sim/atomic_actions/primitives/coordinated_placement.py Replaces two inline manipulation slots with equivalent shared-builder calls while preserving cross-slot disjointness.
embodichain/lab/sim/atomic_actions/primitives/hand_over.py Replaces source and destination declarations with equivalent shared manipulation slots.
embodichain/lab/sim/atomic_actions/primitives/pick_up.py Replaces the inline primary manipulation contract without changing its capabilities or required commands.
docs/design/declarative_expert_program_plan.md Updates implementation status and remaining adoption work to reflect the Phase 1 foundation now on main.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart LR
    A[Built-in atomic action] --> B{Required resource slot}
    B -->|Motion only| C[make_motion_slot]
    B -->|Motion and grasp| D[make_manipulation_slot]
    C --> E[SkillBindingContract]
    D --> E
    E --> F[BoundRobotSkillProfile]
    F --> G[_rejection_reasons]
    G -->|No reasons| H[Candidate assignment]
    G -->|Reasons present| I[Reject resource and report diagnostics]
Loading

Reviews (1): Last reviewed commit: "Merge branch 'main' into refactor/simpli..." | Re-trigger Greptile

@yuecideng
yuecideng merged commit 56dbe01 into main Aug 19, 2026
2 checks passed
@yuecideng
yuecideng deleted the refactor/simplify-phase1-foundation branch August 19, 2026 03:57
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 refactor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant