Skip to content

Restore RFC 008 validation contracts - #1111

Open
burtenshaw wants to merge 2 commits into
ben/rfc008-reapply-1044from
ben/rfc008-reapply-1045
Open

Restore RFC 008 validation contracts#1111
burtenshaw wants to merge 2 commits into
ben/rfc008-reapply-1044from
ben/rfc008-reapply-1045

Conversation

@burtenshaw

@burtenshaw burtenshaw commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

This PR reapplies #1045 on #1110. Stack: #1110#1111#1112.

@bot-ci-comment

bot-ci-comment Bot commented Sep 1, 2026

Copy link
Copy Markdown

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alignment Review Report

Two-tier review of the RFC 008 "contracts" slice. Net: clean, faithful to the RFC, no mechanical fixes required. One process flag for a human.

Automated Checks

  • Lint: PASS (this PR's code). ruff format --check, usort check, and ruff check src/ tests/ all pass on the changed files under src/openenv/validation/ and tests/test_validation/. .claude/hooks/lint.sh exits non-zero, but only because its ruff format … envs/ pass flags ~26 pre-existing unformatted files under envs/ that this PR does not touch.
  • Debug code: CLEAN (this PR's code). .claude/hooks/check-debug.sh reports print(/TODO hits, but every one is in pre-existing files (src/openenv/core/**, cli/**, auto/**) — none in src/openenv/validation/. No breakpoint()/pdb.
  • Tests: PASS. tests/test_validation/ 65 passed; full suite 1597 passed / 133 skipped (expected optional-dep skips); scripts/sync_validation_schemas.py --check reports schemas in sync.

Open RFCs Context

  • RFC 008 — Environment Auto-Validation (rfcs/008-environment-auto-validation.md, Status: In Review, author @zkwentz). This PR is the RFC's "PR2 — contracts": signature detection surface, parser/grader/provider protocols, normalized-manifest + report JSON Schemas, and severity policy v1.
  • Other open RFCs (000/001/002/003/005 In Review; 010 Draft) don't intersect these changes.

Tier 1: Fixes Required

None. New modules are import-clean (no circular imports; every __all__ name resolves; from openenv.validation import * works), fully typed, and lint-clean. Parsers are declared pure-reads and there's no credential handling, so no security concerns.

Tier 2: Alignment Discussion

Principle Conflicts

None identified. Checked against INVARIANTS.md:

  • Client-server separation — validation is a standalone subsystem; no server/ imports.
  • Rewards in environment — the contracts validate verifier sanity (oracle→max, floor gap); they do not externalize reward computation.
  • Agent isolation / "agents cannot reset"set_state is an infra-side validation capability, and runtime.oracle_containment stays a required check so the oracle is withheld from the agent at serve time.
  • Pydantic serialization — all wire types (NormalizedManifest, ValidationReport, CheckResult, policy models) are Pydantic with extra="forbid".

RFC Conflicts

No design conflict — the implementation matches RFC 008 exactly. I cross-checked committed policies/severity-v1.json against the RFC's stated rollup and it agrees to the number: 45 check ids = 34 fail / 10 warn / 1 advisory, 33 local-lane, with levels/lanes/severities matching the 44-test mapping (and EXPECTED_POLICY in conftest.py mirrors it as a drift guard).

One process flag:

ALIGNMENT FLAG: Freezing normative contracts while the RFC is still In Review

  • RFC at stake: RFC 008 (Status: In Review)
  • The concern: This PR commits hard-to-revise artifacts — the report/manifest JSON Schemas (report_schema_version "1"), the check-id taxonomy, and the v1 severity mapping — before the RFC that defines them is finalized. Any review-driven change to a check id, severity, or schema field must then move in lockstep across severity-v1.json, report.schema.json, and the EXPECTED_POLICY mirror. Worth an explicit "we accept freezing these now" from the RFC owner.
  • Suggested reviewer: @zkwentz (RFC 008 author); cc @Darktex (owns the principles/invariants this touches)

Summary

  • 0 mechanical issues to fix (Tier 1)
  • 1 alignment point for human review (Tier 2, process): freezing RFC-008 contracts while In Review
  • 0 RFC design conflicts — severity policy and schemas match RFC 008 exactly
Open in Web View Automation 

Sent by Cursor Automation: Pre-review

severity: Severity


class DeclarationBounds(BaseModel):

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI (non-blocking): DeclarationBounds ships here and is loaded as SeverityPolicy.bounds, but nothing enforces these ceilings against a manifest's declared oracle_tolerance / floor_margin / variance_tolerance / episode_timeout_s yet — these field names appear only in this class. Enforcement belongs to the static.manifest grader in a later implementation PR, which is consistent with RFC 008's stacked-delivery plan. Flagging so the wiring isn't lost between the contracts PR and the implementation PR.


signature: SignatureKind

def parse(self, package_root: Path) -> NormalizedManifest: ...
requires_provider: frozenset[ProviderCapability]
depends_on: tuple[str, ...]

def applies_to(self, manifest: NormalizedManifest) -> bool: ...

def applies_to(self, manifest: NormalizedManifest) -> bool: ...

def run(self, subject: Subject) -> CheckResult: ...

base_url: str

def exec(self, argv: list[str], timeout_s: float) -> ExecResult: ...

def exec(self, argv: list[str], timeout_s: float) -> ExecResult: ...

def stop(self) -> None: ...
*,
network: NetworkPolicy | None = None,
env_vars: dict[str, str] | None = None,
) -> RunningSubject: ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature size: extra-large Extra-large pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants