Skip to content

BaseFeature: typed Ash resource fragment for features #129

@matt-beanland

Description

@matt-beanland

Motivation

Diffo.Provider.Feature is a generic Ash Resource whose characteristics are stored via the generic Characteristic resource (using Ash.Type.Dynamic). Once #128 (BaseCharacteristic) lands, Feature is the natural next step: features become typed resources with real Ash attributes and properly typed characteristic relationships.

Proposed change

Introduce Diffo.Provider.BaseFeature as an Ash Resource Fragment. Feature type modules become Ash Resources that use BaseFeature. BaseFeature itself uses BaseCharacteristic for its characteristics, so feature characteristics inherit the same typing benefits.

DSL impact

feature :name, MyFeatureResource do ... end references a BaseFeature-derived resource. The inline characteristic declarations inside the feature block map to BaseCharacteristic-derived resources on that feature type. The verifier (VerifyFeatures) is updated to check BaseFeature extension.

Instance behaviour simplification

With features as proper resources, set_features_argument and the feature-related wiring in Extension.Feature / TransformBehaviour reduce to standard manage_relationship. The feature/1 and feature_characteristic/2 helper functions generated by TransformBehaviour may simplify or be removed.

Neo4j model

Each BaseFeature-derived resource becomes a distinct Neo4j node label, with its characteristics as typed nodes extending BaseCharacteristic.

Acceptance criteria

  • Diffo.Provider.BaseFeature fragment defined, using BaseCharacteristic
  • Existing feature type modules migrated to extend BaseFeature
  • VerifyFeatures updated to check BaseFeature extension
  • Extension.Feature wiring removed; replaced by standard relationship management
  • TransformBehaviour / ActionCreate / ActionUpdate further simplified
  • Tests updated; existing feature integration tests pass
  • DSL cheat sheet and livebook updated

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions