@conarium-ai/core 0.2.38 → 0.2.40

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 (86) hide show
  1. package/CHANGELOG.md +74 -0
  2. package/README.md +1 -1
  3. package/bin/conarium-coverage.mjs +20 -19
  4. package/bin/conarium-init.mjs +10 -9
  5. package/bin/conarium-reconcile.mjs +6 -6
  6. package/bin/conarium-verify.mjs +63 -42
  7. package/dist/audit-hash.d.ts +1 -1
  8. package/dist/audit-hash.d.ts.map +1 -1
  9. package/dist/audit-hash.js +1 -1
  10. package/dist/audit-hash.js.map +1 -1
  11. package/dist/audit.d.ts +22 -21
  12. package/dist/audit.d.ts.map +1 -1
  13. package/dist/audit.js +104 -88
  14. package/dist/audit.js.map +1 -1
  15. package/dist/config.d.ts +69 -433
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +7 -4
  18. package/dist/config.js.map +1 -1
  19. package/dist/connectors/supabase_rest.d.ts +2 -2
  20. package/dist/connectors/supabase_rest.d.ts.map +1 -1
  21. package/dist/connectors/supabase_rest.js +7 -5
  22. package/dist/connectors/supabase_rest.js.map +1 -1
  23. package/dist/console-receipts.d.ts +2 -2
  24. package/dist/console-receipts.d.ts.map +1 -1
  25. package/dist/console-receipts.js +2 -2
  26. package/dist/console-receipts.js.map +1 -1
  27. package/dist/console.d.ts +6 -22
  28. package/dist/console.d.ts.map +1 -1
  29. package/dist/console.js +13 -12
  30. package/dist/console.js.map +1 -1
  31. package/dist/coverage.d.ts +32 -30
  32. package/dist/coverage.d.ts.map +1 -1
  33. package/dist/coverage.js +39 -36
  34. package/dist/coverage.js.map +1 -1
  35. package/dist/governance.d.ts +14 -13
  36. package/dist/governance.d.ts.map +1 -1
  37. package/dist/governance.js +52 -48
  38. package/dist/governance.js.map +1 -1
  39. package/dist/http.d.ts +6 -5
  40. package/dist/http.d.ts.map +1 -1
  41. package/dist/http.js +45 -41
  42. package/dist/http.js.map +1 -1
  43. package/dist/iban.d.ts.map +1 -1
  44. package/dist/iban.js +13 -12
  45. package/dist/iban.js.map +1 -1
  46. package/dist/llm-gate.d.ts +6 -6
  47. package/dist/llm-gate.js +6 -6
  48. package/dist/pseudonymize.d.ts +8 -8
  49. package/dist/pseudonymize.d.ts.map +1 -1
  50. package/dist/pseudonymize.js +7 -7
  51. package/dist/pseudonymize.js.map +1 -1
  52. package/dist/receipt-view.d.ts +1 -1
  53. package/dist/receipt-view.d.ts.map +1 -1
  54. package/dist/receipt-view.js +52 -51
  55. package/dist/receipt-view.js.map +1 -1
  56. package/dist/receipt.d.ts +32 -28
  57. package/dist/receipt.d.ts.map +1 -1
  58. package/dist/receipt.js +23 -20
  59. package/dist/receipt.js.map +1 -1
  60. package/dist/scripts/discover_schema.js +14 -12
  61. package/dist/scripts/discover_schema.js.map +1 -1
  62. package/dist/scripts/dogfood_prove.js +16 -16
  63. package/dist/scripts/dogfood_prove.js.map +1 -1
  64. package/dist/server.d.ts +5 -4
  65. package/dist/server.d.ts.map +1 -1
  66. package/dist/server.js +44 -34
  67. package/dist/server.js.map +1 -1
  68. package/dist/sql-gate/rules.d.ts +8 -7
  69. package/dist/sql-gate/rules.d.ts.map +1 -1
  70. package/dist/sql-gate/rules.js +11 -9
  71. package/dist/sql-gate/rules.js.map +1 -1
  72. package/dist/tokens.d.ts +3 -3
  73. package/dist/tokens.d.ts.map +1 -1
  74. package/dist/tokens.js +18 -18
  75. package/dist/tokens.js.map +1 -1
  76. package/docs/RECEIPT-SPEC.md +200 -3
  77. package/docs/claims/reviews/0.2.39.md +90 -0
  78. package/docs/claims/reviews/0.2.40.md +70 -0
  79. package/package.json +6 -4
  80. package/public/app.js +6 -6
  81. package/public/index.html +7 -7
  82. package/public/receipts-panel.js +7 -7
  83. package/scripts/audit-chain-check.mjs +6 -6
  84. package/scripts/benchmark-overhead.mjs +4 -4
  85. package/scripts/conarium_sabah_brief.mjs +11 -11
  86. package/test-vectors/README.md +15 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,79 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.40 — an exit code that answered a question it had not examined
