CANP-WP-0006 T05: HTTP registries, and one finding
--registry now accepts an http(s):// URL as well as a path, implemented with urllib so reference/ keeps PyYAML as its only dependency. This was the first real test of INTENT principle 10's claim that a hosted registry layers on without changing package semantics. Verified against the running service, almost everything survived the transport unaltered: identity and its ambiguity rules (a bare id in two registries returns 409 over HTTP just as it does locally), immutability of a published id@version (identical content accepted, changed content refused, version bump accepted), strict packaging, validation, and the index. A package published and then installed over HTTP was byte-identical to its source — diff -r clean — and its canonical-fidelity eval still passed after the round trip. One thing did not survive: a URL is not a registry. A filesystem registry IS one registry and section 20.1 names it from its directory; an HTTP service HOSTS SEVERAL behind one base URL. The address therefore cannot name the registry, so it must be named separately — --as when publishing, a qualified reference when installing. Recorded as section 20.4 rather than worked around silently in the client, because the gap is in the specification's list of registry kinds, not in the CLI. Publishing to an HTTP registry without --as fails with that explanation rather than guessing a registry name. Registry responses are treated as untrusted input (section 19): decode_files refuses path traversal, with a test. The wire shape round-trips binary content through base64, also tested. Reference tests 99 -> 105. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Bjefh8NUiEiahN4JLwoSKM Assistant: claude-code Assistant-Model: opus Assistant-Process: 388925@bnt-lap001 Assistant-Session: 3507023f-e0fd-4a1e-9d90-a0d4217d1502
This commit is contained in:
parent
56b1708b58
commit
c076d8395e
6 changed files with 263 additions and 3 deletions
|
|
@ -100,6 +100,12 @@ rather than resolved by guessing.
|
|||
source, method, first-inclusion date, and the package's declared author,
|
||||
source and licence. `index` lists it. Re-adding keeps the original
|
||||
`included_at` and updates `last_seen_at`.
|
||||
- `--registry` accepts an `http(s)://` URL as well as a path. HTTP uses the
|
||||
stdlib, so this stays dependency-light. `CANNED_PROMPTS_PUBLISH_TOKEN`
|
||||
supplies the bearer token when publishing.
|
||||
- Publishing to an HTTP registry needs `--as NAME`: a URL addresses a service
|
||||
that **hosts several registries**, so unlike a directory it does not name one
|
||||
(§ 20.4). Installing names it in a qualified reference.
|
||||
- An optional `registry.yaml` names a registry and records namespace claims.
|
||||
`publish` warns when a namespace is declared `closed` — it cannot
|
||||
authenticate a publisher, and says so rather than implying it checked.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue