UAT: AutomationProfile name validator rejects server:namespace/name format — spec requires full three-part namespacing #2900

Open
opened 2026-04-05 02:45:55 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/automation-profile-name-validator-server-prefix
  • Commit Message: fix(automation-profile): support full [[server:]namespace/]name format in AutomationProfile name validator
  • Milestone: v3.7.0
  • Parent Epic: #362

Summary

The AutomationProfile name validator only accepts bare names (name) or two-part namespaced names (namespace/name), but the specification requires support for the full three-part format [[server:]namespace/]name including an optional server prefix.

Expected Behavior (from spec)

From docs/specification.md Glossary:

Custom profiles namespaced as [[server:]namespace/]name.

This means all of the following should be valid profile names:

  • manual (bare built-in)
  • acme/strict (namespace/name)
  • myserver:acme/strict (server:namespace/name)

Actual Behavior

The name validator in src/cleveragents/domain/models/core/automation_profile.py (lines 78-79, 230-236) uses two regexes:

_BARE_NAME = re.compile(r"^[a-zA-Z0-9_-]+$")
_NAMESPACED_NAME = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$")

The _NAMESPACED_NAME regex only matches namespace/name (two parts). It does NOT match server:namespace/name (three parts). Attempting to create a profile with name myserver:acme/strict will raise a ValueError:

Profile name must be a bare name (e.g. 'manual') or namespaced 'namespace/name' (e.g. 'acme/strict'): got 'myserver:acme/strict'

Code Location

src/cleveragents/domain/models/core/automation_profile.py:

  • Line 78: _BARE_NAME = re.compile(r"^[a-zA-Z0-9_-]+$")
  • Line 79: _NAMESPACED_NAME = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$")
  • Lines 226-237: validate_name_format field validator

Steps to Reproduce

from cleveragents.domain.models.core.automation_profile import AutomationProfile
# This raises ValueError:
p = AutomationProfile(name="myserver:acme/strict")

Impact

Users operating in server mode cannot create or reference automation profiles using the full server:namespace/name format that the spec guarantees. This breaks multi-server profile management.

Subtasks

  • Audit AutomationProfile.validate_name_format() against the spec's [[server:]namespace/]name grammar
  • Add a third regex (or extend _NAMESPACED_NAME) to handle the optional server: prefix component
  • Add validation for the server: prefix token (non-empty, valid identifier characters, no slashes)
  • Update the ValueError message to document all three valid formats
  • Update or add Behave unit tests covering all valid and invalid name format combinations (bare, namespace/name, server:namespace/name, and malformed variants)
  • Update docstrings and inline comments to reflect the full supported format

Definition of Done

  • AutomationProfile name validator correctly accepts server:namespace/name, namespace/name, and bare name formats
  • AutomationProfile name validator correctly rejects malformed names (empty segments, double colons, missing name component, etc.)
  • Behave unit tests cover all branches of the new validator logic
  • Pyright type checking passes (nox -e typecheck)
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/automation-profile-name-validator-server-prefix` - **Commit Message**: `fix(automation-profile): support full [[server:]namespace/]name format in AutomationProfile name validator` - **Milestone**: v3.7.0 - **Parent Epic**: #362 ## Summary The `AutomationProfile` name validator only accepts bare names (`name`) or two-part namespaced names (`namespace/name`), but the specification requires support for the full three-part format `[[server:]namespace/]name` including an optional server prefix. ## Expected Behavior (from spec) From `docs/specification.md` Glossary: > Custom profiles namespaced as `[[server:]namespace/]name`. This means all of the following should be valid profile names: - `manual` (bare built-in) - `acme/strict` (namespace/name) - `myserver:acme/strict` (server:namespace/name) ## Actual Behavior The name validator in `src/cleveragents/domain/models/core/automation_profile.py` (lines 78-79, 230-236) uses two regexes: ```python _BARE_NAME = re.compile(r"^[a-zA-Z0-9_-]+$") _NAMESPACED_NAME = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$") ``` The `_NAMESPACED_NAME` regex only matches `namespace/name` (two parts). It does NOT match `server:namespace/name` (three parts). Attempting to create a profile with name `myserver:acme/strict` will raise a `ValueError`: ``` Profile name must be a bare name (e.g. 'manual') or namespaced 'namespace/name' (e.g. 'acme/strict'): got 'myserver:acme/strict' ``` ## Code Location `src/cleveragents/domain/models/core/automation_profile.py`: - Line 78: `_BARE_NAME = re.compile(r"^[a-zA-Z0-9_-]+$")` - Line 79: `_NAMESPACED_NAME = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$")` - Lines 226-237: `validate_name_format` field validator ## Steps to Reproduce ```python from cleveragents.domain.models.core.automation_profile import AutomationProfile # This raises ValueError: p = AutomationProfile(name="myserver:acme/strict") ``` ## Impact Users operating in server mode cannot create or reference automation profiles using the full `server:namespace/name` format that the spec guarantees. This breaks multi-server profile management. ## Subtasks - [ ] Audit `AutomationProfile.validate_name_format()` against the spec's `[[server:]namespace/]name` grammar - [ ] Add a third regex (or extend `_NAMESPACED_NAME`) to handle the optional `server:` prefix component - [ ] Add validation for the `server:` prefix token (non-empty, valid identifier characters, no slashes) - [ ] Update the `ValueError` message to document all three valid formats - [ ] Update or add Behave unit tests covering all valid and invalid name format combinations (bare, namespace/name, server:namespace/name, and malformed variants) - [ ] Update docstrings and inline comments to reflect the full supported format ## Definition of Done - [ ] `AutomationProfile` name validator correctly accepts `server:namespace/name`, `namespace/name`, and bare `name` formats - [ ] `AutomationProfile` name validator correctly rejects malformed names (empty segments, double colons, missing name component, etc.) - [ ] Behave unit tests cover all branches of the new validator logic - [ ] Pyright type checking passes (`nox -e typecheck`) - All nox stages pass - Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-05 02:46:03 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High (confirmed)
  • MoSCoW: Should Have — name validator rejects spec-required format

Valid UAT finding verified during batch triage.


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

Issue triaged by project owner: - **State**: Verified - **Priority**: High (confirmed) - **MoSCoW**: Should Have — name validator rejects spec-required format Valid UAT 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
#362 Epic: Security & Safety Hardening
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2900
No description provided.