@conarium-ai/core 0.2.20 → 0.2.21

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/README.md +8 -3
  3. package/bin/conarium-doctor.mjs +46 -2
  4. package/conformance/KNOWN-GAPS.md +20 -0
  5. package/conformance/README.md +85 -0
  6. package/conformance/adapters/README.md +59 -0
  7. package/conformance/adapters/conarium.mjs +17 -0
  8. package/conformance/cases/coverage/expect-count-pin.json +13 -0
  9. package/conformance/cases/coverage/tail-without-pin.json +15 -0
  10. package/conformance/cases/evidence/001-single-receipt.json +16 -0
  11. package/conformance/cases/evidence/002-chain-of-three.json +16 -0
  12. package/conformance/cases/evidence/003-tampered-field.json +16 -0
  13. package/conformance/cases/evidence/004-prevhash-break.json +16 -0
  14. package/conformance/cases/evidence/005-seq-gap.json +16 -0
  15. package/conformance/cases/evidence/006-bad-signature.json +16 -0
  16. package/conformance/cases/evidence/007-schema-invalid.json +16 -0
  17. package/conformance/cases/evidence/008-unsigned-no-pubkey.json +13 -0
  18. package/conformance/cases/evidence/009-unsigned-but-pubkey-given.json +16 -0
  19. package/conformance/cases/gate/deny-alias.json +13 -0
  20. package/conformance/cases/gate/deny-case-fold.json +13 -0
  21. package/conformance/cases/gate/deny-comment-between.json +13 -0
  22. package/conformance/cases/gate/deny-cte.json +13 -0
  23. package/conformance/cases/gate/deny-join.json +13 -0
  24. package/conformance/cases/gate/deny-plain.json +13 -0
  25. package/conformance/cases/gate/deny-quoted-lower.json +13 -0
  26. package/conformance/cases/gate/deny-schema-qualify.json +13 -0
  27. package/conformance/cases/gate/deny-string-agg.json +13 -0
  28. package/conformance/cases/gate/deny-subquery.json +13 -0
  29. package/conformance/cases/gate/deny-unqualified.json +13 -0
  30. package/conformance/cases/gate/deny-updlock.json +13 -0
  31. package/conformance/cases/gate/deny-user-fn.json +13 -0
  32. package/conformance/cases/gate/fail-empty.json +13 -0
  33. package/conformance/cases/gate/fail-garbage.json +13 -0
  34. package/conformance/cases/gate/fail-two-statements.json +13 -0
  35. package/conformance/cases/gate/write-copy.json +13 -0
  36. package/conformance/cases/gate/write-create.json +13 -0
  37. package/conformance/cases/gate/write-delete.json +13 -0
  38. package/conformance/cases/gate/write-drop.json +13 -0
  39. package/conformance/cases/gate/write-insert.json +13 -0
  40. package/conformance/cases/gate/write-merge.json +13 -0
  41. package/conformance/cases/gate/write-truncate.json +13 -0
  42. package/conformance/cases/gate/write-update.json +13 -0
  43. package/conformance/cases/inference/cohort-narrowing.json +13 -0
  44. package/conformance/cases/inference/count-channel.json +13 -0
  45. package/conformance/cases/inference/exists-channel.json +13 -0
  46. package/conformance/cases/inference/repeated-probe.json +13 -0
  47. package/conformance/cases/masking/mask-alias.json +14 -0
  48. package/conformance/cases/masking/mask-case.json +14 -0
  49. package/conformance/cases/masking/mask-concat.json +14 -0
  50. package/conformance/cases/masking/mask-subquery.json +14 -0
  51. package/conformance/cases/rowcap/cap-nested.json +14 -0
  52. package/conformance/cases/rowcap/cap-raise-limit.json +14 -0
  53. package/conformance/cases/rowcap/cap-union.json +14 -0
  54. package/conformance/claims/conarium.json +12 -0
  55. package/conformance/lib/status.mjs +48 -0
  56. package/conformance/policies/mask-email.json +5 -0
  57. package/conformance/policies/protected-email.json +6 -0
  58. package/conformance/policies/sql-gate.json +6 -0
  59. package/conformance/profiles.md +15 -0
  60. package/conformance/run.mjs +208 -0
  61. package/conformance/schema/case.json +42 -0
  62. package/dist/config.d.ts +12 -0
  63. package/dist/config.d.ts.map +1 -1
  64. package/dist/config.js +7 -2
  65. package/dist/config.js.map +1 -1
  66. package/dist/types.d.ts +5 -0
  67. package/dist/types.d.ts.map +1 -1
  68. package/docs/CONTRIBUTING.md +7 -0
  69. package/package.json +2 -1
  70. package/scripts/gacs-query-adapter.mjs +52 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,45 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.21 — 2026-08-16
