@conarium-ai/core 0.2.44 → 0.2.46

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,109 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.46 - three numbers that named something they were not
4
+
5
+ Every item here is a figure this project printed, published, or wrote down,
6
+ which turned out to measure something other than what it said. Two were
7
+ declared on the SCITT list before they were fixed; this is that debt.
8
+
9
+ **`exit_contract.mjs` reported its own work wrong.** The success line said
10
+ `27 invocation(s)`. It runs 25 processes; 27 was the pass counter, 23 cases
11
+ plus four assertions over two of them. A count that names something it is not,
12
+ printed by the file added to stop codes naming events they are not, in the
13
+ release that was about exactly that. Both numbers are now derived from the run
14
+ through a single `invoke()` wrapper and both are printed:
15
+ `25 invocation(s), 27 assertion(s)`. Add a case and the label moves on its own.
16
+
17
+ **`pack_locale.mjs` carried a figure its own subject forbids.** Its comment
18
+ said the letter pass finds 1041 where the changelog said 1034 — two
19
+ hand-written declarations of one number, inside the check whose whole purpose
20
+ is catching hand-written declarations drifting apart. Neither was reproducible:
21
+ on the 0.2.42 packed set the letter pass is 971 across 26, the word pass 310
22
+ across 20, and their union 1034 across 29. So 1034 was the union and never the
23
+ letter pass. The comment now describes the mechanism and states no figure at
24
+ all; the live number lives in `docs/claims/locale-residue.json`, where a run
25
+ compares it.
26
+
27
+ **And the number underneath both of them was a measurement of one disk.** See
28
+ the 0.2.43 entry, corrected in place: `324 / 22` came from a working tree
29
+ holding two gitignored files under `docs/audit/` that are in no commit. It
30
+ reached a changelog, and from there a public mailing list, where nobody can
31
+ reproduce it.
32
+
33
+ **`test/pack_tracked.mjs`** is the mechanism for that class, and it is not
34
+ about Turkish. Every path npm would ship must be tracked by git or fall under
35
+ one declared generated prefix, `dist/`, which `npm run build` reproduces from
36
+ source. Anything else is a file that exists on the packer's machine and in no
37
+ release, which means the package built here is not the package CI builds, and
38
+ every measurement taken over it is a measurement of somebody's disk.
39
+
40
+ The same mechanism once shipped a private key: `npm publish` from a machine
41
+ that had run the demo included `examples/_keys/audit-ed25519.pem`, which is why
42
+ package.json carries the sentence about .gitignore not binding npm and why
43
+ `pack_artefakt.mjs` locks that one path. This locks the class instead of the
44
+ path. It fails closed: if git cannot answer, the check does not pass.
45
+
46
+ ## 0.2.45 - the rest of an outside report, and a check over the descriptions
47
+
48
+ **Behaviour change in `conarium-verify` and `conarium-coverage`.** Read the two
49
+ rows below before upgrading a script that branches on exit codes.
50
+
51
+ Joel Hillier probed the exit-code defect we disclosed on 22 August and found
52
+ five routes to 20 where we had named three. 0.2.44 closed three of them. This
53
+ closes the other two.
54
+
55
+ **A file that is valid JSON but not JSONL was called "invalid JSON".** The
56
+ loader splits on newlines unless the file opens with `[`, so a pretty-printed
57
+ JSON object has its opening brace handed to `JSON.parse` alone, and the tool
58
+ reported a valid file as invalid. His point was that the false message mattered
59
+ more than the code, and it does: a caller acts on what it is told went wrong.
60
+ The message now names the real fact and says how to fix it. Where a reader
61
+ actually meets this is directory mode - pointed at our own published
62
+ `test-vectors/`, the verifier reached `expected-hashes.json` and stopped. A
63
+ directory is now asked for the receipts in it: a neighbour that is valid JSON
64
+ in the wrong shape is skipped **and named on stderr**, never skipped quietly.
65
+
66
+ **The check ordering.** The key was loaded before the target was resolved, so a
67
+ path that does not exist answered 13 - a verdict about signatures, for a file
68
+ never opened - and answered 2 as soon as an unrelated `--pubkey` was supplied.
69
+ Which wrong answer a caller received was a fact about check order. The target is
70
+ resolved first now, in `conarium-verify` and `conarium-coverage`. Fail-closed is
71
+ untouched: a missing target exits 2, and a target that is present still cannot
72
+ be verified without a key.
73
+
74
+ | Invocation | 0.2.44 | 0.2.45 |
75
+ |---|---|---|
76
+ | valid JSON that is not JSONL | 20, "invalid JSON" | **2**, and the message is true |
77
+ | a directory holding receipts and a metadata file | 20 | **0**, the metadata file named as skipped |
78
+ | a missing target with no `--pubkey` | 13 | **2** |
79
+ | a corrupt receipts file | 20 | 20, unchanged |
80
+ | a missing `--pubkey` on a file that exists | 13 | 13, unchanged |
81
+
82
+ The last two rows are the split, and a property test decided where it fell. The
83
+ first attempt sent every parse failure to 2, and
84
+ `src/invariants.property.test.ts` - which mutates one byte of a signed chain -
85
+ failed. It was right to: a corrupted file is the artefact being examined and
86
+ rejected, which is a verdict, and answering 2 would send an operator to check
87
+ their arguments instead of their evidence. Valid JSON in the wrong shape is 2.
88
+ Anything else is 20, in a directory as well as out of one.
89
+
90
+ **`test/exit_code_descriptions.mjs`** is new, and it is the part worth keeping.
91
+ The same code is described in `docs/RECEIPT-SPEC.md`, in
92
+ `test-vectors/manifest.json` and in `scripts/gen-test-vectors.mjs`. It requires
93
+ the two machine-readable copies to be identical and each manifest description to
94
+ be the leading clause of the specification's row. On its first run it failed on
95
+ two things nothing else could see: the manifest and the specification describing
96
+ code 2 differently in the same release, and the manifest describing 13 as
97
+ "signature invalid or missing while a pubkey was supplied" - false in the one
98
+ case 13 is returned for, since 13 is what you get when no pubkey was supplied.
99
+
100
+ `spec_exitcode_drift.mjs` was green through all of it, because it compares the
101
+ *set* of codes in the binaries with the set in the tables. That is the blindness
102
+ Joel named after hitting the identical shape in his own `ABSENT` verdict the
103
+ same week: a check over the members of a set cannot see a member that means two
104
+ things. The new check does not close it entirely - it establishes that the three
105
+ texts agree with each other, not that any of them is true of the binary.
106
+
3
107
  ## 0.2.44 — a verdict code, on all four tools, now means something was read
