feat(sim): add semantic call catalog - #490
Conversation
There was a problem hiding this comment.
Pull request overview
Introduces a new immutable “semantic call” layer for sim skills, with a strict typed call catalog that can be validated independently from runtime skill installation. This adds early failure for unknown/invalid semantic calls and prevents stale robot-skill profile bindings after engine skill replacement.
Changes:
- Added
embodichain.lab.sim.skills.callsimplementing immutable semantic call values (Pick,Place,HandOver,RegisteredSemanticCall),SemanticPose, and an immutableSemanticCallCatalog/SemanticCallDescriptormodel. - Added an
AtomicActionEngine.skill_catalog_revisionmonotonic counter and updatedBoundRobotSkillProfileto reject stale bindings based on revision rather than descriptor mapping equality. - Added focused tests for semantic call payload immutability/validation and for rejecting “equivalent descriptor” implementation replacement on a previously bound profile.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tests/sim/skills/test_profiles.py | Adds regression test ensuring bound profiles reject “replace=True” engine registrations even when the public descriptor compares equal. |
| tests/sim/skills/test_calls.py | Adds comprehensive tests covering semantic call value immutability, declarative payload validation, and catalog behavior. |
| embodichain/lab/sim/skills/profiles.py | Tracks engine catalog revision at bind time; adds engine/source_profile accessors; switches stale detection to revision comparison. |
| embodichain/lab/sim/skills/calls.py | New semantic call spec + catalog implementation, including declarative argument snapshotting and strict identifier/contract validation. |
| embodichain/lab/sim/skills/init.py | Exports the new semantic call types and catalog helpers from the skills package. |
| embodichain/lab/sim/atomic_actions/engine.py | Adds skill_catalog_revision and increments it on semantic-skill registration/replacement to invalidate stale bindings. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Greptile SummaryThis PR introduces immutable typed semantic-call values, a catalog for built-in and registered capabilities, and revision-based invalidation of bound skill profiles.
Confidence Score: 4/5The PR appears safe to merge from a behavioral perspective, with the non-blocking requirement to document the newly exported semantic-call APIs. The implementation has focused validation and regression coverage, and no concrete runtime or security defect remains; the accepted concern is that several public APIs are introduced without the repository-required documentation. Files Needing Attention: embodichain/lab/sim/skills/init.py and the public APIs introduced in calls.py, engine.py, and profiles.py
|
| Filename | Overview |
|---|---|
| embodichain/lab/sim/skills/calls.py | Adds immutable semantic-call payloads, pose snapshots, descriptor validation, and built-in/extension catalog discovery. |
| embodichain/lab/sim/atomic_actions/engine.py | Adds a monotonic semantic-skill catalog revision incremented when visible bound capabilities are installed or replaced. |
| embodichain/lab/sim/skills/profiles.py | Uses the engine revision for stale-profile detection and exposes the owning engine and source profile. |
| embodichain/lab/sim/skills/init.py | Publicly exports the semantic-call catalog API without the documentation required for new public APIs. |
| tests/sim/skills/test_calls.py | Exercises pose ownership, declarative payload validation, descriptor restrictions, catalog discovery, and built-in mappings. |
| tests/sim/skills/test_profiles.py | Extends profile tests to cover revision-based invalidation and profile ownership accessors. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
Call[SemanticCallSpec] --> Catalog[SemanticCallCatalog]
Catalog --> Descriptor[SemanticCallDescriptor]
Descriptor --> Skill[Atomic skill descriptor]
Engine[AtomicActionEngine] -->|catalog revision| Profile[BoundRobotSkillProfile]
Profile -->|validates current revision| Skill
Call -->|resource overrides| Profile
Prompt To Fix All With AI
### Issue 1
embodichain/lab/sim/skills/__init__.py:21-33
**Document the public semantic API**
The newly exported semantic-call values and catalog APIs, together with the new public engine and profile properties, have no corresponding documentation update. This leaves users without guidance for constructing registered calls, extending catalogs, associating descriptors with installed skills, or handling catalog revisions.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(sim): add semantic call catalog" | Re-trigger Greptile
| from .calls import ( | ||
| DeclarativeValue, | ||
| HandOver, | ||
| Pick, | ||
| Place, | ||
| PlaceRelationTarget, | ||
| RegisteredSemanticCall, | ||
| SemanticCallCatalog, | ||
| SemanticCallDescriptor, | ||
| SemanticCallSpec, | ||
| SemanticPose, | ||
| builtin_semantic_call_catalog, | ||
| ) |
There was a problem hiding this comment.
Document the public semantic API
The newly exported semantic-call values and catalog APIs, together with the new public engine and profile properties, have no corresponding documentation update. This leaves users without guidance for constructing registered calls, extending catalogs, associating descriptors with installed skills, or handling catalog revisions.
Context Used: CLAUDE.md (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: embodichain/lab/sim/skills/__init__.py
Line: 21-33
Comment:
**Document the public semantic API**
The newly exported semantic-call values and catalog APIs, together with the new public engine and profile properties, have no corresponding documentation update. This leaves users without guidance for constructing registered calls, extending catalogs, associating descriptors with installed skills, or handling catalog revisions.
**Context Used:** CLAUDE.md ([source](https://github.com/dexforce/embodichain/blob/main/CLAUDE.md))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Description
Stack
feat/expert-program-semantic-irAdd strict typed semantic calls and an explicit call catalog for built-in and registered capabilities. Descriptors own argument schemas, revisions, resource requirements, effect contracts, and exact lowerer identity.
Unknown calls, duplicate registrations, invalid references, and catalog/profile mismatches fail during validation rather than reaching motion execution.
Refs #471
Refs #474
Type of change
Screenshots
Not applicable.
Validation
tests/sim/skills/test_calls.pyandtest_profiles.pyChecklist