UAT: Server-qualified project names lose server prefix after persistence #7966

Open
opened 2026-04-12 16:11:46 +00:00 by HAL9000 · 0 comments
Owner

Summary

  • Creating a project with a server-qualified name drops the server prefix when persisted and rehydrated.
  • Subsequent CLI commands cannot find the project using the name that was originally provided.

Steps to Reproduce

  1. Run agents project create dev:team/demo (or call the CLI through the API).
  2. Run agents project show dev:team/demo.
  3. Observe that the command fails with "Project not found".
  4. Run agents project show team/demo and notice the project exists but the server qualifier is missing from the output.

Expected Result

  • The server qualifier (dev: in this example) should be preserved when the project is stored and should be used for subsequent lookups.
  • Showing the project should display the fully-qualified name (dev:team/demo).

Actual Result

  • The server qualifier is discarded during persistence, so lookups using the original dev:team/demo name fail and the project is only accessible as team/demo.
  • The stored project can never be associated back to its server context.

Technical Notes

  • NamespacedProjectModel.from_domain (src/cleveragents/infrastructure/database/models.py) only stores project.namespaced_name, which omits the optional server prefix entirely.
  • NamespacedProjectModel.to_domain recreates a NamespacedProject without populating server, so rehydrated domain objects lose the qualifier.
  • The domain model expects optional servers (see parse_namespaced_name and NamespacedProject.qualified_name), so the persistence layer violates the spec by dropping that information.
  • Minimal proof:
    from cleveragents.domain.models.core.project import NamespacedProject
    from cleveragents.infrastructure.database.models import NamespacedProjectModel
    proj = NamespacedProject(name='demo', namespace='team', server='dev')
    restored = NamespacedProjectModel.from_domain(proj).to_domain()
    assert restored.server is None and restored.qualified_name == 'team/demo'
    

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

## Summary - Creating a project with a server-qualified name drops the server prefix when persisted and rehydrated. - Subsequent CLI commands cannot find the project using the name that was originally provided. ## Steps to Reproduce 1. Run `agents project create dev:team/demo` (or call the CLI through the API). 2. Run `agents project show dev:team/demo`. 3. Observe that the command fails with "Project not found". 4. Run `agents project show team/demo` and notice the project exists but the server qualifier is missing from the output. ## Expected Result - The server qualifier (`dev:` in this example) should be preserved when the project is stored and should be used for subsequent lookups. - Showing the project should display the fully-qualified name (`dev:team/demo`). ## Actual Result - The server qualifier is discarded during persistence, so lookups using the original `dev:team/demo` name fail and the project is only accessible as `team/demo`. - The stored project can never be associated back to its server context. ## Technical Notes - `NamespacedProjectModel.from_domain` (src/cleveragents/infrastructure/database/models.py) only stores `project.namespaced_name`, which omits the optional server prefix entirely. - `NamespacedProjectModel.to_domain` recreates a `NamespacedProject` without populating `server`, so rehydrated domain objects lose the qualifier. - The domain model expects optional servers (see `parse_namespaced_name` and `NamespacedProject.qualified_name`), so the persistence layer violates the spec by dropping that information. - Minimal proof: ```python from cleveragents.domain.models.core.project import NamespacedProject from cleveragents.infrastructure.database.models import NamespacedProjectModel proj = NamespacedProject(name='demo', namespace='team', server='dev') restored = NamespacedProjectModel.from_domain(proj).to_domain() assert restored.server is None and restored.qualified_name == 'team/demo' ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
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#7966
No description provided.