4
108
 
5
109
  **This is a behaviour change to every command-line tool in the package. Read
@@ -57,11 +161,26 @@ plainly rather than implied by an untested green.
57
161
 
58
162
  `test/pack_locale.mjs` has always ended with a line naming what it does *not*
59
163
  fix: Turkish left under `docs/`, out of interface scope, printed so it stays
60
- visible. The line read `324 occurrences across 22 files`. The letter pass finds
61
- **1034 lines across 29 files**. The remainder was counted by `wordProbe` alone —
62
- the pass written for Turkish that carries *no* Turkish letter, and therefore the
63
- wrong instrument for Turkish prose. Both passes now run and the union is
64
- reported.
164
+ visible. The 0.2.43 note wrote that line down as `324 occurrences across 22
165
+ files`, and called **1034 lines across 29 files** the letter pass. Remeasured
166
+ on 22 August 2026 against both bases that could have produced those figures:
167
+ the published 0.2.42 tarball (508 extracted paths) and `npm pack --dry-run` at
168
+ `v0.2.42` (256 paths). The lists differ only by `dist/` build artefacts, which
169
+ `docsRemainder` already excludes (`bin/`, `scripts/` and `public/` too). On
170
+ that packed-doc set the 0.2.42 instrument (`wordProbe` only) is **310 lines
171
+ across 20 files**. `324 / 22` reproduces on neither base, and the reason
172
+ was found rather than left open: two files under `docs/audit/` that are
173
+ gitignored, present on the machine the figure was taken on, and in no commit.
174
+ Copy them into a clean v0.2.42 worktree and the same guard prints 324 across
175
+ 22; remove them and it prints 310 across 20. The number was never a fact about
176
+ the package. `.gitignore` does not bind npm, so a tree with extra files packs
177
+ a different package, and 0.2.46 adds `test/pack_tracked.mjs` to refuse that.
178
+ The `308 / 19` handover note below is the same class with the cause still
179
+ unknown. The **union** of letter and word on that set is **1034 / 29**; the
180
+ letter pass alone is 971 / 26. 1034 is the union, not the letter pass. The
181
+ remainder was counted by `wordProbe` alone — the pass written for Turkish that
182
+ carries *no* Turkish letter, and therefore the wrong instrument for Turkish
183
+ prose. Both passes now run and the union is reported.
65
184
 
