@conarium-ai/core 0.3.5 → 0.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,74 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.7 - a multiplicity bound counts per Receipt
4
+
5
+ `multiplicity.maxStatementsPerReceipt` is documented as how many source
6
+ statements one Receipt may cover, and issue #161 reported that the `/2` result
7
+ compared it with one pattern's statement count, whatever the number of
8
+ Receipts. Three Receipts, three statements and a bound of 1 reported
9
+ `multiplicity-exceeded`. Two patterns of one statement each against one Receipt
10
+ were both `matched`, which erred the other way.
11
+
12
+ A Receipt's bound is now one budget, however many objects the Receipt names,
13
+ and the patterns whose objects all have a Receipt in the Window draw on the
14
+ in-window Receipts together. A statement is covered by one Receipt that names
15
+ all of its pattern's objects or, when none does, by a Receipt for each object.
16
+ Of the patterns that draw, one whose statements are more than bound × the
17
+ in-window Receipts naming one of its objects is `observed-without-receipt`
18
+ with reason `multiplicity-exceeded`, as before, and carries
19
+ `multiplicity: { bound, object, receipts, statements }`. The statements of the
20
+ patterns that draw, that one's included, are then assigned to Receipts as a
21
+ maximum flow. Any other pattern that draws and that some maximum assignment
22
+ leaves with a statement uncovered is `indeterminate` with the new reason
23
+ `multiplicity-shared`, and carries `multiplicity: { bound, objects, receipts,
24
+ statements }` for the patterns it competes with. One Receipt that names
25
+ customers and orders, at a bound of 1, admits one of a customers statement and
26
+ an orders statement, not both. Two cases err toward `indeterminate`;
27
+ `LIMITATIONS.md` names them.
28
+
29
+ A boundary item's `multiplicity` gains `object` and `receipts`, and
30
+ `exceededIfAdmitted` now counts every Receipt with a readable timestamp that
31
+ names the object: two Receipts just outside the Window at a bound of 1 admit
32
+ two statements. Its
33
+ outcome stays `indeterminate`, as draft-07 requires.
34
+
35
+ This changes which `/2` items are `matched`. The `/1` JSON body and the exit
36
+ codes do not change. Three conformance cases are added,
37
+ `v2-multiplicity-per-receipt`, `v2-multiplicity-shared` and
38
+ `v2-multiplicity-one-receipt-two-objects`.
39
+
40
+ ## 0.3.6 - a boundary item shows its size; the sink lock error says what resolves it
41
+
42
+ A pattern uncovered only by the window boundary is `indeterminate`, and
43
+ draft-07 forbids reporting it as `observed-without-receipt`. The outcome alone
44
+ therefore showed 1 statement and 10,000 statements as the same finding. Issue
45
+ #101 reported this: 10,000 statements, one Receipt outside the Window, a bound
46
+ of 1, one `indeterminate` item.
47
+
48
+ The `/2` item now carries the uncovered `objects` and, when the Mapping Profile
49
+ declares a multiplicity bound,
50
+ `multiplicity: { bound, statements, exceededIfAdmitted }`.
51
+ `exceededIfAdmitted` is the comparison the reconciled branch already makes,
52
+ applied as if the Receipt were admitted. The text report names an exceeded
53
+ bound. Outcomes, counts and exit codes do not change.
54
+
55
+ `LIMITATIONS.md` now states two things that were true and unwritten. A declared
56
+ bound is compared with one pattern's statement count, so more Receipts do not
57
+ raise it, whatever the field's name suggests. A run whose `/2` outcome is
58
+ `exceptions` can still exit 0, because `/2` does not change the exit codes.
59
+
60
+ A second gateway on the same audit sink fails with "another process holds the
61
+ audit sink lock". The message now adds that each running gateway needs its own
62
+ `audit.sink` path and that `audit.receiptSink` can be shared.
63
+
64
+ The package description is 250 characters. npm keeps 255 and cut the 0.2.x
65
+ description off mid-word, after "coverage reconciliation a"; a test now holds
66
+ the description under that limit.
67
+
68
+ Dependencies: `express` 5.3.0, `@modelcontextprotocol/sdk` 1.32.2 and
69
+ `@guanmingchiu/sqlparser-ts` 0.63.0. `postgres` stays on 3.x and `re2js` on
70
+ 2.8.7 in this release.
71
+
3
72
  ## 0.3.5 - IBAN spans start at a country code and end at a word; a glued spoken address is read
4
73
 
5
74
  Both changes come from a real large-v3-turbo transcript of an operator's own
package/LIMITATIONS.md CHANGED
@@ -308,6 +308,29 @@ statement was itself receipted. `--json-v2` prints a separate
308
308
  as `/2`. Without a Mapping Profile the `/2` object leaves multiplicity-bound
309
309
  items `indeterminate` rather than treating one receipt as a bound of one.
310
310
 
311
+ A declared multiplicity bound is how many statements one receipt may cover,
312
+ however many objects the receipt names. A statement is covered by one receipt
313
+ in the window that names all of its pattern's objects or, when none names them
314
+ all, by a receipt for each object. The patterns whose objects all have a
315
+ receipt in the window draw on those receipts together; a pattern with an
316
+ object no receipt in the window names takes its outcome from that object and
317
+ draws on none. Of the patterns that draw, one whose statements are more than
318
+ bound × the receipts in the window that name one of its objects is
319
+ `observed-without-receipt` with reason `multiplicity-exceeded`. Any other
320
+ pattern that draws, whose statements the receipts cannot be shown to cover
321
+ beside the patterns that draw on the same receipts, is `indeterminate` with reason `multiplicity-shared`, because the
322
+ evidence does not say which statements the receipts covered. The comparison
323
+ errs toward `indeterminate` in two cases. A pattern over several objects that
324
+ some receipt in the window names whole draws only on the receipts that name it
325
+ whole, even when the others would cover the rest. A pattern over several
326
+ objects that no receipt in the window names whole counts a receipt that names
327
+ two of its objects once for each, unless every receipt that names one of the
328
+ two names the other. Receipts outside the window do not count toward this comparison, even
329
+ when one of them would cover the shortfall: such an item is decided by the
330
+ in-window receipts alone, not reported as a boundary item. `/2` does not change the exit
331
+ codes, so a run whose `/2` outcome is `exceptions` can still exit 0. A check on
332
+ this channel reads `outcome`, not only the exit code.
333
+
311
334
  ## Reconciliation cannot tell a trailing clock from a late receipt
312
335
  <!-- s: reconcile-trailing-clock -->
313
336
 
@@ -317,7 +340,10 @@ A receipt that would have covered a pattern but falls outside the window is
317
340
  reported as `indeterminate` (exit 41) rather than as unreceipted access,
318
341
  because this tool has no way to know which of the two happened. That is a
319
342
  limit, not a verdict: 41 is a failure and the run does not pass, but nothing
320
- is proven either way.
343
+ is proven either way. Under a declared bound the `/2` item says whether the
344
+ statement count exceeds it even if every receipt naming its objects were
345
+ admitted (`multiplicity.exceededIfAdmitted`). The outcome does not change: the
346
+ item stays `indeterminate`, and `false` is not a pass.
321
347
 
322
348
  The exculpation is bounded by the window's own length — an offset larger than
323
349
  the window cannot be a boundary artefact, and the report says so instead of
package/LIMITATIONS.tr.md CHANGED
@@ -304,6 +304,31 @@ havuzu, ORM). 1:1 kuralı böyle her kurulumda sahte "kapsanmamış etkinlik"
304
304
  `/2` diye okunmaz. Mapping Profile yoksa `/2` çokluğa bağlı kalemleri
305
305
  `matched` saymaz, `indeterminate` bırakır.
306
306
 
