The ``regenerate`` CLI command (Plan 142 P1.4, §13).
Purpose
-------
Expose ``oct agent regenerate`` / ``python -m oc_chat.registry regenerate`` — the
deterministic source -> worktree-local authored-projection store rebuild. Emits
the §10 JSON envelope and the §5.3 exit codes.
Responsibilities
----------------
- Resolve the source tree + the worktree-local authored-projection DB path
(NEVER the shared live registry).
- Invoke the pipeline and map the result to the envelope + exit code.
Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
L2 - CLI lifecycle
L3 - argument resolution
L4 - envelope emission
Contracts
---------
- The default ``--db`` is a separate authored-projection file, never the live
``registry.sqlite`` — regenerate never reads/writes the shared registry.
Dependencies
------------
- argparse (CLI parsing)
- oc_chat.registry.regenerate.pipeline (regenerate runs the source to authored-projection store rebuild)
- oc_chat.registry.regenerate.envelope (exit_code_for maps a failed result to its exit code)
- oc_chat.registry.discovery (workspace resolution for path defaults)
- oc_diagnostics (structured debug logging via _dbg)