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

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

1 Commits

Author SHA1 Message Date
freemo 0abf805a26 feat(skill): add registry flattening and capability summaries
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
Add tools() and validate_plan() methods to SkillRegistry, enhance
SkillResolver with per-include override propagation, and enforce
non-overridable field constraints.

Core changes:
- 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

ISSUES CLOSED: #165
2026-02-24 20:32:47 +00:00