[BUG] NamespacedName does not reject namespace/name components starting with a digit #9073

Open
opened 2026-04-14 07:07:46 +00:00 by HAL9000 · 1 comment
Owner

Metadata

Commit: fix(plan): enforce must-start-with-letter constraint in NamespacedName validation
Branch: fix/namespaced-name-reject-digit-start

Background and Context

Per the specification (docs/specification.md — §Naming & Identity (Namespace)), namespace and name components in the [[server:]namespace/]name format must start with a letter (not a digit). The NamespacedName model currently does not enforce this constraint, meaning names like "123abc/my-action" are accepted without error.

This is tracked as @tdd_expected_fail in features/plan_namespaced_name_validation.feature (scenarios tagged @tdd_issue_2145 @tdd_issue_2147):

@tdd_issue @tdd_issue_2145 @tdd_issue_2147 @tdd_expected_fail
Scenario: NamespacedName.parse() rejects namespace starting with a digit
  When I parse the namespaced name "123abc/my-action" expecting an error
  Then a ValueError should be raised
  And the error message should contain "must start with a letter"

Feature Area: Plan Lifecycle & Decision Tree
Spec Reference: docs/specification.md — §Naming & Identity (Namespace)

Expected Behavior

Per the specification, namespace and name components in the [[server:]namespace/]name format must start with a letter (not a digit). For example:

  • "123abc/my-action" should be rejected with an error containing "must start with a letter"
  • "local/123-action" should be rejected with an error containing "must start with a letter"
  • "999org/valid-name" should be rejected with an error containing "must start with a letter"

Acceptance Criteria

  • NamespacedName.parse("123abc/my-action") raises ValueError with message containing "must start with a letter"
  • NamespacedName(namespace="local", name="123-action") raises ValidationError with message containing "must start with a letter"
  • NamespacedName(namespace="999org", name="valid-name") raises ValidationError with message containing "must start with a letter"
  • All three @tdd_expected_fail scenarios in plan_namespaced_name_validation.feature pass
  • Positive cases (valid names starting with letters) continue to pass
  • No regression in existing tests

Subtasks

  • Add validation to NamespacedName.parse() to reject namespace components starting with a digit
  • Add validation to NamespacedName constructor to reject name components starting with a digit
  • Add validation to NamespacedName constructor to reject namespace components starting with a digit
  • Ensure error messages contain "must start with a letter"
  • Remove @tdd_expected_fail tags from features/plan_namespaced_name_validation.feature scenarios
  • Verify positive cases (valid names starting with letters) still work

Definition of Done

  • NamespacedName.parse("123abc/my-action") raises ValueError with message containing "must start with a letter"
  • NamespacedName(namespace="local", name="123-action") raises ValidationError with message containing "must start with a letter"
  • NamespacedName(namespace="999org", name="valid-name") raises ValidationError with message containing "must start with a letter"
  • All three @tdd_expected_fail scenarios in plan_namespaced_name_validation.feature pass
  • Positive cases (valid names) continue to pass
  • No regression in existing tests

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata **Commit:** `fix(plan): enforce must-start-with-letter constraint in NamespacedName validation` **Branch:** `fix/namespaced-name-reject-digit-start` ## Background and Context Per the specification (`docs/specification.md` — §Naming & Identity (Namespace)), namespace and name components in the `[[server:]namespace/]name` format must start with a letter (not a digit). The `NamespacedName` model currently does not enforce this constraint, meaning names like `"123abc/my-action"` are accepted without error. This is tracked as `@tdd_expected_fail` in `features/plan_namespaced_name_validation.feature` (scenarios tagged `@tdd_issue_2145 @tdd_issue_2147`): ```gherkin @tdd_issue @tdd_issue_2145 @tdd_issue_2147 @tdd_expected_fail Scenario: NamespacedName.parse() rejects namespace starting with a digit When I parse the namespaced name "123abc/my-action" expecting an error Then a ValueError should be raised And the error message should contain "must start with a letter" ``` **Feature Area:** Plan Lifecycle & Decision Tree **Spec Reference:** `docs/specification.md` — §Naming & Identity (Namespace) ## Expected Behavior Per the specification, namespace and name components in the `[[server:]namespace/]name` format must start with a letter (not a digit). For example: - `"123abc/my-action"` should be rejected with an error containing "must start with a letter" - `"local/123-action"` should be rejected with an error containing "must start with a letter" - `"999org/valid-name"` should be rejected with an error containing "must start with a letter" ## Acceptance Criteria - [ ] `NamespacedName.parse("123abc/my-action")` raises `ValueError` with message containing "must start with a letter" - [ ] `NamespacedName(namespace="local", name="123-action")` raises `ValidationError` with message containing "must start with a letter" - [ ] `NamespacedName(namespace="999org", name="valid-name")` raises `ValidationError` with message containing "must start with a letter" - [ ] All three `@tdd_expected_fail` scenarios in `plan_namespaced_name_validation.feature` pass - [ ] Positive cases (valid names starting with letters) continue to pass - [ ] No regression in existing tests ## Subtasks - [ ] Add validation to `NamespacedName.parse()` to reject namespace components starting with a digit - [ ] Add validation to `NamespacedName` constructor to reject name components starting with a digit - [ ] Add validation to `NamespacedName` constructor to reject namespace components starting with a digit - [ ] Ensure error messages contain "must start with a letter" - [ ] Remove `@tdd_expected_fail` tags from `features/plan_namespaced_name_validation.feature` scenarios - [ ] Verify positive cases (valid names starting with letters) still work ## Definition of Done - [ ] `NamespacedName.parse("123abc/my-action")` raises `ValueError` with message containing "must start with a letter" - [ ] `NamespacedName(namespace="local", name="123-action")` raises `ValidationError` with message containing "must start with a letter" - [ ] `NamespacedName(namespace="999org", name="valid-name")` raises `ValidationError` with message containing "must start with a letter" - [ ] All three `@tdd_expected_fail` scenarios in `plan_namespaced_name_validation.feature` pass - [ ] Positive cases (valid names) continue to pass - [ ] No regression in existing tests --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.2.0 milestone 2026-04-14 07:37:27 +00:00
Author
Owner

🔍 Triage Decision

Status: VERIFIED

MoSCoW: Should have
Priority: High
Milestone: v3.2.0

Reasoning: NamespacedName does not reject namespace/name components starting with a digit, which is a validation correctness bug; slightly less critical than the broader name format rejection issue but should still be fixed in v3.2.0.


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

## 🔍 Triage Decision **Status:** ✅ VERIFIED **MoSCoW:** Should have **Priority:** High **Milestone:** v3.2.0 **Reasoning:** `NamespacedName` does not reject namespace/name components starting with a digit, which is a validation correctness bug; slightly less critical than the broader name format rejection issue but should still be fixed in v3.2.0. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#9073
No description provided.