{
  "definitions": [
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 3,
      "name": "VISITING",
      "signature": "const VISITING = 0;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 4,
      "name": "DONE",
      "signature": "const DONE = 1;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 5,
      "name": "CYCLE_KEY_SEPARATOR",
      "signature": "const CYCLE_KEY_SEPARATOR = \"|\";"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 7,
      "name": "NAME_EDGE_FIELDS",
      "signature": "const NAME_EDGE_FIELDS: readonly NodeEdgeField[] = ["
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "class_declaration",
      "line": 13,
      "name": "CycleDetector",
      "signature": "class CycleDetector {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 14,
      "name": "cycles",
      "signature": "public readonly cycles: string[][] = [];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 15,
      "name": "state",
      "signature": "private readonly state = new Map<string, number>();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 16,
      "name": "stack",
      "signature": "private readonly stack: string[] = [];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "public_field_definition",
      "line": 17,
      "name": "seenCycle",
      "signature": "private readonly seenCycle = new Set<string>();"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 20,
      "name": "constructor",
      "signature": "public constructor(byName: Readonly<Record<string, DocNode>>) {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 24,
      "name": "visit",
      "signature": "public visit(name: string): void {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 25,
      "name": "mark",
      "signature": "const mark = this.state.get(name);"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "method_definition",
      "line": 44,
      "name": "recordCycle",
      "signature": "private recordCycle(name: string): void {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 45,
      "name": "cycle",
      "signature": "const cycle = this.stack.slice(this.stack.indexOf(name));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 46,
      "name": "key",
      "signature": "const key = cycle.toSorted((left, right) => left.localeCompare(right)).join(CYCLE_KEY_SEPARATOR);"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 54,
      "name": "resolveNodeEdges",
      "signature": "const resolveNodeEdges = function resolveNodeEdges("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 58,
      "name": "dead",
      "signature": "const dead = NAME_EDGE_FIELDS.flatMap(({ key, field }) =>"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 63,
      "name": "superseded",
      "signature": "const superseded = node.supersedes.filter((target) => Object.hasOwn(byName, target));"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 67,
      "name": "indexNodes",
      "signature": "const indexNodes = function indexNodes(nodes: readonly DocNode[]): {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 71,
      "name": "byName",
      "signature": "const byName: Record<string, DocNode> = {};"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 72,
      "name": "duplicates",
      "signature": "const duplicates = new Set<string>();"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 83,
      "name": "buildDocGraph",
      "signature": "export const buildDocGraph = function buildDocGraph(nodes: DocNode[]): DocGraph {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 84,
      "name": "{ byName, duplicateNames }",
      "signature": "const { byName, duplicateNames } = indexNodes(nodes);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 85,
      "name": "edges",
      "signature": "const edges = nodes.map((node) => resolveNodeEdges(node, byName));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 86,
      "name": "detector",
      "signature": "const detector = new CycleDetector(byName);"
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/docs#file-docs-core-analyzers-graph-analyzer-ts",
  "language": "typescript",
  "layer": "processing",
  "name": "graph.analyzer.ts",
  "path": "core/analyzers/graph.analyzer.ts",
  "ref": "anatomy:file-docs-core-analyzers-graph-analyzer-ts",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/docs#folder-docs-core-analyzers",
          "json": "https://banes-lab.com/json/anatomy/docs/folder-docs-core-analyzers",
          "label": "core/analyzers",
          "markdown": "https://banes-lab.com/anatomy/docs/folder-docs-core-analyzers.md",
          "ref": "chapter:/anatomy/docs#folder-docs-core-analyzers"
        }
      ],
      "relation": "contained-in"
    }
  ],
  "slots": {
    "concern": "analyzer",
    "subject": "graph",
    "variant": null
  },
  "stats": {
    "bytes": 3209,
    "callable": 6,
    "definitions": 25,
    "edges": 0,
    "exported": 4,
    "files": 1,
    "findings": {},
    "flows": {
      "isolated": 25
    },
    "lines": {
      "blank": 9,
      "code": 89,
      "total": 98
    }
  },
  "summary": "89 lines of code and 25 definitions.",
  "text": "https://banes-lab.com/source/docs/core/analyzers/graph.analyzer.ts.txt",
  "tree": "docs",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/docs#file-docs-core-analyzers-invocation-analyzer-ts",
      "json": "https://banes-lab.com/json/source/docs/core/analyzers/invocation.analyzer.ts",
      "label": "core/analyzers/invocation.analyzer.ts",
      "markdown": "https://banes-lab.com/source/docs/core/analyzers/invocation.analyzer.ts.md",
      "ref": "anatomy:file-docs-core-analyzers-invocation-analyzer-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/docs#file-docs-core-analyzers-drift-analyzer-ts",
      "json": "https://banes-lab.com/json/source/docs/core/analyzers/drift.analyzer.ts",
      "label": "core/analyzers/drift.analyzer.ts",
      "markdown": "https://banes-lab.com/source/docs/core/analyzers/drift.analyzer.ts.md",
      "ref": "anatomy:file-docs-core-analyzers-drift-analyzer-ts"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/source/docs/core/analyzers",
    "label": "core/analyzers",
    "markdown": "https://banes-lab.com/api/source/docs/core/analyzers.md",
    "ref": "api:source/docs/core/analyzers"
  }
}