307
+ Beyan edilen çokluk sınırı, bir makbuzun kaç ifadeyi karşılayabileceğidir;
308
+ makbuzun kaç nesne adlandırdığı bunu değiştirmez. Bir ifadeyi, pencere içinde
309
+ deseninin bütün nesnelerini adlandıran tek bir makbuz karşılar; hiçbiri hepsini
310
+ adlandırmıyorsa her nesne için bir makbuz karşılar. Bütün nesneleri pencere
311
+ içinde bir makbuzla adlandırılan desenler bu makbuzlardan birlikte pay alır;
312
+ pencere içinde hiçbir makbuzun adlandırmadığı bir nesnesi olan desen sonucunu o
313
+ nesneden alır ve bu makbuzlardan pay almaz. Pay alan desenlerden ifadeleri,
314
+ nesnelerinden birini pencere içinde adlandıran makbuzların sınır katından
315
+ fazla olan desen `observed-without-receipt` olur, gerekçesi
316
+ `multiplicity-exceeded`. Pay alan ve ifadelerinin, aynı makbuzlardan pay alan
317
+ desenlerin yanında makbuzlarca karşılandığı gösterilemeyen başka her desen
318
+ `indeterminate` olur, gerekçesi `multiplicity-shared`; çünkü kanıt, makbuzların hangi ifadeleri karşıladığını
319
+ söylemez. Kıyas iki durumda `indeterminate` yönüne kayar. Birden çok nesneli
320
+ bir deseni pencere içinde bütünüyle adlandıran bir makbuz varsa desen yalnız
321
+ onu bütünüyle adlandıran makbuzlardan pay alır, ötekiler kalanı karşılayacak
322
+ olsa bile. Birden çok nesneli ve pencere içinde hiçbir makbuzun bütünüyle
323
+ adlandırmadığı desen, iki nesnesini adlandıran bir makbuzu her biri için ayrı
324
+ sayar; o iki nesneden birini adlandıran her makbuz ötekini de adlandırıyorsa
325
+ saymaz. Pencere dışındaki makbuzlar bu
326
+ kıyasa girmez, açığı kapatacak olsalar bile: böyle bir kalem yalnız pencere
327
+ içindeki makbuzlarla karara bağlanır, sınır kalemi olarak raporlanmaz. `/2` çıkış kodlarını
328
+ değiştirmez; bu yüzden `/2` sonucu `exceptions` olan bir koşu yine 0 ile
329
+ çıkabilir. Bu kanalı kullanan bir denetim `outcome` alanını okur, yalnız çıkış
330
+ koduna bakmaz.
331
+
307
332
  ## OpenTimestamps istemcisi
308
333
  <!-- s: ots-client -->
309
334
 
@@ -330,7 +355,10 @@ gateway'den geliyor. Yani sınıra iki ayrı saat karar veriyor. Bir deseni
330
355
  kapsayacak olan makbuz pencerenin dışına düşerse sonuç `indeterminate` olur
331
356
  (çıkış 41) — "makbuzsuz erişim" denmez, çünkü araç ikisinden hangisinin olduğunu
332
357
  bilemez. Bu bir hüküm değil, bir sınır: 41 başarısızlıktır, koşu geçmez, ama
333
- hiçbir yön kanıtlanmış olmaz.
358
+ hiçbir yön kanıtlanmış olmaz. Sınır beyan edilmişse `/2` kalemi, nesnelerini
359
+ adlandıran her makbuz kabul edilse bile ifade sayısının sınırı aşıp aşmadığını yazar
360
+ (`multiplicity.exceededIfAdmitted`). Sonuç değişmez, kalem yine `indeterminate`
361
+ kalır; `false` değeri de geçti anlamına gelmez.
334
362
 
335
363
  Aklama, pencerenin kendi uzunluğuyla sınırlı: pencereden uzun bir fark sınır
336
364
  etkisiyle açıklanamaz ve rapor bunu mazeret göstermek yerine açıkça yazar.
package/README.md CHANGED
@@ -3,6 +3,7 @@
3
3
  <p><strong>The Third Eye for Your Company's Data.</strong></p>
4
4
  <p><sub>Part of <a href="https://verax-ai.com">VERAX</a>, by VERAX Teknoloji. Start with the VERAX body: <a href="https://github.com/verax-ai/verax">verax-ai/verax</a>. Sister projects: <a href="https://github.com/dogrucanemek-alt/tugra">Tugra</a> · <a href="https://github.com/dogrucanemek-alt/cedulon">Cedulon</a>.</sub></p>
5
5
  <p><sub>Listed on: <a href="https://www.npmjs.com/package/@conarium-ai/core">npm</a> · <a href="https://glama.ai/mcp/servers/dogrucanemek-alt/conarium">Glama</a> · <a href="https://registry.modelcontextprotocol.io/v0/servers?search=io.github.dogrucanemek-alt/conarium">MCP Registry</a> · <a href="https://mcpmarket.com/server/conarium">MCP Market</a> · <a href="https://lobehub.com/mcp/dogrucanemek-alt-conarium">LobeHub</a> · <a href="https://doi.org/10.5281/zenodo.22238913">Zenodo</a></sub></p>
6
+ <p><a href="https://openforallofus.com/tools/io.github.dogrucanemek-alt/conarium"><img src="https://openforallofus.com/badge/io.github.dogrucanemek-alt/conarium.svg" alt="Agora: MCP handshake check" height="20" /></a></p>
6
7
  <p>A self-hosted, governed gateway that lets AI coding assistants (Cursor, Copilot, Claude) touch your real data under a policy you write—protected values masked before they leave. When a receipt sink is configured it writes a signed, independently verifiable receipt of every access it mediates; <code>conarium-init</code> sets that sink, so the default layout does.</p>
7
8
 
8
9
  <p>
@@ -283,6 +283,201 @@ export function outsideBoundaryCoverage(receipts, fromMs, toMs) {
283
283
  return byTable
284
284
  }
285
285
 
