CANP-WP-0003: name the default registry default

Section 20.1 takes a registry's name from its directory basename, so the
reference tool's default store at ~/.canned-prompts/registry was named
`registry` — giving `registry:practice/thing` as a qualified reference.

The workplan had recorded this as reading poorly in one output line. It was
understated: the name reaches qualified references, the on-disk catalog layout
(catalog/registry/...), and index.yaml rows (registry: registry). Once packages
are installed and inclusions recorded, changing it becomes a migration rather
than an edit.

Renaming the directory to ~/.canned-prompts/default fixes it with no special
case in code, nothing written into the user's store, and no second naming
mechanism competing with section 20.1's manifest.

check_legacy_registry refuses to silently create a fresh empty store beside a
populated ~/.canned-prompts/registry — that failure would have been worse than
the wart being fixed. It names the exact mv, and the --registry flag for
keeping the old store. The check fires only for the default path; an explicit
--registry is never second-guessed.

Tests 95 -> 99.

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:
tegwick 2026-09-06 19:32:30 +02:00
parent 03826eac4f
commit e1889b41a1
5 changed files with 87 additions and 7 deletions

View file

@ -29,7 +29,7 @@ Default locations:
```text
~/.canned-prompts/catalog
~/.canned-prompts/registry
~/.canned-prompts/default
```
A **registry** stores packages flat, because an id is unambiguous within one
@ -49,12 +49,16 @@ A **catalog** is namespaced by registry, because identity is registry-scoped
For example:
```text
~/.canned-prompts/catalog/house/practice/pqrst-estimate/0.1.0/
~/.canned-prompts/catalog/local/practice/pqrst-estimate/0.1.0/
~/.canned-prompts/catalog/default/practice/pqrst-estimate/1.0.0/
~/.canned-prompts/catalog/local/practice/pqrst-estimate/1.0.0/
```
A registry's name comes from its optional `registry.yaml`, and otherwise from
its directory basename. `add` takes a package from a path rather than a
its directory basename — which is why the default registry directory is called
`default` and not `registry`: the basename reaches qualified references,
catalog paths and index rows, and `registry:practice/thing` reads poorly. A
store left at the old `~/.canned-prompts/registry` is reported with the command
to move it, rather than a fresh empty one being created beside it. `add` takes a package from a path rather than a
registry, so it files it under `local` (override with `--as`).
Commands that take an ID accept a bare id or a qualified `<registry>:<id>`.