feat(registry): extend TemplateType and integrate PackageReference into template system #27

Open
opened 2026-06-05 17:34:19 +00:00 by CoreRasurae · 0 comments
Member

Metadata

Commit Message: feat(registry): extend TemplateType and integrate PackageReference into template system
Branch: feature/m1-registry-template-alignment

Background and context

The existing template system supports only 3 types (AGENT, GRAPH, STREAM) with local name-based lookups via ComponentReference. The Package Registry Standard v1.0.0 introduces 6 offline package types (actor, graph, stream, agent, template, skill). We need to extend TemplateType, add PackageReference support to ComponentReference, and wire registry resolution into template instantiation so templates can reference external packages.

Part of Epic: Package Registry Client — Support Package Registry Standard v1.0.0

Current behavior

TemplateType enum has only AGENT, GRAPH, STREAM. ComponentReference uses simple ref_type/ref_name strings with no concept of external registry references.

Expected behavior

  • TemplateType extended with TEMPLATE, SKILL, ACTOR, MCP, LSP
  • ComponentReference gains optional package_ref: PackageReference | None
  • When a template key resolves to a registry reference (e.g. template: "registry.example.com:ns/helper@latest"), the registry client fetches and caches the content
  • Resolved components carry _original_reference in metadata for debug traceability
  • Local templates (current behavior) continue unchanged
  • Multi-server support: one RegistryClient per server URL

Acceptance criteria

  • TemplateType.TEMPLATE and TemplateType.SKILL register and instantiate
  • Template with "git.cleverthis.com:acme/helper@v1.0.0" resolves via registry client
  • Resolved component metadata includes _original_reference
  • Local templates unaffected
  • Registry fetch failures produce descriptive TemplateError with original reference

Subtasks

  • Extend TemplateType enum in base.py with TEMPLATE, SKILL, ACTOR, MCP, LSP
  • Extend ComponentReference dataclass with optional package_ref field
  • Add registry-aware lookup in EnhancedTemplateRegistry and TemplateRegistry
  • Propagate _original_reference through instantiation chain to component metadata
  • Wire ReferenceResolver + RegistryClient pool for multi-server support
  • Tests (Behave): features/registry_template_integration.feature — registry ref in template, local fallback, error paths
  • Validate existing template tests still pass unchanged
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line matches the Commit Message in Metadata exactly.
  • The commit is pushed to the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a PR to master, reviewed, and merged.
## Metadata Commit Message: feat(registry): extend TemplateType and integrate PackageReference into template system Branch: feature/m1-registry-template-alignment ## Background and context The existing template system supports only 3 types (AGENT, GRAPH, STREAM) with local name-based lookups via `ComponentReference`. The Package Registry Standard v1.0.0 introduces 6 offline package types (actor, graph, stream, agent, template, skill). We need to extend `TemplateType`, add `PackageReference` support to `ComponentReference`, and wire registry resolution into template instantiation so templates can reference external packages. Part of Epic: Package Registry Client — Support Package Registry Standard v1.0.0 ## Current behavior `TemplateType` enum has only AGENT, GRAPH, STREAM. `ComponentReference` uses simple `ref_type`/`ref_name` strings with no concept of external registry references. ## Expected behavior - `TemplateType` extended with TEMPLATE, SKILL, ACTOR, MCP, LSP - `ComponentReference` gains optional `package_ref: PackageReference | None` - When a template key resolves to a registry reference (e.g. `template: "registry.example.com:ns/helper@latest"`), the registry client fetches and caches the content - Resolved components carry `_original_reference` in metadata for debug traceability - Local templates (current behavior) continue unchanged - Multi-server support: one `RegistryClient` per server URL ## Acceptance criteria - `TemplateType.TEMPLATE` and `TemplateType.SKILL` register and instantiate - Template with `"git.cleverthis.com:acme/helper@v1.0.0"` resolves via registry client - Resolved component metadata includes `_original_reference` - Local templates unaffected - Registry fetch failures produce descriptive `TemplateError` with original reference ## Subtasks - [ ] Extend `TemplateType` enum in `base.py` with TEMPLATE, SKILL, ACTOR, MCP, LSP - [ ] Extend `ComponentReference` dataclass with optional `package_ref` field - [ ] Add registry-aware lookup in `EnhancedTemplateRegistry` and `TemplateRegistry` - [ ] Propagate `_original_reference` through instantiation chain to component metadata - [ ] Wire `ReferenceResolver` + `RegistryClient` pool for multi-server support - [ ] Tests (Behave): features/registry_template_integration.feature — registry ref in template, local fallback, error paths - [ ] Validate existing template tests still pass unchanged - [ ] Verify coverage >=97% via nox -s coverage_report - [ ] Run nox (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the first line matches the Commit Message in Metadata exactly. - The commit is pushed to the branch matching the Branch in Metadata exactly. - The commit is submitted as a PR to master, reviewed, and merged.
CoreRasurae added this to the v2.1.0 milestone 2026-06-05 17:34:19 +00:00
CoreRasurae changed title from Template system alignment — extend TemplateType, integrate PackageReference to feat(registry): extend TemplateType and integrate PackageReference into template system 2026-06-05 17:47:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveractors-core#27
No description provided.