4
+
5
+ `conarium-verify --anchor-check` over a chain where every receipt is unanchored
6
+ exited **0**. Each null anchor was skipped, which is correct — periodic anchoring
7
+ leaves most receipts null and failing on that would make the flag unusable. What
8
+ followed was not: with nothing left to compare, the run reported success. A
9
+ caller who asked whether the anchors held was answered by a code path that never
10
+ reached an anchor.
11
+
12
+ The count was always printed — the summary line said `0/N anchored` — so the
13
+ information was on screen. The exit code was the part that claimed more than had
14
+ been examined, and the exit code is what a machine reads.
15
+
16
+ It is now **15**, which already means "could not be checked" and is evaluated
17
+ ahead of 14 so that "I could not check" is never swallowed by "it does not hold".
18
+ `--require-head-anchor` keeps 14: there the caller asserted an anchor must be
19
+ present, and its absence is a failed assertion rather than an unread one. A chain
20
+ carrying at least one anchor is unaffected.
21
+
22
+ **This is a behaviour change.** A caller who ran `--anchor-check` over
23
+ never-anchored chains and treated 0 as success will now see 15. That is the
24
+ point — but it is a break, and it is why this is a version rather than a patch to
25
+ the last one.
26
+
27
+ The old answer was not an oversight: `test/anchor_verify.mjs` A6.5 asserted it.
28
+ The test had written the defect down, so the behaviour changed and the
29
+ expectation was corrected — the opposite of vector 008, where the implementation
30
+ was right and the expectation was wrong. A6.9 adds the multi-receipt case and a
31
+ control proving that a run which never asked about anchors still exits 0.
32
+
33
+ Found by applying a rule from the SCITT list to our own tool: a checker must
34
+ report that it did not compare, rather than return a verdict it did not earn.
35
+
36
+ Also here: four more Turkish identifiers in `bin/conarium-verify.mjs`
37
+ (`modelBildirilmemis`, `clientBildirilmemis`, `notlar`, `ek`) that 0.2.39's word
38
+ pass did not carry in its list. Translated, and the words added — which is the
39
+ second time that list has grown by being wrong, and is exactly the limit recorded
40
+ against it.
41
+
42
+ ## 0.2.39 — 2026-08-21 — the package speaks the language its documentation is written in
43
+
44
+ The executable package carried operational text in Turkish. Not in the
45
+ documentation, which has always been English, and not in the specification — in
46
+ the running code, where a reader who installs the package meets it.
47
+
48
+ The sharpest instance: a gateway started without a token printed
49
+ `CONARIUM_MCP_TOKEN eksik ya da <24 karakter — fail-closed, baslamiyorum.` That
50
+ is the first sentence an unaffiliated operator sees when their configuration is
51
+ wrong, and it was unreadable to most of them. The receipt viewer rendered
52
+ `lang="tr"` and translated its own labels into Turkish through a presentation
53
+ map. The console UI in `public/` said `Yukleniyor...` and `zincir saglam`. The
54
+ reasoning comments throughout `src/` — the part of this repository that explains
55
+ why a thing is written the way it is, and the part with the most value to anyone
56
+ extending it — were Turkish, and `tsc` carried them into `dist/`.
57
+
58
+ This project claims to be implementable without us. A code base whose reasoning
59
+ cannot be read by the people expected to implement it is a claim that was never
60
+ measured. Nothing here changes behaviour: strings, comments, `lang`, and the
61
+ presentation map whose values are now its keys. Thresholds, conditions and
62
+ identifiers are untouched, including the Turkish tokens the PII detectors match
63
+ on and the record-kind name they emit, which are data rather than prose.
64
+
65
+ `test/pack_locale.mjs` keeps it that way. It reads the file list `npm pack`
66
+ would ship and fails on Turkish-specific letters outside a narrow allow-list:
67
+ the deliberately Turkish `*.tr.md`, the detector tokens, and the sample names
68
+ the locale tests pin. It was shown failing before it was wired in, and again
69
+ from a comment added to `src/http.ts` and carried into `dist/http.js` by a
70
+ build, which is the path that put the text there in the first place.
71
+
72
+ Two limits, stated rather than left to be found. The check tests for Turkish
73
+ letters, not Turkish language: a sentence written without them passes. And the
74
+ markdown that ships alongside the code — the changelog's own history, parts of
75
+ `docs/` — is still Turkish in places and is a second pass, not this one.
76
+
3
77
  ## 0.2.38 — 2026-08-20 — the conditional sentence that two other pages forgot
4
78
 
5
79
  The receipt is opt-in. Nothing is written until a receipt sink is configured, and
package/README.md CHANGED
@@ -344,7 +344,7 @@ in the contract, **not shipped yet**.
344
344
  ### Implementing the format yourself
345
345
 
346
346
  The receipt is meant to outlive this implementation, so it ships with
347
- conformance vectors — twelve frozen cases plus a machine-readable manifest in
347
+ conformance vectors — thirteen frozen cases plus a machine-readable manifest in
348
348
  [`test-vectors/`](test-vectors/):
349
349
 
