refactor(proof-artifact): converge SCOPE-D onto canonical ProofArtifact v1 (R2, #97) - #78
Merged
Merged
Conversation
…ct v1 (R2, #97)
Delete the copy-pasted epistemicLevel enum from
config/schemas/proof-artifact.schema.json and bind the schema to the
estate-canonical ProofArtifact v1 instead.
- proof-artifact.schema.json: add allOf[{$ref canonical}] and replace the
inline epistemicLevel enum with a $ref to the canonical's $defs
(https://schemas.socioprophet.ai/proof-artifact/v1.json). SCOPE-D-specific
fields remain as the extension; $id/type/additionalProperties unchanged so
the existing contract shape-lint still passes.
- vendor/schemas/proof-artifact/: sovereign-vendored verbatim copy of the
canonical (byte-identical, sha 605ecec0...) so offline AJV resolves the $ref
(not fetched from a CDN).
- scripts/lib/canonical-schemas.js: helper registering the vendored canonical
with an AJV instance; wired into all five compile sites (validate-contracts,
verify-run, init-run, init-ai-infra-run, init-graph-robustness-run).
- scripts/test-epistemic-lattice.js: assert the module enum against the
canonical $defs (single source of truth) instead of the now-removed inline
schema enum.
Verified locally: validate-contracts, validate-wargames, validate-svf,
test-epistemic-lattice/compose/propagation, and the init+verify-run CI flows
(synthetic, ai-infra, graph-robustness) all pass.
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
There was a problem hiding this comment.
Pull request overview
Converges SCOPE-D’s proof-artifact contract onto the estate-canonical ProofArtifact v1 schema by switching the local schema to $ref the canonical vocabulary (notably epistemicLevel) while preserving SCOPE-D’s stricter shape requirements (e.g., additionalProperties: false) and ensuring offline AJV validation continues to work via a vendored canonical copy.
Changes:
- Updated
config/schemas/proof-artifact.schema.jsonto bind to the canonical schema viaallOfand to$refthe canonicalepistemicLeveldefinition. - Added a sovereign-vendored copy of the canonical ProofArtifact v1 schema and documented its provenance/immutability.
- Introduced an AJV helper to register the vendored canonical schema and wired it into all scripts that compile the proof-artifact schema; updated the enum-drift test to assert against the canonical.
Reviewed changes
Copilot reviewed 8 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
config/schemas/proof-artifact.schema.json |
Binds SCOPE-D’s schema to canonical ProofArtifact v1 and refs canonical epistemicLevel while keeping SCOPE-D’s strict extension constraints. |
vendor/schemas/proof-artifact/README.md |
Documents vendoring rationale, provenance, and “do not edit locally” guidance. |
vendor/schemas/proof-artifact/proof-artifact.schema.v1.json |
Adds the vendored, offline-resolvable canonical ProofArtifact v1 schema. |
scripts/lib/canonical-schemas.js |
Adds an idempotent helper to register the vendored canonical schema with AJV. |
scripts/verify-run.js |
Ensures run verification AJV can resolve the canonical $ref by registering the vendored schema. |
scripts/validate-contracts.js |
Ensures contract validation compiles schemas with the canonical ProofArtifact pre-registered. |
scripts/init-run.js |
Ensures init flow can compile proof-artifact schema after introducing canonical $ref. |
scripts/init-ai-infra-run.js |
Ensures ai-infra init flow can compile proof-artifact schema with canonical $ref. |
scripts/init-graph-robustness-run.js |
Ensures graph-robustness init flow can compile proof-artifact schema with canonical $ref. |
scripts/test-epistemic-lattice.js |
Updates enum drift assertion to compare lattice enum against canonical $defs.epistemicLevel. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Remediation R2 — converge SCOPE-D onto canonical ProofArtifact v1
Part of standards-storage#97 (R2: freeze one ProofArtifact schema v1 and converge the forks). Companion to standards-storage PR that creates the canonical schema.
What changed
config/schemas/proof-artifact.schema.json— no longer copy-pastes theepistemicLevelenum. It now:allOf: [{ "$ref": "https://schemas.socioprophet.ai/proof-artifact/v1.json" }], andclaim.properties.epistemicLevel={ "$ref": ".../v1.json#/$defs/epistemicLevel" }.$id, top-leveltype/additionalProperties: false/required/propertiesare unchanged, so the existingvalidate-contracts/validate-wargamesshape-lint (which requires asocioprophet.org/schemas/$idandadditionalProperties: false) still passes. The SCOPE-D-specific fields remain as the extension.vendor/schemas/proof-artifact/proof-artifact.schema.v1.json— sovereign-vendored, byte-identical copy of the canonical (sha256605ecec0…), so SCOPE-D's offline AJV validators resolve the$refwithout any network/CDN fetch. Seevendor/schemas/proof-artifact/README.mdfor provenance and the "do not edit locally" note.scripts/lib/canonical-schemas.js— small helper that registers the vendored canonical with an AJV instance (idempotent).validate-contracts.js,verify-run.js,init-run.js,init-ai-infra-run.js,init-graph-robustness-run.js. Without this, the new$refwould fail AJV compilation.scripts/test-epistemic-lattice.js— the enum-drift test now asserts the lattice module against the canonical$defs.epistemicLevel.enum(the single source of truth) instead of the now-removed inline schema enum.Validation performed (locally,
npm installthen run)validate-contracts.js✅ (19 schema/example pairs) ·validate-wargames-contracts.js✅ ·validate-svf-contracts.js✅test-epistemic-lattice.js✅ ·test-compose-run-epistemic.js✅ ·test-epistemic-propagation.js✅proof-artifact.jsonvalidates against the converged schema (resolving the canonical$ref), e.g.claim.epistemicLevel = synthetic,status = SYNTHETIC_ONLY.No behavioural change to any proof-artifact document; this is a pure convergence of the enum/vocabulary onto the canonical. Also discharges the seed deck's "ProofArtifact schema v1 frozen at Day 90" milestone.
🤖 Generated with Claude Code