Skip to content

Add BoundaryPolicy to authority spec with cross-field validation#169

Merged
aidankhogg merged 2 commits into
dev/alphafrom
codex/add-boundarypolicy-to-authority/spec-layer
Jun 30, 2026
Merged

Add BoundaryPolicy to authority spec with cross-field validation#169
aidankhogg merged 2 commits into
dev/alphafrom
codex/add-boundarypolicy-to-authority/spec-layer

Conversation

@aidankhogg

Copy link
Copy Markdown
Contributor

Motivation

  • Introduce an authority-layer boundary policy to represent real-internet and cross-world posture and trust requirements for the gateway/boundary domain.
  • Capture required configuration surface (service mirrors, upstream resolver, peers) and enforce cross-field invariants that previously lived only in procedural checks.

Description

  • Add BoundaryPolicy Pydantic model to netengine/spec/authority.py with fields real_internet, cross_world, service_mirrors, upstream_resolver_enabled, upstream_resolver_ip, and peers, and a @model_validator(mode="after") implementing the requested validation rules.
  • Implement validations that require mirrors for MIRRORED, forbid mirrors unless mode is MIRRORED, require peers for PEERED/FEDERATED, require trust metadata (trust_bundle or trust_anchor_cert) for FEDERATED peers, and disallow upstream resolution when ISOLATED.
  • Add trust_bundle: Optional[str] to CrossWorldPeer in netengine/spec/models.py and export BoundaryPolicy from netengine/spec/__init__.py.
  • Add unit tests in tests/test_authority_spec.py covering defaults and each validation path and update imports accordingly.

Testing

  • Ran pytest tests/test_authority_spec.py tests/test_gateway_federation.py tests/test_gateway_portal.py tests/test_spec_parsing.py and all tests passed (83 passed, 8 warnings).
  • Ran style/lint checks with poetry run ruff check netengine/spec/authority.py netengine/spec/models.py netengine/spec/__init__.py tests/test_authority_spec.py and all checks passed.

Codex Task

@aidankhogg aidankhogg self-assigned this Jun 30, 2026
@aidankhogg aidankhogg added the enhancement New feature or request label Jun 30, 2026
@aidankhogg aidankhogg merged commit 8e271be into dev/alpha Jun 30, 2026
@aidankhogg aidankhogg deleted the codex/add-boundarypolicy-to-authority/spec-layer branch June 30, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant