# 8dionysus/tree-of-sophia architecture

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

- Interactive diagram: https://gitdiagram.com/8dionysus/tree-of-sophia
- Repository: https://github.com/8dionysus/tree-of-sophia

## Overview

#### Purpose and Entry Points
Tree of Sophia (ToS) is a source-first, version-controlled philosophical knowledge tree. It preserves source evidence and review history while producing inspectable nodes, relations, routes, and derived graph/read-model artifacts. Start at `README.md`; the domain source home is `ToS/README.md`. The bounded public path is `ToS/zarathustra/public-entry/TINY_ENTRY_ROUTE.md`, leading to `ToS/zarathustra/prologue-1/TRILINGUAL_ENTRY.md`.

#### Authority, Contracts, and Doctrine
Doctrine defines what may become canonical and how source-backed claims are modeled; JSON Schema contracts formalize interchange and validation boundaries. The canon is authoritative structured content, not a generated graph. Key paths: `ToS/doctrine/NODE_CONTRACT.md`, `ToS/contracts/tos-node-contract.schema.json`, `ToS/canon/registries/predicates.csv`. Canonical nodes are organized by kind (source, event, state, principle, concept, etc.) and relation packs connect them, e.g. `ToS/canon/event/.../node.json` and `ToS/canon/relations/.../edges.csv`.

#### Evidence Spine and Source Witnessing
Evidence enters through a source-witness model separating catalog metadata from restricted local payloads. Works, expressions, editions, items, fixity, rights, forensic reports, and provenance establish durable source addresses before semantic claims are promoted. Core paths: `ToS/source-witnesses/catalog/catalog.manifest.json`, `ToS/source-witnesses/works/friedrich-nietzsche/also-sprach-zarathustra/work.json`, `ToS/source-witnesses/LOCAL_STORAGE_BOUNDARY.md`. Server import and access requests are explicit operational boundaries rather than direct external-service integrations.

#### Corpus Intake and Golden Kernel
The repository develops two fronts: a broad world-philosophy corpus scaffold and a complete Zarathustra “golden growth kernel.” Candidate intake has tabular nodes, edges, segments, witnesses, and tensions; the kernel demonstrates source-to-review-to-canon practice without imposing Nietzsche-specific ontology globally. Paths: `ToS/candidate-intake/thus-spoke-zarathustra/prologue-1/mode-b/`, `ToS/zarathustra/GOLDEN_GROWTH_KERNEL.md`, `ToS/source-witnesses/works/friedrich-nietzsche/also-sprach-zarathustra/gold-sets/foundation-pilot-v1/`.

#### Philosophy Workbench and Promotion Flow
The philosophy tree supplies era/region/tradition branches and branch manifests. Research artifacts become prepared dossiers, proposed nodes/relations, review packets, then may be planted into canon. Primary flow: source witnesses and research packets → atlas/master tables → graph workbench proposals and review → canonical tree. Paths: `ToS/philosophy/atlas/master-tables/`, `ToS/philosophy/graph-workbench/proposed-nodes/`, `scripts/plant_prepared_dossiers.py`. Workbench graph views are planning/review projections, not canonical authority.

#### Derived Graph and Consumer Boundary
Canonical and source-owned records are transformed into derived exports and local KAG indexes for downstream graph/retrieval consumers. This is a one-way bounded seam: consumers such as `aoa-kag` may read exports but do not gain authority to write ToS canon. Paths: `mechanics/boundary-bridge/parts/derived-kag-seam/scripts/generate_kag_export.py`, `ToS/derived-exports/kag_export.json`, `kag/manifest.json`. Sharded JSONL indexes provide local provider-ready lookup material.

#### Operations, Validation, and Runtime Context
This is primarily a Git-backed data, documentation, and Python-validation repository—not a deployed web application. Repeatable governance operations live as mechanics with local contracts: threshold intake, canon restraint/promotion, review return, and relation promotion. Paths: `mechanics/agon/parts/threshold-registry/`, `mechanics/canon-formation/parts/promotion-gate/`, `mechanics/relation-weaving/parts/graph-promotion/scripts/validate_tree_relation_pack.py`. Python builders and validators under `scripts/` are exercised by repository tests and GitHub Actions (`.github/workflows/repo-validation.yml`); neighboring AoA runtime, visualization, memo, eval, and stats systems remain external consumers or collaborators.

