# noob-stupid/dsh-plugin-gating-hub architecture

> Architecture diagram of the GitHub repository noob-stupid/dsh-plugin-gating-hub, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/noob-stupid/dsh-plugin-gating-hub
- Repository: https://github.com/noob-stupid/dsh-plugin-gating-hub

## Overview

DSH Plugin Gating Hub is a web/desktop plugin console focused on safe framework upgrades and plugin compatibility, with discovery and installation as a secondary layer. The main user flow runs from the console through the local HTTP route dispatcher to upgrade or compatibility logic, which manages framework state and rollback; discovery flows through market and install routes into configurable sources and install jobs. The README also documents AI-assisted deployment and server-component controls. Some feature wiring is documented but its implementation was not sampled, so those links use only supported route or enclosing-directory paths.

Main entry points: [`lib/server/routes/index.js`](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/index.js) (HTTP route dispatcher), [`lib/index.js`](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/index.js) (Plugin entry), [`lib/server/routes/framework-upgrade.js`](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/framework-upgrade.js) (Framework upgrade), [`lib/server/domain/install-job.js`](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/install-job.js) (Install jobs)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Console entry"]
  node_console["Console client<br/>[client.js]"]
  node_plugin["Plugin entry<br/>[index.js]"]
  node_router["HTTP route dispatcher<br/>[index.js]"]
  node_runstate["Runtime state<br/>[state.js]"]
end

subgraph group_safety["Upgrade safety"]
  node_upgrade["Framework upgrade"]
  node_framework["Framework lifecycle<br/>[framework.js]"]
  node_compat["Compatibility gate<br/>[compat.js]"]
  node_quarantine["Failure quarantine<br/>[quarantine.js]"]
  node_fs["Filesystem operations<br/>[fsx.js]"]
end

subgraph group_plugins["Plugin management"]
  node_pluginroutes["Plugin routes<br/>[plugins.js]"]
  node_patch["Patch and gating<br/>[patch.js]"]
end

subgraph group_discovery["Discovery and install"]
  node_marketroute["Market routes<br/>[market.js]"]
  node_market["Market discovery<br/>[market.js]"]
  node_sources["Configurable sources<br/>[sources.js]"]
  node_installroute["Install routes<br/>[install.js]"]
  node_install["Install jobs<br/>[install-job.js]"]
  node_repo["Repository handling<br/>[repoland.js]"]
end

subgraph group_operations["AI and components"]
  node_airexecute["AI deployment<br/>[ai-run.js]"]
  node_components["Server components<br/>[components.js]"]
end

node_user(("Console user"))
node_host["DSH host"]
node_external["Package and Git sources"]

node_user -->|"uses"| node_console
node_console -->|"requests"| node_plugin
node_plugin -->|"registers with"| node_host
node_plugin -->|"dispatches to"| node_router
node_router -->|"reads and updates"| node_runstate
node_router -->|"dispatches upgrade"| node_upgrade
node_upgrade -->|"preflights"| node_framework
node_upgrade -->|"checks compatibility"| node_compat
node_upgrade -->|"checkpoints and restores"| node_fs
node_framework -->|"records failures"| node_quarantine
node_router -->|"dispatches plugin actions"| node_pluginroutes
node_pluginroutes -->|"changes plugin state"| node_patch
node_pluginroutes -->|"checks adapt status"| node_compat
node_router -->|"dispatches search"| node_marketroute
node_marketroute -->|"queries"| node_market
node_market -->|"uses source settings"| node_sources
node_router -->|"dispatches installs"| node_installroute
node_installroute -->|"starts job"| node_install
node_install -->|"selects source"| node_sources
node_install -->|"lands repositories"| node_repo
node_install -->|"fetches packages or Git"| node_external
node_router -->|"dispatches AI actions"| node_airexecute
node_airexecute -.->|"reads package documentation"| node_external
node_plugin -->|"autostarts components"| node_components

