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

Functions

None add_migrate_subcommands (argparse.ArgumentParser migrate_parser)
int _cmd_migrate_group (argparse.Namespace args)
int _cmd_import (argparse.Namespace args)
int _cmd_verify (argparse.Namespace args)
int _cmd_rollback (argparse.Namespace args)
int _cmd_cutover (argparse.Namespace args)
tuple[Registry, MigrationOptions] _registry_and_options (str|None registry_path)
None _print_result (Mapping[str, object] result, bool as_json, str label)
str format_migrate_report (Mapping[str, object] result, str label)

Detailed Description

Migration operator commands for the orchestration registry.

Purpose
-------
Expose the legacy Markdown-state migration lifecycle beneath
``python -m oc_chat.registry migrate``.

Responsibilities
----------------
- Wire import, verify, rollback, and cutover subcommands.
- Resolve registry/workspace paths through the standard discovery logic.
- Format migration results as human text or JSON.

Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
    L2 - lifecycle events
    L3 - semantic details
    L4 - deep tracing

Contracts
---------
- ``cutover`` is a v0.2.x stub and exits 2.
- ``verify`` exits 1 when the registry differs from the legacy projection.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.migrate (migration command implementations)
- oc_chat.registry.discovery (registry path discovery)
- oc_chat.registry (Registry facade passed to the migration commands)
- oc_chat.registry.backends.sqlite (SQLiteBackend opened at the discovered registry path)

Function Documentation

◆ _cmd_cutover()

int oc_chat.registry.cli.migrate._cmd_cutover ( argparse.Namespace args)
protected

Definition at line 164 of file migrate.py.

◆ _cmd_import()

int oc_chat.registry.cli.migrate._cmd_import ( argparse.Namespace args)
protected

Definition at line 143 of file migrate.py.

Here is the call graph for this function:

◆ _cmd_migrate_group()

int oc_chat.registry.cli.migrate._cmd_migrate_group ( argparse.Namespace args)
protected

Definition at line 137 of file migrate.py.

◆ _cmd_rollback()

int oc_chat.registry.cli.migrate._cmd_rollback ( argparse.Namespace args)
protected

Definition at line 157 of file migrate.py.

Here is the call graph for this function:

◆ _cmd_verify()

int oc_chat.registry.cli.migrate._cmd_verify ( argparse.Namespace args)
protected

Definition at line 150 of file migrate.py.

Here is the call graph for this function:

◆ _print_result()

None oc_chat.registry.cli.migrate._print_result ( Mapping[str, object] result,
bool as_json,
str label )
protected

Definition at line 184 of file migrate.py.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _registry_and_options()

tuple[Registry, MigrationOptions] oc_chat.registry.cli.migrate._registry_and_options ( str | None registry_path)
protected

Definition at line 173 of file migrate.py.

Here is the caller graph for this function:

◆ add_migrate_subcommands()

None oc_chat.registry.cli.migrate.add_migrate_subcommands ( argparse.ArgumentParser migrate_parser)
Attach the M11.2 migration subcommands.

Definition at line 66 of file migrate.py.

◆ format_migrate_report()

str oc_chat.registry.cli.migrate.format_migrate_report ( Mapping[str, object] result,
str label )
Return a compact human-readable migration report.

Definition at line 195 of file migrate.py.

Here is the caller graph for this function: