@conarium-ai/core 0.2.42 → 0.2.43

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,43 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.43 — the number watching the Turkish was reporting a third of it
4
+
5
+ `test/pack_locale.mjs` has always ended with a line naming what it does *not*
6
+ fix: Turkish left under `docs/`, out of interface scope, printed so it stays
7
+ visible. The line read `324 occurrences across 22 files`. The letter pass finds
8
+ **1034 lines across 29 files**. The remainder was counted by `wordProbe` alone —
9
+ the pass written for Turkish that carries *no* Turkish letter, and therefore the
10
+ wrong instrument for Turkish prose. Both passes now run and the union is
11
+ reported.
12
+
13
+ What the package was shipping under that number: `docs/superpowers/`,
14
+ `docs/plans/`, `docs/specs/` and `docs/audit/` — dated internal design and
15
+ process documents, in Turkish, including plan files whose first instruction is
16
+ addressed to an agent rather than to a reader. They are out of the package, the
17
+ way `docs/reviews` and `docs/teaching` already were. **243 packed paths, down
18
+ from 257.** The remainder is **34 lines across 14 files**: the bilingual
19
+ limitation paragraphs in `README.md` and `docs/RECEIPT-SPEC.md`, product strings
20
+ quoted in this changelog, and a TURKPATENT citation in `docs/PRIOR-ART.md`.
21
+
22
+ Two sentences were translated rather than dropped: the specification test in
23
+ `conformance/README.md`, and a Turkish parenthetical inside an English paragraph
24
+ of `docs/RECEIPT-SPEC.md`.
25
+
26
+ The remainder is now **pinned** in `docs/claims/locale-residue.json` and the
27
+ guard fails when the tree disagrees with it — in either direction. A printed
28
+ number nobody compares against anything is how this one drifted through three
29
+ releases; it was copied into a handover note as `308 / 19`, a figure that
30
+ reproduces under no definition and matched no release.
31
+
32
+ `test/pack_path_refs.mjs` is new. Dropping `docs/superpowers/` turned the
33
+ "Design source:" line at the top of `docs/RECEIPT-SPEC.md` into a path a reader
34
+ who installed the package cannot open — a dead reference created by a packaging
35
+ change, with no character of that sentence edited. The check reads the documents
36
+ npm packs and fails when one names a path that exists in the repository and not
37
+ in the package. It only considers directories the package *partially* ships:
38
+ `src/` and `test/` are wholly absent and always were, and a check that reports
39
+ those is a check that gets switched off.
40
+
3
41
  ## 0.2.42 — a usage error is not a schema verdict
4
42
 
5
43
  `conarium-verify` exited **20** for an unknown flag and for a missing path.
@@ -7,7 +7,8 @@ reference adapter; the suite does not import that product.
7
7
  A one-person team maintains both the suite and one implementation. That
8
8
  is stated here so nobody has to discover it later.
9
9
 
10
- Dokümandan implement edilemiyorsa spesifikasyon değil blog yazısıdır.
10
+ If it cannot be implemented from the document, it is not a specification;
11
+ it is a blog post.
11
12
 
12
13
  If a frozen case stops matching, do not edit the expectation so the
13
14
  suite goes green. Either the implementation changes, or the
@@ -9,7 +9,9 @@ re-signed when 0.4 fields appear.
9
9
  Implements the portable side of EU AI Act Articles 12 (logging) and 19 (content
10
10
  of logs) for Conarium's governed MCP gateway.
11
11
 
