feat(extensibility): implement pluggable component resolution with scope chain (plan > project > global) #552

Closed
opened 2026-03-04 01:03:51 +00:00 by freemo · 1 comment
Owner

Metadata

  • Commit Message: feat(extensibility): implement pluggable scope chain resolution
  • Branch: feature/m7-pluggable-scope-chain
Field Value
Type Feature
Priority Medium
MoSCoW Could Have
Points 8
Milestone v3.6.0
Assignee freemo
Parent Epic #378 (Legendary: Post-MVP Deferred Work)
Depends On #539 (pipeline orchestrator), #352 (Config Service A9)

Background

The specification (§ Extensibility > Extension Points Summary, lines 44369-44396) defines 27 extension points with specific registration mechanisms. While individual feature issues cover some of these points, no issue ensures the scope chain resolution framework is consistently implemented across all extension points.

The scope chain determines which implementation of a pluggable component is used:

  1. Plan-level override (highest priority) — plan config specifies a custom implementation
  2. Project-level override — project config.toml specifies a custom implementation
  3. Global default — the built-in default implementation

Key extension point categories needing scope chain:

  • ACMS pipeline components (10 components × 3 scopes)
  • Context strategies (custom strategies per plan/project)
  • Sandbox strategies (custom sandbox per resource type config)
  • UKO vocabulary (custom Turtle/RDF files per project)
  • UKO analyzers (custom analyzers per project config.toml)
  • Validation implementations (custom validators per project)

Acceptance Criteria

  1. ComponentResolver class implements 3-level scope chain: plan > project > global.
  2. Any Protocol-based pluggable component can be resolved through the scope chain.
  3. Plan-level overrides are specified in plan metadata.
  4. Project-level overrides are specified in config.toml under [extensions] or component-specific sections.
  5. Global defaults are registered at application startup.
  6. Resolution is deterministic and cached per scope.
  7. Missing implementations at a scope level transparently fall through to the next scope.

Subtasks

1. Design

  • Design ComponentResolver interface and scope chain algorithm
  • Design config.toml schema for extension point overrides
  • Map all 27 extension points to their resolution paths

2. Implementation

  • Implement ComponentResolver with 3-level scope chain
  • Implement config.toml extension point parsing
  • Wire resolver into ACMS pipeline component injection
  • Wire resolver into strategy, sandbox, and validator selection
  • Add plan-level override support

3. Testing

  • Unit test: global default resolution
  • Unit test: project override takes precedence
  • Unit test: plan override takes highest precedence
  • Unit test: fallthrough on missing scope
  • Integration test: end-to-end custom component via config.toml

4. Documentation

  • Extension point catalog (all 27 points with registration instructions)
  • Config.toml extension guide
  • Custom component development tutorial

