Skip to content

Add spec-aware subnet checks to netengine doctor#148

Merged
aidankhogg merged 1 commit into
dev/alphafrom
codex/extend-doctor-cli-for-subnet-checks
Jun 29, 2026
Merged

Add spec-aware subnet checks to netengine doctor#148
aidankhogg merged 1 commit into
dev/alphafrom
codex/extend-doctor-cli-for-subnet-checks

Conversation

@aidankhogg

Copy link
Copy Markdown
Contributor

Motivation

  • Enable users to validate requested world subnets before bootstrapping so Docker networks that would reuse or overlap world subnets are detected early.
  • Allow netengine doctor to be run against a world spec to include spec.substrate.networks[*].subnet in preflight network checks.
  • Provide clearer diagnostics and remediation when an existing Docker network reuses or overlaps a requested subnet.

Description

  • Added an optional --spec PATH option and an optional positional spec argument to the doctor command in netengine/cli/doctor.py, with mutual-exclusion handling and spec-loading via the existing spec loader.
  • Extended DoctorContext and the preflight API (build_context, run_checks) in netengine/diagnostic/preflight.py to carry spec_subnets: tuple[str, ...] through preflight probes.
  • Updated _check_docker_subnet_conflicts to collect compose-defined subnets and also include ctx.spec_subnets, to detect overlaps and exact reuse and to emit clearer conflict messages and remediation hints referencing Docker network names.
  • Plumbed spec subnet extraction into the readiness flow in netengine/cli/main.py so readiness uses the loaded spec's substrate subnets for subnet checks.
  • Documented usage in README.md, docs/alpha-quickstart.md, and docs/troubleshooting.md with examples like poetry run netengine doctor --spec examples/minimal.yaml.
  • Added unit tests in tests/test_doctor.py covering --spec handling and Docker subnet conflict detection against spec subnets, and formatted/linted modified files.

Testing

  • Ran python -m pytest tests/test_doctor.py and all tests passed (15 passed).
  • Ran python -m ruff check on modified files and linting completed with no issues (All checks passed).
  • Ran git diff --check to verify no whitespace/git-diff problems and none were reported.

Codex Task

@aidankhogg aidankhogg self-assigned this Jun 29, 2026
@aidankhogg aidankhogg added the enhancement New feature or request label Jun 29, 2026
@aidankhogg aidankhogg merged commit 2a5eb99 into dev/alpha Jun 29, 2026
@aidankhogg aidankhogg deleted the codex/extend-doctor-cli-for-subnet-checks branch June 29, 2026 21:54
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