@conarium-ai/core 0.3.7 → 0.3.9

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,32 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.9 - a boundary item over the bound either way is observed-without-receipt
4
+
5
+ When a boundary item's `exceededIfAdmitted` is `true`, the item is over the
6
+ declared bound under either reading of the clock, so the clock does not decide
7
+ it. Following draft-08, `/2` reports it as `observed-without-receipt` with
8
+ reason `multiplicity-exceeded`, the offset and the bound, where draft-07
9
+ required `indeterminate`. Issue #101 reported the case: 10,000 statements
10
+ against one Receipt, a bound of 1, one `indeterminate` item. Thanks to
11
+ giskard09 for the report. `/1` still exits 41 for it, and without a declared
12
+ bound no item leaves `indeterminate` this way. The conformance case
13
+ `v2-window-boundary-bound-exceeded` now expects `observed-without-receipt`.
14
+
15
+ ## 0.3.8 - the patterns beside a join that a Receipt names in part are decided together
16
+
17
+ 0.3.7 said its comparison errs toward `indeterminate` for a pattern over
18
+ several objects that a Receipt names in part. That was not so for the patterns
19
+ beside it. With a bound of 1, Receipts naming customers and orders, customers,
20
+ and orders, two statements of a customers-orders join and one on orders, 0.3.7
21
+ reported the orders pattern `matched`. Covering both join statements, one with
22
+ the join Receipt and one with the other two, leaves the orders statement
23
+ uncovered and covers as many statements as any assignment can, so the orders
24
+ pattern is `indeterminate`. In 0.3.8 the patterns that share a Receipt with
25
+ such a pattern are decided together: if any of their statements is left
26
+ uncovered, each of them not over the bound on its own is `indeterminate`. The
27
+ conformance case `v2-multiplicity-join-neighbour` is added; it fails on 0.3.7.
28
+ The `/1` JSON body and the exit codes do not change.
29
+
3
30
  ## 0.3.7 - a multiplicity bound counts per Receipt
4
31
 
5
32
  `multiplicity.maxStatementsPerReceipt` is documented as how many source
package/LIMITATIONS.md CHANGED
@@ -320,12 +320,18 @@ bound × the receipts in the window that name one of its objects is
320
320
  pattern that draws, whose statements the receipts cannot be shown to cover
321
321
  beside the patterns that draw on the same receipts, is `indeterminate` with reason `multiplicity-shared`, because the
322
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
323
+ is approximate for a pattern that draws, over several objects, when a receipt
324
+ in the window names one of its objects but not all of them. If some receipt in the window
325
+ names the pattern whole, it draws only on the receipts that name it whole, even
326
+ when the others would cover the rest. If none does, it counts a receipt that
327
+ names two of its objects once for each, unless every receipt that names one of
328
+ the two names the other. Either way, a pattern beside it could look covered
329
+ when another assignment would leave it short. So every pattern that draws and
330
+ shares a receipt in the window with such a pattern, directly or through other
331
+ patterns that draw, is decided together with it: if any of their statements is left uncovered,
332
+ each of them not over the bound on its own is `indeterminate`, even one that a
333
+ closer count would show covered. The comparison errs only toward
334
+ `indeterminate`. Receipts outside the window do not count toward this comparison, even
329
335
  when one of them would cover the shortfall: such an item is decided by the
330
336
  in-window receipts alone, not reported as a boundary item. `/2` does not change the exit
331
337
  codes, so a run whose `/2` outcome is `exceptions` can still exit 0. A check on
@@ -342,8 +348,11 @@ because this tool has no way to know which of the two happened. That is a
342
348
  limit, not a verdict: 41 is a failure and the run does not pass, but nothing
343
349
  is proven either way. Under a declared bound the `/2` item says whether the
344
350
  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.
351
+ admitted (`multiplicity.exceededIfAdmitted`). When it does, both readings of the
352
+ clock give the same answer, so the clock does not decide the item: `/2` reports
353
+ it as `observed-without-receipt` with reason `multiplicity-exceeded`, the offset
354
+ and the bound (draft-08). The `/1` result and exit 41 do not change. When it
355
+ does not, the item stays `indeterminate`, and `false` is not a pass.
347
356
 
348
357
  The exculpation is bounded by the window's own length — an offset larger than
349
358
  the window cannot be a boundary artefact, and the report says so instead of
