UAT: Two incompatible namespace parsing classes (NamespacedName vs ParsedName) violate the universal naming scheme #4529

Closed
opened 2026-04-08 14:18:20 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: Namespace system — Universal naming scheme

Expected Behavior (from spec)

The spec (Glossary > Naming & Identity, line 174) defines a single universal naming scheme:

Namespace: The scoping segment in the name format [[server:]namespace/]name. Defaults to local/ when omitted. local/ is reserved for local-only items.

All entities (plans, actions, projects, resources, tools, skills, actors) use this same format. The spec implies a single, consistent parsing implementation.

Actual Behavior (from code)

The codebase has two different, incompatible namespace parsing classes:

1. NamespacedName in src/cleveragents/domain/models/core/plan.py

Used for: Plans, Actions

class NamespacedName(BaseModel):
    @field_validator("namespace")
    def validate_namespace(cls, v):
        if not all(c.isalnum() or c == "-" for c in v):
            raise ValueError("Namespace must be alphanumeric with hyphens only")
        return v.lower()  # Forces lowercase

    @field_validator("name")
    def validate_name(cls, v):
        if not v.replace("-", "").replace("_", "").isalnum():
            raise ValueError("Name must be alphanumeric with hyphens or underscores")
        return v.lower()  # Forces lowercase

2. ParsedName in src/cleveragents/domain/models/core/project.py

Used for: Projects

class ParsedName(BaseModel):
    # Uses regex validation: r"^[a-zA-Z][a-zA-Z0-9_-]*$"
    # Does NOT force lowercase
    # Validates reserved namespaces (system, internal, admin, root)
    # Validates provider namespaces (openai, anthropic, etc.)

Key Differences

Feature NamespacedName (plan.py) ParsedName (project.py)
Case handling Forces lowercase Preserves case
Validation method Character-by-character Regex pattern
Reserved namespace check None Yes (system, internal, admin, root)
Provider namespace check None Yes (openai, anthropic, etc.)
Underscore in namespace Not allowed Allowed
Underscore in name Allowed Allowed
Start character Any alphanumeric Must start with letter

Impact

  1. Inconsistent behavior: A project named MyProject would be stored as local/MyProject, but a plan named MyPlan would be stored as local/myplan (forced lowercase). This creates cross-entity naming inconsistencies.

  2. Missing validation for plans/actions: Plans and actions do not validate reserved namespaces (system, internal, admin, root), allowing users to create plans in reserved namespaces.

  3. Missing provider namespace protection for plans: Users can create plans in openai/ or anthropic/ namespaces, which are reserved for built-in LLM actors.

  4. Namespace validation inconsistency: NamespacedName allows underscores in namespaces (e.g., my_org/plan), while ParsedName does not.

  5. Code duplication: Two separate parsing implementations that must be kept in sync.

Code Locations

  • src/cleveragents/domain/models/core/plan.pyNamespacedName class (lines ~201-280)
  • src/cleveragents/domain/models/core/project.pyParsedName class (lines ~68-160)
  • src/cleveragents/domain/models/core/__init__.py — Both exported (lines 191, 211)

Consolidate into a single ParsedName (or NamespacedName) class in a shared module (e.g., src/cleveragents/domain/models/core/naming.py) and use it consistently across all entity types. The ParsedName implementation in project.py is more complete and spec-aligned.


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

## Bug Report **Feature Area:** Namespace system — Universal naming scheme ### Expected Behavior (from spec) The spec (Glossary > Naming & Identity, line 174) defines a **single** universal naming scheme: > **Namespace**: The scoping segment in the name format `[[server:]namespace/]name`. Defaults to `local/` when omitted. `local/` is reserved for local-only items. All entities (plans, actions, projects, resources, tools, skills, actors) use this same format. The spec implies a single, consistent parsing implementation. ### Actual Behavior (from code) The codebase has **two different, incompatible namespace parsing classes**: #### 1. `NamespacedName` in `src/cleveragents/domain/models/core/plan.py` Used for: Plans, Actions ```python class NamespacedName(BaseModel): @field_validator("namespace") def validate_namespace(cls, v): if not all(c.isalnum() or c == "-" for c in v): raise ValueError("Namespace must be alphanumeric with hyphens only") return v.lower() # Forces lowercase @field_validator("name") def validate_name(cls, v): if not v.replace("-", "").replace("_", "").isalnum(): raise ValueError("Name must be alphanumeric with hyphens or underscores") return v.lower() # Forces lowercase ``` #### 2. `ParsedName` in `src/cleveragents/domain/models/core/project.py` Used for: Projects ```python class ParsedName(BaseModel): # Uses regex validation: r"^[a-zA-Z][a-zA-Z0-9_-]*$" # Does NOT force lowercase # Validates reserved namespaces (system, internal, admin, root) # Validates provider namespaces (openai, anthropic, etc.) ``` ### Key Differences | Feature | `NamespacedName` (plan.py) | `ParsedName` (project.py) | |---------|---------------------------|--------------------------| | Case handling | Forces lowercase | Preserves case | | Validation method | Character-by-character | Regex pattern | | Reserved namespace check | None | Yes (system, internal, admin, root) | | Provider namespace check | None | Yes (openai, anthropic, etc.) | | Underscore in namespace | Not allowed | Allowed | | Underscore in name | Allowed | Allowed | | Start character | Any alphanumeric | Must start with letter | ### Impact 1. **Inconsistent behavior**: A project named `MyProject` would be stored as `local/MyProject`, but a plan named `MyPlan` would be stored as `local/myplan` (forced lowercase). This creates cross-entity naming inconsistencies. 2. **Missing validation for plans/actions**: Plans and actions do not validate reserved namespaces (`system`, `internal`, `admin`, `root`), allowing users to create plans in reserved namespaces. 3. **Missing provider namespace protection for plans**: Users can create plans in `openai/` or `anthropic/` namespaces, which are reserved for built-in LLM actors. 4. **Namespace validation inconsistency**: `NamespacedName` allows underscores in namespaces (e.g., `my_org/plan`), while `ParsedName` does not. 5. **Code duplication**: Two separate parsing implementations that must be kept in sync. ### Code Locations - `src/cleveragents/domain/models/core/plan.py` — `NamespacedName` class (lines ~201-280) - `src/cleveragents/domain/models/core/project.py` — `ParsedName` class (lines ~68-160) - `src/cleveragents/domain/models/core/__init__.py` — Both exported (lines 191, 211) ### Recommended Fix Consolidate into a single `ParsedName` (or `NamespacedName`) class in a shared module (e.g., `src/cleveragents/domain/models/core/naming.py`) and use it consistently across all entity types. The `ParsedName` implementation in `project.py` is more complete and spec-aligned. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Closing as duplicate of #4427. Both issues describe the same bug: two incompatible namespace parsing classes (NamespacedName vs ParsedName) in the codebase. Issue #4427 is older and covers the same root cause.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Closing as duplicate of #4427. Both issues describe the same bug: two incompatible namespace parsing classes (`NamespacedName` vs `ParsedName`) in the codebase. Issue #4427 is older and covers the same root cause. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#4529
No description provided.