|
| dict[str, object] | run_doctor (Registry registry, SQLiteBackend backend, Path workspace_root, DoctorOptions options) |
| dict[str, object] | check_permissions (Path option_c, *, bool fix, bool skip) |
| dict[str, object] | sweep_stray_temp_files (Path orchestration_dir) |
| dict[str, object] | sweep_expired_locks (Registry registry, SQLiteBackend backend) |
| dict[str, object] | check_credential_consistency (SQLiteBackend backend, Path secrets_path) |
| dict[str, object] | check_round_state (SQLiteBackend backend) |
| dict[str, object] | auth_event_summary (SQLiteBackend backend) |
| dict[str, object] | check_snapshot_conflicts (Registry registry, SQLiteBackend backend, Path workspace_root, DoctorOptions options) |
| str | format_doctor_report (Mapping[str, object] report) |
| str | _section_line (str label, object section) |
| Mapping[str, object]|None | _secret_block (object data, str slot, str phase) |
| object | _fingerprint_for_block (Mapping[str, object] block) |
| list[str] | _warnings_from (*Mapping[str, object] sections) |
| dict[str, object] | _skipped (str message) |
| str | _resolution_mode (DoctorOptions options) |
| dict[str, object] | _audit_snapshot_repair (Registry registry, str actor_slot, RenderResult result, str action) |
| dict[str, object] | _trust_local (Registry registry, str actor_slot, RenderResult result) |
Operator doctor checks for the orchestration registry.
Purpose
-------
Provide the health checks and small repairs owned by M11.1c: local file
permissions, stray temp-file cleanup, expired-lock sweep auditing, and
credential fingerprint consistency.
Responsibilities
----------------
- Inspect and optionally repair `.option_c` and `agent_secrets.json` modes.
- Remove stray `.tmp-*` files below `.option_c/orchestration`.
- Sweep expired lock rows and emit a `doctor.repair` audit operation.
- Compare on-disk credential fingerprints with `agent_credentials`.
Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
L2 - lifecycle events
L3 - semantic details
L4 - deep tracing
Contracts
---------
- Audit rows go through `Registry.execute_domain_command`.
- Secret values are never returned in structured output.
- Windows permission inspection is a graceful v0.2.x skip.
Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.registry.api (Registry facade)
- oc_chat.registry.backends.sqlite (SQLite backend)
- oc_chat.registry.domain (plan_reimport for the trust-local snapshot repair)
- oc_chat.registry.render (render_all for snapshot drift detection and trust-registry repair)
- oc_chat.registry.render._common (RenderResult and plan_for_worktree lookup)