package/LIMITATIONS.tr.md CHANGED
@@ -316,13 +316,20 @@ fazla olan desen `observed-without-receipt` olur, gerekçesi
316
316
  `multiplicity-exceeded`. Pay alan ve ifadelerinin, aynı makbuzlardan pay alan
317
317
  desenlerin yanında makbuzlarca karşılandığı gösterilemeyen başka her desen
318
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
319
+ söylemez. Pay alan ve birden çok nesneli bir desende, pencere içindeki bir
320
+ makbuz nesnelerinden birini adlandırıp hepsini adlandırmıyorsa kıyas
321
+ yaklaşıktır.
322
+ Deseni pencere içinde bütünüyle adlandıran bir makbuz varsa desen yalnız onu
323
+ bütünüyle adlandıran makbuzlardan pay alır, ötekiler kalanı karşılayacak olsa
324
+ bile. Yoksa iki nesnesini adlandıran bir makbuzu her biri için ayrı sayar; o
325
+ iki nesneden birini adlandıran her makbuz ötekini de adlandırıyorsa saymaz. İki
326
+ durumda da yanındaki bir desen, başka bir atamada açıkta kalacakken karşılanmış
327
+ görünebilir. Bu yüzden pay alan ve böyle bir desenle pencere içinde doğrudan ya
328
+ da pay alan başka desenler üzerinden makbuz paylaşan her desen onunla birlikte
329
+ karara bağlanır:
330
+ ifadelerinden biri açıkta kalırsa, tek başına sınırı aşmayan her biri
331
+ `indeterminate` olur, daha yakın bir sayımın karşılanmış göstereceği bir desen
332
+ bile. Kıyas yalnız `indeterminate` yönüne yanılır. Pencere dışındaki makbuzlar bu
326
333
  kıyasa girmez, açığı kapatacak olsalar bile: böyle bir kalem yalnız pencere
327
334
  içindeki makbuzlarla karara bağlanır, sınır kalemi olarak raporlanmaz. `/2` çıkış kodlarını
328
335
  değiştirmez; bu yüzden `/2` sonucu `exceptions` olan bir koşu yine 0 ile
@@ -357,8 +364,11 @@ kapsayacak olan makbuz pencerenin dışına düşerse sonuç `indeterminate` olu
357
364
  bilemez. Bu bir hüküm değil, bir sınır: 41 başarısızlıktır, koşu geçmez, ama
358
365
  hiçbir yön kanıtlanmış olmaz. Sınır beyan edilmişse `/2` kalemi, nesnelerini
359
366
  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.
367
+ (`multiplicity.exceededIfAdmitted`). Aşıyorsa saatin iki okuması da aynı sonucu
368
+ verir, yani kalemi saat belirlemez: `/2` onu `observed-without-receipt` olarak,
369
+ `multiplicity-exceeded` gerekçesi, fark ve sınırla raporlar (draft-08). `/1`
370
+ sonucu ve 41 çıkış kodu değişmez. Aşmıyorsa kalem `indeterminate` kalır;
371
+ `false` değeri de geçti anlamına gelmez.
362
372
 
363
373
  Aklama, pencerenin kendi uzunluğuyla sınırlı: pencereden uzun bir fark sınır
364
374
  etkisiyle açıklanamaz ve rapor bunu mazeret göstermek yerine açıkça yazar.
