@opensip-cli/mcp 0.1.15

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 (188) hide show
  1. package/LICENSE +202 -0
  2. package/NOTICE +8 -0
  3. package/README.md +33 -0
  4. package/dist/__tests__/command-transport.test.d.ts +13 -0
  5. package/dist/__tests__/command-transport.test.d.ts.map +1 -0
  6. package/dist/__tests__/command-transport.test.js +63 -0
  7. package/dist/__tests__/command-transport.test.js.map +1 -0
  8. package/dist/__tests__/e2e-stdio.test.d.ts +16 -0
  9. package/dist/__tests__/e2e-stdio.test.d.ts.map +1 -0
  10. package/dist/__tests__/e2e-stdio.test.js +271 -0
  11. package/dist/__tests__/e2e-stdio.test.js.map +1 -0
  12. package/dist/__tests__/freshness.test.d.ts +9 -0
  13. package/dist/__tests__/freshness.test.d.ts.map +1 -0
  14. package/dist/__tests__/freshness.test.js +78 -0
  15. package/dist/__tests__/freshness.test.js.map +1 -0
  16. package/dist/__tests__/integration.test.d.ts +20 -0
  17. package/dist/__tests__/integration.test.d.ts.map +1 -0
  18. package/dist/__tests__/integration.test.js +178 -0
  19. package/dist/__tests__/integration.test.js.map +1 -0
  20. package/dist/__tests__/register-mcp-graph-adapters.test.d.ts +12 -0
  21. package/dist/__tests__/register-mcp-graph-adapters.test.d.ts.map +1 -0
  22. package/dist/__tests__/register-mcp-graph-adapters.test.js +47 -0
  23. package/dist/__tests__/register-mcp-graph-adapters.test.js.map +1 -0
  24. package/dist/__tests__/session-results-read-port.test.d.ts +13 -0
  25. package/dist/__tests__/session-results-read-port.test.d.ts.map +1 -0
  26. package/dist/__tests__/session-results-read-port.test.js +151 -0
  27. package/dist/__tests__/session-results-read-port.test.js.map +1 -0
  28. package/dist/__tests__/sqlite-graph-read-port.test.d.ts +12 -0
  29. package/dist/__tests__/sqlite-graph-read-port.test.d.ts.map +1 -0
  30. package/dist/__tests__/sqlite-graph-read-port.test.js +322 -0
  31. package/dist/__tests__/sqlite-graph-read-port.test.js.map +1 -0
  32. package/dist/__tests__/tool-descriptor.test.d.ts +9 -0
  33. package/dist/__tests__/tool-descriptor.test.d.ts.map +1 -0
  34. package/dist/__tests__/tool-descriptor.test.js +55 -0
  35. package/dist/__tests__/tool-descriptor.test.js.map +1 -0
  36. package/dist/catalog-generation.d.ts +22 -0
  37. package/dist/catalog-generation.d.ts.map +1 -0
  38. package/dist/catalog-generation.js +21 -0
  39. package/dist/catalog-generation.js.map +1 -0
  40. package/dist/command.d.ts +3 -0
  41. package/dist/command.d.ts.map +1 -0
  42. package/dist/command.js +111 -0
  43. package/dist/command.js.map +1 -0
  44. package/dist/freshness.d.ts +50 -0
  45. package/dist/freshness.d.ts.map +1 -0
  46. package/dist/freshness.js +96 -0
  47. package/dist/freshness.js.map +1 -0
  48. package/dist/graph-read-port.d.ts +111 -0
  49. package/dist/graph-read-port.d.ts.map +1 -0
  50. package/dist/graph-read-port.js +16 -0
  51. package/dist/graph-read-port.js.map +1 -0
  52. package/dist/index.d.ts +9 -0
  53. package/dist/index.d.ts.map +1 -0
  54. package/dist/index.js +9 -0
  55. package/dist/index.js.map +1 -0
  56. package/dist/mcp-error.d.ts +15 -0
  57. package/dist/mcp-error.d.ts.map +1 -0
  58. package/dist/mcp-error.js +5 -0
  59. package/dist/mcp-error.js.map +1 -0
  60. package/dist/register-mcp-graph-adapters.d.ts +3 -0
  61. package/dist/register-mcp-graph-adapters.d.ts.map +1 -0
  62. package/dist/register-mcp-graph-adapters.js +21 -0
  63. package/dist/register-mcp-graph-adapters.js.map +1 -0
  64. package/dist/result-dto.d.ts +63 -0
  65. package/dist/result-dto.d.ts.map +1 -0
  66. package/dist/result-dto.js +11 -0
  67. package/dist/result-dto.js.map +1 -0
  68. package/dist/results-read-port.d.ts +43 -0
  69. package/dist/results-read-port.d.ts.map +1 -0
  70. package/dist/results-read-port.js +13 -0
  71. package/dist/results-read-port.js.map +1 -0
  72. package/dist/server.d.ts +84 -0
  73. package/dist/server.d.ts.map +1 -0
  74. package/dist/server.js +153 -0
  75. package/dist/server.js.map +1 -0
  76. package/dist/session-results-read-port.d.ts +42 -0
  77. package/dist/session-results-read-port.d.ts.map +1 -0
  78. package/dist/session-results-read-port.js +147 -0
  79. package/dist/session-results-read-port.js.map +1 -0
  80. package/dist/sqlite-graph-read-port.d.ts +88 -0
  81. package/dist/sqlite-graph-read-port.d.ts.map +1 -0
  82. package/dist/sqlite-graph-read-port.js +304 -0
  83. package/dist/sqlite-graph-read-port.js.map +1 -0
  84. package/dist/symbol-dto.d.ts +58 -0
  85. package/dist/symbol-dto.d.ts.map +1 -0
  86. package/dist/symbol-dto.js +12 -0
  87. package/dist/symbol-dto.js.map +1 -0
  88. package/dist/tool.d.ts +6 -0
  89. package/dist/tool.d.ts.map +1 -0
  90. package/dist/tool.js +33 -0
  91. package/dist/tool.js.map +1 -0
  92. package/dist/tools/__tests__/graph-handlers.test.d.ts +11 -0
  93. package/dist/tools/__tests__/graph-handlers.test.d.ts.map +1 -0
  94. package/dist/tools/__tests__/graph-handlers.test.js +415 -0
  95. package/dist/tools/__tests__/graph-handlers.test.js.map +1 -0
  96. package/dist/tools/__tests__/graph-walk.test.d.ts +9 -0
  97. package/dist/tools/__tests__/graph-walk.test.d.ts.map +1 -0
  98. package/dist/tools/__tests__/graph-walk.test.js +72 -0
  99. package/dist/tools/__tests__/graph-walk.test.js.map +1 -0
  100. package/dist/tools/__tests__/refresh-graph.test.d.ts +11 -0
  101. package/dist/tools/__tests__/refresh-graph.test.d.ts.map +1 -0
  102. package/dist/tools/__tests__/refresh-graph.test.js +100 -0
  103. package/dist/tools/__tests__/refresh-graph.test.js.map +1 -0
  104. package/dist/tools/__tests__/result-handlers.test.d.ts +9 -0
  105. package/dist/tools/__tests__/result-handlers.test.d.ts.map +1 -0
  106. package/dist/tools/__tests__/result-handlers.test.js +194 -0
  107. package/dist/tools/__tests__/result-handlers.test.js.map +1 -0
  108. package/dist/tools/__tests__/schemas.test.d.ts +10 -0
  109. package/dist/tools/__tests__/schemas.test.d.ts.map +1 -0
  110. package/dist/tools/__tests__/schemas.test.js +73 -0
  111. package/dist/tools/__tests__/schemas.test.js.map +1 -0
  112. package/dist/tools/blast-radius.d.ts +12 -0
  113. package/dist/tools/blast-radius.d.ts.map +1 -0
  114. package/dist/tools/blast-radius.js +33 -0
  115. package/dist/tools/blast-radius.js.map +1 -0
  116. package/dist/tools/call-walk-tool.d.ts +17 -0
  117. package/dist/tools/call-walk-tool.d.ts.map +1 -0
  118. package/dist/tools/call-walk-tool.js +46 -0
  119. package/dist/tools/call-walk-tool.js.map +1 -0
  120. package/dist/tools/callees-of.d.ts +12 -0
  121. package/dist/tools/callees-of.d.ts.map +1 -0
  122. package/dist/tools/callees-of.js +20 -0
  123. package/dist/tools/callees-of.js.map +1 -0
  124. package/dist/tools/find-dead-code.d.ts +11 -0
  125. package/dist/tools/find-dead-code.d.ts.map +1 -0
  126. package/dist/tools/find-dead-code.js +26 -0
  127. package/dist/tools/find-dead-code.js.map +1 -0
  128. package/dist/tools/get-agent-catalog.d.ts +12 -0
  129. package/dist/tools/get-agent-catalog.d.ts.map +1 -0
  130. package/dist/tools/get-agent-catalog.js +23 -0
  131. package/dist/tools/get-agent-catalog.js.map +1 -0
  132. package/dist/tools/get-architecture.d.ts +11 -0
  133. package/dist/tools/get-architecture.d.ts.map +1 -0
  134. package/dist/tools/get-architecture.js +26 -0
  135. package/dist/tools/get-architecture.js.map +1 -0
  136. package/dist/tools/get-latest-findings.d.ts +13 -0
  137. package/dist/tools/get-latest-findings.d.ts.map +1 -0
  138. package/dist/tools/get-latest-findings.js +38 -0
  139. package/dist/tools/get-latest-findings.js.map +1 -0
  140. package/dist/tools/get-symbol.d.ts +18 -0
  141. package/dist/tools/get-symbol.d.ts.map +1 -0
  142. package/dist/tools/get-symbol.js +44 -0
  143. package/dist/tools/get-symbol.js.map +1 -0
  144. package/dist/tools/graph-walk.d.ts +50 -0
  145. package/dist/tools/graph-walk.d.ts.map +1 -0
  146. package/dist/tools/graph-walk.js +89 -0
  147. package/dist/tools/graph-walk.js.map +1 -0
  148. package/dist/tools/list-runs.d.ts +11 -0
  149. package/dist/tools/list-runs.d.ts.map +1 -0
  150. package/dist/tools/list-runs.js +37 -0
  151. package/dist/tools/list-runs.js.map +1 -0
  152. package/dist/tools/refresh-graph.d.ts +22 -0
  153. package/dist/tools/refresh-graph.d.ts.map +1 -0
  154. package/dist/tools/refresh-graph.js +75 -0
  155. package/dist/tools/refresh-graph.js.map +1 -0
  156. package/dist/tools/register.d.ts +13 -0
  157. package/dist/tools/register.d.ts.map +1 -0
  158. package/dist/tools/register.js +40 -0
  159. package/dist/tools/register.js.map +1 -0
  160. package/dist/tools/schemas.d.ts +54 -0
  161. package/dist/tools/schemas.d.ts.map +1 -0
  162. package/dist/tools/schemas.js +59 -0
  163. package/dist/tools/schemas.js.map +1 -0
  164. package/dist/tools/search-symbols.d.ts +12 -0
  165. package/dist/tools/search-symbols.d.ts.map +1 -0
  166. package/dist/tools/search-symbols.js +37 -0
  167. package/dist/tools/search-symbols.js.map +1 -0
  168. package/dist/tools/show-run.d.ts +12 -0
  169. package/dist/tools/show-run.d.ts.map +1 -0
  170. package/dist/tools/show-run.js +40 -0
  171. package/dist/tools/show-run.js.map +1 -0
  172. package/dist/tools/tool-result.d.ts +29 -0
  173. package/dist/tools/tool-result.d.ts.map +1 -0
  174. package/dist/tools/tool-result.js +39 -0
  175. package/dist/tools/tool-result.js.map +1 -0
  176. package/dist/tools/trace-path.d.ts +12 -0
  177. package/dist/tools/trace-path.d.ts.map +1 -0
  178. package/dist/tools/trace-path.js +57 -0
  179. package/dist/tools/trace-path.js.map +1 -0
  180. package/dist/tools/types.d.ts +20 -0
  181. package/dist/tools/types.d.ts.map +1 -0
  182. package/dist/tools/types.js +11 -0
  183. package/dist/tools/types.js.map +1 -0
  184. package/dist/tools/who-calls.d.ts +12 -0
  185. package/dist/tools/who-calls.d.ts.map +1 -0
  186. package/dist/tools/who-calls.js +21 -0
  187. package/dist/tools/who-calls.js.map +1 -0
  188. package/package.json +104 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"freshness.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/freshness.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Catalog freshness mapping (Task 6.1 — Persistence/freshness).
