Add devcontainer integration, resource type inheritance, and execution environment routing to specification #491

Closed
opened 2026-03-01 19:32:25 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit Message: docs(spec): add devcontainer integration and resource type inheritance
  • Branch: docs/update-and-fix-container

Background and Context

Modern software development increasingly relies on containerized development environments. The Development Containers Specification defines .devcontainer/devcontainer.json as the standard for portable, reproducible container environments. CleverAgents already models containers as first-class resources (ADR-039), but lacks integration with devcontainers, a mechanism for resource type inheritance (needed for container specialization), and a routing system for deciding where tools execute (host vs. container).

This issue covers the specification and ADR work to add these capabilities.

Expected Behavior

The specification and supporting ADRs should define:

  1. Resource Type Inheritance (ADR-042) — A single-inheritance inherits mechanism on resource type definitions enabling subtypes (e.g., devcontainer-instance inheriting from container-instance) with polymorphic tool binding, auto-discovery, and DAG queries.
  2. Devcontainer Integration (ADR-043) — Auto-detection of .devcontainer/ directories during resource discovery, lazy container activation (build only on first access), three container-project association patterns (auto-detect, explicit mount, clone-into), and execution environment routing.
  3. Specification Updates — Glossary, resource type schema, handler/sandbox/coherence tables, auto-discovery section, tool capability metadata, CLI references (agents resource add, agents plan use, agents project context set), execution environment routing section, resource type YAML examples, and end-to-end examples.

Acceptance Criteria

  • ADR-042 (Resource Type Inheritance) created with inherits field design, field resolution, collection merging, handler inheritance, polymorphism guarantees, and inheritance chain rules
  • ADR-043 (Devcontainer Integration) created with devcontainer-instance type, lazy activation lifecycle, devcontainer.json parsing, 3 container-project association patterns, and execution environment routing
  • ADR-039 amended with cross-references to ADR-042 and ADR-043
  • ADR index updated with ADR-036 through ADR-040 (previously missing) and ADR-042, ADR-043
  • Specification glossary updated with Resource Type Inheritance, Devcontainer, and Execution Environment definitions
  • Resource type inheritance section added to specification
  • Resource type YAML schema updated with inherits field
  • Handler table, sandbox strategy table, and coherence table updated with devcontainer-instance
  • Auto-discovery section updated with devcontainer detection and WBS diagram
  • Tool capability metadata environment field expanded to structured required/preferred/specific subfields
  • Technology stack updated with devcontainer CLI entry
  • Project model updated with execution environment subsection
  • CLI agents resource add updated with --mount and --clone-into flags and container examples
  • CLI agents plan use updated with --execution-environment and --execution-env-priority flags
  • CLI agents project context set updated with --execution-environment and --execution-env-priority flags
  • Command synopsis block updated with new flags
  • Execution environment routing section added to execution model with 6-level precedence chain and routing algorithm
  • Resource type YAML Example 6 (Devcontainer Instance) added
  • End-to-end Example 16 (Devcontainer-Driven Development) added
  • End-to-end Example 17 (Explicit Container with Directory Mount) added
  • End-to-end Example 18 (Container with Remote Repo Clone) added
  • All cross-references verified consistent

