test(registry): add failing regression for prefix-vs-type-name resolve path (#131) #133
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
#132 TDD: Registry reference resolution builds /agt/… instead of /agent/…, failing with HTTP 404 on compliant registries
cleveragents/cleveractors-core
Reference
cleveragents/cleveractors-core!133
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "tdd/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
Companion TDD issue-capture test for #131 ("Registry reference resolution builds /agt/… instead of /agent/…, failing with HTTP 404 on compliant registries"). Adds a Behave regression scenario proving the bug:
_RegistryReferenceStrategyinreference_resolver.pymapspackage_type="agent"through_TEMPLATE_TYPE_TO_PACKAGE_TYPEto"agt"before callingRegistryClient.resolve_package, soPackageContentResolver.resolve(ref, package_type="agent")(the pathAgentReferenceResolveruses, ADR-2037) requestsGET /agt/{ns}/{name}instead of the spec-compliantGET /agent/{ns}/{name}(Package Registry Standard §8.2.2).pkg_agt_is only the Package ID prefix (§3.2) — a separate concept from the URL route segment.features/registry_http_client.feature, steps added to the existing sharedfeatures/steps/registry_http_client_steps.py.@tdd_issue @tdd_issue_131 @tdd_expected_fail.PackageContentResolver.resolve()against a mocked httpx transport and asserts the requested path is/agent/acme/assistant, not/agt/acme/assistant.@tdd_expected_failmakes the assertion genuinely fail withAssertionError(bug reproduced); with the tag present,TddExpectedFailPolicyinverts the result so CI passes.Closes #132
Test plan
nox -s lint— greennox -s format -- --check— greennox -s typecheck— greennox -s security_scan— greennox -s dead_code— greennox -s unit_tests— 3064/3064 scenarios greennox -s coverage_report— 96.7% (>= repo gate 96.5%)nox -s integration_tests— 357/357 Robot tests greennox -s benchmark_regressionskipped — test-only change, no ASV-relevant code touchedAssertionError(notValueError/RuntimeError) when@tdd_expected_failis removed locally_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: #132PR Review: !133 (Ticket #132)
Verdict: Approve
This PR correctly implements the TDD issue-capture test required by the bug-fix workflow for #131. The new Behave scenario is properly tagged (
@tdd_issue @tdd_issue_131 @tdd_expected_fail), drives the realPackageContentResolver.resolve()code path, and asserts the spec-compliant request path/agent/acme/assistant. The failure mode is a plainAssertionError, soTddExpectedFailPolicywill invert it as expected and keep CI green while the bug remains unfixed. The step definitions are clean, well-placed in the existing registry HTTP client step file, and follow the project’s BDD conventions.I checked the PR conversation and found no existing review comments or author responses that would change this assessment.
Critical Issues
None
Major Issues
None
Minor Issues
Limited type coverage in the capture test
features/registry_http_client.feature:241The scenario only reproduces the bug for
package_type="agent". The root cause in_RegistryReferenceStrategyapplies the_TEMPLATE_TYPE_TO_PACKAGE_TYPEmapping for all template/system types (graph,skill,template, etc.). The TDD issue (#132) only asks for an agent example, so this is acceptable for the capture PR, but the follow-up bugfix PR for #131 should add regression coverage for the other affected types as listed in #131’s acceptance criteria.Coverage threshold documentation inconsistency
noxfile.py:27/CONTRIBUTING.md:1240The PR test plan reports 96.7% coverage against the
noxfile.pythreshold of 96.5%. Note thatCONTRIBUTING.mdstates the project-specific gate is 97%. This is a pre-existing inconsistency, not introduced by this PR, and CI will use thenoxfile.pyvalue, so it does not block approval. It would be worth aligning the two documents so future TDD issues don’t carry contradictory acceptance criteria.Nits
features/registry_http_client.feature:242-243uses two consecutiveWhensteps (When the mock server returns…/When I resolve…). The mock setup would read slightly better as aGiven, but this matches the style already used throughout the file, so it is fine as-is.Summary
A focused, well-scoped TDD capture PR. The test genuinely reproduces the
/agt/vs/agent/URL bug, is correctly tagged for the expected-fail inversion workflow, and does not introduce any regressions or code-quality issues. The follow-up fix in #131 should remove@tdd_expected_failand expand type coverage.Minor issues number 2, is not relevant, we have a noxfile threshold at 96.5% while having a 97% in the specification, but the 97% is the rounded value, which is also obtainable from a 96.5% real coverage.
@hurui200320 Thanks for the review. I checked each Minor Issue against issue #132's own scope, the linked bug #131,
docs/index.md/ADR-2037, and the existing coverage artifact before deciding what to change. Summary: no code changes applied — both Minor Issues, on inspection, don't call for a fix in this PR.1. Limited type coverage in the capture test — not applied.
You already noted this is acceptable for the capture PR since #132 only asks for an
agentexample, and pointed to "the follow-up bugfix PR for #131" for the other types. I kept it that way rather than expanding scope here: #132's acceptance criteria explicitly scope the TDD scenario topackage_type="agent"only, and #131's own acceptance criteria already list theskill/graphregression coverage as deliverables of the bugfix PR (where@tdd_expected_failalso gets removed). Adding that coverage in this PR would mean this TDD issue-capture commit does two things (agent capture + broader regression coverage) instead of one, which conflicts with the single-commit/single-responsibility scoping this issue was written with. So this is intentionally left for #131's PR, not overlooked.2. Coverage threshold documentation inconsistency (
noxfile.py:27vsCONTRIBUTING.md:1240) — not applied, and I don't think it's actually an inconsistency.I pulled the coverage artifact already produced for this PR (
build/coverage.json) to check the numbers directly: rawpercent_coveredis96.6978%, but Slipcover's ownpercent_covered_displayfield for that same run reports"97". SoCOVERAGE_THRESHOLD = 96.5innoxfile.pyisn't a stray/incorrect number relative to the documented 97% gate — it's calibrated to Slipcover's own rounding: any run that raw-scores >= 96.5% is a run Slipcover itself would display as 97%. CONTRIBUTING.md's "97% enforced merge gate" andnoxfile.py's 96.5 floor describe the same effective gate, just at different precision (rounded-display vs. raw-with-buffer). This matches @CoreRasurae's comment on your review. Given that, and sincenoxfile.py's threshold is a project-wide CI gate (not something scoped to issue #132), I didn't touch it — changing the literal value would be a separate, unrelated decision outside this issue's atomic scope, and the underlying premise (a genuine mismatch) doesn't hold up once you look at Slipcover's own rounding behavior.Nit (consecutive
When/Whensteps) — no change, per your own note that it matches existing file style.Happy to open a follow-up issue for either point if you'd still like the docstring/threshold values made more self-explanatory going forward — let me know and I'll file it rather than fold it into this TDD-capture commit.