Skip to content

refactor(proof-artifact): converge SCOPE-D onto canonical ProofArtifact v1 (R2, #97) - #78

Merged
mdheller merged 1 commit into
mainfrom
feat/proof-artifact-v1-converge
Aug 2, 2026
Merged

refactor(proof-artifact): converge SCOPE-D onto canonical ProofArtifact v1 (R2, #97)#78
mdheller merged 1 commit into
mainfrom
feat/proof-artifact-v1-converge

Conversation

@mdheller

@mdheller mdheller commented Aug 2, 2026

Copy link
Copy Markdown
Member

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 the epistemicLevel enum. It now:
    • binds to the canonical via allOf: [{ "$ref": "https://schemas.socioprophet.ai/proof-artifact/v1.json" }], and
    • sources the enum via claim.properties.epistemicLevel = { "$ref": ".../v1.json#/$defs/epistemicLevel" }.
    • $id, top-level type/additionalProperties: false/required/properties are unchanged, so the existing validate-contracts / validate-wargames shape-lint (which requires a socioprophet.org/schemas/ $id and additionalProperties: 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 (sha256 605ecec0…), so SCOPE-D's offline AJV validators resolve the $ref without any network/CDN fetch. See vendor/schemas/proof-artifact/README.md for 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).
  • Wired that helper into all five sites that compile the proof-artifact schema: validate-contracts.js, verify-run.js, init-run.js, init-ai-infra-run.js, init-graph-robustness-run.js. Without this, the new $ref would 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 install then 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
  • Full CI init→verify flows for synthetic, ai-infra, and graph-robustness labs ✅ — generated proof-artifact.json validates 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

…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.
Copilot AI review requested due to automatic review settings August 2, 2026 18:43
@github-actions

github-actions Bot commented Aug 2, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copilot AI 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.

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.json to bind to the canonical schema via allOf and to $ref the canonical epistemicLevel definition.
  • 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.

@mdheller
mdheller merged commit 9bc84da into main Aug 2, 2026
11 checks passed
@mdheller
mdheller deleted the feat/proof-artifact-v1-converge branch August 2, 2026 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants