oc_chat
Loading...
Searching...
No Matches
oc_chat.registry.cli.regenerate Namespace Reference

Functions

None add_regenerate_subcommand (argparse._SubParsersAction subcommands)
int _cmd_regenerate (argparse.Namespace args)

Detailed Description

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)

Function Documentation

◆ _cmd_regenerate()

int oc_chat.registry.cli.regenerate._cmd_regenerate ( argparse.Namespace args)
protected

Definition at line 79 of file regenerate.py.

◆ add_regenerate_subcommand()

None oc_chat.registry.cli.regenerate.add_regenerate_subcommand ( argparse._SubParsersAction subcommands)
Attach the top-level ``regenerate`` command (§13).

Definition at line 57 of file regenerate.py.