feat(registry): implement async HTTP client using httpx #24

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

Metadata

Commit Message: feat(registry): implement async RegistryClient using httpx
Branch: feature/m1-registry-http-client

Background and context

The Package Registry Standard v1.0.0 (§8) defines 4 HTTP API endpoints: GET /packages/{id} (retrieve by PackageId), GET /{type}/{ns}/{name}?version= (resolve a reference), GET /browse (discovery), GET /.well-known/cleverthis-packages (registry metadata). The client uses httpx — mirrors requests API, supports sync+async, already installed (0.27.2).

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

Current behavior

No HTTP registry client exists.

Expected behavior

  • RegistryClient configured per server URL, async via httpx.AsyncClient
  • All 4 endpoints implemented with proper request/response handling
  • Version alias resolution (latest, vx, vX.Y.x, vX.x) per §4.2
  • Anonymous reads (§9.1), optional API key auth (§9.2)
  • Error mapping: all 8 error types → typed exceptions
  • Add httpx as explicit dependency in pyproject.toml

Acceptance criteria

  • Fetching a valid PackageId returns its YAML content as dict
  • Version alias resolution works for all alias types
  • 404 → PackageNotFoundError, 400 → InvalidPackageIdError, etc.
  • Connection errors and timeouts → RegistryNetworkError

Subtasks

  • Create src/cleveractors/registry/client.py with RegistryClient class
  • Implement GET /packages/{id} endpoint
  • Implement GET /{type}/{ns}/{name}?version= with version resolution
  • Implement GET /browse with type/namespace filters
  • Implement GET /.well-known/cleverthis-packages discovery
  • Error mapping to typed exceptions from exceptions.py
  • Add httpx dependency to pyproject.toml
  • Tests (Behave): features/registry_http_client.feature — mock server covering all endpoints
  • Tests (Robot): robot/registry_integration.robot — against fake registry server
  • Tests (Benchmark ASV): benchmarks/registry_http_client.py -- against fake registry server
  • 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): implement async RegistryClient using httpx Branch: feature/m1-registry-http-client ## Background and context The Package Registry Standard v1.0.0 (§8) defines 4 HTTP API endpoints: `GET /packages/{id}` (retrieve by PackageId), `GET /{type}/{ns}/{name}?version=` (resolve a reference), `GET /browse` (discovery), `GET /.well-known/cleverthis-packages` (registry metadata). The client uses `httpx` — mirrors `requests` API, supports sync+async, already installed (0.27.2). Part of Epic: Package Registry Client — Support Package Registry Standard v1.0.0 ## Current behavior No HTTP registry client exists. ## Expected behavior - `RegistryClient` configured per server URL, async via `httpx.AsyncClient` - All 4 endpoints implemented with proper request/response handling - Version alias resolution (`latest`, `vx`, `vX.Y.x`, `vX.x`) per §4.2 - Anonymous reads (§9.1), optional API key auth (§9.2) - Error mapping: all 8 error types → typed exceptions - Add `httpx` as explicit dependency in `pyproject.toml` ## Acceptance criteria - Fetching a valid `PackageId` returns its YAML content as dict - Version alias resolution works for all alias types - 404 → `PackageNotFoundError`, 400 → `InvalidPackageIdError`, etc. - Connection errors and timeouts → `RegistryNetworkError` ## Subtasks - [ ] Create `src/cleveractors/registry/client.py` with `RegistryClient` class - [ ] Implement `GET /packages/{id}` endpoint - [ ] Implement `GET /{type}/{ns}/{name}?version=` with version resolution - [ ] Implement `GET /browse` with type/namespace filters - [ ] Implement `GET /.well-known/cleverthis-packages` discovery - [ ] Error mapping to typed exceptions from `exceptions.py` - [ ] Add `httpx` dependency to `pyproject.toml` - [ ] Tests (Behave): features/registry_http_client.feature — mock server covering all endpoints - [ ] Tests (Robot): robot/registry_integration.robot — against fake registry server - [ ] Tests (Benchmark ASV): benchmarks/registry_http_client.py -- against fake registry server - [ ] 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:56 +00:00
CoreRasurae changed title from Registry HTTP client — async resolver and fetcher using httpx to feat(registry): implement async HTTP client using httpx 2026-06-05 17:47:07 +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#24
No description provided.