UAT: _TOOL_NAME_PATTERN and _SKILL_NAME_PATTERN allow names/namespaces starting with digits — spec requires names to start with a letter #2936

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

Metadata

  • Branch: fix/tool-skill-name-pattern-digit-start
  • Commit Message: fix(domain): require tool and skill name components to start with a letter
  • Milestone: v3.7.0
  • Parent Epic: #392

Description

The spec defines the namespace format as [[server:]namespace/]name and states that namespace and name components must start with a letter. However, the regex patterns used for Tool and Skill name validation in the domain models allow names and namespaces starting with digits.

Code locations:

  • src/cleveragents/domain/models/core/tool.py, line 80: _TOOL_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$")
  • src/cleveragents/domain/models/core/skill.py, line 78: _SKILL_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$")

Both patterns use [a-zA-Z0-9_-]+ which allows the first character to be a digit (e.g., 123abc/my-tool would be accepted).

Expected behavior: Both patterns should require the namespace and name components to start with a letter, consistent with the spec requirement and the _SERVER_NS_NAME_RE pattern in project.py which correctly uses [a-zA-Z][a-zA-Z0-9_-]*.

Actual behavior: _TOOL_NAME_PATTERN and _SKILL_NAME_PATTERN accept names like 123abc/my-tool and local/456-tool where the namespace or name starts with a digit.

Note: This is related to but distinct from issues #2145 and #2147 which cover NamespacedName.validate_namespace() and validate_name() in plan.py. This issue covers the separate regex patterns used for Tool and Skill name validation.

Subtasks

  • Fix _TOOL_NAME_PATTERN in tool.py to require namespace and name to start with a letter
  • Fix _SKILL_NAME_PATTERN in skill.py to require namespace and name to start with a letter
  • Add Behave scenarios covering rejection of digit-starting tool/skill names
  • Run nox -e typecheck to confirm no type regressions
  • Run nox (all default sessions), fix any errors

Definition of Done

  • _TOOL_NAME_PATTERN rejects names like 123abc/my-tool and local/456-tool
  • _SKILL_NAME_PATTERN rejects names like 123abc/my-skill and local/456-skill
  • Both patterns accept valid names like local/my-tool and myorg/code-review
  • Behave scenarios added covering the new validation
  • Commit created with message: fix(domain): require tool and skill name components to start with a letter
  • Code pushed to branch fix/tool-skill-name-pattern-digit-start and PR merged
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/tool-skill-name-pattern-digit-start` - **Commit Message**: `fix(domain): require tool and skill name components to start with a letter` - **Milestone**: v3.7.0 - **Parent Epic**: #392 ## Description The spec defines the namespace format as `[[server:]namespace/]name` and states that namespace and name components must start with a letter. However, the regex patterns used for Tool and Skill name validation in the domain models allow names and namespaces starting with digits. **Code locations**: - `src/cleveragents/domain/models/core/tool.py`, line 80: `_TOOL_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$")` - `src/cleveragents/domain/models/core/skill.py`, line 78: `_SKILL_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$")` Both patterns use `[a-zA-Z0-9_-]+` which allows the first character to be a digit (e.g., `123abc/my-tool` would be accepted). **Expected behavior**: Both patterns should require the namespace and name components to start with a letter, consistent with the spec requirement and the `_SERVER_NS_NAME_RE` pattern in `project.py` which correctly uses `[a-zA-Z][a-zA-Z0-9_-]*`. **Actual behavior**: `_TOOL_NAME_PATTERN` and `_SKILL_NAME_PATTERN` accept names like `123abc/my-tool` and `local/456-tool` where the namespace or name starts with a digit. **Note**: This is related to but distinct from issues #2145 and #2147 which cover `NamespacedName.validate_namespace()` and `validate_name()` in `plan.py`. This issue covers the separate regex patterns used for Tool and Skill name validation. ## Subtasks - [ ] Fix `_TOOL_NAME_PATTERN` in `tool.py` to require namespace and name to start with a letter - [ ] Fix `_SKILL_NAME_PATTERN` in `skill.py` to require namespace and name to start with a letter - [ ] Add Behave scenarios covering rejection of digit-starting tool/skill names - [ ] Run `nox -e typecheck` to confirm no type regressions - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done - [ ] `_TOOL_NAME_PATTERN` rejects names like `123abc/my-tool` and `local/456-tool` - [ ] `_SKILL_NAME_PATTERN` rejects names like `123abc/my-skill` and `local/456-skill` - [ ] Both patterns accept valid names like `local/my-tool` and `myorg/code-review` - [ ] Behave scenarios added covering the new validation - [ ] Commit created with message: `fix(domain): require tool and skill name components to start with a letter` - [ ] Code pushed to branch `fix/tool-skill-name-pattern-digit-start` and PR merged - [ ] 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:52:45 +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#2936
No description provided.