fix(skills): add lowercase-only namespace/name pattern validation to SkillConfigSchema.name field #3208

Merged
freemo merged 1 commits from fix/skill-config-schema-lowercase-name-validation into master 2026-04-05 21:09:26 +00:00
4 changed files with 55 additions and 8 deletions
+21
View File
@@ -700,6 +700,27 @@ Feature: Consolidated Action
And the action schema error should mention "namespace/name"
Scenario: Uppercase namespace is rejected by ActionConfigSchema
Given an action YAML string with name "MyOrg/my-action"
When I validate the action schema expecting failure
Then the action schema validation should fail
And the action schema error should mention "namespace/name"
Scenario: Uppercase name part is rejected by ActionConfigSchema
Given an action YAML string with name "myorg/MyAction"
When I validate the action schema expecting failure
Then the action schema validation should fail
And the action schema error should mention "namespace/name"
Scenario: Fully uppercase namespaced name is rejected by ActionConfigSchema
Given an action YAML string with name "MyOrg/MyAction"
When I validate the action schema expecting failure
Then the action schema validation should fail
And the action schema error should mention "namespace/name"
Scenario: Invalid argument type
Given an action YAML string with an argument of type "array"
When I validate the action schema expecting failure
+30
View File
@@ -137,6 +137,36 @@ Feature: Skill YAML schema validation
Then the skill schema validation should fail
And the skill schema error should mention "namespace/name"
Scenario: Uppercase namespace is rejected by SkillConfigSchema
Given a skill YAML string with name "MyOrg/my-skill"
When I validate the skill schema expecting failure
Then the skill schema validation should fail
And the skill schema error should mention "namespace/name"
Scenario: Uppercase name part is rejected by SkillConfigSchema
Given a skill YAML string with name "myorg/MySkill"
When I validate the skill schema expecting failure
Then the skill schema validation should fail
And the skill schema error should mention "namespace/name"
Scenario: Fully uppercase namespaced name is rejected by SkillConfigSchema
Given a skill YAML string with name "MyOrg/MySkill"
When I validate the skill schema expecting failure
Then the skill schema validation should fail
And the skill schema error should mention "namespace/name"
Scenario: Uppercase tool reference name is rejected by SkillToolRefSchema
Given a skill YAML string with an invalid tool ref name "MyOrg/MyTool"
When I validate the skill schema expecting failure
Then the skill schema validation should fail
And the skill schema error should mention "namespace/name"
Scenario: Uppercase include name is rejected by SkillIncludeSchema
Given a skill YAML string with an invalid include name "MyOrg/MySkill"
When I validate the skill schema expecting failure
Then the skill schema validation should fail
And the skill schema error should mention "namespace/name"
Scenario: Invalid tool reference name
Given a skill YAML string with an invalid tool ref name "no-slash-tool"
When I validate the skill schema expecting failure
+2 -4
View File
@@ -39,10 +39,8 @@ logger = logging.getLogger(__name__)
# Constants
# ────────────────────────────────────────────────────────────
#: Pattern for ``<namespace>/<name>`` with hyphens, underscores, alphanum.
NAMESPACED_NAME_RE = re.compile(
r"^[a-zA-Z0-9][a-zA-Z0-9_-]*/[a-zA-Z0-9][a-zA-Z0-9_-]*$"
)
#: Pattern for ``<namespace>/<name>`` with hyphens, underscores, lowercase alphanum.
NAMESPACED_NAME_RE = re.compile(r"^[a-z0-9][a-z0-9_-]*/[a-z0-9][a-z0-9_-]*$")
#: Pattern for ``${VAR}`` environment variable references.
_ENV_VAR_RE = re.compile(r"\$\{([A-Za-z_][A-Za-z0-9_]*)\}")
+2 -4
View File
@@ -37,10 +37,8 @@ logger = logging.getLogger(__name__)
# Constants
# ────────────────────────────────────────────────────────────
#: Pattern for ``<namespace>/<name>`` with hyphens, underscores, alphanum.
NAMESPACED_NAME_RE = re.compile(
r"^[a-zA-Z0-9][a-zA-Z0-9_-]*/[a-zA-Z0-9][a-zA-Z0-9_-]*$"
)
#: Pattern for ``<namespace>/<name>`` with hyphens, underscores, lowercase alphanum.
NAMESPACED_NAME_RE = re.compile(r"^[a-z0-9][a-z0-9_-]*/[a-z0-9][a-z0-9_-]*$")
#: Pattern for ``${VAR}`` environment variable references.
_ENV_VAR_RE = re.compile(r"\$\{([A-Za-z_][A-Za-z0-9_]*)\}")