286
+ /**
287
+ * How many Receipts name each object: those in the window, and all of them.
288
+ * A Receipt that names one object twice is one Receipt. Same attribution rule
289
+ * as receiptCoverage. A Receipt whose timestamp does not parse is in neither
290
+ * count, because no reading of the clock admits it.
291
+ *
292
+ * `groups` holds the in-window Receipts by the set of objects they name.
293
+ * Receipts that name the same objects are interchangeable against a bound, so
294
+ * one group stands for all of them.
295
+ */
296
+ export function namingReceiptCounts(receipts, fromMs, toMs) {
297
+ const inWindow = new Map()
298
+ const all = new Map()
299
+ const groups = new Map()
300
+ for (const r of receipts) {
301
+ const t = Date.parse(r.ts)
302
+ if (Number.isNaN(t)) continue
303
+ const named = new Set()
304
+ for (const ref of r.dataRefs || []) if (ref.object) named.add(normalizeObject(ref.object))
305
+ if (r.request?.tool === 'describe_table' && r.request?.target) named.add(normalizeObject(r.request.target))
306
+ const inside = t >= fromMs && t <= toMs
307
+ for (const key of named) {
308
+ all.set(key, (all.get(key) ?? 0) + 1)
309
+ if (inside) inWindow.set(key, (inWindow.get(key) ?? 0) + 1)
310
+ }
311
+ if (inside && named.size > 0) {
312
+ const objects = [...named].sort()
313
+ const key = objects.join('\u0000')
314
+ const g = groups.get(key)
315
+ if (g) g.count += 1
316
+ else groups.set(key, { objects, count: 1 })
317
+ }
318
+ }
319
+ return { inWindow, all, groups: [...groups.values()] }
320
+ }
321
+
322
+ /**
323
+ * Maximum flow (Dinic) over integer capacities. `reachable()` after `run()` is
324
+ * the set of nodes reachable from the source in the residual graph: the same
325
+ * set for every maximum flow.
326
+ */
327
+ class FlowNetwork {
328
+ constructor(n) {
329
+ this.head = new Array(n).fill(-1)
330
+ this.to = []
331
+ this.cap = []
332
+ this.next = []
333
+ }
334
+
335
+ add(u, v, c) {
336
+ for (const [a, b, k] of [[u, v, c], [v, u, 0]]) {
337
+ this.to.push(b)
338
+ this.cap.push(k)
339
+ this.next.push(this.head[a])
340
+ this.head[a] = this.to.length - 1
341
+ }
342
+ }
343
+
344
+ levels(s) {
345
+ const level = new Array(this.head.length).fill(-1)
346
+ level[s] = 0
347
+ const queue = [s]
348
+ for (let i = 0; i < queue.length; i++) {
349
+ const u = queue[i]
350
+ for (let e = this.head[u]; e !== -1; e = this.next[e]) {
351
+ if (this.cap[e] > 0 && level[this.to[e]] < 0) {
352
+ level[this.to[e]] = level[u] + 1
353
+ queue.push(this.to[e])
354
+ }
355
+ }
356
+ }
357
+ return level
358
+ }
359
+
360
+ run(s, t) {
361
+ let total = 0
362
+ for (;;) {
363
+ const level = this.levels(s)
364
+ if (level[t] < 0) return total
365
+ const it = [...this.head]
366
+ const push = (u, f) => {
367
+ if (u === t) return f
368
+ for (; it[u] !== -1; it[u] = this.next[it[u]]) {
369
+ const e = it[u]
370
+ const v = this.to[e]
371
+ if (this.cap[e] > 0 && level[v] === level[u] + 1) {
372
+ const got = push(v, Math.min(f, this.cap[e]))
373
+ if (got > 0) {
374
+ this.cap[e] -= got
375
+ this.cap[e ^ 1] += got
376
+ return got
377
+ }
378
+ }
379
+ }
380
+ return 0
381
+ }
382
+ for (let f = push(s, Infinity); f > 0; f = push(s, Infinity)) total += f
383
+ }
384
+ }
385
+
386
+ reachable(s) {
387
+ const level = this.levels(s)
388
+ return (u) => level[u] >= 0
389
+ }
390
+ }
391
+
392
+ /**
393
+ * Which reconciled patterns the in-window Receipts can be shown to cover under
394
+ * a bound of `max` statements per Receipt.
395
+ *
396
+ * A statement is covered by one Receipt that names all of its pattern's
397
+ * objects or, when no in-window Receipt names them all, by one Receipt for each
398
+ * object; a Receipt covers at most `max` statements. Every reconciled pattern
399
+ * draws on the Receipts, including one over the bound on its own, because its
400
+ * statements were observed. A pattern is shared when some maximum assignment
401
+ * leaves one of its statements uncovered: the evidence does not say which
402
+ * statements the Receipts covered. The rest are covered in every maximum
403
+ * assignment.
404
+ *
405
+ * A shared pattern's `group` is the patterns and Receipt groups it competes
406
+ * with: their statements are more than those Receipts admit.
407
+ */
408
+ export function boundAssignment(reconciled, groups, max) {
409
+ const S = 0
410
+ const T = 1
411
+ const groupNode = (gi) => 2 + gi
412
+ let next = 2 + groups.length
413
+ const nodes = [] // { pattern, demand, targets }
414
+ for (const [pi, d] of reconciled.entries()) {
415
+ const tables = [...new Set(d.tables)]
416
+ const full = groups.flatMap((g, gi) => (tables.every((t) => g.objects.includes(t)) ? [gi] : []))
417
+ if (full.length > 0) {
418
+ nodes.push({ pattern: pi, objects: tables, demand: d.delta, targets: full })
419
+ continue
420
+ }
421
+ // Objects named by exactly the same Receipt groups are covered by one
422
+ // Receipt per statement, so they share a node.
423
+ const byTargets = new Map()
424
+ for (const t of tables) {
425
+ const targets = groups.flatMap((g, gi) => (g.objects.includes(t) ? [gi] : []))
426
+ const key = targets.join(',')
427
+ if (byTargets.has(key)) byTargets.get(key).objects.push(t)
428
+ else byTargets.set(key, { pattern: pi, objects: [t], demand: d.delta, targets })
429
+ }
430
+ nodes.push(...byTargets.values())
431
+ }
432
+ const net = new FlowNetwork(next + nodes.length)
433
+ for (const [gi, g] of groups.entries()) net.add(groupNode(gi), T, g.count * max)
434
+ for (const n of nodes) {
435
+ n.id = next++
436
+ net.add(S, n.id, n.demand)
437
+ for (const gi of n.targets) net.add(n.id, groupNode(gi), n.demand)
438
+ }
439
+ net.run(S, T)
440
+ const inS = net.reachable(S)
441
+
442
+ // Groups of competing patterns: the nodes reachable from the source,
443
+ // connected through the edges between pattern and Receipt group nodes.
444
+ const parent = new Map()
445
+ const find = (x) => (parent.get(x) === x ? x : (parent.set(x, find(parent.get(x))), parent.get(x)))
446
+ const join = (a, b) => parent.set(find(a), find(b))
447
+ for (const n of nodes) {
448
+ if (!inS(n.id)) continue
449
+ if (!parent.has(n.id)) parent.set(n.id, n.id)
450
+ for (const gi of n.targets) {
451
+ const g = groupNode(gi)
452
+ if (!parent.has(g)) parent.set(g, g)
453
+ join(n.id, g)
454
+ }
455
+ }
456
+ const byRoot = new Map()
457
+ for (const n of nodes) {
458
+ if (!inS(n.id)) continue
459
+ const root = find(n.id)
460
+ if (!byRoot.has(root)) byRoot.set(root, { patterns: new Set(), objects: new Set(), groups: new Set() })
461
+ const c = byRoot.get(root)
462
+ c.patterns.add(n.pattern)
463
+ for (const o of n.objects) c.objects.add(o)
464
+ for (const gi of n.targets) c.groups.add(gi)
465
+ }
466
+ // A pattern covered one Receipt per object can sit in two groups; it reports
467
+ // the one furthest over the bound.
468
+ const shared = new Map()
469
+ const over = (g) => g.statements - g.receipts * max
470
+ for (const c of byRoot.values()) {
471
+ const group = {
472
+ objects: [...c.objects].sort(),
473
+ receipts: [...c.groups].reduce((sum, gi) => sum + groups[gi].count, 0),
474
+ statements: [...c.patterns].reduce((sum, pi) => sum + reconciled[pi].delta, 0),
475
+ }
476
+ for (const pi of c.patterns) if (!shared.has(pi) || over(group) > over(shared.get(pi))) shared.set(pi, group)
477
+ }
478
+ return shared
479
+ }
480
+
286
481
  /**
287
482
  * Receipts in the window that name an object the database counters did not
288
483
  * increment. Distinct from `unassigned` (receipt named nothing).
@@ -424,7 +619,7 @@ export function reconcile(before, after, receipts, opts = {}) {
424
619
  }
425
620
  const unobserved = unobservedReceipts(receipts, fromMs, toMs, observedTables)
426
621
 
427
- return {
622
+ const out = {
428
623
  v: RECONCILE_V,
429
624
  window: { start: before.ts, end: after.ts },
430
625
  role: before.role,
@@ -449,6 +644,10 @@ export function reconcile(before, after, receipts, opts = {}) {
449
644
  infrastructure,
450
645
  unobserved,
451
646
  }
647
+ // Read by the /2 projection only. Not enumerable, so the /1 body, which is a
648
+ // compatibility contract, does not change shape.
649
+ Object.defineProperty(out, 'namingReceipts', { value: namingReceiptCounts(receipts, fromMs, toMs) })
650
+ return out
452
651
  }
453
652
 
454
653
  // ─── /2 projection ───────────────────────────────────────────────────────────
@@ -572,6 +771,21 @@ function infraRuleId(query) {
572
771
  return INFRA_QUERY_RE.test(query) ? 'infra-query' : 'infra-schema'
573
772
  }
574
773
 
774
+ /**
775
+ * What admitting every Receipt that names a boundary item's objects would
776
+ * settle against a declared bound. Each statement of the pattern touches every
777
+ * object it names, so the object with the fewest naming Receipts binds. This
778
+ * is the most generous reading of the clock: `exceededIfAdmitted: true` holds
779
+ * however the boundary is read.
780
+ */
781
+ export function boundaryMultiplicity(d, naming, max) {
782
+ const tables = [...new Set(classifyPattern(d.query).tables.map((t) => t.table))]
783
+ const count = (t) => naming.all.get(t) ?? 0
784
+ const object = tables.reduce((a, t) => (count(t) < count(a) ? t : a))
785
+ const receipts = count(object)
786
+ return { bound: max, object, receipts, statements: d.delta, exceededIfAdmitted: d.delta > receipts * max }
787
+ }
788
+
575
789
  /**
576
790
  * Project a /1 reconcile() result onto coverage-reconciliation/2.
577
791
  * Does not change /1 fields or exit codes.
@@ -624,31 +838,73 @@ export function projectResultV2(result, ctx) {
624
838
  })
625
839
  }
626
840
 
841
+ const max = profile?.maxStatementsPerReceipt ?? null
842
+ const naming = result.namingReceipts
843
+ if (max != null && !naming) {
844
+ throw new Error('projectResultV2: the result carries no receipt counts; pass the value reconcile() returned')
845
+ }
846
+
847
+ // The temporal rule keeps a boundary item indeterminate whatever its size, so
848
+ // the outcome alone shows 1 statement and 10,000 as the same finding. The item
849
+ // carries the objects and, under a declared bound, what admitting every
850
+ // Receipt that names them would and would not settle.
627
851
  for (const d of result.indeterminate) {
628
852
  push('indeterminate', {
629
853
  pattern: patternDigest(d.query),
630
854
  reason: 'window-boundary',
631
855
  requiredSkewMs: d.requiredSkewMs,
856
+ objects: d.uncoveredTables,
857
+ ...(max != null ? { multiplicity: boundaryMultiplicity(d, naming, max) } : {}),
632
858
  })
633
859
  }
634
860
 
635
- const max = profile?.maxStatementsPerReceipt ?? null
636
- for (const d of result.reconciled) {
861
+ // The bound is how many statements one Receipt may cover. A Receipt names
862
+ // objects, not patterns, and its bound is one budget however many objects it
863
+ // names. Only patterns whose objects all have an in-window Receipt draw. A
864
+ // pattern with an unnamed object is decided by that object, and counting its
865
+ // statements here would let a bypass on one object turn a receipted neighbour
866
+ // into a finding. A pattern over the bound on its own, against the Receipts
867
+ // that name one of its objects, is observed-without-receipt. A pattern that
868
+ // fits on its own but that the Receipts cannot be shown to cover beside its
869
+ // neighbours is indeterminate: the evidence does not say which statements
870
+ // the Receipts covered (boundAssignment).
871
+ const receiptsIn = (t) => naming?.inWindow.get(t) ?? 0
872
+ const excess = (t, statements) => statements - receiptsIn(t) * max
873
+ const worst = (tables, statementsOf) =>
874
+ tables.reduce((a, t) => (excess(t, statementsOf(t)) > excess(a, statementsOf(a)) ? t : a))
875
+ const shared = max != null ? boundAssignment(result.reconciled, naming.groups, max) : new Map()
876
+
877
+ for (const [pi, d] of result.reconciled.entries()) {
637
878
  if (max == null) {
638
879
  push('indeterminate', {
639
880
  pattern: patternDigest(d.query),
640
881
  reason: 'multiplicity-undeclared',
641
882
  objects: d.tables || [],
642
883
  })
643
- } else if (d.delta <= max) {
644
- counts.matched += 1
645
- } else {
884
+ continue
885
+ }
886
+ const tables = [...new Set(d.tables)]
887
+ const alone = worst(tables, () => d.delta)
888
+ if (excess(alone, d.delta) > 0) {
646
889
  push('observed-without-receipt', {
647
890
  pattern: patternDigest(d.query),
648
891
  objects: d.tables || [],
649
892
  reason: 'multiplicity-exceeded',
893
+ multiplicity: { bound: max, object: alone, receipts: receiptsIn(alone), statements: d.delta },
650
894
  })
895
+ continue
896
+ }
897
+ const group = shared.get(pi)
898
+ if (group) {
899
+ push('indeterminate', {
900
+ pattern: patternDigest(d.query),
901
+ objects: d.tables || [],
902
+ reason: 'multiplicity-shared',
903
+ multiplicity: { bound: max, ...group },
904
+ })
905
+ continue
651
906
  }
907
+ counts.matched += 1
652
908
  }
653
909
 
654
910
  for (const u of result.unobserved) {
@@ -870,9 +1126,19 @@ async function main(argv = process.argv.slice(2)) {
870
1126
  if (result.indeterminate.length > 0) {
871
1127
  const atBoundary = result.indeterminate.filter((d) => d.boundaryPlausible)
872
1128
  const beyond = result.indeterminate.filter((d) => !d.boundaryPlausible)
1129
+ const max = profile?.maxStatementsPerReceipt ?? null
1130
+ const exceeded = (d) => {
1131
+ if (max == null) return ''
1132
+ const m = boundaryMultiplicity(d, result.namingReceipts, max)
1133
+ return m.exceededIfAdmitted
1134
+ ? `\n ${d.delta} statements exceed the declared multiplicity bound of ${max} even if all ` +
1135
+ `${m.receipts} receipt(s) naming ${m.object} are admitted`
1136
+ : ''
1137
+ }
873
1138
  const line = (d) =>
874
1139
  ` ~ (+${d.delta}) table(s) [${d.uncoveredTables.join(', ')}] have a receipt ${d.requiredSkewMs}ms outside ` +
875
- `the window: ${truncate(d.query)}`
1140
+ `the window: ${truncate(d.query)}` +
1141
+ exceeded(d)
876
1142
 
877
1143
  if (atBoundary.length > 0) {
878
1144
  const bound =
@@ -0,0 +1,18 @@
1
+ {
2
+ "id": "reconciliation/v2-multiplicity-one-receipt-two-objects",
3
+ "regime": "conformance",
4
+ "profile": "GACS-C1",
5
+ "claim": "reconciliation",
6
+ "harness": "reconcile-v2",
7
+ "before": "conformance/fixtures/reconciliation/before-empty.json",
8
+ "after": "conformance/fixtures/reconciliation/after-customers-orders.json",
9
+ "receipts": "conformance/fixtures/reconciliation/receipts-customers-orders-one.jsonl",
10
+ "mappingProfile": "conformance/fixtures/reconciliation/profile-multiplicity-1.json",
11
+ "expectOutcome": "exceptions",
12
+ "expectCounts": { "matched": 0, "indeterminate": 2, "observed-without-receipt": 0 },
13
+ "expectItemOutcomes": ["indeterminate"],
14
+ "forbidItemOutcomes": ["matched", "observed-without-receipt"],
15
+ "expectItemFields": { "reason": "multiplicity-shared", "multiplicity": { "bound": 1, "objects": ["customers", "orders"], "receipts": 1, "statements": 2 } },
16
+ "rationale": "The bound is how many statements one Receipt may cover, however many objects the Receipt names. One Receipt names customers and orders, the bound is 1, and there is one statement on each object, so the Receipt admits one of the two. Each pattern fits on its own, and the evidence does not say which one the Receipt covered, so neither is matched.",
17
+ "doesNotTest": "Whether the Receipt belongs to either statement. The comparison is a count against a declared bound."
18
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "id": "reconciliation/v2-multiplicity-per-receipt",
3
+ "regime": "conformance",
4
+ "profile": "GACS-C1",
5
+ "claim": "reconciliation",
6
+ "harness": "reconcile-v2",
7
+ "before": "conformance/fixtures/reconciliation/before-empty.json",
8
+ "after": "conformance/fixtures/reconciliation/after-customers-3.json",
9
+ "receipts": "conformance/fixtures/reconciliation/receipts-customers-3.jsonl",
10
+ "mappingProfile": "conformance/fixtures/reconciliation/profile-multiplicity-1.json",
11
+ "expectOutcome": "no-exceptions",
12
+ "expectCounts": { "matched": 1, "observed-without-receipt": 0, "indeterminate": 0 },
13
+ "forbidItemOutcomes": ["observed-without-receipt", "indeterminate"],
14
+ "rationale": "The multiplicity bound is how many source statements one Receipt may cover. Three Receipts in the Window name the object, the bound is 1, and the pattern has three statements, so the bound admits all three.",
15
+ "doesNotTest": "Whether each Receipt belongs to one of the statements. The comparison is a count against a declared bound."
16
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "id": "reconciliation/v2-multiplicity-shared",
3
+ "regime": "conformance",
4
+ "profile": "GACS-C1",
5
+ "claim": "reconciliation",
6
+ "harness": "reconcile-v2",
7
+ "before": "conformance/fixtures/reconciliation/before-empty.json",
8
+ "after": "conformance/fixtures/reconciliation/after-customers-two-patterns.json",
9
+ "receipts": "conformance/fixtures/reconciliation/receipts-customers.jsonl",
10
+ "mappingProfile": "conformance/fixtures/reconciliation/profile-multiplicity-1.json",
11
+ "expectOutcome": "exceptions",
12
+ "expectCounts": { "matched": 0, "indeterminate": 2, "observed-without-receipt": 0 },
13
+ "expectItemOutcomes": ["indeterminate"],
14
+ "forbidItemOutcomes": ["matched", "observed-without-receipt"],
15
+ "expectItemFields": { "reason": "multiplicity-shared", "multiplicity": { "bound": 1, "objects": ["customers"], "receipts": 1, "statements": 2 } },
16
+ "rationale": "A Receipt names objects, not patterns, so two patterns against one object draw on the same Receipts. One Receipt at a bound of 1 admits one of the two statements. Each pattern fits the bound on its own, and the evidence does not say which one the Receipt covered, so neither is matched.",
17
+ "doesNotTest": "A pattern over the bound on its own. That is observed-without-receipt with reason multiplicity-exceeded."
18
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "id": "reconciliation/v2-window-boundary-bound-exceeded",
3
+ "regime": "conformance",
4
+ "profile": "GACS-C1",
5
+ "claim": "reconciliation",
6
+ "harness": "reconcile-v2",
7
+ "before": "conformance/fixtures/reconciliation/before-customers-10.json",
8
+ "after": "conformance/fixtures/reconciliation/after-customers-15.json",
9
+ "receipts": "conformance/fixtures/reconciliation/receipts-customers-early.jsonl",
10
+ "mappingProfile": "conformance/fixtures/reconciliation/profile-multiplicity-1.json",
11
+ "expectOutcome": "exceptions",
12
+ "expectItemOutcomes": ["indeterminate"],
13
+ "forbidItemOutcomes": ["matched", "observed-without-receipt"],
14
+ "expectItemFields": { "reason": "window-boundary", "multiplicity": { "bound": 1, "object": "customers", "receipts": 1, "statements": 5, "exceededIfAdmitted": true } },
15
+ "rationale": "An item uncovered only by the window boundary stays indeterminate under the temporal rule of the draft, and it reports that its statement count exceeds the declared bound even if every Receipt naming its objects were admitted. The outcome alone would present 5 statements and 10,000 statements as the same finding.",
16
+ "doesNotTest": "Whether the Receipt belongs to the recorded access."
17
+ }
@@ -0,0 +1,17 @@
1
+ {
2
+ "id": "reconciliation/v2-window-boundary-bound-held",
3
+ "regime": "conformance",
4
+ "profile": "GACS-C1",
5
+ "claim": "reconciliation",
6
+ "harness": "reconcile-v2",
7
+ "before": "conformance/fixtures/reconciliation/before-customers-10.json",
8
+ "after": "conformance/fixtures/reconciliation/after-customers-15.json",
9
+ "receipts": "conformance/fixtures/reconciliation/receipts-customers-early.jsonl",
10
+ "mappingProfile": "conformance/fixtures/reconciliation/profile-multiplicity.json",
11
+ "expectOutcome": "exceptions",
12
+ "expectItemOutcomes": ["indeterminate"],
13
+ "forbidItemOutcomes": ["matched", "observed-without-receipt"],
14
+ "expectItemFields": { "reason": "window-boundary", "multiplicity": { "bound": 8, "object": "customers", "receipts": 1, "statements": 5, "exceededIfAdmitted": false } },
15
+ "rationale": "Same evidence as v2-window-boundary-bound-exceeded with a bound of 8: the count fits the bound, so the clock alone keeps this item from being matched. A held bound never turns a boundary item into matched.",
16
+ "doesNotTest": "A declared skew bound. That is v2-clocks-declared."
17
+ }
@@ -0,0 +1 @@
1
+ {"v":"conarium-dbsnapshot/0.1","ts":"2026-08-06T12:00:00.000Z","role":"conarium_c2","source":"pg_stat_statements","entries":[{"queryid":"1","query":"WITH pgrst_source AS (SELECT \"public\".\"customers\".* FROM \"public\".\"customers\") SELECT * FROM pgrst_source","calls":3}]}
@@ -0,0 +1 @@
1
+ {"v":"conarium-dbsnapshot/0.1","ts":"2026-08-06T12:00:00.000Z","role":"conarium_c2","source":"pg_stat_statements","entries":[{"queryid":"1","query":"WITH pgrst_source AS (SELECT \"public\".\"customers\".* FROM \"public\".\"customers\") SELECT * FROM pgrst_source","calls":1},{"queryid":"2","query":"SELECT \"public\".\"orders\".* FROM \"public\".\"orders\" LIMIT $1","calls":1}]}
@@ -0,0 +1 @@
1
+ {"v":"conarium-dbsnapshot/0.1","ts":"2026-08-06T12:00:00.000Z","role":"conarium_c2","source":"pg_stat_statements","entries":[{"queryid":"1","query":"WITH pgrst_source AS (SELECT \"public\".\"customers\".* FROM \"public\".\"customers\") SELECT * FROM pgrst_source","calls":1},{"queryid":"2","query":"WITH pgrst_source AS (SELECT \"public\".\"customers\".* FROM \"public\".\"customers\") SELECT * FROM pgrst_source /* second pattern */","calls":1}]}
@@ -0,0 +1,9 @@
1
+ {
2
+ "v": "conarium-mapping-profile/0.1",
3
+ "version": "1",
4
+ "multiplicity": { "maxStatementsPerReceipt": 1 },
5
+ "exclusions": [
6
+ { "id": "infra-query", "version": "1" },
7
+ { "id": "infra-schema", "version": "1" }
8
+ ]
9
+ }
@@ -0,0 +1,3 @@
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}}
2
+ {"v":"conarium-receipt/0.3","ts":"2026-08-06T11:01:00.000Z","request":{"tool":"query","target":"zion-rest","argsHash":"sha256:00"},"dataRefs":[{"source":"zion-rest","object":"zion.customers","fieldsRequested":[]}],"policy":{"decision":"allow"},"chain":{"seq":2}}
3
+ {"v":"conarium-receipt/0.3","ts":"2026-08-06T11:02:00.000Z","request":{"tool":"query","target":"zion-rest","argsHash":"sha256:00"},"dataRefs":[{"source":"zion-rest","object":"zion.customers","fieldsRequested":[]}],"policy":{"decision":"allow"},"chain":{"seq":3}}
@@ -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":[]},{"source":"zion-rest","object":"zion.orders","fieldsRequested":[]}],"policy":{"decision":"allow"},"chain":{"seq":1}}
@@ -131,6 +131,13 @@ function runReconcileV2(c) {
131
131
  if (body.bounds?.[k] !== n) reasons.push(`bounds.${k} ${body.bounds?.[k]} != ${n}`)
132
132
  }
