@conarium-ai/core 0.2.35 → 0.2.37

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 (45) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/LIMITATIONS.md +32 -3
  3. package/LIMITATIONS.tr.md +67 -2
  4. package/README.md +6 -3
  5. package/bin/conarium-reconcile.mjs +297 -13
  6. package/bin/conarium-stamp.mjs +2 -2
  7. package/conformance/cases/reconciliation/v2-clocks-declared.json +16 -0
  8. package/conformance/cases/reconciliation/v2-clocks-undeclared-profile.json +16 -0
  9. package/conformance/cases/reconciliation/v2-excluded.json +16 -0
  10. package/conformance/cases/reconciliation/v2-indeterminate.json +14 -0
  11. package/conformance/cases/reconciliation/v2-matched.json +16 -0
  12. package/conformance/cases/reconciliation/v2-neg-unattributed.json +15 -0
  13. package/conformance/cases/reconciliation/v2-neg-undeclared-exclusion.json +16 -0
  14. package/conformance/cases/reconciliation/v2-neg-undeclared-multiplicity.json +16 -0
  15. package/conformance/cases/reconciliation/v2-neg-undeclared-skew.json +15 -0
  16. package/conformance/cases/reconciliation/v2-observed-without-receipt.json +14 -0
  17. package/conformance/cases/reconciliation/v2-receipted-without-observation.json +14 -0
  18. package/conformance/fixtures/reconciliation/after-customers-1.json +1 -0
  19. package/conformance/fixtures/reconciliation/after-customers-15.json +1 -0
  20. package/conformance/fixtures/reconciliation/after-empty.json +1 -0
  21. package/conformance/fixtures/reconciliation/after-set.json +1 -0
  22. package/conformance/fixtures/reconciliation/after-unattributed.json +1 -0
  23. package/conformance/fixtures/reconciliation/before-customers-10.json +1 -0
  24. package/conformance/fixtures/reconciliation/before-empty.json +1 -0
  25. package/conformance/fixtures/reconciliation/profile-clocks.json +9 -0
  26. package/conformance/fixtures/reconciliation/profile-exclusion.json +7 -0
  27. package/conformance/fixtures/reconciliation/profile-multiplicity.json +9 -0
  28. package/conformance/fixtures/reconciliation/profile-no-clocks.json +4 -0
  29. package/conformance/fixtures/reconciliation/receipts-customers-early.jsonl +1 -0
  30. package/conformance/fixtures/reconciliation/receipts-customers.jsonl +1 -0
  31. package/conformance/fixtures/reconciliation/receipts-empty.jsonl +0 -0
  32. package/conformance/run.mjs +59 -0
  33. package/dist/audit.d.ts.map +1 -1
  34. package/dist/audit.js +117 -35
  35. package/dist/audit.js.map +1 -1
  36. package/docs/API-STABILITY.md +1 -1
  37. package/docs/ARCHITECTURE.md +3 -1
  38. package/docs/RECEIPT-SPEC.md +92 -15
  39. package/docs/claims/retracted-phrasings.json +7 -0
  40. package/docs/claims/reviews/0.2.36.md +152 -0
  41. package/docs/claims/reviews/0.2.37.md +180 -0
  42. package/docs/claims/surfaces.json +115 -0
  43. package/docs/security/THREAT-MODEL.md +14 -4
  44. package/docs/security/best-practices-badge.md +5 -3
  45. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"v":"conarium-receipt/0.3","ts":"2026-08-06T11:00:00.000Z","request":{"tool":"query","target":"zion-rest","argsHash":"sha256:00"},"dataRefs":[{"source":"zion-rest","object":"zion.customers","fieldsRequested":[]}],"policy":{"decision":"allow"},"chain":{"seq":1}}
@@ -97,6 +97,56 @@ function resistanceStatusFor(c, empirical, claimsFile) {
97
97
  return empirical.denied ? 'ENFORCED' : 'NOT_COVERED'
98
98
  }
99
99
 
