# anirban4ru/gaze architecture

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

- Interactive diagram: https://gitdiagram.com/anirban4ru/gaze
- Repository: https://github.com/anirban4ru/gaze

## Overview

GAZE is a Windows desktop privacy application: the user configures monitoring and calibration, an isolated local vision worker analyzes camera frames, and the agent evaluates observations to activate a fail-safe screen cover. The app and worker exchange commands and numeric observations over named-pipe IPC; the overlay provides synchronous cover and GPU frosted-glass layers. Settings, calibration, and platform process isolation are supporting concerns. Edges follow shown references or README architecture; some unsampled runtime links are omitted rather than inferred.

Main entry points: [`src/Gaze.Vision/Pipeline/VisionPipeline.cs`](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Pipeline/VisionPipeline.cs) (Vision pipeline), [`src/Gaze.Agent/EngineHost.cs`](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Agent/EngineHost.cs) (Engine host), [`src/Gaze.App/Services/AppController.cs`](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/Services/AppController.cs) (App controller), [`src/Gaze.VisionHost/VisionWorkerHost.cs`](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.VisionHost/VisionWorkerHost.cs) (Vision worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Desktop app"]
  node_app["WPF shell<br/>[MainWindow.xaml.cs]"]
  node_controller["App controller<br/>[AppController.cs]"]
  node_settings["Settings UI"]
  node_onboarding["Onboarding calibration"]
end

subgraph group_engine["Protection engine"]
  node_store[("Settings and calibration store<br/>[SettingsStore.cs]")]
  node_config["Settings and profiles<br/>[GazeSettings.cs]"]
  node_agent["Engine host<br/>[EngineHost.cs]"]
  node_supervisor["Vision supervisor"]
  node_state["Privacy state machine"]
  node_ipc["Named-pipe IPC<br/>[GazePipeServer.cs]"]
  node_observations["Numeric observations<br/>[Observation.cs]"]
end

subgraph group_vision["On-device vision"]
  node_worker["Vision worker"]
  node_camera["Camera capture"]
  node_pipeline["Vision pipeline<br/>[VisionPipeline.cs]"]
  node_yunet["Face detection"]
  node_landmarker["Face landmarks"]
  node_pose["Head-pose estimation"]
end

subgraph group_privacy["Privacy presentation"]
  node_overlay["Dual-layer overlay<br/>[OverlayManager.cs]"]
  node_blur["GPU blur pipeline<br/>[BlurPipeline.cs]"]
end

subgraph group_platform["Windows platform"]
  node_tray["Tray and agent shell<br/>[TrayIconService.cs]"]
  node_job["Worker process isolation"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"delegates to"| node_controller
node_controller -->|"loads settings"| node_store
node_settings -.->|"updates settings"| node_controller
node_onboarding -.->|"requests calibration"| node_controller
node_store -->|"persists"| node_config
node_controller -->|"sends commands"| node_ipc
node_agent -->|"evaluates events"| node_state
node_agent -->|"applies effects"| node_overlay
node_agent -->|"manages worker"| node_supervisor
node_agent -->|"hosts pipe"| node_ipc
node_supervisor -->|"isolates process"| node_job
node_worker -->|"sends observations"| node_ipc
node_worker -->|"processes frames"| node_pipeline
node_worker -.->|"controls capture"| node_camera
node_pipeline -->|"detects faces"| node_yunet
node_pipeline -->|"estimates landmarks"| node_landmarker
node_pipeline -->|"estimates pose"| node_pose
node_pipeline -->|"produces"| node_observations
node_overlay -->|"renders frost"| node_blur
node_tray -.->|"controls protection"| node_agent

click node_app "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/MainWindow.xaml.cs"
click node_controller "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/Services/AppController.cs"
click node_settings "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/Views/Pages/SettingsPage.xaml.cs"
click node_onboarding "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/Views/OnboardingWizardWindow.xaml.cs"
click node_store "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Config/SettingsStore.cs"
click node_config "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Config/GazeSettings.cs"
click node_agent "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Agent/EngineHost.cs"
click node_supervisor "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Agent/VisionSupervisor.cs"
click node_state "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Privacy/PrivacyStateMachine.cs"
click node_ipc "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Ipc/Transport/GazePipeServer.cs"
click node_worker "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.VisionHost/VisionWorkerHost.cs"
click node_camera "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Camera/MediaFrameCameraSource.cs"
click node_pipeline "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Pipeline/VisionPipeline.cs"
click node_yunet "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Inference/YuNetFaceDetector.cs"
click node_landmarker "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Inference/MediaPipeFaceLandmarker.cs"
click node_pose "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Geometry/SvdHeadPoseEstimator.cs"
click node_observations "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Observations/Observation.cs"
click node_overlay "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Overlay/OverlayManager.cs"
click node_blur "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Overlay/BlurPipeline.cs"
click node_tray "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Platform/Shell/TrayIconService.cs"
click node_job "https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Platform/Processes/JobObjectSupervisor.cs"

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_app,node_controller,node_settings,node_onboarding,node_user toneBlue
class node_store,node_config,node_agent,node_supervisor,node_state,node_ipc,node_observations toneAmber
class node_worker,node_camera,node_pipeline,node_yunet,node_landmarker,node_pose toneMint
class node_overlay,node_blur toneRose
class node_tray,node_job toneIndigo
```

## Components

### Desktop app

- [WPF shell](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/MainWindow.xaml.cs): `src/Gaze.App/MainWindow.xaml.cs`
- [App controller](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/Services/AppController.cs): `src/Gaze.App/Services/AppController.cs`
- [Settings UI](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/Views/Pages/SettingsPage.xaml.cs): `src/Gaze.App/Views/Pages/SettingsPage.xaml.cs`
- [Onboarding calibration](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.App/Views/OnboardingWizardWindow.xaml.cs): `src/Gaze.App/Views/OnboardingWizardWindow.xaml.cs`

### Protection engine

- [Settings and calibration store](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Config/SettingsStore.cs): `src/Gaze.Core/Config/SettingsStore.cs`
- [Settings and profiles](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Config/GazeSettings.cs): `src/Gaze.Core/Config/GazeSettings.cs`
- [Engine host](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Agent/EngineHost.cs): `src/Gaze.Agent/EngineHost.cs`
- [Vision supervisor](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Agent/VisionSupervisor.cs): `src/Gaze.Agent/VisionSupervisor.cs`
- [Privacy state machine](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Privacy/PrivacyStateMachine.cs): `src/Gaze.Core/Privacy/PrivacyStateMachine.cs`
- [Named-pipe IPC](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Ipc/Transport/GazePipeServer.cs): `src/Gaze.Ipc/Transport/GazePipeServer.cs`
- [Numeric observations](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Core/Observations/Observation.cs): `src/Gaze.Core/Observations/Observation.cs`

### On-device vision

- [Vision worker](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.VisionHost/VisionWorkerHost.cs): `src/Gaze.VisionHost/VisionWorkerHost.cs`
- [Camera capture](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Camera/MediaFrameCameraSource.cs): `src/Gaze.Vision/Camera/MediaFrameCameraSource.cs`
- [Vision pipeline](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Pipeline/VisionPipeline.cs): `src/Gaze.Vision/Pipeline/VisionPipeline.cs`
- [Face detection](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Inference/YuNetFaceDetector.cs): `src/Gaze.Vision/Inference/YuNetFaceDetector.cs`
- [Face landmarks](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Inference/MediaPipeFaceLandmarker.cs): `src/Gaze.Vision/Inference/MediaPipeFaceLandmarker.cs`
- [Head-pose estimation](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Vision/Geometry/SvdHeadPoseEstimator.cs): `src/Gaze.Vision/Geometry/SvdHeadPoseEstimator.cs`

### Privacy presentation

- [Dual-layer overlay](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Overlay/OverlayManager.cs): `src/Gaze.Overlay/OverlayManager.cs`
- [GPU blur pipeline](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Overlay/BlurPipeline.cs): `src/Gaze.Overlay/BlurPipeline.cs`

### Windows platform

- [Tray and agent shell](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Platform/Shell/TrayIconService.cs): `src/Gaze.Platform/Shell/TrayIconService.cs`
- [Worker process isolation](https://github.com/anirban4ru/gaze/blob/main/src/Gaze.Platform/Processes/JobObjectSupervisor.cs): `src/Gaze.Platform/Processes/JobObjectSupervisor.cs`

### Other components

- **User**

## Connections

- User → WPF shell: uses
- WPF shell → App controller: delegates to
- App controller → Settings and calibration store: loads settings (evidence: `src/Gaze.App/Services/AppController.cs`)
- Settings UI → App controller: updates settings
- Onboarding calibration → App controller: requests calibration
- Settings and calibration store → Settings and profiles: persists (evidence: `src/Gaze.Core/Config/SettingsStore.cs`)
- App controller → Named-pipe IPC: sends commands (evidence: `src/Gaze.App/Services/AppController.cs`)
- Engine host → Privacy state machine: evaluates events (evidence: `src/Gaze.Agent/EngineHost.cs`)
- Engine host → Dual-layer overlay: applies effects (evidence: `src/Gaze.Agent/EngineHost.cs`)
- Engine host → Vision supervisor: manages worker (evidence: `src/Gaze.Agent/EngineHost.cs`)
- Engine host → Named-pipe IPC: hosts pipe (evidence: `src/Gaze.Agent/EngineHost.cs`)
- Vision supervisor → Worker process isolation: isolates process (evidence: `src/Gaze.Agent/VisionSupervisor.cs`)
- Vision worker → Named-pipe IPC: sends observations (evidence: `src/Gaze.VisionHost/VisionWorkerHost.cs`)
- Vision worker → Vision pipeline: processes frames (evidence: `src/Gaze.VisionHost/VisionWorkerHost.cs`)
- Vision worker → Camera capture: controls capture
- Vision pipeline → Face detection: detects faces (evidence: `src/Gaze.Vision/Pipeline/VisionPipeline.cs`)
- Vision pipeline → Face landmarks: estimates landmarks (evidence: `src/Gaze.Vision/Pipeline/VisionPipeline.cs`)
- Vision pipeline → Head-pose estimation: estimates pose (evidence: `src/Gaze.Vision/Pipeline/VisionPipeline.cs`)
- Vision pipeline → Numeric observations: produces (evidence: `src/Gaze.Vision/Pipeline/VisionPipeline.cs`)
- Dual-layer overlay → GPU blur pipeline: renders frost (evidence: `src/Gaze.Overlay/OverlayManager.cs`)
- Tray and agent shell → Engine host: controls protection (evidence: `src/Gaze.Agent/EngineHost.cs`)
