# tw0m8/tizenlite architecture

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

- Interactive diagram: https://gitdiagram.com/tw0m8/tizenlite
- Repository: https://github.com/tw0m8/tizenlite

## Overview

Tizen Lite is an agent-oriented toolkit and skill for reducing Samsung Tizen TV background load reversibly. The main workflow is to inspect the TV, apply one-time app removals and configuration changes, then reapply boot-volatile masks after each power-on. The README documents the operational stages and capabilities; sampled source shows the TV command relay and CLI backend. Several product subsystems are represented by their exact enclosing directories because their implementation was not sampled.

Main entry points: [`bin/tv-root-apply`](https://github.com/tw0m8/tizenlite/blob/main/bin/tv-root-apply) (Root state applier), [`skills/tizen-lite`](https://github.com/tw0m8/tizenlite/tree/main/skills/tizen-lite) (Tizen Lite skill), [`bin/tv`](https://github.com/tw0m8/tizenlite/blob/main/bin/tv) (TV CLI), [`bin/tvlib.py`](https://github.com/tw0m8/tizenlite/blob/main/bin/tvlib.py) (TV command backend)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_guidance["Agent guidance"]
  node_agent_skill["Tizen Lite skill"]
  node_agent_playbooks["Troubleshooting playbooks"]
end

subgraph group_host_control["Host control"]
  node_tv_cli["TV CLI"]
  node_tvlib["TV command backend<br/>[tvlib.py]"]
  node_agent_client["Agent loop client<br/>[tv-agent-loop.sh]"]
  node_relay["Command relay<br/>[tv-agent-server.py]"]
  node_watchdog["Boot watchdog"]
  node_host_state[("Host relay state<br/>[tv-agent-server.py]")]
end

subgraph group_tv_changes["TV changes"]
  node_root_apply["Root state applier"]
  node_app_removal["Reversible app removal<br/>[restore.sh]"]
  node_unit_management["Unit and process control"]
  node_launcher["Launcher setup"]
  node_privacy["ACR and telemetry controls"]
  node_dns["DNS rewrites<br/>[tvlib.py]"]
end

subgraph group_operations["Operations and recovery"]
  node_audit["TV audit<br/>[audit.sh]"]
  node_status["TV status and logs<br/>[tvlib.py]"]
  node_restore["Restore changes<br/>[restore.sh]"]
end

node_operator(("TV owner or operator"))
node_tv(("Samsung Tizen TV"))
node_root_chain(("External root chain"))

node_operator -->|"uses guidance"| node_agent_skill
node_agent_skill -->|"provides playbooks"| node_agent_playbooks
node_operator -->|"runs audit"| node_audit
node_operator -->|"runs commands"| node_tv_cli
node_tv_cli -.->|"uses backend"| node_tvlib
node_tvlib -->|"submits TV work"| node_agent_client
node_tv -->|"polls commands"| node_relay
node_relay -->|"reads and writes"| node_host_state
node_root_chain -->|"provides root access"| node_root_apply
node_operator -->|"applies TV state"| node_root_apply
node_watchdog -->|"reapplies at boot"| node_root_apply
node_root_apply -.->|"manages units"| node_unit_management
node_operator -->|"removes apps"| node_app_removal
node_app_removal -->|"supports undo"| node_restore
node_operator -->|"sets up launcher"| node_launcher
node_operator -->|"disables tracking"| node_privacy
node_operator -->|"manages rewrites"| node_dns
node_operator -->|"checks TV"| node_status
node_status -->|"queries status"| node_tv
node_operator -->|"restores changes"| node_restore

click node_agent_skill "https://github.com/tw0m8/tizenlite/tree/main/skills/tizen-lite"
click node_agent_playbooks "https://github.com/tw0m8/tizenlite/tree/main/agent/playbooks"
click node_audit "https://github.com/tw0m8/tizenlite/blob/main/agent/audit.sh"
click node_tv_cli "https://github.com/tw0m8/tizenlite/blob/main/bin/tv"
click node_tvlib "https://github.com/tw0m8/tizenlite/blob/main/bin/tvlib.py"
click node_agent_client "https://github.com/tw0m8/tizenlite/blob/main/bin/tv-agent-loop.sh"
click node_relay "https://github.com/tw0m8/tizenlite/blob/main/bin/tv-agent-server.py"
click node_root_apply "https://github.com/tw0m8/tizenlite/blob/main/bin/tv-root-apply"
click node_watchdog "https://github.com/tw0m8/tizenlite/blob/main/bin/tv-root-watchdog"
click node_app_removal "https://github.com/tw0m8/tizenlite/blob/main/restore.sh"
click node_unit_management "https://github.com/tw0m8/tizenlite/blob/main/bin/tv-root-apply"
click node_launcher "https://github.com/tw0m8/tizenlite/tree/main/skills/tizen-lite"
click node_privacy "https://github.com/tw0m8/tizenlite/tree/main/skills/tizen-lite"
click node_dns "https://github.com/tw0m8/tizenlite/blob/main/bin/tvlib.py"
click node_status "https://github.com/tw0m8/tizenlite/blob/main/bin/tvlib.py"
click node_restore "https://github.com/tw0m8/tizenlite/blob/main/restore.sh"
click node_host_state "https://github.com/tw0m8/tizenlite/blob/main/bin/tv-agent-server.py"

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_agent_skill,node_agent_playbooks toneBlue
class node_tv_cli,node_tvlib,node_agent_client,node_relay,node_watchdog,node_host_state toneAmber
class node_root_apply,node_app_removal,node_unit_management,node_launcher,node_privacy,node_dns toneMint
class node_audit,node_status,node_restore toneRose
class node_operator,node_tv,node_root_chain toneIndigo
```

## Components

### Agent guidance

- [Tizen Lite skill](https://github.com/tw0m8/tizenlite/tree/main/skills/tizen-lite): `skills/tizen-lite`
- [Troubleshooting playbooks](https://github.com/tw0m8/tizenlite/tree/main/agent/playbooks): `agent/playbooks`

### Host control

- [TV CLI](https://github.com/tw0m8/tizenlite/blob/main/bin/tv): `bin/tv`
- [TV command backend](https://github.com/tw0m8/tizenlite/blob/main/bin/tvlib.py): `bin/tvlib.py`
- [Agent loop client](https://github.com/tw0m8/tizenlite/blob/main/bin/tv-agent-loop.sh): `bin/tv-agent-loop.sh`
- [Command relay](https://github.com/tw0m8/tizenlite/blob/main/bin/tv-agent-server.py): `bin/tv-agent-server.py`
- [Boot watchdog](https://github.com/tw0m8/tizenlite/blob/main/bin/tv-root-watchdog): `bin/tv-root-watchdog`
- [Host relay state](https://github.com/tw0m8/tizenlite/blob/main/bin/tv-agent-server.py): `bin/tv-agent-server.py`

### TV changes

- [Root state applier](https://github.com/tw0m8/tizenlite/blob/main/bin/tv-root-apply): `bin/tv-root-apply`
- [Reversible app removal](https://github.com/tw0m8/tizenlite/blob/main/restore.sh): `restore.sh`
- [Unit and process control](https://github.com/tw0m8/tizenlite/blob/main/bin/tv-root-apply): `bin/tv-root-apply`
- [Launcher setup](https://github.com/tw0m8/tizenlite/tree/main/skills/tizen-lite): `skills/tizen-lite`
- [ACR and telemetry controls](https://github.com/tw0m8/tizenlite/tree/main/skills/tizen-lite): `skills/tizen-lite`
- [DNS rewrites](https://github.com/tw0m8/tizenlite/blob/main/bin/tvlib.py): `bin/tvlib.py`

### Operations and recovery

- [TV audit](https://github.com/tw0m8/tizenlite/blob/main/agent/audit.sh): `agent/audit.sh`
- [TV status and logs](https://github.com/tw0m8/tizenlite/blob/main/bin/tvlib.py): `bin/tvlib.py`
- [Restore changes](https://github.com/tw0m8/tizenlite/blob/main/restore.sh): `restore.sh`

### Other components

- **TV owner or operator**
- **Samsung Tizen TV**
- **External root chain**

## Connections

- TV owner or operator → Tizen Lite skill: uses guidance (evidence: `README.md`)
- Tizen Lite skill → Troubleshooting playbooks: provides playbooks (evidence: `README.md`)
- TV owner or operator → TV audit: runs audit (evidence: `README.md`)
- TV owner or operator → TV CLI: runs commands (evidence: `README.md`)
- TV CLI → TV command backend: uses backend
- TV command backend → Agent loop client: submits TV work (evidence: `bin/tvlib.py`)
- Samsung Tizen TV → Command relay: polls commands (evidence: `bin/tv-agent-server.py`)
- Command relay → Host relay state: reads and writes (evidence: `bin/tv-agent-server.py`)
- External root chain → Root state applier: provides root access (evidence: `README.md`)
- TV owner or operator → Root state applier: applies TV state (evidence: `README.md`)
- Boot watchdog → Root state applier: reapplies at boot (evidence: `README.md`)
- Root state applier → Unit and process control: manages units
- TV owner or operator → Reversible app removal: removes apps (evidence: `README.md`)
- Reversible app removal → Restore changes: supports undo (evidence: `README.md`)
- TV owner or operator → Launcher setup: sets up launcher (evidence: `README.md`)
- TV owner or operator → ACR and telemetry controls: disables tracking (evidence: `README.md`)
- TV owner or operator → DNS rewrites: manages rewrites (evidence: `bin/tvlib.py`)
- TV owner or operator → TV status and logs: checks TV (evidence: `bin/tvlib.py`)
- TV status and logs → Samsung Tizen TV: queries status (evidence: `bin/tvlib.py`)
- TV owner or operator → Restore changes: restores changes (evidence: `README.md`)
