docs(spec): extend auto_discovery schema with parent_types and detection fields #6313

Closed
HAL9000 wants to merge 1 commit from spec/devcontainer-auto-discovery-schema into master
Owner

Summary

Fixes a spec inconsistency identified in issue #6291 (Devcontainer auto-discovery never registers devcontainer-instance children).

Problem

The formal JSON Schema for auto_discovery in the Resource Type schema (§34650-34676) only defined four fields:

  • enabled
  • scan_depth
  • include_patterns
  • exclude_patterns

However, the built-in devcontainer-instance type example (§35283-35294) uses three additional fields that were not in the formal schema:

  • parent_types — which resource types trigger auto-discovery of this child type
  • detection.scan_paths — relative paths to check for the child resource's presence
  • detection.activationeager or lazy activation mode

This inconsistency meant implementers could not determine the correct auto_discovery schema from the formal spec alone. The auto_discover_children() helper in the repository layer was using an incompatible {"enabled": true, "rules": [...]} schema that matched neither the formal schema nor the devcontainer example.

Changes

  1. JSON Schema (§34650-34676): Extended the auto_discovery object schema to include parent_types (array of strings) and detection (object with scan_paths and activation sub-fields).

  2. Prose table (§34897-34904): Extended the Auto-Discovery Fields table to document the three new fields with descriptions and examples.

Architectural Rationale

The devcontainer example is the authoritative source — it was designed with ADR-043 and reflects the intended implementation. The formal schema simply needed to catch up. The parent_types + detection.scan_paths + detection.activation pattern is the correct way to express "when a git-checkout resource is registered and a .devcontainer/devcontainer.json file is found, create a devcontainer-instance child resource with lazy activation."

Impact on Implementers

  • auto_discover_children() in src/cleveragents/infrastructure/database/repositories.py must be updated to use the parent_types + detection.scan_paths schema instead of the old enabled/rules schema
  • ResourceRegistryService.register_resource() must call the discovery helper after inserting a parent resource
  • The devcontainer built-in type config in _resource_registry_data.py is already correct and does not need changes

References

  • Issue: #6291
  • ADR-043: Devcontainer Integration and Container-Project Association
  • Spec §34650-34676 (JSON Schema — auto_discovery)
  • Spec §34897-34904 (Prose table — Auto-Discovery Fields)
  • Spec §35283-35294 (devcontainer-instance built-in type example)
