__init__.py file-level

at main · View file ↗ · Intel ↗

History
1 files
1 commits
0 hotspots
0 🧊 dead
0 💥 blast risk
sha256:6 fix(ISR): default require_independent_second_reviewer to require Opera… · aaronrene · Sep 2, 2026
1 """Overseer Kit VCS adapters — config loading and backend factory."""
2
3 from __future__ import annotations
4
5 from pathlib import Path
6
7 from adapters.config import load_config
8 from adapters.errors import ConfigError
9 from adapters.factory import create_adapter
10 from adapters.runner import CommandRunner
11
12 __all__ = [
13 "CommandRunner",
14 "ConfigError",
15 "create_adapter",
16 "load_config",
17 ]
18
19 SUPPORTED_CONFIG_VERSION = 1
20 SUPPORTED_REGIMES = frozenset({"muse+git-mirror", "muse-only", "git-only"})
21
22
23 def load_adapter(
24 repo_root: Path,
25 config_path: Path | None = None,
26 runner: CommandRunner | None = None,
27 ):
28 """Load config and return the regime-appropriate VCS adapter.
29
30 Fail-closed: missing/unparseable config, unknown version, or unknown regime
31 raises ``ConfigError``.
32 """
33 path = config_path or (repo_root / ".overseer" / "config.yaml")
34 config = load_config(path)
35 return create_adapter(config, repo_root.resolve(), runner=runner)