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

@ -4,7 +4,7 @@ type: workplan
title: "Default registry name reads as 'registry:'"
domain: agents
repo: canned-prompts
status: proposed
status: finished
owner: codex
topic_slug: practice
created: "2026-09-06"
@ -20,7 +20,7 @@ Residual from `CANP-WP-0002` (`origin: residual`, `origin_ref: CANP-WP-0002`).
```task
id: CANP-WP-0003-T01
status: todo
status: done
priority: low
state_hub_task_id: "ead2d409-2b80-5f50-9f0f-a397822ba2ae"
```
@ -54,3 +54,28 @@ Options worth weighing:
`registry.yaml` — already exists and is documented.
Option 3 is the current state. Pick deliberately rather than by default.
## Outcome
**Decision (operator, 2026-09-06): option 2** — rename the default directory to
`~/.canned-prompts/default`, so the § 20.1 basename rule produces a good name
with no special case, no file written into the user's store, and no second
naming mechanism.
**The cost of deferring had been understated.** The workplan recorded this as
reading poorly in one output line. It is not only display: 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 is a migration rather than an edit — which is
an argument for deciding early, not late.
Delivered:
- `default_registry()` returns `~/.canned-prompts/default`.
- `check_legacy_registry` refuses to silently create a fresh empty store beside
a populated `~/.canned-prompts/registry`. It names the exact `mv`, and the
`--registry` flag for keeping the old one. Silently starting empty would have
been worse than the wart being fixed.
- The check fires only for the default path; an explicitly passed `--registry`
is never second-guessed.
- Docs updated in both READMEs. Tests 95 → 99.