## Summary Fixes a spec inconsistency identified in issue #6291 (Devcontainer auto-discovery never registers `devcontainer-instance` children). ## Problem The formal JSON Schema for `auto_discovery` in the Resource Type schema (§34650-34676) only defined four fields: - `enabled` - `scan_depth` - `include_patterns` - `exclude_patterns` However, the built-in `devcontainer-instance` type example (§35283-35294) uses three additional fields that were not in the formal schema: - `parent_types` — which resource types trigger auto-discovery of this child type - `detection.scan_paths` — relative paths to check for the child resource's presence - `detection.activation` — `eager` or `lazy` activation mode This inconsistency meant implementers could not determine the correct `auto_discovery` schema from the formal spec alone. The `auto_discover_children()` helper in the repository layer was using an incompatible `{"enabled": true, "rules": [...]}` schema that matched neither the formal schema nor the devcontainer example. ## Changes 1. **JSON Schema** (§34650-34676): Extended the `auto_discovery` object schema to include `parent_types` (array of strings) and `detection` (object with `scan_paths` and `activation` sub-fields). 2. **Prose table** (§34897-34904): Extended the Auto-Discovery Fields table to document the three new fields with descriptions and examples. ## Architectural Rationale The devcontainer example is the authoritative source — it was designed with ADR-043 and reflects the intended implementation. The formal schema simply needed to catch up. The `parent_types` + `detection.scan_paths` + `detection.activation` pattern is the correct way to express "when a git-checkout resource is registered and a `.devcontainer/devcontainer.json` file is found, create a `devcontainer-instance` child resource with lazy activation." ## Impact on Implementers - `auto_discover_children()` in `src/cleveragents/infrastructure/database/repositories.py` must be updated to use the `parent_types` + `detection.scan_paths` schema instead of the old `enabled`/`rules` schema - `ResourceRegistryService.register_resource()` must call the discovery helper after inserting a parent resource - The devcontainer built-in type config in `_resource_registry_data.py` is already correct and does not need changes ## References - Issue: #6291 - ADR-043: Devcontainer Integration and Container-Project Association - Spec §34650-34676 (JSON Schema — auto_discovery) - Spec §34897-34904 (Prose table — Auto-Discovery Fields) - Spec §35283-35294 (devcontainer-instance built-in type example)
docs(spec): extend auto_discovery schema with parent_types and detection fields
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 23s
CI / lint (pull_request) Successful in 26s
CI / helm (pull_request) Successful in 25s
CI / quality (pull_request) Successful in 32s
CI / build (pull_request) Successful in 42s
CI / typecheck (pull_request) Successful in 54s
CI / security (pull_request) Successful in 1m5s
CI / e2e_tests (pull_request) Successful in 3m44s
CI / integration_tests (pull_request) Successful in 4m12s
CI / unit_tests (pull_request) Successful in 4m48s
CI / docker (pull_request) Successful in 1m17s
CI / coverage (pull_request) Successful in 10m32s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 58m24s
07fa1d3777
The formal JSON Schema for auto_discovery in the Resource Type schema
(§34650-34676) was missing three fields used by the built-in
devcontainer-instance type example (§35283-35294):

- parent_types: list of resource types that trigger auto-discovery
- detection.scan_paths: relative paths to check for child resource presence
- detection.activation: eager|lazy activation mode (default: lazy)

The devcontainer-instance built-in type uses all three fields to express
that it should be auto-discovered when a git-checkout resource is
registered and a .devcontainer/devcontainer.json file is found.

Without these fields in the formal schema, implementers could not
determine the correct auto_discovery schema from the spec alone, causing
the auto_discover_children() helper to use an incompatible schema.

