@conarium-ai/core 0.2.38 → 0.2.39
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 +35 -0
- package/README.md +1 -1
- package/bin/conarium-coverage.mjs +20 -19
- package/bin/conarium-init.mjs +10 -9
- package/bin/conarium-reconcile.mjs +6 -6
- package/bin/conarium-verify.mjs +37 -33
- package/dist/audit-hash.d.ts +1 -1
- package/dist/audit-hash.d.ts.map +1 -1
- package/dist/audit-hash.js +1 -1
- package/dist/audit-hash.js.map +1 -1
- package/dist/audit.d.ts +22 -21
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +104 -88
- package/dist/audit.js.map +1 -1
- package/dist/config.d.ts +69 -433
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +7 -4
- package/dist/config.js.map +1 -1
- package/dist/connectors/supabase_rest.d.ts +2 -2
- package/dist/connectors/supabase_rest.d.ts.map +1 -1
- package/dist/connectors/supabase_rest.js +7 -5
- package/dist/connectors/supabase_rest.js.map +1 -1
- package/dist/console-receipts.d.ts +2 -2
- package/dist/console-receipts.d.ts.map +1 -1
- package/dist/console-receipts.js +2 -2
- package/dist/console-receipts.js.map +1 -1
- package/dist/console.d.ts +6 -22
- package/dist/console.d.ts.map +1 -1
- package/dist/console.js +13 -12
- package/dist/console.js.map +1 -1
- package/dist/coverage.d.ts +32 -30
- package/dist/coverage.d.ts.map +1 -1
- package/dist/coverage.js +39 -36
- package/dist/coverage.js.map +1 -1
- package/dist/governance.d.ts +14 -13
- package/dist/governance.d.ts.map +1 -1
- package/dist/governance.js +52 -48
- package/dist/governance.js.map +1 -1
- package/dist/http.d.ts +6 -5
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +45 -41
- package/dist/http.js.map +1 -1
- package/dist/iban.d.ts.map +1 -1
- package/dist/iban.js +13 -12
- package/dist/iban.js.map +1 -1
- package/dist/llm-gate.d.ts +6 -6
- package/dist/llm-gate.js +6 -6
- package/dist/pseudonymize.d.ts +8 -8
- package/dist/pseudonymize.d.ts.map +1 -1
- package/dist/pseudonymize.js +7 -7
- package/dist/pseudonymize.js.map +1 -1
- package/dist/receipt-view.d.ts +1 -1
- package/dist/receipt-view.d.ts.map +1 -1
- package/dist/receipt-view.js +52 -51
- package/dist/receipt-view.js.map +1 -1
- package/dist/receipt.d.ts +32 -28
- package/dist/receipt.d.ts.map +1 -1
- package/dist/receipt.js +23 -20
- package/dist/receipt.js.map +1 -1
- package/dist/scripts/discover_schema.js +14 -12
- package/dist/scripts/discover_schema.js.map +1 -1
- package/dist/scripts/dogfood_prove.js +16 -16
- package/dist/scripts/dogfood_prove.js.map +1 -1
- package/dist/server.d.ts +5 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +44 -34
- package/dist/server.js.map +1 -1
- package/dist/sql-gate/rules.d.ts +8 -7
- package/dist/sql-gate/rules.d.ts.map +1 -1
- package/dist/sql-gate/rules.js +11 -9
- package/dist/sql-gate/rules.js.map +1 -1
- package/dist/tokens.d.ts +3 -3
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +18 -18
- package/dist/tokens.js.map +1 -1
- package/docs/RECEIPT-SPEC.md +188 -1
- package/docs/claims/reviews/0.2.39.md +90 -0
- package/package.json +6 -4
- package/public/app.js +6 -6
- package/public/index.html +7 -7
- package/public/receipts-panel.js +7 -7
- package/scripts/audit-chain-check.mjs +6 -6
- package/scripts/benchmark-overhead.mjs +4 -4
- package/scripts/conarium_sabah_brief.mjs +11 -11
- package/test-vectors/README.md +15 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.d.ts","sourceRoot":"","sources":["../../src/sql-gate/rules.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAE9C,eAAO,MAAM,YAAY,YACvB,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ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AQ,EAAE,MAAM,GAAG,OAAO,CAE/D;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,YAAY,GACrB,MAAM,GAAG,SAAS,CASpB;AAED,qEAAqE;AACrE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAyCpD"}
|
package/dist/sql-gate/rules.js
CHANGED
|
@@ -36,14 +36,15 @@ export const SAFE_BUILTIN_FUNCTIONS = new Set([
|
|
|
36
36
|
'upper',
|
|
37
37
|
]);
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
40
|
-
* Oracle
|
|
41
|
-
*
|
|
39
|
+
* Dialect-specific scalar functions. The shared list carries Postgres names; once
|
|
40
|
+
* the MSSQL and Oracle gates bound to that list, the most ordinary calls like
|
|
41
|
+
* `GETDATE`/`NVL` started being rejected — the gate closed while legitimate use
|
|
42
|
+
* broke.
|
|
42
43
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* sp_*, OPENROWSET/OPENJSON)
|
|
44
|
+
* Rule: only pure, read-oriented scalar transforms that do not change row count
|
|
45
|
+
* go here. Anything that aggregates/serializes rows is BLOCKED_DUMP_FUNCTIONS'
|
|
46
|
+
* job; families that produce dynamic SQL or reach file/network/OS (DBMS_*, UTL_*,
|
|
47
|
+
* xp_*, sp_*, OPENROWSET/OPENJSON) must never be written here.
|
|
47
48
|
*/
|
|
48
49
|
export const DIALECT_SAFE_FUNCTIONS = {
|
|
49
50
|
mssql: new Set([
|
|
@@ -109,8 +110,9 @@ export function hasRowLockClause(norm) {
|
|
|
109
110
|
export function isSafeBuiltinFunction(baseName, schema, dialect) {
|
|
110
111
|
if (SAFE_BUILTIN_FUNCTIONS.has(baseName) && (!schema || schema === 'pg_catalog'))
|
|
111
112
|
return true;
|
|
112
|
-
//
|
|
113
|
-
//
|
|
113
|
+
// The dialect list covers ONLY un-schema-qualified calls: `app.pkg.nvl` is a
|
|
114
|
+
// user package, not a builtin — if a schema qualifier is present the dialect
|
|
115
|
+
// list does not apply.
|
|
114
116
|
if (schema)
|
|
115
117
|
return false;
|
|
116
118
|
if (dialect === 'mssql' || dialect === 'oracle') {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/sql-gate/rules.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;IAC1E,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;CACzD,CAAA;AAEV,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IAC5C,KAAK;IACL,KAAK;IACL,OAAO;IACP,MAAM;IACN,SAAS;IACT,aAAa;IACb,UAAU;IACV,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,OAAO;IACP,QAAQ;IACR,OAAO;IACP,UAAU;IACV,OAAO;IACP,QAAQ;IACR,OAAO;IACP,OAAO;IACP,KAAK;IACL,KAAK;IACL,QAAQ;IACR,cAAc;IACd,gBAAgB;IAChB,uBAAuB;IACvB,SAAS;IACT,OAAO;IACP,OAAO;IACP,YAAY;IACZ,KAAK;IACL,MAAM;IACN,OAAO;CACR,CAAC,CAAA;AAEF
|
|
1
|
+
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/sql-gate/rules.ts"],"names":[],"mappings":"AAMA,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,SAAS;IAC1E,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS;CACzD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QACV,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YACd,QAAQ,GAAG,IAAI,CAAA;YACf,GAAG,IAAI,CAAC,CAAA;YACR,CAAC,IAAI,CAAC,CAAA;YACN,SAAQ;QACV,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,CAAC,IAAI,CAAC,CAAA;YACN,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI,IAAI,GAAG,CAAC,CAAC,CAAC,KAAK,IAAI;gBAAE,CAAC,IAAI,CAAC,CAAA;YACnE,GAAG,IAAI,GAAG,CAAA;YACV,SAAQ;QACV,CAAC;QACD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;YAC3B,CAAC,IAAI,CAAC,CAAA;YACN,OAAO,CAAC,GAAG,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC;gBAAE,CAAC,IAAI,CAAC,CAAA;YACxE,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM;gBAAE,CAAC,IAAI,CAAC,CAAA;YAC1B,GAAG,IAAI,GAAG,CAAA;YACV,SAAQ;QACV,CAAC;QACD,GAAG,IAAI,CAAC,CAAA;QACR,CAAC,IAAI,CAAC,CAAA;IACR,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC"}
|
package/dist/tokens.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ export interface ResolvedActor {
|
|
|
4
4
|
assurance: ActorAssurance;
|
|
5
5
|
isUser: boolean;
|
|
6
6
|
}
|
|
7
|
-
/**
|
|
7
|
+
/** hash → person id. If the file is missing, null = per-person identity is off (not an error). */
|
|
8
8
|
export declare function loadTokenStore(path?: string): Map<string, string> | null;
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
11
|
-
*
|
|
10
|
+
* Resolves the incoming token to a person. If there is no match it NEVER
|
|
11
|
+
* invents a person identity — it falls back to shared-token behavior.
|
|
12
12
|
*/
|
|
13
13
|
export declare function resolveActor(supplied: string, store: Map<string, string> | null, fallbackId: string): ResolvedActor;
|
|
14
14
|
//# sourceMappingURL=tokens.d.ts.map
|
package/dist/tokens.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAE9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,OAAO,CAAA;CAChB;AAYD,
|
|
1
|
+
{"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,gBAAgB,CAAA;AAE9D,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,cAAc,CAAA;IACzB,MAAM,EAAE,OAAO,CAAA;CAChB;AAYD,kGAAkG;AAClG,wBAAgB,cAAc,CAAC,IAAI,GAAE,MAAwB,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAkBzF;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EACjC,UAAU,EAAE,MAAM,GACjB,aAAa,CAOf"}
|
package/dist/tokens.js
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Per-person identity — token store.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* 'service'
|
|
7
|
-
*
|
|
4
|
+
* Why a token, not a declaration: a name the client sends (such as
|
|
5
|
+
* X-Conarium-Actor) has not been verified by anyone; signing it onto the
|
|
6
|
+
* receipt is worse than an honest 'service' value. Conarium already verifies
|
|
7
|
+
* the token, so it KNOWS who connected.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Tokens are not stored in plaintext — only a SHA-256 hash. Even if the
|
|
10
|
+
* file leaks, nobody's token is captured.
|
|
11
11
|
*/
|
|
12
12
|
import { createHash } from 'node:crypto';
|
|
13
13
|
import { existsSync, readFileSync } from 'node:fs';
|
|
14
14
|
/**
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
15
|
+
* The path is read on every call, NOT at module load.
|
|
16
|
+
* If it were captured as a constant, changing `CONARIUM_TOKENS_FILE`
|
|
17
|
+
* afterwards would affect nothing — including tests, which would silently
|
|
18
|
+
* measure the wrong thing.
|
|
19
19
|
*/
|
|
20
20
|
function varsayilanYol() {
|
|
21
21
|
return process.env.CONARIUM_TOKENS_FILE || 'conarium.tokens.json';
|
|
22
22
|
}
|
|
23
|
-
/**
|
|
23
|
+
/** hash → person id. If the file is missing, null = per-person identity is off (not an error). */
|
|
24
24
|
export function loadTokenStore(path = varsayilanYol()) {
|
|
25
25
|
if (!existsSync(path))
|
|
26
26
|
return null;
|
|
@@ -29,10 +29,10 @@ export function loadTokenStore(path = varsayilanYol()) {
|
|
|
29
29
|
raw = JSON.parse(readFileSync(path, 'utf8'));
|
|
30
30
|
}
|
|
31
31
|
catch (e) {
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
//
|
|
35
|
-
throw new Error(`loadTokenStore: ${path}
|
|
32
|
+
// We THROW on purpose, we do not silently return null: returning null
|
|
33
|
+
// would turn off per-person identity unnoticed and everyone would become
|
|
34
|
+
// 'service' again — a silent drop is far more dangerous than a noisy error.
|
|
35
|
+
throw new Error(`loadTokenStore: ${path} unreadable or invalid JSON — ${e.message}`);
|
|
36
36
|
}
|
|
37
37
|
const map = new Map();
|
|
38
38
|
for (const t of raw.tokens ?? []) {
|
|
@@ -43,8 +43,8 @@ export function loadTokenStore(path = varsayilanYol()) {
|
|
|
43
43
|
return map;
|
|
44
44
|
}
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
47
|
-
*
|
|
46
|
+
* Resolves the incoming token to a person. If there is no match it NEVER
|
|
47
|
+
* invents a person identity — it falls back to shared-token behavior.
|
|
48
48
|
*/
|
|
49
49
|
export function resolveActor(supplied, store, fallbackId) {
|
|
50
50
|
if (store && supplied) {
|
package/dist/tokens.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAUlD;;;;;GAKG;AACH,SAAS,aAAa;IACpB,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,sBAAsB,CAAA;AACnE,CAAC;AAED,
|
|
1
|
+
{"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAUlD;;;;;GAKG;AACH,SAAS,aAAa;IACpB,OAAO,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,sBAAsB,CAAA;AACnE,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,cAAc,CAAC,IAAI,GAAW,aAAa,EAAE;IAC3D,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;QAAE,OAAO,IAAI,CAAA;IAClC,I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MAAM,EAAE,KAAK,EAAE,CAAA;AACrE,CAAC"}
|
package/docs/RECEIPT-SPEC.md
CHANGED
|
@@ -207,10 +207,197 @@ block-explorer client in this repository; `ignoreBitcoinNode: true` is set.
|
|
|
207
207
|
Tracked remainder: unclassified network-shaped errors still share 14 with
|
|
208
208
|
"proof does not hold".
|
|
209
209
|
|
|
210
|
+
## Wire format for a second implementation
|
|
211
|
+
|
|
212
|
+
An independent implementer built a verifier from the published vectors and the
|
|
213
|
+
IETF draft alone. They reached 13/13 — but only after opening this repository's
|
|
214
|
+
source, because four things were nowhere in the documents: what the signature
|
|
215
|
+
actually covers, that `seq` must advance by exactly one, which absent fields are
|
|
216
|
+
schema errors rather than hash mismatches, and in what order the checks run.
|
|
217
|
+
A specification that has to be read alongside its own implementation is not
|
|
218
|
+
finished. What they had to guess is written down below.
|
|
219
|
+
|
|
220
|
+
Parts of this section are asserted against the shipped verifier by
|
|
221
|
+
`test/spec_wire_contract.mjs` and are marked **measured** where they appear:
|
|
222
|
+
the signed payload and its byte length, the order the checks run in, the
|
|
223
|
+
required-field table row by row, and the vector counts quoted in prose. If the
|
|
224
|
+
code moves and one of those sentences does not, the check fails.
|
|
225
|
+
|
|
226
|
+
The rest of this section is prose. It describes behaviour the verifier has, and
|
|
227
|
+
nothing in the test suite compares it to the code — the same gap the
|
|
228
|
+
Implementation Status guard was written to close one document over. Read it as
|
|
229
|
+
accurate on the revision that shipped it, not as pinned.
|
|
230
|
+
|
|
231
|
+
### What the signature covers — measured
|
|
232
|
+
|
|
233
|
+
`sig.value` is base64 of an Ed25519 signature over the **UTF-8 bytes of the
|
|
234
|
+
`chain.hash` string, `sha256:` prefix included** — 71 bytes for a SHA-256
|
|
235
|
+
digest (`sha256:` plus 64 hex characters).
|
|
236
|
+
|
|
237
|
+
It is not the raw 32-byte digest, not the hex without the prefix, and not the
|
|
238
|
+
canonical JSON of the receipt. Those are the three natural guesses, and the
|
|
239
|
+
guard verifies that a correct signature fails against all three: an
|
|
240
|
+
implementation that picks one of them produces receipts nobody else can check,
|
|
241
|
+
and discovers this only when a second party tries.
|
|
242
|
+
|
|
243
|
+
```
|
|
244
|
+
payload = utf8("sha256:" + hex(SHA-256(canonical bytes))) # 71 bytes
|
|
245
|
+
sig.value = base64(Ed25519-sign(payload))
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
The three paragraphs that follow are prose, not measured. `sig.alg` is
|
|
249
|
+
`Ed25519` — any other value is rejected before the key is loaded.
|
|
250
|
+
`sig.keyId` selects the public key from the caller's trust set; an unknown
|
|
251
|
+
`keyId` is a signature failure, not a "skip". `sig.value` must be canonical
|
|
252
|
+
base64: a re-encodable variant is refused rather than normalised.
|
|
253
|
+
|
|
254
|
+
The signature covers the hash, and the hash covers the receipt. `hash`, `sig`
|
|
255
|
+
and `anchor` are excluded from the bytes that are hashed — which is what lets a
|
|
256
|
+
transparency-log anchor be attached after signing, and is also the limit
|
|
257
|
+
recorded under **Known gaps**.
|
|
258
|
+
|
|
259
|
+
### `seq` advances by exactly one
|
|
260
|
+
|
|
261
|
+
**Measured:** that a gap yields exit 12, and that it is diagnosed before the
|
|
262
|
+
signature check. **Not measured:** the non-increasing case and
|
|
263
|
+
`--expect-seq-from`, which no vector exercises — stated here rather than left
|
|
264
|
+
to be discovered.
|
|
265
|
+
|
|
266
|
+
`chain.seq` is an integer that increases by **exactly one** between consecutive
|
|
267
|
+
receipts. Both failure shapes are exit **12**:
|
|
268
|
+
|
|
269
|
+
- `seq` not greater than its predecessor — reordered or duplicated;
|
|
270
|
+
- `seq` greater by more than one — a receipt is missing.
|
|
271
|
+
|
|
272
|
+
`prevHash` alone does not catch the second case. A chain with a deleted receipt
|
|
273
|
+
can still link correctly if the deletion happened before the successors were
|
|
274
|
+
written; only the counter reveals the hole. That is what vector
|
|
275
|
+
`005-seq-gap` is for, and a verifier that checks hashes but not `seq` passes it
|
|
276
|
+
and is wrong.
|
|
277
|
+
|
|
278
|
+
`--expect-seq-from N` pins the first receipt of the file to `N`. Without it, a
|
|
279
|
+
file whose first receipt is `seq: 7` verifies as a valid *suffix* — the
|
|
280
|
+
verifier reports what it can prove, and where a chain starts is not something a
|
|
281
|
+
single file can prove.
|
|
282
|
+
|
|
283
|
+
### Fields whose absence is a schema error (exit 20) — measured
|
|
284
|
+
|
|
285
|
+
A receipt missing one of these is not a tampered receipt — it is not a receipt.
|
|
286
|
+
The distinction matters because the exit code is a diagnosis: reporting exit 10
|
|
287
|
+
("record altered") for a document that never had the field would name the wrong
|
|
288
|
+
event.
|
|
289
|
+
|
|
290
|
+
Each row is checked by removing exactly that path from the named vector and
|
|
291
|
+
requiring exit 20.
|
|
292
|
+
|
|
293
|
+
| Path | Checked against |
|
|
294
|
+
|---|---|
|
|
295
|
+
| `v` | 001-single-receipt |
|
|
296
|
+
| `id` | 001-single-receipt |
|
|
297
|
+
| `ts` | 001-single-receipt |
|
|
298
|
+
| `period` | 001-single-receipt |
|
|
299
|
+
| `request` | 001-single-receipt |
|
|
300
|
+
| `dataRefs` | 001-single-receipt |
|
|
301
|
+
| `policy` | 001-single-receipt |
|
|
302
|
+
| `policy.decision` | 001-single-receipt |
|
|
303
|
+
| `flags` | 001-single-receipt |
|
|
304
|
+
| `masking` | 001-single-receipt |
|
|
305
|
+
| `outcome` | 001-single-receipt |
|
|
306
|
+
| `actor` | 001-single-receipt |
|
|
307
|
+
| `actor.type` | 001-single-receipt |
|
|
308
|
+
| `actor.assurance` | 001-single-receipt |
|
|
309
|
+
| `chain` | 001-single-receipt |
|
|
310
|
+
| `chain.seq` | 001-single-receipt |
|
|
311
|
+
| `chain.prevHash` | 001-single-receipt |
|
|
312
|
+
| `chain.hash` | 001-single-receipt |
|
|
313
|
+
| `consentRef` | 001-single-receipt |
|
|
314
|
+
| `anchor` | 001-single-receipt |
|
|
315
|
+
| `model` | 001-single-receipt |
|
|
316
|
+
| `model.source` | 001-single-receipt |
|
|
317
|
+
| `client` | 001-single-receipt |
|
|
318
|
+
| `client.source` | 001-single-receipt |
|
|
319
|
+
| `disclosure` | 010-disclosure-commitment |
|
|
320
|
+
| `disclosure.source` | 010-disclosure-commitment |
|
|
321
|
+
| `disclosure.hash` | 010-disclosure-commitment |
|
|
322
|
+
| `disclosure.bytes` | 010-disclosure-commitment |
|
|
323
|
+
| `destination` | 010-disclosure-commitment |
|
|
324
|
+
| `destination.source` | 010-disclosure-commitment |
|
|
325
|
+
| `destination.value` | 010-disclosure-commitment |
|
|
326
|
+
|
|
327
|
+
`consentRef` and `anchor` must be **present and null**, not absent: the two
|
|
328
|
+
carry different meanings, and a reader who cannot tell "declared empty" from
|
|
329
|
+
"never written" is guessing. The same rule governs `disclosure` and
|
|
330
|
+
`destination` under `source: "undeclared"` — the value keys stay, holding
|
|
331
|
+
`null`. Vector `013-disclosure-keys-omitted` locks that case.
|
|
332
|
+
|
|
333
|
+
`model` and `client` are required from v0.3 onward; `disclosure` and
|
|
334
|
+
`destination` from v0.4. An older receipt that lacks them is valid at its own
|
|
335
|
+
version — the version field decides which rows apply, which is why a v0.3
|
|
336
|
+
receipt in a v0.4 chain still verifies (`012-mixed-chain`).
|
|
337
|
+
|
|
338
|
+
`sig` is deliberately not in this table. A receipt without a signature is a
|
|
339
|
+
well-formed receipt that cannot be trusted — exit **13**, not 20.
|
|
340
|
+
|
|
341
|
+
### Check order — measured
|
|
342
|
+
|
|
343
|
+
The order is part of the contract, because the exit code is a diagnosis and the
|
|
344
|
+
wrong order produces a true verdict with a false reason.
|
|
345
|
+
|
|
346
|
+
| Order | Check | Exit on failure |
|
|
347
|
+
|---|---|---|
|
|
348
|
+
| 1st | Schema | 20 |
|
|
349
|
+
| 2nd | Recomputed content hash | 10 |
|
|
350
|
+
| 3rd | `prevHash` link to the previous receipt | 11 |
|
|
351
|
+
| 4th | `seq` advances by exactly one | 12 |
|
|
352
|
+
| 5th | Ed25519 signature | 13 |
|
|
353
|
+
| 6th | Anchor, only under `--anchor-check` | 14 / 15 |
|
|
354
|
+
|
|
355
|
+
Receipts are processed in file order, and the first failure ends the run — so
|
|
356
|
+
the exit code names the first defective receipt, not the worst one.
|
|
357
|
+
|
|
358
|
+
Put the signature check first and a deleted receipt (`004`) or a sequence gap
|
|
359
|
+
(`005`) reports as a bad signature whenever the offending receipt is also
|
|
360
|
+
unsigned. The verdict "do not trust this chain" is unchanged; the operator is
|
|
361
|
+
sent to look at the wrong thing. The guard builds exactly that case — it
|
|
362
|
+
removes the signature from the one receipt that already breaks the chain — and
|
|
363
|
+
requires 11 and 12 rather than 13.
|
|
364
|
+
|
|
365
|
+
### Canonical form, and what the vectors do not measure — prose
|
|
366
|
+
|
|
367
|
+
Content bytes are canonicalised with **JCS (RFC 8785)** and digested with
|
|
368
|
+
SHA-256, prefixed `sha256:`. `hash`, `sig` and `anchor` are removed first,
|
|
369
|
+
including the nested `chain.hash`.
|
|
370
|
+
|
|
371
|
+
`expected-hashes.json` publishes those digests, so a second implementation can
|
|
372
|
+
compare canonical bytes without holding our private key. Matching them is what
|
|
373
|
+
interoperability actually requires; signing is RFC 8032 and none of it is ours.
|
|
374
|
+
|
|
375
|
+
⚠️ **Stated limit.** The published vectors are ASCII-keyed with integer and
|
|
376
|
+
string values. A naive sorted-key serialiser reproduces every one of their
|
|
377
|
+
hashes, so passing them does **not** demonstrate a conforming JCS
|
|
378
|
+
implementation. The number formatting rules (RFC 8785 §3.2.2.3) and the
|
|
379
|
+
UTF-16 code-unit sort order over non-ASCII keys are unexercised. A receipt
|
|
380
|
+
carrying a float, a large integer, or a non-ASCII key is where two
|
|
381
|
+
implementations will first disagree, and this repository does not currently
|
|
382
|
+
publish a vector that would catch it.
|
|
383
|
+
|
|
384
|
+
### Which document is normative for what — prose
|
|
385
|
+
|
|
386
|
+
The IETF draft (`standards/`) defines Transformation Evidence and Coverage
|
|
387
|
+
Reconciliation, and states that signature and chain verification are **out of
|
|
388
|
+
scope** for it. That is deliberate: those belong to the receipt format, not to
|
|
389
|
+
the evidence structures layered on top.
|
|
390
|
+
|
|
391
|
+
So the draft is normative for the evidence structures; **this document is
|
|
392
|
+
normative for the receipt wire format** — signature payload, canonical form,
|
|
393
|
+
sequence rule, schema requirements and check order. An implementer who reads
|
|
394
|
+
only the draft has not been told how to verify a receipt, and should not
|
|
395
|
+
conclude the format leaves it open.
|
|
396
|
+
|
|
210
397
|
## Conformance vectors
|
|
211
398
|
|
|
212
399
|
A specification that cannot be implemented from the document alone is a blog
|
|
213
|
-
post. [`test-vectors/`](../test-vectors/) is the difference:
|
|
400
|
+
post. [`test-vectors/`](../test-vectors/) is the difference: thirteen frozen cases,
|
|
214
401
|
the public key, and a machine-readable manifest.
|
|
215
402
|
|
|
216
403
|
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# Claims review — 0.2.39
|
|
2
|
+
|
|
3
|
+
- base: d46b00d
|
|
4
|
+
- head: e182d9a
|
|
5
|
+
- surface: sha256:66ceac7f7ddc9957d3b4c1ec117f88b5a127b55c5c43ad121a3aa02f9e53bf5e
|
|
6
|
+
- verdict: pass
|
|
7
|
+
- reviewer: maintainer, re-reading the surfaces after the wire-format section and
|
|
8
|
+
the second locale pass were merged
|
|
9
|
+
|
|
10
|
+
The version was reviewed once already, before publication, on the translation
|
|
11
|
+
pass. That review recorded two limits for the next reader — that the locale
|
|
12
|
+
check tests for letters rather than language, and that Turkish markdown still
|
|
13
|
+
ships beside the code. Both were acted on before the version left the tree, so
|
|
14
|
+
this record supersedes the earlier one rather than repeating it.
|
|
15
|
+
|
|
16
|
+
The gate stopped the release, which is the first time it has stopped anything,
|
|
17
|
+
and the finding below is the one it produced.
|
|
18
|
+
|
|
19
|
+
## Findings
|
|
20
|
+
|
|
21
|
+
### 1. docs/RECEIPT-SPEC.md:220 — a section against overclaiming, overclaiming
|
|
22
|
+
|
|
23
|
+
- Claim: "Every statement in this section is asserted against the shipped
|
|
24
|
+
verifier by `test/spec_wire_contract.mjs`. If the code moves and a sentence
|
|
25
|
+
does not, that check fails — the sentences are measured, not remembered."
|
|
26
|
+
- Mechanism: `test/spec_wire_contract.mjs`, which makes fourteen assertions: the
|
|
27
|
+
signed payload against four candidate encodings, the payload byte length
|
|
28
|
+
against the number in the document, the order of the checks against receipts
|
|
29
|
+
built to fail two at once, the required-field table row by row, the vector
|
|
30
|
+
counts quoted in prose, that every manifest case is described, and that the
|
|
31
|
+
deep-link into this section resolves.
|
|
32
|
+
- Why it falls short: the section contains statements none of those touch —
|
|
33
|
+
that `sig.alg` other than `Ed25519` is rejected before the key is loaded, that
|
|
34
|
+
an unknown `keyId` is a failure rather than a skip, that a non-canonical
|
|
35
|
+
base64 signature is refused rather than normalised, what `--expect-seq-from`
|
|
36
|
+
pins, the JCS limits paragraph, and the whole section on which document is
|
|
37
|
+
normative for what. "Every statement" asserted a property over a section when
|
|
38
|
+
it held over part of it, which is the same shape as a conformance runner
|
|
39
|
+
reporting a class it sampled — the failure this repository has been arguing
|
|
40
|
+
about on the SCITT list for three days, in its own document.
|
|
41
|
+
- Disposition: reworded in e182d9a. The four measured parts are labelled
|
|
42
|
+
**measured** in their headings; the two that are not are labelled **prose**;
|
|
43
|
+
and the introduction states that the prose is not compared to the code by
|
|
44
|
+
anything in the test suite.
|
|
45
|
+
|
|
46
|
+
### 2. docs/RECEIPT-SPEC.md — `seq`, where the label needed splitting
|
|
47
|
+
|
|
48
|
+
- Claim: `### seq advances by exactly one — measured` (the first correction's
|
|
49
|
+
own first attempt).
|
|
50
|
+
- Mechanism: the order test runs `005-seq-gap` and requires exit 12 with the
|
|
51
|
+
signature removed from the receipt that fails.
|
|
52
|
+
- Why it falls short: that measures the gap case and its position in the check
|
|
53
|
+
order. The non-increasing case and `--expect-seq-from` are exercised by no
|
|
54
|
+
vector, so labelling the whole section "measured" would have repeated the
|
|
55
|
+
first finding one heading down.
|
|
56
|
+
- Disposition: reworded in e182d9a. The section now states which half is
|
|
57
|
+
measured and names the two behaviours no vector exercises.
|
|
58
|
+
|
|
59
|
+
### 3. README.md:347 — a count that had been wrong in two files
|
|
60
|
+
|
|
61
|
+
- Claim: "conformance vectors — twelve frozen cases plus a machine-readable
|
|
62
|
+
manifest".
|
|
63
|
+
- Mechanism: `test-vectors/manifest.json`, which carries thirteen cases.
|
|
64
|
+
- Why it falls short: the same claim appeared in `README.md` and
|
|
65
|
+
`docs/RECEIPT-SPEC.md`, and the test suite stayed green because each file was
|
|
66
|
+
internally consistent. A reader counting the table in `test-vectors/README.md`
|
|
67
|
+
would have found thirteen and had no way to tell which number was the stale
|
|
68
|
+
one.
|
|
69
|
+
- Disposition: corrected, and the recurrence closed — prose counts in all three
|
|
70
|
+
files are now compared against the manifest by `test/spec_wire_contract.mjs`,
|
|
71
|
+
and every manifest case must appear in the vector README's table.
|
|
72
|
+
|
|
73
|
+
## Limits recorded rather than left to be found
|
|
74
|
+
|
|
75
|
+
- The prose half of the wire-format section is accurate on this revision and
|
|
76
|
+
pinned by nothing. It is marked as such in the document; a reader who wants a
|
|
77
|
+
guarantee has the four measured parts and the vectors.
|
|
78
|
+
- `test/spec_wire_contract.mjs` compares any prose "N cases" in three files
|
|
79
|
+
against the manifest. A future sentence in one of those files about some other
|
|
80
|
+
document's vector count will fail this check wrongly. The message names the
|
|
81
|
+
file and the phrase, so the cost is one edit, but it is a known edge rather
|
|
82
|
+
than a discovered one.
|
|
83
|
+
- The locale check now reads words as well as letters, and the word list is
|
|
84
|
+
deliberately small: it excludes every Turkish word that is also English. A
|
|
85
|
+
Turkish sentence built only from words outside that list still passes.
|
|
86
|
+
- Turkish design history under `docs/` still ships in the package — 308 word
|
|
87
|
+
occurrences across 19 packed files at the time of this review. The check
|
|
88
|
+
prints that number on every green run rather than passing over it. Whether
|
|
89
|
+
that history belongs in a tarball is a packaging decision, not a claim defect,
|
|
90
|
+
and it is not made here.
|
package/package.json
CHANGED
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@conarium-ai/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.39",
|
|
4
4
|
"mcpName": "io.github.dogrucanemek-alt/conarium",
|
|
5
|
-
"//files-artefakt": "
|
|
6
|
-
"//files": "
|
|
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
|
+
"//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.",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
9
9
|
"bin",
|
|
10
10
|
"scripts",
|
|
11
11
|
"docs",
|
|
12
12
|
"!docs/reviews",
|
|
13
|
+
"!docs/teaching",
|
|
14
|
+
"!docs/teaching/**",
|
|
13
15
|
"!docs/benchmarks/*.cpuprofile",
|
|
14
16
|
"public",
|
|
15
17
|
"assets",
|
|
@@ -105,7 +107,7 @@
|
|
|
105
107
|
"node-sql-parser": "^5.4.0",
|
|
106
108
|
"pgsql-ast-parser": "^12.0.2",
|
|
107
109
|
"postgres": "^3.4.4",
|
|
108
|
-
"zod": "
|
|
110
|
+
"zod": "4.4.3"
|
|
109
111
|
},
|
|
110
112
|
"devDependencies": {
|
|
111
113
|
"@jazzer.js/core": "^4.0.0",
|
package/public/app.js
CHANGED
|
@@ -22,7 +22,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
22
22
|
const empty = document.getElementById('receipt-empty')
|
|
23
23
|
if (empty && name === 'receipts') {
|
|
24
24
|
empty.hidden = false
|
|
25
|
-
empty.textContent = '
|
|
25
|
+
empty.textContent = 'Receipts panel not found.'
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -223,7 +223,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
223
223
|
try {
|
|
224
224
|
const res = await apiFetch('/api/receipts')
|
|
225
225
|
if (!res.ok) {
|
|
226
|
-
ConariumReceiptsPanel.showError(ui, '
|
|
226
|
+
ConariumReceiptsPanel.showError(ui, 'Could not load the receipt list (' + res.status + ').')
|
|
227
227
|
return
|
|
228
228
|
}
|
|
229
229
|
const data = await res.json()
|
|
@@ -237,7 +237,7 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
237
237
|
},
|
|
238
238
|
})
|
|
239
239
|
} catch (e) {
|
|
240
|
-
ConariumReceiptsPanel.showError(ui, '
|
|
240
|
+
ConariumReceiptsPanel.showError(ui, 'Could not load the receipt list.')
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
|
|
@@ -249,18 +249,18 @@ document.addEventListener('DOMContentLoaded', () => {
|
|
|
249
249
|
const res = await apiFetch('/api/receipts/' + encodeURIComponent(id))
|
|
250
250
|
if (!res.ok) {
|
|
251
251
|
detail.hidden = false
|
|
252
|
-
detail.textContent = '
|
|
252
|
+
detail.textContent = 'Could not read the receipt (' + res.status + ').'
|
|
253
253
|
return
|
|
254
254
|
}
|
|
255
255
|
const data = await res.json()
|
|
256
256
|
detail.hidden = false
|
|
257
257
|
detail.innerHTML = data.html || ''
|
|
258
258
|
if (data.html && /BEGIN PRIVATE KEY|BEGIN.*PRIVATE/.test(data.html)) {
|
|
259
|
-
detail.textContent = '
|
|
259
|
+
detail.textContent = 'a private key reached the panel — not shown'
|
|
260
260
|
}
|
|
261
261
|
} catch (e) {
|
|
262
262
|
detail.hidden = false
|
|
263
|
-
detail.textContent = '
|
|
263
|
+
detail.textContent = 'Could not read the receipt.'
|
|
264
264
|
}
|
|
265
265
|
}
|
|
266
266
|
|
package/public/index.html
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
<a href="#" class="nav-item" data-tab="playground">Playground</a>
|
|
21
21
|
<a href="#" class="nav-item" data-tab="governance">Governance</a>
|
|
22
22
|
<a href="#" class="nav-item" data-tab="audit">Audit Logs</a>
|
|
23
|
-
<a href="#" class="nav-item" data-tab="receipts">
|
|
23
|
+
<a href="#" class="nav-item" data-tab="receipts">Receipts</a>
|
|
24
24
|
</nav>
|
|
25
25
|
</aside>
|
|
26
26
|
|
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
<div class="tab-content" id="tab-receipts">
|
|
98
98
|
<div class="card glass-panel">
|
|
99
99
|
<div class="card-header">
|
|
100
|
-
<h3>
|
|
101
|
-
<button class="btn secondary-btn" id="refresh-receipts">
|
|
100
|
+
<h3>Receipts</h3>
|
|
101
|
+
<button class="btn secondary-btn" id="refresh-receipts">Refresh</button>
|
|
102
102
|
</div>
|
|
103
103
|
<p id="receipt-chain" class="receipt-chain" hidden></p>
|
|
104
104
|
<p id="receipt-empty" class="receipt-empty" hidden></p>
|
|
@@ -106,10 +106,10 @@
|
|
|
106
106
|
<table class="audit-table" id="receipt-table" hidden>
|
|
107
107
|
<thead>
|
|
108
108
|
<tr>
|
|
109
|
-
<th>
|
|
110
|
-
<th>
|
|
111
|
-
<th>
|
|
112
|
-
<th>
|
|
109
|
+
<th>Time</th>
|
|
110
|
+
<th>Actor</th>
|
|
111
|
+
<th>Tool</th>
|
|
112
|
+
<th>Decision</th>
|
|
113
113
|
<th>Maske</th>
|
|
114
114
|
<th>seq</th>
|
|
115
115
|
</tr>
|
package/public/receipts-panel.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
2
|
+
* Receipts tab view-state. Called BEFORE the fetch — otherwise the first click
|
|
3
|
+
* stays empty (everything hidden) and only the second click looks filled.
|
|
4
4
|
*/
|
|
5
5
|
(function (root) {
|
|
6
6
|
function showLoading(ui) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
ui.table.hidden = true
|
|
9
9
|
ui.detail.hidden = true
|
|
10
10
|
ui.empty.hidden = false
|
|
11
|
-
ui.empty.textContent = '
|
|
11
|
+
ui.empty.textContent = 'Loading…'
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
function showError(ui, message) {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
ui.table.hidden = true
|
|
25
25
|
ui.detail.hidden = true
|
|
26
26
|
ui.empty.hidden = false
|
|
27
|
-
ui.empty.textContent = message || '
|
|
27
|
+
ui.empty.textContent = message || 'no receipts yet'
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
function showList(ui, data, make) {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
if (chain.ok === false) {
|
|
37
37
|
ui.chain.hidden = false
|
|
38
38
|
ui.chain.className = 'receipt-chain broken'
|
|
39
|
-
ui.chain.textContent = '
|
|
39
|
+
ui.chain.textContent = 'broken (row ' + chain.brokenAt + ')'
|
|
40
40
|
} else {
|
|
41
41
|
ui.chain.hidden = false
|
|
42
42
|
ui.chain.className = 'receipt-chain ok'
|
|
43
|
-
ui.chain.textContent = '
|
|
43
|
+
ui.chain.textContent = 'chain intact'
|
|
44
44
|
}
|
|
45
45
|
items.forEach(function (row) {
|
|
46
46
|
const tr = make.tr()
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
|
|
72
72
|
function render(ui, data, make) {
|
|
73
73
|
if (!data || data.error) {
|
|
74
|
-
showError(ui, (data && data.error) || '
|
|
74
|
+
showError(ui, (data && data.error) || 'Could not load the receipt list.')
|
|
75
75
|
return 'error'
|
|
76
76
|
}
|
|
77
77
|
const items = Array.isArray(data.items) ? data.items : []
|