3
+ *
4
+ * Maps the graph engine's `CatalogVerdict` to the agent-facing `Freshness` DTO,
5
+ * and recovers the working-tree `ValidationContext` from a catalog's recorded
6
+ * `filesFingerprint`. Pure verdict→DTO logic — no engine re-entry.
7
+ */
8
+ import { describe, expect, it } from 'vitest';
9
+ import { freshnessFromVerdict, missingFreshness, unverifiedFreshness, workingTreeContextFromCatalog, } from '../freshness.js';
10
+ const BUILT_AT = '2026-05-22T00:00:00.000Z';
11
+ function makeCatalog(over = {}) {
12
+ return {
13
+ version: '3.0',
14
+ tool: 'graph',
15
+ language: 'typescript',
16
+ builtAt: BUILT_AT,
17
+ cacheKey: 'ts-5.7.3-test',
18
+ filesFingerprint: '0\n',
19
+ functions: {},
20
+ ...over,
21
+ };
22
+ }
23
+ describe('missingFreshness', () => {
24
+ it('is fresh:false with reason "missing" and no builtAt', () => {
25
+ expect(missingFreshness()).toEqual({ fresh: false, reason: 'missing' });
26
+ });
27
+ });
28
+ describe('unverifiedFreshness', () => {
29
+ it('reports fresh:true with the builtAt (matches graph lookup serving the persisted catalog)', () => {
30
+ expect(unverifiedFreshness(BUILT_AT)).toEqual({ fresh: true, builtAt: BUILT_AT });
31
+ });
32
+ });
33
+ describe('freshnessFromVerdict', () => {
34
+ it('maps a valid verdict to fresh:true', () => {
35
+ const verdict = { kind: 'valid' };
36
+ expect(freshnessFromVerdict(verdict, BUILT_AT)).toEqual({ fresh: true, builtAt: BUILT_AT });
37
+ });
38
+ it('maps an incremental verdict to fresh:false with a changed-file reason', () => {
39
+ const verdict = {
40
+ kind: 'incremental',
41
+ changedFiles: ['a.ts', 'b.ts'],
42
+ };
43
+ const fresh = freshnessFromVerdict(verdict, BUILT_AT);
44
+ expect(fresh.fresh).toBe(false);
45
+ expect(fresh.builtAt).toBe(BUILT_AT);
46
+ expect(fresh.reason).toContain('2 file(s) changed');
47
+ });
48
+ it('maps an invalid verdict to fresh:false with its reason', () => {
49
+ const verdict = {
50
+ kind: 'invalid',
51
+ reason: 'version-mismatch',
52
+ };
53
+ const fresh = freshnessFromVerdict(verdict, BUILT_AT);
54
+ expect(fresh.fresh).toBe(false);
55
+ expect(fresh.reason).toContain('version-mismatch');
56
+ });
57
+ });
58
+ describe('workingTreeContextFromCatalog', () => {
59
+ it('recovers the tracked file set (in order) from the persisted fingerprint', () => {
60
+ const catalog = makeCatalog({
61
+ filesFingerprint: '2\nsrc/a.ts|111|10\nsrc/b.ts|222|20\n',
62
+ });
63
+ const ctx = workingTreeContextFromCatalog(catalog);
64
+ expect(ctx).toBeDefined();
65
+ expect(ctx?.currentFiles).toEqual(['src/a.ts', 'src/b.ts']);
66
+ expect(ctx?.currentLanguage).toBe('typescript');
67
+ expect(ctx?.currentCacheKey).toBe('ts-5.7.3-test');
68
+ });
69
+ it('returns undefined for a pre-fingerprint catalog (older build)', () => {
70
+ const { filesFingerprint, ...withoutFp } = makeCatalog();
71
+ void filesFingerprint;
72
+ expect(workingTreeContextFromCatalog(withoutFp)).toBeUndefined();
73
+ });
74
+ it('returns undefined when the fingerprint records zero files', () => {
75
+ expect(workingTreeContextFromCatalog(makeCatalog({ filesFingerprint: '0\n' }))).toBeUndefined();
76
+ });
77
+ });
78
+ //# sourceMappingURL=freshness.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"freshness.test.js","sourceRoot":"","sources":["../../src/__tests__/freshness.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,mBAAmB,EACnB,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UAAU,CAAC,CAAC,CAAC;QAC5D,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QAChD,MAAM,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACrD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,+DAA+D,EAAE,GAAG,EAAE;QACvE,MAAM,EAAE,gBAAgB,EAAE,GAAG,SAAS,EAAE,GAAG,WAAW,EAAE,CAAC;QACzD,KAAK,gBAAgB,CAAC;QACtB,MAAM,CAAC,6BAA6B,CAAC,SAAoB,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAC9E,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,2DAA2D,EAAE,GAAG,EAAE;QACnE,MAAM,CAAC,6BAA6B,CAAC,WAAW,CAAC,EAAE,gBAAgB,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,EAAE,CAAC;IAClG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * MCP integration (Task 6.2) — real adapter registrar + real catalog build +
3
+ * real read ports, in-process.
4
+ *
5
+ * Exercises the genuine capability wiring a recent core fix enables: MCP's own
6
+ * `registerMcpGraphAdapter` routes the bundled `graph-*` adapter into the
7
+ * scope-owned adapter registry (`currentAdapterRegistry()`), so `runGraph`'s
8
+ * `pickAdapter()` finds it under an mcp-owned run — BEFORE any `refresh_graph`.
9
+ * Then it builds a real catalog over a tiny TS fixture and drives the SQLite
10
+ * `GraphReadPort` end-to-end (search → get_symbol → who_calls → blast →
11
+ * dead_code), and seeds sessions to drive the session-backed `ResultsReadPort`
12
+ * (list → latest → show) over a real `DataStore`.
13
+ *
14
+ * The full host bootstrap (`loadOwningToolCapabilities` driving the
15
+ * `mcp-graph-adapter` domain from the manifest) is proven against the REAL built
16
+ * CLI in e2e-stdio.test.ts; this suite proves the registrar + ports in-process
17
+ * without coupling the package to the composition root.
18
+ */
19
+ export {};
20
+ //# sourceMappingURL=integration.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/integration.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * MCP integration (Task 6.2) — real adapter registrar + real catalog build +
3
+ * real read ports, in-process.
4
+ *
5
+ * Exercises the genuine capability wiring a recent core fix enables: MCP's own
6
+ * `registerMcpGraphAdapter` routes the bundled `graph-*` adapter into the
7
+ * scope-owned adapter registry (`currentAdapterRegistry()`), so `runGraph`'s
8
+ * `pickAdapter()` finds it under an mcp-owned run — BEFORE any `refresh_graph`.
9
+ * Then it builds a real catalog over a tiny TS fixture and drives the SQLite
10
+ * `GraphReadPort` end-to-end (search → get_symbol → who_calls → blast →
11
+ * dead_code), and seeds sessions to drive the session-backed `ResultsReadPort`
12
+ * (list → latest → show) over a real `DataStore`.
13
+ *
14
+ * The full host bootstrap (`loadOwningToolCapabilities` driving the
15
+ * `mcp-graph-adapter` domain from the manifest) is proven against the REAL built
16
+ * CLI in e2e-stdio.test.ts; this suite proves the registrar + ports in-process
17
+ * without coupling the package to the composition root.
18
+ */
19
+ import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
20
+ import { tmpdir } from 'node:os';
21
+ import { join } from 'node:path';
22
+ import { applyToolContributeScope, RunScope, runWithScope, runWithScopeSync, } from '@opensip-cli/core';
23
+ import { DataStoreFactory } from '@opensip-cli/datastore';
24
+ import { currentAdapterRegistry, graphTool } from '@opensip-cli/graph';
25
+ import { runGraph } from '@opensip-cli/graph/internal';
26
+ import { typescriptGraphAdapter } from '@opensip-cli/graph-typescript';
27
+ import { SessionRepo } from '@opensip-cli/session-store';
28
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
29
+ import { workingTreeContextFromCatalog } from '../freshness.js';
30
+ import { registerMcpGraphAdapter } from '../register-mcp-graph-adapters.js';
31
+ import { SessionResultsReadPort } from '../session-results-read-port.js';
32
+ import { SqliteGraphReadPort } from '../sqlite-graph-read-port.js';
33
+ const TSCONFIG = JSON.stringify({
34
+ compilerOptions: {
35
+ target: 'ES2022',
36
+ module: 'Node16',
37
+ moduleResolution: 'Node16',
38
+ strict: true,
39
+ rootDir: '.',
40
+ },
41
+ include: ['**/*.ts'],
42
+ });
43
+ const SOURCE = [
44
+ 'export function main(): number { return helper(); }',
45
+ 'function helper(): number { return 1; }',
46
+ 'function unused(): number { return 7; }',
47
+ '',
48
+ ].join('\n');
49
+ let dir;
50
+ let store;
51
+ let scope;
52
+ beforeEach(() => {
53
+ dir = mkdtempSync(join(tmpdir(), 'mcp-int-'));
54
+ mkdirSync(dir, { recursive: true });
55
+ writeFileSync(join(dir, 'tsconfig.json'), TSCONFIG, 'utf8');
56
+ writeFileSync(join(dir, 'index.ts'), SOURCE, 'utf8');
57
+ store = DataStoreFactory.open({ backend: 'memory' });
58
+ scope = new RunScope();
59
+ applyToolContributeScope(scope, graphTool);
60
+ });
61
+ afterEach(() => {
62
+ rmSync(dir, { recursive: true, force: true });
63
+ store.close();
64
+ });
65
+ /** Build the graph read port whose rebuild runs the real engine under the scope. */
66
+ function buildGraphPort() {
67
+ const rebuild = async () => {
68
+ const outcome = await runWithScope(scope, () => runGraph({ cwd: dir, datastore: store }));
69
+ if (outcome.catalog === null)
70
+ throw new Error('graph build produced no catalog');
71
+ return outcome.catalog;
72
+ };
73
+ return new SqliteGraphReadPort({
74
+ store,
75
+ freshnessContext: workingTreeContextFromCatalog,
76
+ rebuild,
77
+ });
78
+ }
79
+ describe('MCP integration — adapter load + real catalog', () => {
80
+ it('routes the bundled graph adapter into the scope registry BEFORE a build', () => {
81
+ runWithScopeSync(scope, () => {
82
+ expect(currentAdapterRegistry().size).toBe(0);
83
+ registerMcpGraphAdapter(typescriptGraphAdapter);
84
+ expect(currentAdapterRegistry().size).toBeGreaterThan(0);
85
+ expect(currentAdapterRegistry().getById('typescript')).toBeDefined();
86
+ });
87
+ });
88
+ it('refresh_graph builds a real catalog, then the port answers structural queries', async () => {
89
+ runWithScopeSync(scope, () => registerMcpGraphAdapter(typescriptGraphAdapter));
90
+ const graph = buildGraphPort();
91
+ // refresh_graph: a project without a loaded catalog → build it.
92
+ const refreshed = await graph.refresh();
93
+ expect(refreshed.ok).toBe(true);
94
+ // search → get_symbol
95
+ const search = graph.searchSymbols('helper');
96
+ expect(search.ok).toBe(true);
97
+ const helperRef = search.ok
98
+ ? search.value.data.find((r) => r.qualifiedName.includes('helper'))
99
+ : undefined;
100
+ expect(helperRef).toBeDefined();
101
+ const span = graph.findBySpan(helperRef.filePath, helperRef.line);
102
+ expect(span.ok && span.value.data.some((r) => r.bodyHash === helperRef.bodyHash)).toBe(true);
103
+ // who_calls (reverse adjacency): main calls helper.
104
+ const callers = graph.callerGraph();
105
+ expect(callers.ok).toBe(true);
106
+ if (callers.ok) {
107
+ const callerHashes = callers.value.data.edges.get(helperRef.bodyHash) ?? [];
108
+ const callerNames = callerHashes
109
+ .map((h) => callers.value.data.resolve(h)?.qualifiedName ?? '')
110
+ .join(',');
111
+ expect(callerNames).toContain('main');
112
+ }
113
+ // blast: helper has at least one direct caller.
114
+ const blast = graph.blast(helperRef.symbolId);
115
+ expect(blast.ok).toBe(true);
116
+ expect(blast.ok && (blast.value.data?.direct ?? 0)).toBeGreaterThanOrEqual(1);
117
+ // dead_code: `unused` is unreachable.
118
+ const dead = graph.deadCode();
119
+ expect(dead.ok).toBe(true);
120
+ const deadNames = dead.ok ? dead.value.data.map((d) => d.symbol.qualifiedName) : [];
121
+ expect(deadNames.some((n) => n.includes('unused'))).toBe(true);
122
+ });
123
+ });
124
+ // ── session-backed ResultsReadPort over a real DataStore ─────────────
125
+ function makeSession(over = {}) {
126
+ return {
127
+ id: 'fit-int-1',
128
+ tool: 'fit',
129
+ startedAt: '2026-05-21T12:00:00.000Z',
130
+ completedAt: '2026-05-21T12:00:30.000Z',
131
+ cwd: dir,
132
+ recipe: 'default',
133
+ score: 88,
134
+ passed: true,
135
+ durationMs: 30_000,
136
+ payload: { summary: { total: 1, passed: 1, failed: 0, errors: 0, warnings: 0 } },
137
+ ...over,
138
+ };
139
+ }
140
+ const buildStubReplay = (stored) => ({
141
+ result: {},
142
+ envelope: {
143
+ schemaVersion: 2,
144
+ tool: stored.tool,
145
+ runId: 'r',
146
+ createdAt: stored.startedAt,
147
+ verdict: {
148
+ score: stored.score,
149
+ passed: stored.passed,
150
+ summary: { total: 0, passed: 0, failed: 0, errors: 0, warnings: 0 },
151
+ },
152
+ units: [],
153
+ signals: [],
154
+ baselineIdentity: { fingerprintStrategyId: 'x', fingerprintStrategyVersion: 1 },
155
+ },
156
+ fidelity: 'projection',
157
+ });
158
+ const stubResolver = () => buildStubReplay;
159
+ describe('MCP integration — session replay over a real DataStore', () => {
160
+ it('lists, replays latest, and shows a seeded run (replay only, never re-run)', async () => {
161
+ new SessionRepo(store).save(makeSession({ id: 'fit-int-1' }));
162
+ new SessionRepo(store).save(makeSession({
163
+ id: 'fit-int-2',
164
+ startedAt: '2026-05-22T00:00:00.000Z',
165
+ completedAt: '2026-05-22T00:00:30.000Z',
166
+ }));
167
+ const results = new SessionResultsReadPort({ store, replayFor: stubResolver });
168
+ const list = results.listRuns();
169
+ expect(list.ok && list.value.map((r) => r.id)).toEqual(['fit-int-2', 'fit-int-1']);
170
+ const latest = await results.latestFindings({ tool: 'fit' });
171
+ expect(latest.ok).toBe(true);
172
+ expect(latest.ok && latest.value.session?.id).toBe('fit-int-2');
173
+ const shown = await results.showRun({ ref: 'fit-int-1' });
174
+ expect(shown.ok && shown.value.session?.id).toBe('fit-int-1');
175
+ expect(shown.ok && shown.value.data.fidelity).toBe('projection');
176
+ });
177
+ });
178
+ //# sourceMappingURL=integration.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"integration.test.js","sourceRoot":"","sources":["../../src/__tests__/integration.test.ts"],"names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Q,EAAE,CAAC;QAChC,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,CAAC;QAEnF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;QAC7D,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC7B,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAEhE,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,WAAW,EAAE,CAAC,CAAC;QAC1D,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAC9D,MAAM,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * MCP graph-adapter registrar (Task 6.1 step 6 — Scope).
3
+ *
4
+ * `registerMcpGraphAdapter` mirrors graph's own `registerGraphAdapter`: a routed
5
+ * capability contribution is registered into THIS run's scope-owned adapter
6
+ * registry (`scope.graph.adapters`, reached via `currentAdapterRegistry()`).
7
+ * Because graph's `contributeScope` runs for every bundled tool, that registry
8
+ * exists under `opensip mcp` even though the dispatched tool is `mcp` — the
9
+ * wiring a recent core fix routes through MCP's own domain.
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=register-mcp-graph-adapters.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-mcp-graph-adapters.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/register-mcp-graph-adapters.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * MCP graph-adapter registrar (Task 6.1 step 6 — Scope).
3
+ *
4
+ * `registerMcpGraphAdapter` mirrors graph's own `registerGraphAdapter`: a routed
5
+ * capability contribution is registered into THIS run's scope-owned adapter
6
+ * registry (`scope.graph.adapters`, reached via `currentAdapterRegistry()`).
7
+ * Because graph's `contributeScope` runs for every bundled tool, that registry
8
+ * exists under `opensip mcp` even though the dispatched tool is `mcp` — the
9
+ * wiring a recent core fix routes through MCP's own domain.
10
+ */
11
+ import { applyToolContributeScope, RunScope, runWithScopeSync } from '@opensip-cli/core';
12
+ import { currentAdapterRegistry, graphTool } from '@opensip-cli/graph';
13
+ import { typescriptGraphAdapter } from '@opensip-cli/graph-typescript';
14
+ import { describe, expect, it } from 'vitest';
15
+ import { registerMcpGraphAdapter } from '../register-mcp-graph-adapters.js';
16
+ /** A scope carrying graph's contributed subscope (so `scope.graph.adapters` exists). */
17
+ function graphScope() {
18
+ const scope = new RunScope();
19
+ applyToolContributeScope(scope, graphTool);
20
+ return scope;
21
+ }
22
+ describe('registerMcpGraphAdapter', () => {
23
+ it('registers a routed graph adapter into the scope-owned adapter registry', () => {
24
+ const scope = graphScope();
25
+ runWithScopeSync(scope, () => {
26
+ expect(currentAdapterRegistry().size).toBe(0);
27
+ // The host routes the contribution (already shape-checked) through this registrar.
28
+ registerMcpGraphAdapter(typescriptGraphAdapter);
29
+ expect(currentAdapterRegistry().size).toBe(1);
30
+ expect(currentAdapterRegistry().getById('typescript')).toBeDefined();
31
+ });
32
+ });
33
+ it('routes through the scope active at registration time (no module singleton)', () => {
34
+ // A first scope gets the adapter; a second, independent scope does NOT —
35
+ // proving registration targets the active scope's registry, not a global.
36
+ const first = graphScope();
37
+ runWithScopeSync(first, () => registerMcpGraphAdapter(typescriptGraphAdapter));
38
+ const second = graphScope();
39
+ runWithScopeSync(second, () => {
40
+ expect(currentAdapterRegistry().size).toBe(0);
41
+ });
42
+ runWithScopeSync(first, () => {
43
+ expect(currentAdapterRegistry().size).toBe(1);
44
+ });
45
+ });
46
+ });
47
+ //# sourceMappingURL=register-mcp-graph-adapters.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-mcp-graph-adapters.test.js","sourceRoot":"","sources":["../../src/__tests__/register-mcp-graph-adapters.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAE5E,wFAAwF;AACxF,SAAS,UAAU;IACjB,MAAM,KAAK,GAAG,IAAI,QAAQ,EAAE,CAAC;IAC7B,wBAAwB,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;IAC3C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,EAAE,CAAC,wEAAwE,EAAE,GAAG,EAAE;QAChF,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC;QAC3B,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE;YAC3B,MAAM,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9C,mFAAmF;YACnF,uBAAuB,CAAC,sBAAsB,CAAC,CAAC;YAChD,MAAM,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC9C,MAAM,CAAC,sBAAsB,EAAE,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC;QACvE,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,4EAA4E,EAAE,GAAG,EAAE;QACpF,yEAAyE;QACzE,0EAA0E;QAC1E,MAAM,KAAK,GAAG,UAAU,EAAE,CAAC;QAC3B,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE,CAAC,uBAAuB,CAAC,sBAAsB,CAAC,CAAC,CAAC;QAE/E,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC;QAC5B,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE;YAC5B,MAAM,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;QACH,gBAAgB,CAAC,KAAK,EAAE,GAAG,EAAE;YAC3B,MAAM,CAAC,sBAAsB,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * `SessionResultsReadPort` against a REAL in-memory `DataStore` (Task 6.1 step 5,
3
+ * 7 — result-first behavior; replay only, never re-run).
4
+ *
5
+ * Sessions are seeded via `SessionRepo` (test files may import it; production MCP
6
+ * source never names it). The per-tool replay is injected as a deterministic
7
+ * fake `replayFor` — so the test exercises the port's filter mapping
8
+ * (severity → `errors-only`/`warnings-only`, limit → `top:N`) and provenance
9
+ * without depending on a specific tool's replay internals. The fake replay also
10
+ * proves the port REPLAYS a stored session — it never invokes a run command.
11
+ */
12
+ export {};
13
+ //# sourceMappingURL=session-results-read-port.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-results-read-port.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/session-results-read-port.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG"}
@@ -0,0 +1,151 @@
1
+ /**
2
+ * `SessionResultsReadPort` against a REAL in-memory `DataStore` (Task 6.1 step 5,
3
+ * 7 — result-first behavior; replay only, never re-run).
4
+ *
5
+ * Sessions are seeded via `SessionRepo` (test files may import it; production MCP
6
+ * source never names it). The per-tool replay is injected as a deterministic
7
+ * fake `replayFor` — so the test exercises the port's filter mapping
8
+ * (severity → `errors-only`/`warnings-only`, limit → `top:N`) and provenance
9
+ * without depending on a specific tool's replay internals. The fake replay also
10
+ * proves the port REPLAYS a stored session — it never invokes a run command.
11
+ */
12
+ import { buildSignalEnvelope, } from '@opensip-cli/contracts';
13
+ import { createSignal, HOST_VERDICT_POLICY_FALLBACK, } from '@opensip-cli/core';
14
+ import { DataStoreFactory } from '@opensip-cli/datastore';
15
+ import { SessionRepo } from '@opensip-cli/session-store';
16
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
17
+ import { SessionResultsReadPort } from '../session-results-read-port.js';
18
+ let store;
19
+ let replayCalls;
20
+ beforeEach(() => {
21
+ store = DataStoreFactory.open({ backend: 'memory' });
22
+ replayCalls = [];
23
+ });
24
+ afterEach(() => {
25
+ store.close();
26
+ });
27
+ function makeSession(over = {}) {
28
+ return {
29
+ id: 'fit-1',
30
+ tool: 'fit',
31
+ startedAt: '2026-05-21T12:00:00.000Z',
32
+ completedAt: '2026-05-21T12:00:30.000Z',
33
+ cwd: '/proj',
34
+ recipe: 'default',
35
+ score: 80,
36
+ passed: false,
37
+ durationMs: 30_000,
38
+ payload: { summary: { total: 2, passed: 0, failed: 2, errors: 1, warnings: 1 } },
39
+ ...over,
40
+ };
41
+ }
42
+ /** A replay envelope with one error-rung + one warning-rung signal. */
43
+ function replayEnvelope(tool) {
44
+ const signals = [
45
+ createSignal({ source: 'u', severity: 'high', ruleId: 'err-rule', message: 'an error' }),
46
+ createSignal({ source: 'u', severity: 'medium', ruleId: 'warn-rule', message: 'a warning' }),
47
+ ];
48
+ const envelope = buildSignalEnvelope({
49
+ tool,
50
+ runId: 'r',
51
+ createdAt: '2026-05-21T12:00:00.000Z',
52
+ units: [{ slug: 'u', passed: false, durationMs: 1 }],
53
+ signals,
54
+ policy: HOST_VERDICT_POLICY_FALLBACK,
55
+ runFaulted: false,
56
+ });
57
+ return { result: {}, envelope, fidelity: 'projection' };
58
+ }
59
+ /** Records every replayed tool (proving "no re-run") then returns its envelope. */
60
+ const replayAndRecord = (stored) => {
61
+ replayCalls.push(stored.tool);
62
+ return replayEnvelope(stored.tool);
63
+ };
64
+ /** A replay resolver that records every tool it replays (proving "no re-run"). */
65
+ const recordingResolver = () => replayAndRecord;
66
+ function port() {
67
+ return new SessionResultsReadPort({ store, replayFor: recordingResolver });
68
+ }
69
+ describe('SessionResultsReadPort — listRuns', () => {
70
+ it('lists stored runs as lean RunSummary pointers (newest first)', () => {
71
+ new SessionRepo(store).save(makeSession({
72
+ id: 'a',
73
+ startedAt: '2026-05-01T00:00:00.000Z',
74
+ completedAt: '2026-05-01T00:00:00.000Z',
75
+ }));
76
+ new SessionRepo(store).save(makeSession({
77
+ id: 'b',
78
+ startedAt: '2026-05-02T00:00:00.000Z',
79
+ completedAt: '2026-05-02T00:00:00.000Z',
80
+ }));
81
+ const out = port().listRuns();
82
+ expect(out.ok).toBe(true);
83
+ if (out.ok) {
84
+ expect(out.value.map((r) => r.id)).toEqual(['b', 'a']);
85
+ expect(out.value[0]?.showCommand).toContain('opensip sessions show');
86
+ }
87
+ });
88
+ it('honors the tool filter', () => {
89
+ new SessionRepo(store).save(makeSession({ id: 'fit-x', tool: 'fit' }));
90
+ new SessionRepo(store).save(makeSession({ id: 'graph-x', tool: 'graph' }));
91
+ const out = port().listRuns({ tool: 'graph' });
92
+ expect(out.ok && out.value.map((r) => r.id)).toEqual(['graph-x']);
93
+ });
94
+ });
95
+ describe('SessionResultsReadPort — latestFindings (severity/limit → replay filters)', () => {
96
+ beforeEach(() => {
97
+ new SessionRepo(store).save(makeSession());
98
+ });
99
+ it('maps severity:errors → errors-only and returns only error-rung findings', async () => {
100
+ const out = await port().latestFindings({ tool: 'fit', severity: 'errors' });
101
+ expect(out.ok).toBe(true);
102
+ if (out.ok) {
103
+ expect(out.value.filtersApplied).toContain('errors-only');
104
+ expect(out.value.data.map((f) => f.ruleId)).toEqual(['err-rule']);
105
+ }
106
+ // It REPLAYED the persisted fit session — it never ran the tool.
107
+ expect(replayCalls).toEqual(['fit']);
108
+ });
109
+ it('maps severity:warnings → warnings-only', async () => {
110
+ const out = await port().latestFindings({ tool: 'fit', severity: 'warnings' });
111
+ expect(out.ok && out.value.filtersApplied).toContain('warnings-only');
112
+ expect(out.ok && out.value.data.map((f) => f.ruleId)).toEqual(['warn-rule']);
113
+ });
114
+ it('maps limit → top:N', async () => {
115
+ const out = await port().latestFindings({ tool: 'fit', limit: 1 });
116
+ expect(out.ok && out.value.filtersApplied).toContain('top:1');
117
+ expect(out.ok && out.value.data).toHaveLength(1);
118
+ });
119
+ it('applies no severity filter for severity:all', async () => {
120
+ const out = await port().latestFindings({ tool: 'fit', severity: 'all' });
121
+ expect(out.ok && out.value.data.map((f) => f.ruleId).sort()).toEqual(['err-rule', 'warn-rule']);
122
+ });
123
+ it('returns a structured err when no run exists for the tool', async () => {
124
+ const out = await port().latestFindings({ tool: 'graph' });
125
+ expect(out.ok).toBe(false);
126
+ });
127
+ });
128
+ describe('SessionResultsReadPort — showRun', () => {
129
+ it('replays a stored run by id with provenance + recommendedNext (never re-runs)', async () => {
130
+ new SessionRepo(store).save(makeSession({ id: 'fit-1' }));
131
+ const out = await port().showRun({ ref: 'fit-1' });
132
+ expect(out.ok).toBe(true);
133
+ if (out.ok) {
134
+ expect(out.value.data.fidelity).toBe('projection');
135
+ expect(out.value.session?.id).toBe('fit-1');
136
+ expect(out.value.recommendedNext?.rerunCommand).toBe('opensip fit');
137
+ }
138
+ expect(replayCalls).toEqual(['fit']);
139
+ });
140
+ it('returns a structured err for an unknown ref', async () => {
141
+ const out = await port().showRun({ ref: 'does-not-exist' });
142
+ expect(out.ok).toBe(false);
143
+ });
144
+ });
145
+ describe('SessionResultsReadPort — agentCatalog', () => {
146
+ it('returns the self-describing agent catalog', () => {
147
+ const out = port().agentCatalog();
148
+ expect(out.ok).toBe(true);
149
+ });
150
+ });
151
+ //# sourceMappingURL=session-results-read-port.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"session-results-read-port.test.js","sourceRoot":"","sources":["../../src/__tests__/session-results-read-port.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,mBAAmB,GAIpB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,YAAY,EACZ,4BAA4B,GAG7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAkB,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,WAAW,EAAwB,MAAM,4BAA4B,CAAC;AAC/E,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAErE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAEzE,IAAI,KAAgB,CAAC;AACrB,IAAI,WAA0B,CAAC;AAE/B,UAAU,CAAC,GAAG,EAAE;IACd,KAAK,GAAG,gBAAgB,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrD,WAAW,GAAG,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH,SAAS,CAAC,GAAG,EAAE;IACb,KAAK,CAAC,KAAK,EAAE,CAAC;AAChB,CAAC,CAAC,CAAC;AAEH,SAAS,WAAW,CAAC,OAA+B,EAAE;IACpD,OAAO;QACL,EAAE,E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CAAC,CAAC;YACnD,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YAC5C,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QACtE,CAAC;QACD,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,6CAA6C,EAAE,KAAK,IAAI,EAAE;QAC3D,MAAM,GAAG,GAAG,MAAM,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC5D,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,uCAAuC,EAAE,GAAG,EAAE;IACrD,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACnD,MAAM,GAAG,GAAG,IAAI,EAAE,CAAC,YAAY,EAAE,CAAC;QAClC,MAAM,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * `SqliteGraphReadPort` against a REAL in-memory `DataStore` (Task 6.1 steps 2,
3
+ * 4, 7 — ports return Result; persistence round-trip; generation snapshotting;
4
+ * forward-compat; no raw body in DTOs).
5
+ *
6
+ * Seeds a hand-built catalog through the graph engine's `CatalogRepo` (the same
7
+ * persistence path `runGraph` writes), then drives the port — no `runGraph`
8
+ * needed at this level. A separate suite seeds NOTHING to assert the
9
+ * missing-catalog ok-`fresh:false` contract.
10
+ */
11
+ export {};
12
+ //# sourceMappingURL=sqlite-graph-read-port.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sqlite-graph-read-port.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/sqlite-graph-read-port.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG"}