|
| Path | discover_registry_path (str|os.PathLike[str]|None start=None, Mapping[str, str]|None env=None) |
| RegistryLocation | discover_registry_location (str|os.PathLike[str]|None start=None, Mapping[str, str]|None env=None, str|os.PathLike[str]|None registry_path=None, str|os.PathLike[str]|None workspace_root=None) |
| None | _worker_registry_guard (Mapping[str, str] env, Path workspace_root) |
| Path | _discover_path (Path anchor, Mapping[str, str] env, Path workspace_root) |
| Path | _resolve_workspace_root (Path anchor, str|os.PathLike[str]|None workspace_root) |
| Path | _workspace_root_from_manifest (Path manifest) |
| Path|None | _find_workspace_manifest (Path anchor) |
| Path|None | _git_common_dir (Path anchor) |
| Path | _anchor_path (str|os.PathLike[str]|None start) |
| Path | _absolute_path (Path path, Path base) |
Registry location discovery.
Purpose
-------
Resolve the SQLite registry location in the order specified by the
orchestration registry design-lock document.
Responsibilities
----------------
- Honor ``OC_AGENT_REGISTRY`` when it points at an absolute path.
- Detect ``.option_c_workspace.json`` and derive the shared registry path.
- Fall back through git common-dir and project-root locations.
- Return workspace metadata needed by the init seed path.
Diagnostics
-----------
Domain: OC_CHAT.MAIN
Levels:
L2 - lifecycle events
L3 - semantic details
L4 - deep tracing
Contracts
---------
- Discovery is read-only and does not create directories or files.
- Environment override paths must be absolute.
Dependencies
------------
- oc_diagnostics (structured debug logging via _dbg)
- oc_chat.core._paths (workspace root fallback)
| None oc_chat.registry.discovery._worker_registry_guard |
( |
Mapping[str, str] | env, |
|
|
Path | workspace_root ) |
|
protected |
Plan 142j R7: in worker context (``OC_AGENT_WORKER=1``), ``OC_AGENT_REGISTRY``
MUST be set, absolute, and resolve INSIDE this worktree's
``.option_c/orchestration/`` boundary; else fail closed (``WorkerRegistryError``).
A not-yet-created ``registry.sqlite`` **inside** the boundary is VALID (the
per-worktree store is created on first use — location, not existence, is
checked). Unset/empty OR resolving OUTSIDE the boundary (main repo / sibling
worktree / arbitrary temp) is fail-closed. Non-worker local CLI is unaffected
(the existing workspace/git fallback still applies).
Definition at line 122 of file discovery.py.