feat(types): add calibration scope and issuer to the reward certificate - #38
Merged
Conversation
A self-signed certificate may carry only synthetic scope. certified now requires oracle tier 2 or 3, a current certificate, a calibration corpus digest, and a stated calibration scope. The receipt carries both. The only computable scope today is synthetic. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
Follows openadapt-types#37 (released as 0.16.0). Adds the calibration scope and the issuer to
RewardCertificateV1, carries both onRewardEvidenceReceiptV1, and tightenscertified.What changes
RewardCertificateV1gains two required fields:calibration_scope(syntheticorproduction) andissuer(self_signedororganization). The validator refusesissuer: self_signedwithcalibration_scope: production. A self-signed certificate can state only what it can compute, and today that is a bound against the synthetic MockMed/ExtraDup corpus.RewardEvidenceReceiptV1gainscalibration_corpus_digestandcalibration_scope. Both must be present whenever a certificate is referenced and both must be absent whencertificate_stateisabsent.certified: truenow requires all of: oracle tier 2 or 3,certificate_state: current, a calibration corpus digest, and a stated scope. A newproduction_certifiedproperty is true only for a certified receipt withproductionscope, which no self-signed certificate can reach.score()applies the same rule: with a certificate,certifiedis true only when the certificate is current and carries its corpus digest and scope.docs/REWARD.mdgains a section stating that the only computable certificate today is synthetic-scope, that production scope needs the unpublished Phase-1 calibration, and that public text must keep "certified" beside "synthetic" until that changes.Tests
test_self_signed_certificate_refuses_production_scopeandtest_certified_requires_corpus_digest_and_stated_scopecover the two refusals. The existing 33 reward tests are updated for the new required fields; the pinned contract digest is unchanged becauseRewardContractV1did not change.Reviewer checks
uv run pytest: 430 passed locally.uv buildandscripts/check_source_boundary.py --require-distpass.reward-certificate-v1.jsonandreward-evidence-receipt-v1.json. The file count is unchanged.featcommit, so python-semantic-release cuts 0.17.0 on merge. Consumers of 0.16.0 must addissuerandcalibration_scopeto any certificate they build.Opened by an agent session, not the founder.
🤖 Generated with Claude Code