4
+
5
+ Findings from an independent review that cloned the repository, installed it and ran
6
+ the tests, the hardening checks and the conformance suite on its own machine. None of
7
+ the four is a vulnerability: one is a claim this project stated less carefully than it
8
+ states everything else, and three are places where a misconfiguration could stay quiet.
9
+
10
+ - **The IETF draft is described as what it is.** The README said only that
11
+ `draft-dogru-scitt-disclosure-evidence` is "on the IETF Datatracker." A reader's
12
+ legal or security team can take that for a standards process; the Datatracker page
13
+ itself says the opposite. It now reads: individual submission, not adopted by a
14
+ working group, no formal standing — an Internet-Draft is a dated public record, not
15
+ a standard. Published so the receipt format can be implemented without us.
16
+
17
+ - **The production profile announces what it changes.** Selecting
18
+ `profile: production` quietly turned on the OpenTimestamps anchor sink when none was
19
+ set, which means an outbound HTTPS connection, and quietly set
20
+ `CONARIUM_AUDIT_REQUIRE_SIG=1`. Both are documented and `conarium-doctor` reports
21
+ them, but an operator who does not run the doctor never saw it happen. Each implicit
22
+ change now prints one line to stderr — never stdout, which would corrupt the MCP
23
+ stream — and nothing is printed when the operator set the value themselves. This
24
+ README says elsewhere that a governance product making an undisclosed outbound
25
+ connection has already lost the argument; that sentence should apply to itself.
26
+
27
+ - **`doctor` warns when a masked column is not a protected one.** A column in
28
+ `maskColumns` but not in `protectedColumns` leaves exactly the inference channel
29
+ LIMITATIONS describes: the value is hidden, and a predicate on it still answers
30
+ questions about it. That can be a deliberate choice, so this is a warning and not a
31
+ refusal — it exists to make sure it is a choice.
32
+
33
+ - **`doctor` tests a custom pattern instead of only compiling it.** A rule may now
34
+ carry an optional `sample`. A pattern that compiles but does not match its own
35
+ sample is a warning; a pattern with no sample is reported as untested rather than
36
+ passing silently. Neither the pattern nor the sample is ever printed. Compiling is
37
+ not catching, and a typo in a customer-specific rule used to protect nothing while
38
+ looking healthy.
39
+
40
+ - Contributing docs now carry the rule the four findings share: a setting that weakens
41
+ a protection has to be noisy — in the receipt, in the doctor, and at startup.
42
+
3
43
  ## 0.2.20 — 2026-08-16
4
44
 
5
45
  - **`policy.protectedColumns`: a column you may read but not ask about.**
package/README.md CHANGED
@@ -27,7 +27,10 @@ only copy; this repo does not keep a second one.
27
27
  ## Standards
28
28
 
