UAT: Action name and actor name validators reject the spec-required server:namespace/name format — only namespace/name is accepted #3021

Open
opened 2026-04-05 04:01:30 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/action-schema/namespaced-name-regex
  • Commit Message: fix(action/schema): support full [[server:]namespace/]name format in name validators
  • Milestone: v3.6.0
  • Parent Epic: #392

Background

The specification defines the full namespacing format for actions and actors as:

[[server:]namespace/]name

This means the following formats should all be valid:

  • name (bare name, defaults to local/)
  • namespace/name (two-part)
  • server:namespace/name (three-part with server prefix)

However, the implementation in src/cleveragents/action/schema.py uses the following regex for name validation:

NAMESPACED_NAME_RE = re.compile(
    r"^[a-zA-Z0-9][a-zA-Z0-9_-]*/[a-zA-Z0-9][a-zA-Z0-9_-]*$"
)

This regex only accepts the two-part namespace/name format. It does NOT support:

  1. The three-part server:namespace/name format (e.g., myserver:local/my-action)
  2. Bare names without a namespace (e.g., my-action)

The same regex is used to validate:

  • Action names (name field)
  • strategy_actor and execution_actor (required actor references)
  • estimation_actor, review_actor, apply_actor, invariant_actor (optional actor references)

This means that any action or actor reference using a server prefix (e.g., connecting to a remote CleverAgents server) will be rejected at YAML parse time, even though the spec explicitly supports this format.

Expected behavior (per spec):

  • myserver:local/my-action should be a valid action name
  • myserver:openai/gpt-4 should be a valid actor reference
  • my-action (bare name) should be valid and default to local/my-action

Actual behavior:

  • myserver:local/my-action raises ValidationError: Invalid action name
  • my-action raises ValidationError: Invalid action name

Code location: src/cleveragents/action/schema.pyNAMESPACED_NAME_RE constant and validate_namespaced_name, validate_required_actor_name, validate_optional_actor_name methods

Note: The JSON Schema in docs/schema/action.schema.yaml also only uses the two-part pattern ^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$. Both the schema YAML and the Python implementation need to be updated to support the full [[server:]namespace/]name format.

Subtasks

  • Write a failing Behave scenario reproducing the bug (TDD — must be merged to master first)
  • Update NAMESPACED_NAME_RE in src/cleveragents/action/schema.py to match the full [[server:]namespace/]name pattern
  • Update validate_namespaced_name to handle bare names (defaulting to local/<name>)
  • Update validate_required_actor_name and validate_optional_actor_name to use the corrected regex
  • Update docs/schema/action.schema.yaml JSON Schema pattern to support the three-part format
  • Verify all existing tests still pass after the regex change
  • Ensure coverage >= 97%

Definition of Done

  • myserver:local/my-action is accepted as a valid action name
  • myserver:openai/gpt-4 is accepted as a valid actor reference
  • my-action (bare name) is accepted and normalised to local/my-action
  • namespace/name (two-part) continues to be accepted
  • docs/schema/action.schema.yaml pattern updated to reflect the full spec format
  • Failing Behave scenario merged to master before fix is implemented (TDD)
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Metadata - **Branch**: `fix/action-schema/namespaced-name-regex` - **Commit Message**: `fix(action/schema): support full [[server:]namespace/]name format in name validators` - **Milestone**: v3.6.0 - **Parent Epic**: #392 ## Background The specification defines the full namespacing format for actions and actors as: > `[[server:]namespace/]name` This means the following formats should all be valid: - `name` (bare name, defaults to `local/`) - `namespace/name` (two-part) - `server:namespace/name` (three-part with server prefix) However, the implementation in `src/cleveragents/action/schema.py` uses the following regex for name validation: ```python NAMESPACED_NAME_RE = re.compile( r"^[a-zA-Z0-9][a-zA-Z0-9_-]*/[a-zA-Z0-9][a-zA-Z0-9_-]*$" ) ``` This regex **only accepts the two-part `namespace/name` format**. It does NOT support: 1. The three-part `server:namespace/name` format (e.g., `myserver:local/my-action`) 2. Bare names without a namespace (e.g., `my-action`) The same regex is used to validate: - Action names (`name` field) - `strategy_actor` and `execution_actor` (required actor references) - `estimation_actor`, `review_actor`, `apply_actor`, `invariant_actor` (optional actor references) This means that any action or actor reference using a server prefix (e.g., connecting to a remote CleverAgents server) will be rejected at YAML parse time, even though the spec explicitly supports this format. **Expected behavior** (per spec): - `myserver:local/my-action` should be a valid action name - `myserver:openai/gpt-4` should be a valid actor reference - `my-action` (bare name) should be valid and default to `local/my-action` **Actual behavior**: - `myserver:local/my-action` raises `ValidationError: Invalid action name` - `my-action` raises `ValidationError: Invalid action name` **Code location**: `src/cleveragents/action/schema.py` — `NAMESPACED_NAME_RE` constant and `validate_namespaced_name`, `validate_required_actor_name`, `validate_optional_actor_name` methods **Note**: The JSON Schema in `docs/schema/action.schema.yaml` also only uses the two-part pattern `^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$`. Both the schema YAML and the Python implementation need to be updated to support the full `[[server:]namespace/]name` format. ## Subtasks - [ ] Write a failing Behave scenario reproducing the bug (TDD — must be merged to `master` first) - [ ] Update `NAMESPACED_NAME_RE` in `src/cleveragents/action/schema.py` to match the full `[[server:]namespace/]name` pattern - [ ] Update `validate_namespaced_name` to handle bare names (defaulting to `local/<name>`) - [ ] Update `validate_required_actor_name` and `validate_optional_actor_name` to use the corrected regex - [ ] Update `docs/schema/action.schema.yaml` JSON Schema pattern to support the three-part format - [ ] Verify all existing tests still pass after the regex change - [ ] Ensure coverage >= 97% ## Definition of Done - [ ] `myserver:local/my-action` is accepted as a valid action name - [ ] `myserver:openai/gpt-4` is accepted as a valid actor reference - [ ] `my-action` (bare name) is accepted and normalised to `local/my-action` - [ ] `namespace/name` (two-part) continues to be accepted - [ ] `docs/schema/action.schema.yaml` pattern updated to reflect the full spec format - [ ] Failing Behave scenario merged to `master` before fix is implemented (TDD) - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.6.0 milestone 2026-04-05 04:02:16 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Confirmed
  • MoSCoW: Should Have

Valid finding verified during batch triage.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Confirmed - **MoSCoW**: Should Have Valid finding verified during batch triage. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#392 Epic: Actor YAML & Compiler
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3021
No description provided.