Skip to content

RFC 008 slice 0a: core types, normalized manifest, and fixtures - #1044

Open
zkwentz wants to merge 3 commits into
rfc-008/pr1-rfcfrom
rfc-008/pr2a-manifest
Open

RFC 008 slice 0a: core types, normalized manifest, and fixtures#1044
zkwentz wants to merge 3 commits into
rfc-008/pr1-rfcfrom
rfc-008/pr2a-manifest

Conversation

@zkwentz

@zkwentz zkwentz commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Checkpoint

Stacked on #1041 (RFC). First half of the slice-0 contracts (split from the original #1042 for reviewability; the registries/report/policy half follows in #1042).

PYTHONPATH=src:envs uv run pytest tests/test_validation/ -v   # 26 passed
python scripts/sync_validation_schemas.py --check              # schemas in sync

How to review (~450 hand-written lines)

Read in this order:

  1. src/openenv/validation/types.py (~95 lines) — the seven enums. Carries the core invariant: graders emit CheckStatus; only the severity policy assigns Severity.
  2. src/openenv/validation/manifest.py (~300 lines) — NormalizedManifest + component models, the entire interface between a package format and every grader. The validators are the substance: judge pin + variance tolerance iff llm_judged; set_state required for injected-state oracles; verifier entry iff kind == "script"; NetworkPolicy per the Harbor task.toml 1.4 precedent (mode public default — egress allowed — / no-network / allowlist); GPU declarations (gpus/gpu_types) are resource fields, not disqualifiers; a missing oracle is a valid manifest (graded FAIL later, not a parse error).
  3. tests/test_validation/test_manifest.py — the validator behaviors, one test each.

Skim only:

  • schemas/manifest.schema.json (~450 lines) — generated from the pydantic model, CI-checked by scripts/sync_validation_schemas.py.
  • tests/fixtures/validation/ (20 files, ~480 lines) — ten fixture packages; read served_min_pass/ and broken_manifest/, the other eight are variations. Each normalized_manifest.json doubles as the golden parse result for the parser slices.

Refs #778, #898.

🤖 Generated with Claude Code


Note

Low Risk
New additive package and tests only; no changes to runtime CLI behavior or existing env execution paths.

Overview
Introduces the RFC 008 validation contract foundation: a new openenv.validation package with shared enums and the normalized manifest Pydantic models that parsers will emit and graders will consume.

Core types (types.py) define validation levels, local vs hub lanes, grader CheckStatus vs policy Severity, verdicts, package SignatureKind (openenv.yaml, task.toml, task.md), and provider capabilities.

NormalizedManifest and nested models encode reward/oracle/verifier rules, resource and network declarations, capabilities (including optional oracle — valid at parse time, graded later), and type tags. Cross-field validators enforce LLM judge pins + variance tolerance, set_state for injected-state oracles, and verifier entry only for script verifiers.

Packaging ships committed manifest.schema.json (generated from models) via scripts/sync_validation_schemas.py (--check / --fix for CI). Ten fixture packages under tests/fixtures/validation/ supply golden normalized manifests for future parser work plus pass/fail schema cases; tests/test_validation/ covers enum contracts, manifest validation, and schema sync.

Reviewed by Cursor Bugbot for commit e2e84a8. Bugbot is set up for automated code reviews on this repo. Configure here.

@bot-ci-comment

bot-ci-comment Bot commented Aug 4, 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.

@burtenshaw burtenshaw added feature size: large Large pull request labels Aug 4, 2026 — with Cursor
Comment thread tests/test_validation/test_types.py Outdated
Comment thread src/openenv/validation/manifest.py
Comment thread pyproject.toml Outdated
zkwentz added a commit that referenced this pull request Aug 4, 2026
Review finding on #1044: the illustrative openenv.yaml omitted the verifier
binding, so the RFC's own example would fail its normative schema. The
verifier stays required — how "evaluate this state" is invoked is not
defaultable; a served env declares kind: reward_channel explicitly.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zkwentz added a commit that referenced this pull request Aug 4, 2026
Collapse the test_types import to one line (CI usort gate), and ship only the
schemas/*.json package-data glob here — the policies/*.json half moves to
slice 0b where the policies/ directory actually lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zkwentz
zkwentz force-pushed the rfc-008/pr2a-manifest branch from e798610 to b86a665 Compare August 4, 2026 19:29
zkwentz added a commit that referenced this pull request Aug 4, 2026
Collapse the test_types import to one line (CI usort gate), and ship only the
schemas/*.json package-data glob here — the policies/*.json half moves to
slice 0b where the policies/ directory actually lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zkwentz
zkwentz force-pushed the rfc-008/pr2a-manifest branch from b86a665 to 5cc099f Compare August 4, 2026 19:36
{
"manifest_schema_version": "1",
"name": "served-min-pass",
"version": "0.1.0",

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Golden manifests invent package version

Medium Severity

Served fixture goldens set version to 0.1.0, but the matching openenv.yaml sources never declare a package version. NormalizedManifest.version defaults to None, so a faithful parser would emit null. Harbor/PostTrain fixtures keep source and golden aligned; these served ones do not, so later parser golden checks will encode the wrong expected result.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5cc099f. Configure here.

zkwentz and others added 2 commits August 4, 2026 15:47
First half of the slice-0 contracts: core enums (Level, Lane, CheckStatus,
Severity, Verdict, SignatureKind, ProviderCapability), the NormalizedManifest
pydantic models with all schema rules (judge pin iff llm_judged, set_state
required for injected-state oracles, verifier entry iff script, NetworkPolicy
per the Harbor task.toml 1.4 precedent, GPU resource declarations), the
committed manifest JSON Schema with its CI sync script, the ten golden/defect
fixture packages whose normalized_manifest.json doubles as parser golden
output, and the schema round-trip tests.

Registries, report/policy contracts, and conformance tests follow in slice 0b.

Checkpoint: PYTHONPATH=src:envs pytest tests/test_validation/ -v   # 26 passed
            python scripts/sync_validation_schemas.py --check

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collapse the test_types import to one line (CI usort gate), and ship only the
schemas/*.json package-data glob here — the policies/*.json half moves to
slice 0b where the policies/ directory actually lands.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e2e84a8. Configure here.

raise ValueError(
"a judge pin is declared but capabilities.llm_judged is false"
)
return self

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Incomplete llm_judged invariant

Medium Severity

_judge_pin_iff_llm_judged treats the judge pin as present iff llm_judged, but only requires reward.variance_tolerance when llm_judged is true — it never rejects a non-null variance_tolerance when llm_judged is false. That breaks the stated bidirectional invariant and can let non-judged manifests carry a variance bound that only variance-mode determinism should use.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit e2e84a8. Configure here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature size: large Large pull request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants