# yan-mc/dsh-normify architecture

> Architecture diagram of the GitHub repository yan-mc/dsh-normify, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-12). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yan-mc/dsh-normify
- Repository: https://github.com/yan-mc/dsh-normify

## Overview

Normify is a DeepSeek Harness plugin and deterministic engine for maintaining an architecture tree as a contract with a codebase. The main workflow is AI-assisted: the model creates or edits planned module data through tools, validates it, implements code, refreshes module fingerprints, and closes the change only after successful validation. The engine also compiles validated data into frozen artifacts and rendering data, then produces a standalone interactive architecture diagram. The README documents these capabilities; some internal call paths are not shown in the excerpts, so those links are omitted or marked unverified.

Main entry points: [`src/tools.ts`](https://github.com/yan-mc/dsh-normify/blob/main/src/tools.ts) (Normify Tools), [`src/engine/validate.ts`](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/validate.ts) (Project Validation), [`src/engine/store.ts`](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/store.ts) (Project Store), [`src/engine/companion.ts`](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/companion.ts) (Companion Workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_plugin["Plugin Interface"]
  node_plugin_entry["Plugin Entry<br/>[index.ts]"]
  node_tool_api["Normify Tools<br/>[tools.ts]"]
  node_reference_help["Reference Help<br/>[reference.ts]"]
end

subgraph group_model["Architecture Data"]
  node_project_store[("Project Store<br/>[store.ts]")]
  node_module_schema["Module Frontmatter<br/>[frontmatter.ts]"]
  node_module_ids["Module IDs<br/>[ids.ts]"]
  node_module_editing["Module Editing<br/>[edit.ts]"]
  node_layout_data["Render Layouts<br/>[layout.ts]"]
  node_shared_types["Engine Types<br/>[types.ts]"]
end

subgraph group_governance["Change Governance"]
  node_architecture_policy["Architecture Policy<br/>[policy.ts]"]
  node_diagnostics["Diagnostics<br/>[diag.ts]"]
  node_validation["Project Validation<br/>[validate.ts]"]
  node_change_records["Change Records<br/>[changes.ts]"]
  node_companion_flow["Companion Workflow<br/>[companion.ts]"]
end

subgraph group_outputs["Build And View"]
  node_compiler["Deterministic Compiler<br/>[compile.ts]"]
  node_renderer["Diagram Renderer<br/>[render.ts]"]
  node_html_template["Interactive HTML<br/>[template.ts]"]
end

node_developer(("AI Developer"))

node_developer -->|"uses tools"| node_tool_api
node_plugin_entry -->|"registers tools"| node_tool_api
node_tool_api -->|"creates project"| node_project_store
node_tool_api -->|"edits modules"| node_module_editing
node_tool_api -->|"runs workflow"| node_companion_flow
node_tool_api -->|"validates project"| node_validation
node_tool_api -->|"builds artifacts"| node_compiler
node_tool_api -->|"renders diagram"| node_renderer
node_tool_api -->|"provides help"| node_reference_help
node_companion_flow -->|"opens and closes"| node_change_records
node_companion_flow -->|"validates changes"| node_validation
node_companion_flow -->|"compiles on close"| node_compiler
node_companion_flow -->|"optionally renders"| node_renderer
node_module_editing -.->|"writes modules"| node_project_store
node_module_schema -->|"checks identifiers"| node_module_ids
node_project_store -->|"serializes modules"| node_module_schema
node_project_store -->|"installs defaults"| node_architecture_policy
node_project_store -.->|"cleans layouts"| node_layout_data
node_validation -->|"enforces rules"| node_architecture_policy
node_validation -->|"checks change log"| node_change_records
node_validation -.->|"checks project data"| node_project_store
node_validation -.->|"reports findings"| node_diagnostics
node_compiler -->|"validates first"| node_validation
node_renderer -.->|"loads project"| node_project_store
node_renderer -->|"fills template"| node_html_template
node_renderer -.->|"uses layout data"| node_layout_data

click node_plugin_entry "https://github.com/yan-mc/dsh-normify/blob/main/src/index.ts"
click node_tool_api "https://github.com/yan-mc/dsh-normify/blob/main/src/tools.ts"
click node_project_store "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/store.ts"
click node_module_schema "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/frontmatter.ts"
click node_module_ids "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/ids.ts"
click node_module_editing "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/edit.ts"
click node_layout_data "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/layout.ts"
click node_architecture_policy "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/policy.ts"
click node_diagnostics "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/diag.ts"
click node_validation "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/validate.ts"
click node_change_records "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/changes.ts"
click node_companion_flow "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/companion.ts"
click node_reference_help "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/reference.ts"
click node_compiler "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/compile.ts"
click node_renderer "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/render.ts"
click node_html_template "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/template.ts"
click node_shared_types "https://github.com/yan-mc/dsh-normify/blob/main/src/engine/types.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_plugin_entry,node_tool_api,node_reference_help toneBlue
class node_project_store,node_module_schema,node_module_ids,node_module_editing,node_layout_data,node_shared_types toneAmber
class node_architecture_policy,node_diagnostics,node_validation,node_change_records,node_companion_flow toneMint
class node_compiler,node_renderer,node_html_template toneRose
class node_developer toneIndigo
```

## Components

### Plugin Interface

- [Plugin Entry](https://github.com/yan-mc/dsh-normify/blob/main/src/index.ts): `src/index.ts`
- [Normify Tools](https://github.com/yan-mc/dsh-normify/blob/main/src/tools.ts): `src/tools.ts`
- [Reference Help](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/reference.ts): `src/engine/reference.ts`

### Architecture Data

- [Project Store](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/store.ts): `src/engine/store.ts`
- [Module Frontmatter](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/frontmatter.ts): `src/engine/frontmatter.ts`
- [Module IDs](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/ids.ts): `src/engine/ids.ts`
- [Module Editing](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/edit.ts): `src/engine/edit.ts`
- [Render Layouts](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/layout.ts): `src/engine/layout.ts`
- [Engine Types](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/types.ts): `src/engine/types.ts`

### Change Governance

- [Architecture Policy](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/policy.ts): `src/engine/policy.ts`
- [Diagnostics](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/diag.ts): `src/engine/diag.ts`
- [Project Validation](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/validate.ts): `src/engine/validate.ts`
- [Change Records](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/changes.ts): `src/engine/changes.ts`
- [Companion Workflow](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/companion.ts): `src/engine/companion.ts`

### Build And View

- [Deterministic Compiler](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/compile.ts): `src/engine/compile.ts`
- [Diagram Renderer](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/render.ts): `src/engine/render.ts`
- [Interactive HTML](https://github.com/yan-mc/dsh-normify/blob/main/src/engine/template.ts): `src/engine/template.ts`

### Other components

- **AI Developer**

## Connections

- AI Developer → Normify Tools: uses tools
- Plugin Entry → Normify Tools: registers tools (evidence: `src/index.ts`)
- Normify Tools → Project Store: creates project (evidence: `src/tools.ts`)
- Normify Tools → Module Editing: edits modules (evidence: `src/tools.ts`)
- Normify Tools → Companion Workflow: runs workflow (evidence: `src/tools.ts`)
- Normify Tools → Project Validation: validates project (evidence: `src/tools.ts`)
- Normify Tools → Deterministic Compiler: builds artifacts (evidence: `src/tools.ts`)
- Normify Tools → Diagram Renderer: renders diagram (evidence: `src/tools.ts`)
- Normify Tools → Reference Help: provides help (evidence: `src/tools.ts`)
- Companion Workflow → Change Records: opens and closes (evidence: `src/engine/companion.ts`)
- Companion Workflow → Project Validation: validates changes (evidence: `src/engine/companion.ts`)
- Companion Workflow → Deterministic Compiler: compiles on close (evidence: `src/engine/companion.ts`)
- Companion Workflow → Diagram Renderer: optionally renders (evidence: `src/engine/companion.ts`)
- Module Editing → Project Store: writes modules (evidence: `src/engine/edit.ts`)
- Module Frontmatter → Module IDs: checks identifiers (evidence: `src/engine/frontmatter.ts`)
- Project Store → Module Frontmatter: serializes modules (evidence: `src/engine/store.ts`)
- Project Store → Architecture Policy: installs defaults (evidence: `src/engine/store.ts`)
- Project Store → Render Layouts: cleans layouts (evidence: `src/engine/store.ts`)
- Project Validation → Architecture Policy: enforces rules (evidence: `src/engine/validate.ts`)
- Project Validation → Change Records: checks change log (evidence: `src/engine/validate.ts`)
- Project Validation → Project Store: checks project data (evidence: `src/engine/validate.ts`)
- Project Validation → Diagnostics: reports findings (evidence: `src/engine/validate.ts`)
- Deterministic Compiler → Project Validation: validates first (evidence: `src/engine/compile.ts`)
- Diagram Renderer → Project Store: loads project (evidence: `src/engine/render.ts`)
- Diagram Renderer → Interactive HTML: fills template (evidence: `src/engine/render.ts`)
- Diagram Renderer → Render Layouts: uses layout data
