fix(registry): use full package type names in registry resolve URL #134
No reviewers
Labels
No labels
auto/blocked-by-deps
auto/ci-timeout
auto/claimed-implementer
auto/claimed-merge
auto/claimed-reviewer
auto/driver-down
auto/invariant-violation
auto/last-attempt-tier-0
auto/last-attempt-tier-1
auto/last-attempt-tier-2
auto/last-attempt-tier-min
Automation Tracking
auto/needs-conflict-resolution
auto/needs-implementer
auto/postmortem
auto/ready-to-merge
auto/restart-throttled
auto/revert
auto/sentinel
auto/stale-inactivity
auto/unstable
Blocked
Bounty
$100
Bounty
$1000
Bounty
$10000
Bounty
$20
Bounty
$2000
Bounty
$250
Bounty
$50
Bounty
$500
Bounty
$5000
Bounty
$750
MoSCoW
Could have
MoSCoW
Must have
MoSCoW
Should have
Needs Feedback
Points
1
Points
13
Points
2
Points
21
Points
3
Points
34
Points
5
Points
55
Points
8
Points
88
Priority
Backlog
Priority
CI Blocker
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Signed-off: Owner
Signed-off: Scrum Master
Signed-off: Tech Lead
Spike
State
Completed
State
Duplicate
State
In Progress
State
In Review
State
Paused
State
Unverified
State
Verified
State
Wont Do
Type
Automation
Type
Bug
Type
Discussion
Type
Documentation
Type
Epic
Type
Feature
Type
Legendary
Type
Refactor
Type
Support
Type
Task
Type
Testing
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#131 Registry reference resolution builds /agt/… instead of /agent/…, failing with HTTP 404 on compliant registries
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core!134
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "bugfix/m1-registry-resolve-full-type-names"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Fixes #131:
_RegistryReferenceStrategy.resolve/.aresolveinreference_resolver.pyapplied_TEMPLATE_TYPE_TO_PACKAGE_TYPE(a full-type-name -> Package-ID-prefix table, e.g."agent"->"agt") to the value sent as the resolve endpoint's{package_type}URL segment, so every registry-backed reference resolution (bareagents.<name>references, ADR-2037 D-2;routes.<name>references, ADR-2037 D-7;skills:references, ADR-2034; template-driven package references) requestedGET /agt/{ns}/{name}instead of the spec-compliantGET /agent/{ns}/{name}(Package Registry Standard §8.2.2). A compliant registry does not route the short prefix and answers404._compute_cache_key(resolution cache key) and Package-ID construction elsewhere. Only its application to the HTTP path segment was wrong.resolve()/aresolve()now pass the full type name straight through toRegistryClient.resolve_package.@tdd_expected_failfrom the #132 regression scenario now that the assertion passes normally (@tdd_issue/@tdd_issue_131stay permanently as a regression guard).skill/graphfull-type-name resolve paths and a scenario confirming the resolution cache key still carries the mapped Package-ID prefix (:agt).Note: this branch is built on top of
tdd/m1-registry-resolve-full-type-names(PR #133, still open/CI-pending at the time of this PR), per the mandatory Bug Fix TDD workflow. The diff below currently includes both the TDD commit and this fix commit; it will shrink to just this commit once #133 merges tomaster.Closes #131
Test plan
nox -s lint— greennox -s format -- --check— greennox -s typecheck— greennox -s security_scan— greennox -s dead_code— greennox -s unit_tests— 3067/3067 scenarios greennox -s coverage_report— 96.7% (>= repo gate 96.5%)nox -s integration_tests— 357/357 Robot tests greennox -s benchmark_regressionskipped — no ASV-relevant code touched@tdd_expected_failremovedlocal:/ID:reference resolution (existing coverage still green)_RegistryReferenceStrategy in reference_resolver.py maps a package_type through _TEMPLATE_TYPE_TO_PACKAGE_TYPE (e.g. "agent" -> "agt") before calling RegistryClient.resolve_package, so a registry reference resolved via PackageContentResolver.resolve(ref, package_type="agent") (as used by AgentReferenceResolver, ADR-2037) requests GET /agt/{ns}/{name} instead of GET /agent/{ns}/{name}. Per the Package Registry Standard §8.2.2, the {package_type} URL segment is the full type name, not the pkg_agt_-style Package ID prefix defined in §3.2 — a compliant registry answers 404 for /agt/.... Adds a new scenario to features/registry_http_client.feature (extending the existing shared registry_http_client_steps.py rather than a new step file) that drives PackageContentResolver.resolve() for an "agent" registry reference against a mocked httpx transport and asserts the requested path is "/agent/acme/assistant", not "/agt/acme/assistant". Confirmed locally that the assertion fails with AssertionError when @tdd_expected_fail is removed, proving the bug is genuinely reproduced; with the tag present, TddExpectedFailPolicy inverts the failure so nox -s unit_tests stays green. ISSUES CLOSED: #132_RegistryReferenceStrategy.resolve/aresolve applied _TEMPLATE_TYPE_TO_PACKAGE_TYPE (a full-type-name -> Package-ID-prefix table, e.g. "agent" -> "agt") to the value sent as the resolve endpoint's {package_type} URL segment, so every registry-backed reference resolution -- bare agents.<name> references (ADR-2037 D-2), routes.<name> references (ADR-2037 D-7), skills: references (ADR-2034), and template-driven package references -- requested GET /agt/{ns}/{name} instead of the spec-compliant GET /agent/{ns}/{name} (Package Registry Standard §8.2.2). A compliant registry does not route the short prefix and answers 404. The mapping itself is not wrong and is left untouched: it is still required by _compute_cache_key to build the resolution cache key and by other call sites that construct Package IDs (pkg_agt_...). Only its application to the HTTP path segment was incorrect, so the fix removes the resolved_type indirection from resolve()/aresolve() and passes the full type name straight through to RegistryClient.resolve_package. Removes @tdd_expected_fail from the #132 regression scenario now that the assertion passes normally, and adds coverage for the skill/graph full-type-name paths plus a scenario confirming the cache key still carries the mapped Package-ID prefix. ISSUES CLOSED: #131PR Review: !134 (Ticket #131)
Verdict: Approve
The fix correctly removes the erroneous mapping of full package type names to Package-ID prefixes in
_RegistryReferenceStrategy.resolve/.aresolvewhile preserving the mapping for resolution cache keys. All affected call sites already pass full type names (agent,skill,graph,template, etc.), so the generated registry URLs now conform to Package Registry Standard §8.2.2. The companion TDD scenario from #133 has its@tdd_expected_failtag removed and is joined by explicitskillandgraphregression scenarios plus a cache-key assertion, giving good coverage of the fix.Critical Issues
None.
Major Issues
None.
Minor Issues
None.
Nits
None.
Summary
This is a focused, well-scoped bugfix that addresses the exact root cause described in #131. The code change is minimal and surgical:
pkg_typeis passed verbatim to_resolve_registry_asyncinstead of being run through_TEMPLATE_TYPE_TO_PACKAGE_TYPE. Docstrings and comments are updated to make the distinction between URL-segment type names and Package-ID prefixes explicit. The regression test suite now covers agent, skill, and graph paths and verifies that the cache key still carries the mapped prefix (:agt).I verified that all upstream callers (
AgentReferenceResolver,SkillReferenceResolver,RouteReferenceResolver, and the template package-reference path) already supply full type names, so no additional caller changes are required. Local/ID:resolution is unaffected because the change only touches the_RegistryReferenceStrategybranch. The CHANGELOG entry accurately describes the user-visible impact.No blocking issues; ready to merge.
04bd6c2bad0880b02fd2