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

Functions

None add_db_subcommands (argparse.ArgumentParser db_parser)
int _cmd_db_group (argparse.Namespace args)
int _cmd_integrity_check (argparse.Namespace args)
int _cmd_reserved_db (argparse.Namespace args)
str format_integrity_report (Mapping[str, object] report)

Variables

tuple RESERVED_DB_COMMANDS = ("backup", "restore", "prune", "archive-log", "restore-log")

Detailed Description

Database operator commands for the orchestration registry.

Purpose
-------
Expose read-only database health commands beneath
``python -m oc_chat.registry db``.

Responsibilities
----------------
- Wire the ``db integrity-check`` command.
- Reserve future database operation names with explicit v0.2.x stubs.
- Format structured integrity reports for humans or JSON consumers.

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

Contracts
---------
- ``integrity-check`` does not mutate logical registry state.
- Reserved commands exit 2 with a clear not-implemented message.

Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.backends.sqlite (SQLite backend)
- oc_chat.registry.discovery (registry path discovery)

Function Documentation

◆ _cmd_db_group()

int oc_chat.registry.cli.db._cmd_db_group ( argparse.Namespace args)
protected

Definition at line 87 of file db.py.

◆ _cmd_integrity_check()

int oc_chat.registry.cli.db._cmd_integrity_check ( argparse.Namespace args)
protected

Definition at line 93 of file db.py.

Here is the call graph for this function:

◆ _cmd_reserved_db()

int oc_chat.registry.cli.db._cmd_reserved_db ( argparse.Namespace args)
protected

Definition at line 104 of file db.py.

◆ add_db_subcommands()

None oc_chat.registry.cli.db.add_db_subcommands ( argparse.ArgumentParser db_parser)
Attach the M11.1c db subcommands to ``db_parser``.

Definition at line 57 of file db.py.

◆ format_integrity_report()

str oc_chat.registry.cli.db.format_integrity_report ( Mapping[str, object] report)
Return a compact human-readable integrity report.

Definition at line 109 of file db.py.

Here is the caller graph for this function:

Variable Documentation

◆ RESERVED_DB_COMMANDS

tuple oc_chat.registry.cli.db.RESERVED_DB_COMMANDS = ("backup", "restore", "prune", "archive-log", "restore-log")

Definition at line 54 of file db.py.