feat(skill): add registry flattening and capability summaries #415

Closed
freemo wants to merge 1 commit from feature/m4-skill-registry-core into master
Owner

Summary

Add tools() and validate_plan() methods to SkillRegistry, enhance SkillResolver with per-include override propagation, and enforce non-overridable field constraints.

Changes

Core

  • SkillRegistry.tools(name) returns combined tuple of flattened ResolvedToolEntry list and SkillCapabilitySummary in a single call
  • SkillRegistry.validate_plan(plan) validates skill references, catching missing skills, include cycles, and invalid tool refs
  • SkillResolver._resolve_recursive() now applies per-include overrides (SkillInclude.overrides) to entries from included skills, with before/after key snapshots to target only newly-added entries
  • _NON_OVERRIDABLE_FIELDS frozenset (name, source_skill, is_inline) rejects overrides on structural fields with descriptive error messages that include skill name and include path for traceability
  • _validate_override_keys() helper ensures override safety

Testing

  • 13 Behave scenarios in features/skill_flatten.feature covering deterministic ordering, depth-first include resolution, inline tools, cycle detection with path trace, per-include overrides, non-overridable field rejection, capability summary aggregation, tools() method, validate_plan() (valid/missing/cycle), de-duplication, and shallow merge
  • 11 Robot Framework integration tests in robot/skill_flatten.robot
  • 4 ASV benchmark suites (FlattenSimple, FlattenDeep, FlattenWide, ComputeSummary) in benchmarks/skill_flatten_bench.py

Documentation

  • docs/reference/skill_registry.md updated with flattening rules, override merging, non-overridable fields, capability summary fields, validate_plan() usage, and error message reference

Closes #165

## Summary Add `tools()` and `validate_plan()` methods to SkillRegistry, enhance SkillResolver with per-include override propagation, and enforce non-overridable field constraints. ## Changes ### Core - `SkillRegistry.tools(name)` returns combined tuple of flattened `ResolvedToolEntry` list and `SkillCapabilitySummary` in a single call - `SkillRegistry.validate_plan(plan)` validates skill references, catching missing skills, include cycles, and invalid tool refs - `SkillResolver._resolve_recursive()` now applies per-include overrides (`SkillInclude.overrides`) to entries from included skills, with before/after key snapshots to target only newly-added entries - `_NON_OVERRIDABLE_FIELDS` frozenset (`name`, `source_skill`, `is_inline`) rejects overrides on structural fields with descriptive error messages that include skill name and include path for traceability - `_validate_override_keys()` helper ensures override safety ### Testing - 13 Behave scenarios in `features/skill_flatten.feature` covering deterministic ordering, depth-first include resolution, inline tools, cycle detection with path trace, per-include overrides, non-overridable field rejection, capability summary aggregation, `tools()` method, `validate_plan()` (valid/missing/cycle), de-duplication, and shallow merge - 11 Robot Framework integration tests in `robot/skill_flatten.robot` - 4 ASV benchmark suites (`FlattenSimple`, `FlattenDeep`, `FlattenWide`, `ComputeSummary`) in `benchmarks/skill_flatten_bench.py` ### Documentation - `docs/reference/skill_registry.md` updated with flattening rules, override merging, non-overridable fields, capability summary fields, `validate_plan()` usage, and error message reference Closes #165
freemo added this to the v3.1.0 milestone 2026-02-24 13:14:01 +00:00
freemo force-pushed feature/m4-skill-registry-core from 54dd6c2059
Some checks failed
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 18s
CI / security (pull_request) Successful in 29s
CI / typecheck (pull_request) Successful in 43s
CI / integration_tests (pull_request) Successful in 2m31s
CI / unit_tests (pull_request) Successful in 6m59s
CI / docker (pull_request) Successful in 39s
CI / benchmark-regression (pull_request) Successful in 17m32s
CI / coverage (pull_request) Failing after 23m22s
to 0abf805a26
All checks were successful
CI / lint (pull_request) Successful in 23s
CI / quality (pull_request) Successful in 32s
CI / benchmark-publish (pull_request) Has been skipped
CI / security (pull_request) Successful in 50s
CI / typecheck (pull_request) Successful in 58s
CI / build (pull_request) Successful in 23s
CI / integration_tests (pull_request) Successful in 5m15s
CI / unit_tests (pull_request) Successful in 21m32s
CI / benchmark-regression (pull_request) Successful in 21m20s
CI / docker (pull_request) Successful in 14s
CI / coverage (pull_request) Successful in 42m30s
2026-02-24 20:32:49 +00:00
Compare
Author
Owner

Seems these commits got in elsewhere (perhaps as part of a squash.

Seems these commits got in elsewhere (perhaps as part of a squash.
freemo closed this pull request 2026-02-24 20:47:35 +00:00
All checks were successful
CI / lint (pull_request) Successful in 23s
Required
Details
CI / quality (pull_request) Successful in 32s
Required
Details
CI / benchmark-publish (pull_request) Has been skipped
CI / security (pull_request) Successful in 50s
Required
Details
CI / typecheck (pull_request) Successful in 58s
Required
Details
CI / build (pull_request) Successful in 23s
Required
Details
CI / integration_tests (pull_request) Successful in 5m15s
Required
Details
CI / unit_tests (pull_request) Successful in 21m32s
Required
Details
CI / benchmark-regression (pull_request) Successful in 21m20s
CI / docker (pull_request) Successful in 14s
Required
Details
CI / coverage (pull_request) Successful in 42m30s
Required
Details

Pull request closed

Sign in to join this conversation.
No reviewers
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!415
No description provided.