350
350
  ```bash
@@ -19,8 +19,8 @@
19
19
  import { createHash, createPublicKey, verify as cryptoVerify } from 'crypto'
20
20
  import { readFileSync, existsSync } from 'fs'
21
21
 
22
- // v0.1 geriye uyum: eski beyanlar hâlâ doğrulanabilir (kanıtı çöpe atmamak için).
23
- // v0.2, coverage.unassignedReceiptCount alanını ekler. Hangi sürüm olduğu çıktıda belirtilir.
22
+ // v0.1 backward compatibility: old declarations remain verifiable (so the evidence is not thrown away).
23
+ // v0.2 adds the coverage.unassignedReceiptCount field. Which version it is is stated in the output.
24
24
  const COVERAGE_V = 'conarium-coverage/0.2'
25
25
  const COVERAGE_V_LEGACY = 'conarium-coverage/0.1'
26
26
 
@@ -213,7 +213,7 @@ function schemaOk(d) {
213
213
  if (!Number.isInteger(d.coverage.notRecorded)) return 'coverage.notRecorded not integer'
214
214
  if (!Array.isArray(d.coverage.accessedObjects)) return 'coverage.accessedObjects must be an array'
215
215
  if (!Array.isArray(d.coverage.notRecordedObjects)) return 'coverage.notRecordedObjects must be an array'
216
- // v0.2: unassignedReceiptCount zorunlu. v0.1'de alan yoktu — geriye uyum için yoksa 0 varsay.
216
+ // v0.2: unassignedReceiptCount is required. The field did not exist in v0.1 — if absent, assume 0 for backward compatibility.
217
217
  if (d.v === COVERAGE_V && !Number.isInteger(d.coverage.unassignedReceiptCount)) {
218
218
  return 'coverage.unassignedReceiptCount not integer'
219
219
  }
@@ -265,9 +265,9 @@ function verifySig(keys, d) {
265
265
  }
266
266
 
267
267
  /**
268
- * Beyanı makbuzlarla çapraz kontrol et. Tutarsızlık → hata metni döner, tutarlıysa null.
269
- * Dürüstlük kuralı: coverage.notRecordedObjects "erişim KAYDEDİLMEDİ" anlamına gelir,
270
- * "erişilmedi" değil — bu metinlerde de korunur.
268
+ * Cross-check the declaration against receipts. Inconsistency → returns an error string, null if consistent.
269
+ * Honesty rule: coverage.notRecordedObjects means "access was NOT RECORDED",
270
+ * not "was not accessed" — this is preserved in these strings too.
271
271
  */
272
272
  function crossCheck(d, receipts) {
273
273
  if (receipts.length === 0) {
@@ -277,7 +277,7 @@ function crossCheck(d, receipts) {
277
277
  if (receipts.length !== d.chain.count) {
278
278
  return `count mismatch: declaration says ${d.chain.count}, receipts file has ${receipts.length}`
279
279
  }
280
- // seq aralığı + kesintisizlik
280
+ // seq range + contiguity
281
281
  const seqs = receipts.map((r) => r.chain.seq).sort((a, b) => a - b)
282
282
  if (seqs[0] !== d.chain.firstSeq) {
283
283
  return `firstSeq mismatch: declaration says ${d.chain.firstSeq}, receipts start at ${seqs[0]}`
@@ -317,9 +317,9 @@ function crossCheck(d, receipts) {
317
317
  return `decisions.${k} mismatch: declaration says ${d.decisions[k]}, receipts have ${dec[k]}`
318
318
  }
319
319
  }
320
- // coverage — aynı mantık src/coverage.ts computeCoverage ile birebir:
321
- // nesne kaynağı dataRefs[].object + describe_table'da request.target (ikinci kanıt).
322
- // list_tables veri erişimi değil (sema listeleme) — nesne sayılmaz.
320
+ // coverage — same logic as src/coverage.ts computeCoverage, one-to-one:
321
+ // object source is dataRefs[].object + request.target on describe_table (second evidence).
322
+ // list_tables is not data access (schema listing) — the object is not counted.
323
323
  const recorded = new Set()
324
324
  let unassignedReceiptCount = 0
325
325
  for (const r of receipts) {
@@ -344,8 +344,8 @@ function crossCheck(d, receipts) {
344
344
  if (notRecordedObjects.length !== d.coverage.notRecorded) {
345
345
  return `coverage.notRecorded mismatch: declaration says ${d.coverage.notRecorded}, receipts show ${notRecordedObjects.length}`
346
346
  }
347
- // v0.2: belirsizlik sayacı makbuzlardan hesaplanıp beyanla karşılaştırılır.
348
- // v0.1'de alan yoktu — geriye uyum için atla.
347
+ // v0.2: the unassigned counter is computed from receipts and compared against the declaration.
348
+ // The field did not exist in v0.1 — skip for backward compatibility.
349
349
  if (d.v === COVERAGE_V && unassignedReceiptCount !== d.coverage.unassignedReceiptCount) {
350
350
  return `coverage.unassignedReceiptCount mismatch: declaration says ${d.coverage.unassignedReceiptCount}, receipts show ${unassignedReceiptCount}`
351
351
  }
@@ -440,10 +440,11 @@ async function main(argv = process.argv.slice(2)) {
440
440
  }
441
441
  }
442
442
 
443
- // Zincir kesintisizliği: CI'da sorulan soru "kapsamam eksiksiz mi?" (b).
444
- // Zincirde boşluk = makbuz EKSİK = kapsam eksik. Varsayılan SIKI: boşluk varsa
445
- // "ok:" yazma ve EXIT 12 ver (conarium-verify'daki seq gap ile aynı anlam).
446
- // --allow-gaps yalnızca ozgunluk sorusu (a) sorulduğunda EXIT 0 döndürür.
443
+ // Chain contiguity: the question CI asks is "is my coverage complete?" (b).
444
+ // A gap in the chain = a receipt is MISSING = coverage is incomplete. Default
445
+ // is STRICT: if there is a gap, do not print "ok:" and EXIT 12 (same meaning
446
+ // as seq gap in conarium-verify).
447
+ // --allow-gaps returns EXIT 0 only when the authenticity question (a) is asked.
447
448
  if (!d.chain.contiguous && !opts.allowGaps) {
448
449
  const gapDesc = d.chain.gaps
449
450
  .map((g) => `seq ${g.expectedSeq} (found ${g.foundSeq})`)
@@ -459,7 +460,7 @@ async function main(argv = process.argv.slice(2)) {
459
460
  const complete = d.chain.contiguous === true && windowStartPinned
460
461
  const pinNote = windowStartPinned
461
462
  ? 'window start pinned'
462
- : 'window start not pinned (başlangıç sabitlenmedi)'
463
+ : 'window start not pinned'
463
464
 
464
465
  if (opts.json) {
465
466
  console.log(JSON.stringify({
@@ -483,8 +484,8 @@ async function main(argv = process.argv.slice(2)) {
483
484
  'warning: window start not pinned — prefix truncation is invisible; pass --expect-seq-from N',
484
485
  )
485
486
  }
486
- // Belirsizlik uyarısı: notRecorded listesi ancak unassigned=0 iken "kesin" sayılabilir.
487
- // "erişilmedi"/"not accessed" ifadesi YASAK — kaydın yokluğu belirsizdir, erişim yokluğu değil.
487
+ // Unassigned warning: the notRecorded list can only be treated as "definitive" when unassigned=0.
488
+ // The phrase "not accessed" is FORBIDDEN — absence of a record is indeterminate, not absence of access.
488
489
  if (unassigned > 0) {
489
490
  console.warn(
490
491
  `warning: notRecorded=${d.coverage.notRecorded} (access NOT RECORDED; ${unassigned} receipt(s) could not be attributed ` +
@@ -166,10 +166,10 @@ if (!NO_KEYS) {
166
166
  console.log(` export CONARIUM_AUDIT_SIGNING_KEY=${signingKeyPath}`)
167
167
  console.log(` export CONARIUM_AUDIT_TRUST_PUBKEYS=${publicPath}`)
168
168
  }
169
- // --config HER ZAMAN yazilir. Onceki hal 'conarium-doctor --no-net' diyordu ve
170
- // `--out <dir>` kullanildiginda o komut FAIL ediyordu: config <dir> altina yaziliyor,
171
- // doctor ise cwd'ye bakiyor. Aracin kendi yazdirdigi komutun basarisiz olmasi,
172
- // "kimse bize sormadan kurabilsin" sartinin dogrudan ihlali.
169
+ // --config is ALWAYS printed. The previous form printed 'conarium-doctor --no-net',
170
+ // which FAILED whenever `--out <dir>` was used: the config is written under <dir>
171
+ // while doctor looks in the cwd. A tool whose own printed command fails is a direct
172
+ // breach of the requirement that anyone can install this without asking us.
173
173
  console.log(` conarium-doctor --config ${configPath} --no-net`)
174
174
  console.log('')
175
175
  console.log('MCP client block (Cursor / Claude Code) — paste into mcp.json:')
@@ -177,11 +177,12 @@ console.log(JSON.stringify({
177
177
  mcpServers: {
178
178
  conarium: {
179
179
  command: 'node',
180
- // Config yolu ACIKCA veriliyor: MCP istemcisi sunucuyu KENDI calisma
181
- // dizininde baslatir, kullanicinin kurulum dizininde degil. Yol yazilmazsa
182
- // gecit config'i bulamaz ve HATA VERMEZ — sifir connector'la acilir, yani
183
- // hicbir sey yonetilmez. Doctor'un "Config file: not found" uyarisi tam
184
- // bunu anlatiyor; blogu uretirken ayni tuzaga dusmustuk.
180
+ // The config path is given EXPLICITLY: an MCP client starts the server in
181
+ // ITS OWN working directory, not the user's install directory. Without the
182
+ // path the gateway does not find the config and does NOT error — it comes up
183
+ // with zero connectors, so nothing is governed at all. Doctor's "Config file:
184
+ // not found" warning says exactly that, and we fell into the same trap once
185
+ // while producing the walkthrough.
185
186
  args: [gatewayJs, '--config', configPath],
186
187
  env: NO_KEYS
187
188
  ? {}
@@ -134,9 +134,9 @@ function loadSnapshot(path, label) {
134
134
  export function extractTables(sql) {
135
135
  const found = []
136
136
  const seen = new Set()
137
- // CTE adları (WITH x AS (…)) ilişki değildir — PostgREST her sorguyu
138
- // `WITH pgrst_source AS (…) SELECT … FROM pgrst_source` diye sarar; CTE adı
139
- // tablo sanılırsa her PostgREST deseni sahte "unreconciled" üretir.
137
+ // CTE names (WITH x AS (…)) are not relations — PostgREST wraps every query
138
+ // as `WITH pgrst_source AS (…) SELECT … FROM pgrst_source`; if the CTE name
139
+ // is taken for a table, every PostgREST pattern produces a false "unreconciled".
140
140
  const cteNames = new Set()
141
141
  const cteRe = /("([^"]+)"|[a-z_][a-z0-9_$]*)\s+as\s*\(/gi
142
142
  let c
@@ -212,7 +212,7 @@ function loadReceipts(path) {
212
212
  return { receipts }
213
213
  }
214
214
 
215
- /** Son nokta-parçası: "zion.customers" → "customers". Şema önekleri bağlayıcı farklı adlandırır. */
215
+ /** Last dotted segment: "zion.customers" → "customers". Schema prefixes are named differently by the binder. */
216
216
  function normalizeObject(name) {
217
217
  const parts = String(name).toLowerCase().split('.')
218
218
  return parts[parts.length - 1]
@@ -937,8 +937,8 @@ async function main(argv = process.argv.slice(2)) {
937
937
  )
938
938
  }
939
939
  }
940
- // Literal çıkışlar bilerek ayrı: spec_exitcode_drift bekçisi sadece
941
- // literal sayıları tarar, ternary içindeki kod görünmez kalırdı.
940
+ // Literal exits are deliberately separate: the spec_exitcode_drift sentinel
941
+ // only scans literal numbers; a code inside a ternary would stay invisible.
942
942
  if (problems > 0) {
943
943
  process.exit(40)
944
944
  }
@@ -31,9 +31,9 @@ const RECEIPT_V1 = 'conarium-receipt/0.1'
31
31
  const RECEIPT_V2 = 'conarium-receipt/0.2'
32
32
  const RECEIPT_V3 = 'conarium-receipt/0.3'
33
33
  const RECEIPT_V4 = 'conarium-receipt/0.4'
34
- const SURUMLER = [RECEIPT_V1, RECEIPT_V2, RECEIPT_V3, RECEIPT_V4]
35
- // Tek sozluk. v0.3 model/client uc degeri kullanir; v0.4 disclosure `measured`
36
- // ekler. DECLARED/VERIFIED ikinci set yoktur.
34
+ const VERSIONS = [RECEIPT_V1, RECEIPT_V2, RECEIPT_V3, RECEIPT_V4]
35
+ // Single vocabulary. v0.3 model/client use three values; v0.4 adds
36
+ // disclosure `measured`. There is no second DECLARED/VERIFIED set.
37
37
  const META_KAYNAKLARI = ['protocol', 'measured', 'operator-declared', 'undeclared']
38
38
  const META_V3 = ['protocol', 'operator-declared', 'undeclared']
39
39
  const GENESIS = 'sha256:0000000000000000000000000000000000000000000000000000000000000000'
@@ -287,33 +287,33 @@ function loadReceipts(target) {
287
287
 
288
288
  function schemaOk(r) {
289
289
  if (!r || typeof r !== 'object') return 'not an object'
290
- if (!SURUMLER.includes(r.v)) return `unsupported version ${r.v}`
290
+ if (!VERSIONS.includes(r.v)) return `unsupported version ${r.v}`
291
291
  if (typeof r.id !== 'string' || !r.id) return 'missing id'
292
292
  if (typeof r.ts !== 'string') return 'missing ts'
293
293
  if (!r.chain || typeof r.chain !== 'object') return 'missing chain'
294
294
  if (!Number.isInteger(r.chain.seq)) return 'chain.seq not integer'
295
295
  if (typeof r.chain.prevHash !== 'string') return 'missing chain.prevHash'
296
296
  if (typeof r.chain.hash !== 'string') return 'missing chain.hash'
297
- // Her iki surumde de null olmali; undefined sema kaymasi sayilir -> 20.
298
- // (Riza baglama gelecek bir surumun isi, v0.2'nin degil.)
297
+ // Must be null in both versions; undefined counts as a schema drift -> 20.
298
+ // (Binding consent is a future version's job, not v0.2's.)
299
299
  if (r.consentRef !== null && r.consentRef !== undefined) {
300
300
  return 'consentRef must be null'
301
301
  }
302
302
  if (!('consentRef' in r)) return 'missing consentRef (must be null)'
303
303
  if (!('anchor' in r)) return 'missing anchor field'
304
- // Govde alanlari da semaya dahildir. Bunlar olmadan da hash zaten tutmaz ve
305
- // exit 10 doner — ama "kurcalanmis" TESHISI yanlis olur: eksik alanli bir
306
- // kayit degistirilmis bir makbuz degil, hic makbuz degildir. Teshis dogru
307
- // olsun diye burada yakalaniyor (test-vectors/007 bunu kilitliyor).
308
- for (const alan of ['period', 'request', 'dataRefs', 'policy', 'flags', 'masking', 'outcome']) {
309
- if (!(alan in r) || r[alan] === null || r[alan] === undefined) return `missing ${alan}`
304
+ // Body fields are also part of the schema. Without them the hash already
305
+ // fails and we exit 10 — but the "tampered" DIAGNOSIS would be wrong: a
306
+ // record with missing fields is not a modified receipt, it is not a receipt
307
+ // at all. Caught here so the diagnosis is correct (test-vectors/007 locks this).
308
+ for (const field of ['period', 'request', 'dataRefs', 'policy', 'flags', 'masking', 'outcome']) {
309
+ if (!(field in r) || r[field] === null || r[field] === undefined) return `missing ${field}`
310
310
  }
311
311
  if (!Array.isArray(r.dataRefs)) return 'dataRefs must be an array'
312
312
  if (!Array.isArray(r.flags)) return 'flags must be an array'
313
313
  if (typeof r.policy !== 'object' || typeof r.policy.decision !== 'string') {
314
314
  return 'policy.decision is required'
315
315
  }
316
- // v0.1: aktör "service" olmak zorunda (degismedi — eski makbuzlar aynen dogrulanir)
316
+ // v0.1: actor must be "service" (unchanged — old receipts still verify as-is)
317
317
  if (r.v === RECEIPT_V1) {
318
318
  if (!r.actor || r.actor.type !== 'service') return 'actor.type must be "service" in v0.1'
319
319
  } else {
@@ -327,23 +327,24 @@ function schemaOk(r) {
327
327
  return 'actor.type "user" cannot carry assurance "shared-token"'
328
328
  }
329
329
  }
330
- // v0.3: model/client artik DEGERI ile birlikte KAYNAGINI da tasir.
331
- // "undeclared" gecerli bir makbuzdur — eksik degil, durustce bos.
332
- // v0.4 ayni model/client kurallarini korur; disclosure/destination EKLER.
333
- // Eski surumlerde bu alanlar zorunlu degil — eksik 0.3 makbuz 20 donmez.
330
+ // v0.3: model/client now carry their SOURCE along with the VALUE.
331
+ // "undeclared" is a valid receipt — not missing, honestly empty.
332
+ // v0.4 keeps the same model/client rules; ADDS disclosure/destination.
333
+ // These fields are not required in older versions — a receipt missing 0.3
334
+ // fields does not return 20.
334
335
  if (r.v === RECEIPT_V3 || r.v === RECEIPT_V4) {
335
- for (const alan of ['model', 'client']) {
336
- const m = r[alan]
337
- if (!m || typeof m !== 'object') return `missing ${alan}`
336
+ for (const field of ['model', 'client']) {
337
+ const m = r[field]
338
+ if (!m || typeof m !== 'object') return `missing ${field}`
338
339
  if (!META_V3.includes(m.source)) {
339
- return `${alan}.source must be one of ${META_V3.join('|')} in ${r.v === RECEIPT_V4 ? 'v0.4' : 'v0.3'}`
340
+ return `${field}.source must be one of ${META_V3.join('|')} in ${r.v === RECEIPT_V4 ? 'v0.4' : 'v0.3'}`
340
341
  }
341
- // Bildirilmedi denip deger tasimak celiskidir: makbuz ya bilmiyordur ya bilir.
342
+ // Claiming undeclared while carrying values is a contradiction: a receipt either does not know or it does.
342
343
  if (m.source === 'undeclared') {
343
- const dolu = alan === 'model'
344
+ const populated = field === 'model'
344
345
  ? [m.provider, m.name, m.version].some((x) => x !== null)
345
346
  : [m.name, m.version].some((x) => x !== null)
346
- if (dolu) return `${alan}.source is "undeclared" but carries values`
347
+ if (populated) return `${field}.source is "undeclared" but carries values`
347
348
  }
348
349
  }
349
350
  }
@@ -604,10 +605,11 @@ async function main(argv = process.argv.slice(2)) {
604
605
  })
605
606
  }
606
607
  const otsResult = await verifyOtsProof(row.ots, receipt.chain.hash)
607
- // 15 ÖNCE gelir: "kontrol edemedim" ile "kanıt tutmuyor" farklı cevaplardır
608
- // ve ikincisi birincisini yutarsa doğrulayıcı bilmediği bir şeyi iddia eder.
609
- // Sessizce 0 dönmek de aynı ölçüde yanlış olurdu — çağıran, çıpanın
610
- // doğrulanmadığını BİLMELİ, sadece doğrulanamadığını.
608
+ // 15 comes FIRST: "I could not check" and "the proof does not hold" are
609
+ // different answers, and if the second swallows the first the verifier
610
+ // claims something it does not know. Silently returning 0 would be
611
+ // equally wrong — the caller MUST KNOW the anchor was not verified,
612
+ // only that it could not be verified.
611
613
  if (otsResult.unknown) {
612
614
  fail(
613
615
  15,
@@ -661,16 +663,18 @@ async function main(argv = process.argv.slice(2)) {
661
663
  }
662
664
  }
663
665
 
664
- // Bildirilmemis meta BASARISIZLIK DEGILDIR — ama sessizce de gecmez. Denetci
665
- // "N makbuz dogrulandi" cumlesini okurken, kacinin model kimligi tasimadigini
666
- // gormeli; aksi halde dogrulama, olcmedigi bir seyi onaylamis gibi okunur.
667
- // NOT: receipts elemanlari {file, receipt} sarmalidir — dogrudan r.model okumak
668
- // sessizce hep 0 verir (bu tam olarak bir kez yasandi, e2e kosusu yakaladi).
669
- const modelBildirilmemis = receipts.filter((r) => r.receipt?.model?.source === 'undeclared').length
670
- const clientBildirilmemis = receipts.filter((r) => r.receipt?.client?.source === 'undeclared').length
671
- const notlar = []
672
- if (modelBildirilmemis) notlar.push(`${modelBildirilmemis} with undeclared model`)
673
- if (clientBildirilmemis) notlar.push(`${clientBildirilmemis} with undeclared client`)
666
+ // Undeclared metadata is NOT a failure — but it also does not pass silently.
667
+ // When the auditor reads "N receipts verified", they must see how many carry
668
+ // no model identity; otherwise verification reads as if it approved something
669
+ // it did not measure.
670
+ // NOTE: receipts elements are wrapped as {file, receipt} — reading r.model
671
+ // directly silently always yields 0 (this happened exactly once; the e2e run
672
+ // caught it).
673
+ const undeclaredModelCount = receipts.filter((r) => r.receipt?.model?.source === 'undeclared').length
674
+ const undeclaredClientCount = receipts.filter((r) => r.receipt?.client?.source === 'undeclared').length
675
+ const notes = []
676
+ if (undeclaredModelCount) notes.push(`${undeclaredModelCount} with undeclared model`)
677
+ if (undeclaredClientCount) notes.push(`${undeclaredClientCount} with undeclared client`)
674
678
 
675
679
  if (opts.requireHeadAnchor && !headAnchored) {
676
680
  fail(14, 'head anchor required but head is not anchored', opts.json, {
@@ -680,6 +684,23 @@ async function main(argv = process.argv.slice(2)) {
680
684
  })
681
685
  }
682
686
 
687
+ // --anchor-check on a chain where no receipt carries an anchor used to exit 0:
688
+ // every null was skipped, nothing was compared, and the caller who asked
689
+ // whether the anchors held was told yes by a path that never reached one.
690
+ // That is the same defect as a checker returning a verdict on an input it
691
+ // never examined. The value for it already exists — 15 means "could not be
692
+ // checked", deliberately distinct from 14 "does not hold" — so this is 15.
693
+ // `--require-head-anchor` above stays 14: the caller asserted an anchor must
694
+ // be there, and its absence is a failed assertion rather than an unread one.
695
+ if (opts.anchorCheck && receipts.length > 0 && anchoredCount === 0) {
696
+ fail(
697
+ 15,
698
+ `anchor check requested but no receipt carries an anchor: 0/${receipts.length} anchored, nothing was compared`,
699
+ opts.json,
700
+ { anchored: 0, total: receipts.length, headAnchored: false },
701
+ )
702
+ }
703
+
683
704
  const summary = `${anchoredCount}/${receipts.length} anchored, head anchored: ${headAnchored ? 'yes' : 'no'}`
684
705
  const tailPinned = isTailPinned(opts)
685
706
  if (!tailPinned) console.error(TAIL_UNPINNED_NOTE)
@@ -689,16 +710,16 @@ async function main(argv = process.argv.slice(2)) {
689
710
  ok: true,
690
711
  code: 0,
691
712
  count: receipts.length,
692
- undeclaredModel: modelBildirilmemis,
693
- undeclaredClient: clientBildirilmemis,
713
+ undeclaredModel: undeclaredModelCount,
714
+ undeclaredClient: undeclaredClientCount,
694
715
  anchored: anchoredCount,
695
716
  headAnchored,
696
717
  anchorSummary: opts.anchorCheck ? summary : undefined,
697
718
  tailPinned,
698
719
  }))
699
720
  } else {
700
- const ek = notlar.length ? ` (${notlar.join(', ')})` : ''
701
- console.log(`ok: ${receipts.length} receipt(s) verified${ek}`)
721
+ const suffix = notes.length ? ` (${notes.join(', ')})` : ''
722
+ console.log(`ok: ${receipts.length} receipt(s) verified${suffix}`)
702
723
  if (opts.anchorCheck) console.log(summary)
703
724
  }
704
725
  process.exit(0)
@@ -1,4 +1,4 @@
1
- /** validateChain / log() ile aynı kural: hash+signature+sig+anchor hariç JSON → sha256. */
1
+ /** Same rule as validateChain / log(): JSON excluding hash+signature+sig+anchor → sha256. */
2
2
  export declare function computeEntryHash(entry: Record<string, unknown>): string;
3
3
  export declare const GENESIS_HASH = "0000000000000000000000000000000000000000000000000000000000000000";
4
4
  //# sourceMappingURL=audit-hash.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-hash.d.ts","sourceRoot":"","sources":["../src/audit-hash.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAOvE;AAED,eAAO,MAAM,YAAY,qEAAqE,CAAA"}
1
+ {"version":3,"file":"audit-hash.d.ts","sourceRoot":"","sources":["../src/audit-hash.ts"],"names":[],"mappings":"AAEA,6FAA6F;AAC7F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAOvE;AAED,eAAO,MAAM,YAAY,qEAAqE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { createHash } from 'crypto';
2
- /** validateChain / log() ile aynı kural: hash+signature+sig+anchor hariç JSON → sha256. */
2
+ /** Same rule as validateChain / log(): JSON excluding hash+signature+sig+anchor → sha256. */
3
3
  export function computeEntryHash(entry) {
4
4
  const signed = { ...entry };
5
5
  delete signed.hash;
@@ -1 +1 @@
1
- {"version":3,"file":"audit-hash.js","sourceRoot":"","sources":["../src/audit-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAEnC,2FAA2F;AAC3F,MAAM,UAAU,gBAAgB,CAAC,KAA8B;IAC7D,MAAM,MAAM,GAA4B,EAAE,GAAG,KAAK,EAAE,CAAA;IACpD,OAAO,MAAM,CAAC,IAAI,CAAA;IAClB,OAAO,MAAM,CAAC,SAAS,CAAA;IACvB,OAAO,MAAM,CAAC,GAAG,CAAA;IACjB,OAAO,MAAM,CAAC,MAAM,CAAA;IACpB,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC1E,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,kEAAkE,CAAA"}
1
+ {"version":3,"file":"audit-hash.js","sourceRoot":"","sources":["../src/audit-hash.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAA;AAEnC,6FAA6F;AAC7F,MAAM,UAAU,gBAAgB,CAAC,KAA8B;IAC7D,MAAM,MAAM,GAA4B,EAAE,GAAG,KAAK,EAAE,CAAA;IACpD,OAAO,MAAM,CAAC,IAAI,CAAA;IAClB,OAAO,MAAM,CAAC,SAAS,CAAA;IACvB,OAAO,MAAM,CAAC,GAAG,CAAA;IACjB,OAAO,MAAM,CAAC,MAAM,CAAA;IACpB,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC1E,CAAC;AAED,MAAM,CAAC,MAAM,YAAY,GAAG,kEAAkE,CAAA"}
package/dist/audit.d.ts CHANGED
@@ -4,9 +4,9 @@ import type { CustomPiiPattern, DetectorToggles } from './types.js';
4
4
  export interface AuditEntry {
5
5
  timestamp: string;
6
6
  actor: string;
7
- /** Kimliğin nasıl kurulduğu. Artefakt kimi değil, NASIL bilindiğini de taşır. */
7
+ /** How the identity was established. The artefact carries not just who, but HOW they were known. */
8
8
  actorAssurance?: ActorAssurance;
9
- /** Yürürlükteki maskeleme profilinin adı (varsa). Taban politikada tanımsız. */
9
+ /** Name of the active masking profile (if any). Undefined on the base policy. */
10
10
  policyProfile?: string;
11
11
  tool: string;
12
12
  args?: any;
@@ -19,8 +19,8 @@ export interface AuditEntry {
19
19
  reason?: string;
20
20
  governance?: unknown;
21
21
  /**
22
- * Bağlanan istemci, MCP `initialize` sırasında bildirdiyse (`clientInfo`).
23
- * Config'teki beyanı EZER: ölçülmüş değer, beyan edilmiş değerden üstündür.
22
+ * Connected client, if it reported during MCP `initialize` (`clientInfo`).
23
+ * OVERRIDES the config declaration: a measured value outranks a declared one.
24
24
  */
25
25
  client?: {
26
26
  name: string;
@@ -28,8 +28,8 @@ export interface AuditEntry {
28
28
  source?: MetaSource;
29
29
  };
30
30
  /**
31
- * İstemciye giden metin. Makbuza yalnız hash yazılır. Audit JSONL'e
32
- * ASLA yazılmaz — sonuç satırı denetim izine sızmasın.
31
+ * Text sent to the client. Only the hash is written to the receipt. NEVER
32
+ * written to the audit JSONL — the result line must not leak into the audit trail.
33
33
  */
34
34
  disclosurePayload?: string;
35
35
  prevHash?: string;
@@ -43,13 +43,14 @@ export interface AuditEntry {
43
43
  };
44
44
  }
45
45
  /**
46
- * Makbuz meta bilgisi. v0.3'ten beri İKİSİ DE OPSİYONEL — eksiklik uydurulmaz,
47
- * makbuza `source: 'undeclared'` olarak yazılır.
46
+ * Receipt metadata. Since v0.3 BOTH are OPTIONAL — a gap is not invented;
47
+ * it is written on the receipt as `source: 'undeclared'`.
48
48
  *
49
- * Neden gevşetildi: model kimliği MCP protokolünde yok, yani operatör beyan etmedikçe
50
- * hiçbir yerden gelemez. Zorunlu tutmak makbuzu tamamen kapalı tutuyordu — "her erişim
51
- * için imzalı makbuz" vaadi bu yüzden canlıda karşılıksızdı. Artık makbuz üretilir ve
52
- * bilinmeyen alanı gizlemek yerine bildirilmedi olarak işaretler.
49
+ * Why it was relaxed: model identity is not in the MCP protocol, so it cannot
50
+ * come from anywhere unless the operator declares it. Making it required kept
51
+ * the receipt completely shut — the "signed receipt for every access" promise
52
+ * was therefore unmet in production. Receipts are now produced and mark the
53
+ * unknown field as undeclared instead of hiding it.
53
54
  */
54
55
  export interface ReceiptMeta {
55
56
  model?: {
@@ -62,7 +63,7 @@ export interface ReceiptMeta {
62
63
  version: string;
63
64
  source?: MetaSource;
64
65
  };
65
- /** Operatör beyanı. Doğrulanmaz. Politika bunu okumaz. */
66
+ /** Operator declaration. Not verified. Policy does not read this. */
66
67
  destination?: string;
67
68
  }
68
69
  export declare class Audit {
@@ -74,9 +75,9 @@ export declare class Audit {
74
75
  /** keyId → verify key (current signing pubkey + CONARIUM_AUDIT_TRUST_PUBKEYS). */
75
76
  private trustStore;
76
77
  private lastHash;
77
- /** Sink byte size at last sync — başka yazıcı araya girdiyse stale lastHash yakalanır. */
78
+ /** Sink byte size at last sync — if another writer interleaved, a stale lastHash is caught. */
78
79
  private sinkSize;
79
- /** Makbuz zinciri durumu — opt-in (receiptSink verilirse aktif). */
80
+ /** Receipt chain state — opt-in (active when receiptSink is provided). */
80
81
  private receiptSink?;
81
82
  private receiptMeta?;
82
83
  private receiptLastHash;
@@ -99,23 +100,23 @@ export declare class Audit {
99
100
  private requireSigningCapability;
100
101
  private currentSinkSize;
101
102
  /**
102
- * Başka bir yazıcı sink'e ekleme yaptıysa bellekdeki lastHash bayat kalır.
103
- * Size değişmediyse ucuz çık; değiştiyse kuyruğu yeniden oku.
104
- * İki instance'ın aynı anda yazdığı gerçek yarışı kapatmaz — dosya kilidi gerekir.
103
+ * If another writer appended to the sink, the in-memory lastHash is stale.
104
+ * Cheap exit if size did not change; re-read the tail if it did.
105
+ * Does not close a real race of two instances writing at once — that needs a file lock.
105
106
  */
106
107
  private syncLastHashIfStale;
107
108
  private getLastHash;
108
- /** Makbuz zincirinin son durumunu dosyadan yükle (seq + hash). */
109
+ /** Load the receipt chain's last state from the file (seq + hash). */
109
110
  private loadReceiptChainState;
110
111
  /** Same pipeline as audit args — used for client-facing error text (G13). */
111
112
  maskText(value: string): string;
112
113
  private maskArgs;
113
114
  log(entry: Omit<AuditEntry, 'timestamp' | 'actor' | 'prevHash' | 'hash'> & {
114
- /** Erişimi yapan kişi. Verilmezse örnek başına sabit consumer kullanılır. */
115
+ /** The person who performed the access. If omitted, the per-instance fixed consumer is used. */
115
116
  actor?: string;
116
117
  actorAssurance?: ActorAssurance;
117
118
  }): AuditEntry;
118
- /** AuditEntry'den makbuz üret, zincire ekle, receiptSink'e yaz. */
119
+ /** Build a receipt from AuditEntry, append to the chain, write to receiptSink. */
119
120
  private writeReceipt;
120
121
  private validateChain;
121
122
  }
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAGjD,OAAO,EAIL,KAAK,UAAU,EAIhB,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAMnE,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,iFAAiF;IACjF,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,GAAG,CAAA;IACV,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;OAGG;IACH,MAAM,CAAC,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,UAAU,CAAA;KAAE,CAAA;IAC/D;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gDAAgD;I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