66
185
  What the package was shipping under that number: `docs/superpowers/`,
67
186
  `docs/plans/`, `docs/specs/` and `docs/audit/` — dated internal design and
@@ -382,18 +382,25 @@ async function main(argv = process.argv.slice(2)) {
382
382
  process.exit(2)
383
383
  }
384
384
 
385
- const keyResult = loadVerifyKeys(opts.pubkeys)
386
- if (keyResult.error) {
387
- fail(keyResult.code, keyResult.error, opts.json)
388
- }
389
- const { keys } = keyResult
390
-
385
+ /**
386
+ * Target before key, for the reason set out in conarium-verify: with the key
387
+ * first, a declaration that is not there answered 13 — a signature verdict
388
+ * about a file nobody opened — and answered 2 as soon as an unrelated
389
+ * --pubkey was supplied. Fail-closed is unaffected: a missing declaration
390
+ * exits 2, and one that is present still needs a key.
391
+ */
391
392
  const declResult = loadDeclaration(opts.target)
392
393
  if (declResult.error) {
393
394
  fail(declResult.code, declResult.error, opts.json)
394
395
  }
395
396
  const d = declResult.declaration
396
397
 
398
+ const keyResult = loadVerifyKeys(opts.pubkeys)
399
+ if (keyResult.error) {
400
+ fail(keyResult.code, keyResult.error, opts.json)
401
+ }
402
+ const { keys } = keyResult
403
+
397
404
  const schemaErr = schemaOk(d)
