# gsai9582/labelsense architecture

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

- Interactive diagram: https://gitdiagram.com/gsai9582/labelsense
- Repository: https://github.com/gsai9582/labelsense

## Overview

LabelSense is a browser-based medical-device labeling compliance workflow. Its documented path runs from regulatory intelligence through change-impact analysis, template-bound label authoring, hybrid verification, and controlled release with audit evidence. The repository is a React UI with data and utility modules; the sampled code supports a few local component relationships, while most cross-phase connections come from the README. Unsampled modules are represented by their exact tree paths, without assuming their internal wiring.

Main entry points: [`src/components/audit/AuditModule.tsx`](https://github.com/gsai9582/labelsense/blob/main/src/components/audit/AuditModule.tsx) (Audit workspace), [`src/components/author/AuthorModule.tsx`](https://github.com/gsai9582/labelsense/blob/main/src/components/author/AuthorModule.tsx) (Label authoring), [`src/components/validate/ValidateModule.tsx`](https://github.com/gsai9582/labelsense/blob/main/src/components/validate/ValidateModule.tsx) (Validation suite), [`src/components/impact/ImpactModule.tsx`](https://github.com/gsai9582/labelsense/blob/main/src/components/impact/ImpactModule.tsx) (Impact assessment)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sense["Regulatory intelligence"]
  node_sense["Regulatory intelligence<br/>[SenseModule.tsx]"]
  node_radar["Regulatory radar"]
  node_clause["Clause RAG viewer"]
  node_extractor["Rule extractor<br/>[RuleExtractor.tsx]"]
  node_regdata["Regulatory reference data<br/>[regulatoryData.ts]"]
end

subgraph group_impact["Change impact"]
  node_impact["Impact assessment<br/>[ImpactModule.tsx]"]
  node_graph["Digital thread graph<br/>[KnowledgeGraph.tsx]"]
  node_ecn["ECN simulator<br/>[ECNSimulator.tsx]"]
  node_traversal["Traversal results"]
end

subgraph group_author["Label authoring"]
  node_author["Label authoring<br/>[AuthorModule.tsx]"]
  node_slots["Constrained slot filling"]
  node_canvas["Artwork canvas"]
  node_symbols["ISO symbol library<br/>[isoSymbols.ts]"]
  node_translation["Translation memory"]
  node_symbolpicker["Symbol picker<br/>[SymbolPicker.tsx]"]
  node_translationmatrix["Translation matrix"]
end

subgraph group_validate["Verification"]
  node_validate["Validation suite<br/>[ValidateModule.tsx]"]
  node_gs1["GS1 checker<br/>[GS1Checker.tsx]"]
  node_gs1util["GS1 validation logic<br/>[gs1Validator.ts]"]
  node_vision["Vision redline<br/>[VisionRedline.tsx]"]
  node_backtranslation["Back-translation check"]
  node_routing["Confidence routing"]
end

subgraph group_release["Release and audit"]
  node_audit["Audit workspace<br/>[AuditModule.tsx]"]
  node_whytrace["Why-Trace inspector<br/>[WhyTraceModal.tsx]"]
  node_timeline["Audit timeline"]
  node_packet["Submission packet"]
  node_signature["Electronic signature"]
  node_auditutil["Audit hash utilities<br/>[auditTrail.ts]"]
  node_tooltip["Abbreviation help<br/>[AbbrTooltip.tsx]"]
end

node_user(("Labeling operator"))
node_app["Workflow application<br/>[App.tsx]"]
node_header["Workflow navigation<br/>[Header.tsx]"]

node_user -->|"uses"| node_app
node_app -.->|"presents"| node_header
node_app -->|"starts workflow"| node_sense
node_sense -->|"feeds changes"| node_impact
node_impact -->|"identifies artwork"| node_author
node_author -->|"submits labels"| node_validate
node_validate -->|"routes release"| node_audit
node_sense -.->|"monitors updates"| node_radar
node_radar -->|"selects update"| node_clause
node_clause -->|"promotes rules"| node_extractor
node_sense -.->|"uses references"| node_regdata
node_impact -.->|"explores thread"| node_graph
node_impact -.->|"simulates change"| node_ecn
node_impact -.->|"reports impact"| node_traversal
node_author -.->|"fills locked fields"| node_slots
node_author -.->|"renders artwork"| node_canvas
node_author -.->|"selects symbols"| node_symbolpicker
node_symbolpicker -.->|"uses library"| node_symbols
node_author -.->|"manages localization"| node_translationmatrix
node_translationmatrix -.->|"uses translations"| node_translation
node_validate -.->|"checks identifiers"| node_gs1
node_gs1 -.->|"validates barcode"| node_gs1util
node_validate -.->|"compares artwork"| node_vision
node_validate -.->|"checks language drift"| node_backtranslation
node_validate -.->|"assigns risk tier"| node_routing
node_routing -->|"renders help"| node_tooltip
node_routing -.->|"triggers signoff"| node_signature
node_routing -.->|"opens audit"| node_audit
node_audit -.->|"inspects evidence"| node_whytrace
node_audit -.->|"reviews events"| node_timeline
node_audit -.->|"exports dossier"| node_packet
node_audit -.->|"records approval"| node_signature
node_auditutil -.->|"supports hashing"| node_audit

click node_app "https://github.com/gsai9582/labelsense/blob/main/src/App.tsx"
click node_header "https://github.com/gsai9582/labelsense/blob/main/src/components/common/Header.tsx"
click node_sense "https://github.com/gsai9582/labelsense/blob/main/src/components/sense/SenseModule.tsx"
click node_radar "https://github.com/gsai9582/labelsense/blob/main/src/components/sense/RegulatoryRadar.tsx"
click node_clause "https://github.com/gsai9582/labelsense/blob/main/src/components/sense/ClauseRAGViewer.tsx"
click node_extractor "https://github.com/gsai9582/labelsense/blob/main/src/components/sense/RuleExtractor.tsx"
click node_regdata "https://github.com/gsai9582/labelsense/blob/main/src/data/regulatoryData.ts"
click node_impact "https://github.com/gsai9582/labelsense/blob/main/src/components/impact/ImpactModule.tsx"
click node_graph "https://github.com/gsai9582/labelsense/blob/main/src/components/impact/KnowledgeGraph.tsx"
click node_ecn "https://github.com/gsai9582/labelsense/blob/main/src/components/impact/ECNSimulator.tsx"
click node_traversal "https://github.com/gsai9582/labelsense/blob/main/src/components/impact/TraversalResults.tsx"
click node_author "https://github.com/gsai9582/labelsense/blob/main/src/components/author/AuthorModule.tsx"
click node_slots "https://github.com/gsai9582/labelsense/blob/main/src/components/author/AntiHallucinationEditor.tsx"
click node_canvas "https://github.com/gsai9582/labelsense/blob/main/src/components/author/LiveArtworkCanvas.tsx"
click node_symbols "https://github.com/gsai9582/labelsense/blob/main/src/data/isoSymbols.ts"
click node_translation "https://github.com/gsai9582/labelsense/blob/main/src/data/translationMemory.ts"
click node_symbolpicker "https://github.com/gsai9582/labelsense/blob/main/src/components/author/SymbolPicker.tsx"
click node_translationmatrix "https://github.com/gsai9582/labelsense/blob/main/src/components/author/TranslationMatrix.tsx"
click node_validate "https://github.com/gsai9582/labelsense/blob/main/src/components/validate/ValidateModule.tsx"
click node_gs1 "https://github.com/gsai9582/labelsense/blob/main/src/components/validate/GS1Checker.tsx"
click node_gs1util "https://github.com/gsai9582/labelsense/blob/main/src/utils/gs1Validator.ts"
click node_vision "https://github.com/gsai9582/labelsense/blob/main/src/components/validate/VisionRedline.tsx"
click node_backtranslation "https://github.com/gsai9582/labelsense/blob/main/src/components/validate/NeuralBackTranslation.tsx"
click node_routing "https://github.com/gsai9582/labelsense/blob/main/src/components/validate/ConfidenceRouting.tsx"
click node_audit "https://github.com/gsai9582/labelsense/blob/main/src/components/audit/AuditModule.tsx"
click node_whytrace "https://github.com/gsai9582/labelsense/blob/main/src/components/audit/WhyTraceModal.tsx"
click node_timeline "https://github.com/gsai9582/labelsense/blob/main/src/components/audit/AuditTrailTimeline.tsx"
click node_packet "https://github.com/gsai9582/labelsense/blob/main/src/components/audit/SubmissionPacket.tsx"
click node_signature "https://github.com/gsai9582/labelsense/blob/main/src/components/common/ESignatureModal.tsx"
click node_auditutil "https://github.com/gsai9582/labelsense/blob/main/src/utils/auditTrail.ts"
click node_tooltip "https://github.com/gsai9582/labelsense/blob/main/src/components/common/AbbrTooltip.tsx"

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_sense,node_radar,node_clause,node_extractor,node_regdata toneBlue
class node_impact,node_graph,node_ecn,node_traversal toneAmber
class node_author,node_slots,node_canvas,node_symbols,node_translation,node_symbolpicker,node_translationmatrix toneMint
class node_validate,node_gs1,node_gs1util,node_vision,node_backtranslation,node_routing toneRose
class node_audit,node_whytrace,node_timeline,node_packet,node_signature,node_auditutil,node_tooltip,node_user toneIndigo
class node_app,node_header toneTeal
```

## Components

### Regulatory intelligence

- [Regulatory intelligence](https://github.com/gsai9582/labelsense/blob/main/src/components/sense/SenseModule.tsx): `src/components/sense/SenseModule.tsx`
- [Regulatory radar](https://github.com/gsai9582/labelsense/blob/main/src/components/sense/RegulatoryRadar.tsx): `src/components/sense/RegulatoryRadar.tsx`
- [Clause RAG viewer](https://github.com/gsai9582/labelsense/blob/main/src/components/sense/ClauseRAGViewer.tsx): `src/components/sense/ClauseRAGViewer.tsx`
- [Rule extractor](https://github.com/gsai9582/labelsense/blob/main/src/components/sense/RuleExtractor.tsx): `src/components/sense/RuleExtractor.tsx`
- [Regulatory reference data](https://github.com/gsai9582/labelsense/blob/main/src/data/regulatoryData.ts): `src/data/regulatoryData.ts`

### Change impact

- [Impact assessment](https://github.com/gsai9582/labelsense/blob/main/src/components/impact/ImpactModule.tsx): `src/components/impact/ImpactModule.tsx`
- [Digital thread graph](https://github.com/gsai9582/labelsense/blob/main/src/components/impact/KnowledgeGraph.tsx): `src/components/impact/KnowledgeGraph.tsx`
- [ECN simulator](https://github.com/gsai9582/labelsense/blob/main/src/components/impact/ECNSimulator.tsx): `src/components/impact/ECNSimulator.tsx`
- [Traversal results](https://github.com/gsai9582/labelsense/blob/main/src/components/impact/TraversalResults.tsx): `src/components/impact/TraversalResults.tsx`

### Label authoring

- [Label authoring](https://github.com/gsai9582/labelsense/blob/main/src/components/author/AuthorModule.tsx): `src/components/author/AuthorModule.tsx`
- [Constrained slot filling](https://github.com/gsai9582/labelsense/blob/main/src/components/author/AntiHallucinationEditor.tsx): `src/components/author/AntiHallucinationEditor.tsx`
- [Artwork canvas](https://github.com/gsai9582/labelsense/blob/main/src/components/author/LiveArtworkCanvas.tsx): `src/components/author/LiveArtworkCanvas.tsx`
- [ISO symbol library](https://github.com/gsai9582/labelsense/blob/main/src/data/isoSymbols.ts): `src/data/isoSymbols.ts`
- [Translation memory](https://github.com/gsai9582/labelsense/blob/main/src/data/translationMemory.ts): `src/data/translationMemory.ts`
- [Symbol picker](https://github.com/gsai9582/labelsense/blob/main/src/components/author/SymbolPicker.tsx): `src/components/author/SymbolPicker.tsx`
- [Translation matrix](https://github.com/gsai9582/labelsense/blob/main/src/components/author/TranslationMatrix.tsx): `src/components/author/TranslationMatrix.tsx`

### Verification

- [Validation suite](https://github.com/gsai9582/labelsense/blob/main/src/components/validate/ValidateModule.tsx): `src/components/validate/ValidateModule.tsx`
- [GS1 checker](https://github.com/gsai9582/labelsense/blob/main/src/components/validate/GS1Checker.tsx): `src/components/validate/GS1Checker.tsx`
- [GS1 validation logic](https://github.com/gsai9582/labelsense/blob/main/src/utils/gs1Validator.ts): `src/utils/gs1Validator.ts`
- [Vision redline](https://github.com/gsai9582/labelsense/blob/main/src/components/validate/VisionRedline.tsx): `src/components/validate/VisionRedline.tsx`
- [Back-translation check](https://github.com/gsai9582/labelsense/blob/main/src/components/validate/NeuralBackTranslation.tsx): `src/components/validate/NeuralBackTranslation.tsx`
- [Confidence routing](https://github.com/gsai9582/labelsense/blob/main/src/components/validate/ConfidenceRouting.tsx): `src/components/validate/ConfidenceRouting.tsx`

### Release and audit

- [Audit workspace](https://github.com/gsai9582/labelsense/blob/main/src/components/audit/AuditModule.tsx): `src/components/audit/AuditModule.tsx`
- [Why-Trace inspector](https://github.com/gsai9582/labelsense/blob/main/src/components/audit/WhyTraceModal.tsx): `src/components/audit/WhyTraceModal.tsx`
- [Audit timeline](https://github.com/gsai9582/labelsense/blob/main/src/components/audit/AuditTrailTimeline.tsx): `src/components/audit/AuditTrailTimeline.tsx`
- [Submission packet](https://github.com/gsai9582/labelsense/blob/main/src/components/audit/SubmissionPacket.tsx): `src/components/audit/SubmissionPacket.tsx`
- [Electronic signature](https://github.com/gsai9582/labelsense/blob/main/src/components/common/ESignatureModal.tsx): `src/components/common/ESignatureModal.tsx`
- [Audit hash utilities](https://github.com/gsai9582/labelsense/blob/main/src/utils/auditTrail.ts): `src/utils/auditTrail.ts`
- [Abbreviation help](https://github.com/gsai9582/labelsense/blob/main/src/components/common/AbbrTooltip.tsx): `src/components/common/AbbrTooltip.tsx`

### Other components

- **Labeling operator**
- [Workflow application](https://github.com/gsai9582/labelsense/blob/main/src/App.tsx): `src/App.tsx`
- [Workflow navigation](https://github.com/gsai9582/labelsense/blob/main/src/components/common/Header.tsx): `src/components/common/Header.tsx`

## Connections

- Labeling operator → Workflow application: uses (evidence: `README.md`)
- Workflow application → Workflow navigation: presents
- Workflow application → Regulatory intelligence: starts workflow (evidence: `README.md`)
- Regulatory intelligence → Impact assessment: feeds changes (evidence: `README.md`)
- Impact assessment → Label authoring: identifies artwork (evidence: `README.md`)
- Label authoring → Validation suite: submits labels (evidence: `README.md`)
- Validation suite → Audit workspace: routes release (evidence: `README.md`)
- Regulatory intelligence → Regulatory radar: monitors updates
- Regulatory radar → Clause RAG viewer: selects update (evidence: `src/components/sense/ClauseRAGViewer.tsx`)
- Clause RAG viewer → Rule extractor: promotes rules (evidence: `src/components/sense/ClauseRAGViewer.tsx`)
- Regulatory intelligence → Regulatory reference data: uses references
- Impact assessment → Digital thread graph: explores thread
- Impact assessment → ECN simulator: simulates change
- Impact assessment → Traversal results: reports impact
- Label authoring → Constrained slot filling: fills locked fields
- Label authoring → Artwork canvas: renders artwork
- Label authoring → Symbol picker: selects symbols
- Symbol picker → ISO symbol library: uses library
- Label authoring → Translation matrix: manages localization
- Translation matrix → Translation memory: uses translations
- Validation suite → GS1 checker: checks identifiers
- GS1 checker → GS1 validation logic: validates barcode
- Validation suite → Vision redline: compares artwork
- Validation suite → Back-translation check: checks language drift
- Validation suite → Confidence routing: assigns risk tier
- Confidence routing → Abbreviation help: renders help (evidence: `src/components/validate/ConfidenceRouting.tsx`)
- Confidence routing → Electronic signature: triggers signoff
- Confidence routing → Audit workspace: opens audit
- Audit workspace → Why-Trace inspector: inspects evidence
- Audit workspace → Audit timeline: reviews events
- Audit workspace → Submission packet: exports dossier
- Audit workspace → Electronic signature: records approval
- Audit hash utilities → Audit workspace: supports hashing
