diff --git a/CHANGELOG.md b/CHANGELOG.md index dca5c2ea6..5901227b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ Changed `wf10_batch.robot` to be less likely to create files, and `plan_generation_graph.robot` to give more test answers. ## [Unreleased] +- **fix(resources): remove unsupported executable resource type and fix resource list columns** (#3077 / PR #3248): Removed `executable` from `LSP_RESOURCE_TYPES` and `BUILTIN_TYPE_NAMES` (the specification defines no such built-in type). Updated `agents resource list` CLI table columns from `[ID, Name, Type, Status, Kind, Location, Description]` to the spec-required `[Name, ID, Type, Phys/Virt, Children, Projects]`. Deleted orphaned `examples/resource-types/executable.yaml`. Lifecycle state for container resources is now displayed as a note below the resource table. - **fix(cli): add Read-Only and Writes columns to tool list output** (#1476): Rewrote `list_tools()` in `src/cleveragents/cli/commands/tool.py` to render exactly the 5 spec-required columns (Name, Type, Source, Read-Only, Writes), removed the legacy diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 1264eaf25..1e635e434 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -55,3 +55,4 @@ Below are some of the specific details of various contributions. dropped. Includes Behave BDD and Robot Framework regression tests. * HAL 9000 has contributed the config-actor combined-format support fix (PR #11232 / issue #11189): added ``_detect_nested_config_actor()``, ``_flatten_config_actor()``, and handling in ``ActorConfiguration.from_blob()`` to transparently flatten the nested ``config.actor`` block from both compact-string and nested-dict forms so v3 detection, schema validation, and canonicalisation see flat data — eliminating the ``"provider is required"`` crash. * HAL 9000 has contributed the actor compiler `actor_ref` field fix (issue #1429): corrected `_map_node()` and `compile_actor()` in `src/cleveragents/actor/compiler.py` to read `actor_ref` from the top-level `NodeDefinition.actor_ref` field instead of `node.config.get("actor_ref")`, resolving silent failures on all SUBGRAPH nodes where `subgraph_refs` was always empty and `NodeConfig.subgraph` was always `None`. +* HAL 9000 has contributed the removal of the unsupported executable resource type (PR #3248 / issue #3077): removed `executable` from `LSP_RESOURCE_TYPES` and `BUILTIN_TYPE_NAMES`, updated `agents resource list` CLI table columns to the spec-required `[Name, ID, Type, Phys/Virt, Children, Projects]`, deleted orphaned `examples/resource-types/executable.yaml`, and updated related BDD test coverage. diff --git a/examples/resource-types/executable.yaml b/examples/resource-types/executable.yaml deleted file mode 100644 index fae10cde5..000000000 --- a/examples/resource-types/executable.yaml +++ /dev/null @@ -1,29 +0,0 @@ -# Spec reference: docs/adr/ADR-039-container-resource-types.md lines 207-226 -schema_version: "1.0" -name: executable -description: "System executable (language runtime, compiler, LSP server binary). Discovered from container or host PATH." -resource_kind: physical -sandbox_strategy: none -user_addable: true -built_in: true -cli_args: - - name: path - type: string - required: true - description: Absolute path to the executable - - name: version - type: string - required: false - description: Executable version if detectable -parent_types: ["container-exec-env", "fs-directory"] -child_types: [] -handler: "cleveragents.resource.handlers.executable:ExecutableHandler" -auto_discovery: - trigger_types: ["container-exec-env", "fs-directory"] - scan_paths: [] - lazy: true -capabilities: - read: true - write: false - sandbox: false - checkpoint: false diff --git a/features/resource_cli.feature b/features/resource_cli.feature index e1033fafa..ed2da316e 100644 --- a/features/resource_cli.feature +++ b/features/resource_cli.feature @@ -102,6 +102,14 @@ Feature: Resource CLI commands When I run resource list with format "json" Then the resource output should be valid JSON + Scenario: List resources shows spec-required columns + Given built-in types are bootstrapped + And I run resource add "git-checkout" "local/col-test" with path "/tmp/ctest" + When I run resource list + Then the resource output should contain "Phys/Virt" + And the resource output should contain "Children" + And the resource output should contain "Projects" + # ---- Resource Show ---- Scenario: Show a resource by name diff --git a/features/resource_list_lifecycle_state.feature b/features/resource_list_lifecycle_state.feature index 0c411b472..9eded453d 100644 --- a/features/resource_list_lifecycle_state.feature +++ b/features/resource_list_lifecycle_state.feature @@ -7,10 +7,12 @@ Feature: agents resource list shows devcontainer lifecycle state column Given a fresh in-memory resource registry And built-in types are bootstrapped - Scenario: resource list shows "Status" column header + Scenario: resource list shows spec-required column headers Given a devcontainer-instance resource is registered When I run resource list with all flag - Then the resource output should contain "Status" + Then the resource output should contain "Phys/Virt" + And the resource output should contain "Children" + And the resource output should contain "Projects" Scenario: resource list shows "detected (not built)" for a new devcontainer-instance Given a devcontainer-instance resource is registered @@ -68,8 +70,7 @@ Feature: agents resource list shows devcontainer lifecycle state column Scenario: resource list shows lifecycle state for container-instance resources Given a container-instance resource is registered When I run resource list with all flag - Then the resource output should contain "Status" - And the resource output should contain "detected (not built)" + Then the resource output should contain "detected (not built)" Scenario: resource list succeeds gracefully when lifecycle tracker raises an error Given a devcontainer-instance resource is registered diff --git a/src/cleveragents/cli/commands/resource.py b/src/cleveragents/cli/commands/resource.py index 1dc7457ef..6e04b110d 100644 --- a/src/cleveragents/cli/commands/resource.py +++ b/src/cleveragents/cli/commands/resource.py @@ -860,37 +860,40 @@ def resource_list( return table = Table(title=f"Resources ({len(resources)} total)") - table.add_column("ID", style="dim") table.add_column("Name", style="cyan") + table.add_column("ID", style="dim") table.add_column("Type", style="blue") - table.add_column("Status", style="yellow") - table.add_column("Kind", style="magenta") - table.add_column("Location", style="dim") - table.add_column("Description", style="dim") + table.add_column("Phys/Virt", style="magenta") + table.add_column("Children", justify="right") + table.add_column("Projects", justify="right") detected_devcontainers: list[Any] = [] + lifecycle_states: list[tuple[Any, str]] = [] for res in resources: - desc = res.description or "" - if len(desc) > 40: - desc = desc[:37] + "..." res_id = res.resource_id if len(res_id) > 12: res_id = res_id[:12] + "..." lifecycle_state = _get_lifecycle_state_str(res) if lifecycle_state == "detected (not built)": detected_devcontainers.append(res) + if lifecycle_state: + lifecycle_states.append((res, lifecycle_state)) table.add_row( - res_id, res.name or "(unnamed)", + res_id, res.resource_type_name, - lifecycle_state or "", str(res.classification), - res.location or "", - desc, + str(len(res.children)), + str(len(res.linked_projects)), ) console.print(table) + for res, state in lifecycle_states: + style = "yellow" if state in ("detected (not built)", "failed") else "blue" + label = res.name or res.resource_id + console.print(f"[{style}] {label}: {state}[/{style}]") + for res in detected_devcontainers: location = res.location or "(unknown path)" devcontainer_json = f"{location}/.devcontainer/devcontainer.json"