100
+ function runReconcileV2(c) {
101
+ const bin = join(REPO, 'bin', 'conarium-reconcile.mjs')
102
+ const args = [
103
+ bin,
104
+ '--before', resolve(REPO, c.before),
105
+ '--after', resolve(REPO, c.after),
106
+ '--receipts', resolve(REPO, c.receipts),
107
+ '--json-v2',
108
+ ]
109
+ if (c.mappingProfile) args.push('--profile', resolve(REPO, c.mappingProfile))
110
+ const r = spawnSync(process.execPath, args, { encoding: 'utf8', cwd: REPO, windowsHide: true })
111
+ let body
112
+ try {
113
+ body = JSON.parse((r.stdout || '').trim().split('\n').filter(Boolean).pop() || '')
114
+ } catch {
115
+ return { toolFailure: true, detail: `reconcile --json-v2 stdout was not JSON (exit ${r.status}): ${(r.stderr || r.stdout || '').trim()}` }
116
+ }
117
+ if (body.v !== 'coverage-reconciliation/2') {
118
+ return { ok: false, outcome: body.v, detail: `expected v coverage-reconciliation/2, got ${body.v}` }
119
+ }
120
+ const reasons = []
121
+ if (c.expectOutcome && body.outcome !== c.expectOutcome) {
122
+ reasons.push(`outcome ${body.outcome} != ${c.expectOutcome}`)
123
+ }
124
+ if (c.expectCounts) {
125
+ for (const [k, n] of Object.entries(c.expectCounts)) {
126
+ if ((body.counts?.[k] ?? 0) !== n) reasons.push(`counts.${k} ${body.counts?.[k]} != ${n}`)
127
+ }
128
+ }
129
+ if (c.expectBounds) {
130
+ for (const [k, n] of Object.entries(c.expectBounds)) {
131
+ if (body.bounds?.[k] !== n) reasons.push(`bounds.${k} ${body.bounds?.[k]} != ${n}`)
132
+ }
133
+ }
134
+ const itemOutcomes = (body.items || []).map((i) => i.outcome)
135
+ if (Array.isArray(c.expectItemOutcomes)) {
136
+ for (const want of c.expectItemOutcomes) {
137
+ if (!itemOutcomes.includes(want)) reasons.push(`missing item outcome ${want}`)
138
+ }
139
+ }
140
+ if (Array.isArray(c.forbidItemOutcomes)) {
141
+ for (const bad of c.forbidItemOutcomes) {
142
+ if (itemOutcomes.includes(bad) || (bad === 'matched' && (body.counts?.matched ?? 0) > 0)) {
143
+ reasons.push(`forbidden outcome present: ${bad}`)
144
+ }
145
+ }
146
+ }
147
+ return { ok: reasons.length === 0, outcome: body.outcome, detail: reasons.join('; ') || null }
148
+ }
149
+
100
150
  function evaluate(c, claimsFile, adapter) {
101
151
  const row = {
102
152
  id: c.id,
@@ -109,6 +159,15 @@ function evaluate(c, claimsFile, adapter) {
109
159
  expectedStatus: c.expectedStatus || null,
110
160
  }
111
161
 
162
+ if ((c.harness || 'query') === 'reconcile-v2') {
163
+ const v = runReconcileV2(c)
164
+ if (v.toolFailure) return { ...row, status: 'TOOL_FAILURE', detail: v.detail, unexpected: true }
165
+ const ok = v.ok
166
+ const status = label('conformance', conformanceStatus({ ok }))
167
+ const unexpected = status === 'FAIL' && claimed(claimsFile, c.claim)
168
+ return { ...row, status, outcome: v.outcome, unexpected, detail: v.detail || null }
169
+ }
170
+
112
171
  if ((c.harness || 'query') === 'verify') {
113
172
  const v = runVerify(claimsFile, c)
114
173
  if (v.toolFailure) return { ...row, status: 'TOOL_FAILURE', detail: v.detail, unexpected: true }
@@ -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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AAG,MAAM,CAM9B;IAED,OAAO,CAAC,QAAQ;IAiBhB,GAAG,CACD,KAAK,EAAE,IAAI,CAAC,UAAU,EAAE,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC,GAAG;QACrE,6EAA6E;QAC7E,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,cAAc,CAAC,EAAE,cAAc,CAAA;KAChC,GACA,UAAU,CA2EZ;IAED,mEAAmE;IACnE,OAAO,CAAC,YAAY;IAiCpB,OAAO,CAAC,aAAa;CAkHtB"}
package/dist/audit.js CHANGED
@@ -150,7 +150,31 @@ function ensureLockExitHook() {
150
150
  }
151
151
  });
152
152
  }