click node_console "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/client.js"
click node_plugin "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/index.js"
click node_router "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/index.js"
click node_runstate "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/state.js"
click node_upgrade "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/framework-upgrade.js"
click node_framework "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/framework.js"
click node_compat "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/compat.js"
click node_quarantine "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/quarantine.js"
click node_fs "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/infra/fsx.js"
click node_pluginroutes "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/plugins.js"
click node_patch "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/patch.js"
click node_marketroute "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/market.js"
click node_market "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/market.js"
click node_sources "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/sources.js"
click node_installroute "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/install.js"
click node_install "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/install-job.js"
click node_repo "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/repoland.js"
click node_airexecute "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/ai-run.js"
click node_components "https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/components.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_console,node_plugin,node_router,node_runstate,node_user toneBlue
class node_upgrade,node_framework,node_compat,node_quarantine,node_fs toneAmber
class node_pluginroutes,node_patch toneMint
class node_marketroute,node_market,node_sources,node_installroute,node_install,node_repo toneRose
class node_airexecute,node_components,node_host,node_external toneIndigo
```

## Components

### Console entry

- [Console client](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/client.js): `lib/client.js`
- [Plugin entry](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/index.js): `lib/index.js`
- [HTTP route dispatcher](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/index.js): `lib/server/routes/index.js`
- [Runtime state](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/state.js): `lib/server/state.js`

### Upgrade safety

- [Framework upgrade](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/framework-upgrade.js): `lib/server/routes/framework-upgrade.js`
- [Framework lifecycle](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/framework.js): `lib/server/domain/framework.js`
- [Compatibility gate](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/compat.js): `lib/server/domain/compat.js`
- [Failure quarantine](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/quarantine.js): `lib/server/domain/quarantine.js`
- [Filesystem operations](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/infra/fsx.js): `lib/server/infra/fsx.js`

### Plugin management

- [Plugin routes](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/plugins.js): `lib/server/routes/plugins.js`
- [Patch and gating](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/patch.js): `lib/server/domain/patch.js`

### Discovery and install

- [Market routes](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/market.js): `lib/server/routes/market.js`
- [Market discovery](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/market.js): `lib/server/domain/market.js`
- [Configurable sources](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/sources.js): `lib/server/domain/sources.js`
- [Install routes](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/routes/install.js): `lib/server/routes/install.js`
- [Install jobs](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/install-job.js): `lib/server/domain/install-job.js`
- [Repository handling](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/repoland.js): `lib/server/domain/repoland.js`

### AI and components

- [AI deployment](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/ai-run.js): `lib/server/domain/ai-run.js`
- [Server components](https://github.com/noob-stupid/dsh-plugin-gating-hub/blob/main/lib/server/domain/components.js): `lib/server/domain/components.js`

### Other components

- **Console user**
- **DSH host**
- **Package and Git sources**

## Connections

- Console user → Console client: uses
- Console client → Plugin entry: requests
- Plugin entry → DSH host: registers with
- Plugin entry → HTTP route dispatcher: dispatches to
- HTTP route dispatcher → Runtime state: reads and updates
- HTTP route dispatcher → Framework upgrade: dispatches upgrade
- Framework upgrade → Framework lifecycle: preflights
- Framework upgrade → Compatibility gate: checks compatibility
- Framework upgrade → Filesystem operations: checkpoints and restores
- Framework lifecycle → Failure quarantine: records failures
- HTTP route dispatcher → Plugin routes: dispatches plugin actions
- Plugin routes → Patch and gating: changes plugin state
- Plugin routes → Compatibility gate: checks adapt status
- HTTP route dispatcher → Market routes: dispatches search
- Market routes → Market discovery: queries
- Market discovery → Configurable sources: uses source settings
- HTTP route dispatcher → Install routes: dispatches installs
- Install routes → Install jobs: starts job
- Install jobs → Configurable sources: selects source
- Install jobs → Repository handling: lands repositories
- Install jobs → Package and Git sources: fetches packages or Git
- HTTP route dispatcher → AI deployment: dispatches AI actions
- AI deployment → Package and Git sources: reads package documentation
- Plugin entry → Server components: autostarts components