12
- Design source: `docs/superpowers/specs/2026-07-29-conarium-receipt-design.md`.
12
+ Design source: [`2026-07-29-conarium-receipt-design.md`](https://github.com/dogrucanemek-alt/conarium/blob/main/docs/superpowers/specs/2026-07-29-conarium-receipt-design.md),
13
+ in the repository only — it is written in Turkish and the npm package does not
14
+ carry it. This document is the normative one either way.
13
15
 
14
16
  ## Official claim (do not widen)
15
17
 
@@ -723,7 +725,7 @@ revision history is itself timestamped.
723
725
  2. **`dataRefs[].fieldsRequested` and `policy.rulesApplied` are emitted empty.** Until 0.2.29 the first was filled from the masked-field list and the second from the set of SQL functions the query touched — in both cases a field whose name described something other than its contents. A reader takes `fieldsRequested` for the columns a query asked for, and `rulesApplied` for policy rule identifiers; neither was true, and both were signed. They are now empty, because in a signed document a field filled with the wrong thing is worse than a field left empty: empty says *unknown*, wrongly-filled says *known* and misleads. The correct contents are recoverable — selected columns from the SQL AST, rule identifiers from a policy engine that emits them — and neither is implemented; when it is, these fields carry it. **The conformance vectors under `test-vectors/` show both fields populated. Those vectors are hand-written to exercise the format and are not produced by this implementation; a populated value is valid, and an empty one is what this version emits.** Losing per-field masking detail from `dataRefs` is a regression and is stated here rather than absorbed silently — `masking.byClass` still carries the per-class counts.
724
726
  3. **Bypass detection — addressed as of reconcile v0.1, with stated limits.** Disabling Conarium and reading the DB directly still produces no receipt — no gateway can prevent that from inside. What changed: absence is now *checkable from both sides*. One-sided: `conarium-coverage` emits a signed declaration (chain contiguity + which declared objects have recorded access). Two-sided: `conarium-reconcile` compares the database's own per-role query counters against the in-window receipts and reports any DB-recorded pattern no receipt covers (see §Reconciliation). Remaining limits, stated: reconciliation trusts the DB's own counters (an attacker who can falsify `pg_stat_statements` is out of scope), requires a dedicated DB role per gateway instance, and matches per pattern/table — never per call count. **The language rule stands: "access NOT RECORDED", never "no access occurred."**
725
727
  4. **Creation-time truth is not proven.** Without hardware attestation, an operator can still write false-but-well-formed receipts *before* anchoring.
726
- 5. **In-file `sig` stripping + HMAC/`anchor` reduction.** Content `hash` is computed with `{hash, sig, anchor}` (and audit `signature`/`sig`) excluded, so an operator who controls the file can drop or thin those fields without invalidating the content hash itself. Contiguity and the trust store catch some boot-time cases, but full protection against in-file strip/reduce games is **not solvable in-file** (*in-file çözülemez*) — it needs an external transparency-log anchor and/or out-of-band key ceremony. **Opt-in strict boot (G3):** `CONARIUM_AUDIT_REQUIRE_SIG=1` rejects a chain with any unsigned line when a signing key is configured; the default stays the 08-05 compatibility open. **Mitigation available today, measured:** keep `CONARIUM_AUDIT_HMAC_KEY` enabled alongside Ed25519. HMAC is keyed, so an actor who strips `sig` and recomputes the unkeyed hashes still fails the HMAC check (`entry signature mismatch`). Verified by test: Ed25519 alone → strip-all passes the boot check; Ed25519 + HMAC → caught. `conarium-verify --pubkey` also catches it (exit 13, `missing sig`) because it is told to expect signatures. **Anchor client is available** (`conarium-stamp` / `conarium-anchor-service`; `CONARIUM_ANCHOR_SINK=opentimestamps` selects the calendars). Receipts start as `anchor: null`. After a stamp is submitted the sidecar is `pending` until Bitcoin finality (hours); see §Anchoring.
728
+ 5. **In-file `sig` stripping + HMAC/`anchor` reduction.** Content `hash` is computed with `{hash, sig, anchor}` (and audit `signature`/`sig`) excluded, so an operator who controls the file can drop or thin those fields without invalidating the content hash itself. Contiguity and the trust store catch some boot-time cases, but full protection against in-file strip/reduce games is **not solvable in-file** — it needs an external transparency-log anchor and/or out-of-band key ceremony. **Opt-in strict boot (G3):** `CONARIUM_AUDIT_REQUIRE_SIG=1` rejects a chain with any unsigned line when a signing key is configured; the default stays the 08-05 compatibility open. **Mitigation available today, measured:** keep `CONARIUM_AUDIT_HMAC_KEY` enabled alongside Ed25519. HMAC is keyed, so an actor who strips `sig` and recomputes the unkeyed hashes still fails the HMAC check (`entry signature mismatch`). Verified by test: Ed25519 alone → strip-all passes the boot check; Ed25519 + HMAC → caught. `conarium-verify --pubkey` also catches it (exit 13, `missing sig`) because it is told to expect signatures. **Anchor client is available** (`conarium-stamp` / `conarium-anchor-service`; `CONARIUM_ANCHOR_SINK=opentimestamps` selects the calendars). Receipts start as `anchor: null`. After a stamp is submitted the sidecar is `pending` until Bitcoin finality (hours); see §Anchoring.
727
729
  6. **`argsHash` hurts debugging.** Support cases need the customer's own logs to correlate.
728
730
  7. **Tail truncation is invisible to `conarium-verify` unless pinned.** Deleting the last N receipts leaves a consistent leftover chain (exit 0). `--expect-count` / `--expect-last-hash` exist for operators who have an external length or last-hash; they are opt-in so a verifier that saw the same file yesterday still exits 0 today. Anchoring the head, or `conarium-reconcile` against the database's own counters, are the other pins.
729
731
 
@@ -0,0 +1,7 @@
1
+ {
2
+ "lines": 34,
3
+ "files": 14,
4
+ "why": "bilingual limitation paragraphs, quoted product strings in the changelog, and a TURKPATENT citation",
5
+ "measuredBy": "test/pack_locale.mjs — union of the letter pass and the word pass over every path npm packs, excluding dist/bin/scripts/public and *.tr.md",
6
+ "rule": "A ceiling, not a target. Lower it whenever Turkish leaves the package. Raising it means a new Turkish file is shipping to strangers, which needs a reason written in the release note."
7
+ }
@@ -0,0 +1,75 @@
1
+ # Claims review — 0.2.43
2
+
3
+ - base: v0.2.42
4
+ - head: 392aadf
5
+ - surface: sha256:6cd0fa9075a09f70c75f3e5682d3454977f4a5c7025dbbe25540136aa6a89f40
6
+ - verdict: pass
7
+ - reviewer: maintainer. The release exists because a printed number was never
8
+ asked to agree with the tree, so every figure below was taken from the tree.
9
+
10
+ One surface changed: `docs/RECEIPT-SPEC.md`, twice. The "Design source" line at
11
+ the top was rewritten because the directory it pointed at left the package. A
12
+ Turkish parenthetical was deleted from limitation 5 — it restated in Turkish the
13
+ English words immediately beside it, "not solvable in-file", so nothing was
14
+ claimed or withdrawn. It is described rather than quoted here: the guard this
15
+ release fixes counts every packed document, and this file is one of them.
16
+
17
+ ## Findings
18
+
19
+ ### 1. docs/RECEIPT-SPEC.md:12 — "normative" is asserted where nothing compares the two documents
20
+
21
+ - Claim: "This document is the normative one either way."
22
+ - Mechanism: four checks read this file and measure it against the shipped
23
+ code — `spec_wire_contract.mjs`, `spec_jcs_class.mjs`,
24
+ `spec_exitcode_drift.mjs`, `implementation_status.mjs`. None of them, and
25
+ nothing else in the tree, reads the design document.
26
+ - Why it falls short: those checks establish that *this* document is held to the
27
+ code. They do not establish precedence, because precedence is only tested
28
+ where two documents disagree and nothing compares them. The design document
29
+ carries no marking on its own page saying it has been superseded, and it is
30
+ still in the repository, still dated, still readable — and now more likely to
31
+ be found on its own, since the sentence naming it links straight to it.
32
+ - Disposition: accepted, shipping. Dropping it from the package is the whole
33
+ remedy for the reader who arrived through `npm i`, which is the reader this
34
+ release is about. The repository reader is not covered. Marking the design
35
+ document would mean editing a dated record to keep a claim true, which is the
36
+ trade this project refuses elsewhere. Recorded rather than fixed.
37
+
38
+ ### 2. The pinned remainder measures the package, and will be read as measuring the project
39
+
40
+ - Claim: "34 Turkish line(s) across 14 packed doc file(s)" — the guard's line,
41
+ the pin in `docs/claims/locale-residue.json`, and the changelog paragraph.
42
+ - Mechanism: `docsRemainder` runs the letter pass and the word pass over the
43
+ output of `npm pack --dry-run`, so the figure is exactly the packed set.
44
+ - Why it falls short: the guard's own line says "packed", but the figure is
45
+ what gets copied out of it, and a figure copied out of a scope survives
46
+ without the scope. That is not a hypothetical — it is the defect this release
47
+ fixes. `324 / 22` was read as the size of the problem when it was the size of
48
+ what one probe could see, and it reached a handover note as `308 / 19`, a
49
+ number that reproduces under no definition at all. Measured, so the next
50
+ reader has both: the repository's tracked `.md`, `.txt` and `.json` carry
51
+ **1185 Turkish lines across 46 files**. The package carries 34 across 14.
52
+ - Disposition: accepted. `measuredBy` in the pin file now states the scope
53
+ beside the number rather than in a comment somewhere else, and the changelog
54
+ paragraph says "packed". The stronger remedy — a second pin over the whole
55
+ repository — is deliberately not taken: Turkish in a Turkish team's repository
56
+ is not a defect, and a guard that reports it every run is a guard that gets
57
+ switched off. The line that matters is the package boundary, and that is the
58
+ one now pinned.
59
+
60
+ ## Not a finding, recorded so the next reader does not re-derive it
61
+
62
+ The guard printed `N Turkish word occurrence(s)` for three releases while
63
+ counting **lines** — one hit per line, however many Turkish words that line
64
+ carried. The wording is corrected to `line(s)` here. It means the old figures
65
+ were further from an occurrence count than the 324-against-1034 gap alone
66
+ suggests, and that no comparison anyone made against them was measuring what
67
+ its own label said.
68
+
69
+ `test/pack_path_refs.mjs` is new and its first version was wrong in a way worth
70
+ writing down: it reported fifty-odd references to `src/` and `test/` paths as
71
+ broken, because it asked "is this path shipped?" instead of "is this path in a
72
+ directory the reader has reason to think is shipped?". `src/` and `test/` have
73
+ never been in the package; nobody is misled by a document that names them. The
74
+ check now derives the roots it polices from what npm actually packs, so it
75
+ covers `docs/` — which is half here — and leaves the wholly-absent roots alone.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@conarium-ai/core",
3
- "version": "0.2.42",
3
+ "version": "0.2.43",
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.",
@@ -12,6 +12,14 @@
12
12
  "!docs/reviews",
13
13
  "!docs/teaching",
14
14
  "!docs/teaching/**",
15
+ "!docs/superpowers",
16
+ "!docs/superpowers/**",
17
+ "!docs/plans",
18
+ "!docs/plans/**",
19
+ "!docs/specs",
20
+ "!docs/specs/**",
21
+ "!docs/audit",
22
+ "!docs/audit/**",
15
23
  "!docs/benchmarks/*.cpuprofile",
16
24
  "public",
17
25
  "assets",
@@ -1,69 +0,0 @@
1
- # E2E health — 2026-08-14
2
-
3
- O2. No refactor. Push / npm / Hetzner yok.
4
-
5
- ## a) Regresyon — temiz
6
-
7
- | Komut | Sonuç |
8
- |--|--|
9
- | `vitest run` | **483 geçti / 1 skip** (console-shortcut) |
10
- | `npm run test:checks` | **28/28** |
11
-
12
- Postgres `Governance.guardQuery` hâlâ `pgsql-ast-parser` + `sql-gate/rules` + `sql-gate/postgres`. MSSQL/Oracle ayrı fonksiyon; o yol değişmedi.
13
-
14
- ## b) Performans — temiz (karşılaştırma notu)
15
-
16
- `docs/BENCHMARK.md` alıntısı: same-limit partial, maxRows=100, ~**5 ms** (linux 2026-08-14T13:46Z: p50 **5.006** / p95 6.730 / p99 7.099).
17
-
18
- Bu tur: `docs/benchmarks/overhead-20260814T1644Z-win32.json` (Windows Node → Docker Postgres 16).
19
-
20
- | | eski p50 (linux) | yeni p50 (win32) |
21
- |--|--|--|
22
- | same-limit allow 100 | 2.850 ms | 1.992 ms |
23
- | same-limit partial 100 | **5.006 ms** | **3.158 ms** |
24
- | in-process guard allow | (yok / ayrı) | 0.359 ms |
25
-
26
- Ortak katman ayrımı guard yoluna ölçülebilir ek vergi koymadı. OS farklı; “ürün hızlandı” iddiası yok. 5 000 satır maskeli hâlâ saniye mertebesi (eski ~22 s linux / yeni ~7 s win32) — bilinen maliyet, yeni tıkanma değil.
27
-
28
- ## c) Uçtan uca zincir — temiz (kısmi bakılamadı)
29
-
30
- | Halka | Kanıt | Durum |
31
- |--|--|--|
32
- | sorgu → kapı | `governance.rowcap.test.ts`, `vectors.test.ts` postgres 28/28, `src/server.ts` `governance.guardQuery` | temiz |
33
- | maskeleme | `governance.masking.test.ts`, `http_gateway.e2e.mjs` search → `[MASKED_PII]`, email sızmıyor | temiz |
34
- | makbuz | `audit.receipt.test.ts`, e2e receipts 0→1 | temiz |
35
- | zincir | `audit.chain.test.ts` | temiz |
36
- | `conarium-verify` | e2e `verify exit 0` + `/verified/` | temiz |
37
- | panel | `console_receipts_tab.mjs` + `/api/receipts` (`console.ts`) | temiz (DOM sözleşmesi) |
38
-
39
- **Bakılamadı:** tarayıcıda, aynı süreçte üretilmiş bir makbuzun panele tıklanması. HTTP e2e SQL `query` aracını değil `search` (docs) yolunu koşuyor. MSSQL/Oracle’ın MCP `query` üzerinden seçilmesi — konnektör yok.
40
-
41
- ## d) Ölü kod / çift kaynak — bulgu
42
-
43
- | Bulgu | Kanıt | Etki | Öneri | Aciliyet |
44
- |--|--|--|--|--|
45
- | MCP `query` yalnız Postgres kapısı | `src/server.ts` `governance.guardQuery`; `console.ts` aynı. `guardMssqlQuery` / `guardOracleQuery` yalnız test + live betik | Beyan “SQL kapısı Oracle/MSSQL” doğru; **dağıtılan araç T-SQL/Oracle SQL’i Postgres parser’a verir** (fail-closed veya yanlış AST) | Lehçe seçimi ayrı karar. LIMITATIONS’a yazıldı | yüksek (iddia/yol) |
46
- | `matchGlob` üç kopya | `governance.ts` `match`, `mssql.ts`, `oracle.ts` | Kural sapması riski | Tek fonksiyon | düşük |
47
- | `*Adapter.inspect` sunucuda kullanılmıyor | yalnız `*.test.ts` | Ölü yüzey, zarar yok | Bırak veya bağla | düşük |
48
-
49
- ## e) `conarium-doctor` — bulgu
50
-
51
- `node bin/conarium-doctor.mjs --no-net` (repo `conarium.config.json`):
52
-
53
- - `maxRows: 50` eşik altı (100) → **uyarı yok** (doğru; eşiği görüyor).
54
- - Lehçe (MSSQL/Oracle) **yok**.
55
- - Özel PII deseni **yok** (config’de de yok).
56
- - FAIL: `DATABASE_READONLY_DSN` set değil — beklenen boş kurulum.
57
- - WARN: imza anahtarı yok.
58
-
59
- Yeni lehçeler doctorda sessiz.
60
-
61
- ## f) Paket bütünlüğü — temiz (not)
62
-
63
- `npm pack --dry-run`: `dist/sql-gate/{mssql,oracle,postgres,rules,types}.js` + `test-vectors/sql-gate/vectors.json` + `LIMITATIONS.md` var. Live betikler (`test/sql-gate-*-live.mjs`) pakette yok (doğru). `docs/audit/2026-08-14-*.md` tarball’a giriyor — müşteri verisi değil, gürültü.
64
-
65
- ## Bakılamayan
66
-
67
- - Canlı panel tıklaması (yukarı).
68
- - MSSQL/Oracle MCP `query` (konnektör yok).
69
- - `test:checks` 28; paket metni bazen “27” demişti — sayı 28, drift değil bu turda.