5. Integration

  • Wire into all existing pluggable component creation points
  • Verify compatibility with Config Service A9 (#352)

6. Observability

  • Log resolution chain (which scope provided the component)

7. Security

  • Validate that custom components come from trusted sources
  • Plan-level overrides cannot bypass project-level security constraints

Definition of Done

  • All acceptance criteria met
  • All subtask checkboxes checked
  • Tests pass in CI
  • Code reviewed and approved
## Metadata - **Commit Message**: `feat(extensibility): implement pluggable scope chain resolution` - **Branch**: `feature/m7-pluggable-scope-chain` | Field | Value | |-------|-------| | **Type** | Feature | | **Priority** | Medium | | **MoSCoW** | Could Have | | **Points** | 8 | | **Milestone** | v3.6.0 | | **Assignee** | freemo | | **Parent Epic** | #378 (Legendary: Post-MVP Deferred Work) | | **Depends On** | #539 (pipeline orchestrator), #352 (Config Service A9) | ## Background The specification (§ Extensibility > Extension Points Summary, lines 44369-44396) defines **27 extension points** with specific registration mechanisms. While individual feature issues cover some of these points, no issue ensures the **scope chain resolution** framework is consistently implemented across all extension points. The scope chain determines which implementation of a pluggable component is used: 1. **Plan-level override** (highest priority) — plan config specifies a custom implementation 2. **Project-level override** — project config.toml specifies a custom implementation 3. **Global default** — the built-in default implementation Key extension point categories needing scope chain: - ACMS pipeline components (10 components × 3 scopes) - Context strategies (custom strategies per plan/project) - Sandbox strategies (custom sandbox per resource type config) - UKO vocabulary (custom Turtle/RDF files per project) - UKO analyzers (custom analyzers per project config.toml) - Validation implementations (custom validators per project) ## Acceptance Criteria 1. `ComponentResolver` class implements 3-level scope chain: plan > project > global. 2. Any Protocol-based pluggable component can be resolved through the scope chain. 3. Plan-level overrides are specified in plan metadata. 4. Project-level overrides are specified in `config.toml` under `[extensions]` or component-specific sections. 5. Global defaults are registered at application startup. 6. Resolution is deterministic and cached per scope. 7. Missing implementations at a scope level transparently fall through to the next scope. ## Subtasks ### 1. Design - [ ] Design `ComponentResolver` interface and scope chain algorithm - [ ] Design config.toml schema for extension point overrides - [ ] Map all 27 extension points to their resolution paths ### 2. Implementation - [ ] Implement `ComponentResolver` with 3-level scope chain - [ ] Implement config.toml extension point parsing - [ ] Wire resolver into ACMS pipeline component injection - [ ] Wire resolver into strategy, sandbox, and validator selection - [ ] Add plan-level override support ### 3. Testing - [ ] Unit test: global default resolution - [ ] Unit test: project override takes precedence - [ ] Unit test: plan override takes highest precedence - [ ] Unit test: fallthrough on missing scope - [ ] Integration test: end-to-end custom component via config.toml ### 4. Documentation - [ ] Extension point catalog (all 27 points with registration instructions) - [ ] Config.toml extension guide - [ ] Custom component development tutorial ### 5. Integration - [ ] Wire into all existing pluggable component creation points - [ ] Verify compatibility with Config Service A9 (#352) ### 6. Observability - [ ] Log resolution chain (which scope provided the component) ### 7. Security - [ ] Validate that custom components come from trusted sources - [ ] Plan-level overrides cannot bypass project-level security constraints ## Definition of Done - [ ] All acceptance criteria met - [ ] All subtask checkboxes checked - [ ] Tests pass in CI - [ ] Code reviewed and approved
freemo added this to the v3.6.0 milestone 2026-03-04 01:03:56 +00:00
freemo self-assigned this 2026-03-04 01:41:13 +00:00
Author
Owner

Implementation complete in PR #623.

ComponentResolver implements a 3-level scope chain (plan > project > global) for resolving Protocol-based pluggable components. Key features:

  • Thread-safe registration and resolution with caching
  • config.toml extension loading and plan metadata loading
  • Introspection APIs and extension point catalog
  • Security-restricted dynamic imports (module prefix allowlist)
  • None-rejection validation on all registration methods

Test coverage:

  • 39 BDD scenarios (features/component_resolver.feature)
  • 9 Robot Framework integration tests
  • ASV benchmark suite
  • 100% code coverage on component_resolver.py; 97.07% overall
  • Lint, typecheck (Pyright strict), and all nox stages pass
Implementation complete in PR #623. **ComponentResolver** implements a 3-level scope chain (plan > project > global) for resolving Protocol-based pluggable components. Key features: - Thread-safe registration and resolution with caching - `config.toml` extension loading and plan metadata loading - Introspection APIs and extension point catalog - Security-restricted dynamic imports (module prefix allowlist) - None-rejection validation on all registration methods **Test coverage:** - 39 BDD scenarios (features/component_resolver.feature) - 9 Robot Framework integration tests - ASV benchmark suite - 100% code coverage on component_resolver.py; 97.07% overall - Lint, typecheck (Pyright strict), and all nox stages pass
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#552
No description provided.