29
29
  [draft-dogru-scitt-disclosure-evidence](https://datatracker.ietf.org/doc/draft-dogru-scitt-disclosure-evidence/)
30
- on the IETF Datatracker. Source files live in [`standards/`](standards/).
30
+ is an individual submission. Not adopted by an IETF working group, and it
31
+ carries no formal standing — an Internet-Draft is a dated public record, not a standard.
32
+ It is published so the receipt format can be implemented without us.
33
+ Source files live in [`standards/`](standards/).
31
34
 
32
35
  ## 👁️ The Problem
33
36
 
@@ -564,8 +567,10 @@ scanner. This is not a second masking path and it does not replace
564
567
  `maskColumns`.
565
568
 
566
569
  Each rule needs a name (what the receipt records), a pattern, optional
567
- column globs, and a mask label. A broken or ReDoS-shaped pattern rejects
568
- the config; the pattern text is never written to logs or receipts.
570
+ column globs, and a mask label. An optional `sample` is what `conarium-doctor`
571
+ tries the compiled pattern against — compile success is not a catch. A
572
+ broken or ReDoS-shaped pattern rejects the config; the pattern and the
573
+ sample are never written to logs, receipts, or doctor output.
569
574
 
570
575
  ```json
571
576
  {
@@ -288,6 +288,17 @@ if (config) {
288
288
  if (hasProtected) {
289
289
  ok('policy.protectedColumns', pol.protectedColumns.join(', '))
290
290
  }
291
+ if (hasMask) {
292
+ const protectedSet = new Set(hasProtected ? pol.protectedColumns : [])
293
+ for (const col of pol.maskColumns) {
294
+ if (protectedSet.has(col)) continue
295
+ warn(
296
+ 'policy.maskColumns',
297
+ `${col} is in maskColumns but not in protectedColumns. Masking hides the value; LIMITATIONS.md ("Masking hides values; it does not make them unlearnable") still applies. That is a valid choice — make sure it is a choice.`,
298
+ 'Add the column to protectedColumns if predicates on it must be refused. Leave it only in maskColumns if hiding the value is enough.',
299
+ )
300
+ }
301
+ }
291
302
 
292
303
  // 4b. Raised maxRows — performance warning, not a deny.
293
304
  // Threshold is measured (docs/benchmarks/masking-cost-threshold.json).
@@ -394,8 +405,41 @@ if (config) {
394
405
  } else {
395
406
  try {
396
407
  const { compileCustomPatterns } = await import(pathToFileURL(compilerPath).href)
397
- compileCustomPatterns(patterns)
398
- ok('policy.customPatterns', `${patterns.length} compiled: ${patternNames.join(', ')}`)
408
+ const compiled = compileCustomPatterns(patterns)
409
+ const byName = new Map(compiled.map((c) => [c.name, c]))
410
+ for (const p of patterns) {
411
+ const name = p && typeof p.name === 'string' ? p.name : 'unnamed'
412
+ const sample = p && typeof p.sample === 'string' ? p.sample : ''
413
+ const rule = byName.get(name)
414
+ if (!sample) {
415
+ unseen(
416
+ 'policy.customPatterns',
417
+ `pattern ${name} compiled but was not tested (no sample)`,
418
+ 'Add a sample that the pattern should match. The doctor will not print the sample.',
419
+ )
420
+ continue
421
+ }
422
+ if (!rule?.re) {
423
+ unseen(
424
+ 'policy.customPatterns',
425
+ `pattern ${name} compiled but was not tested (no compiled rule)`,
426
+ 'Rebuild the package and rerun the doctor.',
427
+ )
428
+ continue
429
+ }
430
+ rule.re.lastIndex = 0
431
+ const hit = rule.re.test(sample)
432
+ rule.re.lastIndex = 0
433
+ if (hit) {
434
+ ok('policy.customPatterns', `pattern ${name} compiled and matched its sample`)
435
+ } else {
436
+ warn(
437
+ 'policy.customPatterns',
438
+ `pattern ${name} compiled but did not match its own sample`,
439
+ 'The pattern compiled. It did not match the sample you gave it. Fix the pattern or the sample. Neither is printed.',
440
+ )
441
+ }
442
+ }
399
443
  } catch (e) {
400
444
  fail(
401
445
  'policy.customPatterns',
@@ -0,0 +1,20 @@
1
+ # Known gaps
2
+
3
+ These cases are in the suite on purpose. They are not hidden, and they
4
+ are not claimed as capabilities.
5
+
6
+ `inference-control` is **not** in the claims file. The term is bounded
7
+ inference controls: a control can raise the cost of an attack. It does
8
+ not make a value unlearnable.
9
+
10
+ | id | Expected status | Why it is listed |
11
+ |---|---|---|
12
+ | `inference/count-channel` | NOT_COVERED | `SELECT count(*) … WHERE email LIKE 'a%'` under mask-only policy. 1 vs 0 answers a question about a masked value. |
13
+ | `inference/exists-channel` | NOT_COVERED | `id IN (SELECT id … WHERE email LIKE …)` is the 1/0 channel. SQL `EXISTS` is already refused as an unknown function. |
14
+ | `inference/repeated-probe` | NOT_COVERED | Successive narrowing predicates are not budgeted per session. |
15
+ | `inference/cohort-narrowing` | NOT_COVERED | `GROUP BY` on an allowed column yields cohort sizes. |
16
+ | `coverage/tail-without-pin` | DETECTED_WITH_EXTERNAL_PIN | A hash chain cannot see receipts deleted from the end unless a pin or anchor is supplied. |
17
+
18
+ Each of these files sets `expectedFail: true`. The runner treats the
19
+ listed status as the expected outcome. If a listed gap starts returning
20
+ `ENFORCED`, the job fails — the list must be edited in the same change.
@@ -0,0 +1,85 @@
1
+ # GACS — Governed Access Conformance Suite
2
+
3
+ An open, hostile test suite for governed data access. Anyone can run it
4
+ against their own product by writing an adapter. This repository ships a
5
+ reference adapter; the suite does not import that product.
6
+
7
+ A one-person team maintains both the suite and one implementation. That
8
+ is stated here so nobody has to discover it later.
9
+
10
+ Dokümandan implement edilemiyorsa spesifikasyon değil blog yazısıdır.
11
+
12
+ If a frozen case stops matching, do not edit the expectation so the
13
+ suite goes green. Either the implementation changes, or the
14
+ specification / version changes and that change is recorded in the
15
+ open. There is no script that bulk-rewrites expected results.
16
+
17
+ ## What it tests
18
+
19
+ | Class | Profile | Typical claim |
20
+ |---|---|---|
21
+ | `evidence/` | GACS-D1 | Receipt chain, signature, tamper, mid-chain delete, seq gap |
22
+ | `gate/` `rowcap/` `masking/` | GACS-E1 | Table policy, row cap, column masking |
23
+ | `coverage/` | GACS-C1 | Length pins; tail drop without a pin |
24
+ | `inference/` | GACS-I1 | Count / existence / probe / cohort channels |
25
+
26
+ See [profiles.md](profiles.md). A procurement line can cite a profile
27
+ instead of inventing a score.
28
+
29
+ ## What it does not test
30
+
31
+ - Timing side channels
32
+ - A session-wide probe budget
33
+ - Whether a live database role could bypass the gate
34
+ - That a receipt was *correct* when it was written
35
+ - That this suite's authors are a large vendor
36
+
37
+ Every case has a `doesNotTest` field. Empty is rejected.
38
+
39
+ ## Two regimes
40
+
41
+ **conformance** — frozen vectors. `PASS` / `FAIL` means "matched the
42
+ recorded expectation."
43
+
44
+ **resistance** — hostile probes. The runner will not print `PASS`.
45
+ Statuses: `ENFORCED`, `BOUNDED(<limit>)`, `NOT_COVERED`,
46
+ `DECLARED_ONLY`, `DETECTED_WITH_EXTERNAL_PIN`, `NOT_CLAIMED`.
47
+
48
+ An unclaimed capability is `NOT_CLAIMED` and is not a failure. A listed
49
+ gap (`expectedFail`) that starts returning `ENFORCED` *is* a failure —
50
+ [KNOWN-GAPS.md](KNOWN-GAPS.md) must be edited in the same change.
51
+
52
+ No percentage, letter grade, or ranking is produced.
53
+
54
+ ## How to write an adapter
55
+
56
+ See [adapters/README.md](adapters/README.md). Thirty lines is enough.
57
+
58
+ ```
59
+ node conformance/run.mjs --adapter <your-adapter> --claims <your-claims.json>
60
+ ```
61
+
62
+ Claims file: implementation name, version, the claims you actually
63
+ make, and optionally a `verify` command for receipt files.
64
+
65
+ ## How to run the reference adapter
66
+
67
+ ```
68
+ npm run build
69
+ node conformance/run.mjs --adapter conformance/adapters/conarium.mjs --claims conformance/claims/conarium.json
70
+ ```
71
+
72
+ Exit 0 means every *claimed* case held and every listed gap is still a
73
+ gap. Exit 1 means a claimed miss or a gap that closed without the list
74
+ being updated.
75
+
76
+ ## Falsify it
77
+
78
+ If you think a case is wrong, open an issue. The value of the suite is
79
+ that it can be shown to be wrong.
80
+
81
+ ## Relation to the SCITT draft
82
+
83
+ This suite also exercises mechanisms described in
84
+ [draft-dogru-scitt-disclosure-evidence](https://datatracker.ietf.org/doc/draft-dogru-scitt-disclosure-evidence/).
85
+ GACS stands on its own if that draft moves or dies.
@@ -0,0 +1,59 @@
1
+ # Query adapter
2
+
3
+ The runner never imports an implementation. It starts your adapter as a
4
+ child process:
5
+
6
+ ```
7
+ <adapter> --policy <policy.json> --query <query.sql>
8
+ ```
9
+
10
+ Write one JSON object to stdout, then exit 0. The decision lives in the
11
+ JSON. A non-zero exit is a tool failure, not a `deny`.
12
+
13
+ ```json
14
+ {
15
+ "decision": "allow",
16
+ "rewrittenSql": "SELECT id FROM t LIMIT 50",
17
+ "maskedFields": ["email"],
18
+ "denyReason": "",
19
+ "receipt": {}
20
+ }
21
+ ```
22
+
23
+ `decision` is `allow` or `deny`. Other fields may be empty strings / `[]` / `{}`.
24
+
25
+ ## Thirty-line sketch
26
+
27
+ ```js
28
+ #!/usr/bin/env node
29
+ import { readFileSync } from 'node:fs'
30
+ import { parseArgs } from 'node:util'
31
+ // import { yourGate } from 'your-product'
32
+
33
+ const { values } = parseArgs({
34
+ options: { policy: { type: 'string' }, query: { type: 'string' } },
35
+ })
36
+ const policy = JSON.parse(readFileSync(values.policy, 'utf8'))
37
+ const sql = readFileSync(values.query, 'utf8')
38
+ try {
39
+ const out = yourGate(policy, sql)
40
+ process.stdout.write(JSON.stringify({
41
+ decision: 'allow',
42
+ rewrittenSql: out.sql || '',
43
+ maskedFields: out.masked || [],
44
+ denyReason: '',
45
+ receipt: {},
46
+ }) + '\n')
47
+ } catch (err) {
48
+ process.stdout.write(JSON.stringify({
49
+ decision: 'deny',
50
+ rewrittenSql: '',
51
+ maskedFields: [],
52
+ denyReason: String(err.message || ''),
53
+ receipt: {},
54
+ }) + '\n')
55
+ }
56
+ ```
57
+
58
+ Receipt-chain cases do not use this adapter. The claims file names a
59
+ verifier command; the runner execs that.
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process'
3
+ import { dirname, join } from 'node:path'
4
+ import { fileURLToPath } from 'node:url'
5
+
6
+ const root = join(dirname(fileURLToPath(import.meta.url)), '../..')
7
+ const helper = join(root, 'scripts', 'gacs-query-adapter.mjs')
8
+ const r = spawnSync(process.execPath, [helper, ...process.argv.slice(2)], {
9
+ encoding: 'utf8',
10
+ cwd: root,
11
+ windowsHide: true,
12
+ })
13
+ if (r.stdout) process.stdout.write(r.stdout)
14
+ if (r.status) {
15
+ if (!r.stdout) process.stderr.write(r.stderr || 'query helper failed\n')
16
+ process.exit(r.status)
17
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "coverage/expect-count-pin",
3
+ "regime": "conformance",
4
+ "profile": "GACS-C1",
5
+ "claim": "reconciliation",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/002-chain-of-three/receipts.jsonl",
8
+ "verifyArgs": ["--pubkey", "KEYS/vector-key.pub.pem", "--expect-count", "3"],
9
+ "expectExit": 0,
10
+ "rationale": "A length pin makes a shorter leftover chain fail. The three-receipt vector still verifies when the pin matches.",
11
+ "doesNotTest": "Live comparison against a database's own query counters.",
12
+ "sourceVector": "test-vectors/manifest.json#002-chain-of-three"
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "id": "coverage/tail-without-pin",
3
+ "regime": "resistance",
4
+ "profile": "GACS-C1",
5
+ "claim": "reconciliation",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/002-chain-of-three/receipts.jsonl",
8
+ "verifyArgs": ["--pubkey", "KEYS/vector-key.pub.pem"],
9
+ "expectExit": 0,
10
+ "expectedStatus": "DETECTED_WITH_EXTERNAL_PIN",
11
+ "expectedFail": true,
12
+ "rationale": "Without --expect-count / --expect-last-hash / an anchor, a chain that lost its tail still verifies. The pin is the control.",
13
+ "doesNotTest": "A live database counter; this case only shows the receipt file cannot see a missing tail by itself.",
14
+ "sourceVector": "test-vectors/manifest.json#002-chain-of-three"
15
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/001-single-receipt",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/001-single-receipt/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 0,
13
+ "rationale": "One valid signed receipt. The smallest passing case.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#001-single-receipt"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/002-chain-of-three",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/002-chain-of-three/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 0,
13
+ "rationale": "Three receipts linked by prevHash. Contiguous, all signed.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#002-chain-of-three"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/003-tampered-field",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/003-tampered-field/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 10,
13
+ "rationale": "outcome.rows changed from 2 to 999 after signing. The stored hash no longer matches the body.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#003-tampered-field"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/004-prevhash-break",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/004-prevhash-break/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 11,
13
+ "rationale": "The middle receipt of the chain was deleted. #3 points at a hash that is no longer present.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#004-prevhash-break"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/005-seq-gap",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/005-seq-gap/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 12,
13
+ "rationale": "seq jumps 1 -> 7. prevHash still links, so only the counter reveals the gap.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#005-seq-gap"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/006-bad-signature",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/006-bad-signature/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 13,
13
+ "rationale": "First byte of the signature flipped. Body and hash are untouched — only the signature is wrong.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#006-bad-signature"
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/007-schema-invalid",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/007-schema-invalid/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 20,
13
+ "rationale": "policy removed. The verifier must reject the shape before it trusts anything else in the file.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#007-schema-invalid"
16
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "evidence/008-unsigned-no-pubkey",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/008-unsigned-no-pubkey/receipts.jsonl",
8
+ "verifyArgs": [],
9
+ "expectExit": 13,
10
+ "rationale": "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.",
11
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
12
+ "sourceVector": "test-vectors/manifest.json#008-unsigned-no-pubkey"
13
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "evidence/009-unsigned-but-pubkey-given",
3
+ "regime": "conformance",
4
+ "profile": "GACS-D1",
5
+ "claim": "receipts",
6
+ "harness": "verify",
7
+ "receipt": "test-vectors/009-unsigned-but-pubkey-given/receipts.jsonl",
8
+ "verifyArgs": [
9
+ "--pubkey",
10
+ "KEYS/vector-key.pub.pem"
11
+ ],
12
+ "expectExit": 13,
13
+ "rationale": "The same unsigned receipt, but the caller asked for signature verification. Fail-closed: a missing signature is not a passing signature.",
14
+ "doesNotTest": "That the records were correct when created; tail truncation without an external pin.",
15
+ "sourceVector": "test-vectors/manifest.json#009-unsigned-but-pubkey-given"
16
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-alias",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT s.id FROM public.secrets AS s",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-alias",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-case-fold",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT id FROM PUBLIC.SECRETS",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-case-fold",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-comment-between",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT id FROM /* join */ public.secrets",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-comment-between",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-cte",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "WITH x AS (SELECT id FROM public.secrets) SELECT * FROM x",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-cte",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-join",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT c.id FROM public.customers c JOIN public.secrets s ON s.id = c.id",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-join",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-plain",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT id FROM public.secrets",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-plain",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-quoted-lower",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT id FROM public.\"secrets\"",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-quoted-lower",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-schema-qualify",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT id FROM public.secrets",
9
+ "rationale": "A table that is denied (or not allowed) is refused, including through alias, join, CTE, subquery, quoting, and comments.",
10
+ "doesNotTest": "Database-role grants; information_schema contents; dialects other than the postgres spelling used here.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-schema-qualify",
12
+ "expect": "deny"
13
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "id": "gate/deny-string-agg",
3
+ "regime": "conformance",
4
+ "profile": "GACS-E1",
5
+ "claim": "table-policy",
6
+ "harness": "query",
7
+ "policy": "policies/sql-gate.json",
8
+ "query": "SELECT STRING_AGG(email, ',') FROM public.customers",
9
+ "rationale": "Serialization and dump aggregates are refused.",
10
+ "doesNotTest": "Leakage through allowed aggregates such as count or avg.",
11
+ "sourceVector": "test-vectors/sql-gate/vectors.json#deny-string-agg",
12
+ "expect": "deny"
13
+ }