@@ -394,16 +394,21 @@ class FlowNetwork {
394
394
  * a bound of `max` statements per Receipt.
395
395
  *
396
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.
397
+ * objects or by one Receipt for each object; a Receipt covers at most `max`
398
+ * statements. Every reconciled pattern draws on the Receipts, including one
399
+ * over the bound on its own, because its statements were observed. A pattern
400
+ * is shared when some maximum assignment leaves one of its statements
401
+ * uncovered: the evidence does not say which statements the Receipts covered.
402
+ * The rest are covered in every maximum assignment.
403
+ *
404
+ * The flow is exact except for a pattern over several objects that a Receipt
405
+ * names in part (rough). Where one draws, the patterns that share Receipts with
406
+ * it are all shared unless the flow covers every one of their statements, so
407
+ * the result errs only toward shared.
404
408
  *
405
409
  * A shared pattern's `group` is the patterns and Receipt groups it competes
406
- * with: their statements are more than those Receipts admit.
410
+ * with: their statements are more than those Receipts admit, or, for a pattern
411
+ * shared only beside a rough one, all the patterns taken together with it.
407
412
  */
408
413
  export function boundAssignment(reconciled, groups, max) {
409
414
  const S = 0
@@ -411,6 +416,18 @@ export function boundAssignment(reconciled, groups, max) {
411
416
  const groupNode = (gi) => 2 + gi
412
417
  let next = 2 + groups.length
413
418
  const nodes = [] // { pattern, demand, targets }
419
+ // The groups a pattern can draw on in fact: every one that names one of its
420
+ // objects. A pattern over several objects that one of them names without the
421
+ // rest is drawn on fewer, or on some twice, so the assignment below only
422
+ // approximates it (rough).
423
+ const reach = new Map()
424
+ const rough = new Set()
425
+ for (const [pi, d] of reconciled.entries()) {
426
+ const tables = [...new Set(d.tables)]
427
+ const naming = groups.flatMap((g, gi) => (tables.some((t) => g.objects.includes(t)) ? [gi] : []))
428
+ reach.set(pi, naming)
429
+ if (tables.length > 1 && naming.some((gi) => !tables.every((t) => groups[gi].objects.includes(t)))) rough.add(pi)
430
+ }
414
431
  for (const [pi, d] of reconciled.entries()) {
415
432
  const tables = [...new Set(d.tables)]
416
433
  const full = groups.flatMap((g, gi) => (tables.every((t) => g.objects.includes(t)) ? [gi] : []))
@@ -475,6 +492,43 @@ export function boundAssignment(reconciled, groups, max) {
475
492
  }
476
493
  for (const pi of c.patterns) if (!shared.has(pi) || over(group) > over(shared.get(pi))) shared.set(pi, group)
477
494
  }
495
+
496
+ // Where a rough pattern draws, the assignment can leave a neighbour covered
497
+ // that another maximum assignment would not. So when the patterns that share
498
+ // Receipts with a rough pattern are not all covered, none of them is shown
499
+ // covered. When they are all covered, the assignment is a real one, and every
500
+ // maximum assignment covers them all.
501
+ const all = new Map()
502
+ const findAll = (x) => (all.get(x) === x ? x : (all.set(x, findAll(all.get(x))), all.get(x)))
503
+ const unite = (a, b) => {
504
+ for (const x of [a, b]) if (!all.has(x)) all.set(x, x)
505
+ all.set(findAll(a), findAll(b))
506
+ }
507
+ const patternKey = (pi) => `p${pi}`
508
+ for (const [pi] of reconciled.entries()) {
509
+ unite(patternKey(pi), patternKey(pi))
510
+ for (const gi of reach.get(pi)) unite(patternKey(pi), `g${gi}`)
511
+ }
512
+ const components = new Map()
513
+ for (const [pi] of reconciled.entries()) {
514
+ const root = findAll(patternKey(pi))
515
+ if (!components.has(root)) components.set(root, { patterns: new Set(), objects: new Set(), groups: new Set(), short: false, rough: false })
516
+ const c = components.get(root)
517
+ c.patterns.add(pi)
518
+ for (const t of reconciled[pi].tables || []) c.objects.add(t)
519
+ for (const gi of reach.get(pi)) c.groups.add(gi)
520
+ if (rough.has(pi)) c.rough = true
521
+ }
522
+ for (const n of nodes) if (inS(n.id)) components.get(findAll(patternKey(n.pattern))).short = true
523
+ for (const c of components.values()) {
524
+ if (!c.rough || !c.short) continue
525
+ const group = {
526
+ objects: [...c.objects].sort(),
527
+ receipts: [...c.groups].reduce((sum, gi) => sum + groups[gi].count, 0),
528
+ statements: [...c.patterns].reduce((sum, pi) => sum + reconciled[pi].delta, 0),
529
+ }
530
+ for (const pi of c.patterns) if (!shared.has(pi)) shared.set(pi, group)
531
+ }
478
532
  return shared
479
533
  }
480
534
 
@@ -844,17 +898,31 @@ export function projectResultV2(result, ctx) {
844
898
  throw new Error('projectResultV2: the result carries no receipt counts; pass the value reconcile() returned')
845
899
  }
846
900
 
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.
901
+ // The temporal rule keeps a boundary item indeterminate, because the clock
902
+ // decides it. Under a declared bound, an item whose count exceeds the bound
903
+ // even with every Receipt naming its objects admitted is over it under either
904
+ // reading of the clock, so the clock does not decide it: draft-08 makes it
905
+ // observed-without-receipt and requires the offset and the bound on the item
906
+ // (#101). Otherwise the item carries what admitting those Receipts would and
907
+ // would not settle.
851
908
  for (const d of result.indeterminate) {
909
+ const multiplicity = max != null ? boundaryMultiplicity(d, naming, max) : null
910
+ if (multiplicity?.exceededIfAdmitted) {
911
+ push('observed-without-receipt', {
912
+ pattern: patternDigest(d.query),
913
+ reason: 'multiplicity-exceeded',
914
+ requiredSkewMs: d.requiredSkewMs,
915
+ objects: d.uncoveredTables,
916
+ multiplicity,
917
+ })
918
+ continue
919
+ }
852
920
  push('indeterminate', {
853
921
  pattern: patternDigest(d.query),
854
922
  reason: 'window-boundary',
855
923
  requiredSkewMs: d.requiredSkewMs,
856
924
  objects: d.uncoveredTables,
857
- ...(max != null ? { multiplicity: boundaryMultiplicity(d, naming, max) } : {}),
925
+ ...(multiplicity ? { multiplicity } : {}),
858
926
  })
859
927
  }
860
928
 
@@ -1132,7 +1200,8 @@ async function main(argv = process.argv.slice(2)) {
1132
1200
  const m = boundaryMultiplicity(d, result.namingReceipts, max)
1133
1201
  return m.exceededIfAdmitted
1134
1202
  ? `\n ${d.delta} statements exceed the declared multiplicity bound of ${max} even if all ` +
1135
- `${m.receipts} receipt(s) naming ${m.object} are admitted`
1203
+ `${m.receipts} receipt(s) naming ${m.object} are admitted, so the clock does not decide it: ` +
1204
+ '/2 reports it as observed-without-receipt'
1136
1205
  : ''
1137
1206
  }
1138
1207
  const line = (d) =>
@@ -0,0 +1,18 @@
1
+ {
2
+ "id": "reconciliation/v2-multiplicity-join-neighbour",
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-join-and-orders.json",
9
+ "receipts": "conformance/fixtures/reconciliation/receipts-join-whole-and-parts.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" },
16
+ "rationale": "The bound is 1. One Receipt names customers and orders, one names customers, one names orders. A customers-orders join has two statements and an orders pattern has one. Covering both join statements, one with the join Receipt and one with the customers Receipt and the orders Receipt, leaves the orders statement uncovered, and no assignment covers more than two statements. So the orders pattern is not shown covered, and neither is the join.",
17
+ "doesNotTest": "Whether the Receipts belong to the statements. The comparison is a count against a declared bound."
18
+ }
@@ -9,9 +9,9 @@
9
9
  "receipts": "conformance/fixtures/reconciliation/receipts-customers-early.jsonl",
10
10
  "mappingProfile": "conformance/fixtures/reconciliation/profile-multiplicity-1.json",
11
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.",
12
+ "expectItemOutcomes": ["observed-without-receipt"],
13
+ "forbidItemOutcomes": ["matched", "indeterminate"],
14
+ "expectItemFields": { "reason": "multiplicity-exceeded", "requiredSkewMs": 3000, "multiplicity": { "bound": 1, "object": "customers", "receipts": 1, "statements": 5, "exceededIfAdmitted": true } },
15
+ "rationale": "The only Receipt naming the object falls outside the Window, and the statement count exceeds the declared bound even with that Receipt admitted. Under either reading of the clock the item is observed-without-receipt, so the clock does not decide it and the temporal rule does not keep it indeterminate. The item carries the offset and the bound.",
16
16
  "doesNotTest": "Whether the Receipt belongs to the recorded access."
17
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":"SELECT \"public\".\"customers\".\"id\" FROM \"public\".\"customers\" JOIN \"public\".\"orders\" ON \"public\".\"orders\".\"customer_id\" = \"public\".\"customers\".\"id\"","calls":2},{"queryid":"2","query":"SELECT \"public\".\"orders\".* FROM \"public\".\"orders\" LIMIT $1","calls":1}]}
@@ -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":[]},{"source":"zion-rest","object":"zion.orders","fieldsRequested":[]}],"policy":{"decision":"allow"},"chain":{"seq":1}}
2
+ {"v":"conarium-receipt/0.3","ts":"2026-08-06T11:10: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:20:00.000Z","request":{"tool":"query","target":"zion-rest","argsHash":"sha256:00"},"dataRefs":[{"source":"zion-rest","object":"zion.orders","fieldsRequested":[]}],"policy":{"decision":"allow"},"chain":{"seq":3}}
@@ -581,8 +581,8 @@ when the profile lists at least one exclusion rule.
581
581
 