133
133
  }
134
+ if (c.expectItemFields) {
135
+ const fields = Object.entries(c.expectItemFields)
136
+ const carried = (body.items || []).some((i) =>
137
+ fields.every(([k, v]) => JSON.stringify(i[k]) === JSON.stringify(v)),
138
+ )
139
+ if (!carried) reasons.push(`no item carries ${JSON.stringify(c.expectItemFields)}`)
140
+ }
134
141
  const itemOutcomes = (body.items || []).map((i) => i.outcome)
135
142
  if (Array.isArray(c.expectItemOutcomes)) {
136
143
  for (const want of c.expectItemOutcomes) {
@@ -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,oGAAoG;IACpG,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,iFAAiF;IACjF,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;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AO,CAAC,WAAW;IASnB,sEAAsE;IACtE,OAAO,CAAC,qBAAqB;IAY7B,6EAA6E;IAC7E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,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,gGAAgG;QAChG,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,cAAc,CAAC,EAAE,cAAc,CAAA;KAChC,GACA,UAAU,CA4EZ;IAED,kFAAkF;IAClF,OAAO,CAAC,YAAY;IAiCpB,OAAO,CAAC,aAAa;CAqHtB"}
package/dist/audit.js CHANGED
@@ -170,6 +170,7 @@ const LOCK_POLL_MS = 15;
170
170
  // until it is this old. The cost is bounded: such a crash blocks the sink for
171
171
  // LOCK_STALE_MS and, being fail-closed, blocks access with it.
172
172
  const LOCK_STALE_MS = 30_000;
173
+ const LOCK_HINT = ': each running gateway needs its own audit.sink path; audit.receiptSink can be shared';
173
174
  // A lock that vanished between the failed create and this call reads as
174
175
  // infinitely old, which sends the caller down the retry path — the same place
175
176
  // an expired lock lands, and the next create attempt is the one that decides.
@@ -231,8 +232,20 @@ function acquireSinkLockOnce(sink) {
231
232
  throw new Error('another process holds the audit sink lock (pid unknown)');
232
233
  }
233
234
  function acquireSinkLock(sink, opts = {}) {
234
- if (!opts.wait)
235
- return acquireSinkLockOnce(sink);
235
+ if (!opts.wait) {
236
+ // Only the constructor takes a lock without waiting, and only on audit.sink.
237
+ // A write that times out may be waiting on a shared receipt sink, where
238
+ // changing audit.sink resolves nothing, so the hint stays off that path.
239
+ try {
240
+ return acquireSinkLockOnce(sink);
241
+ }
242
+ catch (err) {
243
+ const msg = err.message;
244
+ if (msg.includes('another process holds'))
245
+ throw new Error(`${msg}${LOCK_HINT}`);
246
+ throw err;
247
+ }
248
+ }
236
249
  const deadline = Date.now() + LOCK_WAIT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ACD,MAAM,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;gBACpD,IAAI,CAAC,OAAO,EAAE,CAAC;oBACb,MAAM,IAAI,KAAK,CACb,iDAAiD,KAAK,CAAC,GAAG,CAAC,KAAK,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"}
@@ -579,6 +579,52 @@ bound does not decide), and `receipted-without-observation` makes
579
579
  `outcome` `exceptions`. `bounds.exclusion` is `operator-declared` only
580
580
  when the profile lists at least one exclusion rule.
581
581
 
582
+ A declared multiplicity bound is how many statements one Receipt may cover,
583
+ however many objects the Receipt names. A statement is covered by one in-window
584
+ Receipt that names all of its pattern's objects or, when no in-window Receipt
585
+ names them all, by an in-window Receipt for each object. The patterns whose
586
+ objects all have a Receipt in the Window draw on the in-window Receipts; a
587
+ pattern with an object no Receipt in the Window names takes its outcome from
588
+ that object and draws on none.
589
+
590
+ Of the patterns that draw, one whose call delta is more than bound × the
591
+ in-window Receipts that name one of its objects is `observed-without-receipt`
592
+ with reason `multiplicity-exceeded`; it still draws on the Receipts, because its statements
593
+ were observed. The statements of the patterns that draw are assigned to
594
+ Receipts as a maximum flow. Of the patterns not over the bound on their own,
595
+ one that some maximum assignment leaves with a statement uncovered is
596
+ `indeterminate` with reason `multiplicity-shared`: the evidence does not say
597
+ which statements the Receipts covered. Every other pattern is `matched`. The
598
+ comparison errs toward `indeterminate` in two situations. A pattern over
599
+ several objects that some in-window Receipt names whole draws only on the
600
+ Receipts that name it whole. A pattern over several objects that no in-window
601
+ Receipt names whole is drawn
602
+ against each object's Receipts, and objects named by exactly the same Receipts
603
+ share one draw; a Receipt that names two of its objects that do not share a
604
+ draw is counted once for each.
605
+
606
+ A `multiplicity-exceeded` item carries
607
+ `multiplicity: { bound, object, receipts, statements }`: `object` is the object
608
+ whose bound decided it, as Receipts are matched to it (the last name segment,
609
+ lower case), `receipts` the in-window Receipts naming it, and `statements` the
610
+ pattern's call delta. A `multiplicity-shared` item carries
611
+ `multiplicity: { bound, objects, receipts, statements }` for the patterns it
612
+ competes with for Receipts: `objects` are the objects they draw for, `receipts`
613
+ the in-window Receipts they can draw on, and `statements` their call deltas
614
+ added together. A pattern drawn one Receipt per object can compete in two such
615
+ groups; it reports the one whose statements are furthest over
616
+ `receipts × bound`.
617
+
618
+ A `/2` item whose `reason` is `window-boundary` carries `requiredSkewMs` and the
619
+ uncovered `objects`. When the profile declares a multiplicity bound it also
620
+ carries `multiplicity: { bound, object, receipts, statements, exceededIfAdmitted }`:
621
+ `statements` is the pattern's call delta in the window, `receipts` the number of
622
+ Receipts with a readable timestamp that name `object`, inside the Window or out,
623
+ and `object` the one of the pattern's objects with the fewest such Receipts.
624
+ `exceededIfAdmitted` is `statements > receipts × bound`: the count exceeds the
625
+ bound even with every Receipt naming the object admitted. The item stays
626
+ `indeterminate` either way, and `false` is not a pass.
627
+
582
628
  ### Mapping Profile (`conarium-mapping-profile/0.1`)
583
629
 
584
630
  A Mapping Profile is an operator declaration. It is versioned, serialized as
@@ -606,7 +652,7 @@ undeclared, not defaulted.
606
652
 
607
653
  | Field | Type | Encoding | What it declares |
608
654
  |---|---|---|---|
609
- | `multiplicity.maxStatementsPerReceipt` | integer ≥ 1 | JSON number | how many source statements one receipt may cover |
655
+ | `multiplicity.maxStatementsPerReceipt` | integer ≥ 1 | JSON number | how many source statements one receipt may cover, however many objects it names. The patterns whose objects all have a receipt in the window draw on the in-window receipts together |
610
656
  | `exclusions[]` | array | `{ "id": string, "version": string }` | rules that remove items before comparison |
611
657
  | `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`. |
612
658
  | `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`. |
@@ -0,0 +1,61 @@
1
+ # Claims review — 0.3.6
2
+
3
+ - base: v0.3.5
4
+ - head: 8c1617e
5
+ - surface: sha256:105ec8031c795c5056c2e61ccea0cde81b83683a2a1a4c77fc7d14282462640a
6
+ - verdict: pass
7
+ - reviewer: Claude. Four claim surfaces changed between v0.3.5 and HEAD:
8
+ `LIMITATIONS.md`, `LIMITATIONS.tr.md`, `README.md` and `docs/RECEIPT-SPEC.md`
9
+ (`node test/denetci.mjs input v0.3.5 HEAD`).
10
+
11
+ The release changes `projectResultV2` and the text report in
12
+ `bin/conarium-reconcile.mjs`, the lock error in `src/audit.ts`, the conformance
13
+ harness and two cases, the package description, and the dependencies named in
14
+ the changelog.
15
+
16
+ Each new sentence was set against what establishes it:
17
+
18
+ - "three receipts, three statements and a bound of 1 report
19
+ `multiplicity-exceeded`", and "a run whose `/2` outcome is `exceptions` can
20
+ still exit 0": `three receipts do not raise a bound of 1` in
21
+ `test/reconcile_cli.test.mjs`, which runs the CLI and reads both the body and
22
+ the exit code.
23
+ - "Statements of separate patterns are not added together against one receipt":
24
+ `separate patterns are not added together` in the same file.
25
+ - `multiplicity.exceededIfAdmitted` and "the outcome does not change": the
26
+ `a boundary item carries` block in that file, and
27
+ `conformance/cases/reconciliation/v2-window-boundary-bound-exceeded.json` and
28
+ `v2-window-boundary-bound-held.json`, which forbid `matched` and
29
+ `observed-without-receipt` on the item.
30
+ - "the comparison a pattern inside the window gets": `d.delta > max` here and
31
+ `d.delta <= max` in the reconciled branch of `projectResultV2`.
32
+
33
+ The changelog is not a claim surface, but its sentences were checked the same
34
+ way. "1 statement and 10,000 statements as the same finding" was measured on
35
+ v0.3.5 with a bound of 1 and one Receipt 3 seconds outside the Window. The
36
+ exit code assertion in the boundary tests holds "exit codes do not change".
37
+
38
+ ## Findings
39
+
40
+ ### 1. docs/RECEIPT-SPEC.md:616 — what the bound is compared with
41
+
42
+ - Claim: "how many source statements one receipt may cover"
43
+ - Mechanism: `d.delta <= max` in `projectResultV2`
44
+ - Why it falls short: the comparison is one pattern's statement count in the
45
+ window. The number of receipts does not enter it, so the sentence described a
46
+ rule the implementation does not apply. This predates the release and was
47
+ found while checking the boundary change.
48
+ - Disposition: the row now states the comparison, `LIMITATIONS.md` states the
49
+ consequence, and tests hold both. The behaviour is not changed here, because
50
+ changing it moves `matched` outcomes and needs a decision on what the bound
51
+ counts.
52
+
53
+ ### 2. README.md:6 — the Agora badge
54
+
55
+ - Claim: alt text "Agora: MCP handshake check", and the image, which read
56
+ "agora" and "runs locally" when this review was written
57
+ - Mechanism: a third-party site's own check, served as a remote image
58
+ - Why it falls short: this repository does not establish what that check tests,
59
+ and the image can change without a release of this package
60
+ - Disposition: kept. The badge is attributed to its publisher and links to its
61
+ listing, and it makes no statement in this project's voice.
@@ -0,0 +1,165 @@
1
+ # Claims review — 0.3.7
2
+
3
+ - base: v0.3.6
4
+ - head: 8563bc6
5
+ - surface: sha256:aefdbafd7270ffbf2fdb2f682303350e1b67fcb8c4dcf83e9adef1f5fe6afa53
6
+ - verdict: pass
7
+ - reviewer: Claude. Three claim surfaces changed between v0.3.6 and HEAD:
8
+ `LIMITATIONS.md`, `LIMITATIONS.tr.md` and `docs/RECEIPT-SPEC.md`
9
+ (`node test/denetci.mjs input v0.3.6 HEAD`).
10
+
11
+ The release changes `projectResultV2` and the text report in
12
+ `bin/conarium-reconcile.mjs`, adds `namingReceiptCounts`, `boundAssignment`
13
+ (a maximum flow from patterns to groups of in-window Receipts) and
14
+ `boundaryMultiplicity`, updates two conformance cases and adds three.
15
+
16
+ Each new sentence was set against what establishes it. The tests named are in
17
+ `test/reconcile_cli.test.mjs`, under `what a declared bound is compared with`
18
+ and `a boundary item carries what the outcome alone does not show`; each runs
19
+ the CLI and reads the `/2` body. "Seen failing" means the test went red when
20
+ the code it names was changed back, and green again when it was restored.
21
+
22
+ - "how many statements one Receipt may cover, however many objects the Receipt
23
+ names": `a receipt that names two objects is one budget, not one per object`,
24
+ and `conformance/cases/reconciliation/v2-multiplicity-one-receipt-two-objects.json`.
25
+ Seen failing with a group's capacity multiplied by the objects it names.
26
+ - "A statement is covered by one in-window Receipt that names all of its
27
+ pattern's objects or, when no in-window Receipt names them all, by an
28
+ in-window Receipt for each object": `one receipt that names both objects of
29
+ a join covers one statement of it`, `a join is covered by one receipt for
30
+ each of its objects`, `a join no receipt names whole is covered by receipts
31
+ that each name some of its objects`.
32
+ - "The patterns whose objects all have a Receipt in the Window draw on the
33
+ in-window Receipts": `two patterns against one object draw on the same
34
+ receipt and neither is matched`, `two receipts cover the two patterns`,
35
+ `three receipts at a bound of 1 cover three statements`, and
36
+ `v2-multiplicity-shared.json`, `v2-multiplicity-per-receipt.json`.
37
+ - "a pattern with an object no Receipt in the Window names takes its outcome
38
+ from that object and draws on none": `a pattern with an object no receipt
39
+ names does not draw on its neighbour's receipts`.
40
+ - "Of the patterns that draw, one whose call delta is more than bound × the
41
+ in-window Receipts that name one of its objects is `observed-without-receipt`": `one receipt at a
42
+ bound of 1 does not cover three statements`, `a pattern that names two
43
+ objects is bound by the object with fewer receipts`. "it still draws on the
44
+ Receipts": `one pattern over its own bound is not softened by a neighbour on
45
+ the same object`. Seen failing with such patterns left out of the flow.
46
+ - "one that some maximum assignment leaves with a statement uncovered is
47
+ `indeterminate` with reason `multiplicity-shared`" and "Every other pattern
48
+ is `matched`": `patterns that fit each object on its own can still be more
49
+ than their receipts cover together` (each object fits its own Receipts, the
50
+ two Receipts that name orders cover two of three statements), and `a pattern
51
+ with receipts to spare is matched beside a shortfall it cannot take part in`.
52
+ The second holds because the set of nodes reachable from the source in the
53
+ residual graph is the same for every maximum flow.
54
+ - "A pattern over several objects that some in-window Receipt names whole
55
+ draws only on the Receipts that name it whole": `a join that some receipt
56
+ names whole draws only on receipts that name it whole`. Seen failing with
57
+ that branch removed.
58
+ - "objects named by exactly the same Receipts share one draw; a Receipt that
59
+ names two of its objects that do not share a draw is counted once for each":
60
+ `a join no receipt names whole is covered by receipts that each name some of
61
+ its objects` (seen failing with one node per object) and `a join no receipt
62
+ names whole, named by receipts that overlap, counts a shared receipt once
63
+ per object`.
64
+ - `multiplicity-exceeded` fields: the two exceeded tests above. `object` "as
65
+ Receipts are matched to it": the same tests read `customers` and `orders`
66
+ for Receipts naming `zion.customers` and `zion.orders`.
67
+ - `multiplicity-shared` fields, "`objects` are the objects they draw for,
68
+ `receipts` the in-window Receipts they can draw on, and `statements` their
69
+ call deltas added together": the shared tests above (in the first, two of
70
+ three Receipts and three statements; the Receipt that names only products is
71
+ not counted). "it reports the one whose statements are furthest over":
72
+ `a join covered one receipt per object reports the group furthest over the
73
+ bound`. Seen failing with the last group written instead.
74
+ - "Receipts outside the window do not count toward this comparison": `a
75
+ receipt outside the Window does not count toward an in-window bound`.
76
+ - "`/2` does not change the exit codes": the exit code assertion in `one
77
+ receipt at a bound of 1 does not cover three statements`, and `the receipt
78
+ counts stay out of the /1 body` for the `/1` body. Seen failing when the
79
+ counts were made enumerable.
80
+ - Boundary item, "`receipts` the number of Receipts with a readable timestamp
81
+ that name `object`, inside the Window or out" and `exceededIfAdmitted`:
82
+ `every receipt naming the object counts when the item asks what admitting
83
+ them would settle` (two Receipts outside, two statements, `false`).
84
+ - "`object` the one of the pattern's objects with the fewest such Receipts": `a
85
+ boundary item that names two objects reports the one with fewer receipts`.
86
+ Seen failing with the comparison reversed.
87
+ - "The item stays `indeterminate` either way": the boundary tests, and
88
+ `v2-window-boundary-bound-exceeded.json` and `v2-window-boundary-bound-held.json`,
89
+ which forbid `matched` and `observed-without-receipt` on the item.
90
+
91
+ The changelog is not a claim surface, but its sentences were checked the same
92
+ way. The 0.3.6 behaviour it describes is the table in #161, measured on the
93
+ published 0.3.6. The three added conformance cases were run against the
94
+ previous `bin/conarium-reconcile.mjs` and failed.
95
+
96
+ ## Findings
97
+
98
+ ### 1. LIMITATIONS.md — which patterns draw on the receipts
99
+
100
+ - Claim: "every pattern on that object draws on the same receipts" (first
101
+ draft of this release, also in `LIMITATIONS.tr.md`, `docs/RECEIPT-SPEC.md` and
102
+ the changelog).
103
+ - Mechanism: the patterns `projectResultV2` assigns are `result.reconciled`
104
+ only.
105
+ - Why it falls short: a pattern with an object no in-window receipt names is in
106
+ `unreconciled` or `indeterminate` and draws on nothing, so "every pattern"
107
+ says more than the code does.
108
+ - Disposition: reworded before `8563bc6` to name the patterns that draw, with a
109
+ test for the case.
110
+
111
+ ### 2. LIMITATIONS.md — what an item short of in-window receipts is called
112
+
113
+ - Claim: "such an item is reported as `multiplicity-exceeded`, not as a
114
+ boundary item" (first draft, also in `LIMITATIONS.tr.md`).
115
+ - Mechanism: the reconciled branch of `projectResultV2`.
116
+ - Why it falls short: when the shortfall comes from patterns sharing
117
+ receipts, the item is `multiplicity-shared`, not `multiplicity-exceeded`.
118
+ - Disposition: reworded before `8563bc6` to "decided by the in-window receipts
119
+ alone, not reported as a boundary item".
120
+
121
+ ### 3. LIMITATIONS.md — one receipt's bound counted once per object
122
+
123
+ - Claim: "The receipts in the window that name an object admit receipts ×
124
+ bound statements against it" (a draft of this release, which compared each
125
+ object's receipts with the statements on that object).
126
+ - Mechanism: a load per object, set against the in-window receipts naming
127
+ that object.
128
+ - Why it falls short: a receipt that names two objects was counted in both
129
+ objects' capacity. One receipt naming customers and orders, at a bound of 1,
130
+ covered a customers statement and an orders statement, and both were
131
+ `matched`. Reproduced with the CLI;
132
+ `v2-multiplicity-one-receipt-two-objects` fails on that draft.
133
+ - Disposition: the code was changed before `788c641` to one budget per
134
+ receipt, assigned as a maximum flow, and the sentences rewritten. The two
135
+ cases where the flow errs toward `indeterminate` are stated in
136
+ `LIMITATIONS.md`, each with a test.
137
+
138
+ ### 4. docs/RECEIPT-SPEC.md — what is assigned, and when
139
+
140
+ - Claim: "Otherwise the statements are assigned to Receipts as a maximum
141
+ flow" (a draft of this release).
142
+ - Mechanism: `boundAssignment` puts every reconciled pattern in the flow.
143
+ - Why it falls short: "Otherwise" read as if a pattern over the bound on its
144
+ own were left out of the assignment; it is in it.
145
+ - Disposition: reworded before `8563bc6`. The same pass changed
146
+ "beside the patterns it shares them with" in `LIMITATIONS.md`, which did not
147
+ fit a pattern that is `multiplicity-shared` with no neighbour (the two
148
+ limit cases), and "named by receipts that overlap", which did not say when a
149
+ receipt is counted twice.
150
+
151
+ ### 5. docs/RECEIPT-SPEC.md — which patterns the bound decides
152
+
153
+ - Claim: "A pattern whose call delta is more than bound × the in-window
154
+ Receipts that name one of its objects is `observed-without-receipt`" (a
155
+ draft of this release, also in `LIMITATIONS.md`, `LIMITATIONS.tr.md` and the
156
+ changelog).
157
+ - Mechanism: the reconciled branch of `projectResultV2`, which sees only
158
+ patterns whose objects all have an in-window Receipt.
159
+ - Why it falls short: read alone, the sentence also covers a pattern whose
160
+ only Receipts are outside the Window: three statements against no in-window
161
+ Receipt are more than 1 × 0, yet that pattern is a boundary item and stays
162
+ `indeterminate` (`10,000 statements against one bound of 1 stay
163
+ indeterminate and say the bound is exceeded`).
164
+ - Disposition: reworded before `8563bc6` to "Of the patterns that draw", and
165
+ the `multiplicity-shared` sentences scoped the same way.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conarium-ai/core",
3
- "version": "0.3.5",
3
+ "version": "0.3.7",
4
4
  "mcpName": "io.github.dogrucanemek-alt/conarium",
5
5
  "//files-artefakt": "Generated files under examples/ (private key, receipt/audit JSONL) are EXCLUDED. .gitignore does not bind npm: because the allow-list contained 'examples', `npm publish` on a machine that had run the demo was shipping _keys/audit-ed25519.pem (PRIVATE KEY) and the receipts. test/pack_artefakt.mjs locks this. The exclusions are LIMITED to examples/: receipts.jsonl and .pub.pem under test-vectors/ MUST ship, or a third party cannot run the conformance vectors.",
6
6
  "//files": "Allow-list of what enters the package. Without it npm sent everything: 296 files / 1.5 MB — CI workflows, gitleaks config, a 137 KB marketing image, the site's api/chat.js. A bank security team opens the tarball and sees those. scripts/ is here ON PURPOSE: conarium-reconcile references scripts/pg-snapshot.sql at runtime; without it the user files a support mail.",
@@ -51,7 +51,7 @@
51
51
  "LIMITATIONS.tr.md",
52
52
  "CHANGELOG.md"
53
53
  ],
54
- "description": "Governed MCP gateway for AI data access: policy enforcement and PII masking, an Ed25519-signed receipt per mediated access that a third party verifies offline (written when a receipt sink is configured, which conarium-init sets), coverage reconciliation against the database's own query counters to surface access that bypassed the gateway, and conformance vectors so the receipt format can be implemented without us. Self-hosted, MIT.",
54
+ "description": "Self-hosted, governed MCP gateway for AI data access: policy enforcement, PII masking, a signed receipt per access once a receipt sink is configured (conarium-init sets one), and coverage reconciliation against the database's own query counters. MIT.",
55
55
  "keywords": [
56
56
  "mcp",
57
57
  "ai",
@@ -126,9 +126,9 @@
126
126
  },
127
127
  "dependencies": {
128
128
  "@eslint-community/regexpp": "4.12.2",
129
- "@guanmingchiu/sqlparser-ts": "^0.62.0",
130
- "@modelcontextprotocol/sdk": "^1.0.0",
131
- "express": "^5.2.1",
129
+ "@guanmingchiu/sqlparser-ts": "^0.63.0",
130
+ "@modelcontextprotocol/sdk": "^1.32.2",
131
+ "express": "^5.3.0",
132
132
  "node-sql-parser": "^5.4.0",
133
133
  "pgsql-ast-parser": "^12.0.2",
134
134
  "postgres": "^3.4.4",
@@ -138,10 +138,10 @@
138
138
  "devDependencies": {
139
139
  "@jazzer.js/core": "^4.0.0",
140
140
  "@types/express": "^5.0.6",
141
- "@types/node": "^26.4.1",
142
- "fast-check": "^4.9.0",
143
- "supertest": "^7.2.2",
144
- "tsx": "^4.23.13",
141
+ "@types/node": "^26.6.5",
142
+ "fast-check": "^4.10.2",
143
+ "supertest": "^7.3.1",
144
+ "tsx": "^4.23.15",
145
145
  "typescript": "^7.0.2",
146
146
  "vitest": "^5.0.0"
147
147
  },