{
  "definitions": [
    {
      "callable": true,
      "callees": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "holdsRole",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "callers": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "assignRoles",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        },
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "roleAtDepth",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "exported": false,
      "flow": "relay",
      "kind": "lexical_declaration",
      "line": 23,
      "name": "ranksAtDepth",
      "signature": "const ranksAtDepth = function ranksAtDepth(root: string, name: string, depth: number, after: number): number[] {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "shared/manifests/taxonomy.manifest.ts",
          "name": "isConcernFolder",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-manifests-taxonomy-manifest-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/manifests/taxonomy.manifest.ts",
            "label": "shared/manifests/taxonomy.manifest.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/manifests/taxonomy.manifest.ts.md",
            "ref": "anatomy:file-governance-shared-manifests-taxonomy-manifest-ts"
          }
        },
        {
          "file": "shared/manifests/taxonomy.manifest.ts",
          "name": "isDeclaredContainer",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-manifests-taxonomy-manifest-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/manifests/taxonomy.manifest.ts",
            "label": "shared/manifests/taxonomy.manifest.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/manifests/taxonomy.manifest.ts.md",
            "ref": "anatomy:file-governance-shared-manifests-taxonomy-manifest-ts"
          }
        },
        {
          "file": "shared/manifests/taxonomy.manifest.ts",
          "name": "isLegalSubject",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-manifests-taxonomy-manifest-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/manifests/taxonomy.manifest.ts",
            "label": "shared/manifests/taxonomy.manifest.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/manifests/taxonomy.manifest.ts.md",
            "ref": "anatomy:file-governance-shared-manifests-taxonomy-manifest-ts"
          }
        },
        {
          "file": "shared/manifests/taxonomy.manifest.ts",
          "name": "isMarkerFolder",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-manifests-taxonomy-manifest-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/manifests/taxonomy.manifest.ts",
            "label": "shared/manifests/taxonomy.manifest.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/manifests/taxonomy.manifest.ts.md",
            "ref": "anatomy:file-governance-shared-manifests-taxonomy-manifest-ts"
          }
        }
      ],
      "callers": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "ranksAtDepth",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "exported": false,
      "flow": "relay",
      "kind": "lexical_declaration",
      "line": 10,
      "name": "holdsRole",
      "signature": "const holdsRole = function holdsRole(root: string, name: string, role: string): boolean {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "ranksAtDepth",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        },
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "terminalRankOf",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "callers": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "folderPathError",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "exported": false,
      "flow": "relay",
      "kind": "lexical_declaration",
      "line": 44,
      "name": "assignRoles",
      "signature": "const assignRoles = function assignRoles("
    },
    {
      "callable": true,
      "callees": [],
      "callers": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "assignRoles",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "exported": false,
      "flow": "leaf",
      "kind": "lexical_declaration",
      "line": 39,
      "name": "terminalRankOf",
      "signature": "const terminalRankOf = function terminalRankOf(root: string): number {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "ranksAtDepth",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 35,
      "name": "roleAtDepth",
      "signature": "export const roleAtDepth = function roleAtDepth(root: string, name: string, depth: number, after: number): number {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "shared/manifests/taxonomy.manifest.ts",
          "name": "vocabularyFor",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-manifests-taxonomy-manifest-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/manifests/taxonomy.manifest.ts",
            "label": "shared/manifests/taxonomy.manifest.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/manifests/taxonomy.manifest.ts.md",
            "ref": "anatomy:file-governance-shared-manifests-taxonomy-manifest-ts"
          }
        }
      ],
      "callers": [],
      "exported": false,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 75,
      "name": "labelError",
      "signature": "const labelError = function labelError(root: string, segments: readonly string[]): string | undefined {"
    },
    {
      "callable": true,
      "callees": [
        {
          "file": "shared/matchers/folder.matcher.ts",
          "name": "assignRoles",
          "source": {
            "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
            "json": "https://banes-lab.com/json/source/governance/shared/matchers/folder.matcher.ts",
            "label": "shared/matchers/folder.matcher.ts",
            "markdown": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.md",
            "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts"
          }
        }
      ],
      "callers": [],
      "exported": true,
      "flow": "entry",
      "kind": "lexical_declaration",
      "line": 87,
      "name": "folderPathError",
      "signature": "export const folderPathError = function folderPathError(root: string, segments: readonly string[]): string | undefined {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 24,
      "name": "{ roleOrder, rolesAtDepth }",
      "signature": "const { roleOrder, rolesAtDepth } = vocabularyFor(root).roles;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 25,
      "name": "ranks",
      "signature": "const ranks: number[] = [];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 40,
      "name": "{ roleOrder, terminalRole }",
      "signature": "const { roleOrder, terminalRole } = vocabularyFor(root).roles;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 50,
      "name": "name",
      "signature": "const name = segments[index];"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 55,
      "name": "rest",
      "signature": "const rest = assignRoles(root, segments, index + 1, rank);"
    },
    {
      "callable": true,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 63,
      "name": "deepestRank",
      "signature": "const deepestRank = function deepestRank(root: string, segments: readonly string[]): { at: number; after: number } {"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 64,
      "name": "after",
      "signature": "let after = -1;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 66,
      "name": "rank",
      "signature": "const rank = roleAtDepth(root, name, index + 1, after);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 76,
      "name": "unkebab",
      "signature": "const unkebab = segments.find((name) => !isKebab(name, root));"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": false,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 80,
      "name": "repeated",
      "signature": "const repeated = segments.find((name, index) => segments.indexOf(name) !== index);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 88,
      "name": "vocabulary",
      "signature": "const vocabulary = vocabularyFor(root);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 89,
      "name": "{ roleOrder, rolesAtDepth, terminalRole }",
      "signature": "const { roleOrder, rolesAtDepth, terminalRole } = vocabulary.roles;"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 93,
      "name": "label",
      "signature": "const label = labelError(root, segments);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 100,
      "name": "{ at, after }",
      "signature": "const { at, after } = deepestRank(root, segments);"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 102,
      "name": "allowed",
      "signature": "const allowed = (rolesAtDepth[at] ?? []).join(\" | \");"
    },
    {
      "callable": false,
      "callees": [],
      "callers": [],
      "exported": true,
      "flow": "isolated",
      "kind": "lexical_declaration",
      "line": 103,
      "name": "later",
      "signature": "const later = roleOrder.slice(after + 1).join(\" | \");"
    }
  ],
  "document": null,
  "findings": [],
  "generated": false,
  "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-folder-matcher-ts",
  "language": "typescript",
  "layer": "processing",
  "name": "folder.matcher.ts",
  "path": "shared/matchers/folder.matcher.ts",
  "ref": "anatomy:file-governance-shared-matchers-folder-matcher-ts",
  "relations": [
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/governance#folder-governance-shared-matchers",
          "json": "https://banes-lab.com/json/anatomy/governance/folder-governance-shared-matchers",
          "label": "shared/matchers",
          "markdown": "https://banes-lab.com/anatomy/governance/folder-governance-shared-matchers.md",
          "ref": "chapter:/anatomy/governance#folder-governance-shared-matchers"
        }
      ],
      "relation": "contained-in"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-manifests-taxonomy-manifest-ts",
          "json": "https://banes-lab.com/json/source/governance/shared/manifests/taxonomy.manifest.ts",
          "label": "shared/manifests/taxonomy.manifest.ts",
          "markdown": "https://banes-lab.com/source/governance/shared/manifests/taxonomy.manifest.ts.md",
          "ref": "anatomy:file-governance-shared-manifests-taxonomy-manifest-ts"
        }
      ],
      "relation": "uses"
    },
    {
      "links": [
        {
          "href": "https://banes-lab.com/anatomy/governance#folder-governance-shared-manifests",
          "json": "https://banes-lab.com/json/anatomy/governance/folder-governance-shared-manifests",
          "label": "shared/manifests",
          "markdown": "https://banes-lab.com/anatomy/governance/folder-governance-shared-manifests.md",
          "ref": "chapter:/anatomy/governance#folder-governance-shared-manifests"
        },
        {
          "href": "https://banes-lab.com/anatomy/governance#folder-governance-shared-matchers",
          "json": "https://banes-lab.com/json/anatomy/governance/folder-governance-shared-matchers",
          "label": "shared/matchers",
          "markdown": "https://banes-lab.com/anatomy/governance/folder-governance-shared-matchers.md",
          "ref": "chapter:/anatomy/governance#folder-governance-shared-matchers"
        }
      ],
      "relation": "linked-from"
    }
  ],
  "slots": {
    "concern": "matcher",
    "subject": "folder",
    "variant": null
  },
  "stats": {
    "bytes": 4325,
    "callable": 8,
    "definitions": 23,
    "edges": 10,
    "exported": 8,
    "files": 1,
    "findings": {},
    "flows": {
      "relay": 3,
      "leaf": 1,
      "entry": 3,
      "isolated": 16
    },
    "lines": {
      "blank": 8,
      "code": 99,
      "total": 107
    }
  },
  "summary": "99 lines of code and 23 definitions.",
  "text": "https://banes-lab.com/source/governance/shared/matchers/folder.matcher.ts.txt",
  "tree": "governance",
  "siblings": {
    "next": {
      "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-location-matcher-ts",
      "json": "https://banes-lab.com/json/source/governance/shared/matchers/location.matcher.ts",
      "label": "shared/matchers/location.matcher.ts",
      "markdown": "https://banes-lab.com/source/governance/shared/matchers/location.matcher.ts.md",
      "ref": "anatomy:file-governance-shared-matchers-location-matcher-ts"
    },
    "previous": {
      "href": "https://banes-lab.com/anatomy/governance#file-governance-shared-matchers-filename-matcher-ts",
      "json": "https://banes-lab.com/json/source/governance/shared/matchers/filename.matcher.ts",
      "label": "shared/matchers/filename.matcher.ts",
      "markdown": "https://banes-lab.com/source/governance/shared/matchers/filename.matcher.ts.md",
      "ref": "anatomy:file-governance-shared-matchers-filename-matcher-ts"
    }
  },
  "up": {
    "href": null,
    "json": "https://banes-lab.com/json/api/source/governance/shared/matchers",
    "label": "shared/matchers",
    "markdown": "https://banes-lab.com/api/source/governance/shared/matchers.md",
    "ref": "api:source/governance/shared/matchers"
  }
}
