OpenPanel is an open-source web and product analytics platform, an open-source alternative to Mixpanel with optional self-hosting.
chore(tooling): dependency and conformance messages state rules plainly
Carl-Gerhard Lindesvärd831120c8c25d
diff --git a/.dependency-cruiser.cjs b/.dependency-cruiser.cjsindex e90022da0..c0beba75d 100644--- a/.dependency-cruiser.cjs+++ b/.dependency-cruiser.cjs@@ -27,28 +27,22 @@// < modules < services.ts < registries < index.ts//// It is a LAYER order, not path depth: a module importing `../../jobs/define` is going DOWN. rpc/, http/ and jobs/ are ONE-// layer, so edges among them are sideways, as are cross-module edges. A dependency-cruiser rule is one from x to-// rectangle while "every layer may import every lower layer" is a triangle, hence one rule per layer boundary.+// layer, so edges among them are sideways, as are cross-module edges. A dependency-cruiser rule covers one+// from-by-to rectangle while "every layer may import every lower layer" is a triangle, hence one rule per// layer boundary. All six share the `core-layers-` prefix and this comment.-const R22_COMMENT =- 'ADR-022 R22: layers only import downward — shared < clients < transport ' +- 'infrastructure (rpc/, http/, jobs/) < modules < services.ts < registries < ' +- 'index.ts. By LAYER, not by path depth: a module importing ../../jobs/define ' +- 'is going down and is not a violation, and rpc/ http/ jobs/ are one layer so ' +- "edges among them are sideways. Infrastructure reaches a module's behaviour " +- 'through deps/ctx, never by deep-importing modules/<name>/src/*. Two upward ' +- 'edges are legal, both type-only and both exempted on ' +- 'core-layers-modules-below-composition: a module importing ServiceDeps / ' +- 'Services from services.ts (R3 requires it — all 36 factories do it), and a ' +- "module importing another module's <name>.constants.ts (R8 blesses that " +- 'file). Landed at `warn` by M14-002 with 23 violations (7 from shared/, 6 ' +- 'from clients/, 10 from rpc/ + http/ + jobs/, 0 from modules/ and above), ' +- 'exactly as core-uses-ctx-not-db-internals did in M10-001. M15-008 cleared ' +- 'clients/, and M15-009 cleared the rest and flipped all six rules to ' +- '`error` at 0: shared/ stopped being a drawer (the seven misfiled files went ' +- 'to the layer that owns them), the ingest tier is handed to the clientAuth ' +- 'macro instead of imported by it, and the two registry reads moved into the ' +- 'registry. A rule that fires is the only durable fix.';+const LAYERS_COMMENT =+ 'Layers only import downward: shared < clients < transport infrastructure ' ++ '(rpc/, http/, jobs/) < modules < services.ts < registries < index.ts. By ' ++ 'layer, not by path depth: a module importing ../../jobs/define is going ' ++ 'down, and rpc/ http/ jobs/ are one layer so edges among them are sideways. ' ++ "Infrastructure reaches a module's behaviour through deps/ctx, never by " ++ 'deep-importing modules/<name>/src/*. Two upward edges are legal, both on ' ++ 'core-layers-modules-below-composition: a type-only import of ServiceDeps / ' ++ 'Services from services.ts (every service factory takes both), and a value ' ++ "import of another module's <name>.constants.ts. An upward import couples a " ++ 'lower layer to code that is built from it, which is how import cycles and ' ++ 'a junk-drawer shared/ start; move the code to the layer that owns it ' ++ 'instead.';// The web tier: everything that ends up in a browser bundle.const FRONTENDS = '^(apps/(start|public)|packages/sdks/)';@@ -69,51 +63,23 @@ module.exports = {name: 'core-uses-ctx-not-db-internals',severity: 'error',comment:- 'M10-001/M10-009 (docs/TECH_DEBT.md §4 steps 2 and 4): packages/core reaches ' +- 'Postgres/ClickHouse through ctx.db / ctx.ch / ServiceDeps, never by acquiring a ' +- 'client from @openpanel/db itself, so a requestId minted at the edge keeps reaching ' +- "the query (ADR-018). import type stays allowed (dependencyTypesNot: ['type-only']) " +- '— that is what keeps `bun test` offline. M10-009 flipped this from warn to error at ' +- '0 violations; the four exemptions below are each a named seam, not a blanket. ' +- 'FROM: (1) packages/core/src/context.ts — its Db / ClickHouseClient fields are ' +- "`typeof import('@openpanel/db/...')` type queries, which dependency-cruiser tags " +- "['undetermined', 'type-import'] rather than 'type-only' (verified via --output-type " +- 'json), i.e. a genuinely type-level reference; excluded by path rather than by ' +- 'widening dependencyTypesNot, because dependency-cruiser folds a `typeof import()` ' +- 'and a runtime `import()` of the same module into ONE edge and drops the ' +- "'dynamic-import' tag when it does, so exempting 'type-import' wholesale would hide " +- 'real value imports. (2) packages/core/src/v1-compat.ts — THE declared composition ' +- "seam (ADR-007; that file's own header). It is where the boot scope registers the " +- 'deps it already built, and the only thing behind it is the lazy fallback for a ' +- "caller with no Ctx to thread through — MCP's tool handlers have a fixed " +- '@modelcontextprotocol/sdk signature (modules/mcp/src/auth.ts lazy-imports it; the gsc ' +- 'tools reach getGsc* through it), and the assistant tool runtime is the same shape. ' +- 'Nothing holding a Ctx comes through it. M11-004 corrects an earlier claim here: this ' +- 'file is NOT deleted with packages/trpc — it stays as that seam. ' +- '(3) packages/core/src/code-migrations/** — one-shot CLI scripts run by ' +- '`migrate.ts` (`pnpm migrate:deploy:code`), outside the app, with no request and no ' +- 'Ctx to lose; ADR-007 puts code-migrations/ in core and keeps clickhouse/migration.ts ' +- 'in packages/db, so the edge is what the ADR describes. (4) *.test.ts — a test has no ' +- "request, and M10-009's own measurement of this drift is defined as " +- '`grep ... | grep -v .test.ts`. Tests that need a real client against openpanel_test ' +- 'take it directly; two of them (shared/ch-tables.parity.test.ts, ' +- "shared/ch-dates.parity.test.ts) exist precisely to police core's copies of " +- "@openpanel/db's table map and date helpers against the originals. " +- 'TO: the three modules under packages/db that build QUERY TEXT and hold no client — ' +- 'clickhouse/sql.ts (ADR-013 fixes the `sql` tag AT that path by name), ' +- 'clickhouse/query-builder.ts (`clix(client, tz)` takes the client as an argument) and ' +- 'sql-builder.ts (`createSqlBuilder()` returns strings). Importing one of those cannot ' +- 'lose a request scope, because the client is still whatever the caller passes — and ' +- 'in core that is always deps.ch. prisma-client.ts, clickhouse/client.ts, logger.ts ' +- 'and the barrel are NOT exempt: those are where a second client comes from.',+ 'packages/core reaches Postgres and ClickHouse through ctx.db / ctx.ch / ' ++ 'ServiceDeps, never by acquiring a client from @openpanel/db itself, so the ' ++ 'requestId minted at the edge stays on every query. `import type` is allowed, ' ++ 'which keeps `bun test` offline. Exempt FROM: packages/core/src/context.ts, whose ' ++ "Db / ClickHouseClient fields are `typeof import('@openpanel/db/...')` type " ++ 'queries that dependency-cruiser does not tag as type-only (exempting the ' ++ 'type-import tag instead would also hide runtime `import()` of the same module, ' ++ 'because both fold into one edge); and *.test.ts, since a test has no request ' ++ 'and some tests deliberately compare core against the real @openpanel/db ' ++ 'helpers. Exempt TO: the three files that build query text and hold no client ' ++ '(clickhouse/sql.ts, clickhouse/query-builder.ts, sql-builder.ts); the client is ' ++ 'still whatever the caller passes, which in core is always deps.ch. ' ++ 'prisma-client.ts, clickhouse/client.ts, logger.ts and the barrel are not exempt: ' ++ 'those are where a second client comes from.',from: {path: '^packages/core/src/',- pathNot: [- '^packages/core/src/context\\.ts$',- '^packages/core/src/v1-compat\\.ts$',- '^packages/core/src/code-migrations/',- '\\.test\\.ts$',- ],+ pathNot: ['^packages/core/src/context\\.ts$', '\\.test\\.ts$'],},to: {path: '^packages/db/',@@ -129,17 +95,13 @@ module.exports = {name: 'core-no-self-barrel',severity: 'error',comment:- 'M10-001/M10-009 (docs/TECH_DEBT.md §4): a file under packages/core/src/** imports its ' +- 'siblings by relative path, never through its own package barrel (@openpanel/core) — a ' +- 'self-import is always resolvable as a relative import and importing the barrel instead ' +- 'just risks reintroducing the exact resolution cycles the barrel is meant to avoid for ' +- 'external consumers. `to.path` matches the RESOLVED path (see header comment), so this ' +- 'targets packages/core/package.json\'s "." export target (./src/index.ts) directly rather ' +- 'than the bare specifier string, which would never match a resolved path. import type ' +- 'stays allowed. M10-009 flipped this from warn to error at 0 violations. *.test.ts is ' +- 'exempt: a barrel test (src/index.test.ts) has to import the barrel to test it, and the ' +- "mcp/gsc suites `mock.module('@openpanel/core', ...)` deliberately — that is a mocking " +- 'idiom, not a production import cycle.',+ 'A file under packages/core/src imports its siblings by relative path, never ' ++ 'through its own barrel (@openpanel/core): a relative import always works, and ' ++ 'going through the barrel reintroduces the resolution cycles the barrel exists ' ++ "to keep away from external consumers. `to.path` is the barrel's resolved file " ++ '(src/index.ts), because rules match resolved paths, not specifiers. `import ' ++ 'type` is allowed. *.test.ts is exempt: a barrel test has to import the barrel, ' ++ "and `mock.module('@openpanel/core', ...)` is a mocking idiom, not a cycle.",from: {path: '^packages/core/src/',pathNot: '\\.test\\.ts$',@@ -152,7 +114,7 @@ module.exports = {{name: 'core-layers-shared-is-the-bottom',severity: 'error',- comment: R22_COMMENT,+ comment: LAYERS_COMMENT,from: {path: '^packages/core/src/shared/',pathNot: '\\.test\\.ts$',@@ -162,7 +124,7 @@ module.exports = {{name: 'core-layers-clients-below-transport',severity: 'error',- comment: R22_COMMENT,+ comment: LAYERS_COMMENT,from: {path: '^packages/core/src/clients/',pathNot: '\\.test\\.ts$',@@ -172,7 +134,7 @@ module.exports = {{name: 'core-layers-transport-below-modules',severity: 'error',- comment: R22_COMMENT,+ comment: LAYERS_COMMENT,from: {// One layer, three directories: rpc/base.ts, http/define.ts and// jobs/define.ts are peers, so edges AMONG them are sideways, not up.@@ -184,7 +146,7 @@ module.exports = {{name: 'core-layers-modules-below-composition',severity: 'error',- comment: R22_COMMENT,+ comment: LAYERS_COMMENT,from: {path: '^packages/core/src/modules/',pathNot: '\\.test\\.ts$',@@ -200,14 +162,14 @@ module.exports = {{name: 'core-layers-composition-below-registries',severity: 'error',- comment: R22_COMMENT,+ comment: LAYERS_COMMENT,from: { path: '^packages/core/src/services\\.ts$' },to: { path: REGISTRIES_AND_INDEX, dependencyTypesNot: ['type-only'] },},{name: 'core-layers-registries-below-index',severity: 'error',- comment: R22_COMMENT,+ comment: LAYERS_COMMENT,from: {path: '^packages/core/src/(rpc\\.router|rest\\.routes|jobs\\.registry)\\.ts$',},@@ -223,8 +185,7 @@ module.exports = {'A *.constants.ts file must stay isomorphic: zod, another *.constants.ts, or type-only.',from: { path: '\\.constants\\.ts$' },to: {- // zod is matched by resolved path, not the raw specifier: once- // Matched by resolved path: `^zod$` only matched the fallback dependency-cruiser uses when resolution fails.+ // zod is matched by resolved path: `^zod$` only matched the fallback dependency-cruiser uses when resolution fails.pathNot: ['\\.constants\\.ts$', '(^|/)node_modules/zod/'],dependencyTypesNot: ['type-only'],},@@ -233,15 +194,13 @@ module.exports = {name: 'frontend-values-only-constants',severity: 'error',comment:- 'ADR-022 R12: a web app value-imports @openpanel/core or @openpanel/db only through a ' +- '*.constants.ts path — everything else arrives as `import type`, which is erased, so no ' +- 'server code reaches a browser bundle. M15-010 widened the FROM side: it read `apps/start` ' +- 'alone, which left apps/public and packages/sdks/* unguarded by R12 (ADR-022, "The ' +- 'existing frontend boundary needs widening at the same time"). @openpanel/shared is ' +- 'deliberately NOT in the TO list — its root entrypoint is meant to be value-imported by a ' +- 'browser, which is what `shared-root-stays-isomorphic` below makes safe. NOTE: only ' +- "`apps/start packages` are cruised today (package.json's check:deps), so the " +- 'apps/public half of this rule holds vacuously until that command names it.',+ 'A web app (apps/start, apps/public, packages/sdks/*) value-imports ' ++ '@openpanel/core or @openpanel/db only through a *.constants.ts path. Everything ' ++ 'else must be `import type`, which is erased, so no server code reaches a browser ' ++ 'bundle. @openpanel/shared is not in the TO list: its root entrypoint is meant for ' ++ 'browsers, and shared-root-stays-isomorphic keeps that safe. check:deps only ' ++ 'cruises apps/start and packages, so the apps/public part of this rule is not ' ++ 'checked until that command names it.',from: { path: FRONTENDS },to: {path: '^packages/(core|db)/',@@ -253,15 +212,14 @@ module.exports = {name: 'shared-root-stays-isomorphic',severity: 'error',comment:- "ADR-022 R21: nothing reachable from @openpanel/shared's ROOT entrypoint may import a " +- "node: builtin or the server/ subtree. This is the load-bearing half of R21's pair: a " +- 'root-reachable file that quietly imports node:crypto still type-checks, still bundles, ' +- 'and puts a Node polyfill (or a broken bundle) in every browser that loads the ' +- 'dashboard — and the import looks isomorphic at the call site, so nothing else would ' +- 'catch it. Node-only code has its own entrypoint, @openpanel/shared/server, and the ' +- 'reachability is computed from src/index.ts rather than per-file so a helper added three ' +- 'hops down is covered too. dependency-cruiser reports a node: specifier with the prefix ' +- 'stripped, hence the two spellings.',+ "Nothing reachable from @openpanel/shared's root entrypoint may import a node: " ++ 'builtin or the server/ subtree. A root-reachable file that imports node:crypto ' ++ 'still type-checks and bundles, and puts a Node polyfill (or a broken bundle) in ' ++ 'every browser that loads the dashboard, while looking isomorphic at the call ' ++ 'site. Node-only code belongs behind @openpanel/shared/server. Reachability is ' ++ 'computed from src/index.ts, so a helper several imports down is covered too. ' ++ 'dependency-cruiser reports a node: specifier with the prefix stripped, hence the ' ++ 'two spellings.',from: { path: '^packages/shared/src/index\\.ts$' },to: {path: [@@ -275,12 +233,11 @@ module.exports = {name: 'no-web-to-server',severity: 'error',comment:- 'ADR-022 R21: a web app may not import @openpanel/shared/server. This is the readable ' +- "half of R21's pair — the deliberate wrong import, a frontend reaching for a " +- 'server-only helper (crypto, encryption, safe-fetch, ssrf, parser-user-agent). Unlike ' +- 'the root rule above it does not need reachability: the specifier itself is the ' +- 'violation. Same caveat as frontend-values-only-constants — apps/public is not cruised ' +- "by package.json's check:deps yet, so that third of the FROM side is vacuous today.",+ 'A web app may not import @openpanel/shared/server: it holds server-only helpers ' ++ '(crypto, encryption, safe-fetch, ssrf, parser-user-agent) that must not reach a ' ++ 'browser bundle. The specifier itself is the violation, so no reachability is ' ++ 'needed. As with frontend-values-only-constants, apps/public is not cruised by ' ++ 'check:deps yet.',from: { path: FRONTENDS },to: { path: '^packages/shared/src/server/' },},diff --git a/packages/core/src/modules/chart/chart.service.ts b/packages/core/src/modules/chart/chart.service.tsindex e140be44f..c301c4d20 100644--- a/packages/core/src/modules/chart/chart.service.ts+++ b/packages/core/src/modules/chart/chart.service.ts@@ -756,7 +756,7 @@ export function createChartService(input: FunnelStepProfilesRequest): Promise<IServiceProfile[]> => getFunnelStepProfiles(deps, input),getFunnelGroup: funnel.getFunnelGroup,- /** The funnel row -> serie grouping (funnel.service.ts's `toSeries`). */+ /** Groups funnel rows into one serie per breakdown combination. */toFunnelSeries: funnel.toSeries,getFunnelChart: (chartInput: IReportInputdiff --git a/packages/db/src/clickhouse/round-robin.ts b/packages/db/src/clickhouse/round-robin.tsindex 15c6bc7c2..3a133cae4 100644--- a/packages/db/src/clickhouse/round-robin.ts+++ b/packages/db/src/clickhouse/round-robin.ts@@ -15,7 +15,7 @@ export interface ClientSlot {}/**- * Three buckets of error:+ * Four classes of error:** - `node-down`: TCP/DNS/CONNECT-level failure. The node is genuinely* unreachable from this worker right now. **Retry on next node ANDdiff --git a/tooling/gates/conformance.sh b/tooling/gates/conformance.shindex e4c673386..2523f4db0 100755--- a/tooling/gates/conformance.sh+++ b/tooling/gates/conformance.sh@@ -31,7 +31,7 @@ require_analyzer() {exit 2}command -v bun >/dev/null 2>&1 || {- echo "FAIL: bun is not on PATH; the analyzer runs under bun (ADR-010)." >&2+ echo "FAIL: bun is not on PATH; the analyzer runs under bun." >&2exit 2}# A delegated check that silently reports zero because its tool is absent is worse than no check.diff --git a/tooling/gates/conformance/cli.ts b/tooling/gates/conformance/cli.tsindex b869db915..2d3dbafad 100644--- a/tooling/gates/conformance/cli.ts+++ b/tooling/gates/conformance/cli.ts@@ -384,7 +384,7 @@ function buildRules(tree: Tree): RuleBlock[] {checkDependencyLoaders(tree.core),],note: v1Compat- ? `v1-compat.ts: ${v1Compat.text.replace(/\n$/, '').split('\n').length} lines, ${v1CompatImporters} importers (tests included) — the headline numbers for fix-wave step 2. ADR-022 measured 2,104 lines / 69 importers at 6694c5b7 on 2026-09-07.`+ ? `v1-compat.ts: ${v1Compat.text.replace(/\n$/, '').split('\n').length} lines, ${v1CompatImporters} importers (tests included).`: undefined,},{@@ -401,7 +401,7 @@ function buildRules(tree: Tree): RuleBlock[] {metrics: [reviewOnly('client shape',- 'Review rule (ADR-022 check line: "review"). Read packages/core/src/clients/*: no logger, built once at boot, a missing thing is null.'+ 'Review rule. Read packages/core/src/clients/*: no logger, built once at boot, a missing thing is null.'),],},@@ -418,7 +418,7 @@ function buildRules(tree: Tree): RuleBlock[] {metrics: [reviewOnly('job file shape',- 'Review rule (ADR-022 check line: "review + ADR-021"). See R18 below for the one mechanical half.'+ 'Review rule. See R18 below for the one mechanical half.'),],},@@ -442,7 +442,7 @@ function buildRules(tree: Tree): RuleBlock[] {metrics: [reviewOnly('index.ts and main.ts shape',- 'Review rule (ADR-022 check line: "review of index.ts and main.ts").'+ 'Review rule: read index.ts and main.ts.'),],},@@ -465,7 +465,7 @@ function buildRules(tree: Tree): RuleBlock[] {metrics: [reviewOnly('lifecycle',- 'Review rule (ADR-022 check line: "main.ts shutdown order vs open order; core does not close handed-in connections").'+ 'Review rule: main.ts shuts down in the reverse of the order it opens; core does not close connections handed to it.'),],},@@ -488,7 +488,7 @@ function buildRules(tree: Tree): RuleBlock[] {metrics: [reviewOnly('provider error handling',- 'Review rule (ADR-022 check line: "review of every job-handler catch around a client call").'+ 'Review rule: read every job-handler catch around a client call.'),],},@@ -519,7 +519,7 @@ function buildRules(tree: Tree): RuleBlock[] {// the same edges twice.asView(cruiserMetric(- 'ADR-022 baseline slice: shared/ -> above it',+ 'upward imports: shared/ -> above it',R22_SHARED_UPWARD_RULE,cruiser,tree@@ -527,7 +527,7 @@ function buildRules(tree: Tree): RuleBlock[] {),asView(cruiserMetric(- 'ADR-022 baseline slice: http/*, rpc/base.ts -> modules/*/src/*',+ 'upward imports: http/*, rpc/base.ts -> modules/*/src/*',R22_TRANSPORT_UPWARD_RULE,cruiser,tree,@@ -538,7 +538,7 @@ function buildRules(tree: Tree): RuleBlock[] {),],note: cruiser.available- ? "M14-002 landed these rules and verified cruiser resolves its typescript peer, so R22 is the cruiser rule, not ADR-022's grep fallback. A bare ../ depth grep is forbidden: a module importing defineJob at ../../jobs/define is importing DOWNWARD."+ ? 'Counted by dependency-cruiser on resolved imports, not by grepping ../ depth: a module importing defineJob at ../../jobs/define is importing DOWNWARD.': undefined,},// R20 (test shapes) is deliberately absent from this gate.@@ -624,7 +624,7 @@ const BASELINE_METRICS: readonly {];function renderBaseline(rules: RuleBlock[], lines: string[]): void {- lines.push('BASELINE REPRODUCTION (ADR-022 / CONFORMANCE_GATE_SPEC.md)');+ lines.push('HEADLINE NUMBERS');lines.push('');for (const entry of BASELINE_METRICS) {const metric = rules.find((rule) => rule.id === entry.rule)?.metrics[@@ -644,12 +644,12 @@ function renderBaseline(rules: RuleBlock[], lines: string[]): void {export function renderReport(rules: RuleBlock[]): string {const lines: string[] = [heavy,- 'OpenPanel conformance gate (ADR-022) — report',+ 'OpenPanel conformance gate — report',heavy,'','Rules R1..R22 in order. ASSERT rules fail `--assert` above their target;',- 'REPORT rules are review rules and are printed as hints only. R20 is',- 'deferred by Carl (2026-09-08) and is absent by design.',+ 'REPORT rules are review rules and are printed as hints only. R20 (test',+ 'shapes) is not checked by this gate.','',];@@ -714,19 +714,14 @@ export function renderAssert(rules: RuleBlock[]): {if (failures === 0) {return {- output: 'OK: every asserted ADR-022 rule is at its target.',+ output: 'OK: every asserted rule is at its target.',failed: false,};}- lines.unshift(- heavy,- 'OpenPanel conformance gate (ADR-022) — assert FAILED',- heavy,- ''- );+ lines.unshift(heavy, 'OpenPanel conformance gate — assert FAILED', heavy, '');lines.push(heavy);- lines.push(`FAIL: ${failures} asserted ADR-022 violation(s).`);+ lines.push(`FAIL: ${failures} asserted violation(s).`);lines.push(heavy);return { output: lines.join('\n'), failed: true };}diff --git a/tooling/gates/conformance/rules.test.ts b/tooling/gates/conformance/rules.test.tsindex 7cf61bc58..d587a173a 100644--- a/tooling/gates/conformance/rules.test.ts+++ b/tooling/gates/conformance/rules.test.ts@@ -151,7 +151,7 @@ describe('R6 — the asset-loader carve-out is an allowlist, not a pattern', ()expect(metric.label).toContain('0 of 2 load* functions');});- test('the allowlist is exactly the two ADR-022 names, each with a reason', () => {+ test('the allowlist is exactly the two sanctioned files, each with a reason', () => {expect(ASSET_LOADER_ALLOWLIST.map((entry) => entry.file)).toEqual(['packages/core/src/clients/geo.ts','packages/core/src/modules/integration/src/flush-exports.ts',diff --git a/tooling/gates/conformance/rules.ts b/tooling/gates/conformance/rules.tsindex 3eaa301c3..20f6c3c95 100644--- a/tooling/gates/conformance/rules.ts+++ b/tooling/gates/conformance/rules.ts@@ -237,7 +237,7 @@ export function checkServicesMembers(sources: ParsedSource[]): Metric {count: offenders.length,target: 0,offenders: sorted(offenders),- note: `${conforming} conforming member(s) of ${members}; baseline 2026-09-08 was 0`,+ note: `${conforming} conforming member(s) of ${members}`,};}@@ -259,7 +259,7 @@ export function checkCreateServicesCallSites(sources: ParsedSource[]): Metric {file: source.path,line: lineOf(source, node.getStart(source.sourceFile)),detail:- 'createServices( outside the five sanctioned construction sites (ADR-022 R15)',+ 'createServices( outside the five sanctioned construction sites (R15)',});}});@@ -388,11 +388,7 @@ export function checkEnvReads(sources: ParsedSource[]): Metric[] {count: dotted.length,target: 0,offenders: dotted,- note:- 'ADR-022 baseline 2026-09-08: 172 occurrences across 50 files, measured with `rg process\\.env\\.`.\n' +- "That grep's file count is one high: rpc/base.ts:246 is a COMMENT saying core reads no process.env,\n" +- 'and it misses shared/get-client-ip.ts:83, a real read written `process.env?.`. The two errors cancel\n' +- 'in the occurrence count and do not in the file count, so the AST reads 172 across 49 files.',+ note: 'Counted on the AST: a comment that mentions process.env is not a read, and `process.env?.` is.',},{label: `process.env[...] reads in packages/core/src (non-test) — across ${bracketedFiles.size} files`,@@ -645,7 +641,7 @@ export function checkSharedPackageIsolation(repoRoot: string): Metric {count: 0,target: 0,offenders: [],- note: `${SHARED_PACKAGE_ROOT} does not exist yet — ADR-022's C7 chore creates it. Nothing to check.`,+ note: `${SHARED_PACKAGE_ROOT} does not exist. Nothing to check.`,};}