shared/configs/taxonomy.config.ts
shared/configs/taxonomy.config.ts is a file in GovLab Extension Host. 610 lines of code and 19 definitions.
import { taxonomy as coordinationTaxonomy } from "coordination-surface/config/taxonomy.config.ts";
import { DOC_BOUNDARY_FILENAMES } from "@govlab/docs/configuration/constants/document.constants.ts";
import { relativePath } from "@ssot/paths";
export const LAYERS = [
"domain",
"application",
"processing",
"runtime",
"infrastructure",
"operations",
"product",
] as const;
export type Layer = (typeof LAYERS)[number];
export const HOST_BOUNDARY_DOCUMENTS: readonly string[] = [
"CLAUDE.md",
"CLAUDE.template.md",
"CODEBASE-CONVENTIONS.md",
"CODEBASE-TENSIONS.md",
];
export const taxonomy = {
excluded: {
trees: [
relativePath("docArch"),
relativePath("claude"),
relativePath("methodology"),
relativePath("thirdParty"),
],
},
ignored: {
foldersFiles: [
"index.ts",
"index.html",
"vite.config.ts",
"vitest.config.ts",
"package.json",
"package-lock.json",
"tsconfig.json",
"tsconfig.base.json",
"_manifest.json",
"paths.yaml",
"govlab.config.ts",
"favicon.ico",
".gitignore",
".git",
".certificates",
"node_modules",
"_builds",
"_tmp*",
"_excluded*",
],
},
boundaryDocuments: [...DOC_BOUNDARY_FILENAMES, ...HOST_BOUNDARY_DOCUMENTS],
concerns: [
{ folder: "actions", layer: "infrastructure", tag: "action" },
{ folder: "actuators", layer: "application", tag: "actuator" },
{ folder: "adapters", layer: "infrastructure", tag: "adapter" },
{ folder: "aggregators", layer: "processing", tag: "aggregator" },
{ folder: "allowlists", layer: "infrastructure", tag: "allowlist" },
{ folder: "analyzers", layer: "processing", tag: "analyzer" },
{ collection: "assets", folder: "assets", layer: "infrastructure", tag: "asset" },
{ folder: "behaviors", layer: "application", tag: "behavior" },
{ folder: "bounds", layer: "processing", tag: "bounds" },
{ folder: "buffers", layer: "domain", tag: "buffer" },
{ folder: "buses", layer: "infrastructure", tag: "bus" },
{ folder: "caches", layer: "infrastructure", tag: "cache" },
{ folder: "capabilities", layer: "application", tag: "capability" },
{ folder: "classifiers", layer: "application", tag: "classifier" },
{ folder: "comparators", layer: "processing", tag: "comparator" },
{ folder: "components", layer: "product", tag: "component" },
{ folder: "configs", layer: "infrastructure", tag: "config" },
{ folder: "constants", layer: "infrastructure", tag: "constants" },
{ folder: "context", layer: "application", tag: "context" },
{ folder: "converters", layer: "processing", tag: "converter" },
{ folder: "coordinators", layer: "application", tag: "coordinator" },
{ folder: "counters", layer: "operations", tag: "counter" },
{ folder: "data", layer: "domain", tag: "data" },
{ folder: "effects", layer: "product", tag: "effect" },
{ folder: "emitters", layer: "application", tag: "emitter" },
{ folder: "entrypoints", layer: "runtime", tag: "entrypoint" },
{ folder: "eslint", layer: "infrastructure", tag: "eslint" },
{ folder: "evaluators", layer: "runtime", tag: "evaluator" },
{ folder: "exclusions", layer: "infrastructure", tag: "exclusions" },
{ folder: "factories", layer: "infrastructure", tag: "factory" },
{ folder: "fonts", layer: "infrastructure", tag: "font" },
{ folder: "formatters", layer: "processing", tag: "formatter" },
{ folder: "guards", layer: "infrastructure", tag: "guard" },
{ folder: "heaps", layer: "runtime", tag: "heap" },
{ folder: "heuristics", layer: "application", tag: "heuristic" },
{ folder: "icons", layer: "infrastructure", tag: "icons" },
{ folder: "ids", layer: "infrastructure", tag: "ids" },
{ folder: "intents", layer: "application", tag: "intent" },
{ folder: "lexers", layer: "processing", tag: "lexer" },
{ folder: "lifecycle", layer: "runtime", tag: "lifecycle" },
{ folder: "listeners", layer: "application", tag: "listener" },
{ folder: "loaders", layer: "infrastructure", tag: "loader" },
{ folder: "manifests", layer: "infrastructure", tag: "manifest" },
{ folder: "matchers", layer: "processing", tag: "matcher" },
{ folder: "models", layer: "domain", tag: "model" },
{ folder: "normalizers", layer: "processing", tag: "normalizer" },
{ folder: "observers", layer: "application", tag: "observer" },
{ folder: "parsers", layer: "processing", tag: "parser" },
{ folder: "persistence", layer: "infrastructure", tag: "persistence" },
{ folder: "pipelines", layer: "processing", tag: "pipeline" },
{ folder: "plugins", layer: "infrastructure", tag: "plugin" },
{ folder: "policies", layer: "domain", tag: "policy" },
{ folder: "pools", layer: "runtime", tag: "pool" },
{ folder: "predicates", layer: "infrastructure", tag: "predicate" },
{ folder: "probes", layer: "operations", tag: "probe" },
{ folder: "producers", layer: "application", tag: "producer" },
{ folder: "records", layer: "domain", tag: "record" },
{ folder: "registries", layer: "infrastructure", tag: "registry" },
{ folder: "renderers", layer: "product", tag: "renderer" },
{ folder: "reporters", layer: "operations", tag: "reporter" },
{ folder: "resolvers", layer: "infrastructure", tag: "resolver" },
{ folder: "sanitizers", layer: "processing", tag: "sanitizer" },
{ folder: "schedulers", layer: "runtime", tag: "scheduler" },
{ folder: "schemas", layer: "infrastructure", tag: "schema" },
{ folder: "selectors", layer: "application", tag: "selector" },
{ folder: "shaders", layer: "product", tag: "shader" },
{ folder: "specifications", layer: "domain", tag: "specification" },
{ folder: "steps", layer: "application", tag: "step" },
{ folder: "stores", layer: "application", tag: "store" },
{ folder: "strings", layer: "product", tag: "strings" },
{ folder: "styles", layer: "product", tag: "style" },
{ folder: "stylelint", layer: "infrastructure", tag: "stylelint" },
{ folder: "throttling", layer: "operations", tag: "throttling" },
{ folder: "timers", layer: "runtime", tag: "timer" },
{ folder: "tokens", layer: "product", tag: "tokens" },
{ folder: "types", layer: "infrastructure", tag: "types" },
{ folder: "validators", layer: "processing", tag: "validator" },
{ folder: "views", layer: "product", tag: "view" },
{ folder: "visitors", layer: "processing", tag: "visitor" },
{ folder: "widgets", layer: "product", tag: "widget" },
],
configRule:
'"<root-path>": ["<container>", "<container>", ..], | The root-path defines where taxonomy will be enforced. No declaration = no enforcement. specialContainers is used for containers that are a flat bucket.',
containers: {
".govlab": ["shared", "rules", "codemods"],
"banes-lab.root/banes-lab.build.scripts": ["configuration", "core", "runtime"],
"banes-lab.root/banes-lab.content": ["configuration", "core", "runtime"],
"banes-lab.root/banes-lab.deploy": ["configuration", "core", "runtime"],
"banes-lab.root/banes-lab.public": ["static"],
"banes-lab.root/banes-lab.server": ["configuration", "runtime"],
"banes-lab.root/banes-lab.social-share": ["configuration", "core", "runtime", "cards"],
"banes-lab.root/banes-lab.web": ["configuration", "core", "domain", "presentation", "runtime"],
"govlab.root/govlab.constants": ["configuration", "core"],
"govlab.root/govlab.context": ["configuration", "core", "runtime"],
"govlab.root/govlab.docs": ["configuration", "core", "runtime"],
"govlab.root/govlab.patterns": ["configuration", "core", "runtime"],
"govlab.root/govlab.pipeline": ["configuration", "core", "runtime"],
"govlab.root/govlab.quality": ["configuration", "core", "runtime"],
"govlab.root/govlab.stats": ["configuration", "core", "runtime"],
"govlab.root/govlab.utils/argv": ["configuration", "core"],
"govlab.root/govlab.utils/canonical-write": ["configuration", "core"],
"govlab.root/govlab.utils/code-parse": ["configuration", "core", "runtime"],
"govlab.root/govlab.utils/content-fingerprint": ["configuration", "core"],
"project.paths": ["configuration", "core"],
"project.scripts": ["configuration", "core", "runtime"],
"project.secrets": ["configuration", "core"],
},
testMirrors: {
"codebase.testing/test.build": "banes-lab.root/banes-lab.build.scripts",
"codebase.testing/test.content": "banes-lab.root/banes-lab.content",
"codebase.testing/test.coordination": "banes-lab.root/banes-lab.coordination/tools",
"codebase.testing/test.deploy": "banes-lab.root/banes-lab.deploy",
"codebase.testing/test.govlab/argv": "govlab.root/govlab.utils/argv",
"codebase.testing/test.govlab/canonical-write": "govlab.root/govlab.utils/canonical-write",
"codebase.testing/test.govlab/code-parse": "govlab.root/govlab.utils/code-parse",
"codebase.testing/test.govlab/constants": "govlab.root/govlab.constants",
"codebase.testing/test.govlab/content-fingerprint": "govlab.root/govlab.utils/content-fingerprint",
"codebase.testing/test.govlab/context": "govlab.root/govlab.context",
"codebase.testing/test.govlab/docs": "govlab.root/govlab.docs",
"codebase.testing/test.govlab/patterns": "govlab.root/govlab.patterns",
"codebase.testing/test.govlab/pipeline": "govlab.root/govlab.pipeline",
"codebase.testing/test.govlab/quality": "govlab.root/govlab.quality",
"codebase.testing/test.govlab/stats": "govlab.root/govlab.stats",
"codebase.testing/test.paths": "project.paths",
"codebase.testing/test.rules": ".govlab",
"codebase.testing/test.scripts": "project.scripts",
"codebase.testing/test.secrets": "project.secrets",
"codebase.testing/test.server": "banes-lab.root/banes-lab.server",
"codebase.testing/test.social": "banes-lab.root/banes-lab.social-share",
"codebase.testing/test.web": "banes-lab.root/banes-lab.web",
},
grammar: {
case: "kebab",
compoundMarkers: ["test", "spec", "d", "generated", "barrel", "rule", "backup", "fixture"],
dialects: [],
fixtureMarkers: ["fixture"],
testMarkers: ["test", "spec"],
file: ["<subject>.<concern>.<ext>", "<subject>.<variant>.<concern>.<ext>"],
folder: { depthOne: ["<container>"], depthThree: ["<concern>"], depthTwo: ["<subject>", "<concern>"] },
generatedFolder: { marker: "generated", prefix: "_" },
markerFolders: { backup: "backups", generated: "generated" },
folderRule:
"depth counts folders from the governed root, container included, file excluded. roles resolve in the order container < subject < concern: each depth consumes a role strictly later than the depth before it, any role after the container may be skipped, and the file's parent always resolves to <concern>.",
maxDepthFromRoot: 3,
separator: ".",
splitters: [
{ joiner: ".", letters: "lower", name: "dot" },
{ joiner: ".", letters: "upper", name: "screaming-dot" },
{ joiner: "-", letters: "lower", name: "kebab" },
{ joiner: "-", letters: "upper", name: "screaming-kebab" },
{ joiner: "_", letters: "lower", name: "snake" },
{ joiner: "_", letters: "upper", name: "screaming-snake" },
{ joiner: null, letters: "upper", name: "pascal" },
{ joiner: null, letters: "lower", name: "camel" },
],
},
reasoning: "doc-arch/taxonomy/file-types.project.taxonomy.md",
specialContainers: {
".govlab": ["types"],
"banes-lab.root/banes-lab.build.scripts": ["types"],
"banes-lab.root/banes-lab.content": ["types"],
"banes-lab.root/banes-lab.deploy": ["types"],
"banes-lab.root/banes-lab.social-share": ["types"],
"banes-lab.root/banes-lab.web": ["types"],
"govlab.root/govlab.context": ["types"],
"govlab.root/govlab.docs": ["types"],
"govlab.root/govlab.patterns": ["types"],
"govlab.root/govlab.pipeline": ["types"],
"govlab.root/govlab.quality": ["types"],
"govlab.root/govlab.stats": ["types"],
"govlab.root/govlab.utils/argv": ["types"],
"govlab.root/govlab.utils/canonical-write": ["types"],
"govlab.root/govlab.utils/code-parse": ["types"],
"govlab.root/govlab.utils/content-fingerprint": ["types"],
"project.paths": ["types"],
"project.scripts": ["types"],
"project.secrets": ["types"],
},
subjects: [
"access",
"address",
"agent",
"algorithm",
"alias",
"anatomy",
"anchor",
"anti-pattern",
"architecture",
"automation",
"axis",
"backup",
"barrel",
"base",
"baseline",
"bearer",
"binding",
"block",
"blueprint",
"bnf",
"browser",
"build",
"canon",
"card",
"catalog",
"causality",
"certificate",
"chapter",
"character",
"check",
"checklist",
"citation",
"clipboard",
"closure",
"code",
"code-point",
"codemod",
"collaboration",
"comment",
"company",
"composition",
"concept",
"concern",
"constraint",
"construct",
"container",
"contract",
"coordination",
"correctness",
"coverage",
"credential",
"css",
"database",
"definition",
"dependency",
"deployment",
"derivation",
"design",
"detector",
"diagram",
"dimension",
"discord",
"document",
"drift",
"ecosystem",
"edit",
"element",
"environment",
"event",
"evidence",
"exclusion",
"exemplar",
"export",
"failure",
"faq",
"field",
"figure",
"filename",
"filter",
"finding",
"fingerprint",
"folder",
"form",
"fragment",
"generator",
"glossary",
"governance",
"grammar",
"graph",
"grid",
"handoff",
"heritage",
"home",
"ibm-plex-mono",
"identifier",
"idiom",
"image",
"implementation",
"increment",
"index",
"information",
"integration",
"introduction",
"invariant",
"inventory",
"invocation",
"jetbrains-mono",
"journal",
"jwt",
"key",
"keyword",
"kind",
"knob",
"layer",
"leak",
"learning",
"lens",
"lesson",
"lexicon",
"license",
"limitation",
"link",
"literal",
"liveness",
"location",
"loop",
"machine",
"maintenance",
"mark",
"markdown",
"markup",
"math",
"menu",
"metadata",
"metaprogramming",
"methodology",
"metric",
"mode",
"nginx",
"node",
"notification",
"observability",
"ontology",
"operation",
"orchestration",
"overlay",
"package",
"page",
"panel",
"pattern",
"payload",
"performance",
"persona",
"phase",
"plan",
"principle",
"privacy",
"profile",
"program",
"punctuation",
"quality",
"rate",
"rationale",
"readme",
"reason",
"recovery",
"reference",
"registrar",
"release",
"remote",
"repair",
"report",
"representation",
"resource",
"response",
"route",
"rule",
"scope",
"search",
"section",
"security",
"seed",
"segment",
"sentence",
"server",
"setup",
"shell",
"sink",
"site",
"snapshot",
"source",
"source-code-pro",
"specifier",
"ssh",
"stage",
"stance",
"start",
"structure",
"substrate",
"surface",
"syntax",
"system",
"tab",
"table",
"target",
"taxonomy",
"technique",
"template",
"tension",
"terms",
"text",
"token",
"tone",
"tool",
"tracking",
"transaction",
"tree",
"troubleshooting",
"validation",
"vcs",
"verb",
"viewport",
"violation",
"vocabulary",
"walk",
"webhook",
"wiki",
"word",
"writing",
],
variants: [
"actionlint",
"application",
"attribution",
"audit",
"background",
"badge",
"bandit",
"banner",
"behavioral",
"bold",
"branch",
"brakeman",
"channel",
"checkov",
"checkstyle",
"clang-tidy",
"clippy",
"clj-kondo",
"codeql",
"creational",
"creative-commons",
"credo",
"dashboard",
"debug",
"depcheck",
"dependency-cruiser",
"detekt",
"distillation",
"distribution",
"domain",
"emblem",
"emblem-gold-circle",
"emblem-gold-square",
"emblem-silver-circle",
"emblem-silver-square",
"error-prone",
"fifo",
"go",
"go-critic",
"golangci-lint",
"gosec",
"hadolint",
"header",
"htmlhint",
"icon",
"infrastructure",
"ini",
"jscpd",
"kics",
"knip",
"lintr",
"logo",
"lru",
"luacheck",
"madge",
"mascot",
"max",
"medium",
"min",
"modular",
"mypy",
"note",
"operations",
"output",
"oxlint",
"perlcritic",
"phpcs",
"phpmd",
"pmd",
"portrait",
"poster",
"prettier",
"processing",
"product",
"prose",
"psalm",
"pylint",
"refusal",
"regular",
"review",
"revive",
"root",
"rubocop",
"ruff",
"runtime",
"scalastyle",
"semgrep",
"sequence",
"share-alike",
"shellcheck",
"short",
"sidebar",
"slither",
"solid",
"sonar",
"spotbugs",
"sqlfluff",
"staticcheck",
"structural",
"stylua",
"swiftlint",
"tflint",
"toml",
"translation",
"trivy",
"ts-prune",
"typescript",
"universal",
"vector",
"verification",
"wordmark",
"wordmark-gold",
"wordmark-silver",
"workflow",
"xml",
"yaml",
"yamllint",
],
version: 5,
} as const;
export const imports = { [relativePath("app.coordination")]: coordinationTaxonomy } as const;
export type TaxonomyConfig = typeof taxonomy;
export type Subject = TaxonomyConfig["subjects"][number];
export type Variant = TaxonomyConfig["variants"][number];
export type ConcernEntry = TaxonomyConfig["concerns"][number];
export type ConcernTag = ConcernEntry["tag"];
export type ConcernFolder = ConcernEntry["folder"];
export type GovernedRoot = keyof TaxonomyConfig["containers"];
export type CompoundMarker = TaxonomyConfig["grammar"]["compoundMarkers"][number];
type Assert<Name extends string, Overlap> = [Overlap] extends [never] ? true : [Name, Overlap];
export const NO_SUBJECT_CONCERN_OVERLAP: Assert<
"subject is already a concern tag",
Extract<Subject, ConcernTag>
> = true;
export const NO_VARIANT_SUBJECT_OVERLAP: Assert<"variant is already a subject", Extract<Variant, Subject>> = true;
export const NO_VARIANT_CONCERN_OVERLAP: Assert<
"variant is already a concern tag",
Extract<Variant, ConcernTag>
> = true;
export const NO_MARKER_CONCERN_OVERLAP: Assert<
"compound marker is already a concern tag",
Extract<CompoundMarker, ConcernTag>
> = true;
export const EVERY_LAYER_DECLARED: Assert<
"concern layer is not in the spine",
Exclude<ConcernEntry["layer"], Layer>
> = true;