Skip to content

armgit / Ix

Public Imported from GitHub
0

Understand any codebase instantly. System intelligence for codebases, built for humans and AI.

test(core-ingestion): fix the 6 failing tests and gate the suite in CI (#558)

KageBinary12056e768ef7
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index d32681cf..e4a57c38 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -205,6 +205,16 @@ jobs:
working-directory: ix-cli
run: npm run smoke
+ # core-ingestion has its own 358-test suite and nothing ran it until #557,
+ # by which point 6 tests had been failing for months -- three of them since
+ # #120 extracted the directory their fixtures lived in. The package is
+ # already installed and built by the ix-cli build step above, so gating it
+ # here costs one step rather than a whole job, and picks up the matrix's
+ # OS/node spread for free (the tree-sitter grammars are native).
+ - name: core-ingestion tests
+ working-directory: core-ingestion
+ run: npm test
+
- name: Upload coverage
if: ${{ matrix.coverage }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
diff --git a/core-ingestion/src/__tests__/__snapshots__/parseFile.test.ts.snap b/core-ingestion/src/__tests__/__snapshots__/parseFile.test.ts.snap
index 7219ffe8..5a42261a 100644
--- a/core-ingestion/src/__tests__/__snapshots__/parseFile.test.ts.snap
+++ b/core-ingestion/src/__tests__/__snapshots__/parseFile.test.ts.snap
@@ -1,239 +1,845 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[`parseFile snapshots > snapshots doctor.ts 1`] = `
+exports[`parseFile snapshots > snapshots Identifiers.scala 1`] = `
{
"chunks": [
{
- "chunkKind": "interface",
+ "chunkKind": "class",
"container": undefined,
- "contentHash": "2af0710a68e6f595",
- "endByte": 322,
- "language": "typescript",
- "lineEnd": 10,
+ "contentHash": "f89c32100a79e3f6",
+ "endByte": 191,
+ "language": "scala",
+ "lineEnd": 5,
+ "lineStart": 5,
+ "name": "WorkspaceId",
+ "startByte": 133,
+ },
+ {
+ "chunkKind": "class",
+ "container": undefined,
+ "contentHash": "2847b0c26e640a74",
+ "endByte": 246,
+ "language": "scala",
+ "lineEnd": 7,
"lineStart": 7,
- "name": "Check",
- "startByte": 232,
+ "name": "NodeId",
+ "startByte": 193,
},
{
- "chunkKind": "function",
+ "chunkKind": "class",
"container": undefined,
- "contentHash": "a80b54ecd0296c6e",
- "endByte": 3307,
- "language": "typescript",
- "lineEnd": 100,
+ "contentHash": "d79bfe54e1660f23",
+ "endByte": 448,
+ "language": "scala",
+ "lineEnd": 15,
+ "lineStart": 9,
+ "name": "Identifiers",
+ "startByte": 248,
+ },
+ {
+ "chunkKind": "function",
+ "container": "Identifiers",
+ "contentHash": "0ecc8f79a318ce0c",
+ "endByte": 321,
+ "language": "scala",
+ "lineEnd": 10,
+ "lineStart": 10,
+ "name": "nodeId",
+ "startByte": 271,
+ },
+ {
+ "chunkKind": "function",
+ "container": "Identifiers",
+ "contentHash": "4a2d15a355a66a93",
+ "endByte": 390,
+ "language": "scala",
+ "lineEnd": 12,
"lineStart": 12,
- "name": "registerDoctorCommand",
- "startByte": 331,
+ "name": "workspaceId",
+ "startByte": 325,
+ },
+ {
+ "chunkKind": "function",
+ "container": "Identifiers",
+ "contentHash": "894168cff2017366",
+ "endByte": 446,
+ "language": "scala",
+ "lineEnd": 14,
+ "lineStart": 14,
+ "name": "isBlank",
+ "startByte": 394,
},
],
"entities": [
{
"kind": "file",
- "language": "typescript",
- "lineEnd": 101,
+ "language": "scala",
+ "lineEnd": 16,
"lineStart": 1,
- "name": "doctor.ts",
+ "name": "Identifiers.scala",
},
{
"container": undefined,
- "kind": "interface",
- "language": "typescript",
- "lineEnd": 10,
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 5,
+ "lineStart": 5,
+ "name": "WorkspaceId",
+ "packageScope": undefined,
+ },
+ {
+ "container": undefined,
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 7,
"lineStart": 7,
- "name": "Check",
+ "name": "NodeId",
+ "packageScope": undefined,
},
{
"container": undefined,
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 15,
+ "lineStart": 9,
+ "name": "Identifiers",
+ "packageScope": undefined,
+ },
+ {
+ "container": "Identifiers",
"kind": "function",
- "language": "typescript",
- "lineEnd": 100,
+ "language": "scala",
+ "lineEnd": 10,
+ "lineStart": 10,
+ "name": "nodeId",
+ "packageScope": undefined,
+ },
+ {
+ "container": "Identifiers",
+ "kind": "function",
+ "language": "scala",
+ "lineEnd": 12,
"lineStart": 12,
- "name": "registerDoctorCommand",
+ "name": "workspaceId",
+ "packageScope": undefined,
},
{
- "kind": "module",
- "language": "typescript",
- "lineEnd": 1,
+ "container": "Identifiers",
+ "kind": "function",
+ "language": "scala",
+ "lineEnd": 14,
+ "lineStart": 14,
+ "name": "isBlank",
+ "packageScope": undefined,
+ },
+ ],
+ "exportPublicNames": undefined,
+ "filePath": "core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Identifiers.scala",
+ "fileRole": {
+ "role": "production",
+ "role_confidence": 0.5,
+ "role_signals": [],
+ },
+ "importAliases": undefined,
+ "importBindings": undefined,
+ "language": "scala",
+ "relationships": [
+ {
+ "dstName": "WorkspaceId",
+ "predicate": "CONTAINS",
+ "srcName": "Identifiers.scala",
+ },
+ {
+ "dstName": "AnyVal",
+ "predicate": "EXTENDS",
+ "srcName": "WorkspaceId",
+ },
+ {
+ "dstName": "NodeId",
+ "predicate": "CONTAINS",
+ "srcName": "Identifiers.scala",
+ },
+ {
+ "dstName": "AnyVal",
+ "predicate": "EXTENDS",
+ "srcName": "NodeId",
+ },
+ {
+ "dstName": "Identifiers",
+ "predicate": "CONTAINS",
+ "srcName": "Identifiers.scala",
+ },
+ {
+ "dstName": "nodeId",
+ "predicate": "CONTAINS",
+ "srcName": "Identifiers",
+ },
+ {
+ "dstName": "workspaceId",
+ "predicate": "CONTAINS",
+ "srcName": "Identifiers",
+ },
+ {
+ "dstName": "isBlank",
+ "predicate": "CONTAINS",
+ "srcName": "Identifiers",
+ },
+ {
+ "dstName": "NodeId",
+ "predicate": "REFERENCES",
+ "srcName": "Identifiers.nodeId",
+ },
+ {
+ "dstName": "NodeId",
+ "predicate": "CALLS",
+ "srcName": "Identifiers.nodeId",
+ },
+ {
+ "dstName": "WorkspaceId",
+ "predicate": "REFERENCES",
+ "srcName": "Identifiers.workspaceId",
+ },
+ {
+ "dstName": "WorkspaceId",
+ "predicate": "CALLS",
+ "srcName": "Identifiers.workspaceId",
+ },
+ ],
+}
+`;
+
+exports[`parseFile snapshots > snapshots Node.scala 1`] = `
+{
+ "chunks": [
+ {
+ "chunkKind": "interface",
+ "container": undefined,
+ "contentHash": "2c3602b7735b0980",
+ "endByte": 506,
+ "language": "scala",
+ "lineEnd": 12,
+ "lineStart": 12,
+ "name": "NodeKind",
+ "startByte": 485,
+ },
+ {
+ "chunkKind": "class",
+ "container": undefined,
+ "contentHash": "b850691c07cad41c",
+ "endByte": 687,
+ "language": "scala",
+ "lineEnd": 19,
+ "lineStart": 14,
+ "name": "NodeKind",
+ "startByte": 508,
+ },
+ {
+ "chunkKind": "class",
+ "container": "NodeKind",
+ "contentHash": "12598e5fe79c0e34",
+ "endByte": 565,
+ "language": "scala",
+ "lineEnd": 15,
+ "lineStart": 15,
+ "name": "Module",
+ "startByte": 528,
+ },
+ {
+ "chunkKind": "class",
+ "container": "NodeKind",
+ "contentHash": "7dfa5e9b2a11d532",
+ "endByte": 605,
+ "language": "scala",
+ "lineEnd": 16,
+ "lineStart": 16,
+ "name": "File",
+ "startByte": 568,
+ },
+ {
+ "chunkKind": "class",
+ "container": "NodeKind",
+ "contentHash": "1b4ff062f9924dc4",
+ "endByte": 645,
+ "language": "scala",
+ "lineEnd": 17,
+ "lineStart": 17,
+ "name": "Class",
+ "startByte": 608,
+ },
+ {
+ "chunkKind": "class",
+ "container": "NodeKind",
+ "contentHash": "79d42ac9f2b6c985",
+ "endByte": 685,
+ "language": "scala",
+ "lineEnd": 18,
+ "lineStart": 18,
+ "name": "Function",
+ "startByte": 648,
+ },
+ {
+ "chunkKind": "class",
+ "container": undefined,
+ "contentHash": "c588319971f82fee",
+ "endByte": 783,
+ "language": "scala",
+ "lineEnd": 26,
+ "lineStart": 21,
+ "name": "Node",
+ "startByte": 689,
+ },
+ {
+ "chunkKind": "class",
+ "container": undefined,
+ "contentHash": "74e0de9b40b263e7",
+ "endByte": 914,
+ "language": "scala",
+ "lineEnd": 31,
+ "lineStart": 28,
+ "name": "Node",
+ "startByte": 785,
+ },
+ {
+ "chunkKind": "function",
+ "container": "Node",
+ "contentHash": "bcf16f274d8cc256",
+ "endByte": 913,
+ "language": "scala",
+ "lineEnd": 31,
+ "lineStart": 29,
+ "name": "module",
+ "startByte": 801,
+ },
+ ],
+ "entities": [
+ {
+ "kind": "file",
+ "language": "scala",
+ "lineEnd": 32,
"lineStart": 1,
- "name": "commander",
+ "name": "Node.scala",
},
{
- "kind": "module",
- "language": "typescript",
- "lineEnd": 2,
- "lineStart": 2,
- "name": "chalk",
+ "container": undefined,
+ "kind": "interface",
+ "language": "scala",
+ "lineEnd": 12,
+ "lineStart": 12,
+ "name": "NodeKind",
+ "packageScope": undefined,
},
{
- "kind": "module",
- "language": "typescript",
- "lineEnd": 3,
- "lineStart": 3,
- "name": "ui.js",
+ "container": undefined,
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 19,
+ "lineStart": 14,
+ "name": "NodeKind",
+ "packageScope": undefined,
+ },
+ {
+ "container": "NodeKind",
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 15,
+ "lineStart": 15,
+ "name": "Module",
+ "packageScope": undefined,
+ },
+ {
+ "container": "NodeKind",
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 16,
+ "lineStart": 16,
+ "name": "File",
+ "packageScope": undefined,
+ },
+ {
+ "container": "NodeKind",
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 17,
+ "lineStart": 17,
+ "name": "Class",
+ "packageScope": undefined,
+ },
+ {
+ "container": "NodeKind",
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 18,
+ "lineStart": 18,
+ "name": "Function",
+ "packageScope": undefined,
},
{
- "kind": "module",
- "language": "typescript",
- "lineEnd": 4,
- "lineStart": 4,
- "name": "api.js",
+ "container": undefined,
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 26,
+ "lineStart": 21,
+ "name": "Node",
+ "packageScope": undefined,
+ },
+ {
+ "container": undefined,
+ "kind": "class",
+ "language": "scala",
+ "lineEnd": 31,
+ "lineStart": 28,
+ "name": "Node",
+ "packageScope": undefined,
+ },
+ {
+ "container": "Node",
+ "kind": "function",
+ "language": "scala",
+ "lineEnd": 31,
+ "lineStart": 29,
+ "name": "module",
+ "packageScope": undefined,
},
{
"kind": "module",
- "language": "typescript",
- "lineEnd": 5,
- "lineStart": 5,
- "name": "config.js",
+ "language": "scala",
+ "lineEnd": 10,
+ "lineStart": 10,
+ "name": "java.time.Instant",
},
],
- "filePath": "ix-cli/src/cli/commands/doctor.ts",
+ "exportPublicNames": undefined,
+ "filePath": "core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Node.scala",
"fileRole": {
"role": "production",
"role_confidence": 0.5,
"role_signals": [],
},
"importAliases": undefined,
- "language": "typescript",
+ "importBindings": undefined,
+ "language": "scala",
"relationships": [
{
- "dstName": "Check",
+ "dstName": "NodeKind",
"predicate": "CONTAINS",
- "srcName": "doctor.ts",
+ "srcName": "Node.scala",
},
{
- "dstName": "registerDoctorCommand",
+ "dstName": "NodeKind",
"predicate": "CONTAINS",
- "srcName": "doctor.ts",
+ "srcName": "Node.scala",
},
{
- "dstName": "commander",
- "predicate": "IMPORTS",
- "srcName": "doctor.ts",
+ "dstName": "Module",
+ "predicate": "CONTAINS",
+ "srcName": "NodeKind",
},
{
- "dstName": "chalk",
- "predicate": "IMPORTS",
- "srcName": "doctor.ts",
+ "dstName": "NodeKind",
+ "predicate": "EXTENDS",
+ "srcName": "Module",
},
{
- "dstName": "ui.js",
- "predicate": "IMPORTS",
- "srcName": "doctor.ts",
+ "dstName": "File",
+ "predicate": "CONTAINS",
+ "srcName": "NodeKind",
},
{
- "dstName": "api.js",
- "predicate": "IMPORTS",
- "srcName": "doctor.ts",
+ "dstName": "NodeKind",
+ "predicate": "EXTENDS",
+ "srcName": "File",
+ },
+ {
+ "dstName": "Class",
+ "predicate": "CONTAINS",
+ "srcName": "NodeKind",
+ },
+ {
+ "dstName": "NodeKind",
+ "predicate": "EXTENDS",
+ "srcName": "Class",
},
{
- "dstName": "config.js",
+ "dstName": "Function",
+ "predicate": "CONTAINS",
+ "srcName": "NodeKind",
+ },
+ {
+ "dstName": "NodeKind",
+ "predicate": "EXTENDS",
+ "srcName": "Function",
+ },
+ {
+ "dstName": "Node",
+ "predicate": "CONTAINS",
+ "srcName": "Node.scala",
+ },
+ {
+ "dstName": "Node",
+ "predicate": "CONTAINS",
+ "srcName": "Node.scala",
+ },
+ {
+ "dstName": "module",
+ "predicate": "CONTAINS",
+ "srcName": "Node",
+ },
+ {
+ "dstName": "java.time.Instant",
"predicate": "IMPORTS",
- "srcName": "doctor.ts",
+ "srcName": "Node.scala",
},
{
- "dstName": "Command",
+ "dstName": "NodeKind",
"predicate": "REFERENCES",
- "srcName": "registerDoctorCommand",
+ "srcName": "Node",
},
{
- "dstName": "command",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "dstName": "Instant",
+ "predicate": "REFERENCES",
+ "srcName": "Node",
},
{
- "dstName": "description",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "dstName": "Instant",
+ "predicate": "REFERENCES",
+ "srcName": "Node.module",
},
{
- "dstName": "option",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "dstName": "Node",
+ "predicate": "REFERENCES",
+ "srcName": "Node.module",
},
{
- "dstName": "action",
+ "dstName": "Node",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "Node.module",
},
{
- "dstName": "getEndpoint",
+ "dstName": "NodeKind.Module",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "Node.module",
},
+ ],
+}
+`;
+
+exports[`parseFile snapshots > snapshots a TypeScript command module 1`] = `
+{
+ "chunks": [
{
- "dstName": "IxClient",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "chunkKind": "interface",
+ "container": undefined,
+ "contentHash": "d3ddb9e65bb91943",
+ "endByte": 729,
+ "language": "typescript",
+ "lineEnd": 18,
+ "lineStart": 14,
+ "name": "CheckResult",
+ "startByte": 654,
},
{
- "dstName": "health",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "chunkKind": "function",
+ "container": undefined,
+ "contentHash": "6c07d4a71f08370e",
+ "endByte": 1055,
+ "language": "typescript",
+ "lineEnd": 30,
+ "lineStart": 24,
+ "name": "runChecks",
+ "startByte": 832,
},
{
- "dstName": "stats",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "chunkKind": "function",
+ "container": undefined,
+ "contentHash": "80dea54a583ce51e",
+ "endByte": 1361,
+ "language": "typescript",
+ "lineEnd": 40,
+ "lineStart": 32,
+ "name": "runOne",
+ "startByte": 1057,
},
{
- "dstName": "conflicts",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "chunkKind": "function",
+ "container": undefined,
+ "contentHash": "23dc5c83e71305af",
+ "endByte": 1542,
+ "language": "typescript",
+ "lineEnd": 46,
+ "lineStart": 42,
+ "name": "statusOf",
+ "startByte": 1370,
},
{
- "dstName": "isArray",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "chunkKind": "class",
+ "container": undefined,
+ "contentHash": "3a95f788f5a59860",
+ "endByte": 1855,
+ "language": "typescript",
+ "lineEnd": 62,
+ "lineStart": 48,
+ "name": "CheckRunner",
+ "startByte": 1551,
},
{
- "dstName": "run",
- "predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "chunkKind": "method",
+ "container": "CheckRunner",
+ "contentHash": "b57207da8a75d395",
+ "endByte": 1677,
+ "language": "typescript",
+ "lineEnd": 53,
+ "lineStart": 51,
+ "name": "constructor",
+ "startByte": 1615,
+ },
+ {
+ "chunkKind": "method",
+ "container": "CheckRunner",
+ "contentHash": "c3b37b9c0a27616e",
+ "endByte": 1742,
+ "language": "typescript",
+ "lineEnd": 57,
+ "lineStart": 55,
+ "name": "load",
+ "startByte": 1681,
+ },
+ {
+ "chunkKind": "method",
+ "container": "CheckRunner",
+ "contentHash": "ebf38e56bde93e51",
+ "endByte": 1853,
+ "language": "typescript",
+ "lineEnd": 61,
+ "lineStart": 59,
+ "name": "describe",
+ "startByte": 1746,
+ },
+ ],
+ "entities": [
+ {
+ "kind": "file",
+ "language": "typescript",
+ "lineEnd": 65,
+ "lineStart": 1,
+ "name": "sample-command.ts",
+ },
+ {
+ "container": undefined,
+ "kind": "interface",
+ "language": "typescript",
+ "lineEnd": 18,
+ "lineStart": 14,
+ "name": "CheckResult",
+ "packageScope": undefined,
+ },
+ {
+ "container": undefined,
+ "kind": "function",
+ "language": "typescript",
+ "lineEnd": 30,
+ "lineStart": 24,
+ "name": "runChecks",
+ "packageScope": undefined,
+ },
+ {
+ "container": undefined,
+ "kind": "function",
+ "language": "typescript",
+ "lineEnd": 40,
+ "lineStart": 32,
+ "name": "runOne",
+ "packageScope": undefined,
+ },
+ {
+ "container": undefined,
+ "kind": "function",
+ "language": "typescript",
+ "lineEnd": 46,
+ "lineStart": 42,
+ "name": "statusOf",
+ "packageScope": undefined,
+ },
+ {
+ "container": undefined,
+ "kind": "class",
+ "language": "typescript",
+ "lineEnd": 62,
+ "lineStart": 48,
+ "name": "CheckRunner",
+ "packageScope": undefined,
+ },
+ {
+ "container": "CheckRunner",
+ "kind": "method",
+ "language": "typescript",
+ "lineEnd": 53,
+ "lineStart": 51,
+ "name": "constructor",
+ "packageScope": undefined,
+ },
+ {
+ "container": "CheckRunner",
+ "kind": "method",
+ "language": "typescript",
+ "lineEnd": 57,
+ "lineStart": 55,
+ "name": "load",
+ "packageScope": undefined,
+ },
+ {
+ "container": "CheckRunner",
+ "kind": "method",
+ "language": "typescript",
+ "lineEnd": 61,
+ "lineStart": 59,
+ "name": "describe",
+ "packageScope": undefined,
+ },
+ {
+ "kind": "module",
+ "language": "typescript",
+ "lineEnd": 11,
+ "lineStart": 11,
+ "name": "node:fs",
+ },
+ {
+ "kind": "module",
+ "language": "typescript",
+ "lineEnd": 12,
+ "lineStart": 12,
+ "name": "node:path",
+ },
+ ],
+ "exportPublicNames": undefined,
+ "filePath": "core-ingestion/test-fixtures/typescript/sample-command.ts",
+ "fileRole": {
+ "role": "fixture",
+ "role_confidence": 0.6,
+ "role_signals": [
+ "filename:sample",
+ ],
+ },
+ "importAliases": undefined,
+ "importBindings": [
+ {
+ "imported": "readFileSync",
+ "local": "readFileSync",
+ "pkg": "node:fs",
+ },
+ {
+ "imported": "default",
+ "local": "path",
+ "pkg": "node:path",
+ },
+ ],
+ "language": "typescript",
+ "relationships": [
+ {
+ "dstName": "CheckResult",
+ "predicate": "CONTAINS",
+ "srcName": "sample-command.ts",
+ },
+ {
+ "dstName": "runChecks",
+ "predicate": "CONTAINS",
+ "srcName": "sample-command.ts",
+ },
+ {
+ "dstName": "runOne",
+ "predicate": "CONTAINS",
+ "srcName": "sample-command.ts",
+ },
+ {
+ "dstName": "statusOf",
+ "predicate": "CONTAINS",
+ "srcName": "sample-command.ts",
+ },
+ {
+ "dstName": "CheckRunner",
+ "predicate": "CONTAINS",
+ "srcName": "sample-command.ts",
+ },
+ {
+ "dstName": "constructor",
+ "predicate": "CONTAINS",
+ "srcName": "CheckRunner",
+ },
+ {
+ "dstName": "load",
+ "predicate": "CONTAINS",
+ "srcName": "CheckRunner",
+ },
+ {
+ "dstName": "describe",
+ "predicate": "CONTAINS",
+ "srcName": "CheckRunner",
+ },
+ {
+ "dstName": "node:fs",
+ "importRaw": "node:fs",
+ "predicate": "IMPORTS",
+ "srcName": "sample-command.ts",
+ },
+ {
+ "dstName": "node:path",
+ "importRaw": "node:path",
+ "predicate": "IMPORTS",
+ "srcName": "sample-command.ts",
},
{
"dstName": "push",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "runChecks",
},
{
- "dstName": "every",
+ "dstName": "runOne",
+ "predicate": "CALLS",
+ "srcName": "runChecks",
+ },
+ {
+ "dstName": "join",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "runOne",
},
{
- "dstName": "stringify",
+ "dstName": "readFileSync",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "runOne",
},
{
- "dstName": "renderSection",
+ "dstName": "CheckStatus",
+ "predicate": "REFERENCES",
+ "srcName": "statusOf",
+ },
+ {
+ "dstName": "every",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "statusOf",
},
{
- "dstName": "green",
+ "dstName": "some",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "statusOf",
},
{
- "dstName": "red",
+ "dstName": "loader",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "CheckRunner.load",
},
{
- "dstName": "dim",
+ "dstName": "CheckRunner.loader",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "CheckRunner.load",
},
{
- "dstName": "renderSuccess",
+ "dstName": "statusOf",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "CheckRunner.describe",
},
{
- "dstName": "renderError",
+ "dstName": "runChecks",
"predicate": "CALLS",
- "srcName": "registerDoctorCommand",
+ "srcName": "sample-command.ts",
},
],
}
diff --git a/core-ingestion/src/__tests__/parseFile.test.ts b/core-ingestion/src/__tests__/parseFile.test.ts
index f0dd3c9c..1aad5566 100644
--- a/core-ingestion/src/__tests__/parseFile.test.ts
+++ b/core-ingestion/src/__tests__/parseFile.test.ts
@@ -19,17 +19,27 @@ function snapshotParse(relativePath: string) {
expect(result).toMatchSnapshot();
}
+// Every file snapshotted here is a frozen fixture, deliberately.
+//
+// These three used to read live paths: two from `memory-layer/`, which #120
+// extracted to a separate private repo in April 2026 (so they threw ENOENT for
+// everyone from then on), and one from ix-cli/src/cli/commands/doctor.ts, a
+// source file under active development whose every edit broke the snapshot.
+// A snapshot test needs an input that only changes when someone means to
+// change it. See #557.
+const SCALA_FIXTURES = 'core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample';
+
describe('parseFile snapshots', () => {
it('snapshots Node.scala', () => {
- snapshotParse('memory-layer/src/main/scala/ix/memory/model/Node.scala');
+ snapshotParse(`${SCALA_FIXTURES}/model/Node.scala`);
});
it('snapshots Identifiers.scala', () => {
- snapshotParse('memory-layer/src/main/scala/ix/memory/model/Identifiers.scala');
+ snapshotParse(`${SCALA_FIXTURES}/model/Identifiers.scala`);
});
- it('snapshots doctor.ts', () => {
- snapshotParse('ix-cli/src/cli/commands/doctor.ts');
+ it('snapshots a TypeScript command module', () => {
+ snapshotParse('core-ingestion/test-fixtures/typescript/sample-command.ts');
});
});
diff --git a/core-ingestion/src/__tests__/queries.rust.test.ts b/core-ingestion/src/__tests__/queries.rust.test.ts
index 5447042c..b1117f87 100644
--- a/core-ingestion/src/__tests__/queries.rust.test.ts
+++ b/core-ingestion/src/__tests__/queries.rust.test.ts
@@ -101,9 +101,13 @@ fn run(s: impl Sink) {
);
expect(result).not.toBeNull();
- // Parameters are not inside a struct/class range, so the src falls back to the file name.
+ // Attributed to the enclosing function, not the file. The parser falls back
+ // to the file name only at file scope -- queries.go.test.ts asserts the same
+ // rule for Go type references inside `use()`. This expectation used to read
+ // `impl_trait.rs`, describing an older file-level fallback, and went stale
+ // unnoticed because nothing ran this suite (#557).
expect(result!.relationships).toContainEqual({
- srcName: 'impl_trait.rs',
+ srcName: 'run',
dstName: 'Sink',
predicate: 'REFERENCES',
});
diff --git a/core-ingestion/src/__tests__/queries.scala.test.ts b/core-ingestion/src/__tests__/queries.scala.test.ts
index 728b2b99..58d3abaf 100644
--- a/core-ingestion/src/__tests__/queries.scala.test.ts
+++ b/core-ingestion/src/__tests__/queries.scala.test.ts
@@ -22,8 +22,11 @@ describe('Scala queries', () => {
expect(result!.entities.map(entity => entity.name)).toContain('bar');
expect(result!.entities.map(entity => entity.name)).toContain('baz');
expect(result!.entities.map(entity => entity.name)).not.toContain('local');
+ // Attributed to the val that holds the reference, not its enclosing class --
+ // matching the `Foo.baz` CALLS expectation directly below, which this one
+ // used to contradict by expecting the coarser `Foo` (#557).
expect(result!.relationships).toContainEqual({
- srcName: 'Foo',
+ srcName: 'Foo.baz',
dstName: 'NodeKind',
predicate: 'REFERENCES',
});
diff --git a/core-ingestion/src/__tests__/resolveEdges.integration.test.ts b/core-ingestion/src/__tests__/resolveEdges.integration.test.ts
index f4f30fab..a0e1b579 100644
--- a/core-ingestion/src/__tests__/resolveEdges.integration.test.ts
+++ b/core-ingestion/src/__tests__/resolveEdges.integration.test.ts
@@ -6,7 +6,11 @@ import { describe, expect, it } from 'vitest';
import { parseFile, resolveEdges } from '../index.js';
const repoRoot = path.resolve(import.meta.dirname, '../../..');
-const scalaRoot = path.join(repoRoot, 'memory-layer/src/main/scala');
+// Frozen in-repo fixtures. This walked `memory-layer/` until #557 -- a
+// directory #120 extracted to a separate private repo in April 2026, so the
+// test threw ENOENT on every checkout from then on. The backend is not public,
+// so the fixtures are synthetic rather than a copy of it.
+const scalaRoot = path.join(repoRoot, 'core-ingestion/test-fixtures/scala-repo/src/main/scala');
function walkScalaFiles(dir: string): string[] {
return readdirSync(dir, { withFileTypes: true }).flatMap(entry => {
diff --git a/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/api/GraphQueryApi.scala b/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/api/GraphQueryApi.scala
new file mode 100644
index 00000000..cf8221ff
--- /dev/null
+++ b/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/api/GraphQueryApi.scala
@@ -0,0 +1,17 @@
+// Frozen fixture — see Node.scala. The cross-file half of the resolveEdges
+// integration test: this file must REFERENCE NodeKind from another package so
+// resolution has to reach Node.scala to satisfy it.
+package ix.sample.api
+
+import ix.sample.model.{Node, NodeKind}
+
+class GraphQueryApi {
+ def kindOf(node: Node): NodeKind = node.kind
+
+ def isFile(node: Node): Boolean = node.kind match {
+ case NodeKind.File => true
+ case _ => false
+ }
+
+ def defaultKind: NodeKind = NodeKind.Module
+}
diff --git a/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Identifiers.scala b/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Identifiers.scala
new file mode 100644
index 00000000..126575c8
--- /dev/null
+++ b/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Identifiers.scala
@@ -0,0 +1,15 @@
+// Frozen fixture — see Node.scala. Exercises value classes and a companion
+// object of plain helper defs.
+package ix.sample.model
+
+final case class WorkspaceId(value: String) extends AnyVal
+
+final case class NodeId(value: String) extends AnyVal
+
+object Identifiers {
+ def nodeId(raw: String): NodeId = NodeId(raw.trim)
+
+ def workspaceId(raw: String): WorkspaceId = WorkspaceId(raw.trim)
+
+ def isBlank(raw: String): Boolean = raw.trim.isEmpty
+}
diff --git a/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Node.scala b/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Node.scala
new file mode 100644
index 00000000..86fd849c
--- /dev/null
+++ b/core-ingestion/test-fixtures/scala-repo/src/main/scala/ix/sample/model/Node.scala
@@ -0,0 +1,31 @@
+// Frozen fixture. Synthetic, not a copy of any backend source: this repo is
+// public and the Scala backend it used to vendor is not, which is why these
+// tests could not simply be repointed at the sibling repo (#557).
+//
+// Shape matters more than content — the parser features under test are a
+// package clause, an import, a sealed trait with case objects extending it,
+// a case class with typed fields, and a companion object.
+package ix.sample.model
+
+import java.time.Instant
+
+sealed trait NodeKind
+
+object NodeKind {
+ case object Module extends NodeKind
+ case object File extends NodeKind
+ case object Class extends NodeKind
+ case object Function extends NodeKind
+}
+
+final case class Node(
+ id: String,
+ kind: NodeKind,
+ name: String,
+ createdAt: Instant,
+)
+
+object Node {
+ def module(id: String, name: String, createdAt: Instant): Node =
+ Node(id, NodeKind.Module, name, createdAt)
+}
diff --git a/core-ingestion/test-fixtures/typescript/sample-command.ts b/core-ingestion/test-fixtures/typescript/sample-command.ts
new file mode 100644
index 00000000..f8e2289c
--- /dev/null
+++ b/core-ingestion/test-fixtures/typescript/sample-command.ts
@@ -0,0 +1,64 @@
+// Frozen fixture for the TypeScript parse snapshot.
+//
+// This replaces a snapshot of ix-cli/src/cli/commands/doctor.ts — a live source
+// file under active development, so every unrelated edit to it broke the
+// snapshot (#557). The point of the test is parser coverage over realistic
+// TypeScript, which does not require the file to be one anybody ships.
+//
+// Constructs deliberately present: imports, an exported interface, a type
+// alias, a union, an exported async function, a class with a constructor and
+// methods, generics, and a default-exported arrow function.
+import { readFileSync } from "node:fs";
+import path from "node:path";
+
+export interface CheckResult {
+ name: string;
+ ok: boolean;
+ detail?: string;
+}
+
+export type CheckStatus = "pass" | "warn" | "fail";
+
+type Loader<T> = (source: string) => T;
+
+export async function runChecks(root: string): Promise<CheckResult[]> {
+ const results: CheckResult[] = [];
+ for (const name of ["config", "graph", "schema"]) {
+ results.push(await runOne(root, name));
+ }
+ return results;
+}
+
+async function runOne(root: string, name: string): Promise<CheckResult> {
+ const target = path.join(root, `${name}.json`);
+ try {
+ const raw = readFileSync(target, "utf8");
+ return { name, ok: raw.length > 0 };
+ } catch (err: unknown) {
+ return { name, ok: false, detail: String(err) };
+ }
+}
+
+export function statusOf(results: CheckResult[]): CheckStatus {
+ if (results.every((r) => r.ok)) return "pass";
+ if (results.some((r) => r.ok)) return "warn";
+ return "fail";
+}
+
+export class CheckRunner<T> {
+ private readonly loader: Loader<T>;
+
+ constructor(loader: Loader<T>) {
+ this.loader = loader;
+ }
+
+ load(source: string): T {
+ return this.loader(source);
+ }
+
+ describe(results: CheckResult[]): string {
+ return `${statusOf(results)}: ${results.length} checks`;
+ }
+}
+
+export default (root: string) => runChecks(root);