@conarium-ai/core 0.2.26 → 0.2.28
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 +65 -0
- package/LIMITATIONS.md +17 -0
- package/LIMITATIONS.tr.md +19 -1
- package/bin/conarium-reconcile.mjs +182 -11
- package/docs/API-STABILITY.md +1 -1
- package/docs/RECEIPT-SPEC.md +58 -0
- package/docs/claims/reviews/0.2.27.md +22 -0
- package/docs/claims/reviews/0.2.28.md +45 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.28 — 2026-08-17
|
|
4
|
+
|
|
5
|
+
The `indeterminate` class added in 0.2.27 was attacked the same day, and the
|
|
6
|
+
attack got through. A legitimate receipt from the previous day, naming the same
|
|
7
|
+
table, turned a real in-window bypass from exit 40 into 41 — and the run then
|
|
8
|
+
said the access was **"NOT reported as unreceipted access"**. 41 is not a silent
|
|
9
|
+
pass, and was not one then: the run still fails and CI still goes red. The damage
|
|
10
|
+
was the sentence. At three seconds it is true; at twenty-three hours it points
|
|
11
|
+
the reader away from what happened.
|
|
12
|
+
|
|
13
|
+
- **The exculpation is bounded by the window's own length.** An offset larger
|
|
14
|
+
than `after.ts − before.ts` cannot be a boundary artefact, so the boundary is
|
|
15
|
+
no longer offered as the explanation. The pattern stays `indeterminate` at 41,
|
|
16
|
+
because the tool still cannot say which access that receipt belongs to, and the
|
|
17
|
+
report says so in those terms: *"a boundary artefact cannot explain an offset
|
|
18
|
+
larger than the window itself … NOT excused as a timing effect."*
|
|
19
|
+
|
|
20
|
+
- **The threshold is derived, not chosen.** It is the window the caller supplied.
|
|
21
|
+
A number picked by us would be the kind of number this tool exists to refuse.
|
|
22
|
+
|
|
23
|
+
- **A declared `--skew` outranks it.** A five-second window with a six-second NTP
|
|
24
|
+
step is a real case, and the operator is the one who knows their clocks.
|
|
25
|
+
|
|
26
|
+
- **The 0.2.27 fix is unchanged.** A genuinely skewed receipt three seconds
|
|
27
|
+
outside a two-hour window still reads as the boundary, still exits 41, and
|
|
28
|
+
still is not called a bypass. A pattern with even one table that has no receipt
|
|
29
|
+
anywhere still exits 40 with the bypass sentence.
|
|
30
|
+
|
|
31
|
+
Found by an adversarial review commissioned after the fix shipped, on the ground
|
|
32
|
+
that the fix had loosened a guard's default and its author should not be the one
|
|
33
|
+
clearing it.
|
|
34
|
+
|
|
35
|
+
## 0.2.27 — 2026-08-17
|
|
36
|
+
|
|
37
|
+
`conarium-reconcile` could accuse the gateway of being bypassed because two
|
|
38
|
+
clocks disagreed by three seconds. Raised by Walter Hawkins on the IETF SCITT
|
|
39
|
+
list against `bin/conarium-reconcile.mjs` on main, and reproduced before it was
|
|
40
|
+
changed.
|
|
41
|
+
|
|
42
|
+
- **The window straddles two clocks, and the comparison was exact.** The window
|
|
43
|
+
is `[before.ts, after.ts]`, both from the database; a receipt's `ts` comes from
|
|
44
|
+
the gateway. A receipt three seconds early was counted `outOfWindow`, the table
|
|
45
|
+
it covered landed in `uncovered`, and the run exited 40 with "the gateway may
|
|
46
|
+
have been bypassed". The failure is asymmetric: skew manufactures the
|
|
47
|
+
accusation rather than any real gap, and the sub-second version is the
|
|
48
|
+
dangerous one, because it is believed.
|
|
49
|
+
|
|
50
|
+
- **The missing piece was qualification, not observation.** The tool already
|
|
51
|
+
counted those receipts; nothing asked how far outside they were, so a receipt
|
|
52
|
+
three seconds early and one six hours early produced the same verdict. A
|
|
53
|
+
pattern whose uncovered tables all have a receipt just outside the boundary is
|
|
54
|
+
now `indeterminate`, exit **41**, and the report names the skew that would have
|
|
55
|
+
to be true for it. 41 is a failure, not a pass — what it is not is an
|
|
56
|
+
accusation.
|
|
57
|
+
|
|
58
|
+
- **`--skew <duration>` declares the bound** (`500ms`, `5s`, `2m`, `1h`). Beyond
|
|
59
|
+
it, a receipt is not skew and its pattern stays unreconciled at 40. Without it
|
|
60
|
+
nothing decides the question, so nothing is asserted. An unreadable duration is
|
|
61
|
+
an error rather than a default: a tolerance nobody chose is the kind of number
|
|
62
|
+
this tool exists to refuse.
|
|
63
|
+
|
|
64
|
+
- **A real gap stays a real gap.** If even one uncovered table has no receipt
|
|
65
|
+
anywhere, the pattern remains unreconciled. A genuine finding is not made
|
|
66
|
+
indeterminate by a neighbour's clock.
|
|
67
|
+
|
|
3
68
|
## 0.2.26 — 2026-08-17
|
|
4
69
|
|
|
5
70
|
The claim list that `test/claim_discipline.mjs` enforces now ships in the
|
package/LIMITATIONS.md
CHANGED
|
@@ -187,6 +187,23 @@ such deployment. The consequence is that a clean run establishes pattern and
|
|
|
187
187
|
object overlap within the window. It does not establish that each recorded
|
|
188
188
|
statement was itself receipted.
|
|
189
189
|
|
|
190
|
+
## Reconciliation cannot tell a trailing clock from a late receipt
|
|
191
|
+
|
|
192
|
+
The window comes from the database's snapshot timestamps and a receipt's
|
|
193
|
+
timestamp comes from the gateway, so the boundary is decided by two clocks.
|
|
194
|
+
A receipt that would have covered a pattern but falls outside the window is
|
|
195
|
+
reported as `indeterminate` (exit 41) rather than as unreceipted access,
|
|
196
|
+
because this tool has no way to know which of the two happened. That is a
|
|
197
|
+
limit, not a verdict: 41 is a failure and the run does not pass, but nothing
|
|
198
|
+
is proven either way.
|
|
199
|
+
|
|
200
|
+
The exculpation is bounded by the window's own length — an offset larger than
|
|
201
|
+
the window cannot be a boundary artefact, and the report says so instead of
|
|
202
|
+
excusing it. `--skew` lets an operator declare what their clocks can do, and
|
|
203
|
+
that declaration outranks the inference. Neither mode establishes that the
|
|
204
|
+
receipt belongs to the access the counters recorded. This limit was found by
|
|
205
|
+
attack after the class shipped, not by reading it.
|
|
206
|
+
|
|
190
207
|
A receipt that names an object while the database counters show no increase
|
|
191
208
|
for that object is listed as UNOBSERVED. It is not a failure. The same
|
|
192
209
|
shape appears when a counter was reset at the window edge, when a pooler
|
package/LIMITATIONS.tr.md
CHANGED
|
@@ -4,7 +4,9 @@ Conarium'un yapmadıkları. Ölçülmüş. Tarih yok.
|
|
|
4
4
|
|
|
5
5
|
## Sertifikasyon yok
|
|
6
6
|
|
|
7
|
-
SOC 2 yok. ISO yok.
|
|
7
|
+
SOC 2 yok. ISO yok. İkisi de planlanmıyor: bu denetimler müşteri verisini
|
|
8
|
+
elinde tutan kuruluşu denetler, Conarium'un yönettiği veri ise bize hiç
|
|
9
|
+
ulaşmıyor. Bağımsız sızma testi de yok — o yol haritasında.
|
|
8
10
|
|
|
9
11
|
## 1.0 değil
|
|
10
12
|
|
|
@@ -150,3 +152,19 @@ Damgalama yerleşik takvim istemcisiyle yapılır (Node `crypto` + herkese açı
|
|
|
150
152
|
`javascript-opentimestamps` bağımlılık değil. `web3` / `elliptic` / `crypto-js` / `request` / `lodash` ağacı kurulmaz.
|
|
151
153
|
Bitcoin onayı yine saatler sürebilir; makbuz `pending` gösterir.
|
|
152
154
|
Bitcoin blok doğrulaması `blockstream.info`'ya sorar. O host yoksa doğrulayıcı "kontrol edemedim" der, "geçerli" demez.
|
|
155
|
+
|
|
156
|
+
## Mutabakat, kayan saatle geç yazılmış makbuzu ayıramaz
|
|
157
|
+
|
|
158
|
+
Pencerenin iki ucu veritabanının snapshot damgalarından, makbuzun damgası ise
|
|
159
|
+
gateway'den geliyor. Yani sınıra iki ayrı saat karar veriyor. Bir deseni
|
|
160
|
+
kapsayacak olan makbuz pencerenin dışına düşerse sonuç `indeterminate` olur
|
|
161
|
+
(çıkış 41) — "makbuzsuz erişim" denmez, çünkü araç ikisinden hangisinin olduğunu
|
|
162
|
+
bilemez. Bu bir hüküm değil, bir sınır: 41 başarısızlıktır, koşu geçmez, ama
|
|
163
|
+
hiçbir yön kanıtlanmış olmaz.
|
|
164
|
+
|
|
165
|
+
Aklama, pencerenin kendi uzunluğuyla sınırlı: pencereden uzun bir fark sınır
|
|
166
|
+
etkisiyle açıklanamaz ve rapor bunu mazeret göstermek yerine açıkça yazar.
|
|
167
|
+
`--skew` ile operatör kendi saatlerinin ne kadar kayabileceğini beyan eder ve o
|
|
168
|
+
beyan, araçtan çıkarılan sınırı ezer. İki kipte de makbuzun, sayaçların
|
|
169
|
+
kaydettiği erişime ait olduğu kanıtlanmış olmaz. Bu sınır, sınıf yayına
|
|
170
|
+
çıktıktan sonra **saldırıyla** bulundu; okumayla değil.
|
|
@@ -48,6 +48,33 @@
|
|
|
48
48
|
* counter regression — e.g. pg_stat_statements was reset mid-window)
|
|
49
49
|
* 40 unreconciled DB activity: at least one pattern the DB recorded has no
|
|
50
50
|
* covering receipt in the window (or could not be attributed to a table)
|
|
51
|
+
* 41 indeterminate: the only thing standing between a pattern and its
|
|
52
|
+
* receipt is the window boundary, and two clocks decide that boundary
|
|
53
|
+
*
|
|
54
|
+
* Two clocks, one window:
|
|
55
|
+
* The window is [before.ts, after.ts] and both come from the database. A
|
|
56
|
+
* receipt's ts comes from the gateway. Admitting a receipt on an exact
|
|
57
|
+
* comparison across those two clocks makes the failure asymmetric: a gateway
|
|
58
|
+
* trailing the database turns a receipt that genuinely covers a table into an
|
|
59
|
+
* out-of-window receipt, the table into an uncovered one, and the run into an
|
|
60
|
+
* accusation of bypass. Skew then manufactures the accusation rather than any
|
|
61
|
+
* real gap — and the sub-second version of that is the dangerous one, because
|
|
62
|
+
* it is believed.
|
|
63
|
+
*
|
|
64
|
+
* This tool already counted those receipts (`outOfWindow`). What was missing
|
|
65
|
+
* was not the observation but its qualification: how far outside, and against
|
|
66
|
+
* what declared bound. A pattern that is uncovered ONLY because a receipt sat
|
|
67
|
+
* outside the boundary is now indeterminate, not an accusation, and the
|
|
68
|
+
* report names the skew that would have to be true for it to be one.
|
|
69
|
+
*
|
|
70
|
+
* `--skew` declares the bound. Without it nothing decides the question, so
|
|
71
|
+
* nothing is asserted: the pattern is indeterminate and the report says the
|
|
72
|
+
* bound was never declared. With it, a receipt further out than the bound is
|
|
73
|
+
* not skew, and the pattern stays unreconciled.
|
|
74
|
+
*
|
|
75
|
+
* Reported for the operator, not resolved for them: this tool cannot tell a
|
|
76
|
+
* trailing clock from a receipt written late. That is why the class is
|
|
77
|
+
* "indeterminate" and not "covered".
|
|
51
78
|
*/
|
|
52
79
|
import { readFileSync, existsSync } from 'fs'
|
|
53
80
|
|
|
@@ -224,6 +251,33 @@ export function receiptCoverage(receipts, fromMs, toMs) {
|
|
|
224
251
|
return { covered, coveredRaw, inWindow, outOfWindow, unassigned }
|
|
225
252
|
}
|
|
226
253
|
|
|
254
|
+
/**
|
|
255
|
+
* For every table named by a receipt that fell OUTSIDE the window, the smallest
|
|
256
|
+
* distance from that receipt to the nearest window boundary.
|
|
257
|
+
*
|
|
258
|
+
* This is the qualification the tool was missing. `outOfWindow` counted these
|
|
259
|
+
* receipts; nothing asked how far outside they were, so a receipt three seconds
|
|
260
|
+
* early and one six hours early produced the same verdict.
|
|
261
|
+
*/
|
|
262
|
+
export function outsideBoundaryCoverage(receipts, fromMs, toMs) {
|
|
263
|
+
const byTable = new Map() // normalized table -> smallest offset in ms
|
|
264
|
+
for (const r of receipts) {
|
|
265
|
+
const t = Date.parse(r.ts)
|
|
266
|
+
if (Number.isNaN(t)) continue
|
|
267
|
+
if (t >= fromMs && t <= toMs) continue
|
|
268
|
+
const offset = t < fromMs ? fromMs - t : t - toMs
|
|
269
|
+
const named = []
|
|
270
|
+
for (const ref of r.dataRefs || []) if (ref.object) named.push(String(ref.object))
|
|
271
|
+
if (r.request?.tool === 'describe_table' && r.request?.target) named.push(String(r.request.target))
|
|
272
|
+
for (const obj of named) {
|
|
273
|
+
const key = normalizeObject(obj)
|
|
274
|
+
const prev = byTable.get(key)
|
|
275
|
+
if (prev === undefined || offset < prev) byTable.set(key, offset)
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
return byTable
|
|
279
|
+
}
|
|
280
|
+
|
|
227
281
|
/**
|
|
228
282
|
* Receipts in the window that name an object the database counters did not
|
|
229
283
|
* increment. Distinct from `unassigned` (receipt named nothing).
|
|
@@ -259,7 +313,11 @@ export function unobservedReceipts(receipts, fromMs, toMs, observedTables) {
|
|
|
259
313
|
|
|
260
314
|
// ─── reconciliation core ─────────────────────────────────────────────────────
|
|
261
315
|
|
|
262
|
-
export function reconcile(before, after, receipts) {
|
|
316
|
+
export function reconcile(before, after, receipts, opts = {}) {
|
|
317
|
+
const declaredSkewMs =
|
|
318
|
+
typeof opts.skewMs === 'number' && Number.isFinite(opts.skewMs) && opts.skewMs >= 0
|
|
319
|
+
? opts.skewMs
|
|
320
|
+
: null
|
|
263
321
|
if (before.role !== after.role) {
|
|
264
322
|
return { error: `role mismatch: before=${before.role}, after=${after.role}` }
|
|
265
323
|
}
|
|
@@ -301,8 +359,11 @@ export function reconcile(before, after, receipts) {
|
|
|
301
359
|
|
|
302
360
|
const cov = receiptCoverage(receipts, fromMs, toMs)
|
|
303
361
|
|
|
362
|
+
const outside = outsideBoundaryCoverage(receipts, fromMs, toMs)
|
|
363
|
+
|
|
304
364
|
const reconciled = []
|
|
305
365
|
const unreconciled = []
|
|
366
|
+
const indeterminate = []
|
|
306
367
|
const unattributed = []
|
|
307
368
|
const infrastructure = []
|
|
308
369
|
for (const d of deltas) {
|
|
@@ -318,8 +379,34 @@ export function reconcile(before, after, receipts) {
|
|
|
318
379
|
const uncovered = cls.tables.filter((t) => !cov.covered.has(t.table))
|
|
319
380
|
if (uncovered.length === 0) {
|
|
320
381
|
reconciled.push({ ...d, tables: cls.tables.map((t) => t.table) })
|
|
382
|
+
continue
|
|
383
|
+
}
|
|
384
|
+
const names = uncovered.map((t) => (t.schema ? `${t.schema}.${t.table}` : t.table))
|
|
385
|
+
|
|
386
|
+
// A pattern moves out of the accusation only if the boundary is the ONLY
|
|
387
|
+
// thing missing: every uncovered table must have a receipt just outside.
|
|
388
|
+
// One table with no receipt anywhere is a real gap, and a real gap is not
|
|
389
|
+
// made indeterminate by a neighbour's clock.
|
|
390
|
+
const offsets = uncovered.map((t) => outside.get(t.table))
|
|
391
|
+
const allExplained = offsets.every((o) => o !== undefined)
|
|
392
|
+
const requiredSkewMs = allExplained ? Math.max(...offsets) : null
|
|
393
|
+
const withinDeclared = declaredSkewMs === null || requiredSkewMs <= declaredSkewMs
|
|
394
|
+
|
|
395
|
+
if (allExplained && withinDeclared) {
|
|
396
|
+
// Whether the boundary can plausibly explain the gap at all. A receipt
|
|
397
|
+
// further outside than the window is long is not sitting at the boundary;
|
|
398
|
+
// it is in a different window. Attacked on 2026-08-17: a legitimate
|
|
399
|
+
// receipt from the previous day turned a real in-window bypass from 40
|
|
400
|
+
// into 41, and the run then said the access was "NOT reported as
|
|
401
|
+
// unreceipted access" — an exculpation 23 hours of offset cannot support.
|
|
402
|
+
//
|
|
403
|
+
// The threshold is the window's own length, so it is derived from the
|
|
404
|
+
// input rather than chosen. A declared --skew is the operator's own
|
|
405
|
+
// statement about their clocks and outranks it.
|
|
406
|
+
const boundaryPlausible = declaredSkewMs !== null || requiredSkewMs <= toMs - fromMs
|
|
407
|
+
indeterminate.push({ ...d, uncoveredTables: names, requiredSkewMs, boundaryPlausible })
|
|
321
408
|
} else {
|
|
322
|
-
unreconciled.push({ ...d, uncoveredTables:
|
|
409
|
+
unreconciled.push({ ...d, uncoveredTables: names })
|
|
323
410
|
}
|
|
324
411
|
}
|
|
325
412
|
|
|
@@ -343,8 +430,15 @@ export function reconcile(before, after, receipts) {
|
|
|
343
430
|
unassigned: cov.unassigned,
|
|
344
431
|
coveredObjects: [...cov.coveredRaw].sort(),
|
|
345
432
|
},
|
|
433
|
+
clocks: {
|
|
434
|
+
window: before.source,
|
|
435
|
+
receipts: 'gateway',
|
|
436
|
+
declaredSkewMs,
|
|
437
|
+
windowMs: toMs - fromMs,
|
|
438
|
+
},
|
|
346
439
|
reconciled,
|
|
347
440
|
unreconciled,
|
|
441
|
+
indeterminate,
|
|
348
442
|
unattributed,
|
|
349
443
|
infrastructure,
|
|
350
444
|
unobserved,
|
|
@@ -356,12 +450,35 @@ export function reconcile(before, after, receipts) {
|
|
|
356
450
|
function usage(msg) {
|
|
357
451
|
if (msg) console.error(msg)
|
|
358
452
|
console.error(
|
|
359
|
-
'Usage: conarium-reconcile --before <snapshot.json> --after <snapshot.json> --receipts <receipts.jsonl> [--json]',
|
|
453
|
+
'Usage: conarium-reconcile --before <snapshot.json> --after <snapshot.json> --receipts <receipts.jsonl> [--skew <duration>] [--json]',
|
|
454
|
+
)
|
|
455
|
+
console.error(
|
|
456
|
+
' --skew how far the gateway clock may differ from the database clock (e.g. 500ms, 5s, 2m).',
|
|
457
|
+
)
|
|
458
|
+
console.error(
|
|
459
|
+
' Receipts further outside the window than this are not skew. Without it, a pattern',
|
|
460
|
+
)
|
|
461
|
+
console.error(
|
|
462
|
+
' uncovered only by the boundary is reported as indeterminate rather than decided.',
|
|
360
463
|
)
|
|
361
464
|
}
|
|
362
465
|
|
|
466
|
+
/**
|
|
467
|
+
* `500ms`, `5s`, `2m`, `1h`, or a bare number of milliseconds. Declaring the
|
|
468
|
+
* bound is the point, so an unparseable one is an error rather than a default:
|
|
469
|
+
* a tolerance nobody chose is the kind of number this tool exists to refuse.
|
|
470
|
+
*/
|
|
471
|
+
export function parseDuration(text) {
|
|
472
|
+
const m = /^(\d+(?:\.\d+)?)(ms|s|m|h)?$/.exec(String(text).trim())
|
|
473
|
+
if (!m) return null
|
|
474
|
+
const n = Number(m[1])
|
|
475
|
+
const unit = m[2] || 'ms'
|
|
476
|
+
const scale = { ms: 1, s: 1000, m: 60_000, h: 3_600_000 }[unit]
|
|
477
|
+
return Math.round(n * scale)
|
|
478
|
+
}
|
|
479
|
+
|
|
363
480
|
function parseArgs(argv) {
|
|
364
|
-
const out = { before: null, after: null, receiptsPath: null, json: false }
|
|
481
|
+
const out = { before: null, after: null, receiptsPath: null, json: false, skewMs: null }
|
|
365
482
|
const args = [...argv]
|
|
366
483
|
while (args.length) {
|
|
367
484
|
const a = args.shift()
|
|
@@ -374,6 +491,12 @@ function parseArgs(argv) {
|
|
|
374
491
|
} else if (a === '--receipts') {
|
|
375
492
|
out.receiptsPath = args.shift() ?? null
|
|
376
493
|
if (!out.receiptsPath) throw new Error('--receipts requires a path')
|
|
494
|
+
} else if (a === '--skew') {
|
|
495
|
+
const raw = args.shift() ?? null
|
|
496
|
+
if (!raw) throw new Error('--skew requires a duration (e.g. 500ms, 5s, 2m)')
|
|
497
|
+
const ms = parseDuration(raw)
|
|
498
|
+
if (ms === null) throw new Error(`--skew: cannot read "${raw}" as a duration (try 500ms, 5s, 2m, 1h)`)
|
|
499
|
+
out.skewMs = ms
|
|
377
500
|
} else if (a === '--json') {
|
|
378
501
|
out.json = true
|
|
379
502
|
} else if (a === '--help' || a === '-h') {
|
|
@@ -417,13 +540,15 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
417
540
|
const rec = loadReceipts(opts.receiptsPath)
|
|
418
541
|
if (rec.error) fail(20, rec.error, opts.json)
|
|
419
542
|
|
|
420
|
-
const result = reconcile(b.snapshot, a.snapshot, rec.receipts)
|
|
543
|
+
const result = reconcile(b.snapshot, a.snapshot, rec.receipts, { skewMs: opts.skewMs })
|
|
421
544
|
if (result.error) fail(20, result.error, opts.json)
|
|
422
545
|
|
|
423
546
|
const problems = result.unreconciled.length + result.unattributed.length
|
|
547
|
+
const undecided = result.indeterminate.length
|
|
548
|
+
const exitCode = problems > 0 ? 40 : undecided > 0 ? 41 : 0
|
|
424
549
|
|
|
425
550
|
if (opts.json) {
|
|
426
|
-
console.log(JSON.stringify({ ok:
|
|
551
|
+
console.log(JSON.stringify({ ok: exitCode === 0, code: exitCode, ...result }))
|
|
427
552
|
} else {
|
|
428
553
|
console.log(
|
|
429
554
|
`reconcile window: ${result.window.start} → ${result.window.end} ` +
|
|
@@ -458,13 +583,56 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
458
583
|
console.log(` · [${u.objects.join(', ')}] ${u.tool || 'receipt'} @ ${u.ts}`)
|
|
459
584
|
}
|
|
460
585
|
}
|
|
461
|
-
if (
|
|
586
|
+
if (result.indeterminate.length > 0) {
|
|
587
|
+
const atBoundary = result.indeterminate.filter((d) => d.boundaryPlausible)
|
|
588
|
+
const beyond = result.indeterminate.filter((d) => !d.boundaryPlausible)
|
|
589
|
+
const line = (d) =>
|
|
590
|
+
` ~ (+${d.delta}) table(s) [${d.uncoveredTables.join(', ')}] have a receipt ${d.requiredSkewMs}ms outside ` +
|
|
591
|
+
`the window: ${truncate(d.query)}`
|
|
592
|
+
|
|
593
|
+
if (atBoundary.length > 0) {
|
|
594
|
+
const bound =
|
|
595
|
+
result.clocks.declaredSkewMs === null
|
|
596
|
+
? 'no --skew bound was declared, so the window\'s own length is the only reference'
|
|
597
|
+
: `declared --skew is ${result.clocks.declaredSkewMs}ms`
|
|
598
|
+
console.error(
|
|
599
|
+
`INDETERMINATE: ${atBoundary.length} pattern(s) are uncovered only by the window boundary — ${bound}:`,
|
|
600
|
+
)
|
|
601
|
+
for (const d of atBoundary) console.error(line(d))
|
|
602
|
+
console.error(
|
|
603
|
+
`the window comes from ${result.clocks.window} and receipt timestamps come from the ${result.clocks.receipts} — ` +
|
|
604
|
+
'two clocks. A receipt this close outside is either a trailing clock or a late receipt, and this tool ' +
|
|
605
|
+
'cannot tell them apart. It is NOT reported as unreceipted access.',
|
|
606
|
+
)
|
|
607
|
+
}
|
|
608
|
+
// Never exculpated. The class stays indeterminate because this tool still
|
|
609
|
+
// cannot prove what happened, but a receipt further out than the window is
|
|
610
|
+
// long is not a boundary artefact, and saying otherwise would shield the
|
|
611
|
+
// exact case an attacker would arrange.
|
|
612
|
+
if (beyond.length > 0) {
|
|
613
|
+
console.error(
|
|
614
|
+
`INDETERMINATE (not the boundary): ${beyond.length} pattern(s) have their only covering receipt further ` +
|
|
615
|
+
`outside the window than the window is long (${result.clocks.windowMs}ms):`,
|
|
616
|
+
)
|
|
617
|
+
for (const d of beyond) console.error(line(d))
|
|
618
|
+
console.error(
|
|
619
|
+
'a boundary artefact cannot explain an offset larger than the window itself, so clock skew is not the ' +
|
|
620
|
+
'reading here. This is NOT excused as a timing effect; it is left undecided because the receipt exists ' +
|
|
621
|
+
'and this tool cannot say which access it belongs to. Declare --skew to make the question decidable.',
|
|
622
|
+
)
|
|
623
|
+
}
|
|
624
|
+
}
|
|
625
|
+
if (problems === 0 && undecided === 0) {
|
|
462
626
|
console.log('ok: every DB query pattern in the window is attributable to receipt(s) for the same table')
|
|
463
627
|
console.log(
|
|
464
628
|
'scope: this is object attribution within the window, not per-statement coverage — ' +
|
|
465
629
|
'one receipt naming a table clears further statements against that table. See LIMITATIONS.md.',
|
|
466
630
|
)
|
|
467
|
-
}
|
|
631
|
+
}
|
|
632
|
+
// Guarded on `problems`, not on "not clean": a run whose only finding is
|
|
633
|
+
// indeterminate must never print the bypass sentence. Reaching that
|
|
634
|
+
// sentence through a clock difference is the defect this class exists for.
|
|
635
|
+
if (problems > 0) {
|
|
468
636
|
if (result.unreconciled.length > 0) {
|
|
469
637
|
console.error(
|
|
470
638
|
`UNRECONCILED: ${result.unreconciled.length} pattern(s) recorded by the database have no covering receipt in the window:`,
|
|
@@ -487,10 +655,13 @@ async function main(argv = process.argv.slice(2)) {
|
|
|
487
655
|
}
|
|
488
656
|
// Literal çıkışlar bilerek ayrı: spec_exitcode_drift bekçisi sadece
|
|
489
657
|
// literal sayıları tarar, ternary içindeki kod görünmez kalırdı.
|
|
490
|
-
if (problems
|
|
491
|
-
process.exit(
|
|
658
|
+
if (problems > 0) {
|
|
659
|
+
process.exit(40)
|
|
660
|
+
}
|
|
661
|
+
if (undecided > 0) {
|
|
662
|
+
process.exit(41)
|
|
492
663
|
}
|
|
493
|
-
process.exit(
|
|
664
|
+
process.exit(0)
|
|
494
665
|
}
|
|
495
666
|
|
|
496
667
|
const isDirect =
|
package/docs/API-STABILITY.md
CHANGED
|
@@ -65,7 +65,7 @@ No dates. Shipping 1.0 is a decision, not a document.
|
|
|
65
65
|
| `conarium-doctor` | `--config` `--no-net` `--help` | experimental |
|
|
66
66
|
| `conarium-verify` | `--pubkey` (repeatable) `--anchor-check` `--require-head-anchor` `--anchors` `--expect-seq-from` `--expect-count` `--expect-last-hash` `--strict` `--json` `--help` | **candidate** (exit codes + flags in RECEIPT-SPEC) |
|
|
67
67
|
| `conarium-coverage` | `--pubkey` `--receipts` `--expect-seq-from` `--allow-gaps` `--json` `--help` | experimental |
|
|
68
|
-
| `conarium-reconcile` | `--before` `--after` `--receipts` `--json` `--help` | experimental |
|
|
68
|
+
| `conarium-reconcile` | `--before` `--after` `--receipts` `--skew` `--json` `--help` | experimental |
|
|
69
69
|
| `conarium-stamp` | `--sidecar` `--json` `--help` | experimental |
|
|
70
70
|
| `conarium-anchor-upgrade` | `<anchors.jsonl>` | experimental |
|
|
71
71
|
| `conarium-console` | `--config` `--port` `--host` `--install-shortcut` `--uninstall-shortcut` `--launch` `--help` | experimental |
|
package/docs/RECEIPT-SPEC.md
CHANGED
|
@@ -319,6 +319,64 @@ Rules that keep the verdict honest:
|
|
|
319
319
|
| 0 | Every DB query pattern in the window is attributable to receipt(s) for the same table — object attribution, not per-statement coverage |
|
|
320
320
|
| 20 | Input invalid or window unreliable (schema error, counter regression) |
|
|
321
321
|
| 40 | Unreconciled DB activity — recorded by the database, not receipted |
|
|
322
|
+
| 41 | Indeterminate — a pattern is uncovered only by the window boundary, and two clocks decide that boundary |
|
|
323
|
+
|
|
324
|
+
### The window straddles two clocks
|
|
325
|
+
|
|
326
|
+
The window is `[before.ts, after.ts]` and both timestamps come from the database.
|
|
327
|
+
A receipt's `ts` comes from the gateway. Admitting receipts on an exact comparison
|
|
328
|
+
across those two clocks makes the failure **asymmetric**: a gateway trailing the
|
|
329
|
+
database turns a receipt that genuinely covers a table into an out-of-window
|
|
330
|
+
receipt, and the table into an accusation of bypass. Skew then manufactures the
|
|
331
|
+
accusation rather than any real gap, and the sub-second version is the dangerous
|
|
332
|
+
one, because it is believed.
|
|
333
|
+
|
|
334
|
+
A pattern whose uncovered tables **all** have a receipt outside the window is
|
|
335
|
+
reported as `indeterminate` and exits 41. It is not a pass — 41 is a failure —
|
|
336
|
+
but it is not the bypass sentence either, because this tool cannot tell a trailing
|
|
337
|
+
clock from a late receipt.
|
|
338
|
+
|
|
339
|
+
**Distance is reported, and only the boundary reading is bounded.** Without
|
|
340
|
+
`--skew`, *any* covering receipt outside the window puts its pattern at 41 — the
|
|
341
|
+
tool still cannot say which access that receipt belongs to. What the distance
|
|
342
|
+
decides is whether the boundary can be *offered as the explanation*:
|
|
343
|
+
|
|
344
|
+
| Offset vs the window's own length | Class | What the report says |
|
|
345
|
+
|---|---|---|
|
|
346
|
+
| within | `indeterminate`, boundary-plausible | two clocks, cannot tell them apart, **not** reported as unreceipted access |
|
|
347
|
+
| beyond | `indeterminate`, **not** boundary-plausible | a boundary artefact cannot explain an offset larger than the window itself; **not excused as a timing effect** |
|
|
348
|
+
|
|
349
|
+
The threshold is the window's own length (`after.ts − before.ts`), derived from
|
|
350
|
+
the input rather than chosen. It exists because the exculpation was attacked and
|
|
351
|
+
went through: a legitimate receipt from the previous day, naming the same table,
|
|
352
|
+
turned a real in-window bypass from 40 into 41 and the run then said the access
|
|
353
|
+
was *"NOT reported as unreceipted access"* — a sentence twenty-three hours of
|
|
354
|
+
offset cannot support. 41 was never a silent pass, and is not one now; what
|
|
355
|
+
changed is that the tool stops offering an excuse it cannot back.
|
|
356
|
+
|
|
357
|
+
A declared `--skew` is the operator's own statement about their clocks and
|
|
358
|
+
outranks the window rule. A window shorter than a clock correction is possible —
|
|
359
|
+
a five-second window and a six-second step would read as beyond the boundary
|
|
360
|
+
while being exactly the case the class exists for — and the operator is the one
|
|
361
|
+
who knows whether that is their deployment. We have not measured how often it
|
|
362
|
+
happens; the flag exists so the answer does not have to come from us:
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
INDETERMINATE: 1 pattern(s) are uncovered only by the window boundary — no --skew bound was declared…
|
|
366
|
+
~ (+5) table(s) [public.customers] have a receipt 3000ms outside the window: SELECT …
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
`--skew <duration>` declares the bound (`500ms`, `5s`, `2m`, `1h`). A receipt
|
|
370
|
+
further out than the bound is not skew, and its pattern goes back to unreconciled
|
|
371
|
+
at 40 with the bypass sentence. An unreadable duration is an error, not a default:
|
|
372
|
+
a tolerance nobody chose is the kind of number this tool exists to refuse.
|
|
373
|
+
|
|
374
|
+
A pattern with even one table that has no receipt anywhere is a real gap and stays
|
|
375
|
+
at 40 in either mode: a genuine finding is not made indeterminate by a neighbour's
|
|
376
|
+
clock.
|
|
377
|
+
|
|
378
|
+
Credit: raised by Walter Hawkins on the IETF SCITT list, 2026-08-17, against
|
|
379
|
+
`bin/conarium-reconcile.mjs` on main.
|
|
322
380
|
|
|
323
381
|
## Stamping a document (priority dates)
|
|
324
382
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Claims review — 0.2.27
|
|
2
|
+
|
|
3
|
+
- base: v0.2.26
|
|
4
|
+
- head: cb4d2ee
|
|
5
|
+
- surface: sha256:0968a0b4fdbed3966bd1d7afd4490495fc2efef68056a69e8530ff6e26bf459b
|
|
6
|
+
- verdict: pass
|
|
7
|
+
- reviewer: Claude (release review before publish)
|
|
8
|
+
|
|
9
|
+
Two claim surfaces changed: `docs/RECEIPT-SPEC.md` gained the exit-41 row and a
|
|
10
|
+
section describing it, and `docs/API-STABILITY.md` gained `--skew` in the
|
|
11
|
+
`conarium-reconcile` flag list. The flag list matches the parser. The finding is
|
|
12
|
+
in the new section, and it is the same shape as the defect the release fixes:
|
|
13
|
+
prose implying a limit the mechanism does not enforce.
|
|
14
|
+
|
|
15
|
+
## Findings
|
|
16
|
+
|
|
17
|
+
### 1. docs/RECEIPT-SPEC.md — "a receipt just outside the boundary" described a proximity the default mode does not enforce
|
|
18
|
+
|
|
19
|
+
- Claim: "A pattern whose uncovered tables **all** have a receipt just outside the boundary is reported as `indeterminate` and exits 41", followed by "Without the flag nothing decides the question, so nothing is asserted."
|
|
20
|
+
- Mechanism: `reconcile()` moves a pattern to `indeterminate` when every uncovered table appears in `outsideBoundaryCoverage()` and, if `--skew` was given, the largest offset is within it. When `--skew` is absent there is no bound at all, so the offset is recorded and never compared.
|
|
21
|
+
- Why it falls short: without a declared bound there is no "just". Measured on the CLI against the same fixture, a receipt six hours outside the window produces `21600000ms outside` and exit 41, exactly as a three-second one produces `3000ms outside` and exit 41. A reader would take the sentence to mean a distant receipt still yields 40, and it does not. The second sentence has the opposite error, claiming less than the tool does: it does classify, into a weaker class.
|
|
22
|
+
- Disposition: reworded in `cb4d2ee`. The section now says distance is reported and not judged until a bound is declared, that any covering receipt outside the window lands at 41 in the default mode, and that reading the number is the operator's job there.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Claims review — 0.2.28
|
|
2
|
+
|
|
3
|
+
- base: v0.2.27
|
|
4
|
+
- head: 6e3ef41
|
|
5
|
+
- surface: sha256:28349adb6948b360662a89eb7e4996d611f81fc89503a57879084e7d2c428edb
|
|
6
|
+
- verdict: pass
|
|
7
|
+
- reviewer: Claude (release review before publish)
|
|
8
|
+
|
|
9
|
+
One claim surface changed: `docs/RECEIPT-SPEC.md`, where the two-clocks section
|
|
10
|
+
was rewritten after an adversarial review got through the exculpation shipped in
|
|
11
|
+
0.2.27. The table describing the two readings matches the CLI output, verified by
|
|
12
|
+
running both paths; the threshold named in the prose is the one in the code.
|
|
13
|
+
|
|
14
|
+
## Findings
|
|
15
|
+
|
|
16
|
+
### 1. docs/RECEIPT-SPEC.md — an operational scenario asserted as observed, to justify a design choice
|
|
17
|
+
|
|
18
|
+
- Claim: "A declared `--skew` … outranks the window rule — a five-second window with a six-second NTP step **is a real case**, and the operator is the one who knows it."
|
|
19
|
+
- Mechanism: none. Nothing in this repository measures how often a clock correction exceeds a reconciliation window; the sentence is a plausibility argument borrowed from the review that proposed the threshold.
|
|
20
|
+
- Why it falls short: the design choice is right — an operator's declaration should outrank a value inferred from the input — but "is a real case" states operational frequency as fact in order to justify it. Asserting the world to defend a decision is the same move as asserting a mechanism that does not exist, one step removed.
|
|
21
|
+
- Disposition: reworded in `3602609`. The text now says such a window is possible, describes how it would read, and states plainly that we have not measured how often it happens.
|
|
22
|
+
|
|
23
|
+
### 2. LIMITATIONS.tr.md:7 — the SOC 2 answer given on 2026-08-17 never reached the Turkish surface
|
|
24
|
+
|
|
25
|
+
- Claim: "SOC 2 yok. ISO yok. Bağımsız sızma testi yok. **Yol haritasında.**" — no SOC 2, no ISO, no independent penetration test, on the roadmap.
|
|
26
|
+
- Mechanism: the same question was answered this morning and the answer is in README.md, SECURITY.md, LIMITATIONS.md and the live site: not planned, because the audit certifies organisations that hold customer data and the data Conarium governs does not reach us.
|
|
27
|
+
- Why it falls short: this file also ships to npm, so a Turkish reader of 0.2.26 and 0.2.27 was told SOC 2 is coming while every other surface said it is not. The correction landed on four surfaces and missed the fifth because the fifth is written in another language. `claim_discipline` cannot catch it — "SOC 2 yok" is an allowed denial, and no rule knows that the following sentence takes it back.
|
|
28
|
+
- Disposition: corrected in `6e3ef41`, in Turkish rather than as a translation of the English sentence.
|
|
29
|
+
|
|
30
|
+
### 3. LIMITATIONS said nothing about the limit this release documents in the spec
|
|
31
|
+
|
|
32
|
+
- Claim: absence. `docs/RECEIPT-SPEC.md` states that reconciliation cannot distinguish a trailing clock from a late receipt; `LIMITATIONS.md` and `LIMITATIONS.tr.md` did not mention it.
|
|
33
|
+
- Mechanism: LIMITATIONS is the file that states what has not been done, and it carries the other reconciliation limit (object attribution, not per-statement coverage) already.
|
|
34
|
+
- Why it falls short: a limit documented only in the spec is a limit a reader of the limitations file does not have. The gap was created by this release: the class is new.
|
|
35
|
+
- Disposition: named in both languages in `6e3ef41`, including that the exculpation is bounded by the window's own length and that the limit was found by attack.
|
|
36
|
+
|
|
37
|
+
### 4. Recorded, not a finding: the exculpation this release bounds was itself the previous release's finding
|
|
38
|
+
|
|
39
|
+
The 0.2.27 record carries a finding about the same section describing a
|
|
40
|
+
proximity the default mode did not enforce. That was a wording defect. The one
|
|
41
|
+
fixed here is a behavioural one, found by attack rather than reading: a
|
|
42
|
+
legitimate receipt from the previous day moved a real in-window bypass from 40
|
|
43
|
+
to 41, and the run then said the access was "NOT reported as unreceipted
|
|
44
|
+
access". Both are the same shape — an assertion the mechanism could not back —
|
|
45
|
+
and the second was reachable only because someone was asked to attack it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conarium-ai/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.28",
|
|
4
4
|
"mcpName": "io.github.dogrucanemek-alt/conarium",
|
|
5
5
|
"//files-artefakt": "examples/ altindaki uretilmis dosyalar (ozel anahtar, makbuz/denetim JSONL) ELENIR. .gitignore npm'i baglamaz: izin listesinde 'examples' oldugu icin demoyu kosturmus bir makinede 'npm publish' _keys/audit-ed25519.pem'i (OZEL ANAHTAR) ve makbuzlari yayinliyordu. test/pack_artefakt.mjs bunu kilitler. Elemeler examples/ ile SINIRLI: test-vectors/ altindaki receipts.jsonl ve .pub.pem YAYINLANMAK ZORUNDA, yoksa ucuncu taraf konformans vektorlerini kosturamaz.",
|
|
6
6
|
"//files": "Pakete NE gireceginin izin listesi. Liste olmadan npm her seyi gonderiyordu: 296 dosya / 1.5 MB — CI workflowlari, gitleaks ayari, 137 KB pazarlama gorseli, sitenin api/chat.js dosyasi. Bir bankanin guvenlik ekibi tarball'i acip bunlari gorur. scripts/ BILEREK var: conarium-reconcile calisirken scripts/pg-snapshot.sql'e atif yapiyor, olmazsa kullanici destek maili yazar.",
|