UAT: Skill name pattern allows digit-starting namespace/name components, inconsistent with spec #4887

Open
opened 2026-04-08 20:15:06 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Namespacing — Skill Name Validation
Tested by: UAT tester instance uat-namespacing

What Was Tested

Code analysis of src/cleveragents/domain/models/core/skill.py — the _SKILL_NAME_PATTERN regex used to validate skill names.

Expected Behavior (from spec)

Per ADR-002 (Namespace System), all namespace and name components must start with a letter. The spec states:

Names should be stable identifiers (kebab-case recommended).

The project.py _SERVER_NS_NAME_RE and _BARE_NAME_RE patterns both enforce [a-zA-Z] as the first character. The resource_type.py _NAMESPACED_RE and _BUILTIN_NAME_RE patterns also enforce letter-first.

Actual Behavior

_SKILL_NAME_PATTERN in skill.py (line 78) uses:

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

This pattern allows namespace and name components to start with digits (e.g., 123abc/my-skill, local/456tool). This is inconsistent with:

  1. The spec requirement that names start with a letter
  2. The patterns used in project.py, resource_type.py, and _resource_type_validation.py

Code Location

  • src/cleveragents/domain/models/core/skill.py, line 78
  • Compare with correct patterns:
    • src/cleveragents/domain/models/core/project.py, lines 32–39
    • src/cleveragents/domain/models/core/_resource_type_validation.py, lines 13–14

Steps to Reproduce

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

# Should NOT match but does:
print(_SKILL_NAME_PATTERN.match("123abc/my-skill"))  # Match object — incorrect
print(_SKILL_NAME_PATTERN.match("local/456tool"))    # Match object — incorrect

Fix

Update _SKILL_NAME_PATTERN to require letter-first components:

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

This matches the pattern used in resource_type.py's _NAMESPACED_RE.


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

## Bug Report **Feature Area:** Namespacing — Skill Name Validation **Tested by:** UAT tester instance `uat-namespacing` ### What Was Tested Code analysis of `src/cleveragents/domain/models/core/skill.py` — the `_SKILL_NAME_PATTERN` regex used to validate skill names. ### Expected Behavior (from spec) Per ADR-002 (Namespace System), all namespace and name components must start with a letter. The spec states: > Names should be stable identifiers (kebab-case recommended). The `project.py` `_SERVER_NS_NAME_RE` and `_BARE_NAME_RE` patterns both enforce `[a-zA-Z]` as the first character. The `resource_type.py` `_NAMESPACED_RE` and `_BUILTIN_NAME_RE` patterns also enforce letter-first. ### Actual Behavior `_SKILL_NAME_PATTERN` in `skill.py` (line 78) uses: ```python _SKILL_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$") ``` This pattern allows namespace and name components to start with digits (e.g., `123abc/my-skill`, `local/456tool`). This is inconsistent with: 1. The spec requirement that names start with a letter 2. The patterns used in `project.py`, `resource_type.py`, and `_resource_type_validation.py` ### Code Location - `src/cleveragents/domain/models/core/skill.py`, line 78 - Compare with correct patterns: - `src/cleveragents/domain/models/core/project.py`, lines 32–39 - `src/cleveragents/domain/models/core/_resource_type_validation.py`, lines 13–14 ### Steps to Reproduce ```python import re _SKILL_NAME_PATTERN = re.compile(r"^[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+$") # Should NOT match but does: print(_SKILL_NAME_PATTERN.match("123abc/my-skill")) # Match object — incorrect print(_SKILL_NAME_PATTERN.match("local/456tool")) # Match object — incorrect ``` ### Fix Update `_SKILL_NAME_PATTERN` to require letter-first components: ```python _SKILL_NAME_PATTERN = re.compile(r"^[a-zA-Z][a-zA-Z0-9_-]*/[a-zA-Z][a-zA-Z0-9_-]*$") ``` This matches the pattern used in `resource_type.py`'s `_NAMESPACED_RE`. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:02:24 +00:00
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.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#4887
No description provided.