# krishna-10-7/build architecture

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

- Interactive diagram: https://gitdiagram.com/krishna-10-7/build
- Repository: https://github.com/krishna-10-7/build

## Overview

SentinelQA turns ticket acceptance criteria into locked Playwright suites, records a known-good baseline, then checks changed builds and permits locator-only repairs only after effect and criteria gates. The server coordinates workflow and persistence; the dashboard and 3D office expose operations, while ShopLite supplies a mutation demo target. README documents Jira/GitHub, review, benchmarking and agent modes; sampled evidence supports only some internal call paths, so other documented integrations are shown without speculative wiring.

Main entry points: [`apps/server/src/main.ts`](https://github.com/krishna-10-7/build/blob/main/apps/server/src/main.ts) (HTTP API), [`apps/server/src/service.ts`](https://github.com/krishna-10-7/build/blob/main/apps/server/src/service.ts) (Workflow Service), [`packages/engine/src/check.ts`](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/check.ts) (Check and Heal), [`packages/engine/src/runner.ts`](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/runner.ts) (Browser Runner)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Ticket Workflow"]
  node_ticket_source["Jira Tickets<br/>[jira.ts]"]
  node_compiler["Criteria Compiler<br/>[compile.ts]"]
  node_contract["Contract Schema<br/>[contract.ts]"]
  node_stage_machine["Stage Machine<br/>[pipeline.ts]"]
  node_service["Workflow Service<br/>[service.ts]"]
  node_codegen["Spec Generation<br/>[codegen.ts]"]
  node_suite["Suite Files<br/>[suite.ts]"]
end

subgraph group_engine["Test and Repair"]
  node_baseline["Grounding Baseline<br/>[ground.ts]"]
  node_runner["Browser Runner<br/>[runner.ts]"]
  node_effects["Effect Recorder<br/>[effects.ts]"]
  node_checker["Check and Heal<br/>[check.ts]"]
  node_healer["Locator Healer<br/>[heal.ts]"]
  node_policy["Decision Policies<br/>[policy.ts]"]
  node_ledger["Heal Ledger<br/>[ledger.ts]"]
end

subgraph group_platform["Server Platform"]
  node_server["HTTP API<br/>[main.ts]"]
  node_store[("SQLite Store<br/>[db.ts]")]
  node_identity["Accounts and Tenancy<br/>[tenancy.ts]"]
  node_github["GitHub Integration<br/>[github.ts]"]
  node_jira_hub["Jira Connections<br/>[jira-hub.ts]"]
  node_agent_api["Agent and MCP<br/>[agent.ts]"]
  node_arena["Live Agent Arena<br/>[arena.ts]"]
end

subgraph group_interfaces["Operator Interfaces"]
  node_dashboard["Control Dashboard<br/>[main.tsx]"]
  node_dashboard_api["Dashboard API Client<br/>[api.ts]"]
  node_office["3D Project Offices<br/>[main.ts]"]
  node_office_live["Office Live View<br/>[live.ts]"]
end

subgraph group_demo["Demo Target"]
  node_shoplite["ShopLite Demo<br/>[server.ts]"]
  node_mutations["Drift and Regressions<br/>[mutations.ts]"]
end

node_operator(("Operator"))
node_llm["LLM Endpoint"]
node_browser["Playwright Browser"]

node_operator -->|"operates"| node_dashboard
node_dashboard -->|"requests data"| node_dashboard_api
node_dashboard_api -->|"calls API"| node_server
node_server -->|"routes workflow"| node_service
node_service -->|"compiles criteria"| node_compiler
node_compiler -->|"builds contract"| node_contract
node_service -->|"advances stages"| node_stage_machine
node_service -.->|"generates specs"| node_codegen
node_codegen -.->|"writes suite"| node_suite
node_service -->|"records baseline"| node_baseline
node_service -->|"checks suite"| node_checker
node_baseline -->|"runs criteria"| node_runner
node_runner -->|"records effects"| node_effects
node_checker -->|"runs checks"| node_runner
node_checker -->|"proposes repairs"| node_healer
node_checker -.->|"evaluates rules"| node_policy
node_checker -.->|"records decisions"| node_ledger
node_runner -->|"drives"| node_browser
node_service -.->|"persists workflow"| node_store
node_server -.->|"uses storage"| node_store
node_server -->|"authenticates users"| node_identity
node_server -->|"registers integration"| node_github
node_server -->|"registers integration"| node_jira_hub
node_server -->|"creates agent API"| node_agent_api
node_server -->|"configures arena"| node_arena
node_office -->|"subscribes live"| node_office_live
node_office_live -.->|"fetches and streams"| node_server
node_arena -->|"loads mutations"| node_mutations
node_arena -->|"records baseline"| node_baseline
node_shoplite -->|"applies flags"| node_mutations
node_llm -.->|"assists compilation"| node_compiler
node_ticket_source -.->|"supplies criteria"| node_service

click node_ticket_source "https://github.com/krishna-10-7/build/blob/main/apps/server/src/jira.ts"
click node_compiler "https://github.com/krishna-10-7/build/blob/main/packages/core/src/compile.ts"
click node_contract "https://github.com/krishna-10-7/build/blob/main/packages/core/src/contract.ts"
click node_stage_machine "https://github.com/krishna-10-7/build/blob/main/apps/server/src/pipeline.ts"
click node_service "https://github.com/krishna-10-7/build/blob/main/apps/server/src/service.ts"
click node_codegen "https://github.com/krishna-10-7/build/blob/main/packages/engine/src/codegen.ts"
click node_suite "https://github.com/krishna-10-7/build/blob/main/packages/engine/src/suite.ts"
click node_baseline "https://github.com/krishna-10-7/build/blob/main/packages/engine/src/ground.ts"
click node_runner "https://github.com/krishna-10-7/build/blob/main/packages/engine/src/runner.ts"
click node_effects "https://github.com/krishna-10-7/build/blob/main/packages/engine/src/effects.ts"
click node_checker "https://github.com/krishna-10-7/build/blob/main/packages/engine/src/check.ts"
click node_healer "https://github.com/krishna-10-7/build/blob/main/packages/engine/src/heal.ts"
click node_policy "https://github.com/krishna-10-7/build/blob/main/packages/core/src/policy.ts"
click node_ledger "https://github.com/krishna-10-7/build/blob/main/packages/core/src/ledger.ts"
click node_server "https://github.com/krishna-10-7/build/blob/main/apps/server/src/main.ts"
click node_store "https://github.com/krishna-10-7/build/blob/main/apps/server/src/db.ts"
click node_identity "https://github.com/krishna-10-7/build/blob/main/apps/server/src/tenancy.ts"
click node_github "https://github.com/krishna-10-7/build/blob/main/apps/server/src/github.ts"
click node_jira_hub "https://github.com/krishna-10-7/build/blob/main/apps/server/src/jira-hub.ts"
click node_agent_api "https://github.com/krishna-10-7/build/blob/main/apps/server/src/agent.ts"
click node_arena "https://github.com/krishna-10-7/build/blob/main/apps/server/src/arena/arena.ts"
click node_dashboard "https://github.com/krishna-10-7/build/blob/main/apps/dashboard/src/main.tsx"
click node_dashboard_api "https://github.com/krishna-10-7/build/blob/main/apps/dashboard/src/api.ts"
click node_office "https://github.com/krishna-10-7/build/blob/main/apps/office/src/main.ts"
click node_office_live "https://github.com/krishna-10-7/build/blob/main/apps/office/src/live.ts"
click node_shoplite "https://github.com/krishna-10-7/build/blob/main/apps/shoplite/src/server.ts"
click node_mutations "https://github.com/krishna-10-7/build/blob/main/apps/shoplite/src/mutations.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_ticket_source,node_compiler,node_contract,node_stage_machine,node_service,node_codegen,node_suite,node_browser toneBlue
class node_baseline,node_runner,node_effects,node_checker,node_healer,node_policy,node_ledger toneAmber
class node_server,node_store,node_identity,node_github,node_jira_hub,node_agent_api,node_arena toneMint
class node_dashboard,node_dashboard_api,node_office,node_office_live toneRose
class node_shoplite,node_mutations,node_operator,node_llm toneIndigo
```

## Components

### Ticket Workflow

- [Jira Tickets](https://github.com/krishna-10-7/build/blob/main/apps/server/src/jira.ts): `apps/server/src/jira.ts`
- [Criteria Compiler](https://github.com/krishna-10-7/build/blob/main/packages/core/src/compile.ts): `packages/core/src/compile.ts`
- [Contract Schema](https://github.com/krishna-10-7/build/blob/main/packages/core/src/contract.ts): `packages/core/src/contract.ts`
- [Stage Machine](https://github.com/krishna-10-7/build/blob/main/apps/server/src/pipeline.ts): `apps/server/src/pipeline.ts`
- [Workflow Service](https://github.com/krishna-10-7/build/blob/main/apps/server/src/service.ts): `apps/server/src/service.ts`
- [Spec Generation](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/codegen.ts): `packages/engine/src/codegen.ts`
- [Suite Files](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/suite.ts): `packages/engine/src/suite.ts`

### Test and Repair

- [Grounding Baseline](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/ground.ts): `packages/engine/src/ground.ts`
- [Browser Runner](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/runner.ts): `packages/engine/src/runner.ts`
- [Effect Recorder](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/effects.ts): `packages/engine/src/effects.ts`
- [Check and Heal](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/check.ts): `packages/engine/src/check.ts`
- [Locator Healer](https://github.com/krishna-10-7/build/blob/main/packages/engine/src/heal.ts): `packages/engine/src/heal.ts`
- [Decision Policies](https://github.com/krishna-10-7/build/blob/main/packages/core/src/policy.ts): `packages/core/src/policy.ts`
- [Heal Ledger](https://github.com/krishna-10-7/build/blob/main/packages/core/src/ledger.ts): `packages/core/src/ledger.ts`

### Server Platform

- [HTTP API](https://github.com/krishna-10-7/build/blob/main/apps/server/src/main.ts): `apps/server/src/main.ts`
- [SQLite Store](https://github.com/krishna-10-7/build/blob/main/apps/server/src/db.ts): `apps/server/src/db.ts`
- [Accounts and Tenancy](https://github.com/krishna-10-7/build/blob/main/apps/server/src/tenancy.ts): `apps/server/src/tenancy.ts`
- [GitHub Integration](https://github.com/krishna-10-7/build/blob/main/apps/server/src/github.ts): `apps/server/src/github.ts`
- [Jira Connections](https://github.com/krishna-10-7/build/blob/main/apps/server/src/jira-hub.ts): `apps/server/src/jira-hub.ts`
- [Agent and MCP](https://github.com/krishna-10-7/build/blob/main/apps/server/src/agent.ts): `apps/server/src/agent.ts`
- [Live Agent Arena](https://github.com/krishna-10-7/build/blob/main/apps/server/src/arena/arena.ts): `apps/server/src/arena/arena.ts`

### Operator Interfaces

- [Control Dashboard](https://github.com/krishna-10-7/build/blob/main/apps/dashboard/src/main.tsx): `apps/dashboard/src/main.tsx`
- [Dashboard API Client](https://github.com/krishna-10-7/build/blob/main/apps/dashboard/src/api.ts): `apps/dashboard/src/api.ts`
- [3D Project Offices](https://github.com/krishna-10-7/build/blob/main/apps/office/src/main.ts): `apps/office/src/main.ts`
- [Office Live View](https://github.com/krishna-10-7/build/blob/main/apps/office/src/live.ts): `apps/office/src/live.ts`

### Demo Target

- [ShopLite Demo](https://github.com/krishna-10-7/build/blob/main/apps/shoplite/src/server.ts): `apps/shoplite/src/server.ts`
- [Drift and Regressions](https://github.com/krishna-10-7/build/blob/main/apps/shoplite/src/mutations.ts): `apps/shoplite/src/mutations.ts`

### Other components

- **Operator**
- **LLM Endpoint**
- **Playwright Browser**

## Connections

- Operator → Control Dashboard: operates (evidence: `apps/dashboard/src/main.tsx`)
- Control Dashboard → Dashboard API Client: requests data (evidence: `apps/dashboard/src/main.tsx`)
- Dashboard API Client → HTTP API: calls API (evidence: `apps/dashboard/src/api.ts`)
- HTTP API → Workflow Service: routes workflow (evidence: `apps/server/src/main.ts`)
- Workflow Service → Criteria Compiler: compiles criteria (evidence: `apps/server/src/service.ts`)
- Criteria Compiler → Contract Schema: builds contract (evidence: `packages/core/src/compile.ts`)
- Workflow Service → Stage Machine: advances stages (evidence: `apps/server/src/service.ts`)
- Workflow Service → Spec Generation: generates specs
- Spec Generation → Suite Files: writes suite
- Workflow Service → Grounding Baseline: records baseline (evidence: `apps/server/src/service.ts`)
- Workflow Service → Check and Heal: checks suite (evidence: `apps/server/src/service.ts`)
- Grounding Baseline → Browser Runner: runs criteria (evidence: `packages/engine/src/ground.ts`)
- Browser Runner → Effect Recorder: records effects (evidence: `packages/engine/src/runner.ts`)
- Check and Heal → Browser Runner: runs checks (evidence: `packages/engine/src/check.ts`)
- Check and Heal → Locator Healer: proposes repairs (evidence: `packages/engine/src/check.ts`)
- Check and Heal → Decision Policies: evaluates rules
- Check and Heal → Heal Ledger: records decisions
- Browser Runner → Playwright Browser: drives (evidence: `packages/engine/src/runner.ts`)
- Workflow Service → SQLite Store: persists workflow (evidence: `apps/server/src/service.ts`)
- HTTP API → SQLite Store: uses storage (evidence: `apps/server/src/main.ts`)
- HTTP API → Accounts and Tenancy: authenticates users (evidence: `apps/server/src/main.ts`)
- HTTP API → GitHub Integration: registers integration (evidence: `apps/server/src/main.ts`)
- HTTP API → Jira Connections: registers integration (evidence: `apps/server/src/main.ts`)
- HTTP API → Agent and MCP: creates agent API (evidence: `apps/server/src/main.ts`)
- HTTP API → Live Agent Arena: configures arena (evidence: `apps/server/src/main.ts`)
- 3D Project Offices → Office Live View: subscribes live (evidence: `apps/office/src/main.ts`)
- Office Live View → HTTP API: fetches and streams
- Live Agent Arena → Drift and Regressions: loads mutations (evidence: `apps/server/src/arena/arena.ts`)
- Live Agent Arena → Grounding Baseline: records baseline (evidence: `apps/server/src/arena/arena.ts`)
- ShopLite Demo → Drift and Regressions: applies flags (evidence: `apps/shoplite/src/server.ts`)
- LLM Endpoint → Criteria Compiler: assists compilation
- Jira Tickets → Workflow Service: supplies criteria (evidence: `apps/server/src/service.ts`)
