Skip to content

Commit 4620e61

Browse files
authored
Add Proof Pack v0.1 for DecisionRecord authority-before-mutation
1 parent 4a1462c commit 4620e61

11 files changed

Lines changed: 776 additions & 0 deletions
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"decision_id": "dr_expired_001",
3+
"actor_id": "agent_17",
4+
"action": "approve_invoice",
5+
"object_id": "invoice_778",
6+
"environment": "prod",
7+
"commit_hash": "sha256:abc123",
8+
"verdict": "ALLOW",
9+
"policy_version": "2026-04-27.1",
10+
"issued_at": "2026-04-27T04:00:00Z",
11+
"expires_at": "2026-04-27T04:05:00Z",
12+
"nonce": "nonce_expired_001",
13+
"signature": "sig_valid"
14+
}

demo/replayed_nonce_refusal.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"decision_id": "dr_replay_001",
3+
"actor_id": "agent_17",
4+
"action": "approve_invoice",
5+
"object_id": "invoice_778",
6+
"environment": "prod",
7+
"commit_hash": "sha256:abc123",
8+
"verdict": "ALLOW",
9+
"policy_version": "2026-04-27.1",
10+
"issued_at": "2026-04-27T05:00:00Z",
11+
"expires_at": "2026-04-27T05:05:00Z",
12+
"nonce": "nonce_already_used_001",
13+
"signature": "sig_valid"
14+
}

demo/scope_mismatch_refusal.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"decision_id": "dr_scope_001",
3+
"actor_id": "agent_17",
4+
"action": "approve_invoice",
5+
"object_id": "invoice_OTHER",
6+
"environment": "prod",
7+
"commit_hash": "sha256:abc123",
8+
"verdict": "ALLOW",
9+
"policy_version": "2026-04-27.1",
10+
"issued_at": "2026-04-27T05:00:00Z",
11+
"expires_at": "2026-04-27T05:05:00Z",
12+
"nonce": "nonce_scope_001",
13+
"signature": "sig_valid"
14+
}

demo/valid_decision_record.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"decision_id": "dr_valid_001",
3+
"actor_id": "agent_17",
4+
"action": "approve_invoice",
5+
"object_id": "invoice_778",
6+
"environment": "prod",
7+
"commit_hash": "sha256:abc123",
8+
"verdict": "ALLOW",
9+
"policy_version": "2026-04-27.1",
10+
"issued_at": "2026-04-27T05:00:00Z",
11+
"expires_at": "2026-04-27T05:05:00Z",
12+
"nonce": "nonce_valid_001",
13+
"signature": "sig_valid"
14+
}

