UAT: Reference parser catalog uses filesystem walk instead of Project/Plan/Resource registries — @ references cannot resolve registered projects or plans #5982

Open
opened 2026-04-09 12:52:01 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: TUI Reference and Command Input System — Reference Resolution
Component: src/cleveragents/tui/input/reference_parser.py
ADR Reference: ADR-046 §Reference Notation Grammar, §ACMS Integration


What Was Tested

Code-level analysis of the _catalog() function in src/cleveragents/tui/input/reference_parser.py (lines 37–92) against ADR-046's reference resolution specification.


Expected Behavior (from ADR-046)

ADR-046 specifies that the Reference Picker searches across three entity types:

  1. Projects: searched by name, namespace, and description — resolved through the Project Registry
  2. Plans: searched by name, ULID prefix, action name, and description — resolved through the Plan Registry
  3. Resources: searched by name, type, and file paths within the Resource DAG

The ADR also specifies ACMS integration:

Resolved references must integrate with the ACMS Context Request Protocol (CRP) to prioritize referenced resources in context assembly

Reference examples from ADR-046:

  • @project:cleveragents → resolves to @project:local/cleveragents via Project Registry
  • @plan:01HXM8C2 → resolves via Plan Registry by ULID
  • @api-service → fuzzy match → expands to @project:local/api-service via Project Registry

Actual Behavior (from code)

In src/cleveragents/tui/input/reference_parser.py, lines 37–92:

def _catalog() -> dict[str, list[str]]:
    cwd = Path.cwd()
    # ... cache check ...
    
    files = []
    for root, dirs, filenames in os.walk(cwd, followlinks=False):
        dirs[:] = [name for name in dirs if name not in _IGNORED_DIRS]
        # ... collect files from filesystem ...
    
    catalog = {
        "resource": sorted(files),          # Filesystem walk of CWD
        "project": [value for value in [cwd.name] if value],  # Just CWD name!
        "plan": [],                          # Always empty!
        "actor": sorted(...),               # Examples dir only
        "tool": sorted(...),                # Examples dir only
        "skill": sorted(...),               # Examples dir only
    }

The catalog is built entirely from the local filesystem (current working directory), not from the registered Project/Plan/Resource registries:

  1. project — Only contains [cwd.name] (the current directory name). No registered projects from the Project Registry are included.
  2. plan — Always an empty list []. No plans from the Plan Registry are ever included.
  3. resource — A filesystem walk of CWD, not the Resource DAG from the Resource Registry.
  4. actor/tool/skill — Only scans examples/ subdirectories, not the actual registries.

This means:

  • @project:api-service will fail to resolve unless there happens to be a directory named api-service in CWD
  • @plan:01HXM8C2 will always fail (plan catalog is always empty)
  • @project:local/cleveragents will only resolve if CWD is named cleveragents
  • The ACMS integration described in ADR-046 cannot function because references don't resolve through the actual registries

Code Location

  • src/cleveragents/tui/input/reference_parser.py, lines 37–92 (_catalog function)
  • Specifically: line 69 ("project": [value for value in [cwd.name] if value]) and line 70 ("plan": [])

Severity Assessment

Non-critical for v3.7.0 if the TUI is still in early development and the registry integration is planned for a later milestone. However, this is a significant functional gap:

  • The core value proposition of @ references (resolving to registered projects and plans) does not work
  • @plan:* references are completely non-functional (always empty catalog)
  • @project:* references only work for the current directory name

The ACMS integration (CRP directives from resolved references) also cannot function without proper registry-backed resolution.


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

## Bug Report **Feature Area:** TUI Reference and Command Input System — Reference Resolution **Component:** `src/cleveragents/tui/input/reference_parser.py` **ADR Reference:** ADR-046 §Reference Notation Grammar, §ACMS Integration --- ## What Was Tested Code-level analysis of the `_catalog()` function in `src/cleveragents/tui/input/reference_parser.py` (lines 37–92) against ADR-046's reference resolution specification. --- ## Expected Behavior (from ADR-046) ADR-046 specifies that the Reference Picker searches across three entity types: 1. **Projects**: searched by name, namespace, and description — resolved through the **Project Registry** 2. **Plans**: searched by name, ULID prefix, action name, and description — resolved through the **Plan Registry** 3. **Resources**: searched by name, type, and file paths within the **Resource DAG** The ADR also specifies ACMS integration: > Resolved references must integrate with the ACMS Context Request Protocol (CRP) to prioritize referenced resources in context assembly Reference examples from ADR-046: - `@project:cleveragents` → resolves to `@project:local/cleveragents` via **Project Registry** - `@plan:01HXM8C2` → resolves via **Plan Registry** by ULID - `@api-service` → fuzzy match → expands to `@project:local/api-service` via **Project Registry** --- ## Actual Behavior (from code) In `src/cleveragents/tui/input/reference_parser.py`, lines 37–92: ```python def _catalog() -> dict[str, list[str]]: cwd = Path.cwd() # ... cache check ... files = [] for root, dirs, filenames in os.walk(cwd, followlinks=False): dirs[:] = [name for name in dirs if name not in _IGNORED_DIRS] # ... collect files from filesystem ... catalog = { "resource": sorted(files), # Filesystem walk of CWD "project": [value for value in [cwd.name] if value], # Just CWD name! "plan": [], # Always empty! "actor": sorted(...), # Examples dir only "tool": sorted(...), # Examples dir only "skill": sorted(...), # Examples dir only } ``` The catalog is built entirely from the **local filesystem** (current working directory), not from the registered Project/Plan/Resource registries: 1. **`project`** — Only contains `[cwd.name]` (the current directory name). No registered projects from the Project Registry are included. 2. **`plan`** — Always an **empty list** `[]`. No plans from the Plan Registry are ever included. 3. **`resource`** — A filesystem walk of CWD, not the Resource DAG from the Resource Registry. 4. **`actor`/`tool`/`skill`** — Only scans `examples/` subdirectories, not the actual registries. This means: - `@project:api-service` will fail to resolve unless there happens to be a directory named `api-service` in CWD - `@plan:01HXM8C2` will **always fail** (plan catalog is always empty) - `@project:local/cleveragents` will only resolve if CWD is named `cleveragents` - The ACMS integration described in ADR-046 cannot function because references don't resolve through the actual registries --- ## Code Location - `src/cleveragents/tui/input/reference_parser.py`, lines 37–92 (`_catalog` function) - Specifically: line 69 (`"project": [value for value in [cwd.name] if value]`) and line 70 (`"plan": []`) --- ## Severity Assessment **Non-critical for v3.7.0** if the TUI is still in early development and the registry integration is planned for a later milestone. However, this is a significant functional gap: - The core value proposition of `@` references (resolving to registered projects and plans) does not work - `@plan:*` references are completely non-functional (always empty catalog) - `@project:*` references only work for the current directory name The ACMS integration (CRP directives from resolved references) also cannot function without proper registry-backed resolution. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 13:39:41 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

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

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **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.

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