# yeonb0/layered-wiki-harness architecture

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

- Interactive diagram: https://gitdiagram.com/yeonb0/layered-wiki-harness
- Repository: https://github.com/yeonb0/layered-wiki-harness

## Overview

layered-wiki-harness is an experimental harness for comparing layered-document placement and conditional-linking approaches; its product is evaluation results, not a wiki site. The principal workflow schedules documents across condition cells, retrieves candidates, sends document and run context to a workflow client, validates the verdict, conditionally stores it, and records a verdict log for later aggregation and leakage analysis. The tree and README document additional agent, labeling, and segmentation capabilities. Some v2 internals are unsampled, so uncertain links are omitted or marked dashed.

Main entry points: [`runner/sequential_runner.py`](https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/sequential_runner.py) (Sequential runner), [`run_pilot.py`](https://github.com/yeonb0/layered-wiki-harness/blob/main/run_pilot.py) (Pilot entrypoint), [`agent/placement.py`](https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/placement.py) (Layer placement), [`retrieval/search.py`](https://github.com/yeonb0/layered-wiki-harness/blob/main/retrieval/search.py) (Candidate retrieval)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experiment["Experiment runner"]
  node_pilot["Pilot entrypoint<br/>[run_pilot.py]"]
  node_config["Run configuration<br/>[run_config.py]"]
  node_scheduler["Condition schedule<br/>[conditions.py]"]
  node_sequential["Sequential runner"]
  node_coldstart["Cold-start detection<br/>[cold_start.py]"]
  node_v2runner["V2 sequential runner<br/>[v2_sequential.py]"]
  node_client["Workflow client<br/>[dify_client.py]"]
end

subgraph group_agent["Agent decisions"]
  node_validation["Verdict validation<br/>[validation.py]"]
  node_b1["B1 agent<br/>[b1.py]"]
  node_decompose["Note decomposition<br/>[decompose.py]"]
  node_placement["Layer placement<br/>[placement.py]"]
  node_prompts["Decision prompts<br/>[prompts.py]"]
  node_proposal["Proposed agent<br/>[propose.py]"]
end

subgraph group_retrieval["Retrieval and storage"]
  node_retriever["Candidate retrieval<br/>[search.py]"]
  node_embeddings["Text embeddings<br/>[embeddings.py]"]
  node_vault[("Document vault<br/>[jsonl_backend.py]")]
end

subgraph group_evaluation["Evaluation data"]
  node_log[("Verdict log<br/>[writer.py]")]
  node_aggregate["Result aggregation<br/>[aggregate.py]"]
  node_leakage["Leakage analysis<br/>[leakage.py]"]
end

subgraph group_preparation["Corpus preparation"]
  node_gold["Gold labels<br/>[gold.py]"]
  node_labeling["Label conversion<br/>[convert_labels.py]"]
  node_segmentation["Document segmentation<br/>[segment.py]"]
  node_classification["Corpus classification<br/>[classify.py]"]
end

node_operator(("Experiment operator"))
node_workflow{{"Dify workflow"}}
node_embedding_service{{"Embedding service"}}

node_operator -->|"starts run"| node_pilot
node_pilot -->|"configures"| node_config
node_pilot -->|"schedules"| node_scheduler
node_pilot -->|"runs"| node_sequential
node_pilot -.->|"supports v2"| node_v2runner
node_sequential -->|"uses schedule"| node_scheduler
node_sequential -->|"checks starts"| node_coldstart
node_sequential -->|"searches candidates"| node_retriever
node_sequential -->|"calls workflow"| node_client
node_client -->|"sends inputs"| node_workflow
node_sequential -->|"validates result"| node_validation
node_sequential -->|"stores valid verdict"| node_vault
node_sequential -->|"records outcome"| node_log
node_retriever -->|"embeds text"| node_embeddings
node_embeddings -->|"requests vectors"| node_embedding_service
node_b1 -.->|"uses"| node_decompose
node_b1 -.->|"uses"| node_placement
node_b1 -.->|"uses"| node_prompts
node_b1 -.->|"uses"| node_proposal
node_proposal -.->|"uses"| node_decompose
node_proposal -.->|"uses"| node_placement
node_proposal -.->|"uses"| node_prompts
node_prompts -->|"uses rules"| node_placement
node_prompts -->|"formats candidates"| node_retriever
node_placement -->|"reuses grouping"| node_gold
node_placement -->|"uses layer order"| node_retriever
node_aggregate -->|"reads entries"| node_log
node_leakage -.->|"compares retrieval"| node_retriever
node_labeling -.->|"supplies labels"| node_gold
node_segmentation -.->|"supports labeling"| node_labeling

click node_pilot "https://github.com/yeonb0/layered-wiki-harness/blob/main/run_pilot.py"
click node_config "https://github.com/yeonb0/layered-wiki-harness/blob/main/config/run_config.py"
click node_scheduler "https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/conditions.py"
click node_sequential "https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/sequential_runner.py"
click node_coldstart "https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/cold_start.py"
click node_v2runner "https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/v2_sequential.py"
click node_client "https://github.com/yeonb0/layered-wiki-harness/blob/main/client/dify_client.py"
click node_validation "https://github.com/yeonb0/layered-wiki-harness/blob/main/client/validation.py"
click node_b1 "https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/b1.py"
click node_decompose "https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/decompose.py"
click node_placement "https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/placement.py"
click node_prompts "https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/prompts.py"
click node_proposal "https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/propose.py"
click node_retriever "https://github.com/yeonb0/layered-wiki-harness/blob/main/retrieval/search.py"
click node_embeddings "https://github.com/yeonb0/layered-wiki-harness/blob/main/retrieval/embeddings.py"
click node_vault "https://github.com/yeonb0/layered-wiki-harness/blob/main/vault/jsonl_backend.py"
click node_log "https://github.com/yeonb0/layered-wiki-harness/blob/main/verdictlog/writer.py"
click node_aggregate "https://github.com/yeonb0/layered-wiki-harness/blob/main/analysis/aggregate.py"
click node_leakage "https://github.com/yeonb0/layered-wiki-harness/blob/main/analysis/leakage.py"
click node_gold "https://github.com/yeonb0/layered-wiki-harness/blob/main/labeling/gold.py"
click node_labeling "https://github.com/yeonb0/layered-wiki-harness/blob/main/labeling/convert_labels.py"
click node_segmentation "https://github.com/yeonb0/layered-wiki-harness/blob/main/segmentation/segment.py"
click node_classification "https://github.com/yeonb0/layered-wiki-harness/blob/main/corpus/classify.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_pilot,node_config,node_scheduler,node_sequential,node_coldstart,node_v2runner,node_client toneBlue
class node_validation,node_b1,node_decompose,node_placement,node_prompts,node_proposal toneAmber
class node_retriever,node_embeddings,node_vault toneMint
class node_log,node_aggregate,node_leakage toneRose
class node_gold,node_labeling,node_segmentation,node_classification,node_operator,node_workflow,node_embedding_service toneIndigo
```

## Components

### Experiment runner

- [Pilot entrypoint](https://github.com/yeonb0/layered-wiki-harness/blob/main/run_pilot.py): `run_pilot.py`
- [Run configuration](https://github.com/yeonb0/layered-wiki-harness/blob/main/config/run_config.py): `config/run_config.py`
- [Condition schedule](https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/conditions.py): `runner/conditions.py`
- [Sequential runner](https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/sequential_runner.py): `runner/sequential_runner.py`
- [Cold-start detection](https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/cold_start.py): `runner/cold_start.py`
- [V2 sequential runner](https://github.com/yeonb0/layered-wiki-harness/blob/main/runner/v2_sequential.py): `runner/v2_sequential.py`
- [Workflow client](https://github.com/yeonb0/layered-wiki-harness/blob/main/client/dify_client.py): `client/dify_client.py`

### Agent decisions

- [Verdict validation](https://github.com/yeonb0/layered-wiki-harness/blob/main/client/validation.py): `client/validation.py`
- [B1 agent](https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/b1.py): `agent/b1.py`
- [Note decomposition](https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/decompose.py): `agent/decompose.py`
- [Layer placement](https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/placement.py): `agent/placement.py`
- [Decision prompts](https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/prompts.py): `agent/prompts.py`
- [Proposed agent](https://github.com/yeonb0/layered-wiki-harness/blob/main/agent/propose.py): `agent/propose.py`

### Retrieval and storage

- [Candidate retrieval](https://github.com/yeonb0/layered-wiki-harness/blob/main/retrieval/search.py): `retrieval/search.py`
- [Text embeddings](https://github.com/yeonb0/layered-wiki-harness/blob/main/retrieval/embeddings.py): `retrieval/embeddings.py`
- [Document vault](https://github.com/yeonb0/layered-wiki-harness/blob/main/vault/jsonl_backend.py): `vault/jsonl_backend.py`

### Evaluation data

- [Verdict log](https://github.com/yeonb0/layered-wiki-harness/blob/main/verdictlog/writer.py): `verdictlog/writer.py`
- [Result aggregation](https://github.com/yeonb0/layered-wiki-harness/blob/main/analysis/aggregate.py): `analysis/aggregate.py`
- [Leakage analysis](https://github.com/yeonb0/layered-wiki-harness/blob/main/analysis/leakage.py): `analysis/leakage.py`

### Corpus preparation

- [Gold labels](https://github.com/yeonb0/layered-wiki-harness/blob/main/labeling/gold.py): `labeling/gold.py`
- [Label conversion](https://github.com/yeonb0/layered-wiki-harness/blob/main/labeling/convert_labels.py): `labeling/convert_labels.py`
- [Document segmentation](https://github.com/yeonb0/layered-wiki-harness/blob/main/segmentation/segment.py): `segmentation/segment.py`
- [Corpus classification](https://github.com/yeonb0/layered-wiki-harness/blob/main/corpus/classify.py): `corpus/classify.py`

### Other components

- **Experiment operator**
- **Dify workflow**
- **Embedding service**

## Connections

- Experiment operator → Pilot entrypoint: starts run (evidence: `README.md`)
- Pilot entrypoint → Run configuration: configures (evidence: `run_pilot.py`)
- Pilot entrypoint → Condition schedule: schedules (evidence: `run_pilot.py`)
- Pilot entrypoint → Sequential runner: runs (evidence: `run_pilot.py`)
- Pilot entrypoint → V2 sequential runner: supports v2
- Sequential runner → Condition schedule: uses schedule (evidence: `runner/sequential_runner.py`)
- Sequential runner → Cold-start detection: checks starts (evidence: `runner/sequential_runner.py`)
- Sequential runner → Candidate retrieval: searches candidates (evidence: `runner/sequential_runner.py`)
- Sequential runner → Workflow client: calls workflow (evidence: `runner/sequential_runner.py`)
- Workflow client → Dify workflow: sends inputs (evidence: `client/dify_client.py`)
- Sequential runner → Verdict validation: validates result (evidence: `runner/sequential_runner.py`)
- Sequential runner → Document vault: stores valid verdict (evidence: `runner/sequential_runner.py`)
- Sequential runner → Verdict log: records outcome (evidence: `runner/sequential_runner.py`)
- Candidate retrieval → Text embeddings: embeds text (evidence: `retrieval/search.py`)
- Text embeddings → Embedding service: requests vectors (evidence: `retrieval/embeddings.py`)
- B1 agent → Note decomposition: uses (evidence: `agent/b1.py`)
- B1 agent → Layer placement: uses (evidence: `agent/b1.py`)
- B1 agent → Decision prompts: uses (evidence: `agent/b1.py`)
- B1 agent → Proposed agent: uses (evidence: `agent/b1.py`)
- Proposed agent → Note decomposition: uses (evidence: `agent/propose.py`)
- Proposed agent → Layer placement: uses (evidence: `agent/propose.py`)
- Proposed agent → Decision prompts: uses (evidence: `agent/propose.py`)
- Decision prompts → Layer placement: uses rules (evidence: `agent/prompts.py`)
- Decision prompts → Candidate retrieval: formats candidates (evidence: `agent/prompts.py`)
- Layer placement → Gold labels: reuses grouping (evidence: `agent/placement.py`)
- Layer placement → Candidate retrieval: uses layer order (evidence: `agent/placement.py`)
- Result aggregation → Verdict log: reads entries (evidence: `README.md`)
- Leakage analysis → Candidate retrieval: compares retrieval (evidence: `analysis/leakage.py`)
- Label conversion → Gold labels: supplies labels
- Document segmentation → Label conversion: supports labeling