docs/PROOF_PACK_v0.1.md

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Proof Pack v0.1 — Authority-Before-Mutation
2+
3+
Bounded public proof that, on the demonstrated CommitGate path, state
4+
mutation is refused unless the attached `DecisionRecord` is valid,
5+
scoped, unexpired, signed, and unreplayed — and that every refusal
6+
produces an inspectable receipt.
7+
8+
## How to run in 60 seconds
9+
10+
```bash
11+
git clone https://github.com/LalaSkye/commit-gate-core.git
12+
cd commit-gate-core
13+
python3 scripts/run_proof_pack.py
14+
python3 scripts/verify_receipt.py
15+
```
16+
17+
No install step. Stdlib only. The runner exercises four cases through
18+
the existing kernel at `src/commit_gate_core/gate.py`:
19+
20+
| Case | Demo fixture | Expected | Receipt |
21+
| --- | --- | --- | --- |
22+
| valid DecisionRecord | `demo/valid_decision_record.json` | ALLOW | `receipts/examples/allow_receipt.json` |
23+
| expired authority | `demo/expired_authority_refusal.json` | DENY_EXPIRED | `receipts/examples/deny_expired_receipt.json` |
24+
| scope mismatch | `demo/scope_mismatch_refusal.json` | DENY_SCOPE | `receipts/examples/deny_scope_receipt.json` |
25+
| replayed nonce | `demo/replayed_nonce_refusal.json` | DENY_REPLAY | `receipts/examples/deny_replay_receipt.json` |
26+
27+
## Expected output
28+
29+
`scripts/run_proof_pack.py` prints, for each case: case name, expected
30+
result, actual result, receipt path, receipt hash, mutation occurred
31+
(`YES` / `NO`). The run ends with:
32+
33+
```text
34+
All four cases pass: YES
35+
```
36+
37+
`scripts/verify_receipt.py` then checks each receipt in
38+
`receipts/examples/` against five gates:
39+
40+
1. `receipt_hash_integrity` — sha256 over the receipt minus
41+
`receipt_hash` matches the stored value
42+
2. `input_hash` — the hash of the input DecisionRecord is present and
43+
well-formed
44+
3. `decision_result``actual_result` matches `expected_result`
45+
4. `refusal_reason` — present and non-empty on DENY receipts, `null`
46+
on ALLOW receipts
47+
5. `no_execution_marker``no_execution_marker` is the inverse of
48+
`mutation_occurred`; DENY receipts must show `mutation_occurred=false`
49+
50+
A clean run ends with:
51+
52+
```text
53+
All receipts verified: YES
54+
```
55+
56+
## What this proves
57+
58+
On the demonstrated CommitGate path:
59+
60+
- A signed, scoped, unexpired, unreplayed `DecisionRecord` is a hard
61+
precondition for the mutation callback to run.
62+
- Each of the four failure modes — `DECISION_EXPIRED`,
63+
`SCOPE_MISMATCH:object_id`, `NONCE_REPLAYED`, and the ALLOW happy
64+
path — flows through the kernel in `src/commit_gate_core/gate.py`
65+
and produces a distinct, content-addressed receipt with an explicit
66+
no-execution marker.
67+
- Refusal receipts can be inspected independently by
68+
`scripts/verify_receipt.py` without re-running the gate.
69+
70+
The receipts and DecisionRecord fixtures live in version control, so
71+
the evidence object is reproducible byte-for-byte.
72+
73+
## What this does not prove
74+
75+
- Production readiness, certification, or compliance.
76+
- Adoption, deployment, or coverage outside this repository.
77+
- Universal runtime governance, path-universal enforcement, or
78+
non-bypassability outside the demonstrated path.
79+
- Real cryptographic signature verification — the bundled
80+
`AcceptingSignatureVerifier` is synthetic and treats
81+
`signature == "sig_valid"` as signed for the purpose of the bounded
82+
surface.
83+
- Real persistent nonce ledgers, atomic commit across systems, or
84+
downstream side-effect prevention beyond the in-process callback.
85+
86+
## Claim boundary
87+
88+
This proof pack demonstrates that, on the shown path, state mutation
89+
is refused unless a DecisionRecord is valid, scoped, unexpired, signed,
90+
and unreplayed; each refusal produces an inspectable receipt.
91+
92+
This is not production infrastructure, certification, adoption
93+
evidence, or universal runtime governance. It is a bounded proof
94+
surface for authority-before-mutation.
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"actual_result": "ALLOW",
3+
"case_name": "valid_decision_record",
4+
"claim_boundary": "bounded proof surface for authority-before-mutation on the demonstrated CommitGate path; not production, not certification, not universal runtime governance",
5+
"decision_id": "dr_valid_001",
6+
"expected_result": "ALLOW",
7+
"gate_audit_event": {
8+
"allowed": true,
9+
"attempted": {
10+
"action": "approve_invoice",
11+
"actor_id": "agent_17",
12+
"commit_hash": "sha256:abc123",
13+
"environment": "prod",
14+
"object_id": "invoice_778"
15+
},
16+
"code": "ALLOW",
17+
"decision_id": "dr_valid_001",
18+
"event_type": "GATE_EVALUATION",
19+
"record_scope": {
20+
"action": "approve_invoice",
21+
"actor_id": "agent_17",
22+
"commit_hash": "sha256:abc123",
23+
"environment": "prod",
24+
"object_id": "invoice_778",
25+
"policy_version": "2026-04-27.1"
26+
},
27+
"timestamp": "2026-04-27T05:01:00Z"
28+
},
29+
"input_hash": "sha256:d2d4ced3301d5710dbc556a3288b4291a385667cdb2c1242f37f21617d5d30d8",
30+
"mutation_occurred": true,
31+
"no_execution_marker": false,
32+
"receipt_hash": "sha256:62bcaa6694c5b622c96005567d9f498e6307347caeb11533c88d71be20011a01",
33+
"receipt_id": "RCP-PP-valid_decision_record",
34+
"refusal_reason": null,
35+
"schema_version": "proof-pack-v0.1",
36+
"timestamp": "2026-04-27T05:01:00Z"
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"actual_result": "DENY",
3+
"case_name": "expired_authority",
4+
"claim_boundary": "bounded proof surface for authority-before-mutation on the demonstrated CommitGate path; not production, not certification, not universal runtime governance",
5+
"decision_id": "dr_expired_001",
6+
"expected_result": "DENY_EXPIRED",
7+
"gate_audit_event": {
8+
"allowed": false,
9+
"attempted": {
10+
"action": "approve_invoice",
11+
"actor_id": "agent_17",
12+
"commit_hash": "sha256:abc123",
13+
"environment": "prod",
14+
"object_id": "invoice_778"
15+
},
16+
"code": "DENY:DECISION_EXPIRED",
17+
"decision_id": "dr_expired_001",
18+
"event_type": "GATE_EVALUATION",
19+
"record_scope": {
20+
"action": "approve_invoice",
21+
"actor_id": "agent_17",
22+
"commit_hash": "sha256:abc123",
23+
"environment": "prod",
24+
"object_id": "invoice_778",
25+
"policy_version": "2026-04-27.1"
26+
},
27+
"timestamp": "2026-04-27T05:01:00Z"
28+
},
29+
"input_hash": "sha256:d7cbe91680199adbee2f80c3a8a1f444c4f0062f1ac602d31f74ef3d78fcec1c",
30+
"mutation_occurred": false,
31+
"no_execution_marker": true,
32+
"receipt_hash": "sha256:d2aeafaeb1c19747b26535226fdff51a655b9cec1e651f452ad5569e53b922b8",
33+
"receipt_id": "RCP-PP-expired_authority",
34+
"refusal_reason": "DENY:DECISION_EXPIRED",
35+
"schema_version": "proof-pack-v0.1",
36+
"timestamp": "2026-04-27T05:01:00Z"
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"actual_result": "DENY",
3+
"case_name": "replayed_nonce",
4+
"claim_boundary": "bounded proof surface for authority-before-mutation on the demonstrated CommitGate path; not production, not certification, not universal runtime governance",
5+
"decision_id": "dr_replay_001",
6+
"expected_result": "DENY_REPLAY",
7+
"gate_audit_event": {
8+
"allowed": false,
9+
"attempted": {
10+
"action": "approve_invoice",
11+
"actor_id": "agent_17",
12+
"commit_hash": "sha256:abc123",
13+
"environment": "prod",
14+
"object_id": "invoice_778"
15+
},
16+
"code": "DENY:NONCE_REPLAYED",
17+
"decision_id": "dr_replay_001",
18+
"event_type": "GATE_EVALUATION",
19+
"record_scope": {
20+
"action": "approve_invoice",
21+
"actor_id": "agent_17",
22+
"commit_hash": "sha256:abc123",
23+
"environment": "prod",
24+
"object_id": "invoice_778",
25+
"policy_version": "2026-04-27.1"
26+
},
27+
"timestamp": "2026-04-27T05:01:00Z"
28+
},
29+
"input_hash": "sha256:058e73ce7516134fe86b8a33a9307ca3d290ecfc9175828a071c29c065e909c5",
30+
"mutation_occurred": false,
31+
"no_execution_marker": true,
32+
"receipt_hash": "sha256:026f1d52a19772a295e421e671763100afb9d65dffb2ecac02cd6f583fcf8703",
33+
"receipt_id": "RCP-PP-replayed_nonce",
34+
"refusal_reason": "DENY:NONCE_REPLAYED",
35+
"schema_version": "proof-pack-v0.1",
36+
"timestamp": "2026-04-27T05:01:00Z"
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"actual_result": "DENY",
3+
"case_name": "scope_mismatch",
4+
"claim_boundary": "bounded proof surface for authority-before-mutation on the demonstrated CommitGate path; not production, not certification, not universal runtime governance",
5+
"decision_id": "dr_scope_001",
6+
"expected_result": "DENY_SCOPE",
7+
"gate_audit_event": {
8+
"allowed": false,
9+
"attempted": {
10+
"action": "approve_invoice",
11+
"actor_id": "agent_17",
12+
"commit_hash": "sha256:abc123",
13+
"environment": "prod",
14+
"object_id": "invoice_778"
15+
},
16+
"code": "DENY:SCOPE_MISMATCH:object_id",
17+
"decision_id": "dr_scope_001",
18+
"event_type": "GATE_EVALUATION",
19+
"record_scope": {
20+
"action": "approve_invoice",
21+
"actor_id": "agent_17",
22+
"commit_hash": "sha256:abc123",
23+
"environment": "prod",
24+
"object_id": "invoice_OTHER",
25+
"policy_version": "2026-04-27.1"
26+
},
27+
"timestamp": "2026-04-27T05:01:00Z"
28+
},
29+
"input_hash": "sha256:5119a21c49e3c1d631689ff174241af42b5439f3f266ef7cc5302d02359fd346",
30+
"mutation_occurred": false,
31+
"no_execution_marker": true,
32+
"receipt_hash": "sha256:7a2404f44917d8af894613a1208510ce98970657d90b2a64ff43d292945bd6ab",
33+
"receipt_id": "RCP-PP-scope_mismatch",
34+
"refusal_reason": "DENY:SCOPE_MISMATCH:object_id",
35+
"schema_version": "proof-pack-v0.1",
36+
"timestamp": "2026-04-27T05:01:00Z"
37+
}

0 commit comments

Comments
 (0)