{
  "definitions": [
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "tools/rules/reference.rule.ts",
          "name": "rootsOf",
          "source": {
            "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-reference-rule-ts",
            "json": "https://banes-lab.com/json/source/coordination/tools/rules/reference.rule.ts",
            "label": "tools/rules/reference.rule.ts",
            "markdown": "https://banes-lab.com/source/coordination/tools/rules/reference.rule.ts.md",
            "ref": "anatomy:file-coordination-tools-rules-reference-rule-ts"
          }
        },
        {
          "file": "tools/rules/reference.rule.ts",
          "name": "rootsOf",
          "source": {
            "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-reference-rule-ts",
            "json": "https://banes-lab.com/json/source/coordination/tools/rules/reference.rule.ts",
            "label": "tools/rules/reference.rule.ts",
            "markdown": "https://banes-lab.com/source/coordination/tools/rules/reference.rule.ts.md",
            "ref": "anatomy:file-coordination-tools-rules-reference-rule-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 16,
      "name": "directoriesIn",
      "signature": "const directoriesIn = function directoriesIn(root: string): string[] {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "tools/rules/reference.rule.ts",
          "name": "check",
          "source": {
            "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-reference-rule-ts",
            "json": "https://banes-lab.com/json/source/coordination/tools/rules/reference.rule.ts",
            "label": "tools/rules/reference.rule.ts",
            "markdown": "https://banes-lab.com/source/coordination/tools/rules/reference.rule.ts.md",
            "ref": "anatomy:file-coordination-tools-rules-reference-rule-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 80,
      "name": "recordEdge",
      "signature": "const recordEdge = function recordEdge(edges: Map<string, Set<string>>, from: string, to: string): void {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "config/surface.config.ts",
          "name": "surfaceRoot",
          "source": {
            "href": "https://banes-lab.com/anatomy/coordination#file-coordination-config-surface-config-ts",
            "json": "https://banes-lab.com/json/source/coordination/config/surface.config.ts",
            "label": "config/surface.config.ts",
            "markdown": "https://banes-lab.com/source/coordination/config/surface.config.ts.md",
            "ref": "anatomy:file-coordination-config-surface-config-ts"
          }
        },
        {
          "file": "tools/rules/reference.rule.ts",
          "name": "directoriesIn",
          "source": {
            "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-reference-rule-ts",
            "json": "https://banes-lab.com/json/source/coordination/tools/rules/reference.rule.ts",
            "label": "tools/rules/reference.rule.ts",
            "markdown": "https://banes-lab.com/source/coordination/tools/rules/reference.rule.ts.md",
            "ref": "anatomy:file-coordination-tools-rules-reference-rule-ts"
          }
        },
        {
          "file": "tools/rules/reference.rule.ts",
          "name": "directoriesIn",
          "source": {
            "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-reference-rule-ts",
            "json": "https://banes-lab.com/json/source/coordination/tools/rules/reference.rule.ts",
            "label": "tools/rules/reference.rule.ts",
            "markdown": "https://banes-lab.com/source/coordination/tools/rules/reference.rule.ts.md",
            "ref": "anatomy:file-coordination-tools-rules-reference-rule-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 22,
      "name": "rootsOf",
      "signature": "const rootsOf = function rootsOf(repoRoot: string, taxonomy: TaxonomyData): ReadonlySet<string> {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "tools/rules/reference.rule.ts",
          "name": "recordEdge",
          "source": {
            "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-reference-rule-ts",
            "json": "https://banes-lab.com/json/source/coordination/tools/rules/reference.rule.ts",
            "label": "tools/rules/reference.rule.ts",
            "markdown": "https://banes-lab.com/source/coordination/tools/rules/reference.rule.ts.md",
            "ref": "anatomy:file-coordination-tools-rules-reference-rule-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "method_definition",
      "line": 145,
      "name": "check",
      "signature": "check(context: RuleContext): RuleResult {"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 32,
      "name": "namesInTree",
      "signature": "const namesInTree = function namesInTree(target: string, roots: ReadonlySet<string>, candidates: number): boolean {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 37,
      "name": "slash",
      "signature": "const slash = target.indexOf(\"/\");"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 41,
      "name": "resolvesAgainstAncestor",
      "signature": "const resolvesAgainstAncestor = function resolvesAgainstAncestor("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 46,
      "name": "directory",
      "signature": "let directory = dirname(path);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 53,
      "name": "cut",
      "signature": "const cut = directory.lastIndexOf(\"/\");"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 63,
      "name": "settledTarget",
      "signature": "const settledTarget = function settledTarget("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 75,
      "name": "prefix",
      "signature": "const prefix = surfacePrefix();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 76,
      "name": "prefixed",
      "signature": "const prefixed = prefix.length === 0 ? target : `${prefix}/${target}`;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 88,
      "name": "cited",
      "signature": "const cited = edges.get(from) ?? new Set<string>();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "interface_declaration",
      "line": 93,
      "name": "ResolveScope",
      "signature": "interface ResolveScope {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "interface_declaration",
      "line": 100,
      "name": "ReferenceOutcome",
      "signature": "interface ReferenceOutcome {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 105,
      "name": "NO_OUTCOME",
      "signature": "const NO_OUTCOME: ReferenceOutcome = { edge: null, finding: null };"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 107,
      "name": "referenceOutcome",
      "signature": "const referenceOutcome = function referenceOutcome("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 112,
      "name": "settled",
      "signature": "const settled = settledTarget(scope.context, reference.target, scope.existing);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 117,
      "name": "candidates",
      "signature": "const candidates = scope.byBasename.get(basename(reference.target)) ?? [];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 118,
      "name": "ignored",
      "signature": "const ignored ="
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 124,
      "name": "groupByBasename",
      "signature": "const groupByBasename = function groupByBasename(paths: readonly string[]): Map<string, string[]> {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 125,
      "name": "byBasename",
      "signature": "const byBasename = new Map<string, string[]>();"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 132,
      "name": "reachableOf",
      "signature": "const reachableOf = function reachableOf(context: RuleContext): string[] {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 133,
      "name": "axes",
      "signature": "const axes = AXIS_DOCUMENTS.filter("
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 136,
      "name": "board",
      "signature": "const board = existsSync(resolve(context.repoRoot, BOARD_PATH)) ? [BOARD_PATH] : [];"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 140,
      "name": "byName",
      "signature": "const byName = function byName(left: string, right: string): number {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 144,
      "name": "rule",
      "signature": "export const rule: RuleDeclaration = {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 146,
      "name": "scope",
      "signature": "const scope: ResolveScope = {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 153,
      "name": "reachable",
      "signature": "const reachable = reachableOf(context);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 154,
      "name": "owned",
      "signature": "const owned = reachable.filter((path) => !UPSTREAM_ROOTS.some((root) => path.startsWith(root)));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 155,
      "name": "skippedAsImmutableContent",
      "signature": "const skippedAsImmutableContent = owned.filter((path) => contentIsImmutable(path));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 156,
      "name": "walked",
      "signature": "const walked = owned.filter((path) => !contentIsImmutable(path));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 157,
      "name": "reached",
      "signature": "const reached = reachable.filter((path) => !skippedAsImmutableContent.includes(path));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 159,
      "name": "outcomes",
      "signature": "const outcomes = walked.flatMap((path) =>"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 165,
      "name": "edges",
      "signature": "const edges = new Map<string, Set<string>>();"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 172,
      "name": "cycles",
      "signature": "const cycles = cyclesIn(edges);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 173,
      "name": "findings",
      "signature": "const findings = ["
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-reference-rule-ts",
  "language": "typescript",
  "layer": "domain",
  "name": "reference.rule.ts",
  "path": "tools/rules/reference.rule.ts",
  "ref": "anatomy:file-coordination-tools-rules-reference-rule-ts",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/coordination#folder-coordination-tools-rules",
          "json": "https://banes-lab.com/json/anatomy/coordination/folder-coordination-tools-rules",
          "label": "tools/rules",
          "markdown": "https://banes-lab.com/anatomy/coordination/folder-coordination-tools-rules.md",
          "ref": "chapter:/anatomy/coordination#folder-coordination-tools-rules"
        }
      ],
      "relation": "contained-in"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/coordination#file-coordination-config-surface-config-ts",
          "json": "https://banes-lab.com/json/source/coordination/config/surface.config.ts",
          "label": "config/surface.config.ts",
          "markdown": "https://banes-lab.com/source/coordination/config/surface.config.ts.md",
          "ref": "anatomy:file-coordination-config-surface-config-ts"
        }
      ],
      "relation": "uses"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/coordination#folder-coordination-config",
          "json": "https://banes-lab.com/json/anatomy/coordination/folder-coordination-config",
          "label": "config",
          "markdown": "https://banes-lab.com/anatomy/coordination/folder-coordination-config.md",
          "ref": "chapter:/anatomy/coordination#folder-coordination-config"
        },
        {
          "href": "https://banes-lab.com/anatomy/coordination#folder-coordination-tools-rules",
          "json": "https://banes-lab.com/json/anatomy/coordination/folder-coordination-tools-rules",
          "label": "tools/rules",
          "markdown": "https://banes-lab.com/anatomy/coordination/folder-coordination-tools-rules.md",
          "ref": "chapter:/anatomy/coordination#folder-coordination-tools-rules"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "slots": {
    "concern": "rule",
    "subject": "reference",
    "variant": null
  },
  "stats": {
    "bytes": 7521,
    "callable": 11,
    "definitions": 37,
    "edges": 4,
    "exported": 12,
    "files": 1,
    "findings": {},
    "flows": {
      "leaf": 2,
      "entry": 2,
      "isolated": 33
    },
    "lines": {
      "blank": 28,
      "code": 174,
      "total": 202
    }
  },
  "summary": "174 lines of code and 37 definitions.",
  "text": "https://banes-lab.com/source/coordination/tools/rules/reference.rule.ts.txt",
  "tree": "coordination",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-role-rule-ts",
      "json": "https://banes-lab.com/json/source/coordination/tools/rules/role.rule.ts",
      "label": "tools/rules/role.rule.ts",
      "markdown": "https://banes-lab.com/source/coordination/tools/rules/role.rule.ts.md",
      "ref": "anatomy:file-coordination-tools-rules-role-rule-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/coordination#file-coordination-tools-rules-record-rule-ts",
      "json": "https://banes-lab.com/json/source/coordination/tools/rules/record.rule.ts",
      "label": "tools/rules/record.rule.ts",
      "markdown": "https://banes-lab.com/source/coordination/tools/rules/record.rule.ts.md",
      "ref": "anatomy:file-coordination-tools-rules-record-rule-ts"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/source/coordination/tools/rules",
    "label": "tools/rules",
    "markdown": "https://banes-lab.com/api/source/coordination/tools/rules.md",
    "ref": "api:source/coordination/tools/rules"
  }
}
