feat(registry): add core data types — PackageType, PackageId, PackageReference, PackageContent #23

Closed
opened 2026-06-05 17:33:48 +00:00 by CoreRasurae · 0 comments
Member

Metadata

Commit Message: feat(registry): add PackageType, PackageId, PackageReference, PackageContent core types
Branch: feature/m1-registry-core-types

Background and context

The Package Registry Standard v1.0.0 (§3, §5) defines a strict Package ID format (pkg_<type>_<40-hex-sha1>) and three reference formats (server:ns/name@version, ID:pkg_..., local:). We need immutable value objects for these concepts, plus a wrapper for fetched content that preserves the original user-supplied reference for debugging.

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

Current behavior

No registry data types exist. Templates use only local name-based lookups with no package identity concept.

Expected behavior

  • PackageType enum with members matching §3.2: ACTOR, GRAPH, STREAM, AGENT, TEMPLATE, SKILL (plus MCP, LSP for forward compat)
  • PackageId parses and validates pkg_<type>_<40-hex-sha1>, exposes type, sha1_hex, id_string
  • PackageReference holds original_reference (debug), reference_type (REGISTRY/ID/LOCAL), server/namespace/name/version fields
  • PackageContent wraps fetched dict with id: PackageId, original_reference: str | None, fetched_at: datetime
  • All types are frozen/hashable for cache usage

Acceptance criteria

  • PackageId.from_string("pkg_act_0123456789abcdef0123456789abcdef01234567") succeeds
  • Invalid formats raise descriptive errors
  • PackageReference round-trips its original_reference string
  • All types are hashable (usable as dict keys)

Subtasks

  • Create src/cleveractors/registry/__init__.py with public exports
  • Create src/cleveractors/registry/types.py with PackageType, PackageId, PackageReference, PackageContent
  • Tests (Behave): features/registry_core_types.feature — valid/invalid PackageId, PackageReference parsing, round-trip
  • 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): add PackageType, PackageId, PackageReference, PackageContent core types Branch: feature/m1-registry-core-types ## Background and context The Package Registry Standard v1.0.0 (§3, §5) defines a strict Package ID format (`pkg_<type>_<40-hex-sha1>`) and three reference formats (`server:ns/name@version`, `ID:pkg_...`, `local:`). We need immutable value objects for these concepts, plus a wrapper for fetched content that preserves the original user-supplied reference for debugging. Part of Epic: Package Registry Client — Support Package Registry Standard v1.0.0 ## Current behavior No registry data types exist. Templates use only local name-based lookups with no package identity concept. ## Expected behavior - `PackageType` enum with members matching §3.2: ACTOR, GRAPH, STREAM, AGENT, TEMPLATE, SKILL (plus MCP, LSP for forward compat) - `PackageId` parses and validates `pkg_<type>_<40-hex-sha1>`, exposes `type`, `sha1_hex`, `id_string` - `PackageReference` holds `original_reference` (debug), `reference_type` (REGISTRY/ID/LOCAL), server/namespace/name/version fields - `PackageContent` wraps fetched dict with `id: PackageId`, `original_reference: str | None`, `fetched_at: datetime` - All types are frozen/hashable for cache usage ## Acceptance criteria - `PackageId.from_string("pkg_act_0123456789abcdef0123456789abcdef01234567")` succeeds - Invalid formats raise descriptive errors - `PackageReference` round-trips its `original_reference` string - All types are hashable (usable as dict keys) ## Subtasks - [ ] Create `src/cleveractors/registry/__init__.py` with public exports - [ ] Create `src/cleveractors/registry/types.py` with PackageType, PackageId, PackageReference, PackageContent - [ ] Tests (Behave): features/registry_core_types.feature — valid/invalid PackageId, PackageReference parsing, round-trip - [ ] 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:33:48 +00:00
CoreRasurae changed title from Core data types — PackageType, PackageId, PackageReference, PackageContent to feat(registry): add core data types — PackageType, PackageId, PackageReference, PackageContent 2026-06-05 17:46:56 +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#23
No description provided.