Main entry points: [`mechanics/boundary-bridge/parts/derived-kag-seam/scripts/generate_kag_export.py`](https://github.com/8dionysus/tree-of-sophia/blob/main/mechanics/boundary-bridge/parts/derived-kag-seam/scripts/generate_kag_export.py) (KAG export generator), [`mechanics/relation-weaving/parts/graph-promotion/scripts/validate_tree_relation_pack.py`](https://github.com/8dionysus/tree-of-sophia/blob/main/mechanics/relation-weaving/parts/graph-promotion/scripts/validate_tree_relation_pack.py) (Relation pack validator), [`ToS/doctrine/NODE_CONTRACT.md`](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/doctrine/NODE_CONTRACT.md) (Node doctrine), [`.github/workflows/repo-validation.yml`](https://github.com/8dionysus/tree-of-sophia/blob/main/.github/workflows/repo-validation.yml) (Repository validation workflow)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry &amp; Doctrine"]
  node_repo_readme["Repository entry<br/>documentation<br/>[README.md]"]
  node_tos_home["ToS source home<br/>documentation<br/>[README.md]"]
  node_public_route["Public entry route<br/>bounded route"]
  node_trilingual_entry["Trilingual entry<br/>source entry"]
  node_doctrine["Node doctrine<br/>governance doctrine<br/>[NODE_CONTRACT.md]"]
  node_node_schema["Node schema<br/>JSON Schema contract"]
end

subgraph group_evidence["Evidence &amp; Intake"]
  node_source_catalog[("Witness catalog<br/>source metadata")]
  node_work_witness["Zarathustra work witness<br/>work record<br/>[work.json]"]
  node_local_payload_boundary["Local storage boundary<br/>access boundary"]
  node_gold_set[("Foundation gold set<br/>curated evidence")]
  node_candidate_intake[("Candidate intake<br/>research staging")]
end

subgraph group_knowledge["Knowledge Formation"]
  node_predicate_registry["Predicate registry<br/>relation vocabulary<br/>[predicates.csv]"]
  node_golden_kernel["Golden growth kernel<br/>reference workflow"]
  node_atlas_tables[("Atlas master tables<br/>research synthesis")]
  node_workbench_proposals[("Graph workbench proposals<br/>review projection")]
  node_canon[("Canonical tree<br/>authoritative structured content")]
  node_relation_packs[("Canonical relation packs<br/>canonical edges")]
end

subgraph group_delivery["Derived Consumer Seam"]
  node_kag_generator{{"KAG export generator<br/>derived export builder"}}
  node_kag_export[("KAG export<br/>derived graph export<br/>[kag_export.json]")]
  node_kag_index[("Local KAG index<br/>consumer index<br/>[manifest.json]")]
end

subgraph group_operations["Governance &amp; Validation"]
  node_plant_dossiers{{"Dossier planter<br/>Python promotion tool"}}
  node_promotion_gate["Promotion gate<br/>governance operation"]
  node_relation_validator{{"Relation pack validator<br/>Python validator"}}
  node_repo_validation{{"Repository validation workflow<br/>CI validation"}}
end

node_repo_readme -->|"introduces"| node_tos_home
node_tos_home -->|"exposes"| node_public_route
node_public_route -->|"leads to"| node_trilingual_entry
node_doctrine -->|"formalized by"| node_node_schema
node_doctrine -->|"governs"| node_canon
node_node_schema -->|"validates"| node_canon
node_predicate_registry -->|"constrains"| node_relation_packs
node_source_catalog -->|"catalogs"| node_work_witness
node_local_payload_boundary -.->|"separates payloads from"| node_source_catalog
node_work_witness -->|"supports"| node_gold_set
node_gold_set -->|"supplies evidence to"| node_candidate_intake
node_candidate_intake -->|"synthesized in"| node_atlas_tables
node_atlas_tables -->|"feeds"| node_workbench_proposals
node_golden_kernel -.->|"demonstrates workflow for"| node_workbench_proposals
node_workbench_proposals -->|"submitted through"| node_promotion_gate
node_promotion_gate -->|"authorizes"| node_plant_dossiers
node_plant_dossiers -->|"plants into"| node_canon
node_relation_packs -->|"checked by"| node_relation_validator
node_relation_validator -->|"guards promotion into"| node_canon
node_canon -->|"connected by"| node_relation_packs
node_canon -->|"exports through"| node_kag_generator
node_kag_generator -->|"generates"| node_kag_export
node_kag_export -->|"indexes into"| node_kag_index
node_repo_validation -->|"runs"| node_relation_validator
node_repo_validation -->|"exercises"| node_kag_generator

click node_repo_readme "https://github.com/8dionysus/tree-of-sophia/blob/main/README.md"
click node_tos_home "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/README.md"
click node_public_route "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/zarathustra/public-entry/TINY_ENTRY_ROUTE.md"
click node_trilingual_entry "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/zarathustra/prologue-1/TRILINGUAL_ENTRY.md"
click node_doctrine "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/doctrine/NODE_CONTRACT.md"
click node_node_schema "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/contracts/tos-node-contract.schema.json"
click node_predicate_registry "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/canon/registries/predicates.csv"
click node_source_catalog "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/source-witnesses/catalog/catalog.manifest.json"
click node_work_witness "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/source-witnesses/works/friedrich-nietzsche/also-sprach-zarathustra/work.json"
click node_local_payload_boundary "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/source-witnesses/LOCAL_STORAGE_BOUNDARY.md"
click node_golden_kernel "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/zarathustra/GOLDEN_GROWTH_KERNEL.md"
click node_plant_dossiers "https://github.com/8dionysus/tree-of-sophia/blob/main/scripts/plant_prepared_dossiers.py"
click node_relation_validator "https://github.com/8dionysus/tree-of-sophia/blob/main/mechanics/relation-weaving/parts/graph-promotion/scripts/validate_tree_relation_pack.py"
click node_kag_generator "https://github.com/8dionysus/tree-of-sophia/blob/main/mechanics/boundary-bridge/parts/derived-kag-seam/scripts/generate_kag_export.py"
click node_kag_export "https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/derived-exports/kag_export.json"
click node_kag_index "https://github.com/8dionysus/tree-of-sophia/blob/main/kag/manifest.json"
click node_repo_validation "https://github.com/8dionysus/tree-of-sophia/blob/main/.github/workflows/repo-validation.yml"

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_repo_readme,node_tos_home,node_public_route,node_trilingual_entry,node_doctrine,node_node_schema toneBlue
class node_source_catalog,node_work_witness,node_local_payload_boundary,node_gold_set,node_candidate_intake toneAmber
class node_predicate_registry,node_golden_kernel,node_atlas_tables,node_workbench_proposals,node_canon,node_relation_packs toneMint
class node_kag_generator,node_kag_export,node_kag_index toneRose
class node_plant_dossiers,node_promotion_gate,node_relation_validator,node_repo_validation toneIndigo
```

## Components

### Entry & Doctrine

- [Repository entry](https://github.com/8dionysus/tree-of-sophia/blob/main/README.md): documentation · `README.md`
- [ToS source home](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/README.md): documentation · `ToS/README.md`
- [Public entry route](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/zarathustra/public-entry/TINY_ENTRY_ROUTE.md): bounded route · `ToS/zarathustra/public-entry/TINY_ENTRY_ROUTE.md`
- [Trilingual entry](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/zarathustra/prologue-1/TRILINGUAL_ENTRY.md): source entry · `ToS/zarathustra/prologue-1/TRILINGUAL_ENTRY.md`
- [Node doctrine](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/doctrine/NODE_CONTRACT.md): governance doctrine · Defines canonical, source-backed claim rules. · `ToS/doctrine/NODE_CONTRACT.md`
- [Node schema](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/contracts/tos-node-contract.schema.json): JSON Schema contract · `ToS/contracts/tos-node-contract.schema.json`

### Evidence & Intake

- [Witness catalog](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/source-witnesses/catalog/catalog.manifest.json): source metadata · Catalogs durable source addresses separately from payloads. · `ToS/source-witnesses/catalog/catalog.manifest.json`
- [Zarathustra work witness](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/source-witnesses/works/friedrich-nietzsche/also-sprach-zarathustra/work.json): work record · `ToS/source-witnesses/works/friedrich-nietzsche/also-sprach-zarathustra/work.json`
- [Local storage boundary](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/source-witnesses/LOCAL_STORAGE_BOUNDARY.md): access boundary · Restricted local payloads remain outside repository authority. · `ToS/source-witnesses/LOCAL_STORAGE_BOUNDARY.md`
- **Foundation gold set**: curated evidence
- **Candidate intake**: research staging · Holds candidate nodes, edges, segments, witnesses, and tensions.

### Knowledge Formation

- [Predicate registry](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/canon/registries/predicates.csv): relation vocabulary · `ToS/canon/registries/predicates.csv`
- [Golden growth kernel](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/zarathustra/GOLDEN_GROWTH_KERNEL.md): reference workflow · Demonstrates source-to-review-to-canon practice. · `ToS/zarathustra/GOLDEN_GROWTH_KERNEL.md`
- **Atlas master tables**: research synthesis
- **Graph workbench proposals**: review projection · Planning and review views are not canonical authority.
- **Canonical tree**: authoritative structured content · Canonical nodes by kind and relation packs form the source of authority.
- **Canonical relation packs**: canonical edges

### Derived Consumer Seam

- [KAG export generator](https://github.com/8dionysus/tree-of-sophia/blob/main/mechanics/boundary-bridge/parts/derived-kag-seam/scripts/generate_kag_export.py): derived export builder · `mechanics/boundary-bridge/parts/derived-kag-seam/scripts/generate_kag_export.py`
- [KAG export](https://github.com/8dionysus/tree-of-sophia/blob/main/ToS/derived-exports/kag_export.json): derived graph export · One-way consumer-readable projection of canonical and source-owned records. · `ToS/derived-exports/kag_export.json`
- [Local KAG index](https://github.com/8dionysus/tree-of-sophia/blob/main/kag/manifest.json): consumer index · Provider-ready local lookup material for downstream consumers. · `kag/manifest.json`

### Governance & Validation

- [Dossier planter](https://github.com/8dionysus/tree-of-sophia/blob/main/scripts/plant_prepared_dossiers.py): Python promotion tool · `scripts/plant_prepared_dossiers.py`
- **Promotion gate**: governance operation
- [Relation pack validator](https://github.com/8dionysus/tree-of-sophia/blob/main/mechanics/relation-weaving/parts/graph-promotion/scripts/validate_tree_relation_pack.py): Python validator · `mechanics/relation-weaving/parts/graph-promotion/scripts/validate_tree_relation_pack.py`
- [Repository validation workflow](https://github.com/8dionysus/tree-of-sophia/blob/main/.github/workflows/repo-validation.yml): CI validation · Runs repository Python builders and validators. · `.github/workflows/repo-validation.yml`

## Connections

- Repository entry → ToS source home: introduces
- ToS source home → Public entry route: exposes
- Public entry route → Trilingual entry: leads to
- Node doctrine → Node schema: formalized by
- Node doctrine → Canonical tree: governs
- Node schema → Canonical tree: validates
- Predicate registry → Canonical relation packs: constrains
- Witness catalog → Zarathustra work witness: catalogs
- Local storage boundary → Witness catalog: separates payloads from
- Zarathustra work witness → Foundation gold set: supports
- Foundation gold set → Candidate intake: supplies evidence to
- Candidate intake → Atlas master tables: synthesized in
- Atlas master tables → Graph workbench proposals: feeds
- Golden growth kernel → Graph workbench proposals: demonstrates workflow for
- Graph workbench proposals → Promotion gate: submitted through
- Promotion gate → Dossier planter: authorizes
- Dossier planter → Canonical tree: plants into
- Canonical relation packs → Relation pack validator: checked by
- Relation pack validator → Canonical tree: guards promotion into
- Canonical tree → Canonical relation packs: connected by
- Canonical tree → KAG export generator: exports through
- KAG export generator → KAG export: generates
- KAG export → Local KAG index: indexes into
- Repository validation workflow → Relation pack validator: runs
- Repository validation workflow → KAG export generator: exercises