153
- function acquireSinkLock(sink) {
153
+ function sleepSync(ms) {
154
+ Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
155
+ }
156
+ const LOCK_WAIT_MS = 10_000;
157
+ const LOCK_POLL_MS = 15;
158
+ // `wx` creates the lock file and the body lands in a second syscall, so a
159
+ // reader can catch it existing and empty. That reader cannot name an owner,
160
+ // and "owner unknown" is not "owner gone" — stealing there hands one sink to
161
+ // two live writers. Only age separates mid-creation (sub-millisecond) from a
162
+ // process that died inside that window, so an unreadable lock is honoured
163
+ // until it is this old. The cost is bounded: such a crash blocks the sink for
164
+ // LOCK_STALE_MS and, being fail-closed, blocks access with it.
165
+ const LOCK_STALE_MS = 30_000;
166
+ // A lock that vanished between the failed create and this call reads as
167
+ // infinitely old, which sends the caller down the retry path — the same place
168
+ // an expired lock lands, and the next create attempt is the one that decides.
169
+ function lockAgeMs(lockPath) {
170
+ try {
171
+ return Date.now() - statSync(lockPath).mtimeMs;
172
+ }
173
+ catch {
174
+ return Number.POSITIVE_INFINITY;
175
+ }
176
+ }
177
+ function acquireSinkLockOnce(sink) {
154
178
  if (!existsSync(dirname(sink)))
155
179
  return undefined;
156
180
  const lockPath = `${sink}.lock`;
@@ -188,6 +212,9 @@ function acquireSinkLock(sink) {
188
212
  if (otherPid != null && pidAlive(otherPid)) {
189
213
  throw new Error(`another process holds the audit sink lock (pid ${otherPid})`);
190
214
  }
215
+ if (otherPid == null && lockAgeMs(lockPath) < LOCK_STALE_MS) {
216
+ throw new Error('another process holds the audit sink lock (pid unreadable)');
217
+ }
191
218
  try {
192
219
  unlinkSync(lockPath);
193
220
  }
@@ -196,6 +223,51 @@ function acquireSinkLock(sink) {
196
223
  }
197
224
  throw new Error('another process holds the audit sink lock (pid unknown)');
198
225
  }
226
+ function acquireSinkLock(sink, opts = {}) {
227
+ if (!opts.wait)
228
+ return acquireSinkLockOnce(sink);
229
+ const deadline = Date.now() + LOCK_WAIT_MS;
230
+ for (;;) {
231
+ try {
232
+ return acquireSinkLockOnce(sink);
233
+ }
234
+ catch (err) {
235
+ const msg = err.message;
236
+ if (!msg.includes('another process holds'))
237
+ throw err;
238
+ if (Date.now() >= deadline) {
239
+ throw new Error(`Audit sink lock wait timed out: ${msg}`);
240
+ }
241
+ sleepSync(LOCK_POLL_MS);
242
+ }
243
+ }
244
+ }
245
+ /**
246
+ * Lock order is lexicographic on the sink *paths*, never declaration order.
247
+ * Taking audit then receipt on one path and receipt then audit on another
248
+ * deadlocks; a gateway that fail-closes on a held lock then admits nothing.
249
+ * Two locks, one global order. A single digest of "this process's sinks"
250
+ * would not serialize two processes that share only the receipt file.
251
+ */
252
+ function writeLockSinks(sink, receiptSink) {
253
+ return [...new Set([sink, receiptSink].filter((p) => Boolean(p)))].sort();
254
+ }
255
+ function acquireWriteLocks(sinks) {
256
+ const acquired = [];
257
+ try {
258
+ for (const sink of sinks) {
259
+ const lockPath = acquireSinkLock(sink, { wait: true });
260
+ if (lockPath)
261
+ acquired.push(lockPath);
262
+ }
263
+ return acquired;
264
+ }
265
+ catch (err) {
266
+ for (let i = acquired.length - 1; i >= 0; i--)
267
+ releaseSinkLock(acquired[i]);
268
+ throw err;
269
+ }
270
+ }
199
271
  function releaseSinkLock(lockPath) {
200
272
  const n = heldLocks.get(lockPath) ?? 0;
201
273
  if (n <= 1) {
@@ -395,45 +467,52 @@ export class Audit {
395
467
  if (full.governance != null) {
396
468
  full.governance = this.maskArgs(full.governance);
397
469
  }
398
- this.syncLastHashIfStale();
399
- full.prevHash = this.lastHash;
400
- // Strip sig/signature before hashing (mirrors exclusions in audit-hash).
401
- delete full.sig;
402
- delete full.signature;
403
- full.hash = computeEntryHash(full);
404
- if (this.hmacKey) {
405
- full.signature = createHmac('sha256', this.hmacKey).update(full.hash).digest('hex');
406
- }
407
- if (this.signingKey) {
408
- full.sig = {
409
- alg: 'Ed25519',
410
- keyId: this.signingKey.keyId,
411
- value: signHash(this.signingKey, full.hash),
412
- };
413
- }
414
- const line = JSON.stringify(full);
415
- console.error(`[conarium:audit] ${line}`);
416
- if (this.sink) {
417
- try {
418
- appendFileSync(this.sink, line + '\n');
419
- this.lastHash = full.hash;
420
- this.sinkSize = this.currentSinkSize();
470
+ const writeLocks = acquireWriteLocks(writeLockSinks(this.sink, this.receiptSink));
471
+ try {
472
+ this.syncLastHashIfStale();
473
+ full.prevHash = this.lastHash;
474
+ // Strip sig/signature before hashing (mirrors exclusions in audit-hash).
475
+ delete full.sig;
476
+ delete full.signature;
477
+ full.hash = computeEntryHash(full);
478
+ if (this.hmacKey) {
479
+ full.signature = createHmac('sha256', this.hmacKey).update(full.hash).digest('hex');
421
480
  }
422
- catch (err) {
423
- if (this.failClosed) {
424
- throw new Error(`Audit sink write failed: ${err.message}`);
481
+ if (this.signingKey) {
482
+ full.sig = {
483
+ alg: 'Ed25519',
484
+ keyId: this.signingKey.keyId,
485
+ value: signHash(this.signingKey, full.hash),
486
+ };
487
+ }
488
+ const line = JSON.stringify(full);
489
+ console.error(`[conarium:audit] ${line}`);
490
+ if (this.sink) {
491
+ try {
492
+ appendFileSync(this.sink, line + '\n');
493
+ this.lastHash = full.hash;
494
+ this.sinkSize = this.currentSinkSize();
495
+ }
496
+ catch (err) {
497
+ if (this.failClosed) {
498
+ throw new Error(`Audit sink write failed: ${err.message}`);
499
+ }
425
500
  }
426
501
  }
502
+ else {
503
+ this.lastHash = full.hash;
504
+ }
505
+ // Makbuz üretimi — opt-in (receiptSink yapılandırıldıysa).
506
+ // disclosurePayload audit satırına yazılmaz; yalnız makbuz hash'i için taşınır.
507
+ if (this.receiptSink) {
508
+ this.writeReceipt(disclosurePayload === undefined ? full : { ...full, disclosurePayload });
509
+ }
510
+ return full;
427
511
  }
428
- else {
429
- this.lastHash = full.hash;
430
- }
431
- // Makbuz üretimi — opt-in (receiptSink yapılandırıldıysa).
432
- // disclosurePayload audit satırına yazılmaz; yalnız makbuz hash'i için taşınır.
433
- if (this.receiptSink) {
434
- this.writeReceipt(disclosurePayload === undefined ? full : { ...full, disclosurePayload });
512
+ finally {
513
+ for (let i = writeLocks.length - 1; i >= 0; i--)
514
+ releaseSinkLock(writeLocks[i]);
435
515
  }
436
- return full;
437
516
  }
438
517
  /** AuditEntry'den makbuz üret, zincire ekle, receiptSink'e yaz. */
439
518
  writeReceipt(entry) {
@@ -444,6 +523,9 @@ export class Audit {
444
523
  throw new Error('Audit: cannot write receipt without an Ed25519 signing key — ' +
445
524
  'receipts require CONARIUM_AUDIT_SIGNING_KEY (HMAC is not sufficient).');
446
525
  }
526
+ // Another process may have appended since this instance loaded the tail.
527
+ // Reload under the write lock so seq/prevHash continue that file, not memory.
528
+ this.loadReceiptChainState();
447
529
  const chain = {
448
530
  seq: this.receiptSeq + 1,
449
531
  prevHash: this.receiptLastHash,
package/dist/audit.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../src/audit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AAClG,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AAC9B,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,QAAQ,CAAA;AACpD,OAAO,EAAE,gBAAgB,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,aAAa,CAAC,GAAG,CAAC,wBAAwB,CAC3G,CAAA;gBACH,CAAC;gBACD,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC;oBACtD,MAAM,IAAI,KAAK,CACb,kEAAkE,KAAK,CAAC,GAAG,CAAC,KAAK,aAAa,CAAC,GAAG,CAAC,GAAG,CACvG,CAAA;gBACH,CAAC;YACH,CAAC;YAED,IAAI,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAuB,KAAK,GAAG,EAAE,CAAC;gBACrF,MAAM,IAAI,KAAK,CACb,kIAAkI,CACnI,CAAA;YACH,CAAC;YACD,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAA;QACvB,CAAC;IACH,CAAC;CACF"}
@@ -65,7 +65,7 @@ No dates. Shipping 1.0 is a decision, not a document.
65
65
  | `conarium-doctor` | `--config` `--no-net` `--help` | experimental |
66
66
  | `conarium-verify` | `--pubkey` (repeatable) `--anchor-check` `--require-head-anchor` `--anchors` `--expect-seq-from` `--expect-count` `--expect-last-hash` `--strict` `--json` `--help` | **candidate** (exit codes + flags in RECEIPT-SPEC) |
67
67
  | `conarium-coverage` | `--pubkey` `--receipts` `--expect-seq-from` `--allow-gaps` `--json` `--help` | experimental |
68
- | `conarium-reconcile` | `--before` `--after` `--receipts` `--skew` `--json` `--help` | experimental |
68
+ | `conarium-reconcile` | `--before` `--after` `--receipts` `--skew` `--profile` `--json` `--json-v2` `--result-v2` `--help` | experimental |
69
69
  | `conarium-stamp` | `--sidecar` `--json` `--help` | experimental |
70
70
  | `conarium-anchor-upgrade` | `<anchors.jsonl>` | experimental |
71
71
  | `conarium-console` | `--config` `--port` `--host` `--install-shortcut` `--uninstall-shortcut` `--launch` `--help` | experimental |
@@ -6,7 +6,9 @@ MCP made "connect an AI assistant to your data" a commodity. The durable value i
6
6
 
7
7
  1. **Ingestion** of messy internal sources (schemas today; docs, ADRs, APIs next).
8
8
  2. **Governance + audit** — what the AI may see, and a record of what it saw.
9
- 3. **Self-hosting** — the gateway runs in the customer's network and transmits nothing outward on its own. Raw protected values stay there; the policy-approved disclosure is what reaches the customer's AI client, and `disclosure.hash` binds exactly which bytes those were.
9
+ 3. **Self-hosting** — the gateway runs in the customer's network. Raw protected values stay there; the policy-approved disclosure is what reaches the customer's AI client, and `disclosure.hash` binds exactly which bytes those were. Protected values are not sent to us or to a vendor. Outbound connections are named so they can be checked, not because they carry those values:
10
+ - **npm version check** — `src/update-check.ts` `announceUpdate()`, called at start from both entry points, `src/index.ts` (stdio) and `src/http.ts` (HTTP gateway). Asks the public registry for `@conarium-ai/core`'s latest version number. Sends no installation identity. Disable with `CONARIUM_NO_UPDATE_CHECK=1`.
11
+ - **OpenTimestamps calendars** — only when `conarium-stamp` or `conarium-anchor-service` runs. Those tools submit a digest, not row values, to the public calendars listed in `src/ots/calendar.ts`. The receipt write path does not. The production profile (`src/config.ts`) sets `CONARIUM_ANCHOR_SINK=opentimestamps` when the operator did not; that env selects the calendar client the tools use. Set `CONARIUM_ANCHOR_SINK=none` to keep the client off.
10
12
  4. **Freshness** — incremental re-index so context never goes stale.
11
13
 
12
14
  Conarium owns this layer and stays **tool-agnostic**: it speaks MCP, so it plugs into Cursor, Copilot, Claude Code, Windsurf, Continue.dev — whatever wins.
@@ -60,7 +60,7 @@ Version string: `conarium-receipt/0.4` (verifier also accepts `0.1`, `0.2`, and
60
60
  | `chain.seq` | coverage backbone | contiguous integer; required even before v0.2 coverage proofs |
61
61
  | `chain.prevHash` / `chain.hash` | integrity | JCS (RFC 8785 subset) → SHA-256 |
62
62
  | `sig` | Ed25519 over `chain.hash` | `{ alg, keyId, value }` |
63
- | `anchor` | transparency-log head | filled asynchronously; may be `null` |
63
+ | `anchor` | transparency-log head | `null` when written; filled only after `conarium-stamp` or `conarium-anchor-service` |
64
64
 
65
65
  `hash = sha256(canonicalize(receipt \ {hash, sig, anchor}))` with `chain.hash`
66
66
  stripped before hashing. Prefix: `sha256:` + hex.
@@ -254,7 +254,7 @@ occurred"** — an absent record is ambiguous by nature.
254
254
  ## Reconciliation (two-sided, v0.1)
255
255
 
256
256
  ```
257
- conarium-reconcile --before <snapshot.json> --after <snapshot.json> --receipts <receipts.jsonl> [--json]
257
+ conarium-reconcile --before <snapshot.json> --after <snapshot.json> --receipts <receipts.jsonl> [--skew <duration>] [--profile <path>] [--json] [--json-v2] [--result-v2 <path>]
258
258
  ```
259
259
 
260
260
  The coverage declaration is one-sided: it reports what the receipt chain says
@@ -322,6 +322,75 @@ Rules that keep the verdict honest:
322
322
  | 40 | Unreconciled DB activity — recorded by the database, not receipted |
323
323
  | 41 | Indeterminate — a pattern is uncovered only by the window boundary, and two clocks decide that boundary |
324
324
 
325
+ `--json` is the `/1` body (`conarium-reconcile/0.1`) and the exit codes
326
+ above are its contract. `--json-v2` prints a separate
327
+ `coverage-reconciliation/2` object; `--result-v2 <path>` writes that object
328
+ to a file. The two must not share a body: a consumer MUST NOT read a `/1`
329
+ result as a `/2` result. `/2` does not change these exit codes. Signing and
330
+ SCITT registration of the `/2` object are out of scope for this version.
331
+
332
+ Without a Mapping Profile (`--profile`), `/2` sets `profile` to `null`.
333
+ Every item whose outcome depends on a multiplicity bound is then
334
+ `indeterminate`, an unattributed pattern is `indeterminate` rather than
335
+ `observed-without-receipt`, an infrastructure pattern is `indeterminate`
336
+ rather than `excluded` (`bounds.exclusion` is `undeclared` — an undeclared
337
+ bound does not decide), and `receipted-without-observation` makes
338
+ `outcome` `exceptions`. `bounds.exclusion` is `operator-declared` only
339
+ when the profile lists at least one exclusion rule.
340
+
341
+ ### Mapping Profile (`conarium-mapping-profile/0.1`)
342
+
343
+ A Mapping Profile is an operator declaration. It is versioned, serialized as
344
+ JSON, and digested as raw file bytes (`sha256:` + hex). The result binds that
345
+ digest. The profile is not a measurement: a declared bound is
346
+ `operator-declared` on the result, never `measured`.
347
+
348
+ ```json
349
+ {
350
+ "v": "conarium-mapping-profile/0.1",
351
+ "version": "1",
352
+ "multiplicity": { "maxStatementsPerReceipt": 8 },
353
+ "exclusions": [ { "id": "infra-query", "version": "1" } ],
354
+ "clocks": {
355
+ "observation": "pg_stat_statements",
356
+ "receipt": "gateway",
357
+ "skew": "5s"
358
+ }
359
+ }
360
+ ```
361
+
362
+ `v` is the object type. `version` is the operator's identifier for this
363
+ profile (a string). Every other member is optional. Omitted members are
364
+ undeclared, not defaulted.
365
+
366
+ | Field | Type | Encoding | What it declares |
367
+ |---|---|---|---|
368
+ | `multiplicity.maxStatementsPerReceipt` | integer ≥ 1 | JSON number | how many source statements one receipt may cover |
369
+ | `exclusions[]` | array | `{ "id": string, "version": string }` | rules that remove items before comparison |
370
+ | `clocks.observation` | string | clock identifier | the clock that stamps the observation window (the Data Source). This implementation writes it on `/1` as `clocks.window`. Typical value here: `pg_stat_statements`. |
371
+ | `clocks.receipt` | string | clock identifier | the clock that stamps receipts (the Gateway). This implementation writes it on `/1` as `clocks.receipts`. Typical value here: `gateway`. |
372
+ | `clocks.skew` | string | duration | how far those two clocks may differ |
373
+
374
+ `clocks` accepts only those three keys. A declaration that both sides read
375
+ one clock still writes both identifiers (they may be the same string) and
376
+ still writes `skew` — including `0ms`. Zero is a declaration, not a default.
377
+
378
+ **Duration encoding** (the same grammar as `--skew`; there is not a second
379
+ one): a number, optional fraction, optional unit `ms` / `s` / `m` / `h`.
380
+ The number is scaled by `ms` = 1, `s` = 1000, `m` = 60 000, `h` = 3 600 000,
381
+ then rounded to an integer millisecond. A bare number is milliseconds.
382
+ Examples: `500ms`, `5s`, `2m`, `1h`, `5000`. An unreadable duration is an
383
+ error, not a default.
384
+
385
+ `--skew` and `clocks.skew` are both operator declarations. If both are
386
+ present and they do not parse to the same number of milliseconds, the run
387
+ fails (exit 20). This tool will not pick one: which bound won would be
388
+ invisible on the result. Equal values (`5s` and `5000`) are the same
389
+ declaration. If either is present, `/2` reports `bounds.skew` as
390
+ `operator-declared` and the comparison uses that bound. If neither is
391
+ present, `bounds.skew` is `undeclared` and a pattern uncovered only by the
392
+ window boundary stays `indeterminate`.
393
+
325
394
  ### The window straddles two clocks
326
395
 
327
396
  The window is `[before.ts, after.ts]` and both timestamps come from the database.
@@ -355,7 +424,8 @@ was *"NOT reported as unreceipted access"* — a sentence twenty-three hours of
355
424
  offset cannot support. 41 was never a silent pass, and is not one now; what
356
425
  changed is that the tool stops offering an excuse it cannot back.
357
426
 
358
- A declared `--skew` is the operator's own statement about their clocks and
427
+ A declared skew bound (`--skew` or Mapping Profile `clocks.skew`) is the
428
+ operator's own statement about their clocks and
359
429
  outranks the window rule. A window shorter than a clock correction is possible —
360
430
  a five-second window and a six-second step would read as beyond the boundary
361
431
  while being exactly the case the class exists for — and the operator is the one
@@ -363,11 +433,12 @@ who knows whether that is their deployment. We have not measured how often it
363
433
  happens; the flag exists so the answer does not have to come from us:
364
434
 
365
435
  ```
366
- INDETERMINATE: 1 pattern(s) are uncovered only by the window boundary — no --skew bound was declared…
436
+ INDETERMINATE: 1 pattern(s) are uncovered only by the window boundary — no skew bound was declared…
367
437
  ~ (+5) table(s) [public.customers] have a receipt 3000ms outside the window: SELECT …
368
438
  ```
369
439
 
370
- `--skew <duration>` declares the bound (`500ms`, `5s`, `2m`, `1h`). A receipt
440
+ `--skew <duration>` or Mapping Profile `clocks.skew` declares the bound
441
+ (`500ms`, `5s`, `2m`, `1h`). A receipt
371
442
  further out than the bound is not skew, and its pattern goes back to unreconciled
372
443
  at 40 with the bypass sentence. An unreadable duration is an error, not a default:
373
444
  a tolerance nobody chose is the kind of number this tool exists to refuse.
@@ -390,10 +461,12 @@ conarium-stamp <file> [--sidecar <path>] [--json]
390
461
  | 0 | Stamped; sidecar written (`pending` until upgraded) |
391
462
  | 50 | Stamping failed — calendars unreachable or timed out |
392
463
 
393
- Receipts are anchored automatically. Documents are not, and **a git commit date is
394
- not evidence** — `git commit --date` accepts whatever you type. This stamps the
464
+ Receipts are not anchored by the write path. An operator stamps a document
465
+ with `conarium-stamp`, or submits a chain-head hash through
466
+ `conarium-anchor-service`. A git commit date is **not evidence** —
467
+ `git commit --date` accepts whatever you type. This stamps the
395
468
  SHA-256 of a file to the OpenTimestamps calendars and writes the same sidecar shape
396
- receipt anchoring uses, so `conarium-anchor-upgrade` upgrades it to a Bitcoin block
469
+ those tools use, so `conarium-anchor-upgrade` upgrades it to a Bitcoin block
397
470
  height unchanged. Only the 32-byte digest leaves the machine.
398
471
 
399
472
  **What a stamp proves, exactly:** this file existed, byte for byte in this form, no
@@ -416,16 +489,20 @@ revision history is itself timestamped.
416
489
  2. **`dataRefs[].fieldsRequested` and `policy.rulesApplied` are emitted empty.** Until 0.2.29 the first was filled from the masked-field list and the second from the set of SQL functions the query touched — in both cases a field whose name described something other than its contents. A reader takes `fieldsRequested` for the columns a query asked for, and `rulesApplied` for policy rule identifiers; neither was true, and both were signed. They are now empty, because in a signed document a field filled with the wrong thing is worse than a field left empty: empty says *unknown*, wrongly-filled says *known* and misleads. The correct contents are recoverable — selected columns from the SQL AST, rule identifiers from a policy engine that emits them — and neither is implemented; when it is, these fields carry it. **The conformance vectors under `test-vectors/` show both fields populated. Those vectors are hand-written to exercise the format and are not produced by this implementation; a populated value is valid, and an empty one is what this version emits.** Losing per-field masking detail from `dataRefs` is a regression and is stated here rather than absorbed silently — `masking.byClass` still carries the per-class counts.
417
490
  3. **Bypass detection — addressed as of reconcile v0.1, with stated limits.** Disabling Conarium and reading the DB directly still produces no receipt — no gateway can prevent that from inside. What changed: absence is now *checkable from both sides*. One-sided: `conarium-coverage` emits a signed declaration (chain contiguity + which declared objects have recorded access). Two-sided: `conarium-reconcile` compares the database's own per-role query counters against the in-window receipts and reports any DB-recorded pattern no receipt covers (see §Reconciliation). Remaining limits, stated: reconciliation trusts the DB's own counters (an attacker who can falsify `pg_stat_statements` is out of scope), requires a dedicated DB role per gateway instance, and matches per pattern/table — never per call count. **The language rule stands: "access NOT RECORDED", never "no access occurred."**
418
491
  4. **Creation-time truth is not proven.** Without hardware attestation, an operator can still write false-but-well-formed receipts *before* anchoring.
419
- 5. **In-file `sig` stripping + HMAC/`anchor` reduction.** Content `hash` is computed with `{hash, sig, anchor}` (and audit `signature`/`sig`) excluded, so an operator who controls the file can drop or thin those fields without invalidating the content hash itself. Contiguity and the trust store catch some boot-time cases, but full protection against in-file strip/reduce games is **not solvable in-file** (*in-file çözülemez*) — it needs an external transparency-log anchor and/or out-of-band key ceremony. **Opt-in strict boot (G3):** `CONARIUM_AUDIT_REQUIRE_SIG=1` rejects a chain with any unsigned line when a signing key is configured; the default stays the 08-05 compatibility open. **Mitigation available today, measured:** keep `CONARIUM_AUDIT_HMAC_KEY` enabled alongside Ed25519. HMAC is keyed, so an actor who strips `sig` and recomputes the unkeyed hashes still fails the HMAC check (`entry signature mismatch`). Verified by test: Ed25519 alone → strip-all passes the boot check; Ed25519 + HMAC → caught. `conarium-verify --pubkey` also catches it (exit 13, `missing sig`) because it is told to expect signatures. **Anchor is available** (`CONARIUM_ANCHOR_SINK=opentimestamps`) but starts as `pending` — Bitcoin finality is delayed (hours); see §Anchoring.
492
+ 5. **In-file `sig` stripping + HMAC/`anchor` reduction.** Content `hash` is computed with `{hash, sig, anchor}` (and audit `signature`/`sig`) excluded, so an operator who controls the file can drop or thin those fields without invalidating the content hash itself. Contiguity and the trust store catch some boot-time cases, but full protection against in-file strip/reduce games is **not solvable in-file** (*in-file çözülemez*) — it needs an external transparency-log anchor and/or out-of-band key ceremony. **Opt-in strict boot (G3):** `CONARIUM_AUDIT_REQUIRE_SIG=1` rejects a chain with any unsigned line when a signing key is configured; the default stays the 08-05 compatibility open. **Mitigation available today, measured:** keep `CONARIUM_AUDIT_HMAC_KEY` enabled alongside Ed25519. HMAC is keyed, so an actor who strips `sig` and recomputes the unkeyed hashes still fails the HMAC check (`entry signature mismatch`). Verified by test: Ed25519 alone → strip-all passes the boot check; Ed25519 + HMAC → caught. `conarium-verify --pubkey` also catches it (exit 13, `missing sig`) because it is told to expect signatures. **Anchor client is available** (`conarium-stamp` / `conarium-anchor-service`; `CONARIUM_ANCHOR_SINK=opentimestamps` selects the calendars). Receipts start as `anchor: null`. After a stamp is submitted the sidecar is `pending` until Bitcoin finality (hours); see §Anchoring.
420
493
  6. **`argsHash` hurts debugging.** Support cases need the customer's own logs to correlate.
421
494
  7. **Tail truncation is invisible to `conarium-verify` unless pinned.** Deleting the last N receipts leaves a consistent leftover chain (exit 0). `--expect-count` / `--expect-last-hash` exist for operators who have an external length or last-hash; they are opt-in so a verifier that saw the same file yesterday still exits 0 today. Anchoring the head, or `conarium-reconcile` against the database's own counters, are the other pins.
422
495
 
423
496
  ## Anchoring (OpenTimestamps)
424
497
 
425
- Chain-head hashes are optionally stamped with **OpenTimestamps** (opt-in:
426
- `CONARIUM_ANCHOR_SINK=opentimestamps`). Only the raw 32-byte digest is sent
427
- (our `sha256:<hex>` prefix is stripped first). Proofs live in a sidecar
428
- `<sink>.anchors.jsonl`; the receipt’s `anchor` field is a hash-exterior
498
+ Receipts are not stamped by the write path. `Audit.writeReceipt` emits
499
+ `anchor: null`. An operator stamps a file with `conarium-stamp`, or submits
500
+ a chain-head hash through `conarium-anchor-service`. Those tools talk to the
501
+ **OpenTimestamps** calendars. `CONARIUM_ANCHOR_SINK=opentimestamps` selects
502
+ the in-tree calendar client they use; it does not stamp receipts as they
503
+ are written. Only the raw 32-byte digest is sent (our `sha256:<hex>` prefix
504
+ is stripped first). Proofs live in a sidecar `<sink>.anchors.jsonl`; after
505
+ a stamp is submitted, the receipt’s `anchor` field is a hash-exterior
429
506
  reference: `{ "log": "opentimestamps", "ref": "sha256:…", "state": "pending"|"bitcoin" }`.
430
507
 
431
508
  | State | Meaning |
@@ -442,8 +519,8 @@ chain, not hash calendars.
442
519
  implementation; institutional buyers may prefer it, but it requires trusting a TSA.
443
520
 
444
521
  **Honest latency:** “not backdated” becomes Bitcoin-hard only after upgrade. Pending
445
- is disclosed — `conarium-verify --anchor-check` skips `anchor:null` (periodic
446
- anchoring), exits 0 with a stderr warning while pending, and exits 14 if a
522
+ is disclosed — `conarium-verify --anchor-check` skips `anchor:null` (nothing
523
+ has been submitted yet), exits 0 with a stderr warning while pending, and exits 14 if a
447
524
  *claimed* anchor's proof is missing or does not match the hash. The run prints
448
525
  `N/M anchored, head anchored: yes/no`. `--require-head-anchor` exits 14 when
449
526
  the chain head is unanchored.
@@ -89,6 +89,13 @@
89
89
  "why": "scanCharCap replaces a whole field with [MASKED_PII] even when it contains no identifier",
90
90
  "use": "a field longer than policy.scanCharCap is replaced whole with [MASKED_PII], even when it contains no identifier"
91
91
  },
92
+ {
93
+ "id": "anchored-automatically",
94
+ "re": "anchored automatically",
95
+ "flags": "i",
96
+ "why": "Audit.writeReceipt emits anchor:null and does not call the scheduler; stamp and the anchor service are manual",
97
+ "use": "receipts are not anchored by the write path; stamp a document or run conarium-anchor-service"
98
+ },
92
99
  {
93
100
  "id": "node-18-floor",
94
101
  "re": "(?:with\\s+)?node\\s*\\(?\\s*(?:≥|>=)\\s*18\\s*\\)?|engines[^\\n]{0,40}>=\\s*18\\b",