RFC 008 slice 0b: registries, report schema, and severity policy - #1045
Open
zkwentz wants to merge 5 commits into
Open
RFC 008 slice 0b: registries, report schema, and severity policy#1045zkwentz wants to merge 5 commits into
zkwentz wants to merge 5 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. |
zkwentz
force-pushed
the
rfc-008/pr2-contracts
branch
from
August 4, 2026 19:30
51c6d01 to
85e9b73
Compare
zkwentz
added a commit
that referenced
this pull request
Aug 4, 2026
…ign warn Review finding on #1045: the rollup sentence said "30 fail, 9 warn, 1 advisory" but the committed policy carries 34/10/1 over 45 check ids. Both countings are now stated explicitly, and the per-test tally is corrected to 32 fail (the prior 30 was an arithmetic slip — 30+9+1+2 != 44). Test #8's row now pins hub.cosign_signature at warn. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zkwentz
added a commit
that referenced
this pull request
Aug 4, 2026
… pinned report version Bugbot finding: a grader CLASS loaded from an entry point already satisfies the runtime-checkable Grader protocol (class attributes exist on the class object), so the isinstance guard skipped instantiation and registered the class itself — instantiation now keys off isinstance(candidate, type). Registration also validates requires_capabilities names against CapabilitiesSpec fields so a typo'd capability errors clearly at register time instead of crashing at selection. report_schema_version is pinned to Literal["1"] for parity with the manifest. Regression tests for all three. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zkwentz
force-pushed
the
rfc-008/pr2-contracts
branch
from
August 4, 2026 19:37
85e9b73 to
81ab9ab
Compare
zkwentz
added a commit
that referenced
this pull request
Aug 4, 2026
Review direction from Zach on #1045: WELL_KNOWN_FILES must not list formats whose parsers are not implemented in the build. Detection recognizes only supported formats (entries graduate in with their parsers: openenv.yaml at the walking skeleton, task.toml with the Harbor parser, task.md with the PostTrain parser); anything else is refused as unrecognized, exit 2. parser-not-implemented remains as a defensive registry contract only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… 0b (#778, #898) Second half of the slice-0 contracts: signature detection rules and the unsupported-categories error contract; Parser/Provider/Grader protocols with working Parser and Grader registries (third-party graders via the openenv.validation.graders entry-point group); CheckResult/ValidationReport models with the committed report JSON Schema; the versioned severity policy (severity-v1.json, all 45 check ids including reserved hub/statistical ids) with lane filtering and fail-closed verdict application; and the conformance tests: policy completeness against the RFC table, protocol conformance against test-only fakes, report round-trips, and the accreting checkpoint suite. No runner, no CLI change, no real grader — those land per vertical slice. Checkpoint: PYTHONPATH=src:envs pytest tests/test_validation/ -v # 59 passed python scripts/sync_validation_schemas.py --check Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… pinned report version Bugbot finding: a grader CLASS loaded from an entry point already satisfies the runtime-checkable Grader protocol (class attributes exist on the class object), so the isinstance guard skipped instantiation and registered the class itself — instantiation now keys off isinstance(candidate, type). Registration also validates requires_capabilities names against CapabilitiesSpec fields so a typo'd capability errors clearly at register time instead of crashing at selection. report_schema_version is pinned to Literal["1"] for parity with the manifest. Regression tests for all three. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
WELL_KNOWN_FILES no longer pre-declares formats whose parsers do not exist in the build — entries are added alongside their parsers (openenv.yaml at the walking skeleton, task.toml with the Harbor parser, task.md with the PostTrain parser). The parser-not-implemented category is retained as a defensive registry contract only. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
zkwentz
force-pushed
the
rfc-008/pr2-contracts
branch
from
August 4, 2026 19:48
81ab9ab to
e1a5f68
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit e1a5f68. Configure here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Checkpoint
Stacked on #1044 (slice 0a: types + manifest + fixtures), which stacks on #1041 (RFC). Second half of the slice-0 contracts — the original slice-0 PR (#1042) was split in two for reviewability.
Every contract is exercised by a test the day it lands — the "mock API" exists before any implementation.
How to review (~550 lines)
Read in this order:
src/openenv/validation/signature.py— well-known-file detection table,SignatureError/UnsupportedPackageError, and the unsupported-categories list (exit-code-2 contract). GPU is not a category: GPU packages validate on providers with the GPU capability.parsers/__init__.py,providers/__init__.py,graders/__init__.py— protocols plus workingParserRegistryandGraderRegistry. The load-bearing rule: grader selection reads the manifest only (a conformance test proves two manifests differing only by signature select identically). Third-party graders register via theopenenv.validation.gradersentry-point group. Providers start subjects under the manifest's declared network policy (defaultpublic); enforcingno-network/allowlistneeds theNETWORK_POLICYcapability.report.py+policy.py— report models and severity-policy application: hub-lane entries filtered out entirely for local runs (an author never sees a check they can't red-to-green); ERROR fails closed; unknown ids are an internal error.tests/test_validation/test_policy.py— the verdict semantics, one behavior per test.Skim only:
policies/severity-v1.json— the data table: all 45 check ids (33 local + 12 reserved hub/statistical);tests/test_validation/conftest.pyholds the same table as a literal so the file can't drift silently.schemas/report.schema.json— generated, CI-checked.test_protocols.py/test_report.py/test_checkpoints.py— fakes and mechanical assertions;test_checkpoints.pyis the accretion point every later slice appends to.Flagged judgment calls (not in the approved design docs)
severity-v1.jsonbounds are placeholders:max_oracle_tolerance 0.1 · min_floor_margin 0.1 · max_variance_tolerance 0.2 · max_episode_timeout_s 3600.warn.llm_judged: falseis rejected as a contradiction (strict iff).Refs #778, #898.
🤖 Generated with Claude Code
Note
Low Risk
Contract and test-only slice with no runtime CLI wiring yet; policy bounds are documented placeholders and verdict logic is heavily unit-tested.
Overview
Adds the second half of RFC 008 slice 0: executable contracts for parsers, graders, providers, structured reports, and versioned severity policy—ahead of a full
openenv validatepipeline implementation.Protocols and registries define
Parser/ParserRegistry(signature → manifest),Grader/GraderRegistry(manifest-only selection, entry-point groupopenenv.validation.graders), andValidationProvider/RunningSubjectfor sandbox exec and network policy. Signature module ships detection tables,SignatureError/UnsupportedPackageError, and unsupported categories (GPU is a provider capability, not a reject category).ValidationReportandCheckResultmodels embed the normalized manifest;severity-v1.jsonmaps all 45 check ids (local + reserved hub/statistical) withapply_policyas the sole verdict path (ERROR fails closed; local lane hides hub-only ids). Packaging includes policy JSON; schema sync addsreport.schema.json.Tests lock policy completeness against
EXPECTED_POLICY, verdict semantics, protocol fakes, checkpoint 0, and CI schema sync.Reviewed by Cursor Bugbot for commit af44c21. Bugbot is set up for automated code reviews on this repo. Configure here.