contracts: Receipt v1 schema, canonicalization, verify rules, test vectors

This commit is contained in:
Vault Sovereign
2025-12-26 23:13:34 +00:00
commit a43526f768
7 changed files with 299 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
{
"reason": "test vector signed",
"receipt_version": "1",
"created_at": "2025-01-02T03:04:05.000Z",
"source": "mcp",
"action": "plans.apply",
"target": {
"id": "srv-9",
"ip": null,
"name": "beta"
},
"request": {
"method": "POST",
"path": "/apply",
"body": {
"plan": {
"steps": [
{
"value": "prod",
"path": "/labels/env",
"op": "set"
},
{
"path": "/labels/tmp",
"op": "delete"
}
]
}
}
},
"response": {
"data": {
"applied": true
},
"status": 201,
"ok": true,
"raw": "{\"applied\":true}"
},
"prev_blake3": null,
"hash_alg": "blake3+sha256",
"blake3": "7b25a1668e700c0096dcca33467b89d22cdf7ea635d59f3c692e97153459672a",
"sha256": "237c298f88821d4938f8909012dd8128d062245e480285d605ad146a868bec14",
"plan_file": "plans/test.json",
"plan_blake3": "1111111111111111111111111111111111111111111111111111111111111111",
"plan_sha256": "2222222222222222222222222222222222222222222222222222222222222222",
"lock_file": "/tmp/vm.lock",
"lock_started_at": "2025-01-02T03:00:00.000Z",
"force": true,
"cwd": "/work",
"user": "builder",
"hostname": "vector-host",
"argv": [
"mcp",
"apply",
"--force"
],
"sig_alg": "ed25519",
"signer_pub": "8ac2f516b7138e99a183e56196d3f332e44ff15d8fd388f1807db0db5dc2eaac",
"signature": "041e36a549623bd8e342bf8363f466e7d49de6de673ab4747bd3f4b2396e075f8b3f311293f64fd1faf6e8c49b267808e3542095adad87f74bf1e2722d629605",
"signed_at": "2025-01-02T03:04:06.000Z"
}