Skip to content

Architecture (FLT-379 first slice)

Model

Immutable C# records: ArchitectureModel { SchemaVersion, SystemName, Elements[], Relationships[], OmittedEdges }. Element kinds: Person, ExternalSystem, SoftwareSystem, Boundary, Container, DataStore, Library, DeploymentNode. Relationship kinds: BuildDependency, StartupDependency, InfrastructureReference, Declared. IDs are hex SHA-256 over a length-prefixed (sourceKind, canonicalPath, logicalName) preimage. Canonical JSON: fixed property order, nulls omitted, UTF-8 no BOM, LF, trailing newline, Ordinal ordering. Schema: schemas/.

Sources

  • Solution (.slnx, classic .sln): restricted XML subset, no evaluation. Nearest Directory.Build.props plus parents only via the standard GetPathOfFileAbove import; anything conditional, computed, or an alien import is exit 2. Test signal = IsTestProject or a test package reference; Web/Worker plus test signal is exit 2, plain Exe plus test signal is excluded. Overrides replace topology completely and are marked declared. .slnx accepts Folder under Solution (nestable); folder names are ignored and moving a project between folders changes no element, ID, or output byte. Ignored and never references: File under Folder, Configurations and Properties under Solution, and Build, Deploy, Platform, BuildType, BuildDependency under Project. A solution-level BuildDependency is not read. Any other element, or a Project outside Solution/Folder, is exit 2 with file and line.
  • Compose: YamlDotNet representation model only. Reads service names, image, build presence, depends_on. Image keeps the repository only (digest and tag stripped). Data-store table matches the repository last segment exactly.
  • Terraform (cdk.tf.json snapshot): closed resource table (resourceTypes extends it). String leaves matched against a strict reference regex; values are discarded after matching. Ignored or data. ends count as omitted edges. module or unknown top-level keys exit 2.
  • Declared overlay: persons, external systems, and named relationships; names resolve uniquely or exit 2.

Per-source anti-vacuous rule: zero non-boundary elements exits 2; more than one non-boundary element with zero relationships exits 2 unless allowNoRelationships. Unreferenced .sln/.slnx/*compose*.yml/yaml/ cdk.tf.json files exit 2 unless covered or ignored.

Views and output

c1-context (hand-declared only), c2-containers (startup edges plus build chains lifted through libraries), c3-<slug> per container with libraries, deployment when a Terraform source ran. The D2 writer emits only identifiers, quoted labels, edges, blocks, and the shape / style.stroke-dash keys. docs/architecture/ is wholly tool-owned and replaced via staging plus directory swap.