test(registry): add failing regression for missing content fetch after registry resolve (#135) #137

Merged
CoreRasurae merged 1 commit from tdd/m1-registry-content-fetch into master 2026-08-24 08:59:17 +00:00
Member

Summary

Companion TDD issue for #135. Adds a Behave scenario proving PackageContentResolver._resolve_registry_async (src/cleveractors/registry/reference_resolver.py) never performs the Package Registry Standard §8.2.1 GET /packages/{package_id} fetch for REGISTRY-scheme references — it returns the §8.2.2 resolve stub ({"package_id": ..., "type": "agent"}) directly as if it were the resolved package content, instead of the real package payload (type: llm, etc.) that docs/index.md §4.1.1 and ADR-2037 D-3 require.

The new scenario mocks both the §8.2.2 resolve endpoint and the §8.2.1 get-package endpoint behind distinct request paths, resolves an agent registry reference through PackageContentResolver.resolve(), and asserts the returned content's type field is "llm" (not "agent") and that the get-package endpoint was actually requested. Confirmed locally that both assertions fail with AssertionError when @tdd_expected_fail is removed.

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 green (3084 scenarios, scenario passes via @tdd_expected_fail inversion)
  • nox -s integration_tests green (362 Robot tests, unaffected)
  • nox -s coverage_report green (96.9% >= 96.5% threshold)
  • Confirmed locally that removing @tdd_expected_fail makes the scenario fail for real

Closes #136

## Summary Companion TDD issue for #135. Adds a Behave scenario proving `PackageContentResolver._resolve_registry_async` (`src/cleveractors/registry/reference_resolver.py`) never performs the Package Registry Standard §8.2.1 `GET /packages/{package_id}` fetch for REGISTRY-scheme references — it returns the §8.2.2 resolve stub (`{"package_id": ..., "type": "agent"}`) directly as if it were the resolved package content, instead of the real package payload (`type: llm`, etc.) that `docs/index.md` §4.1.1 and ADR-2037 D-3 require. The new scenario mocks both the §8.2.2 resolve endpoint and the §8.2.1 get-package endpoint behind distinct request paths, resolves an `agent` registry reference through `PackageContentResolver.resolve()`, and asserts the returned content's `type` field is `"llm"` (not `"agent"`) and that the get-package endpoint was actually requested. Confirmed locally that both assertions fail with `AssertionError` when `@tdd_expected_fail` is removed. ## 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` green (3084 scenarios, scenario passes via `@tdd_expected_fail` inversion) - [x] `nox -s integration_tests` green (362 Robot tests, unaffected) - [x] `nox -s coverage_report` green (96.9% >= 96.5% threshold) - [x] Confirmed locally that removing `@tdd_expected_fail` makes the scenario fail for real Closes #136
CoreRasurae added this to the v2.1.0 milestone 2026-08-20 18:58:29 +00:00
test(registry): add failing regression for missing content fetch after registry resolve (#135)
Some checks failed
CI / lint (pull_request) Successful in 45s
CI / typecheck (pull_request) Successful in 1m36s
CI / quality (pull_request) Successful in 48s
CI / security (pull_request) Successful in 2m38s
CI / build (pull_request) Successful in 2m3s
CI / integration_tests (pull_request) Successful in 3m54s
CI / unit_tests (pull_request) Successful in 5m8s
CI / coverage (pull_request) Failing after 14m53s
CI / benchmark (pull_request) Failing after 19m22s
CI / status-check (pull_request) Has been cancelled
CI / lint (push) Successful in 1m36s
CI / security (push) Successful in 1m11s
CI / typecheck (push) Successful in 2m17s
CI / quality (push) Successful in 54s
CI / build (push) Successful in 50s
CI / integration_tests (push) Successful in 3m13s
CI / unit_tests (push) Successful in 5m45s
CI / coverage (push) Successful in 4m20s
CI / status-check (push) Successful in 2s
CI / benchmark (push) Successful in 23m2s
cb4fc5186f
PackageContentResolver._resolve_registry_async (reference_resolver.py)
only performs the Package Registry Standard §8.2.2 "resolve" call
(GET /{package_type}/{namespace}/{name} -> {"package_id", "type"}) and
returns that stub directly as if it were the resolved package content.
It never performs the required §8.2.1 "get package by ID" call
(GET /packages/{package_id} -> {"content": "<YAML string>"}) to fetch
and parse the actual package payload, so a REGISTRY-scheme agents.<name>
reference ends up with type: "agent" (the resolve stub's package-type
field) instead of the real package's type: "llm", per docs/index.md
§4.1.1 and ADR-2037 D-3.

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 mocks both the §8.2.2 resolve response and the §8.2.1
get-package response behind distinct paths, resolves an "agent"
registry reference through PackageContentResolver.resolve(), and
asserts the returned content's "type" field is "llm" (from the real
package) and that the get_package endpoint was actually requested.
Confirmed locally that both assertions fail with AssertionError when
@tdd_expected_fail is removed, proving the bug is genuinely reproduced;
with the tag present, the TDD policy inverts the failure so
nox -s unit_tests stays green.

ISSUES CLOSED: #136
hurui200320 left a comment

PR Review: !137 (Ticket #136)

Verdict: Approve

This PR adds a focused, well-structured TDD regression scenario that correctly captures the missing §8.2.1 content-fetch bug described in #135. The scenario mocks both the resolve endpoint and the get-package endpoint, asserts that PackageContentResolver.resolve() returns the real package content (type: llm) rather than the §8.2.2 stub (type: agent), and verifies that the content endpoint is actually requested. The required tag combination @tdd_issue @tdd_issue_135 @tdd_expected_fail is present, and the failing assertions raise AssertionError, so the TDD expected-fail inversion policy will handle them correctly. No critical or major issues were found.

Critical Issues

None

Major Issues

None

Minor Issues

None

Nits

None

Summary

The changes extend the existing features/registry_http_client.feature and features/steps/registry_http_client_steps.py rather than duplicating them, the step definitions are clean and reuse existing mock helpers, and the test genuinely reproduces the bug on current master. Approved.

## PR Review: !137 (Ticket #136) ### Verdict: Approve This PR adds a focused, well-structured TDD regression scenario that correctly captures the missing §8.2.1 content-fetch bug described in #135. The scenario mocks both the resolve endpoint and the get-package endpoint, asserts that `PackageContentResolver.resolve()` returns the real package content (`type: llm`) rather than the §8.2.2 stub (`type: agent`), and verifies that the content endpoint is actually requested. The required tag combination `@tdd_issue @tdd_issue_135 @tdd_expected_fail` is present, and the failing assertions raise `AssertionError`, so the TDD expected-fail inversion policy will handle them correctly. No critical or major issues were found. ### Critical Issues None ### Major Issues None ### Minor Issues None ### Nits None ### Summary The changes extend the existing `features/registry_http_client.feature` and `features/steps/registry_http_client_steps.py` rather than duplicating them, the step definitions are clean and reuse existing mock helpers, and the test genuinely reproduces the bug on current `master`. Approved.
CoreRasurae deleted branch tdd/m1-registry-content-fetch 2026-08-24 08:59:21 +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!137
No description provided.