Skip to content

CR-010.R1: freeze the proof spec + ship a conformance suite - #241

Merged
harishquantamix merged 1 commit into
masterfrom
cr-010-r1-proof-spec-public
Jul 27, 2026
Merged

harishquantamix merged 1 commit into
masterfrom
cr-010-r1-proof-spec-public

Conversation

@quantamixsol

Copy link
Copy Markdown
Owner

CR-010.R1 — Freeze the proof spec + ship a conformance suite (public)

Cherry-pick of the feature commit 1fa41b70 from private PR #318 (merged 2026-07-27, merge commit 9acbf4cf), applied onto public master 356dae49.

What this publishes

GraQle's tamper-evidence proof format is now a frozen, versioned, independently-implementable spec rather than an implicit contract living in code and docstrings.

Added Purpose
graqle/pct/schema/proof-spec/v1.0/bundle.schema.json The proof-bundle envelope
graqle/pct/schema/proof-spec/v1.0/keyring.schema.json The trusted-key manifest
graqle/pct/schema/proof-spec/v1.0/verify-result.schema.json The --format json result contract
graqle/pct/schema/proof-spec/v1.0/SPEC.md Prose, verification procedure, threat model
graqle/pct/schema/conformance/ 9-case corpus + deterministic golden vectors
tests/test_pct/test_proof_spec_conformance.py 49 tests

Modified — 2 files only: graqle/pct/schema/__init__.py (loader API) and pyproject.toml (wheel artifacts). No signing or verification logic changed.

Why it matters

A third party can now implement a conformant verifier from the published artifacts alone. That claim is tested literally, not asserted: the full corpus runs from an installed wheel at a neutral cwd, over a subprocess/JSON boundary, with no GraQle imports on the consuming side.

  • Corpus covers all 7 VerifyFailure members + the exit-2 usage path
  • Every expectation is empirically derived from the reference implementation
  • Each case asserts the typed failure, the process exit code, and absent-vs-false check semantics
  • SPEC_VERSION (1.0) is decoupled from the SDK version — pinning to the spec does not pin you to a release

proof_format_version is published as opaque — deliberately

The field is inside both the ed25519 signed preimage and the leaf hash, so cryptography pins it, not schema validation:

Forgery Result
Mutate the wrapper value only UNTRUSTED_KID — signature no longer validates
Mutate wrapper and record TAMPERED_LEAF — leaf hash no longer matches

A schema enum would therefore add no security while breaking legitimately divergent values already in circulation. Both attacks are pinned as regression tests; the rationale is in SPEC §3.1, and SPEC §8.2 records that any future unification of this field is signature-breaking and needs a migration path rather than an in-place rewrite.

Verification on this public base

  • 568 tests greentest_pct + test_verify + test_tamper_evidence, verifier isolation guard included
  • Diff re-verified after cherry-pick: exactly the same 20 files, no unrelated lane code, no version files
  • TS-1..TS-4 screen: 0 hits

Governance

Private-first per ABSOLUTE RULE #0: private PR #318 opened, reviewed, and merged first; this public PR carries the feature commit only. Sentinel (2-pass adversarial) APPROVE 89%, 0 blockers — pass 1 blocked on a real installed-wheel path bug that is fixed and regression-pinned, and on two further claims that were refuted by measurement. Plan plan_60634c1a · lesson lesson_20260727T190027.

🤖 Generated with Claude Code

Publish the proof-bundle envelope, the trusted-key manifest, and the
verify-result contract as versioned JSON Schemas + prose, plus a
conformance corpus any third-party verifier must classify identically.

Spec version (1.0) is decoupled from the SDK version. Schemas and corpus
ship in the wheel and load via importlib.resources, so an external
implementer can build a conformant verifier from the published artifacts
alone -- verified by running all 9 cases from an installed wheel at a
neutral cwd.

Corpus covers all 7 VerifyFailure members plus the exit-2 usage path.
Expectations are empirically derived from the reference implementation,
and each case asserts the typed failure, the process exit code, and the
absent-vs-false check semantics.

Additive: no signing or verification logic changed. proof_format_version
is published as an opaque, signature-covered string -- it sits inside
both the signed preimage and the leaf hash, so forging it fails closed
(measured: wrapper-only -> UNTRUSTED_KID, wrapper+record -> TAMPERED_LEAF).
Unifying its three divergent in-tree values is deferred to R2 and would
be signature-breaking; documented in SPEC 8.2.

Sentinel: pass 1 BLOCK (3 blockers + 3 majors). Every finding reproduced
before action -- the installed-wheel path bug was real and is fixed; the
hatchling-artifacts and unconstrained-version blockers were refuted by
measurement. Pass 2 APPROVE 89%, 0 blockers. TS-1..TS-4 screen: 0 hits.
568 tests green across test_pct + test_verify + test_tamper_evidence,
verifier isolation guard included.

Plan: plan_60634c1a
@github-actions

Copy link
Copy Markdown

🛡️ GraQle PR Guardian

💥 Blast Radius: 20 modules affected

Module Files Changed Risk Level Impact Radius
graqle 18 🟠 T3 18
pyproject.toml 1 🟡 T2 1
tests 1 🟢 T1 1

Total blast radius: 20


🏛️ Governance Verdict

🚫 FAIL

  • T3: 5 file(s) require explicit approval.

🔍 SHACL Violations

No SHACL violations detected.


🔐 Approval Requirements

This PR requires approval from: T3

  • A registered Tech Lead or Governance Admin must approve.

Approval requirement NOT yet satisfied.


Metric Value
Blast Radius 20
Files Analyzed 20
Blocked 5
SHACL Violations 0
Verdict FAIL

🔬 Powered by GraQle PR Guardian v0.1.0 · Scan completed 2026-07-27T20:35:19.476493+00:00

@harishquantamix
harishquantamix merged commit 2821feb into master Jul 27, 2026
19 of 20 checks passed
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