refactor: split manifest.py into domain-specific modules
test / unit (pull_request) Successful in 49s
test / integration (pull_request) Successful in 1m4s

Closes #157. Distributes the 1,026-line manifest.py across four
focused modules:

- _manifest_util.py: ManifestError + _as_json_object (shared base)
- manifest_git.py: GitEntry, GitUser, git-gate config helpers
- manifest_egress.py: EgressRoute, EgressConfig, PipelockRoutePolicy
- manifest_agent.py: AgentProvider, Agent

manifest.py is now the residual orchestration layer: Bottle, Manifest,
and re-exports of all public names so existing callers are unaffected.
All 867 unit tests pass.
This commit is contained in:
2026-06-03 04:16:42 +00:00
parent 3e50079bcc
commit 9b81173699
7 changed files with 734 additions and 675 deletions
+3 -2
View File
@@ -71,7 +71,8 @@ def _merge_bottles(
name: str,
) -> Bottle:
"""Apply PRD 0025 merge rules."""
from .manifest import Bottle, GitUser, _validate_egress_routes
from .manifest import Bottle, GitUser
from .manifest_egress import _validate_egress_routes
# Parse the child's declared fields into a Bottle (with the
# usual defaults for anything missing). Validation runs the same
@@ -122,7 +123,7 @@ def _merge_bottles(
def _child_declares_git_gate_repos(child_raw: dict[str, object]) -> bool:
from .manifest import _as_json_object
from ._manifest_util import _as_json_object
git_raw = child_raw.get("git-gate")
if git_raw is None: