circle-ir-ai 4.4.0 → 4.6.0

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/dist/bom/assemble.d.ts +29 -0
  3. package/dist/bom/assemble.d.ts.map +1 -0
  4. package/dist/bom/assemble.js +81 -0
  5. package/dist/bom/assemble.js.map +1 -0
  6. package/dist/bom/classify.d.ts +37 -0
  7. package/dist/bom/classify.d.ts.map +1 -0
  8. package/dist/bom/classify.js +82 -0
  9. package/dist/bom/classify.js.map +1 -0
  10. package/dist/bom/index.d.ts +40 -0
  11. package/dist/bom/index.d.ts.map +1 -0
  12. package/dist/bom/index.js +245 -0
  13. package/dist/bom/index.js.map +1 -0
  14. package/dist/bom/types.d.ts +75 -0
  15. package/dist/bom/types.d.ts.map +1 -0
  16. package/dist/bom/types.js +25 -0
  17. package/dist/bom/types.js.map +1 -0
  18. package/dist/bom/usage.d.ts +17 -0
  19. package/dist/bom/usage.d.ts.map +1 -0
  20. package/dist/bom/usage.js +112 -0
  21. package/dist/bom/usage.js.map +1 -0
  22. package/dist/coverage/index.d.ts +50 -0
  23. package/dist/coverage/index.d.ts.map +1 -0
  24. package/dist/coverage/index.js +73 -0
  25. package/dist/coverage/index.js.map +1 -0
  26. package/dist/coverage-map/index.d.ts +50 -0
  27. package/dist/coverage-map/index.d.ts.map +1 -0
  28. package/dist/coverage-map/index.js +73 -0
  29. package/dist/coverage-map/index.js.map +1 -0
  30. package/dist/coverage-map/kb-join.d.ts +46 -0
  31. package/dist/coverage-map/kb-join.d.ts.map +1 -0
  32. package/dist/coverage-map/kb-join.js +52 -0
  33. package/dist/coverage-map/kb-join.js.map +1 -0
  34. package/dist/coverage-map/kb.d.ts +50 -0
  35. package/dist/coverage-map/kb.d.ts.map +1 -0
  36. package/dist/coverage-map/kb.js +31 -0
  37. package/dist/coverage-map/kb.js.map +1 -0
  38. package/dist/index.d.ts +8 -0
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +6 -0
  41. package/dist/index.js.map +1 -1
  42. package/dist/llm/ax-client.d.ts +17 -0
  43. package/dist/llm/ax-client.d.ts.map +1 -1
  44. package/dist/llm/ax-client.js +21 -0
  45. package/dist/llm/ax-client.js.map +1 -1
  46. package/dist/llm/verification.d.ts +40 -0
  47. package/dist/llm/verification.d.ts.map +1 -1
  48. package/dist/llm/verification.js +114 -31
  49. package/dist/llm/verification.js.map +1 -1
  50. package/dist/security-scan/scanner.d.ts +29 -0
  51. package/dist/security-scan/scanner.d.ts.map +1 -1
  52. package/dist/security-scan/scanner.js +45 -2
  53. package/dist/security-scan/scanner.js.map +1 -1
  54. package/package.json +2 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/bom/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAC7B,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,EAC1B,sBAAsB,EACtB,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,WAAW,EAA8C,MAAM,eAAe,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7C,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,CAAC,CA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IAAI,KAAK,EAAE,CAAC;gBAAC,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC;gBAAC,CAAC,CAAC,UAAU,GAAG,KAAK,CAAC,MAAM,CAAC;YAAC,CAAC;iBAC5D,CAAC;gBAAC,CAAC,CAAC,UAAU,GAAG,CAAC,CAAC;YAAC,CAAC;QAC5B,CAAC;IACH,CAAC;IACD,GAAG,CAAC,UAAU,GAAG,UAAU,CAAC;IAC5B,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Layer-BOM (Bill of Materials) types — the Conformis "9-layer detect + usage
3
+ * index" inventory (conformis-execution-plan.md §7, conformis-layer-generation-canon.md §3/§9).
4
+ *
5
+ * The BOM is the *inventory* step of the conformis loop: for a repo, enumerate
6
+ * the components present at each canonical layer (L2–L9). It is NOT the verifier
7
+ * generator (that is the later, gated step) — it composes signals circle-ir
8
+ * already produces (dependency BOM, imports, config parse) into a per-layer map
9
+ * that everything downstream (coverage map, oracle fan-out, the architect view)
10
+ * consumes.
11
+ *
12
+ * Canon layers (L2–L9); L1 (corpora) and the horizontal band are not repo
13
+ * components, so they are not BOM layers.
14
+ */
15
+ import type { Ecosystem } from './classify.js';
16
+ /** The eight canonical component-bearing layers (conformis-layer-generation-canon.md §3). */
17
+ export type BomLayer = 'L2' | 'L3' | 'L4' | 'L5' | 'L6' | 'L7' | 'L8' | 'L9';
18
+ export declare const BOM_LAYER_TITLES: Record<BomLayer, string>;
19
+ /** One inventoried component at a layer. */
20
+ export interface BomComponent {
21
+ /** Package / file / runtime name. */
22
+ name: string;
23
+ /** Declared version spec when known (deps), else undefined (files/runtime). */
24
+ version?: string;
25
+ layer: BomLayer;
26
+ /**
27
+ * Sub-classification within the layer, e.g. `jwt` / `oauth` / `grpc` (L3),
28
+ * `framework:react` (L5), `orm:prisma` (L7), `container` (L6),
29
+ * `openapi-spec` (L8), `runtime:node` (L2).
30
+ */
31
+ kind: string;
32
+ ecosystem?: Ecosystem;
33
+ /** Where the component came from. */
34
+ source: 'dependency' | 'file' | 'runtime';
35
+ /** Repo-relative path, for file-detected components (L6/L8). */
36
+ path?: string;
37
+ /** L4 only: declared as a direct dependency (vs transitive). */
38
+ direct?: boolean;
39
+ /** Import/call sites of this component (usage index; classified deps only). */
40
+ usageSites?: UsageSite[];
41
+ /** Convenience count of `usageSites` (present when the usage index ran). */
42
+ usageCount?: number;
43
+ }
44
+ /** One place a component is used (an import site). */
45
+ export interface UsageSite {
46
+ /** Repo-relative source file. */
47
+ file: string;
48
+ line: number | null;
49
+ }
50
+ /** Component name → its usage sites (the "which of *your* call-sites" grounding). */
51
+ export type UsageIndex = Record<string, UsageSite[]>;
52
+ export interface LayerBom {
53
+ layer: BomLayer;
54
+ title: string;
55
+ components: BomComponent[];
56
+ }
57
+ /** The repo-level Bill of Materials. */
58
+ export interface RepoBom {
59
+ /** Repo path or logical target id. */
60
+ target: string;
61
+ /** Languages/ecosystems detected (from the dependency ecosystems + files). */
62
+ languages: string[];
63
+ /** Per-layer inventory. Every layer is present (possibly empty). */
64
+ layers: Record<BomLayer, LayerBom>;
65
+ /** Component name → usage sites, when the usage index ran (else undefined). */
66
+ usageIndex?: UsageIndex;
67
+ meta: {
68
+ generatedAt: string;
69
+ totalDependencies: number;
70
+ totalComponents: number;
71
+ /** Layers with at least one component — the "coverage surface". */
72
+ populatedLayers: BomLayer[];
73
+ };
74
+ }
75
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bom/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE/C,6FAA6F;AAC7F,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7E,eAAO,MAAM,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AE,MAAM,CAAC;QACpB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,mEAAmE;QACnE,eAAe,EAAE,QAAQ,EAAE,CAAC;KAC7B,CAAC;CACH"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Layer-BOM (Bill of Materials) types — the Conformis "9-layer detect + usage
3
+ * index" inventory (conformis-execution-plan.md §7, conformis-layer-generation-canon.md §3/§9).
4
+ *
5
+ * The BOM is the *inventory* step of the conformis loop: for a repo, enumerate
6
+ * the components present at each canonical layer (L2–L9). It is NOT the verifier
7
+ * generator (that is the later, gated step) — it composes signals circle-ir
8
+ * already produces (dependency BOM, imports, config parse) into a per-layer map
9
+ * that everything downstream (coverage map, oracle fan-out, the architect view)
10
+ * consumes.
11
+ *
12
+ * Canon layers (L2–L9); L1 (corpora) and the horizontal band are not repo
13
+ * components, so they are not BOM layers.
14
+ */
15
+ export const BOM_LAYER_TITLES = {
16
+ L2: 'Runtime',
17
+ L3: 'Protocols',
18
+ L4: 'Supply chain',
19
+ L5: 'Framework',
20
+ L6: 'Platform/Toolchain',
21
+ L7: 'Data',
22
+ L8: 'Integration/API',
23
+ L9: 'Business',
24
+ };
25
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/bom/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAOH,MAAM,CAAC,MAAM,gBAAgB,GAA6B;IACxD,EAAE,EAAE,SAAS;IACb,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,cAAc;IAClB,EAAE,EAAE,WAAW;IACf,EAAE,EAAE,oBAAoB;IACxB,EAAE,EAAE,MAAM;IACV,EAAE,EAAE,iBAAiB;IACrB,EAAE,EAAE,UAAU;CACf,CAAC"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * BOM usage index — "which of *your* files import this component" (the grounding
3
+ * the Conformis usage-witness needs, conformis-execution-plan.md §2.3).
4
+ *
5
+ * For each classified component (L3/L5/L7 dependency), find the source files +
6
+ * lines that import it, by composing circle-ir's `parse` + `extractImports`
7
+ * (never a hand-rolled import scan). JS/TS/Python resolve cleanly (the import
8
+ * specifier is the package name); Maven is best-effort via groupId prefix.
9
+ */
10
+ import type { UsageIndex } from './types.js';
11
+ /**
12
+ * Build the usage index for `componentNames` over the repo's source files.
13
+ * Returns `{ [componentName]: UsageSite[] }`; components with no import site are
14
+ * omitted. Requires the analyzer to be initialized (caller ensures it).
15
+ */
16
+ export declare function buildUsageIndex(repoPath: string, componentNames: string[]): Promise<UsageIndex>;
17
+ //# sourceMappingURL=usage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.d.ts","sourceRoot":"","sources":["../../src/bom/usage.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAa,MAAM,YAAY,CAAC;AAkDxD;;;;GAIG;AACH,wBAAsB,eAAe,CACnC,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EAAE,GACvB,OAAO,CAAC,UAAU,CAAC,CAiCrB"}
@@ -0,0 +1,112 @@
1
+ /**
2
+ * BOM usage index — "which of *your* files import this component" (the grounding
3
+ * the Conformis usage-witness needs, conformis-execution-plan.md §2.3).
4
+ *
5
+ * For each classified component (L3/L5/L7 dependency), find the source files +
6
+ * lines that import it, by composing circle-ir's `parse` + `extractImports`
7
+ * (never a hand-rolled import scan). JS/TS/Python resolve cleanly (the import
8
+ * specifier is the package name); Maven is best-effort via groupId prefix.
9
+ */
10
+ import * as fs from 'fs';
11
+ import * as path from 'path';
12
+ // Source extension → circle-ir SupportedLanguage.
13
+ const EXT_LANG = {
14
+ '.ts': 'typescript', '.tsx': 'tsx', '.mts': 'typescript', '.cts': 'typescript',
15
+ '.js': 'javascript', '.jsx': 'javascript', '.mjs': 'javascript', '.cjs': 'javascript',
16
+ '.py': 'python',
17
+ '.java': 'java',
18
+ '.go': 'go', '.rs': 'rust',
19
+ };
20
+ const IGNORE_DIRS = new Set(['node_modules', '.git', 'dist', 'build', 'coverage', '.next', 'vendor', 'target', '__pycache__']);
21
+ const MAX_FILES = 4000; // bound the walk; usage index is best-effort, not exhaustive
22
+ const MAX_FILE_BYTES = 512 * 1024;
23
+ function collectSourceFiles(dir, root, depth = 0, out = []) {
24
+ if (depth > 8 || out.length >= MAX_FILES)
25
+ return out;
26
+ let entries;
27
+ try {
28
+ entries = fs.readdirSync(dir, { withFileTypes: true });
29
+ }
30
+ catch {
31
+ return out;
32
+ }
33
+ for (const e of entries) {
34
+ if (out.length >= MAX_FILES)
35
+ break;
36
+ const abs = path.join(dir, e.name);
37
+ if (e.isDirectory()) {
38
+ if (IGNORE_DIRS.has(e.name) || e.name.startsWith('.'))
39
+ continue;
40
+ collectSourceFiles(abs, root, depth + 1, out);
41
+ }
42
+ else if (e.isFile()) {
43
+ const lang = EXT_LANG[path.extname(e.name).toLowerCase()];
44
+ if (lang)
45
+ out.push({ abs, rel: path.relative(root, abs), language: lang });
46
+ }
47
+ }
48
+ return out;
49
+ }
50
+ /**
51
+ * Does an import specifier reference this component?
52
+ * - JS/TS: `from_package === name` or `startsWith(name + '/')` (scoped subpaths).
53
+ * - Maven `group:artifact`: `from_package` (a java package) startsWith the groupId.
54
+ */
55
+ function importMatchesComponent(fromPackage, componentName) {
56
+ if (fromPackage === componentName)
57
+ return true;
58
+ if (fromPackage.startsWith(componentName + '/'))
59
+ return true;
60
+ if (componentName.includes(':')) {
61
+ const groupId = componentName.split(':')[0];
62
+ if (groupId.includes('.') && fromPackage.startsWith(groupId))
63
+ return true;
64
+ }
65
+ return false;
66
+ }
67
+ /**
68
+ * Build the usage index for `componentNames` over the repo's source files.
69
+ * Returns `{ [componentName]: UsageSite[] }`; components with no import site are
70
+ * omitted. Requires the analyzer to be initialized (caller ensures it).
71
+ */
72
+ export async function buildUsageIndex(repoPath, componentNames) {
73
+ const index = {};
74
+ if (componentNames.length === 0)
75
+ return index;
76
+ const { parse, extractImports } = await import('circle-ir');
77
+ const { ensureAnalyzerInitialized, isAnalyzerInitialized } = await import('../utils/analyzer-init.js');
78
+ if (!isAnalyzerInitialized())
79
+ await ensureAnalyzerInitialized();
80
+ const files = collectSourceFiles(repoPath, repoPath);
81
+ for (const f of files) {
82
+ let content;
83
+ try {
84
+ if (fs.statSync(f.abs).size > MAX_FILE_BYTES)
85
+ continue;
86
+ content = fs.readFileSync(f.abs, 'utf-8');
87
+ }
88
+ catch {
89
+ continue;
90
+ }
91
+ let imports;
92
+ try {
93
+ const tree = await parse(content, f.language);
94
+ imports = extractImports(tree, f.language);
95
+ }
96
+ catch {
97
+ continue;
98
+ }
99
+ for (const imp of imports) {
100
+ if (!imp.from_package)
101
+ continue;
102
+ for (const name of componentNames) {
103
+ if (importMatchesComponent(imp.from_package, name)) {
104
+ const site = { file: f.rel, line: imp.line_number };
105
+ (index[name] ??= []).push(site);
106
+ }
107
+ }
108
+ }
109
+ }
110
+ return index;
111
+ }
112
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/bom/usage.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AACzB,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAG7B,kDAAkD;AAClD,MAAM,QAAQ,GAA2B;IACvC,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY;IAC9E,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY;IACrF,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,MAAM;IACf,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM;CAC3B,CAAC;AAEF,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,CAAC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CAAC,CAAC;IACrD,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,IAAI,OAAe,CAAC;QACpB,IAAI,CAAC;YACH,IAAI,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,GAAG,cAAc;gBAAE,SAAS;YACvD,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAC5C,CAAC;QAAC,MAAM,CAAC;YAAC,SAAS;QAAC,CAAC;QAErB,IAAI,OAA2E,CAAC;QAChF,IAAI,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,QAAuC,CAAC,CAAC;YAC7E,OAAO,GAAG,cAAc,CAAC,IAAI,EAAE,CAAC,CAAC,QAAgD,CAAC,CAAC;QACrF,CAAC;QAAC,MAAM,CAAC;YAAC,SAAS;QAAC,CAAC;QAErB,KAAK,MAAM,GAAG,IAAI,OAAO,EAAE,CAAC;YAC1B,IAAI,CAAC,GAAG,CAAC,YAAY;gBAAE,SAAS;YAChC,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;gBAClC,IAAI,sBAAsB,CAAC,GAAG,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC;oBACnD,MAAM,IAAI,GAAc,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC;oBAC/D,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAClC,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Coverage map — the Conformis architect-view *receipt* (conformis-layer-
3
+ * generation-canon.md §9, conformis-execution-plan.md D9 "the subtraction + the
4
+ * receipt").
5
+ *
6
+ * Given a layer-BOM (what's in the repo per layer), declare for each component
7
+ * whether we can *witness* it today (`settles_now`), can only *signal* it until
8
+ * a dynamic harness exists (`signal_until_harness`), have declared it
9
+ * un-checkable (`not_diffable`), or have no capability mapped (`uncovered`).
10
+ *
11
+ * HONESTY (canon §11): these states are a **declaration** of intended coverage,
12
+ * grounded in the canon's per-layer inherited/extracted split — NOT proven
13
+ * witness yield. The real settled-% comes later from shadow-mode witness runs.
14
+ * So this emits **counts + per-component verdicts** (the receipt), and a
15
+ * `declaredCoverablePct` explicitly labelled projected, never a settled-%.
16
+ */
17
+ import type { BomLayer, RepoBom } from '../bom/types.js';
18
+ export type CoverageState = 'settles_now' | 'signal_until_harness' | 'not_diffable' | 'uncovered';
19
+ export declare const COVERAGE_STATES: CoverageState[];
20
+ export interface ComponentCoverage {
21
+ name: string;
22
+ layer: BomLayer;
23
+ kind: string;
24
+ state: CoverageState;
25
+ /** Short why, e.g. "static call-site asserts" / "needs replay harness". */
26
+ basis: string;
27
+ }
28
+ export interface LayerCoverage {
29
+ layer: BomLayer;
30
+ title: string;
31
+ counts: Record<CoverageState, number>;
32
+ components: ComponentCoverage[];
33
+ }
34
+ export interface CoverageMap {
35
+ target: string;
36
+ layers: Record<BomLayer, LayerCoverage>;
37
+ summary: {
38
+ counts: Record<CoverageState, number>;
39
+ totalComponents: number;
40
+ /**
41
+ * PROJECTED — (settles_now + signal_until_harness) / (total − not_diffable).
42
+ * A declaration of intended coverage, NOT a proven settled-%. Gate any real
43
+ * % on shadow-mode witness yield (canon §11).
44
+ */
45
+ declaredCoverablePct: number;
46
+ };
47
+ }
48
+ /** Compute the coverage-map (receipt) for a BOM. Pure. */
49
+ export declare function computeCoverage(bom: RepoBom): CoverageMap;
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/coverage/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAgB,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGvE,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,sBAAsB,GAAG,cAAc,GAAG,WAAW,CAAC;AAElG,eAAO,MAAM,eAAe,EAAE,aAAa,EAAyE,CAAC;AAErH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,CAAC;IACrB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACtC,eAAe,EAAE,MAAM,CAAC;QACxB;;;;WAIG;QACH,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH;AAuCD,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CA2BzD"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Coverage map — the Conformis architect-view *receipt* (conformis-layer-
3
+ * generation-canon.md §9, conformis-execution-plan.md D9 "the subtraction + the
4
+ * receipt").
5
+ *
6
+ * Given a layer-BOM (what's in the repo per layer), declare for each component
7
+ * whether we can *witness* it today (`settles_now`), can only *signal* it until
8
+ * a dynamic harness exists (`signal_until_harness`), have declared it
9
+ * un-checkable (`not_diffable`), or have no capability mapped (`uncovered`).
10
+ *
11
+ * HONESTY (canon §11): these states are a **declaration** of intended coverage,
12
+ * grounded in the canon's per-layer inherited/extracted split — NOT proven
13
+ * witness yield. The real settled-% comes later from shadow-mode witness runs.
14
+ * So this emits **counts + per-component verdicts** (the receipt), and a
15
+ * `declaredCoverablePct` explicitly labelled projected, never a settled-%.
16
+ */
17
+ import { BOM_LAYER_TITLES } from '../bom/types.js';
18
+ export const COVERAGE_STATES = ['settles_now', 'signal_until_harness', 'not_diffable', 'uncovered'];
19
+ // Per-layer default capability, from the canon §3 verifier-shape / inherited-
20
+ // extracted column. Declarations, extend/override per kind below.
21
+ const LAYER_CAPABILITY = {
22
+ L2: { state: 'signal_until_harness', basis: 'runtime races/async need a replay harness (Coyote/JPF); presence is static' },
23
+ L3: { state: 'settles_now', basis: 'static call-site asserts (alg≠none, PKCE-MUST, state-validated); wire seq is dynamic' },
24
+ L4: { state: 'settles_now', basis: 'reachability × version-diff (Syft/Grype/OSV) — static' },
25
+ L5: { state: 'signal_until_harness', basis: 'framework idiom conformance is fuzzier; wrap linters as signal until harnessed' },
26
+ L6: { state: 'settles_now', basis: 'config-conformance (Checkov/OPA/Conftest) — static' },
27
+ L7: { state: 'signal_until_harness', basis: 'tx-boundary/N+1 static; migration reconciliation needs a differential harness' },
28
+ L8: { state: 'settles_now', basis: 'contract-diff × usage-witness (oasdiff/buf/graphql-inspector + circle-ir) — static usage' },
29
+ L9: { state: 'uncovered', basis: 'domain-logic residual — extracted + executed harness, not yet built' },
30
+ };
31
+ // Per-kind overrides where a component is more/less checkable than its layer default.
32
+ const KIND_CAPABILITY = {
33
+ 'runtime:node': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
34
+ 'runtime:python': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
35
+ 'runtime:jvm': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
36
+ 'runtime:go': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
37
+ 'runtime:rust': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
38
+ // L7 raw drivers: presence only, no ORM idiom to check
39
+ 'db-driver': { state: 'signal_until_harness', basis: 'raw driver — query safety needs taint, no ORM idiom contract' },
40
+ // L4 dev deps: not a runtime supply-chain surface
41
+ 'dependency:dev': { state: 'not_diffable', basis: 'dev-only dependency — not in the shipped supply-chain surface' },
42
+ };
43
+ function capabilityFor(c) {
44
+ return KIND_CAPABILITY[c.kind] ?? LAYER_CAPABILITY[c.layer];
45
+ }
46
+ const ALL_LAYERS = ['L2', 'L3', 'L4', 'L5', 'L6', 'L7', 'L8', 'L9'];
47
+ /** Compute the coverage-map (receipt) for a BOM. Pure. */
48
+ export function computeCoverage(bom) {
49
+ const zero = () => ({ settles_now: 0, signal_until_harness: 0, not_diffable: 0, uncovered: 0 });
50
+ const total = zero();
51
+ const layers = {};
52
+ for (const layer of ALL_LAYERS) {
53
+ const counts = zero();
54
+ const components = [];
55
+ for (const c of bom.layers[layer].components) {
56
+ const cap = capabilityFor(c);
57
+ counts[cap.state]++;
58
+ total[cap.state]++;
59
+ components.push({ name: c.name, layer, kind: c.kind, state: cap.state, basis: cap.basis });
60
+ }
61
+ layers[layer] = { layer, title: BOM_LAYER_TITLES[layer], counts, components };
62
+ }
63
+ const totalComponents = COVERAGE_STATES.reduce((n, s) => n + total[s], 0);
64
+ const diffable = totalComponents - total.not_diffable;
65
+ const coverable = total.settles_now + total.signal_until_harness;
66
+ const declaredCoverablePct = diffable > 0 ? Math.round((coverable / diffable) * 1000) / 10 : 0;
67
+ return {
68
+ target: bom.target,
69
+ layers,
70
+ summary: { counts: total, totalComponents, declaredCoverablePct },
71
+ };
72
+ }
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/coverage/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,MA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KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QAC7F,CAAC;QACD,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,KAAK,EAAE,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC;IAChF,CAAC;IAED,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,eAAe,GAAG,KAAK,CAAC,YAAY,CAAC;IACtD,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC;IACjE,MAAM,oBAAoB,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/F,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM;QACN,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE;KAClE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Coverage map — the Conformis architect-view *receipt* (conformis-layer-
3
+ * generation-canon.md §9, conformis-execution-plan.md D9 "the subtraction + the
4
+ * receipt").
5
+ *
6
+ * Given a layer-BOM (what's in the repo per layer), declare for each component
7
+ * whether we can *witness* it today (`settles_now`), can only *signal* it until
8
+ * a dynamic harness exists (`signal_until_harness`), have declared it
9
+ * un-checkable (`not_diffable`), or have no capability mapped (`uncovered`).
10
+ *
11
+ * HONESTY (canon §11): these states are a **declaration** of intended coverage,
12
+ * grounded in the canon's per-layer inherited/extracted split — NOT proven
13
+ * witness yield. The real settled-% comes later from shadow-mode witness runs.
14
+ * So this emits **counts + per-component verdicts** (the receipt), and a
15
+ * `declaredCoverablePct` explicitly labelled projected, never a settled-%.
16
+ */
17
+ import type { BomLayer, RepoBom } from '../bom/types.js';
18
+ export type CoverageState = 'settles_now' | 'signal_until_harness' | 'not_diffable' | 'uncovered';
19
+ export declare const COVERAGE_STATES: CoverageState[];
20
+ export interface ComponentCoverage {
21
+ name: string;
22
+ layer: BomLayer;
23
+ kind: string;
24
+ state: CoverageState;
25
+ /** Short why, e.g. "static call-site asserts" / "needs replay harness". */
26
+ basis: string;
27
+ }
28
+ export interface LayerCoverage {
29
+ layer: BomLayer;
30
+ title: string;
31
+ counts: Record<CoverageState, number>;
32
+ components: ComponentCoverage[];
33
+ }
34
+ export interface CoverageMap {
35
+ target: string;
36
+ layers: Record<BomLayer, LayerCoverage>;
37
+ summary: {
38
+ counts: Record<CoverageState, number>;
39
+ totalComponents: number;
40
+ /**
41
+ * PROJECTED — (settles_now + signal_until_harness) / (total − not_diffable).
42
+ * A declaration of intended coverage, NOT a proven settled-%. Gate any real
43
+ * % on shadow-mode witness yield (canon §11).
44
+ */
45
+ declaredCoverablePct: number;
46
+ };
47
+ }
48
+ /** Compute the coverage-map (receipt) for a BOM. Pure. */
49
+ export declare function computeCoverage(bom: RepoBom): CoverageMap;
50
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/coverage-map/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAgB,QAAQ,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAGvE,MAAM,MAAM,aAAa,GAAG,aAAa,GAAG,sBAAsB,GAAG,cAAc,GAAG,WAAW,CAAC;AAElG,eAAO,MAAM,eAAe,EAAE,aAAa,EAAyE,CAAC;AAErH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,aAAa,CAAC;IACrB,2EAA2E;IAC3E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,QAAQ,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;IACtC,UAAU,EAAE,iBAAiB,EAAE,CAAC;CACjC;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACxC,OAAO,EAAE;QACP,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;QACtC,eAAe,EAAE,MAAM,CAAC;QACxB;;;;WAIG;QACH,oBAAoB,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH;AAuCD,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,WAAW,CA2BzD"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Coverage map — the Conformis architect-view *receipt* (conformis-layer-
3
+ * generation-canon.md §9, conformis-execution-plan.md D9 "the subtraction + the
4
+ * receipt").
5
+ *
6
+ * Given a layer-BOM (what's in the repo per layer), declare for each component
7
+ * whether we can *witness* it today (`settles_now`), can only *signal* it until
8
+ * a dynamic harness exists (`signal_until_harness`), have declared it
9
+ * un-checkable (`not_diffable`), or have no capability mapped (`uncovered`).
10
+ *
11
+ * HONESTY (canon §11): these states are a **declaration** of intended coverage,
12
+ * grounded in the canon's per-layer inherited/extracted split — NOT proven
13
+ * witness yield. The real settled-% comes later from shadow-mode witness runs.
14
+ * So this emits **counts + per-component verdicts** (the receipt), and a
15
+ * `declaredCoverablePct` explicitly labelled projected, never a settled-%.
16
+ */
17
+ import { BOM_LAYER_TITLES } from '../bom/types.js';
18
+ export const COVERAGE_STATES = ['settles_now', 'signal_until_harness', 'not_diffable', 'uncovered'];
19
+ // Per-layer default capability, from the canon §3 verifier-shape / inherited-
20
+ // extracted column. Declarations, extend/override per kind below.
21
+ const LAYER_CAPABILITY = {
22
+ L2: { state: 'signal_until_harness', basis: 'runtime races/async need a replay harness (Coyote/JPF); presence is static' },
23
+ L3: { state: 'settles_now', basis: 'static call-site asserts (alg≠none, PKCE-MUST, state-validated); wire seq is dynamic' },
24
+ L4: { state: 'settles_now', basis: 'reachability × version-diff (Syft/Grype/OSV) — static' },
25
+ L5: { state: 'signal_until_harness', basis: 'framework idiom conformance is fuzzier; wrap linters as signal until harnessed' },
26
+ L6: { state: 'settles_now', basis: 'config-conformance (Checkov/OPA/Conftest) — static' },
27
+ L7: { state: 'signal_until_harness', basis: 'tx-boundary/N+1 static; migration reconciliation needs a differential harness' },
28
+ L8: { state: 'settles_now', basis: 'contract-diff × usage-witness (oasdiff/buf/graphql-inspector + circle-ir) — static usage' },
29
+ L9: { state: 'uncovered', basis: 'domain-logic residual — extracted + executed harness, not yet built' },
30
+ };
31
+ // Per-kind overrides where a component is more/less checkable than its layer default.
32
+ const KIND_CAPABILITY = {
33
+ 'runtime:node': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
34
+ 'runtime:python': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
35
+ 'runtime:jvm': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
36
+ 'runtime:go': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
37
+ 'runtime:rust': { state: 'not_diffable', basis: 'runtime version itself is not a conformance target' },
38
+ // L7 raw drivers: presence only, no ORM idiom to check
39
+ 'db-driver': { state: 'signal_until_harness', basis: 'raw driver — query safety needs taint, no ORM idiom contract' },
40
+ // L4 dev deps: not a runtime supply-chain surface
41
+ 'dependency:dev': { state: 'not_diffable', basis: 'dev-only dependency — not in the shipped supply-chain surface' },
42
+ };
43
+ function capabilityFor(c) {
44
+ return KIND_CAPABILITY[c.kind] ?? LAYER_CAPABILITY[c.layer];
45
+ }
46
+ const ALL_LAYERS = ['L2', 'L3', 'L4', 'L5', 'L6', 'L7', 'L8', 'L9'];
47
+ /** Compute the coverage-map (receipt) for a BOM. Pure. */
48
+ export function computeCoverage(bom) {
49
+ const zero = () => ({ settles_now: 0, signal_until_harness: 0, not_diffable: 0, uncovered: 0 });
50
+ const total = zero();
51
+ const layers = {};
52
+ for (const layer of ALL_LAYERS) {
53
+ const counts = zero();
54
+ const components = [];
55
+ for (const c of bom.layers[layer].components) {
56
+ const cap = capabilityFor(c);
57
+ counts[cap.state]++;
58
+ total[cap.state]++;
59
+ components.push({ name: c.name, layer, kind: c.kind, state: cap.state, basis: cap.basis });
60
+ }
61
+ layers[layer] = { layer, title: BOM_LAYER_TITLES[layer], counts, components };
62
+ }
63
+ const totalComponents = COVERAGE_STATES.reduce((n, s) => n + total[s], 0);
64
+ const diffable = totalComponents - total.not_diffable;
65
+ const coverable = total.settles_now + total.signal_until_harness;
66
+ const declaredCoverablePct = diffable > 0 ? Math.round((coverable / diffable) * 1000) / 10 : 0;
67
+ return {
68
+ target: bom.target,
69
+ layers,
70
+ summary: { counts: total, totalComponents, declaredCoverablePct },
71
+ };
72
+ }
73
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/coverage-map/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAInD,MAAM,CAAC,MAAM,eAAe,GAAoB,CAAC,aAAa,EAAE,sBAAsB,EAAE,cAAc,EAAE,WAAW,CAAC,CAAC;AAsCrH,8EAA8E;AAC9E,kEAAkE;AAClE,MAAM,gBAAgB,GAAiC;IACrD,EAAE,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,4EAA4E,EAAE;IAC1H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C;IAED,MAAM,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,MAAM,QAAQ,GAAG,eAAe,GAAG,KAAK,CAAC,YAAY,CAAC;IACtD,MAAM,SAAS,GAAG,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,oBAAoB,CAAC;IACjE,MAAM,oBAAoB,GAAG,QAAQ,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,SAAS,GAAG,QAAQ,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAE/F,OAAO;QACL,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,MAAM;QACN,OAAO,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,eAAe,EAAE,oBAAoB,EAAE;KAClE,CAAC;AACJ,CAAC"}
@@ -0,0 +1,46 @@
1
+ /**
2
+ * BOM×KB join — enrich the coverage receipt with fleet memory.
3
+ *
4
+ * The coverage map declares what we *can* check (per the capability registry);
5
+ * the KB join adds what the fleet has *already witnessed*. A component that
6
+ * `settles_now` AND carries a fleet witness becomes `witnessed` — the only state
7
+ * backed by evidence rather than declaration. This is the lazy-fan-out input:
8
+ * a component witnessed elsewhere needs re-verification here, not first-time
9
+ * authoring.
10
+ *
11
+ * Honesty (canon §11): `witnessed` is fleet-wide evidence, NOT a this-repo
12
+ * settled-%. The summary reports a `witnessedCount` (real) alongside the
13
+ * `declaredCoverablePct` (projected) — never conflated.
14
+ */
15
+ import type { BomLayer } from '../bom/types.js';
16
+ import type { CoverageMap, CoverageState, ComponentCoverage } from './index.js';
17
+ import type { KnowledgeBase, KbEntry } from './kb.js';
18
+ export type JoinedState = CoverageState | 'witnessed';
19
+ export interface JoinedComponentCoverage extends ComponentCoverage {
20
+ ecosystem?: string;
21
+ /** Fleet memory for this component (absent = KB never saw it). */
22
+ kb?: Pick<KbEntry, 'witnessed' | 'cardUrl' | 'corpusRefs' | 'lastVerdict'>;
23
+ /** State after the join: `witnessed` when settles_now + a fleet witness exists. */
24
+ effectiveState: JoinedState;
25
+ }
26
+ export interface JoinedLayerCoverage {
27
+ layer: BomLayer;
28
+ title: string;
29
+ components: JoinedComponentCoverage[];
30
+ }
31
+ export interface JoinedCoverageMap {
32
+ target: string;
33
+ layers: Record<BomLayer, JoinedLayerCoverage>;
34
+ summary: {
35
+ /** Projected coverable %, carried from the coverage map (declaration). */
36
+ declaredCoverablePct: number;
37
+ totalComponents: number;
38
+ /** REAL: components the fleet has already witnessed (evidence, not projection). */
39
+ witnessedCount: number;
40
+ /** Components with a public card. */
41
+ cardedCount: number;
42
+ };
43
+ }
44
+ /** Enrich a coverage map with a KB's fleet memory. Pure w.r.t. `kb.lookup`. */
45
+ export declare function joinCoverageWithKb(coverage: CoverageMap, kb: KnowledgeBase): JoinedCoverageMap;
46
+ //# sourceMappingURL=kb-join.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"kb-join.d.ts","sourceRoot":"","sources":["../../src/coverage-map/kb-join.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEtD,MAAM,MAAM,WAAW,GAAG,aAAa,GAAG,WAAW,CAAC;AAEtD,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB;IAChE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,kEAAkE;IAClE,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,CAAC,CAAC;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