582
582
  A declared multiplicity bound is how many statements one Receipt may cover,
583
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
584
+ Receipt that names all of its pattern's objects or by an in-window Receipt for
585
+ each object. The patterns whose
586
586
  objects all have a Receipt in the Window draw on the in-window Receipts; a
587
587
  pattern with an object no Receipt in the Window names takes its outcome from
588
588
  that object and draws on none.
@@ -594,14 +594,23 @@ were observed. The statements of the patterns that draw are assigned to
594
594
  Receipts as a maximum flow. Of the patterns not over the bound on their own,
595
595
  one that some maximum assignment leaves with a statement uncovered is
596
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.
597
+ which statements the Receipts covered. Every other pattern is `matched`.
598
+
599
+ The assignment is exact except for a pattern that draws, over several objects,
600
+ where an in-window Receipt names one of its objects but not all of them. Such a
601
+ pattern
602
+ draws only on the Receipts that name it whole, where there are any. Where there
603
+ are none, it is drawn against each object's Receipts: objects named by exactly
604
+ the same Receipts share one draw, and a Receipt that names two of its objects
605
+ that do not share a draw is counted once for each. Either way the assignment
606
+ can show a pattern beside it covered when another maximum assignment would not.
607
+ So the patterns that draw and share an in-window Receipt with such a pattern,
608
+ directly or through other patterns that draw, are taken together; a pattern
609
+ that draws on none is not among them. When the assignment leaves any
610
+ of their statements uncovered, every one of them not over the bound on its own
611
+ is `indeterminate` with reason `multiplicity-shared`. When it covers them all,
612
+ the assignment is a real one, and they are `matched`. The comparison therefore
613
+ errs only toward `indeterminate`.
605
614
 