Fixes: #6291
Refs: ADR-043 (Devcontainer Integration)
HAL9000 force-pushed spec/devcontainer-auto-discovery-schema from 07fa1d3777
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / push-validation (pull_request) Successful in 23s
CI / lint (pull_request) Successful in 26s
CI / helm (pull_request) Successful in 25s
CI / quality (pull_request) Successful in 32s
CI / build (pull_request) Successful in 42s
CI / typecheck (pull_request) Successful in 54s
CI / security (pull_request) Successful in 1m5s
CI / e2e_tests (pull_request) Successful in 3m44s
CI / integration_tests (pull_request) Successful in 4m12s
CI / unit_tests (pull_request) Successful in 4m48s
CI / docker (pull_request) Successful in 1m17s
CI / coverage (pull_request) Successful in 10m32s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 58m24s
to e121663ae7
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 25s
CI / build (pull_request) Successful in 28s
CI / push-validation (pull_request) Successful in 22s
CI / helm (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 1m2s
CI / security (pull_request) Successful in 1m11s
CI / typecheck (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 3m19s
CI / unit_tests (pull_request) Successful in 5m5s
CI / docker (pull_request) Successful in 10s
CI / integration_tests (pull_request) Successful in 6m28s
CI / coverage (pull_request) Successful in 11m58s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 58m13s
2026-04-10 18:44:51 +00:00
Compare
Author
Owner

Rebased the branch onto the latest master so the diff is up to date. Fresh CI is now running—only the long-running benchmark regression job is still in progress. I’ll merge as soon as the full check suite reports green.


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-pool-supervisor

Rebased the branch onto the latest `master` so the diff is up to date. Fresh CI is now running—only the long-running benchmark regression job is still in progress. I’ll merge as soon as the full check suite reports green. --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-pool-supervisor
HAL9000 force-pushed spec/devcontainer-auto-discovery-schema from e121663ae7
All checks were successful
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 25s
CI / build (pull_request) Successful in 28s
CI / push-validation (pull_request) Successful in 22s
CI / helm (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 1m2s
CI / security (pull_request) Successful in 1m11s
CI / typecheck (pull_request) Successful in 1m32s
CI / e2e_tests (pull_request) Successful in 3m19s
CI / unit_tests (pull_request) Successful in 5m5s
CI / docker (pull_request) Successful in 10s
CI / integration_tests (pull_request) Successful in 6m28s
CI / coverage (pull_request) Successful in 11m58s
CI / status-check (pull_request) Successful in 1s
CI / benchmark-regression (pull_request) Successful in 58m13s
to 9ebb70b909
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 23s
CI / helm (pull_request) Successful in 23s
CI / push-validation (pull_request) Successful in 18s
CI / lint (pull_request) Successful in 3m21s
CI / quality (pull_request) Successful in 3m39s
CI / typecheck (pull_request) Successful in 4m24s
CI / security (pull_request) Successful in 4m28s
CI / e2e_tests (pull_request) Successful in 6m34s
CI / unit_tests (pull_request) Successful in 8m32s
CI / integration_tests (pull_request) Failing after 14m21s
CI / docker (pull_request) Successful in 2m16s
CI / coverage (pull_request) Successful in 14m1s
CI / status-check (pull_request) Failing after 2s
CI / benchmark-regression (pull_request) Successful in 56m57s
2026-04-12 04:09:03 +00:00
Compare
HAL9001 left a comment

Blocking issues: CI is red (integration_tests + status-check), missing Closes #6291 reference, PR is not marked as blocking the issue, CHANGELOG.md & milestone updates pending, and commit message needs ISSUES CLOSED: #6291 footer. Please address and re-request review. --- Automated by CleverAgents Bot Supervisor: PR Review Pool | Agent: pr-reviewer Worker: [AUTO-REV-6313]

Blocking issues: CI is red (integration_tests + status-check), missing Closes #6291 reference, PR is not marked as blocking the issue, CHANGELOG.md & milestone updates pending, and commit message needs ISSUES CLOSED: #6291 footer. Please address and re-request review. --- **Automated by CleverAgents Bot** Supervisor: PR Review Pool | Agent: pr-reviewer Worker: [AUTO-REV-6313]
Owner

Noting that I am aware of the broader master instability tracked in #8759, but we still need a green CI result (or an explicit exception) on this branch.

Noting that I am aware of the broader master instability tracked in #8759, but we still need a green CI result (or an explicit exception) on this branch.
HAL9000 scheduled this pull request to auto merge when all checks succeed 2026-04-14 17:30:05 +00:00
freemo closed this pull request 2026-04-15 15:45:13 +00:00
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / build (pull_request) Successful in 23s
Required
Details
CI / helm (pull_request) Successful in 23s
CI / push-validation (pull_request) Successful in 18s
CI / lint (pull_request) Successful in 3m21s
Required
Details
CI / quality (pull_request) Successful in 3m39s
Required
Details
CI / typecheck (pull_request) Successful in 4m24s
Required
Details
CI / security (pull_request) Successful in 4m28s
Required
Details
CI / e2e_tests (pull_request) Successful in 6m34s
CI / unit_tests (pull_request) Successful in 8m32s
Required
Details
CI / integration_tests (pull_request) Failing after 14m21s
Required
Details
CI / docker (pull_request) Successful in 2m16s
Required
Details
CI / coverage (pull_request) Successful in 14m1s
Required
Details
CI / status-check (pull_request) Failing after 2s
CI / benchmark-regression (pull_request) Successful in 56m57s

Pull request closed

Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!6313
No description provided.