Subtasks

  • Create ADR-042: Resource Type Inheritance
  • Create ADR-043: Devcontainer Integration and Container-Project Association
  • Amend ADR-039 with cross-references
  • Update ADR index with missing entries and new ADRs
  • Update specification glossary
  • Add resource type inheritance section to spec
  • Update handler, sandbox, and coherence tables
  • Update auto-discovery section with devcontainer detection
  • Update resource type YAML schema with inherits field
  • Update tool capability metadata environment field
  • Update technology stack
  • Add execution environment subsection to project model
  • Update CLI agents resource add with container flags and examples
  • Update CLI agents plan use with execution environment flags
  • Update CLI agents project context set with execution environment flags
  • Update command synopsis block
  • Add execution environment routing section
  • Add resource type YAML Example 6
  • Add end-to-end Examples 16, 17, 18
  • Final cross-reference review

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `docs(spec): add devcontainer integration and resource type inheritance` - **Branch**: `docs/update-and-fix-container` ## Background and Context Modern software development increasingly relies on containerized development environments. The [Development Containers Specification](https://containers.dev) defines `.devcontainer/devcontainer.json` as the standard for portable, reproducible container environments. CleverAgents already models containers as first-class resources (ADR-039), but lacks integration with devcontainers, a mechanism for resource type inheritance (needed for container specialization), and a routing system for deciding where tools execute (host vs. container). This issue covers the specification and ADR work to add these capabilities. ## Expected Behavior The specification and supporting ADRs should define: 1. **Resource Type Inheritance** (ADR-042) — A single-inheritance `inherits` mechanism on resource type definitions enabling subtypes (e.g., `devcontainer-instance` inheriting from `container-instance`) with polymorphic tool binding, auto-discovery, and DAG queries. 2. **Devcontainer Integration** (ADR-043) — Auto-detection of `.devcontainer/` directories during resource discovery, lazy container activation (build only on first access), three container-project association patterns (auto-detect, explicit mount, clone-into), and execution environment routing. 3. **Specification Updates** — Glossary, resource type schema, handler/sandbox/coherence tables, auto-discovery section, tool capability metadata, CLI references (`agents resource add`, `agents plan use`, `agents project context set`), execution environment routing section, resource type YAML examples, and end-to-end examples. ## Acceptance Criteria - [ ] ADR-042 (Resource Type Inheritance) created with `inherits` field design, field resolution, collection merging, handler inheritance, polymorphism guarantees, and inheritance chain rules - [ ] ADR-043 (Devcontainer Integration) created with `devcontainer-instance` type, lazy activation lifecycle, devcontainer.json parsing, 3 container-project association patterns, and execution environment routing - [ ] ADR-039 amended with cross-references to ADR-042 and ADR-043 - [ ] ADR index updated with ADR-036 through ADR-040 (previously missing) and ADR-042, ADR-043 - [ ] Specification glossary updated with Resource Type Inheritance, Devcontainer, and Execution Environment definitions - [ ] Resource type inheritance section added to specification - [ ] Resource type YAML schema updated with `inherits` field - [ ] Handler table, sandbox strategy table, and coherence table updated with `devcontainer-instance` - [ ] Auto-discovery section updated with devcontainer detection and WBS diagram - [ ] Tool capability metadata `environment` field expanded to structured `required/preferred/specific` subfields - [ ] Technology stack updated with `devcontainer CLI` entry - [ ] Project model updated with execution environment subsection - [ ] CLI `agents resource add` updated with `--mount` and `--clone-into` flags and container examples - [ ] CLI `agents plan use` updated with `--execution-environment` and `--execution-env-priority` flags - [ ] CLI `agents project context set` updated with `--execution-environment` and `--execution-env-priority` flags - [ ] Command synopsis block updated with new flags - [ ] Execution environment routing section added to execution model with 6-level precedence chain and routing algorithm - [ ] Resource type YAML Example 6 (Devcontainer Instance) added - [ ] End-to-end Example 16 (Devcontainer-Driven Development) added - [ ] End-to-end Example 17 (Explicit Container with Directory Mount) added - [ ] End-to-end Example 18 (Container with Remote Repo Clone) added - [ ] All cross-references verified consistent ## Subtasks - [x] Create ADR-042: Resource Type Inheritance - [x] Create ADR-043: Devcontainer Integration and Container-Project Association - [x] Amend ADR-039 with cross-references - [x] Update ADR index with missing entries and new ADRs - [x] Update specification glossary - [x] Add resource type inheritance section to spec - [x] Update handler, sandbox, and coherence tables - [x] Update auto-discovery section with devcontainer detection - [x] Update resource type YAML schema with `inherits` field - [x] Update tool capability metadata environment field - [x] Update technology stack - [x] Add execution environment subsection to project model - [x] Update CLI `agents resource add` with container flags and examples - [x] Update CLI `agents plan use` with execution environment flags - [x] Update CLI `agents project context set` with execution environment flags - [x] Update command synopsis block - [x] Add execution environment routing section - [x] Add resource type YAML Example 6 - [x] Add end-to-end Examples 16, 17, 18 - [x] Final cross-reference review ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added the
State
In Progress
Type
Task
labels 2026-03-01 19:32:55 +00:00
freemo added
State
In Review
and removed
State
In Progress
labels 2026-03-01 19:33:50 +00:00
freemo added
State
Completed
and removed
State
In Review
labels 2026-03-04 00:41:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cleveragents/cleveragents-core#491