# alphaindiamike/rm-stack architecture

> Architecture diagram of the GitHub repository alphaindiamike/rm-stack, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/alphaindiamike/rm-stack
- Repository: https://github.com/alphaindiamike/rm-stack

## Overview

rm-stack is a portable, offline requirements-specification tool. An engineer authors an Item concept and HARA, develops shared System safety and architecture data, then derives and checks HW/SW requirements. The UI provides an outline, chapter editor and live summary; projects are local JSON files. The tree and excerpts support the main domain stages, mode/timing tools and derivation coverage, but do not expose every chapter’s runtime wiring, so uncertain links are omitted.

Main entry points: [`ui_editor.js`](https://github.com/alphaindiamike/rm-stack/blob/main/ui_editor.js) (Chapter editor), [`main.js`](https://github.com/alphaindiamike/rm-stack/blob/main/main.js) (App coordinator), [`model_base.js`](https://github.com/alphaindiamike/rm-stack/blob/main/model_base.js) (Document model), [`validator.js`](https://github.com/alphaindiamike/rm-stack/blob/main/validator.js) (Document validator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Application UI"]
  node_main["App coordinator<br/>[main.js]"]
  node_outline["Chapter outline<br/>[ui_outline.js]"]
  node_editor["Chapter editor<br/>[ui_editor.js]"]
  node_summary["Live summary<br/>[ui_summary.js]"]
end

subgraph group_domain["Safety Work Products"]
  node_item["Item &amp; HARA<br/>[hara.js]"]
  node_system["System work products"]
  node_breakdown["System breakdown<br/>[ch06_breakdown.js]"]
  node_timing["Timing analysis<br/>[ch_timing.js]"]
end

subgraph group_derive["HW/SW Derivation"]
  node_hw["Hardware chapters"]
  node_hwinputs["HW derivation coverage<br/>[hw_inputs.js]"]
  node_sw["Software chapters"]
  node_swinputs["SW derivation coverage<br/>[sw_inputs.js]"]
end

subgraph group_assurance["Validation &amp; Export"]
  node_validator["Document validator<br/>[validator.js]"]
  node_grammar["Requirement grammar<br/>[grammar.js]"]
  node_export["Document export<br/>[export.js]"]
end

subgraph group_core["Document Core"]
  node_model["Document model<br/>[model_base.js]"]
  node_registries["Discipline &amp; chapter registries"]
  node_persistence["JSON persistence<br/>[persistence.js]"]
end

node_engineer(("Engineer"))

node_engineer -->|"uses"| node_main
node_main -->|"renders"| node_outline
node_main -->|"renders"| node_editor
node_main -->|"renders"| node_summary
node_main -->|"lists disciplines"| node_registries
node_main -->|"saves and loads"| node_persistence
node_outline -->|"selects chapter"| node_editor
node_editor -->|"edits"| node_item
node_editor -->|"edits"| node_system
node_editor -->|"edits"| node_hw
node_editor -->|"edits"| node_sw
node_item -->|"shares document data"| node_model
node_system -->|"shares document data"| node_model
node_breakdown -->|"updates declarations"| node_model
node_timing -->|"reads transitions; writes requirements"| node_model
node_hwinputs -->|"requests coverage"| node_validator
node_swinputs -->|"requests coverage"| node_validator
node_validator -->|"checks document"| node_model
node_editor -->|"validates requirements"| node_grammar
node_export -->|"exports document data"| node_model
node_persistence -->|"serializes document"| node_model
node_summary -->|"shows integrity results"| node_validator

click node_main "https://github.com/alphaindiamike/rm-stack/blob/main/main.js"
click node_outline "https://github.com/alphaindiamike/rm-stack/blob/main/ui_outline.js"
click node_editor "https://github.com/alphaindiamike/rm-stack/blob/main/ui_editor.js"
click node_summary "https://github.com/alphaindiamike/rm-stack/blob/main/ui_summary.js"
click node_item "https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/item/hara.js"
click node_system "https://github.com/alphaindiamike/rm-stack/tree/main/disciplines/system"
click node_breakdown "https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/system/ch06_breakdown.js"
click node_timing "https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/system/ch_timing.js"
click node_hw "https://github.com/alphaindiamike/rm-stack/tree/main/disciplines/hardware"
click node_hwinputs "https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/hardware/hw_inputs.js"
click node_sw "https://github.com/alphaindiamike/rm-stack/tree/main/disciplines/software"
click node_swinputs "https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/software/sw_inputs.js"
click node_validator "https://github.com/alphaindiamike/rm-stack/blob/main/validator.js"
click node_grammar "https://github.com/alphaindiamike/rm-stack/blob/main/grammar.js"
click node_export "https://github.com/alphaindiamike/rm-stack/blob/main/export.js"
click node_model "https://github.com/alphaindiamike/rm-stack/blob/main/model_base.js"
click node_registries "https://github.com/alphaindiamike/rm-stack/blob/main/chapter_registry.js"
click node_persistence "https://github.com/alphaindiamike/rm-stack/blob/main/persistence.js"

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_main,node_outline,node_editor,node_summary toneBlue
class node_item,node_system,node_breakdown,node_timing toneAmber
class node_hw,node_hwinputs,node_sw,node_swinputs toneMint
class node_validator,node_grammar,node_export toneRose
class node_model,node_registries,node_persistence,node_engineer toneIndigo
```

## Components

### Application UI

- [App coordinator](https://github.com/alphaindiamike/rm-stack/blob/main/main.js): `main.js`
- [Chapter outline](https://github.com/alphaindiamike/rm-stack/blob/main/ui_outline.js): `ui_outline.js`
- [Chapter editor](https://github.com/alphaindiamike/rm-stack/blob/main/ui_editor.js): `ui_editor.js`
- [Live summary](https://github.com/alphaindiamike/rm-stack/blob/main/ui_summary.js): `ui_summary.js`

### Safety Work Products

- [Item & HARA](https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/item/hara.js): `disciplines/item/hara.js`
- [System work products](https://github.com/alphaindiamike/rm-stack/tree/main/disciplines/system): `disciplines/system`
- [System breakdown](https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/system/ch06_breakdown.js): `disciplines/system/ch06_breakdown.js`
- [Timing analysis](https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/system/ch_timing.js): `disciplines/system/ch_timing.js`

### HW/SW Derivation

- [Hardware chapters](https://github.com/alphaindiamike/rm-stack/tree/main/disciplines/hardware): `disciplines/hardware`
- [HW derivation coverage](https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/hardware/hw_inputs.js): `disciplines/hardware/hw_inputs.js`
- [Software chapters](https://github.com/alphaindiamike/rm-stack/tree/main/disciplines/software): `disciplines/software`
- [SW derivation coverage](https://github.com/alphaindiamike/rm-stack/blob/main/disciplines/software/sw_inputs.js): `disciplines/software/sw_inputs.js`

### Validation & Export

- [Document validator](https://github.com/alphaindiamike/rm-stack/blob/main/validator.js): `validator.js`
- [Requirement grammar](https://github.com/alphaindiamike/rm-stack/blob/main/grammar.js): `grammar.js`
- [Document export](https://github.com/alphaindiamike/rm-stack/blob/main/export.js): `export.js`

### Document Core

- [Document model](https://github.com/alphaindiamike/rm-stack/blob/main/model_base.js): `model_base.js`
- [Discipline & chapter registries](https://github.com/alphaindiamike/rm-stack/blob/main/chapter_registry.js): `chapter_registry.js`
- [JSON persistence](https://github.com/alphaindiamike/rm-stack/blob/main/persistence.js): `persistence.js`

### Other components

- **Engineer**

## Connections

- Engineer → App coordinator: uses
- App coordinator → Chapter outline: renders
- App coordinator → Chapter editor: renders
- App coordinator → Live summary: renders
- App coordinator → Discipline & chapter registries: lists disciplines
- App coordinator → JSON persistence: saves and loads
- Chapter outline → Chapter editor: selects chapter
- Chapter editor → Item & HARA: edits
- Chapter editor → System work products: edits
- Chapter editor → Hardware chapters: edits
- Chapter editor → Software chapters: edits
- Item & HARA → Document model: shares document data
- System work products → Document model: shares document data
- System breakdown → Document model: updates declarations
- Timing analysis → Document model: reads transitions; writes requirements
- HW derivation coverage → Document validator: requests coverage
- SW derivation coverage → Document validator: requests coverage
- Document validator → Document model: checks document
- Chapter editor → Requirement grammar: validates requirements
- Document export → Document model: exports document data
- JSON persistence → Document model: serializes document
- Live summary → Document validator: shows integrity results
