# configuration/strings/taxonomy.strings.ts

> 91 lines of code and 7 definitions.

Tree: Site tree
Language: typescript
Layer: product
Canonical: https://banes-lab.com/anatomy/tree#file-configuration-strings-taxonomy-strings-ts
Source text: https://banes-lab.com/assets/sources/source.7bc349da28c33d3a99a5dd037947a38f70aa3ccaf7d98ba852743c6183c97288.generated.txt

## Definitions

- `VOCABULARY_SHAPE` (lexical_declaration, line 6)
- `GRAMMAR_SAMPLE` (lexical_declaration, line 9)
- `PLACEMENT_DIAGRAM` (lexical_declaration, line 12)
- `WORD_DIAGRAM` (lexical_declaration, line 15)
- `JURISDICTION_DIAGRAM` (lexical_declaration, line 18)
- `TAXONOMY_SECTION` (lexical_declaration, line 21)
- `TAXONOMY_SECTIONS` (lexical_declaration, line 98, exported)

## Source

```typescript
import { TEXT_LANGUAGE, TYPESCRIPT_LANGUAGE } from "#configuration/constants/code.constants";
import type { Section } from "#types/document.types";
import { TAXONOMY_SECTION_ICON } from "#configuration/icons/taxonomy.icons";
import { TAXONOMY_SECTION_ID } from "#core/ids/taxonomy.ids";

const VOCABULARY_SHAPE =
    'export const LAYERS = ["domain", "application", "processing", "runtime", "infrastructure", "operations", "product"] as const;\n\nexport const taxonomy = {\n    containers: {\n        "<governed-root>": ["<container>", "<container>"],\n    },\n    specialContainers: {\n        "<governed-root>": ["<flat-bucket>"],\n    },\n    concerns: [\n        { folder: "registries", tag: "registry", layer: "infrastructure" },\n        { folder: "validators", tag: "validator", layer: "processing" },\n        { folder: "strings", tag: "strings", layer: "product" },\n    ],\n    subjects: ["base", "<domain-noun>", "<domain-noun>"],\n    variants: ["<facet>", "<facet>"],\n    grammar: {\n        separator: ".",\n        maxDepthFromRoot: 3,\n        compoundMarkers: ["test", "spec", "generated"],\n    },\n} as const;\n\ntype Config = typeof taxonomy;\nexport type Subject = Config["subjects"][number];\nexport type Variant = Config["variants"][number];\nexport type ConcernTag = Config["concerns"][number]["tag"];\nexport type GovernedRoot = keyof Config["containers"];\n\ntype Assert<Name extends string, Overlap> = [Overlap] extends [never] ? true : [Name, Overlap];\n\nexport const NO_SUBJECT_CONCERN_OVERLAP: Assert<"subject is already a concern tag", Extract<Subject, ConcernTag>> = true;\nexport const NO_VARIANT_SUBJECT_OVERLAP: Assert<"variant is already a subject", Extract<Variant, Subject>> = true;\nexport const EVERY_LAYER_DECLARED: Assert<"concern layer is not in the spine", Exclude<Config["concerns"][number]["layer"], (typeof LAYERS)[number]>> = true;';

const GRAMMAR_SAMPLE =
    "folder = <container> | <subject> | <concern>       one word, never a dot\nfile   = <subject>.<concern>.<ext>\n       | <subject>.<variant>.<concern>.<ext>        only when two files would collide\n\ndepth  = container(1) → subject(2, optional) → concern(3) → file\n         a role may be skipped, never repeated, never revisited\n         the file's parent is always the concern folder\n         the file's concern tag equals its parent folder";

const PLACEMENT_DIAGRAM =
    'flowchart TB\n    engine["engine · a container, one grouping axis"]\n    registries["registries · a concern folder, files of one role"]\n    page["page.registry.ts"]\n    route["route.registry.ts"]\n    form["form · a subject folder"]\n    panel["panel · a subject folder"]\n    fv["validators"]\n    pv["validators"]\n    field["field.validator.ts"]\n    layout["layout.validator.ts"]\n    engine --> registries --> page\n    registries --> route\n    engine --> form --> fv --> field\n    engine --> panel --> pv --> layout\n    form -. two sets of validators must not merge .- panel';

const WORD_DIAGRAM =
    'flowchart LR\n    word["A word at a slot"]\n    role{"A role a file plays?"}\n    thing{"A thing the system has?"}\n    concern["The concern list · the file\'s tag"]\n    subject["The subject list · the first slot of a name"]\n    rejected["Rejected · a process, an adjective, a grouping label"]\n    split["The file gets its real role, or splits"]\n    word --> role\n    role -- registry, validator, renderer --> concern\n    role -- no --> thing\n    thing -- form, panel, route --> subject\n    thing -- timing, lazy, misc, helper --> rejected --> split';

const JURISDICTION_DIAGRAM =
    'flowchart TB\n    tree["A tree"]\n    declared{"Declared as a governed root?"}\n    governed["Every file inside resolves to one legal path"]\n    foreign{"Carries another system\'s ownership markers?"}\n    upstream{"Authored elsewhere?"}\n    left["Left alone · a grammar that does not claim a tree enforces nothing in it"]\n    refused["Refused as a root · its names are identifiers another runtime resolves"]\n    exempt["Declared once as upstream · exempt from naming, tense and reference checks together"]\n    tree --> declared\n    declared -- yes --> foreign\n    foreign -- yes --> refused\n    foreign -- no --> governed\n    declared -- no --> upstream\n    upstream -- yes --> exempt\n    upstream -- no --> left';

const TAXONOMY_SECTION: Section = {
    icon: TAXONOMY_SECTION_ICON,
    id: TAXONOMY_SECTION_ID,
    intro: "Where a file lives and what its name says follow one grammar, shown in <cite>the grammar</cite>: a container, an optional subject, a concern, and then the file, as shown in <cite>one tree</cite>. The file's name ends with the concern of its folder, which is concern-folder correspondence. Every word comes from a closed vocabulary: <cite>where a word goes</cite> shows how a word is placed, <cite>the vocabulary</cite> shows how the words are declared, and <cite>jurisdiction</cite> shows what the grammar claims and what it leaves alone. A file with two concerns is split rather than given a vague name, which is one concern per file. Only an overlap between two tags for one concern that cannot be reduced takes the tag closer to the domain, following the precedence the layer spine holds on the architecture page. The grammar is what turns separation of concerns from advice into a check, and the layer spine is the axis it uses to classify every concern.",
    subsections: [
        {
            blocks: [
                {
                    application:
                        "In practice, the closed vocabulary and the roots it governs are declared, and a check parses every path against the grammar. A collision is resolved sideways with a variant, never downward with another folder. An undeclared word is a decision for the developer, worked down a ladder: an existing word first, then the is-a test, then the conclusion that the filename is wrong, then the conclusion that the file itself is wrong. Every file is created conformant, because there is no queue of files waiting to be converted.",
                    boundary:
                        "Files that an ecosystem names for you keep their names. The grammar governs what you write, not what your tools require, and a tree carrying another system's ownership markers is never declared a governed root, because its names are identifiers that system resolves at runtime.",
                    cause: "Nothing parses a path, so a wrong placement fails no check and reads as a preference.",
                    decision:
                        "The vocabulary is closed and the path is parsed, rather than placement being reviewed by eye.",
                    failureMode:
                        "A helper folder appears, then a utils folder, then a second helper folder inside a feature, and six months later you can't say where a new file goes, and neither can the model.",
                    kind: "lesson",
                    principle:
                        "For this reason I treat placement as a grammar. A name is a claim about what the code does, and it is checked against the code, never against the old name.",
                    problem:
                        "Separation of concerns given as advice produces a different tree for every developer who follows it.",
                    validation:
                        "To check this, pick a file at random and work out its path from its contents alone. If the derived path differs from the real one, one of them is wrong, and the grammar says which.",
                },
                { code: GRAMMAR_SAMPLE, kind: "code", language: TEXT_LANGUAGE, title: "the grammar" },
                { caption: "one tree", kind: "mermaid", text: PLACEMENT_DIAGRAM },
            ],
            title: "One legal path per file",
        },
        {
            blocks: [
                {
                    kind: "text",
                    text: "Words are resolved by their position rather than by their spelling, which is positional slot resolution. A word is read by the slot it lands in, so a concern tag can also serve as a subject: a registry of pools and a pool named base use the same word in two slots without ambiguity. The one restriction on the words themselves is that a subject never equals its own concern. A subject folder exists exactly when a container holds two or more sets of one concern that must not merge, because optional grouping would give classification two right answers and make placement impossible to check. Sideways overflow handles the rest: a collision takes the filename's variant slot, breadth takes a sibling subject folder, and the bounded nesting depth is the reason both slots exist.",
                },
                { caption: "where a word goes", kind: "mermaid", text: WORD_DIAGRAM },
            ],
            title: "Slots, not words",
        },
        {
            blocks: [
                {
                    kind: "text",
                    text: "Declared jurisdiction decides what the grammar reaches. Each key in the configuration is a governed root, and without a declaration there is no enforcement, so a tree outside the jurisdiction keeps its own names. A declaration is a claim that is checked against the disk: a root declared before its folder exists governs nothing and fails nothing, yet it reads as coverage. Material written elsewhere is declared once as an upstream root, and that one declaration exempts it from the naming, tense and reference checks together, because all three fail on such a tree and none of those failures is a defect in it.",
                },
                { caption: "jurisdiction", kind: "mermaid", text: JURISDICTION_DIAGRAM },
            ],
            title: "Jurisdiction is declared",
        },
        {
            blocks: [
                {
                    kind: "text",
                    text: "Classification is a matter of judgement, while structure can be decided by a machine, and the tooling stops at the line between them. A check reports that a name does not parse or that a tag disagrees with its folder, but it never decides what a file is; the classification rule lives in the layer spine on the architecture page. Reshaping an existing tree is therefore a manual identity migration, done one container at a time with the gate green between each, and the rest is described in moves and renames.",
                },
            ],
            title: "Judgement classifies, the check parses",
        },
        {
            blocks: [
                {
                    kind: "text",
                    text: "The vocabulary is one typed declaration, and its type is what makes it closed: the legal words for each slot are a union derived from the data rather than written out a second time, and a flat bucket is declared explicitly rather than inferred from the folder's shape.",
                },
                {
                    kind: "text",
                    text: "The declaration also asserts its own consistency when it compiles. A subject that is already a concern tag, a variant that is already a subject, or a concern whose layer lies outside the spine fails to compile, so the vocabulary cannot become inconsistent without the whole gate refusing to load. Every closed vocabulary here takes the same shape: a configuration that carries data and the proofs of its own consistency, and no reasoning.",
                },
                { code: VOCABULARY_SHAPE, kind: "code", language: TYPESCRIPT_LANGUAGE, title: "the vocabulary" },
            ],
            title: "A vocabulary that proves itself",
        },
    ],
    title: "Placement is a grammar",
};

export const TAXONOMY_SECTIONS: readonly Section[] = [TAXONOMY_SECTION];
```
