Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions embodichain/lab/sim/atomic_actions/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ def __init__(
control_profiles=control_profiles,
)
self._actions: dict[str, AtomicAction] = {}
self._skill_catalog_revision = 0
self._skill_profile: BoundRobotSkillProfile | None = None
if load_builtins:
self._load_builtin_actions()
Expand Down Expand Up @@ -196,6 +197,16 @@ def skills(self) -> Mapping[str, SkillDescriptor]:
}
)

@property
def skill_catalog_revision(self) -> int:
"""Return the monotonic installed semantic-skill catalog revision.

Replacing an agent-visible implementation advances the revision even
when its public descriptor is equal. Bound profiles and semantic
compilers can therefore reject stale implementation ownership.
"""
return self._skill_catalog_revision

@property
def skill_profile(self) -> BoundRobotSkillProfile | None:
"""Return the currently bound semantic robot profile, when configured."""
Expand Down Expand Up @@ -294,6 +305,13 @@ def register(self, action: AtomicAction, *, replace: bool = False) -> None:
)
action._bind(self._planning_services)
self._actions[descriptor.skill_id] = action
existing_descriptor = None if existing is None else existing.descriptor()
if (descriptor.agent_visible and descriptor.binding_contract is not None) or (
existing_descriptor is not None
and existing_descriptor.agent_visible
and existing_descriptor.binding_contract is not None
):
self._skill_catalog_revision += 1
self._skill_profile = None

def _load_builtin_actions(self) -> None:
Expand Down
24 changes: 24 additions & 0 deletions embodichain/lab/sim/skills/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@

from __future__ import annotations

from .calls import (
DeclarativeValue,
HandOver,
Pick,
Place,
PlaceRelationTarget,
RegisteredSemanticCall,
SemanticCallCatalog,
SemanticCallDescriptor,
SemanticCallSpec,
SemanticPose,
builtin_semantic_call_catalog,
)
Comment on lines +21 to +33

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 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!

Fix in Codex Fix in Claude Code

from .profiles import (
AmbiguousSkillBindingError,
BoundRobotSkillProfile,
Expand Down Expand Up @@ -65,10 +78,15 @@
"BoundRobotSkillProfile",
"ControlPartEndpoint",
"ControlPartEndpointAdapter",
"DeclarativeValue",
"EndpointResolution",
"GRASP_AFFORDANCE_CAPABILITY",
"HandOver",
"PLACE_IN_AFFORDANCE_CAPABILITY",
"PLACE_ON_AFFORDANCE_CAPABILITY",
"Pick",
"Place",
"PlaceRelationTarget",
"ProfileValidationError",
"RegistrySceneProvider",
"ResolvedRobotResource",
Expand All @@ -78,6 +96,7 @@
"ResourceClaim",
"ResourceEndpoint",
"ResourceEndpointAdapter",
"RegisteredSemanticCall",
"RobotResource",
"RobotSkillProfile",
"SceneAffordanceRef",
Expand All @@ -93,7 +112,12 @@
"SceneLinkRef",
"SceneObjectRef",
"SceneRegistry",
"SemanticCallCatalog",
"SemanticCallDescriptor",
"SemanticCallSpec",
"SemanticPose",
"SkillPolicyPreset",
"UnsupportedSkillError",
"UnsupportedSceneAffordanceError",
"builtin_semantic_call_catalog",
]
Loading