606
615
  A `multiplicity-exceeded` item carries
607
616
  `multiplicity: { bound, object, receipts, statements }`: `object` is the object
@@ -613,7 +622,10 @@ competes with for Receipts: `objects` are the objects they draw for, `receipts`
613
622
  the in-window Receipts they can draw on, and `statements` their call deltas
614
623
  added together. A pattern drawn one Receipt per object can compete in two such
615
624
  groups; it reports the one whose statements are furthest over
616
- `receipts × bound`.
625
+ `receipts × bound`. A pattern that is `indeterminate` only because it is taken
626
+ together with a pattern over several objects reports all the patterns taken
627
+ together: their objects, the in-window Receipts that name one of them, and
628
+ their call deltas added together.
617
629
 
618
630
  A `/2` item whose `reason` is `window-boundary` carries `requiredSkewMs` and the
619
631
  uncovered `objects`. When the profile declares a multiplicity bound it also
@@ -622,8 +634,13 @@ carries `multiplicity: { bound, object, receipts, statements, exceededIfAdmitted
622
634
  Receipts with a readable timestamp that name `object`, inside the Window or out,
623
635
  and `object` the one of the pattern's objects with the fewest such Receipts.
624
636
  `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.
637
+ bound even with every Receipt naming the object admitted. When it is `true`,
638
+ both readings of the clock give the same answer, and the item is
639
+ `observed-without-receipt` with reason `multiplicity-exceeded` instead of
640
+ `window-boundary`, carrying the same `requiredSkewMs`, `objects` and
641
+ `multiplicity` (draft-08). When it is `false`, the item stays `indeterminate`,
642
+ and `false` is not a pass. Without a declared bound no item leaves
643
+ `indeterminate` this way.
627
644
 
628
645
  ### Mapping Profile (`conarium-mapping-profile/0.1`)
629
646
 
