@conarium-ai/core 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +131 -0
- package/LICENSE +21 -0
- package/README.md +387 -0
- package/SECURITY.md +226 -0
- package/bin/conarium-anchor-service.mjs +77 -0
- package/bin/conarium-anchor-upgrade.mjs +108 -0
- package/bin/conarium-coverage.mjs +425 -0
- package/bin/conarium-doctor.mjs +480 -0
- package/bin/conarium-init.mjs +184 -0
- package/bin/conarium-reconcile.mjs +441 -0
- package/bin/conarium-stamp.mjs +161 -0
- package/bin/conarium-verify.mjs +610 -0
- package/conarium.config.json +43 -0
- package/deploy/anchor-service/README.md +79 -0
- package/deploy/anchor-service/conarium-anchor.service +21 -0
- package/deploy/anchor-service/dry-run.mjs +122 -0
- package/deploy/anchor-service/ecosystem.config.cjs +21 -0
- package/deploy/anchor-service/env.example +11 -0
- package/dist/anchor-service.d.ts +39 -0
- package/dist/anchor-service.d.ts.map +1 -0
- package/dist/anchor-service.js +278 -0
- package/dist/anchor-service.js.map +1 -0
- package/dist/anchor.d.ts +123 -0
- package/dist/anchor.d.ts.map +1 -0
- package/dist/anchor.js +246 -0
- package/dist/anchor.js.map +1 -0
- package/dist/audit-hash.d.ts +4 -0
- package/dist/audit-hash.d.ts.map +1 -0
- package/dist/audit-hash.js +12 -0
- package/dist/audit-hash.js.map +1 -0
- package/dist/audit.d.ts +104 -0
- package/dist/audit.d.ts.map +1 -0
- package/dist/audit.js +391 -0
- package/dist/audit.js.map +1 -0
- package/dist/config.d.ts +273 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +44 -0
- package/dist/config.js.map +1 -0
- package/dist/connectors/docs.d.ts +23 -0
- package/dist/connectors/docs.d.ts.map +1 -0
- package/dist/connectors/docs.js +140 -0
- package/dist/connectors/docs.js.map +1 -0
- package/dist/connectors/index.d.ts +10 -0
- package/dist/connectors/index.d.ts.map +1 -0
- package/dist/connectors/index.js +37 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors/jira.d.ts +16 -0
- package/dist/connectors/jira.d.ts.map +1 -0
- package/dist/connectors/jira.js +67 -0
- package/dist/connectors/jira.js.map +1 -0
- package/dist/connectors/openapi.d.ts +28 -0
- package/dist/connectors/openapi.d.ts.map +1 -0
- package/dist/connectors/openapi.js +447 -0
- package/dist/connectors/openapi.js.map +1 -0
- package/dist/connectors/postgres.d.ts +17 -0
- package/dist/connectors/postgres.d.ts.map +1 -0
- package/dist/connectors/postgres.js +131 -0
- package/dist/connectors/postgres.js.map +1 -0
- package/dist/connectors/slack.d.ts +16 -0
- package/dist/connectors/slack.d.ts.map +1 -0
- package/dist/connectors/slack.js +65 -0
- package/dist/connectors/slack.js.map +1 -0
- package/dist/connectors/supabase_rest.d.ts +35 -0
- package/dist/connectors/supabase_rest.d.ts.map +1 -0
- package/dist/connectors/supabase_rest.js +153 -0
- package/dist/connectors/supabase_rest.js.map +1 -0
- package/dist/connectors/zion.d.ts +24 -0
- package/dist/connectors/zion.d.ts.map +1 -0
- package/dist/connectors/zion.js +76 -0
- package/dist/connectors/zion.js.map +1 -0
- package/dist/console.d.ts +30 -0
- package/dist/console.d.ts.map +1 -0
- package/dist/console.js +257 -0
- package/dist/console.js.map +1 -0
- package/dist/coverage.d.ts +100 -0
- package/dist/coverage.d.ts.map +1 -0
- package/dist/coverage.js +175 -0
- package/dist/coverage.js.map +1 -0
- package/dist/executor.d.ts +12 -0
- package/dist/executor.d.ts.map +1 -0
- package/dist/executor.js +77 -0
- package/dist/executor.js.map +1 -0
- package/dist/governance.d.ts +124 -0
- package/dist/governance.d.ts.map +1 -0
- package/dist/governance.js +977 -0
- package/dist/governance.js.map +1 -0
- package/dist/http.d.ts +48 -0
- package/dist/http.d.ts.map +1 -0
- package/dist/http.js +221 -0
- package/dist/http.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +25 -0
- package/dist/index.js.map +1 -0
- package/dist/keys.d.ts +51 -0
- package/dist/keys.d.ts.map +1 -0
- package/dist/keys.js +174 -0
- package/dist/keys.js.map +1 -0
- package/dist/license.d.ts +35 -0
- package/dist/license.d.ts.map +1 -0
- package/dist/license.js +122 -0
- package/dist/license.js.map +1 -0
- package/dist/llm-gate.d.ts +17 -0
- package/dist/llm-gate.d.ts.map +1 -0
- package/dist/llm-gate.js +19 -0
- package/dist/llm-gate.js.map +1 -0
- package/dist/openapi_connector.d.ts +6 -0
- package/dist/openapi_connector.d.ts.map +1 -0
- package/dist/openapi_connector.js +145 -0
- package/dist/openapi_connector.js.map +1 -0
- package/dist/pseudonymize.d.ts +19 -0
- package/dist/pseudonymize.d.ts.map +1 -0
- package/dist/pseudonymize.js +25 -0
- package/dist/pseudonymize.js.map +1 -0
- package/dist/rate_limit.d.ts +41 -0
- package/dist/rate_limit.d.ts.map +1 -0
- package/dist/rate_limit.js +66 -0
- package/dist/rate_limit.js.map +1 -0
- package/dist/receipt.d.ts +161 -0
- package/dist/receipt.d.ts.map +1 -0
- package/dist/receipt.js +210 -0
- package/dist/receipt.js.map +1 -0
- package/dist/scripts/discover_schema.d.ts +2 -0
- package/dist/scripts/discover_schema.d.ts.map +1 -0
- package/dist/scripts/discover_schema.js +75 -0
- package/dist/scripts/discover_schema.js.map +1 -0
- package/dist/scripts/dogfood_prove.d.ts +2 -0
- package/dist/scripts/dogfood_prove.d.ts.map +1 -0
- package/dist/scripts/dogfood_prove.js +41 -0
- package/dist/scripts/dogfood_prove.js.map +1 -0
- package/dist/search_policy.d.ts +23 -0
- package/dist/search_policy.d.ts.map +1 -0
- package/dist/search_policy.js +79 -0
- package/dist/search_policy.js.map +1 -0
- package/dist/server.d.ts +29 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +379 -0
- package/dist/server.js.map +1 -0
- package/dist/tokens.d.ts +14 -0
- package/dist/tokens.d.ts.map +1 -0
- package/dist/tokens.js +58 -0
- package/dist/tokens.js.map +1 -0
- package/dist/types.d.ts +132 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/docs/ARCHITECTURE.md +42 -0
- package/docs/CONSENT-BINDING-SPEC.md +136 -0
- package/docs/CONSENT-BINDING-SPEC.md.anchors.jsonl +1 -0
- package/docs/PRIOR-ART.md +213 -0
- package/docs/PRIOR-ART.md.anchors.jsonl +3 -0
- package/docs/RECEIPT-SPEC.md +301 -0
- package/docs/RECEIPT-SPEC.md.anchors.jsonl +1 -0
- package/docs/dogfood/2026-07-31-anchor.anchors.jsonl +1 -0
- package/docs/dogfood/2026-08-06-reconcile.md +140 -0
- package/docs/plans/2026-07-02-redteam-harness.md +416 -0
- package/docs/specs/2026-07-02-redteam-harness-design.md +90 -0
- package/docs/superpowers/TODO-gate1-f4.md +23 -0
- package/docs/superpowers/plans/2026-07-29-conarium-receipt-plan.md +200 -0
- package/docs/superpowers/plans/2026-07-29-katman0-kapanis-plan.md +231 -0
- package/docs/superpowers/plans/2026-07-31-per-user-identity.md +667 -0
- package/docs/superpowers/specs/2026-07-29-conarium-receipt-design.md +202 -0
- package/docs/superpowers/specs/2026-07-31-per-user-identity-design.md +144 -0
- package/docs/superpowers/specs/2026-08-01-coverage-proof-design.md +139 -0
- package/docs/superpowers/specs/2026-08-05-receipt-meta-provenance-design.md +116 -0
- package/examples/claude-desktop-config.json +9 -0
- package/examples/cursor-mcp-settings.json +10 -0
- package/package.json +99 -0
- package/scripts/audit-chain-check.mjs +119 -0
- package/scripts/conarium_sabah_brief.mjs +107 -0
- package/scripts/gen-test-vectors.mjs +193 -0
- package/scripts/pg-snapshot.sql +27 -0
- package/scripts/start-mcp-c1.mjs +70 -0
- package/test-vectors/001-single-receipt/receipts.jsonl +1 -0
- package/test-vectors/002-chain-of-three/receipts.jsonl +3 -0
- package/test-vectors/003-tampered-field/receipts.jsonl +1 -0
- package/test-vectors/004-prevhash-break/receipts.jsonl +2 -0
- package/test-vectors/005-seq-gap/receipts.jsonl +2 -0
- package/test-vectors/006-bad-signature/receipts.jsonl +1 -0
- package/test-vectors/007-schema-invalid/receipts.jsonl +1 -0
- package/test-vectors/008-unsigned-no-pubkey/receipts.jsonl +1 -0
- package/test-vectors/009-unsigned-but-pubkey-given/receipts.jsonl +1 -0
- package/test-vectors/README.md +92 -0
- package/test-vectors/expected-hashes.json +24 -0
- package/test-vectors/keys/vector-key.SECRET-TEST-ONLY.pem +6 -0
- package/test-vectors/keys/vector-key.pub.pem +3 -0
- package/test-vectors/keys/vector-key.pub.pem.keyid +1 -0
- package/test-vectors/manifest.json +95 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"conarium-receipt/0.3","id":"01JVECTOR00000000000000001","ts":"2026-01-01T00:00:00.000Z","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-01T00:00:01.000Z"},"actor":{"type":"service","id":"vector-service","assurance":"shared-token"},"model":{"source":"undeclared","provider":null,"name":null,"version":null},"client":{"source":"undeclared","name":null,"version":null},"request":{"tool":"query","argsHash":"sha256:abababababababababababababababababababababababababababababababab"},"dataRefs":[{"source":"vectors","object":"public.demo","fields":["id","name"]}],"policy":{"id":"conarium.policy/vectors","decision":"allow","rules":["mask:name"]},"flags":[],"masking":{"pii":1},"outcome":{"status":"complete","rows":2},"consentRef":null,"chain":{"seq":1,"prevHash":"sha256:0000000000000000000000000000000000000000000000000000000000000000","hash":"sha256:dbbbd3139923cdf7f854283b495386526de0629a71dc4d5407a3a810ee3e1847"},"sig":{"alg":"Ed25519","keyId":"cnr-vectors","value":"slapCMZcuMJpg5IwxVmzU5MCH3c9qDZOTdyeW+HqCQ42tNzkEq1pnlVheI6KQoAZ+2BLYik69iEnFyXYydA9AQ=="},"anchor":null}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"conarium-receipt/0.3","id":"01JVECTOR00000000000000001","ts":"2026-01-01T00:00:00.000Z","period":{"start":"2026-01-01T00:00:00.000Z","end":"2026-01-01T00:00:01.000Z"},"actor":{"type":"service","id":"vector-service","assurance":"shared-token"},"model":{"source":"undeclared","provider":null,"name":null,"version":null},"client":{"source":"undeclared","name":null,"version":null},"request":{"tool":"query","argsHash":"sha256:abababababababababababababababababababababababababababababababab"},"dataRefs":[{"source":"vectors","object":"public.demo","fields":["id","name"]}],"flags":[],"masking":{"pii":1},"outcome":{"status":"complete","rows":2},"consentRef":null,"chain":{"seq":1,"prevHash":"sha256:0000000000000000000000000000000000000000000000000000000000000000","hash":"sha256:dbbbd3139923cdf7f854283b495386526de0629a71dc4d5407a3a810ee3e1847"},"sig":{"alg":"Ed25519","keyId":"cnr-vectors","value":"TVapCMZcuMJpg5IwxVmzU5MCH3c9qDZOTdyeW+HqCQ42tNzkEq1pnlVheI6KQoAZ+2BLYik69iEnFyXYydA9AQ=="},"anchor":null}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"conarium-receipt/0.3","id":"01JVECTOR00000000000000005","ts":"2026-01-05T00:00:00.000Z","period":{"start":"2026-01-05T00:00:00.000Z","end":"2026-01-05T00:00:01.000Z"},"actor":{"type":"service","id":"vector-service","assurance":"shared-token"},"model":{"source":"undeclared","provider":null,"name":null,"version":null},"client":{"source":"undeclared","name":null,"version":null},"request":{"tool":"query","argsHash":"sha256:abababababababababababababababababababababababababababababababab"},"dataRefs":[{"source":"vectors","object":"public.demo","fields":["id","name"]}],"policy":{"id":"conarium.policy/vectors","decision":"allow","rules":["mask:name"]},"flags":[],"masking":{"pii":1},"outcome":{"status":"complete","rows":2},"consentRef":null,"chain":{"seq":1,"prevHash":"sha256:0000000000000000000000000000000000000000000000000000000000000000","hash":"sha256:352fe3f2fd34891f73b33255e4528a9b891cdafc8a1300aeaf3956244b84c461"},"sig":null,"anchor":null}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"v":"conarium-receipt/0.3","id":"01JVECTOR00000000000000005","ts":"2026-01-05T00:00:00.000Z","period":{"start":"2026-01-05T00:00:00.000Z","end":"2026-01-05T00:00:01.000Z"},"actor":{"type":"service","id":"vector-service","assurance":"shared-token"},"model":{"source":"undeclared","provider":null,"name":null,"version":null},"client":{"source":"undeclared","name":null,"version":null},"request":{"tool":"query","argsHash":"sha256:abababababababababababababababababababababababababababababababab"},"dataRefs":[{"source":"vectors","object":"public.demo","fields":["id","name"]}],"policy":{"id":"conarium.policy/vectors","decision":"allow","rules":["mask:name"]},"flags":[],"masking":{"pii":1},"outcome":{"status":"complete","rows":2},"consentRef":null,"chain":{"seq":1,"prevHash":"sha256:0000000000000000000000000000000000000000000000000000000000000000","hash":"sha256:352fe3f2fd34891f73b33255e4528a9b891cdafc8a1300aeaf3956244b84c461"},"sig":null,"anchor":null}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Conarium Receipt — conformance vectors
|
|
2
|
+
|
|
3
|
+
Frozen inputs and expected results for anyone implementing or checking a
|
|
4
|
+
Conarium Receipt verifier. Nine cases, one public key, one manifest.
|
|
5
|
+
|
|
6
|
+
A specification that cannot be implemented from the document alone is a blog
|
|
7
|
+
post. These vectors are the difference.
|
|
8
|
+
|
|
9
|
+
## Run them
|
|
10
|
+
|
|
11
|
+
Against this repository's verifier:
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
npm run build && npm run test:vectors
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Against your own implementation: read `manifest.json`, feed each case's
|
|
18
|
+
`receipts.jsonl` to your verifier with the listed arguments, and compare the
|
|
19
|
+
exit code. Nothing else is required — no network, no server, no account.
|
|
20
|
+
|
|
21
|
+
```json
|
|
22
|
+
{
|
|
23
|
+
"name": "003-tampered-field",
|
|
24
|
+
"args": ["--pubkey", "KEYS/vector-key.pub.pem"],
|
|
25
|
+
"exitCode": 10
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
`KEYS/` resolves to `test-vectors/keys/`.
|
|
30
|
+
|
|
31
|
+
## The cases
|
|
32
|
+
|
|
33
|
+
| Case | What it is | Exit |
|
|
34
|
+
|---|---|---|
|
|
35
|
+
| 001-single-receipt | One valid signed receipt | 0 |
|
|
36
|
+
| 002-chain-of-three | Three receipts linked by `prevHash` | 0 |
|
|
37
|
+
| 003-tampered-field | `outcome.rows` edited after signing | 10 |
|
|
38
|
+
| 004-prevhash-break | Middle receipt deleted | 11 |
|
|
39
|
+
| 005-seq-gap | `seq` jumps 1 → 7 while `prevHash` still links | 12 |
|
|
40
|
+
| 006-bad-signature | One byte of the signature flipped | 13 |
|
|
41
|
+
| 007-schema-invalid | `policy` removed — not a receipt at all | 20 |
|
|
42
|
+
| 008-unsigned-no-pubkey | Unsigned receipt, no `--pubkey` given | 13 |
|
|
43
|
+
| 009-unsigned-but-pubkey-given | Unsigned receipt, signature demanded | 13 |
|
|
44
|
+
|
|
45
|
+
Exit codes are the ones in [RECEIPT-SPEC.md](../docs/RECEIPT-SPEC.md); the
|
|
46
|
+
drift guard in `test/spec_exitcode_drift.mjs` keeps the two in sync.
|
|
47
|
+
|
|
48
|
+
## Two properties worth pointing at
|
|
49
|
+
|
|
50
|
+
**005 exists because `prevHash` alone is not enough.** The chain still links
|
|
51
|
+
correctly across the gap — only the sequence counter reveals that something is
|
|
52
|
+
missing. A verifier that checks hashes but not `seq` passes this case and is
|
|
53
|
+
wrong.
|
|
54
|
+
|
|
55
|
+
**008 and 009 both return 13, and that is the point.** There is no mode in
|
|
56
|
+
which the verifier reports success on a signature it did not check — not even
|
|
57
|
+
when the caller never asked for one. Silence is not a pass. This vector was
|
|
58
|
+
originally written expecting `0`; the verifier disagreed and the verifier was
|
|
59
|
+
right, so the expectation was corrected rather than the behaviour.
|
|
60
|
+
|
|
61
|
+
## The key, and why the private half is not here
|
|
62
|
+
|
|
63
|
+
`keys/vector-key.pub.pem` is published. The private half is not, and will not
|
|
64
|
+
be. A private key committed to a public repository is a private key that has
|
|
65
|
+
leaked, no matter how loudly the filename shouts otherwise — this project has
|
|
66
|
+
already had one near miss with exactly that, and the rule that came out of it
|
|
67
|
+
holds here too.
|
|
68
|
+
|
|
69
|
+
The cost is that you cannot byte-compare your *signatures* against ours. That
|
|
70
|
+
matters less than it sounds: signing is RFC 8032, implemented correctly by
|
|
71
|
+
every mainstream crypto library, and none of it is ours.
|
|
72
|
+
|
|
73
|
+
What is ours — and what silently breaks between implementations — is the
|
|
74
|
+
canonical form. So `expected-hashes.json` publishes that instead:
|
|
75
|
+
|
|
76
|
+
```
|
|
77
|
+
canonicalise(receipt minus chain.hash, sig, anchor) with JCS (RFC 8785)
|
|
78
|
+
-> SHA-256 -> compare
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
If your hash matches ours, your canonical bytes match ours, which is the only
|
|
82
|
+
thing an interoperable receipt actually requires. Sign it with your own key.
|
|
83
|
+
|
|
84
|
+
## Regenerating — read before you do
|
|
85
|
+
|
|
86
|
+
`scripts/gen-test-vectors.mjs` produced these files. Do not run it to make a
|
|
87
|
+
failing test pass. If a change to this repository breaks a vector, the format
|
|
88
|
+
changed, and that is the signal the vectors exist to raise. Change the code, or
|
|
89
|
+
change the specification and the version string with it.
|
|
90
|
+
|
|
91
|
+
The frozen hash of case 001 is asserted separately in `test/vectors_run.mjs`
|
|
92
|
+
for exactly this reason.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"note": "Canonicalise the receipt with JCS (RFC 8785) excluding chain.hash, sig and anchor, then SHA-256. If your hash matches, your canonical form matches byte for byte.",
|
|
3
|
+
"genesisPrevHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
4
|
+
"receipts": [
|
|
5
|
+
{
|
|
6
|
+
"case": "001-single-receipt",
|
|
7
|
+
"seq": 1,
|
|
8
|
+
"prevHash": "sha256:0000000000000000000000000000000000000000000000000000000000000000",
|
|
9
|
+
"hash": "sha256:dbbbd3139923cdf7f854283b495386526de0629a71dc4d5407a3a810ee3e1847"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"case": "002-chain-of-three",
|
|
13
|
+
"seq": 2,
|
|
14
|
+
"prevHash": "sha256:dbbbd3139923cdf7f854283b495386526de0629a71dc4d5407a3a810ee3e1847",
|
|
15
|
+
"hash": "sha256:56937472179de1567fee9f0b863c7c5d16d8d6b7a8e613e9bf50fb321f82433c"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"case": "002-chain-of-three",
|
|
19
|
+
"seq": 3,
|
|
20
|
+
"prevHash": "sha256:56937472179de1567fee9f0b863c7c5d16d8d6b7a8e613e9bf50fb321f82433c",
|
|
21
|
+
"hash": "sha256:a06a30c3fb4bdbd46bb9400da0815fb3a7007b703cc9cb41208be08413e254c7"
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# TEST VECTOR KEY — PUBLISHED ON PURPOSE, NEVER USE FOR ANYTHING REAL.
|
|
2
|
+
# Anyone reading this repository has the private half. It signs nothing
|
|
3
|
+
# but the frozen vectors in this directory.
|
|
4
|
+
-----BEGIN PRIVATE KEY-----
|
|
5
|
+
MC4CAQAwBQYDK2VwBCIEII/aitZbtkTrKP348FUMbsV6glU6gHFUMUIlHJxP3W62
|
|
6
|
+
-----END PRIVATE KEY-----
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
cnr-vectors
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
{
|
|
2
|
+
"format": "conarium-receipt",
|
|
3
|
+
"versionUnderTest": "conarium-receipt/0.3",
|
|
4
|
+
"keyId": "cnr-vectors",
|
|
5
|
+
"publicKey": "keys/vector-key.pub.pem",
|
|
6
|
+
"note": "Frozen conformance vectors. Run each case through your verifier and compare the exit code. KEYS/ in args resolves to the keys/ directory at the root of test-vectors.",
|
|
7
|
+
"exitCodes": {
|
|
8
|
+
"0": "chain intact, signatures valid",
|
|
9
|
+
"10": "hash mismatch — record altered",
|
|
10
|
+
"11": "prevHash break — deleted or inserted",
|
|
11
|
+
"12": "seq gap / non-increasing",
|
|
12
|
+
"13": "signature invalid or missing while a pubkey was supplied",
|
|
13
|
+
"20": "schema invalid"
|
|
14
|
+
},
|
|
15
|
+
"cases": [
|
|
16
|
+
{
|
|
17
|
+
"name": "001-single-receipt",
|
|
18
|
+
"description": "One valid signed receipt. The smallest passing case.",
|
|
19
|
+
"exitCode": 0,
|
|
20
|
+
"args": [
|
|
21
|
+
"--pubkey",
|
|
22
|
+
"KEYS/vector-key.pub.pem"
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"name": "002-chain-of-three",
|
|
27
|
+
"description": "Three receipts linked by prevHash. Contiguous, all signed.",
|
|
28
|
+
"exitCode": 0,
|
|
29
|
+
"args": [
|
|
30
|
+
"--pubkey",
|
|
31
|
+
"KEYS/vector-key.pub.pem"
|
|
32
|
+
]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "003-tampered-field",
|
|
36
|
+
"description": "outcome.rows changed from 2 to 999 after signing. The stored hash no longer matches the body.",
|
|
37
|
+
"exitCode": 10,
|
|
38
|
+
"args": [
|
|
39
|
+
"--pubkey",
|
|
40
|
+
"KEYS/vector-key.pub.pem"
|
|
41
|
+
]
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"name": "004-prevhash-break",
|
|
45
|
+
"description": "The middle receipt of the chain was deleted. #3 points at a hash that is no longer present.",
|
|
46
|
+
"exitCode": 11,
|
|
47
|
+
"args": [
|
|
48
|
+
"--pubkey",
|
|
49
|
+
"KEYS/vector-key.pub.pem"
|
|
50
|
+
]
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "005-seq-gap",
|
|
54
|
+
"description": "seq jumps 1 -> 7. prevHash still links, so only the counter reveals the gap.",
|
|
55
|
+
"exitCode": 12,
|
|
56
|
+
"args": [
|
|
57
|
+
"--pubkey",
|
|
58
|
+
"KEYS/vector-key.pub.pem"
|
|
59
|
+
]
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "006-bad-signature",
|
|
63
|
+
"description": "First byte of the signature flipped. Body and hash are untouched — only the signature is wrong.",
|
|
64
|
+
"exitCode": 13,
|
|
65
|
+
"args": [
|
|
66
|
+
"--pubkey",
|
|
67
|
+
"KEYS/vector-key.pub.pem"
|
|
68
|
+
]
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "007-schema-invalid",
|
|
72
|
+
"description": "policy removed. The verifier must reject the shape before it trusts anything else in the file.",
|
|
73
|
+
"exitCode": 20,
|
|
74
|
+
"args": [
|
|
75
|
+
"--pubkey",
|
|
76
|
+
"KEYS/vector-key.pub.pem"
|
|
77
|
+
]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"name": "008-unsigned-no-pubkey",
|
|
81
|
+
"description": "An unsigned receipt, verified without --pubkey. Hash and chain are intact, yet the answer is still 13: the verifier never reports success on a signature it did not check.",
|
|
82
|
+
"exitCode": 13,
|
|
83
|
+
"args": []
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"name": "009-unsigned-but-pubkey-given",
|
|
87
|
+
"description": "The same unsigned receipt, but the caller asked for signature verification. Fail-closed: a missing signature is not a passing signature.",
|
|
88
|
+
"exitCode": 13,
|
|
89
|
+
"args": [
|
|
90
|
+
"--pubkey",
|
|
91
|
+
"KEYS/vector-key.pub.pem"
|
|
92
|
+
]
|
|
93
|
+
}
|
|
94
|
+
]
|
|
95
|
+
}
|