fix(registry): use full package type names in registry resolve URL #134

Merged
CoreRasurae merged 1 commit from bugfix/m1-registry-resolve-full-type-names into master 2026-08-20 18:23:16 +00:00
Member

Summary

Fixes #131: _RegistryReferenceStrategy.resolve/.aresolve in reference_resolver.py 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; 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 table itself is untouched — it is still required by _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 to RegistryClient.resolve_package.
  • Removes @tdd_expected_fail from the #132 regression scenario now that the assertion passes normally (@tdd_issue/@tdd_issue_131 stay permanently as a regression guard).
  • Adds coverage for skill/graph full-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 to master.

Closes #131

Test plan

  • nox -s lint — green
  • nox -s format -- --check — green
  • nox -s typecheck — green
  • nox -s security_scan — green
  • nox -s dead_code — green
  • nox -s unit_tests — 3067/3067 scenarios green
  • nox -s coverage_report — 96.7% (>= repo gate 96.5%)
  • nox -s integration_tests — 357/357 Robot tests green
  • nox -s benchmark_regression skipped — no ASV-relevant code touched
  • Confirmed the #132 regression scenario now passes normally with @tdd_expected_fail removed
  • No regression to local:/ID: reference resolution (existing coverage still green)
## Summary Fixes #131: `_RegistryReferenceStrategy.resolve`/`.aresolve` in `reference_resolver.py` 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; 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 table itself is untouched — it is still required by `_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 to `RegistryClient.resolve_package`. - Removes `@tdd_expected_fail` from the #132 regression scenario now that the assertion passes normally (`@tdd_issue`/`@tdd_issue_131` stay permanently as a regression guard). - Adds coverage for `skill`/`graph` full-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 to `master`. Closes #131 ## Test plan - [x] `nox -s lint` — green - [x] `nox -s format -- --check` — green - [x] `nox -s typecheck` — green - [x] `nox -s security_scan` — green - [x] `nox -s dead_code` — green - [x] `nox -s unit_tests` — 3067/3067 scenarios green - [x] `nox -s coverage_report` — 96.7% (>= repo gate 96.5%) - [x] `nox -s integration_tests` — 357/357 Robot tests green - [x] `nox -s benchmark_regression` skipped — no ASV-relevant code touched - [x] Confirmed the #132 regression scenario now passes normally with `@tdd_expected_fail` removed - [x] No regression to `local:`/`ID:` reference resolution (existing coverage still green)
test(registry): add failing regression for prefix-vs-type-name resolve path (#131)
Some checks failed
CI / lint (pull_request) Successful in 1m29s
CI / typecheck (pull_request) Successful in 1m58s
CI / security (pull_request) Successful in 1m49s
CI / quality (pull_request) Successful in 2m12s
CI / build (pull_request) Successful in 2m18s
CI / integration_tests (pull_request) Successful in 3m41s
CI / unit_tests (pull_request) Successful in 6m32s
CI / coverage (pull_request) Failing after 13m0s
CI / benchmark (pull_request) Failing after 19m42s
CI / status-check (pull_request) Failing after 6s
CI / lint (push) Failing after 1m13s
CI / typecheck (push) Failing after 1m42s
CI / security (push) Failing after 1m34s
CI / quality (push) Failing after 1m42s
CI / unit_tests (push) Failing after 1m42s
CI / coverage (push) Has been skipped
CI / integration_tests (push) Failing after 1m47s
CI / benchmark (push) Failing after 2m31s
CI / build (push) Failing after 2m36s
CI / status-check (push) Failing after 13s
e8d41cc200
_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
fix(registry): use full package type names in registry resolve URL
Some checks failed
CI / lint (pull_request) Successful in 1m32s
CI / typecheck (pull_request) Successful in 2m5s
CI / quality (pull_request) Successful in 57s
CI / security (pull_request) Successful in 2m29s
CI / build (pull_request) Successful in 2m23s
CI / integration_tests (pull_request) Successful in 3m25s
CI / unit_tests (pull_request) Successful in 5m49s
CI / coverage (pull_request) Failing after 17m25s
CI / benchmark (pull_request) Failing after 22m58s
CI / status-check (pull_request) Failing after 4s
04bd6c2bad
_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: #131
CoreRasurae added this to the v2.1.0 milestone 2026-08-10 21:01:35 +00:00
hurui200320 left a comment

PR 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/.aresolve while 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_fail tag removed and is joined by explicit skill and graph regression 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_type is passed verbatim to _resolve_registry_async instead 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 _RegistryReferenceStrategy branch. The CHANGELOG entry accurately describes the user-visible impact.

No blocking issues; ready to merge.

## PR 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`/`.aresolve` while 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_fail` tag removed and is joined by explicit `skill` and `graph` regression 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_type` is passed verbatim to `_resolve_registry_async` instead 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 `_RegistryReferenceStrategy` branch. The CHANGELOG entry accurately describes the user-visible impact. No blocking issues; ready to merge.
CoreRasurae force-pushed bugfix/m1-registry-resolve-full-type-names from 04bd6c2bad
Some checks failed
CI / lint (pull_request) Successful in 1m32s
CI / typecheck (pull_request) Successful in 2m5s
CI / quality (pull_request) Successful in 57s
CI / security (pull_request) Successful in 2m29s
CI / build (pull_request) Successful in 2m23s
CI / integration_tests (pull_request) Successful in 3m25s
CI / unit_tests (pull_request) Successful in 5m49s
CI / coverage (pull_request) Failing after 17m25s
CI / benchmark (pull_request) Failing after 22m58s
CI / status-check (pull_request) Failing after 4s
to 0880b02fd2
Some checks failed
CI / lint (pull_request) Successful in 39s
CI / typecheck (pull_request) Successful in 1m18s
CI / security (pull_request) Successful in 56s
CI / quality (pull_request) Successful in 1m45s
CI / build (pull_request) Successful in 1m38s
CI / unit_tests (pull_request) Successful in 5m16s
CI / integration_tests (pull_request) Successful in 2m6s
CI / coverage (pull_request) Successful in 4m42s
CI / benchmark (pull_request) Has been cancelled
CI / status-check (pull_request) Successful in 4s
CI / lint (push) Successful in 42s
CI / typecheck (push) Successful in 1m24s
CI / quality (push) Successful in 41s
CI / build (push) Successful in 1m58s
CI / integration_tests (push) Successful in 3m37s
CI / unit_tests (push) Successful in 5m42s
CI / security (push) Failing after 13m52s
CI / benchmark (push) Failing after 17m45s
CI / coverage (push) Has been cancelled
CI / status-check (push) Has been cancelled
2026-08-20 18:02:08 +00:00
Compare
CoreRasurae deleted branch bugfix/m1-registry-resolve-full-type-names 2026-08-20 18:23:25 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
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!134
No description provided.