@@ -0,0 +1,122 @@
1
+ # Claims review — 0.3.8
2
+
3
+ - base: v0.3.7
4
+ - head: 438c920
5
+ - surface: sha256:0d261576d21c47737ed2ba9096af608c3d7574dcbcfdbbb5652acc49c0a870ce
6
+ - verdict: pass
7
+ - reviewer: Claude. Three claim surfaces changed between v0.3.7 and HEAD:
8
+ `LIMITATIONS.md`, `LIMITATIONS.tr.md` and `docs/RECEIPT-SPEC.md`
9
+ (`node test/denetci.mjs input v0.3.7 HEAD`).
10
+
11
+ The release changes `boundAssignment` in `bin/conarium-reconcile.mjs`: the
12
+ patterns that draw and share an in-window Receipt with a pattern that draws,
13
+ over several objects, that a Receipt names in part are decided together. It
14
+ adds one conformance case, two tests in `test/reconcile_cli.test.mjs` and
15
+ `test/bound_assignment_brute.test.mjs`, which enumerates every assignment of
16
+ 400 random inputs (up to three patterns of one or two objects each, over three
17
+ objects, up to three Receipt groups, a bound of 1 or 2) and compares
18
+ `boundAssignment` with the rule.
19
+
20
+ Each new sentence was set against what establishes it. "Seen failing" means
21
+ the test went red when the code it names was changed, and green again when it
22
+ was restored.
23
+
24
+ - "A statement is covered by one in-window Receipt that names all of its
25
+ pattern's objects or by an in-window Receipt for each object": the rule the
26
+ brute-force test enumerates, and `one receipt that names both objects of a
27
+ join covers one statement of it`, `a join is covered by one receipt for each
28
+ of its objects`.
29
+ - "The assignment is exact except for a pattern that draws, over several
30
+ objects, where an in-window Receipt names one of its objects but not all of
31
+ them": the
32
+ brute-force test requires the same answer as the rule, both ways, on every
33
+ input with no such pattern (more than 50 of the 400). Seen failing with
34
+ every pattern treated as one a Receipt names in part.
35
+ - "Such a pattern draws only on the Receipts that name it whole, where there
36
+ are any. Where there are none, it is drawn against each object's Receipts":
37
+ `a join that some receipt names whole draws only on receipts that name it
38
+ whole (LIMITATIONS.md)` and `a join no receipt names whole, named by
39
+ receipts that overlap, counts a shared receipt once per object
40
+ (LIMITATIONS.md)`.
41
+ - "Either way the assignment can show a pattern beside it covered when another
42
+ maximum assignment would not": the brute-force test fails on 0.3.7's
43
+ `boundAssignment`, and so do `a pattern beside a join that some receipt
44
+ names whole is not matched when the join could take its receipt` and
45
+ `conformance/cases/reconciliation/v2-multiplicity-join-neighbour.json`.
46
+ - "So the patterns that draw and share an in-window Receipt with such a
47
+ pattern, directly or through other patterns that draw, are taken together":
48
+ `a pattern on a receipt that a join could take for one of its objects is not
49
+ matched beside the join` (the Receipt names one object of the join). Seen
50
+ failing with the patterns not joined through their Receipts, with only the
51
+ Receipts that name a pattern whole joined, and with no pattern marked; each
52
+ also turns the brute-force test and the test above red. "a pattern that
53
+ draws on none is not among them": `a pattern with an object no receipt names
54
+ does not draw on its neighbour's receipts` (the customers pattern stays
55
+ matched beside a join whose orders no Receipt names).
56
+ - "When the assignment leaves any of their statements uncovered, every one of
57
+ them not over the bound on its own is `indeterminate` with reason
58
+ `multiplicity-shared`": the two tests above read both items.
59
+ - "When it covers them all, the assignment is a real one, and they are
60
+ `matched`": the brute-force test finds no pattern returned matched that some
61
+ maximum assignment leaves uncovered; `a join no receipt names whole is
62
+ covered by receipts that each name some of its objects` stays matched.
63
+ - "The comparison therefore errs only toward `indeterminate`": the
64
+ brute-force test, within its inputs. See finding 2.
65
+ - `LIMITATIONS.md` "even one that a closer count would show covered": the
66
+ brute-force test requires at least one pattern the rule matches that
67
+ `boundAssignment` shares.
68
+ - "reports all the patterns taken together: their objects, the in-window
69
+ Receipts that name one of them, and their call deltas added together": the
70
+ first test above reads `{ bound: 1, objects: [customers, orders],
71
+ receipts: 3, statements: 3 }` on the orders item. Seen failing with the
72
+ Receipt count set to 0.
73
+ - `LIMITATIONS.tr.md` says the same as `LIMITATIONS.md`, sentence for
74
+ sentence.
75
+
76
+ ## Findings
77
+
78
+ ### 1. LIMITATIONS.md — which way 0.3.7's comparison errs
79
+
80
+ - Claim: "The comparison errs toward `indeterminate` in two cases. A pattern
81
+ over several objects that some receipt in the window names whole draws only
82
+ on the receipts that name it whole, even when the others would cover the
83
+ rest." (0.3.7, also in `LIMITATIONS.tr.md` and `docs/RECEIPT-SPEC.md`).
84
+ - Mechanism: in 0.3.7 such a pattern's node drew only on the groups that name
85
+ it whole.
86
+ - Why it falls short: that errs toward `indeterminate` for the pattern itself,
87
+ not for the patterns beside it. With a bound of 1, Receipts naming customers
88
+ and orders, customers, and orders, two statements of the join and one on
89
+ orders, 0.3.7 reported the orders pattern `matched`; one maximum assignment
90
+ covers both join statements and leaves the orders statement uncovered. An
91
+ independent read of draft-08 found it; it was reproduced on the published
92
+ 0.3.7 package.
93
+ - Disposition: fixed in `db4941b`; the sentence is replaced in all three
94
+ files.
95
+
96
+ ### 2. docs/RECEIPT-SPEC.md — how far "errs only toward" is established
97
+
98
+ - Claim: "The comparison therefore errs only toward `indeterminate`."
99
+ - Mechanism: the argument in the comment on `boundAssignment` (a flow that
100
+ covers every statement of a component is an assignment the rule accepts;
101
+ otherwise every pattern in a component with a rough pattern is shared), and
102
+ the brute-force test.
103
+ - Why it falls short: the test enumerates inputs of up to three patterns of
104
+ one or two objects each, three objects and three Receipt groups. Patterns
105
+ over three objects, and anything larger, rest on the argument.
106
+ - Disposition: accepted, with the test's inputs stated here.
107
+
108
+ ### 3. docs/RECEIPT-SPEC.md — which patterns are taken together
109
+
110
+ - Claim: "So the patterns that share an in-window Receipt with such a pattern,
111
+ directly or through other patterns, are taken together" (a draft of this
112
+ release, also in `LIMITATIONS.md` and `LIMITATIONS.tr.md`).
113
+ - Mechanism: the components in `boundAssignment` are built over
114
+ `result.reconciled` only.
115
+ - Why it falls short: a pattern with an object no in-window Receipt names
116
+ shares a Receipt with its neighbours but draws on none, and is not taken
117
+ together with them. With one Receipt naming customers, two statements of a
118
+ customers-orders join and one on customers, the join is
119
+ `observed-without-receipt` and the customers pattern stays `matched`. An
120
+ independent read of the pull request text found it.
121
+ - Disposition: reworded in `438c920` to name the patterns that draw, in all
122
+ three files.
@@ -0,0 +1,92 @@
1
+ # Claims review — 0.3.9
2
+
3
+ - base: v0.3.8
4
+ - head: 22a48b2
5
+ - surface: sha256:685117adaebe702f949bcbe187d7f0e2067d70704dd5b31ac14bc13cff53c55f
6
+ - verdict: pass
7
+ - reviewer: Claude. Three claim surfaces changed between v0.3.8 and HEAD:
8
+ `LIMITATIONS.md`, `LIMITATIONS.tr.md` and `docs/RECEIPT-SPEC.md`
9
+ (`node test/denetci.mjs input v0.3.8 HEAD`).
10
+
11
+ The release changes `projectResultV2` in `bin/conarium-reconcile.mjs`: a
12
+ boundary item whose `multiplicity.exceededIfAdmitted` is `true` is reported as
13
+ `observed-without-receipt` with reason `multiplicity-exceeded` instead of
14
+ `indeterminate` with reason `window-boundary`, and the text report says so. It
15
+ changes one conformance case and two tests in `test/reconcile_cli.test.mjs`,
16
+ adds two there, and moves the version test in `src/demo-mode.test.ts`.
17
+
18
+ Each new sentence was set against what establishes it. "Seen failing" means
19
+ the test went red when the code it names was changed, and green again when it
20
+ was restored.
21
+
22
+ - "When it does, both readings of the clock give the same answer, so the clock
23
+ does not decide the item": `exceededIfAdmitted` counts every Receipt with a
24
+ readable timestamp that names the object, inside the Window or out, so an
25
+ item over the bound with all of them admitted is over it with any subset
26
+ admitted. `10,000 statements against one bound of 1 are
27
+ observed-without-receipt with the offset and the bound` (offset 3 s) and `a
28
+ beyond-window offset over the bound is observed-without-receipt too` (offset
29
+ 25 h) read the outcome. Both seen failing with the new branch in
30
+ `projectResultV2` disabled, and so does
31
+ `conformance/cases/reconciliation/v2-window-boundary-bound-exceeded.json`
32
+ (PASS before, FAIL with the branch disabled).
33
+ - "`/2` reports it as `observed-without-receipt` with reason
34
+ `multiplicity-exceeded`, the offset and the bound (draft-08)": the first test
35
+ above reads `outcome`, `reason`, `requiredSkewMs: 3000`, `objects` and
36
+ `multiplicity: { bound: 1, object, receipts: 1, statements: 10000,
37
+ exceededIfAdmitted: true }`; the conformance case requires `reason`,
38
+ `requiredSkewMs` and `multiplicity`, not `objects`.
39
+ draft-dogru-scitt-disclosure-evidence-08, Section 4.3, as published on the
40
+ Datatracker: boundary items are indeterminate "unless they exceed a declared
41
+ multiplicity bound under either reading of the clock", and a reconciler
42
+ "MUST report which bound it applied". See finding 1.
43
+ - "The `/1` result and exit 41 do not change": the first test reads exit 41.
44
+ No test reads the `/1` body for this case; see finding 2.
45
+ - "When it does not, the item stays `indeterminate`, and `false` is not a
46
+ pass": `a single statement against the same bound is a different item` and
47
+ `every receipt naming the object counts when the item asks what admitting
48
+ them would settle` read `indeterminate` with `exceededIfAdmitted: false`;
49
+ `the text report still does not call a bound that holds unreceipted` reads
50
+ the text.
51
+ - `docs/RECEIPT-SPEC.md` "carrying the same `requiredSkewMs`, `objects` and
52
+ `multiplicity`": the first test above reads all three on the
53
+ `observed-without-receipt` item.
54
+ - `docs/RECEIPT-SPEC.md` "Without a declared bound no item leaves
55
+ `indeterminate` this way": `without a declared bound the item states no
56
+ multiplicity comparison` reads reason `window-boundary` and no
57
+ `multiplicity` with 10,000 statements; the branch is guarded by `max != null`.
58
+ - Text report: `the text report names the exceeded bound and says what /2
59
+ reports`. Seen failing with the added clause removed from the message.
60
+ - `LIMITATIONS.tr.md` says the same as `LIMITATIONS.md`, sentence for
61
+ sentence.
62
+
63
+ ## Findings
64
+
65
+ ### 1. LIMITATIONS.md, docs/RECEIPT-SPEC.md — "(draft-08)" while the repository carries -07
66
+
67
+ - Claim: "`/2` reports it as `observed-without-receipt` with reason
68
+ `multiplicity-exceeded`, the offset and the bound (draft-08)" (also in
69
+ `LIMITATIONS.tr.md` and `docs/RECEIPT-SPEC.md`).
70
+ - Mechanism: the published -08 text, Section 4.3.
71
+ - Why it falls short: `standards/` in this tree holds
72
+ `draft-dogru-scitt-disclosure-evidence-07.md`, which requires `indeterminate`
73
+ for this item. A reader who follows the citation inside the repository finds
74
+ the opposite rule until the -08 text is added. The -08 citation itself is
75
+ correct: the Datatracker copy states the rule, and its Implementation Status
76
+ names 0.3.7 as not implementing it.
77
+ - Disposition: accepted; the -08 text goes into `standards/` in its own pull
78
+ request.
79
+
80
+ ### 2. LIMITATIONS.md — "The `/1` result and exit 41 do not change"
81
+
82
+ - Claim: "The `/1` result and exit 41 do not change."
83
+ - Mechanism: the change is confined to `projectResultV2`, which builds the
84
+ `/2` body, and one line of the text report.
85
+ - Why it falls short: no test reads the `/1` body of this case, only its exit
86
+ code. Measured instead: the case's fixtures (`before-customers-10.json`,
87
+ `after-customers-15.json`, `receipts-customers-early.jsonl`,
88
+ `profile-multiplicity-1.json`) through the published 0.3.8 package and
89
+ through HEAD give byte-identical `--json` output, exit 41 for both, while
90
+ `--json-v2` moves the item from `indeterminate`/`window-boundary` to
91
+ `observed-without-receipt`/`multiplicity-exceeded`.
92
+ - Disposition: accepted, with the measurement stated here.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conarium-ai/core",
3
- "version": "0.3.7",
3
+ "version": "0.3.9",
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.",