feat: add extends= attribute for interface inheritance (ADR-011) - #10
Merged
sergio-sisternes-epam merged 1 commit intoMay 25, 2026
Merged
Conversation
Introduces the `extends=` attribute on `<skill define="interface">` nodes to express interface specialisation (UML-style interface inheritance). ### Changes **AST** - `NodeKind::InterfaceDefinition` gains `extends: Option<String>` and `legacy_implements: Option<String>`. **Parser** - Reads `extends=` and captures a legacy `implements=` on interface nodes into the new AST fields. **Validator** - Error when `extends=""` (empty value). - Error when both `extends` and `implements` are present with different values. - Warning (deprecation) when `implements=` is used on an interface definition. **Registry** - `InterfaceEntry` gains `extends: Option<String>`. - `register_interface` gains an `extends` parameter. - `validate()` checks for unknown parents (`ExtendsUnknownInterface`) and cycles (`ExtendsInterfaceCycle`). **Python bindings** - `register_interface(name, extends=None, description=None)`. **Docs** - `docs/spec/attributes.md` — new `extends=` row, updated mutual-exclusivity table, and a dedicated semantics section. - `docs/spec/grammar.ebnf` — `ExtendsAttr` added to `InterfaceDefAttrs`. - `docs/spec/resolution.md` — clarifies that `extends` is metadata-only; transitive resolution is explicitly out of scope for this release. - `docs/adrs/adr-011-extends-attribute.md` — new ADR. - CHANGELOG, API reference docs updated. Resolves the DDE v0.5 request to correctly model `dde-simple` and `dde-advanced` as sub-interfaces rather than implementations. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the
extends=attribute on AML interface nodes, resolving the DDE v0.5 request to correctly model multi-level interface hierarchies.Problem
AML had no way to express interface-to-interface specialisation. The only option was
implements=ondefine="interface"nodes, which is semantically wrong (it implies the interface is directly invocable) and was confusing genesis reviewers in the DDE project.Changes
Core (
aml-core)NodeKind::InterfaceDefinitiongainsextends: Option<String>andlegacy_implements: Option<String>extends=and captures legacyimplements=on interface nodesextends=""(empty value)extendsandimplementswith different values on same interfaceimplements=on interface definition (deprecated; useextends=)InterfaceEntrygainsextends;validate()checks for unknown parents and cycles (ExtendsUnknownInterface,ExtendsInterfaceCycle)Python bindings (
aml-python)register_interface(name, extends=None, description=None)Docs
docs/spec/attributes.md— new attribute row + semantics sectiondocs/spec/grammar.ebnf—ExtendsAttraddeddocs/spec/resolution.md— metadata-only notedocs/adrs/adr-011-extends-attribute.md— new ADRUsage (DDE migration)
Notes
extendsis metadata + validation only — resolution behaviour is unchanged. Transitive resolution is explicitly deferred until contract-compatibility rules are defined (see ADR-011).aml-coretests pass.