Skip to content

feat(#4040): add entity-provider SDK with types, interfaces, and annotation validation - #4212

Open
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4040-entity-provider-sdk
Open

feat(#4040): add entity-provider SDK with types, interfaces, and annotation validation#4212
fullsend-ai-coder[bot] wants to merge 1 commit into
mainfrom
agent/4040-entity-provider-sdk

Conversation

@fullsend-ai-coder

Copy link
Copy Markdown
Contributor

Create the @red-hat-developer-hub/backstage-plugin-boost-entity-provider-sdk package establishing type contracts for the AI catalog entity model.

Annotation scheme:

  • Define annotation constants: AI_ASSET_CATEGORY_ANNOTATION,
    AI_ASSET_VERSION_ANNOTATION, AI_ASSET_SOURCE_ANNOTATION
  • Define AIAssetCategory Zod enum with 7 allowed values
    (agent, skill, rule, skill-bundle, mcp-server, ai-model,
    model-server)

Utilities:

  • normalizeAIAssetVersion() with 4 normalization rules: semver
    pass-through, date-based, commit hash, and fallback
  • validateAIAssetEntity() throwing on missing/invalid annotations
  • AIAssetValidator CatalogProcessor rejecting entities with invalid
    annotations, gated to entities carrying rhdh.io/ai-asset-*

Interfaces:

  • AIAssetEntityProvider with connect(), entities() generator,
    getProviderName(), getProviderId(), and optional delta() method
  • Neo4jSyncAdapter with createNode(), updateNode(), deleteNode(),
    createRelationship() and RelationshipType union
  • SkillBundleMetadata Zod schema for skillcard.yaml parsing

Uses Zod schemas as single source of truth per workspace conventions. 28 unit tests cover all validation and normalization rules.


Closes #4040

Post-script verification

  • Branch is not main/master (agent/4040-entity-provider-sdk)
  • Secret scan passed (gitleaks — 6c752b60d5bdc359d1eb6b5b81a34880a0c71c21..HEAD)
  • Pre-commit hooks passed (authoritative run on runner)
  • Tests ran inside sandbox

…tation validation

Create the @red-hat-developer-hub/backstage-plugin-boost-entity-provider-sdk
package establishing type contracts for the AI catalog entity model.

Annotation scheme:
- Define annotation constants: AI_ASSET_CATEGORY_ANNOTATION,
  AI_ASSET_VERSION_ANNOTATION, AI_ASSET_SOURCE_ANNOTATION
- Define AIAssetCategory Zod enum with 7 allowed values
  (agent, skill, rule, skill-bundle, mcp-server, ai-model,
  model-server)

Utilities:
- normalizeAIAssetVersion() with 4 normalization rules: semver
  pass-through, date-based, commit hash, and fallback
- validateAIAssetEntity() throwing on missing/invalid annotations
- AIAssetValidator CatalogProcessor rejecting entities with invalid
  annotations, gated to entities carrying rhdh.io/ai-asset-*

Interfaces:
- AIAssetEntityProvider with connect(), entities() generator,
  getProviderName(), getProviderId(), and optional delta() method
- Neo4jSyncAdapter with createNode(), updateNode(), deleteNode(),
  createRelationship() and RelationshipType union
- SkillBundleMetadata Zod schema for skillcard.yaml parsing

Uses Zod schemas as single source of truth per workspace conventions.
28 unit tests cover all validation and normalization rules.

Closes #4040
@fullsend-ai-coder fullsend-ai-coder Bot added the ready-for-review Agent PR ready for human review label Aug 9, 2026
@rhdh-gh-app

rhdh-gh-app Bot commented Aug 9, 2026

Copy link
Copy Markdown

Missing Changesets

The following package(s) are changed by this PR but do not have a changeset:

  • @red-hat-developer-hub/backstage-plugin-boost-entity-provider-sdk

See CONTRIBUTING.md for more information about how to add changesets.

Changed Packages

Package Name Package Path Changeset Bump Current Version
@red-hat-developer-hub/backstage-plugin-boost-entity-provider-sdk workspaces/boost/plugins/boost-entity-provider-sdk none v0.1.0

@codecov

codecov Bot commented Aug 9, 2026

Copy link
Copy Markdown

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

@sonarqubecloud

sonarqubecloud Bot commented Aug 9, 2026

Copy link
Copy Markdown

@gabemontero

Copy link
Copy Markdown
Contributor

/fs-review

@fullsend-ai-review

fullsend-ai-review Bot commented Aug 9, 2026

Copy link
Copy Markdown

🤖 Finished Review · ✅ Success · Started 11:48 PM UTC · Completed 12:06 AM UTC

Commit: 8496af8 · View workflow run →

@fullsend-ai-review

Copy link
Copy Markdown

Review

Findings

Medium

  • [architectural-conflict] workspaces/boost/plugins/boost-entity-provider-sdk/package.json:97 — The new package's pluginPackages array includes itself (7 entries) but the existing sibling packages (boost-common, boost-node) only list 6 entries and do not include the new SDK. The Backstage convention is for all packages sharing a pluginId to have an identical pluginPackages array, creating an inconsistency in the plugin package graph.
    Remediation: Update sibling packages' pluginPackages arrays to include @red-hat-developer-hub/backstage-plugin-boost-entity-provider-sdk, or match the existing 6-entry list.

  • [stale-doc] workspaces/boost/openspec/changes/ai-catalog-entity-model/design.md:171 — Decision 7 documents Neo4jSyncAdapter.createNode() with three parameters (entityRef, category, metadata) but the implementation has two: (entityRef, properties). The category parameter was removed and metadata was renamed to properties. Similarly, updateNode() uses metadata in the doc but properties in the implementation.
    Remediation: Update Decision 7 in design.md to match the actual SDK interface.

Low

  • [edge-case] workspaces/boost/plugins/boost-entity-provider-sdk/src/normalizeAIAssetVersion.ts:21SEMVER_RE accepts trailing hyphen without pre-release identifier (e.g. 1.0.0-). The inner ? makes the capture group optional after the literal -, so a bare hyphen matches and the string passes through unchanged.
    Remediation: Change to (?:-(\w[\w.]*))?$ to require at least one character after the hyphen.

  • [logic-error] workspaces/boost/plugins/boost-entity-provider-sdk/src/AIAssetValidator.ts:64AIAssetValidator.validateEntityKind produces the same error message for both missing and invalid category values, while validateAIAssetEntity() differentiates them with a more specific message including the rejected value and allowed values list.
    Remediation: Align error messages between the two validation paths.

  • [pattern-violation] workspaces/boost/plugins/boost-entity-provider-sdk/package.json:119 — Test script uses --passWithNoTests --coverage flags but sibling packages use bare backstage-cli package test.

  • [pattern-inconsistency] workspaces/boost/plugins/boost-entity-provider-sdk/src/index.ts:8 — Barrel file uses named re-exports while boost-common uses export *. Named re-exports are valid and prevent accidental exposure of internals (hasAnyAIAssetAnnotation, AI_ASSET_ANNOTATION_PREFIX).

  • [missing-artifact] workspaces/boost/plugins/boost-entity-provider-sdk — No changeset file included for the automated release pipeline.

  • [stale-doc] workspaces/boost/openspec/changes/ai-catalog-entity-model/design.md:163 — Decision 6 documents normalizeAIAssetVersion as a single-parameter function; the implementation accepts an optional second options parameter for entity context and custom warning callback.

  • [stale-doc] workspaces/boost/openspec/changes/neo4j-knowledge-graph/specs/relationship-mapping/spec.md:186 — Spec lists lifecycle methods (connect, disconnect, startSync, stopSync, triggerFullSync) as part of Neo4jSyncAdapter but these are not in the SDK interface contract.

  • [api-evolution] workspaces/boost/plugins/boost-entity-provider-sdk/src/annotations.ts:54AIAssetCategorySchema uses z.enum with a fixed tuple. Adding categories will be a type-level breaking change. At version 0.1.0 this is acceptable but the evolution policy should be documented.

  • [api-surface-coupling] workspaces/boost/plugins/boost-entity-provider-sdk/src/Neo4jSyncAdapter.ts:57 — Neo4j-specific types exported from a general-purpose entity-provider SDK. Per design.md Decision 7, this is intentional to avoid circular imports; the types have no runtime cost.


Labels: PR creates a new package under workspaces/boost/ implementing AI asset entity provider SDK

@fullsend-ai-review fullsend-ai-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the review comment for full details.


Note: The following inline comments could not be posted on the diff (GitHub returned 422) and are included here instead:

  • workspaces/boost/plugins/boost-entity-provider-sdk/package.json (file-level): Line 97 · [medium] architectural-conflict

The new package's pluginPackages array includes itself (7 entries) but the existing sibling packages (boost-common, boost-node) only list 6 entries and do NOT include the new SDK. The Backstage convention is for all packages sharing a pluginId to have an identical pluginPackages array.

Suggested fix: Update sibling packages' pluginPackages arrays to include the new SDK, or match the existing 6-entry list.

  • workspaces/boost/plugins/boost-entity-provider-sdk/src/normalizeAIAssetVersion.ts:21: [low] edge-case

SEMVER_RE accepts trailing hyphen without pre-release identifier (e.g. 1.0.0-). The inner ? makes the capture group optional after the literal -, so a bare hyphen matches and the string passes through unchanged.

Suggested fix: Change to (?:-(\w[\w.]*))?$ to require at least one character after the hyphen.

  • workspaces/boost/plugins/boost-entity-provider-sdk/src/AIAssetValidator.ts:64: [low] logic-error

AIAssetValidator.validateEntityKind produces the same error message for both missing and invalid category values, while validateAIAssetEntity() differentiates them with a more specific message including the rejected value.

Suggested fix: Align error messages between the two validation paths.

  • workspaces/boost/plugins/boost-entity-provider-sdk/package.json (file-level): Line 119 · [low] pattern-violation

Test script uses --passWithNoTests --coverage flags but sibling packages use bare backstage-cli package test.

Suggested fix: Match sibling packages or apply flags workspace-wide.

  • workspaces/boost/plugins/boost-entity-provider-sdk/src/index.ts:8: [low] pattern-inconsistency

Barrel file uses named re-exports while boost-common uses export *. Named re-exports prevent accidental exposure of internals.

  • workspaces/boost/plugins/boost-entity-provider-sdk/src/annotations.ts:54: [low] api-evolution

AIAssetCategorySchema uses z.enum with a fixed tuple. Adding categories will be a type-level breaking change. At version 0.1.0 this is acceptable but the evolution policy should be documented.

  • workspaces/boost/plugins/boost-entity-provider-sdk/src/Neo4jSyncAdapter.ts:57: [low] api-surface-coupling

Neo4j-specific types exported from a general-purpose entity-provider SDK. Per design.md Decision 7, this is intentional to avoid circular imports; types have no runtime cost.

@fullsend-ai-review fullsend-ai-review Bot added requires-manual-review Review requires human judgment workspace/boost Boost workspace (Backstage AI plugin) feature labels Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature ready-for-review Agent PR ready for human review requires-manual-review Review requires human judgment workspace/boost Boost workspace (Backstage AI plugin)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant