# abtn/watch-architecture-rev2 architecture

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

- Interactive diagram: https://gitdiagram.com/abtn/watch-architecture-rev2
- Repository: https://github.com/abtn/watch-architecture-rev2

## Overview

Watch preserves evidence, team knowledge, and lessons from AI-assisted work. The principal cycle is observation and snapshotting, bounded context assembly, task execution and world-memory proposals, application validation and durable commit, outcome evaluation, and governed learning for reuse. The graph also includes strategic planning, knowledge review, revalidation, and retrieval. Some links reflect README-described behavior; sampled excerpts do not expose every runtime call path.

Main entry points: [`core/models.py`](https://github.com/abtn/watch-architecture-rev2/blob/main/core/models.py) (Canonical records), [`core/task_runtime.py`](https://github.com/abtn/watch-architecture-rev2/blob/main/core/task_runtime.py) (Task runtime), [`core/context_assembly.py`](https://github.com/abtn/watch-architecture-rev2/blob/main/core/context_assembly.py) (Context assembly), [`core/update_thread_worker.py`](https://github.com/abtn/watch-architecture-rev2/blob/main/core/update_thread_worker.py) (Update worker)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_observe["Observation and memory"]
  node_ingest["Source ingestion<br/>[ingestion.py]"]
  node_fetch["Source fetching<br/>[source_fetch.py]"]
  node_threads["Update threads<br/>[update_thread.py]"]
  node_thread_context["Thread context"]
  node_world["World memory<br/>[world_memory.py]"]
  node_thread_worker["Update worker"]
end

subgraph group_work["Task and strategy"]
  node_task_runtime["Task runtime<br/>[task_runtime.py]"]
  node_dispatcher["Task dispatcher<br/>[dispatcher.py]"]
  node_objectives["Objectives<br/>[objectives.py]"]
  node_assessment["State assessment"]
  node_strategy["Strategy proposals<br/>[strategy.py]"]
  node_plans["Plans<br/>[plans.py]"]
  node_execution["Execution assessment"]
end

subgraph group_learning["Experience governance"]
  node_evaluation["Outcome evaluation<br/>[evaluations.py]"]
  node_distiller["Experience distiller"]
  node_approval["Knowledge approval"]
  node_commit["Learning commits<br/>[learning_commit.py]"]
  node_history["Learning history"]
  node_lifecycle["Knowledge lifecycle"]
  node_quality["Knowledge quality"]
  node_revalidation["Knowledge revalidation"]
end

subgraph group_reuse["Context and retrieval"]
  node_context["Context assembly"]
  node_index["Knowledge index<br/>[knowledge_index.py]"]
  node_embeddings["Embeddings<br/>[embeddings.py]"]
end

subgraph group_records["Persistence and evidence"]
  node_models[("Canonical records<br/>[models.py]")]
  node_snapshots[("Snapshot store<br/>[snapshot_store.py]")]
end

node_team(("Team / operator"))
node_sources(("Configured sources"))
node_worker(("Workers / models"))

node_sources -.->|"provide content"| node_fetch
node_fetch -.->|"supply sources"| node_ingest
node_ingest -->|"preserve snapshots"| node_snapshots
node_ingest -->|"record signals"| node_models
node_team -->|"set objectives"| node_objectives
node_objectives -->|"commit lifecycle"| node_models
node_objectives -->|"scope assessment"| node_assessment
node_assessment -->|"read state"| node_models
node_assessment -->|"inform strategy"| node_strategy
node_strategy -->|"organize work"| node_plans
node_team -.->|"request work"| node_dispatcher
node_dispatcher -.->|"dispatch tasks"| node_task_runtime
node_plans -.->|"govern execution"| node_task_runtime
node_task_runtime -->|"admit and finalize"| node_models
node_task_runtime -->|"run update tasks"| node_thread_worker
node_thread_worker -->|"request generation"| node_worker
node_thread_worker -->|"assemble thread context"| node_thread_context
node_thread_worker -->|"submit proposals"| node_world
node_thread_context -->|"load thread"| node_threads
node_world -->|"validate and commit"| node_models
node_world -.->|"bind evidence"| node_snapshots
node_task_runtime -.->|"record outcomes"| node_execution
node_execution -.->|"assess results"| node_evaluation
node_evaluation -->|"record evaluations"| node_models
node_task_runtime -.->|"propose learning"| node_distiller
node_distiller -->|"generate candidate"| node_worker
node_distiller -->|"record proposal"| node_models
node_approval -->|"validate approval"| node_models
node_commit -->|"check approval"| node_approval
node_commit -->|"commit accepted change"| node_models
node_history -->|"reconstruct history"| node_models
node_lifecycle -->|"assess lifecycle"| node_models
node_quality -->|"assess quality"| node_models
node_revalidation -->|"assess evidence"| node_models
node_task_runtime -->|"schedule review"| node_lifecycle
node_task_runtime -->|"schedule assessment"| node_quality
node_task_runtime -->|"schedule revalidation"| node_revalidation
node_context -->|"retrieve knowledge"| node_index
node_context -->|"resolve experience"| node_history
node_context -->|"include current state"| node_assessment
node_context -->|"resolve provenance"| node_snapshots
node_context -->|"resolve canonical records"| node_models
node_index -->|"embed content"| node_embeddings
node_index -->|"index eligible records"| node_models
node_task_runtime -.->|"assemble task context"| node_context
node_snapshots -.->|"reference snapshots"| node_models

click node_ingest "https://github.com/abtn/watch-architecture-rev2/blob/main/core/ingestion.py"
click node_fetch "https://github.com/abtn/watch-architecture-rev2/blob/main/core/source_fetch.py"
click node_threads "https://github.com/abtn/watch-architecture-rev2/blob/main/core/update_thread.py"
click node_thread_context "https://github.com/abtn/watch-architecture-rev2/blob/main/core/update_thread_context.py"
click node_world "https://github.com/abtn/watch-architecture-rev2/blob/main/core/world_memory.py"
click node_thread_worker "https://github.com/abtn/watch-architecture-rev2/blob/main/core/update_thread_worker.py"
click node_task_runtime "https://github.com/abtn/watch-architecture-rev2/blob/main/core/task_runtime.py"
click node_dispatcher "https://github.com/abtn/watch-architecture-rev2/blob/main/core/dispatcher.py"
click node_objectives "https://github.com/abtn/watch-architecture-rev2/blob/main/core/objectives.py"
click node_assessment "https://github.com/abtn/watch-architecture-rev2/blob/main/core/state_assessment.py"
click node_strategy "https://github.com/abtn/watch-architecture-rev2/blob/main/core/strategy.py"
click node_plans "https://github.com/abtn/watch-architecture-rev2/blob/main/core/plans.py"
click node_execution "https://github.com/abtn/watch-architecture-rev2/blob/main/core/execution_assessment.py"
click node_evaluation "https://github.com/abtn/watch-architecture-rev2/blob/main/core/evaluations.py"
click node_distiller "https://github.com/abtn/watch-architecture-rev2/blob/main/core/experience_distiller.py"
click node_approval "https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_approval.py"
click node_commit "https://github.com/abtn/watch-architecture-rev2/blob/main/core/learning_commit.py"
click node_history "https://github.com/abtn/watch-architecture-rev2/blob/main/core/learning_history.py"
click node_lifecycle "https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_lifecycle.py"
click node_quality "https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_quality.py"
click node_revalidation "https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_revalidation.py"
click node_context "https://github.com/abtn/watch-architecture-rev2/blob/main/core/context_assembly.py"
click node_index "https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_index.py"
click node_embeddings "https://github.com/abtn/watch-architecture-rev2/blob/main/core/embeddings.py"
click node_models "https://github.com/abtn/watch-architecture-rev2/blob/main/core/models.py"
click node_snapshots "https://github.com/abtn/watch-architecture-rev2/blob/main/core/snapshot_store.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_ingest,node_fetch,node_threads,node_thread_context,node_world,node_thread_worker toneBlue
class node_task_runtime,node_dispatcher,node_objectives,node_assessment,node_strategy,node_plans,node_execution toneAmber
class node_evaluation,node_distiller,node_approval,node_commit,node_history,node_lifecycle,node_quality,node_revalidation toneMint
class node_context,node_index,node_embeddings,node_worker toneRose
class node_models,node_snapshots,node_team,node_sources toneIndigo
```

## Components

### Observation and memory

- [Source ingestion](https://github.com/abtn/watch-architecture-rev2/blob/main/core/ingestion.py): `core/ingestion.py`
- [Source fetching](https://github.com/abtn/watch-architecture-rev2/blob/main/core/source_fetch.py): `core/source_fetch.py`
- [Update threads](https://github.com/abtn/watch-architecture-rev2/blob/main/core/update_thread.py): `core/update_thread.py`
- [Thread context](https://github.com/abtn/watch-architecture-rev2/blob/main/core/update_thread_context.py): `core/update_thread_context.py`
- [World memory](https://github.com/abtn/watch-architecture-rev2/blob/main/core/world_memory.py): `core/world_memory.py`
- [Update worker](https://github.com/abtn/watch-architecture-rev2/blob/main/core/update_thread_worker.py): `core/update_thread_worker.py`

### Task and strategy

- [Task runtime](https://github.com/abtn/watch-architecture-rev2/blob/main/core/task_runtime.py): `core/task_runtime.py`
- [Task dispatcher](https://github.com/abtn/watch-architecture-rev2/blob/main/core/dispatcher.py): `core/dispatcher.py`
- [Objectives](https://github.com/abtn/watch-architecture-rev2/blob/main/core/objectives.py): `core/objectives.py`
- [State assessment](https://github.com/abtn/watch-architecture-rev2/blob/main/core/state_assessment.py): `core/state_assessment.py`
- [Strategy proposals](https://github.com/abtn/watch-architecture-rev2/blob/main/core/strategy.py): `core/strategy.py`
- [Plans](https://github.com/abtn/watch-architecture-rev2/blob/main/core/plans.py): `core/plans.py`
- [Execution assessment](https://github.com/abtn/watch-architecture-rev2/blob/main/core/execution_assessment.py): `core/execution_assessment.py`

### Experience governance

- [Outcome evaluation](https://github.com/abtn/watch-architecture-rev2/blob/main/core/evaluations.py): `core/evaluations.py`
- [Experience distiller](https://github.com/abtn/watch-architecture-rev2/blob/main/core/experience_distiller.py): `core/experience_distiller.py`
- [Knowledge approval](https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_approval.py): `core/knowledge_approval.py`
- [Learning commits](https://github.com/abtn/watch-architecture-rev2/blob/main/core/learning_commit.py): `core/learning_commit.py`
- [Learning history](https://github.com/abtn/watch-architecture-rev2/blob/main/core/learning_history.py): `core/learning_history.py`
- [Knowledge lifecycle](https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_lifecycle.py): `core/knowledge_lifecycle.py`
- [Knowledge quality](https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_quality.py): `core/knowledge_quality.py`
- [Knowledge revalidation](https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_revalidation.py): `core/knowledge_revalidation.py`

### Context and retrieval

- [Context assembly](https://github.com/abtn/watch-architecture-rev2/blob/main/core/context_assembly.py): `core/context_assembly.py`
- [Knowledge index](https://github.com/abtn/watch-architecture-rev2/blob/main/core/knowledge_index.py): `core/knowledge_index.py`
- [Embeddings](https://github.com/abtn/watch-architecture-rev2/blob/main/core/embeddings.py): `core/embeddings.py`

### Persistence and evidence

- [Canonical records](https://github.com/abtn/watch-architecture-rev2/blob/main/core/models.py): `core/models.py`
- [Snapshot store](https://github.com/abtn/watch-architecture-rev2/blob/main/core/snapshot_store.py): `core/snapshot_store.py`

### Other components

- **Team / operator**
- **Configured sources**
- **Workers / models**

## Connections

- Configured sources → Source fetching: provide content
- Source fetching → Source ingestion: supply sources
- Source ingestion → Snapshot store: preserve snapshots (evidence: `core/ingestion.py`)
- Source ingestion → Canonical records: record signals (evidence: `core/ingestion.py`)
- Team / operator → Objectives: set objectives
- Objectives → Canonical records: commit lifecycle (evidence: `core/objectives.py`)
- Objectives → State assessment: scope assessment
- State assessment → Canonical records: read state (evidence: `core/state_assessment.py`)
- State assessment → Strategy proposals: inform strategy (evidence: `core/strategy.py`)
- Strategy proposals → Plans: organize work (evidence: `core/plans.py`)
- Team / operator → Task dispatcher: request work
- Task dispatcher → Task runtime: dispatch tasks
- Plans → Task runtime: govern execution (evidence: `core/task_runtime.py`)
- Task runtime → Canonical records: admit and finalize (evidence: `core/task_runtime.py`)
- Task runtime → Update worker: run update tasks (evidence: `core/update_thread_worker.py`)
- Update worker → Workers / models: request generation (evidence: `core/update_thread_worker.py`)
- Update worker → Thread context: assemble thread context (evidence: `core/update_thread_worker.py`)
- Update worker → World memory: submit proposals (evidence: `core/update_thread_worker.py`)
- Thread context → Update threads: load thread (evidence: `core/update_thread_context.py`)
- World memory → Canonical records: validate and commit (evidence: `core/world_memory.py`)
- World memory → Snapshot store: bind evidence (evidence: `core/world_memory.py`)
- Task runtime → Execution assessment: record outcomes
- Execution assessment → Outcome evaluation: assess results
- Outcome evaluation → Canonical records: record evaluations (evidence: `core/evaluations.py`)
- Task runtime → Experience distiller: propose learning (evidence: `core/task_runtime.py`)
- Experience distiller → Workers / models: generate candidate (evidence: `core/experience_distiller.py`)
- Experience distiller → Canonical records: record proposal (evidence: `core/experience_distiller.py`)
- Knowledge approval → Canonical records: validate approval (evidence: `core/knowledge_approval.py`)
- Learning commits → Knowledge approval: check approval (evidence: `core/learning_commit.py`)
- Learning commits → Canonical records: commit accepted change (evidence: `core/learning_commit.py`)
- Learning history → Canonical records: reconstruct history (evidence: `core/learning_history.py`)
- Knowledge lifecycle → Canonical records: assess lifecycle (evidence: `core/knowledge_lifecycle.py`)
- Knowledge quality → Canonical records: assess quality (evidence: `core/knowledge_quality.py`)
- Knowledge revalidation → Canonical records: assess evidence (evidence: `core/knowledge_revalidation.py`)
- Task runtime → Knowledge lifecycle: schedule review (evidence: `core/task_runtime.py`)
- Task runtime → Knowledge quality: schedule assessment (evidence: `core/task_runtime.py`)
- Task runtime → Knowledge revalidation: schedule revalidation (evidence: `core/task_runtime.py`)
- Context assembly → Knowledge index: retrieve knowledge (evidence: `core/context_assembly.py`)
- Context assembly → Learning history: resolve experience (evidence: `core/context_assembly.py`)
- Context assembly → State assessment: include current state (evidence: `core/context_assembly.py`)
- Context assembly → Snapshot store: resolve provenance (evidence: `core/context_assembly.py`)
- Context assembly → Canonical records: resolve canonical records (evidence: `core/context_assembly.py`)
- Knowledge index → Embeddings: embed content (evidence: `core/knowledge_index.py`)
- Knowledge index → Canonical records: index eligible records (evidence: `core/knowledge_index.py`)
- Task runtime → Context assembly: assemble task context
- Snapshot store → Canonical records: reference snapshots
