Skip to content

Entity-Provider SDK — Types, Interfaces, Annotation Validation (issue 2 of 29) #4040

Description

@gabemontero

Labels: ready-to-code
Dependencies: None
RHIDP Stories: RHIDP-15255, RHIDP-15259, RHIDP-15303
Feature: RHDHPLAN-1507 — Epic RHIDP-15258

Create the @red-hat-developer-hub/backstage-plugin-boost-entity-provider-sdk package with the AI Asset annotation scheme (rhdh.io/ai-asset-category, rhdh.io/ai-asset-version, rhdh.io/ai-asset-source), version normalization utility, CatalogProcessor validator, AIAssetEntityProvider interface definition, Neo4jSyncAdapter interface, and SkillBundleMetadata type. This issue establishes all type contracts — the delta sync framework and package publishing are in Issue 8.

Tasks

From openspec/changes/ai-catalog-entity-model/tasks.md group 1 (RHIDP-15255):

  • 1.1 Define rhdh.io/ai-asset-category annotation constant and allowed values enum (agent, skill, rule, skill-bundle, mcp-server, ai-model, model-server)
  • 1.2 Define rhdh.io/ai-asset-version annotation constant
  • 1.3 Define rhdh.io/ai-asset-source annotation constant
  • 1.4 Implement normalizeAIAssetVersion(sourceVersion) utility with all four normalization rules
  • 1.5 Add unit tests for normalizeAIAssetVersion()
  • 1.6 Implement CatalogProcessor validator rejecting entities with missing/invalid annotations
  • 1.7 Add unit tests for CatalogProcessor validator

From openspec/changes/ai-catalog-entity-model/tasks.md group 2 (RHIDP-15259, RHIDP-15260 — package+interface):

  • 2.1 Create @red-hat-developer-hub/backstage-plugin-boost-entity-provider-sdk package with package.json, tsconfig.json, README.md
  • 2.2 Define AIAssetEntityProvider TypeScript interface with required methods: connect(), * entities(), getProviderName(), getProviderId()
  • 2.3 Define optional delta(cursor?: string) method for incremental sync pattern
  • 2.4 Export annotation constants: AI_ASSET_CATEGORY_ANNOTATION, AI_ASSET_VERSION_ANNOTATION, AI_ASSET_SOURCE_ANNOTATION
  • 2.5 Implement validateAIAssetEntity(entity) utility throwing on missing/invalid annotations
  • 2.6 Add unit tests for validateAIAssetEntity()

From openspec/changes/ai-catalog-entity-model/tasks.md group 3 (RHIDP-15303):

  • 3.1 Define Neo4jSyncAdapter TypeScript interface with methods: createNode(), updateNode(), deleteNode(), createRelationship()
  • 3.2 Define RelationshipType union type with constants: DEPENDS_ON, USES_TOOL, BELONGS_TO, SIMILAR_TO, IMPLEMENTED_BY, INCLUDES
  • 3.3 Export Neo4jSyncAdapter interface from SDK package
  • 3.4 Add JSDoc documentation to interface

From openspec/changes/ai-catalog-entity-model/tasks.md group 4 (RHIDP-15303):

  • 4.1 Define SkillBundleMetadata TypeScript type with fields
  • 4.2 Export SkillBundleMetadata type from SDK package
  • 4.3 Add JSDoc documentation with example skillcard.yaml structure

Specifications

  • openspec/changes/ai-catalog-entity-model/specs/annotation-scheme/spec.md
  • openspec/changes/ai-catalog-entity-model/specs/entity-provider-sdk/spec.md

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions