CLI: validation profiles and shared reports - #947
Conversation
1e84a15 to
e660c8c
Compare
There was a problem hiding this comment.
I found one blocking semantic issue in this.
--json, --output, or --profile selects the RFC 008 planner, while the unqualified command remains on the legacy validator. That makes a presentation flag change both pass/fail behavior and exit status. I reproduced this with a minimal environment containing an empty uv.lock and no Dockerfile: openenv validate <env> exits 0 with “Ready for multi-mode deployment”, while openenv validate <env> --json exits 1 on the shared source checks. A runtime URL similarly gets a different JSON contract when --json is added even though URL validation is already JSON by default.
This conflicts with RFC 008’s stated contract that all local invocations use the shared planner and differ only in presentation, and it creates exactly the human/agent divergence OpenEnv tries to avoid. I see that #951 later unifies the paths, but #947 should be safe as independently mergeable. Please move that unification into this PR, or reorder/fold the dependency so this PR never lands with split validation semantics.
cc - @zkwentz and @Darktex to minimize human-agent divergence / one canonical workflow
What & Why
The shared validation API needs a stable author-facing CLI. This PR exposes static, runtime, and full profiles plus JSON/output controls through
openenv validate.Risk & Review Guidance
src/openenv/cli/commands/validate.py:30for target/profile resolution and exit codes;tests/test_cli/test_validate.pyfor URL and report compatibilityDecisions & Alternatives
Verification
PYTHONPATH=src:envs .venv/bin/python -m pytest tests/ -q -m 'not integration'— 1,559 passed, 114 skipped, 31 external integration tests deselected on the complete stack.Scope & Non-Goals
Stack
PR 6 of 17; depends on #946.
Full 17-PR stack
All upstream PRs remain draft while RFC 008 is under review.