# configuration/constants/architecture.constants.ts

> 46 lines of code and 16 definitions.

Tree: GovLab Context
Language: typescript
Layer: infrastructure
Canonical: https://banes-lab.com/anatomy/context#file-context-configuration-constants-architecture-constants-ts
Source text: https://banes-lab.com/source/context/configuration/constants/architecture.constants.ts.txt

Listed in [configuration/constants](https://banes-lab.com/api/source/context/configuration/constants.md), after [configuration/constants/algorithm.constants.ts](https://banes-lab.com/source/context/configuration/constants/algorithm.constants.ts.md) and before [configuration/constants/check.constants.ts](https://banes-lab.com/source/context/configuration/constants/check.constants.ts.md).

## Definitions

- `SEVERITY_TAXONOMY` (lexical_declaration, line 5, exported)
- `SEVERITY_LEVEL_VALUES` (lexical_declaration, line 16, exported)
- `SEVERITY_LEVELS` (lexical_declaration, line 18, exported)
- `CONDITIONAL_SEVERITY` (lexical_declaration, line 20, exported)
- `EDGE_RELATIONS` (lexical_declaration, line 22, exported)
- `NEGATIVE_KIND` (lexical_declaration, line 30, exported)
- `NON_NEGATIVE` (lexical_declaration, line 32)
- `NEGATIVE_ONLY` (lexical_declaration, line 34)
- `RELATION_RANGES` (lexical_declaration, line 36, exported)
- `REPAIR_RANGES` (lexical_declaration, line 44, exported)
- `REPAIR_FIELDS` (lexical_declaration, line 49, exported)
- `EDGE_FIELDS` (lexical_declaration, line 51, exported)
- `ARCH_SUBJECT` (lexical_declaration, line 56, exported)
- `PRINCIPLE_TYPE` (lexical_declaration, line 58, exported)
- `LABEL_EDGE_PREFIX` (lexical_declaration, line 60, exported)
- `ID_EDGE_PREFIX` (lexical_declaration, line 62, exported)

## Contained in

- [configuration/constants](https://banes-lab.com/anatomy/context/folder-context-configuration-constants.md)

## Source

```typescript
import type { EdgeRelation, RepairField, SeverityLevel } from "#types/architecture.types";
import { KIND_DECISION_ORDER } from "#configuration/constants/kind.constants";
import type { VocabularyEntry } from "#types/vocabulary.types";

export const SEVERITY_TAXONOMY = [
    { definition: "A principle that applies to every system within its scope.", value: "mandatory" },
    { definition: "A principle that applies by default and gives way to a stated reason.", value: "recommended" },
    {
        definition:
            "A principle that applies only to the systems its Mandatory for field names, such as distributed systems.",
        value: "contextual",
    },
    { definition: "A design that is avoided unless a stated need calls for it.", value: "discouraged" },
] as const satisfies readonly VocabularyEntry[];

export const SEVERITY_LEVEL_VALUES: readonly SeverityLevel[] = SEVERITY_TAXONOMY.map((entry) => entry.value);

export const SEVERITY_LEVELS: ReadonlySet<string> = new Set(SEVERITY_LEVEL_VALUES);

export const CONDITIONAL_SEVERITY: SeverityLevel = "contextual";

export const EDGE_RELATIONS: readonly EdgeRelation[] = [
    "requires",
    "reinforces",
    "enables",
    "conflicts_with",
    "tensions_with",
];

export const NEGATIVE_KIND = "anti-pattern";

const NON_NEGATIVE: ReadonlySet<string> = new Set(KIND_DECISION_ORDER.filter((kind) => kind !== NEGATIVE_KIND));

const NEGATIVE_ONLY: ReadonlySet<string> = new Set([NEGATIVE_KIND]);

export const RELATION_RANGES: Record<EdgeRelation, ReadonlySet<string>> = {
    conflicts_with: NEGATIVE_ONLY,
    enables: NON_NEGATIVE,
    reinforces: NON_NEGATIVE,
    requires: NON_NEGATIVE,
    tensions_with: NON_NEGATIVE,
};

export const REPAIR_RANGES: Record<RepairField, ReadonlySet<string>> = {
    refactored_by: new Set(["technique", "pattern", "mechanism", "activity", "approach", "style", "model", "artifact"]),
    violated_by: NEGATIVE_ONLY,
};

export const REPAIR_FIELDS: readonly RepairField[] = ["refactored_by", "violated_by"];

export const EDGE_FIELDS: readonly { field: EdgeRelation; relation: string }[] = EDGE_RELATIONS.map((field) => ({
    field,
    relation: field,
}));

export const ARCH_SUBJECT = "arch";

export const PRINCIPLE_TYPE = "principle";

export const LABEL_EDGE_PREFIX = "label:";

export const ID_EDGE_PREFIX = "id:";
```
