RFC 008 slice 0a: core types, normalized manifest, and fixtures - #1044
RFC 008 slice 0a: core types, normalized manifest, and fixtures#1044zkwentz wants to merge 3 commits into
Conversation
|
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. |
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>
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>
e798610 to
b86a665
Compare
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>
b86a665 to
5cc099f
Compare
| { | ||
| "manifest_schema_version": "1", | ||
| "name": "served-min-pass", | ||
| "version": "0.1.0", |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit 5cc099f. Configure here.
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>
5cc099f to
beb3616
Compare
There was a problem hiding this comment.
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).
❌ 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 |
There was a problem hiding this comment.
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.
Reviewed by Cursor Bugbot for commit e2e84a8. Configure here.


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).
How to review (~450 hand-written lines)
Read in this order:
src/openenv/validation/types.py(~95 lines) — the seven enums. Carries the core invariant: graders emitCheckStatus; only the severity policy assignsSeverity.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 iffllm_judged;set_staterequired for injected-state oracles; verifierentryiffkind == "script";NetworkPolicyper the Harbor task.toml 1.4 precedent (modepublicdefault — 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).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 byscripts/sync_validation_schemas.py.tests/fixtures/validation/(20 files, ~480 lines) — ten fixture packages; readserved_min_pass/andbroken_manifest/, the other eight are variations. Eachnormalized_manifest.jsondoubles 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.validationpackage 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, graderCheckStatusvs policySeverity, verdicts, packageSignatureKind(openenv.yaml,task.toml,task.md), and provider capabilities.NormalizedManifestand 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_statefor injected-state oracles, and verifierentryonly for script verifiers.Packaging ships committed
manifest.schema.json(generated from models) viascripts/sync_validation_schemas.py(--check/--fixfor CI). Ten fixture packages undertests/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.