Skip to content

Emit machine-readable support-matrix from netengine validate#125

Merged
aidankhogg merged 2 commits into
dev/alphafrom
codex/extend-spec-validation-for-support-matrix-output
Jun 29, 2026
Merged

Emit machine-readable support-matrix from netengine validate#125
aidankhogg merged 2 commits into
dev/alphafrom
codex/extend-spec-validation-for-support-matrix-output

Conversation

@aidankhogg

Copy link
Copy Markdown
Contributor

Motivation

  • Provide a CI-friendly, machine-readable report of active spec feature-states so automation can archive results and fail on unsupported active fields via a non-zero exit code.
  • Reuse existing feature-state discovery logic to avoid duplicating validation semantics while enabling JSON serialization for tool consumption.

Description

  • Add a --format text|json option to netengine validate and implement JSON output that includes each active feature-state entry with path, state, stage, reason, current_value, and default_value using _resolve_feature_state_paths and _is_active_feature_value for discovery.
  • Defer enforcement of feature-state gates during initial spec load by adding validate_feature_states flags to load_spec, load_spec_with_composition, load_spec_with_environment, and the CLI helper _load_spec_for_cli, allowing the CLI to produce machine-readable results before failing.
  • Add JSON-friendly helpers _jsonable_feature_value and _active_feature_state_results in netengine/cli/main.py and make the validate command emit structured payloads and exit non-zero when any active field is unsupported.
  • Add tests that cover text and JSON output behavior and failure semantics in tests/test_cli.py, and update docs/support-matrix.md and docs/spec-reference.md with CI usage examples (netengine validate --format json).

Testing

  • Ran unit tests with pytest -q tests/test_cli.py tests/test_feature_states.py, and all tests passed (30 passed).
  • The new JSON behaviors are exercised by two added tests: test_validate_json_reports_active_feature_states and test_validate_json_unsupported_active_feature_exits_nonzero in tests/test_cli.py.

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 83bc36d into dev/alpha Jun 29, 2026
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