398
405
  if (schemaErr) {
399
406
  fail(20, `schema invalid: ${schemaErr}`, opts.json)
@@ -247,43 +247,124 @@ function loadVerifyKeys(paths) {
247
247
  return { keys }
248
248
  }
249
249
 
250
+ function isWholeJson(raw) {
251
+ try {
252
+ JSON.parse(raw)
253
+ return true
254
+ } catch {
255
+ return false
256
+ }
257
+ }
258
+
259
+ /**
260
+ * Read one file as receipts, or say truthfully why it could not be.
261
+ *
262
+ * The message used to be `invalid JSON in <file>:1` for any line that failed
263
+ * to parse, and for the commonest case that sentence was false. Receipts are
264
+ * one per line, so a pretty-printed JSON document has its opening brace handed
265
+ * to JSON.parse on its own — and the file it was read from is perfectly valid
266
+ * JSON. An outside reader hit it and said the message mattered more than the
267
+ * code, which is right: a caller acts on what it is told went wrong, and being
268
+ * told a valid file is invalid sends them to look at the wrong thing.
269
+ *
270
+ * So the file is asked the second question before the tool answers the first.
271
+ * Valid JSON that is not JSONL is a format mismatch and says so; anything else
272
+ * is genuinely malformed and says that instead.
273
+ */
274
+ function parseReceiptFile(file, raw) {
275
+ const lines =
276
+ raw.includes('\n') && !raw.trimStart().startsWith('[')
277
+ ? raw.split('\n').filter(Boolean)
278
+ : [raw]
279
+ const out = []
280
+ for (let i = 0; i < lines.length; i++) {
281
+ let obj
282
+ try {
283
+ obj = JSON.parse(lines[i])
284
+ } catch (err) {
285
+ /**
286
+ * Two different answers, and the split decides whether this is a verdict.
287
+ *
288
+ * If the whole file is valid JSON, nothing is wrong with the bytes — the
289
+ * caller handed a shape this tool does not read, and no judgement about
290
+ * the content has been made. That is 2.
291
+ *
292
+ * If it is not valid JSON either, the artefact was examined and rejected,
293
+ * and that is a verdict whatever the caller intended. It stays in the
294
+ * verdict range, because a one-byte mutation of a signed chain lands
295
+ * here — `src/invariants.property.test.ts` mutates a valid chain and
296
+ * caught this file answering 2 when it first split them. Telling a
297
+ * caller "your command could not be run" about a tampered file sends
298
+ * them to check their arguments instead of their evidence.
299
+ */
300
+ if (isWholeJson(raw)) {
301
+ return {
302
+ code: 2,
303
+ error:
304
+ `${file} is JSON but not JSONL: this reads one receipt per line, ` +
305
+ `and line ${i + 1} is not a complete JSON document on its own. ` +
306
+ 'Convert it with `jq -c .`, or pass a file that already has one receipt per line.',
307
+ }
308
+ }
309
+ return { code: 20, error: `${file}:${i + 1} is not valid JSON: ${err.message}` }
310
+ }
311
+ if (Array.isArray(obj)) {
312
+ for (const item of obj) out.push(item)
313
+ } else {
314
+ out.push(obj)
315
+ }
316
+ }
317
+ return { receipts: out }
318
+ }
319
+
250
320
  function loadReceipts(target) {
251
321
  if (!existsSync(target)) {
252
322
  return { error: `path not found: ${target}`, code: 2 }
253
323
  }
254
324
  const st = statSync(target)
255
- let files = []
256
- if (st.isDirectory()) {
257
- files = readdirSync(target)
258
- .filter((f) => ['.json', '.jsonl', '.receipt'].includes(extname(f)))
259
- .map((f) => join(target, f))
260
- .sort()
261
- } else {
262
- files = [target]
263
- }
325
+ const isDir = st.isDirectory()
326
+ const files = isDir
327
+ ? readdirSync(target)
328
+ .filter((f) => ['.json', '.jsonl', '.receipt'].includes(extname(f)))
329
+ .map((f) => join(target, f))
330
+ .sort()
331
+ : [target]
264
332
 
265
333
  const receipts = []
334
+ const skipped = []
266
335
  for (const file of files) {
267
336
  const raw = readFileSync(file, 'utf-8').trim()
268
337
  if (!raw) continue
269
- const lines = raw.includes('\n') && !raw.trimStart().startsWith('[')
270
- ? raw.split('\n').filter(Boolean)
271
- : [raw]
272
- for (let i = 0; i < lines.length; i++) {
273
- let obj
274
- try {
275
- obj = JSON.parse(lines[i])
276
- } catch (err) {
277
- return { error: `invalid JSON in ${file}:${i + 1}: ${err.message}`, code: 20 }
278
- }
279
- if (Array.isArray(obj)) {
280
- for (const item of obj) receipts.push({ file, receipt: item })
281
- } else {
282
- receipts.push({ file, receipt: obj })
338
+ const parsed = parseReceiptFile(file, raw)
339
+ if (parsed.error) {
340
+ /**
341
+ * Naming a file asserts that it is receipts, so failing to read it is
342
+ * the answer. Naming a directory asks about the receipts in it, and a
343
+ * neighbour that is not receipts is not a verdict about the ones that
344
+ * are — this is what happens to anyone who points the verifier at our
345
+ * own published `test-vectors/`, where `expected-hashes.json` sits
346
+ * beside the vectors and used to stop the run.
347
+ *
348
+ * Skipped, and named. Skipping quietly would report success over
349
+ * something that was never examined, which is the defect this codebase
350
+ * keeps finding in itself and in other people's checkers.
351
+ */
352
+ if (isDir && parsed.code === 2) {
353
+ skipped.push(parsed.error)
354
+ continue
283
355
  }
356
+ /**
357
+ * A neighbour that is not valid JSON at all is never skipped, in a
358
+ * directory or out of it. A corrupt file sitting among receipts is
359
+ * exactly what a tampered receipt looks like, and skipping it because
360
+ * the caller named a directory rather than a file would decide, on a
361
+ * detail of the invocation, not to report evidence.
362
+ */
363
+ return { error: parsed.error, code: parsed.code }
284
364
  }
365
+ for (const receipt of parsed.receipts) receipts.push({ file, receipt })
285
366
  }
286
- return { receipts }
367
+ return { receipts, skipped }
287
368
  }
288
369
 
289
370
  function schemaOk(r) {
@@ -444,17 +525,34 @@ async function main(argv = process.argv.slice(2)) {
444
525
  )
445
526
  }
446
527
 
447
- const keyResult = loadVerifyKeys(opts.pubkeys)
448
- if (keyResult.error) {
449
- fail(keyResult.code, keyResult.error, opts.json)
450
- }
451
- const { keys } = keyResult
452
-
528
+ /**
529
+ * The target is resolved before the key is loaded, and the order is the
530
+ * point. Both checks are refusals, but they answer different questions, and
531
+ * whichever runs first decides what a caller is told about an invocation
532
+ * that is wrong in two ways. With the key first, a path that does not exist
533
+ * came back as 13 — a verdict about signatures, for a file that was never
534
+ * opened — and the same missing path came back as 2 the moment an unrelated
535
+ * --pubkey was added. Which answer you got was a fact about this ordering
536
+ * rather than about your run.
537
+ *
538
+ * Fail-closed is untouched by the swap: a target that is missing exits 2,
539
+ * which is not success, and a target that is present still cannot be
540
+ * verified without a key.
541
+ */
453
542
  const loaded = loadReceipts(opts.target)
454
543
  if (loaded.error) {
455
544
  fail(loaded.code, loaded.error, opts.json)
456
545
  }
457
546
  const { receipts } = loaded
547
+ for (const note of loaded.skipped ?? []) {
548
+ console.error(`skipped, not receipts: ${note}`)
549
+ }
550
+
551
+ const keyResult = loadVerifyKeys(opts.pubkeys)
552
+ if (keyResult.error) {
553
+ fail(keyResult.code, keyResult.error, opts.json)
554
+ }
555
+ const { keys } = keyResult
458
556
 
459
557
  let anchorRows = []
460
558
  if (opts.anchorCheck) {
@@ -192,14 +192,14 @@ are unchanged.
192
192
  |---|---|
193
193
  | 0 | Chain intact, signatures valid |
194
194
  | 1 | The tool failed unexpectedly — no verdict was reached |
195
- | 2 | The command could not be run as given — a flag that does not exist, a required argument that was not given, or a target that is not there. The artefact under test was never opened, so nothing is being judged. |
195
+ | 2 | No verdict was reached because the run could not begin — a flag that does not exist, a required argument that was not given, a target that is not there, or an input that could not be read as receipts. No receipt was judged. |
196
196
  | 10 | Hash mismatch — record altered |
197
197
  | 11 | `prevHash` break — deleted or inserted; also `--expect-count` / `--expect-last-hash` mismatch |
198
198
  | 12 | `seq` gap / non-increasing — missing or reordered |
199
199
  | 13 | Signature invalid / pubkey missing (fail-closed) |
200
200
  | 14 | Claimed anchor invalid under `--anchor-check`, or `--require-head-anchor` when the head is unanchored. An individual `anchor:null` receipt is skipped, not failed — periodic anchoring leaves most of them null. |
201
201
  | 15 | Anchor **could not be checked** — calendar unreachable, the OpenTimestamps verifier is not installed, or `--anchor-check` reached no anchor at all because every receipt in the chain is unanchored. Deliberately distinct from 14: "I could not verify this" is not "this is invalid". The digest comparison is performed offline and still holds; only the timestamp attestation is unconfirmed. A verifier that collapsed the two would be asserting something it did not measure. |
202
- | 20 | Schema invalid — a receipt was read and failed the schema |
202
+ | 20 | The input was read as receipts and rejected — a receipt that failed the schema, or a file that is not valid JSON. A one-byte mutation of a signed chain lands here rather than on 2: the bytes were examined. |
203
203
 
204
204
  Fail-closed: if the verifier is unsure, it does not exit 0.
205
205
 
@@ -484,7 +484,7 @@ occurred"** — an absent record is ambiguous by nature.
484
484
  |---|---|
485
485
  | 0 | Declaration signature valid (+ consistent with receipts if given), chain contiguous. Unpinned window start is printed, not a silent complete. |
486
486
  | 1 | The tool failed unexpectedly — no verdict was reached |
487
- | 2 | The command could not be run as given — a flag that does not exist, a required argument that was not given, or a declaration or receipts file that is not there. The artefact under test was never opened, so nothing is being judged. |
487
+ | 2 | No verdict was reached because the run could not begin — a flag that does not exist, a required argument that was not given, or a declaration or receipts file that is not there. Nothing was judged. |
488
488
  | 12 | Chain has gaps — coverage incomplete (`--allow-gaps` verifies authenticity only); also `--expect-seq-from` miss |
489
489
  | 13 | Signature invalid / pubkey missing (fail-closed); also a receipt Ed25519 failure under `--receipts` |
490
490
  | 20 | Schema invalid — the declaration was read and failed the schema |
@@ -558,7 +558,7 @@ Rules that keep the verdict honest:
558
558
  |---|---|
559
559
  | 0 | Every DB query pattern in the window is attributable to receipt(s) for the same table — object attribution, not per-statement coverage |
560
560
  | 1 | The tool failed unexpectedly — no verdict was reached |
561
- | 2 | The command could not be run as given — a flag that does not exist, a required argument that was not given, or a snapshot, receipts file or profile that is not there. The artefact under test was never opened, so nothing is being judged. |
561
+ | 2 | No verdict was reached because the run could not begin — a flag that does not exist, a required argument that was not given, or a snapshot, receipts file or profile that is not there. Nothing was judged. |
562
562
  | 20 | Input was read and is invalid, or the window is unreliable (schema error, counter regression) |
563
563
  | 40 | Unreconciled DB activity — recorded by the database, not receipted |
564
564
  | 41 | Indeterminate — a pattern is uncovered only by the window boundary, and two clocks decide that boundary |
@@ -701,7 +701,7 @@ conarium-stamp <file> [--sidecar <path>] [--json]
701
701
  |---|---|
702
702
  | 0 | Stamped; sidecar written (`pending` until upgraded) |
703
703
  | 1 | The tool failed unexpectedly — no verdict was reached |
704
- | 2 | The command could not be run as given — a flag that does not exist, a required argument that was not given, or a target that is not there. The artefact under test was never opened, so nothing is being judged. |
704
+ | 2 | No verdict was reached because the run could not begin — a flag that does not exist, a required argument that was not given, or a target that is not there or unreadable. Nothing was judged. |
705
705
  | 50 | Stamping failed — calendars unreachable or timed out |
706
706
 
707
707
  Receipts are not anchored by the write path. An operator stamps a document
@@ -0,0 +1,96 @@
1
+ # Claims review — 0.2.45
2
+
3
+ - base: v0.2.44
4
+ - head: e67cac8
5
+ - surface: sha256:e9d01e4e6f99670242922cf7c7d960d85adb9ca786d238d8a5f4279bc1c3eb43
6
+ - verdict: pass
7
+ - reviewer: maintainer, correcting a disposition written in the previous review
8
+ against an objection it had not read carefully enough
9
+
10
+ One surface changed: the four exit-code tables in `docs/RECEIPT-SPEC.md`. Every
11
+ `2` row was rewritten, the verifier's `20` row was widened, and both changes
12
+ came from measuring rather than from taste.
13
+
14
+ ## Findings
15
+
16
+ ### 1. The previous review answered an objection the reporter had not made
17
+
18
+ - Claim, in `docs/claims/reviews/0.2.44.md`: that a missing `--pubkey` returning
19
+ 13 "stays for the reason 0.2.42 gave for the verifier: 13 is fail-closed. A
20
+ caller that has special-cased it is asserting *do not trust this result*, and
21
+ moving a missing key to 2 would switch that assertion off."
22
+ - Mechanism: the report being answered. Joel Hillier's message of 22 August
23
+ 01:56 says, of the same behaviour, *"The refusal itself is right and I'd keep
24
+ it, and the message says plainly what happened."*
25
+ - Why it falls short: the objection was never that the refusal should go. It was
26
+ that the published description is false — `test-vectors/manifest.json`
27
+ described 13 as *"signature invalid or missing while a pubkey was supplied"*,
28
+ and 13 is what is returned when no pubkey was supplied — and that the check
29
+ ordering decided which of two wrong answers a caller received. A disposition
30
+ that defends a position the reporter already granted looks like an answer and
31
+ settles nothing. Rejecting a finding is legitimate; rejecting a finding one
32
+ has misread is not, and the second is harder to notice because it produces
33
+ the same paragraph.
34
+ - Disposition: both halves are fixed in this release. The description now
35
+ matches the specification's row, and the target is resolved before the key is
36
+ loaded. The previous review's second reason — that reordering "belongs in a
37
+ release that is about the fail-closed posture" — does not survive being
38
+ checked either: fail-closed means never reporting success without verifying
39
+ signatures, a missing target now exits 2, and a target that is present still
40
+ requires a key. Nothing about the posture moved. It was a harmless reorder
41
+ classified as a safety change, which is how work gets deferred for a reason
42
+ that reads well and is not true.
43
+
44
+ ### 2. docs/RECEIPT-SPEC.md — the `2` row has now been rewritten in three consecutive releases
45
+
46
+ - Claim, before this release: "The artefact under test was never opened, so
47
+ nothing is being judged."
48
+ - Mechanism: the paths that reach 2. In 0.2.44 they were argument errors and
49
+ absent targets, and the sentence held. This release adds a file that is valid
50
+ JSON in the wrong shape, and reaching that verdict requires opening the file
51
+ and reading all of it.
52
+ - Why it falls short: the sentence was true when written and was made false by
53
+ the next commit that widened the code. This is the third wording — 0.2.42
54
+ shipped "Usage error", 0.2.44 narrowed it to "the artefact under test was
55
+ never opened" after that overclaimed, and 0.2.45 has now falsified that one.
56
+ A row that has to be re-examined every time a path is added to its code is a
57
+ row whose text is doing work the code should be doing.
58
+ - Disposition: reworded to what is true of every path — "No verdict was reached
59
+ because the run could not begin" — and, more usefully, `test/exit_contract.mjs`
60
+ now asserts the behaviour of each path rather than leaving the row to carry
61
+ it alone. The pattern is recorded because the next widening of code 2 should
62
+ start by asking whether the row survives it.
63
+
64
+ ### 3. docs/RECEIPT-SPEC.md — the `20` row moved because a property test disagreed with the split
65
+
66
+ - Claim: "| 20 | The input was read as receipts and rejected — a receipt that
67
+ failed the schema, or a file that is not valid JSON. A one-byte mutation of a
68
+ signed chain lands here rather than on 2: the bytes were examined. |"
69
+ - Mechanism: `src/invariants.property.test.ts` mutates one byte of a valid
70
+ signed chain and asserts the result is never 0, over a set of verdict codes.
71
+ - Why it falls short — of the first attempt, not the shipped text: the first
72
+ version of this change sent *every* parse failure to 2, on the reasoning that
73
+ no receipt had been read. The property test failed, and it was right to. A
74
+ corrupted receipts file is not a caller who mistyped a command; it is the
75
+ artefact being examined and rejected, which is a verdict, and answering 2
76
+ would send an operator to check their arguments instead of their evidence.
77
+ The distinction that decides it was already in the code — whether the file is
78
+ valid JSON at all — and it had been wired to the wrong branch.
79
+ - Disposition: valid JSON in the wrong shape is 2; anything else stays 20, in a
80
+ directory as well as out of one, because skipping a corrupt neighbour would
81
+ make reporting evidence depend on whether the caller named a file or a folder.
82
+
83
+ ## Not a finding, recorded so the next reader does not re-derive it
84
+
85
+ `test/exit_code_descriptions.mjs` is the mechanism this class has been missing,
86
+ and what it caught on its first run is the argument for it: code 2 described
87
+ differently by the manifest and the specification in the same release, and code
88
+ 13 described by the manifest as something that is false in the one case it is
89
+ returned for. Neither was visible to `spec_exitcode_drift.mjs`, which compares
90
+ the *set* of codes in the binaries with the set in the tables — the same
91
+ blindness that let 20 name two events until 0.2.42.
92
+
93
+ Its own limit, stated: it checks that the three texts agree with each other. It
94
+ does not check that any of them is true of the binary. `exit_contract.mjs` asks
95
+ that question of the codes and cannot ask it of the sentences, and a run that is
96
+ green here means the descriptions are consistent, not that they are correct.
@@ -0,0 +1,67 @@
1
+ # Claims review — 0.2.46
2
+
3
+ - base: v0.2.45
4
+ - head: 696c694
5
+ - surface: sha256:e9d01e4e6f99670242922cf7c7d960d85adb9ca786d238d8a5f4279bc1c3eb43
6
+ - verdict: pass
7
+ - reviewer: maintainer, after a figure this file's process approved reached a
8
+ public archive and turned out to describe one machine
9
+
10
+ The surface hash is unchanged from 0.2.45. No file in `docs/claims/surfaces.json`
11
+ was touched: this release changes two guards, adds a third, and corrects a
12
+ changelog. That is exactly why the substantive finding below is not a finding
13
+ against the diff, and recording it here anyway is the point.
14
+
15
+ ## Findings
16
+
17
+ none, against the claim surfaces.
18
+
19
+ ## The reason this record is not empty
20
+
21
+ **A number that no claim-surface check could see was published to a mailing
22
+ list, and the process that let it through is this one.**
23
+
24
+ `324 Turkish lines across 22 packed doc files` was written into the 0.2.43
25
+ changelog and, on 22 August, into a message on the SCITT list. It is not
26
+ reproducible. Run v0.2.42's own `pack_locale.mjs` in a clean worktree and it
27
+ prints **310 across 20**. Copy in two gitignored files under `docs/audit/` that
28
+ sit on one machine and in no commit, and it prints **324 across 22**. The
29
+ figure measured a working directory.
30
+
31
+ Every gate held and none of them was pointed here:
32
+
33
+ - `claim_discipline` scans surfaces for retracted phrasings. A number is not a
34
+ phrasing.
35
+ - `denetci` compares the surface hash. `CHANGELOG.md` is not a surface, on
36
+ purpose, because a changelog is a record rather than a claim about the
37
+ present.
38
+ - `pack_locale` printed the figure. It had no reason to doubt its own output,
39
+ and it was correct about the tree it was given.
40
+ - `version_claim` compares what npm shipped against the tag. It compares
41
+ contents, not the provenance of the files that produced them.
42
+
43
+ So the defect was not that a check failed. There was no check whose subject was
44
+ *"is the tree this measurement was taken over the tree this repository
45
+ describes"*. `test/pack_tracked.mjs` is that check, and it is the whole
46
+ deliverable of this release. The two label repairs are consequences.
47
+
48
+ **What it does not close.** It establishes that the packed set matches the
49
+ repository plus `dist/`. It says nothing about figures measured over anything
50
+ else — a corpus, a database, a run on another machine — and nothing about
51
+ whether a number in prose was copied correctly from a run that did happen. A
52
+ figure written by hand into a document is still a hand-written figure; the only
53
+ one now mechanically pinned is the locale remainder, in
54
+ `docs/claims/locale-residue.json`.
55
+
56
+ ## Not a finding, recorded so the next reader does not re-derive it
57
+
58
+ The first attempt to show `pack_tracked` red used the two `docs/audit/` files
59
+ that caused the original defect. It stayed **green**, and correctly: 0.2.43
60
+ excluded `docs/audit` from the package, so those files are no longer packed
61
+ from any tree. The red was produced instead with a stray file under `docs/`,
62
+ which is where the class still bites.
63
+
64
+ Worth stating because the near-miss is instructive: a red test built from the
65
+ historical culprit can pass for a reason that has nothing to do with the check
66
+ being wrong, and a reviewer reading only the green would have concluded the
67
+ guard worked. It did work. The demonstration did not.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conarium-ai/core",
3
- "version": "0.2.44",
3
+ "version": "0.2.46",
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.",
@@ -185,12 +185,12 @@ writeFileSync(
185
185
  exitCodes: {
186
186
  0: 'chain intact, signatures valid',
187
187
  1: 'the tool failed unexpectedly — no verdict was reached',
188
- 2: 'the command could not be run as given — nothing was read',
188
+ 2: 'no verdict was reached because the run could not begin',
189
189
  10: 'hash mismatch — record altered',
190
190
  11: 'prevHash break — deleted or inserted',
191
191
  12: 'seq gap / non-increasing',
192
- 13: 'signature invalid or missing while a pubkey was supplied',
193
- 20: 'schema invalid — a receipt was read and failed the schema',
192
+ 13: 'signature invalid / pubkey missing (fail-closed)',
193
+ 20: 'the input was read as receipts and rejected',
194
194
  },
195
195
  cases,
196
196
  },
@@ -7,12 +7,12 @@
7
7
  "exitCodes": {
8
8
  "0": "chain intact, signatures valid",
9
9
  "1": "the tool failed unexpectedly — no verdict was reached",
10
- "2": "the command could not be run as given — nothing was read",
10
+ "2": "no verdict was reached because the run could not begin",
11
11
  "10": "hash mismatch — record altered",
12
12
  "11": "prevHash break — deleted or inserted",
13
13
  "12": "seq gap / non-increasing",
14
- "13": "signature invalid or missing while a pubkey was supplied",
15
- "20": "schema invalid — a receipt was read and failed the schema"
14
+ "13": "signature invalid / pubkey missing (fail-closed)",
15
+ "20": "the input was read as receipts and rejected"
16
16
  },
17
17
  "cases": [
18
18
  {