Files
cleveragents-core/features/devcontainer_autodiscovery_wiring.feature
HAL9000 3d7afb4378 fix(resource): wire discover_devcontainers() into git-checkout and fs-directory handlers
GitCheckoutHandler.discover_children() and FsDirectoryHandler.discover_children()
now call discover_devcontainers() after scanning for fs-directory children. Any
.devcontainer/devcontainer.json or root-level .devcontainer.json found at the
resource location is registered as a devcontainer-instance child resource with
provisioning_state: discovered. Named configurations are also discovered and carry
the configuration name in the config_name property.

This wires the previously-isolated discover_devcontainers() function into the
production code path, enabling the spec's zero-configuration devcontainer experience.

ISSUES CLOSED: #4740
2026-05-07 23:49:20 +00:00

63 lines
4.0 KiB
Gherkin

Feature: Devcontainer auto-discovery wired into git-checkout and fs-directory handlers
As a CleverAgents user
I want devcontainer configurations to be automatically discovered
When I register a git-checkout or fs-directory resource
So that devcontainer-instance child resources are created without manual intervention
Scenario: git-checkout discover_children finds root devcontainer config
Given dcwire a git repo with a ".devcontainer/devcontainer.json" file
When dcwire I call discover_children on the git-checkout resource
Then dcwire the children include a "devcontainer-instance" resource named "devcontainer-default"
And dcwire the devcontainer child has provisioning_state "discovered"
And dcwire the devcontainer child has devcontainer_json_path set
Scenario: git-checkout discover_children finds named devcontainer config
Given dcwire a git repo with a ".devcontainer/api/devcontainer.json" named config
When dcwire I call discover_children on the git-checkout resource
Then dcwire the children include a "devcontainer-instance" resource named "devcontainer-api"
And dcwire the devcontainer child has config_name "api"
Scenario: git-checkout discover_children with no devcontainer returns only directories
Given dcwire a git repo with no devcontainer configuration
When dcwire I call discover_children on the git-checkout resource
Then dcwire no devcontainer-instance children are present
Scenario: git-checkout discover_children includes both fs-directory and devcontainer children
Given dcwire a git repo with a subdirectory "src" and a ".devcontainer/devcontainer.json" file
When dcwire I call discover_children on the git-checkout resource
Then dcwire the children include a "fs-directory" resource named "src"
And dcwire the children include a "devcontainer-instance" resource named "devcontainer-default"
Scenario: fs-directory discover_children finds root devcontainer config
Given dcwire a filesystem directory with a ".devcontainer/devcontainer.json" file
When dcwire I call discover_children on the fs-directory resource
Then dcwire the children include a "devcontainer-instance" resource named "devcontainer-default"
And dcwire the devcontainer child has provisioning_state "discovered"
Scenario: fs-directory discover_children finds named devcontainer config
Given dcwire a filesystem directory with a ".devcontainer/frontend/devcontainer.json" named config
When dcwire I call discover_children on the fs-directory resource
Then dcwire the children include a "devcontainer-instance" resource named "devcontainer-frontend"
And dcwire the devcontainer child has config_name "frontend"
Scenario: fs-directory discover_children with no devcontainer returns only directories
Given dcwire a filesystem directory with no devcontainer configuration
When dcwire I call discover_children on the fs-directory resource
Then dcwire no devcontainer-instance children are present
Scenario: fs-directory discover_children includes both fs-directory and devcontainer children
Given dcwire a filesystem directory with a subdirectory "lib" and a ".devcontainer/devcontainer.json" file
When dcwire I call discover_children on the fs-directory resource
Then dcwire the children include a "fs-directory" resource named "lib"
And dcwire the children include a "devcontainer-instance" resource named "devcontainer-default"
Scenario: git-checkout discover_children finds root-level .devcontainer.json
Given dcwire a git repo with a root-level ".devcontainer.json" file
When dcwire I call discover_children on the git-checkout resource
Then dcwire the children include a "devcontainer-instance" resource named "devcontainer-default"
Scenario: fs-directory discover_children finds root-level .devcontainer.json
Given dcwire a filesystem directory with a root-level ".devcontainer.json" file
When dcwire I call discover_children on the fs-directory resource
Then dcwire the children include a "devcontainer-instance" resource named "devcontainer-default"