# rfls-emyton/tgi architecture

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

- Interactive diagram: https://gitdiagram.com/rfls-emyton/tgi
- Repository: https://github.com/rfls-emyton/tgi

## Overview

TGI is a Python research implementation for building structural representations from literal Unicode-scalar experiences, organizing observed evidence, and deriving or checking context- and action-related conclusions. Its broad workflow runs from frame ingestion through organization and measured acquisition evidence to contextual analysis and observed-action or goal workflows. The README also documents source-bound response-atlas, endpoint-transport, and one-NMU substitution mechanisms. Source excerpts show parts of the foundation and measured-context layers; several higher-level branches are present in the tree or documented but were not inspected, so their links are left unverified.

Main entry points: [`tgi/acquisition_witness.py`](https://github.com/rfls-emyton/tgi/blob/main/tgi/acquisition_witness.py) (Acquisition witness), [`tgi/frame_engine.py`](https://github.com/rfls-emyton/tgi/blob/main/tgi/frame_engine.py) (Frame engine), [`tgi/measured_context_laws.py`](https://github.com/rfls-emyton/tgi/blob/main/tgi/measured_context_laws.py) (Context laws), [`tgi/acquisition_snapshot.py`](https://github.com/rfls-emyton/tgi/blob/main/tgi/acquisition_snapshot.py) (Evidence snapshots)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_foundation["Identity and frames"]
  node_identity["Scalar identity<br/>[identity.py]"]
  node_frame["Frame engine<br/>[frame_engine.py]"]
  node_spatial["Spatial traversal<br/>[spatial.py]"]
end

subgraph group_evidence["Organization and evidence"]
  node_organization["Organization model<br/>[organization.py]"]
  node_snapshot["Evidence snapshots"]
  node_org_snapshot["Organization snapshot"]
  node_witness["Acquisition witness"]
end

subgraph group_analysis["Context and action"]
  node_layout["Measured layout"]
  node_context_laws["Context laws"]
  node_context_verify["Context verification"]
  node_context_actions["Observed context actions"]
  node_goal_workflow["Goal workflows"]
  node_actuation["Observed actuation"]
end

subgraph group_research["Extensions"]
  node_atlas["Response atlas"]
  node_transport["Endpoint transport"]
  node_substitution["NMU substitution"]
end

node_researcher(("Researcher"))

node_researcher -.->|"provides experience"| node_frame
node_frame -->|"encodes identities"| node_identity
node_frame -->|"uses traversal"| node_spatial
node_organization -->|"uses frame engine"| node_frame
node_snapshot -->|"snapshots evidence"| node_organization
node_snapshot -->|"uses frame view"| node_org_snapshot
node_witness -->|"checks acquisition"| node_snapshot
node_witness -->|"takes snapshot"| node_org_snapshot
node_witness -->|"encodes sources"| node_identity
node_witness -->|"canonicalizes evidence"| node_frame
node_layout -->|"encodes values"| node_identity
node_context_laws -->|"uses organization"| node_organization
node_context_laws -->|"snapshots acquisition"| node_snapshot
node_context_laws -->|"certifies evidence"| node_witness
node_context_laws -->|"builds layout"| node_layout
node_context_verify -->|"checks acquisition"| node_snapshot
node_context_verify -->|"verifies witness"| node_witness
node_context_verify -->|"rebuilds layout"| node_layout
node_context_verify -->|"checks policy"| node_context_laws
node_goal_workflow -->|"uses runtime"| node_actuation
node_goal_workflow -->|"uses organization"| node_organization
node_goal_workflow -->|"uses identities"| node_identity
node_goal_workflow -->|"uses frame engine"| node_frame
node_researcher -.->|"submits evidence"| node_atlas
node_researcher -.->|"requests transport"| node_transport
node_researcher -.->|"requests substitution"| node_substitution

click node_identity "https://github.com/rfls-emyton/tgi/blob/main/tgi/identity.py"
click node_frame "https://github.com/rfls-emyton/tgi/blob/main/tgi/frame_engine.py"
click node_spatial "https://github.com/rfls-emyton/tgi/blob/main/tgi/spatial.py"
click node_organization "https://github.com/rfls-emyton/tgi/blob/main/tgi/organization.py"
click node_snapshot "https://github.com/rfls-emyton/tgi/blob/main/tgi/acquisition_snapshot.py"
click node_org_snapshot "https://github.com/rfls-emyton/tgi/blob/main/tgi/organization_snapshot.py"
click node_witness "https://github.com/rfls-emyton/tgi/blob/main/tgi/acquisition_witness.py"
click node_layout "https://github.com/rfls-emyton/tgi/blob/main/tgi/measured_context_layout.py"
click node_context_laws "https://github.com/rfls-emyton/tgi/blob/main/tgi/measured_context_laws.py"
click node_context_verify "https://github.com/rfls-emyton/tgi/blob/main/tgi/measured_context_laws_check.py"
click node_context_actions "https://github.com/rfls-emyton/tgi/blob/main/tgi/observed_context_actions.py"
click node_goal_workflow "https://github.com/rfls-emyton/tgi/blob/main/tgi/guarded_word_goal_workflow.py"
click node_actuation "https://github.com/rfls-emyton/tgi/blob/main/tgi/observed_actuation_runtime.py"
click node_atlas "https://github.com/rfls-emyton/tgi/blob/main/tgi/phase_bound_response_atlas.py"
click node_transport "https://github.com/rfls-emyton/tgi/blob/main/tgi/source_bound_endpoint_transport.py"
click node_substitution "https://github.com/rfls-emyton/tgi/blob/main/tgi/source_bound_single_nmu_edit.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_identity,node_frame,node_spatial toneBlue
class node_organization,node_snapshot,node_org_snapshot,node_witness toneAmber
class node_layout,node_context_laws,node_context_verify,node_context_actions,node_goal_workflow,node_actuation toneMint
class node_atlas,node_transport,node_substitution toneRose
class node_researcher toneIndigo
```

## Components

### Identity and frames

- [Scalar identity](https://github.com/rfls-emyton/tgi/blob/main/tgi/identity.py): `tgi/identity.py`
- [Frame engine](https://github.com/rfls-emyton/tgi/blob/main/tgi/frame_engine.py): `tgi/frame_engine.py`
- [Spatial traversal](https://github.com/rfls-emyton/tgi/blob/main/tgi/spatial.py): `tgi/spatial.py`

### Organization and evidence

- [Organization model](https://github.com/rfls-emyton/tgi/blob/main/tgi/organization.py): `tgi/organization.py`
- [Evidence snapshots](https://github.com/rfls-emyton/tgi/blob/main/tgi/acquisition_snapshot.py): `tgi/acquisition_snapshot.py`
- [Organization snapshot](https://github.com/rfls-emyton/tgi/blob/main/tgi/organization_snapshot.py): `tgi/organization_snapshot.py`
- [Acquisition witness](https://github.com/rfls-emyton/tgi/blob/main/tgi/acquisition_witness.py): `tgi/acquisition_witness.py`

### Context and action

- [Measured layout](https://github.com/rfls-emyton/tgi/blob/main/tgi/measured_context_layout.py): `tgi/measured_context_layout.py`
- [Context laws](https://github.com/rfls-emyton/tgi/blob/main/tgi/measured_context_laws.py): `tgi/measured_context_laws.py`
- [Context verification](https://github.com/rfls-emyton/tgi/blob/main/tgi/measured_context_laws_check.py): `tgi/measured_context_laws_check.py`
- [Observed context actions](https://github.com/rfls-emyton/tgi/blob/main/tgi/observed_context_actions.py): `tgi/observed_context_actions.py`
- [Goal workflows](https://github.com/rfls-emyton/tgi/blob/main/tgi/guarded_word_goal_workflow.py): `tgi/guarded_word_goal_workflow.py`
- [Observed actuation](https://github.com/rfls-emyton/tgi/blob/main/tgi/observed_actuation_runtime.py): `tgi/observed_actuation_runtime.py`

### Extensions

- [Response atlas](https://github.com/rfls-emyton/tgi/blob/main/tgi/phase_bound_response_atlas.py): `tgi/phase_bound_response_atlas.py`
- [Endpoint transport](https://github.com/rfls-emyton/tgi/blob/main/tgi/source_bound_endpoint_transport.py): `tgi/source_bound_endpoint_transport.py`
- [NMU substitution](https://github.com/rfls-emyton/tgi/blob/main/tgi/source_bound_single_nmu_edit.py): `tgi/source_bound_single_nmu_edit.py`

### Other components

- **Researcher**

## Connections

- Researcher → Frame engine: provides experience
- Frame engine → Scalar identity: encodes identities (evidence: `tgi/frame_engine.py`)
- Frame engine → Spatial traversal: uses traversal (evidence: `tgi/frame_engine.py`)
- Organization model → Frame engine: uses frame engine (evidence: `tgi/organization.py`)
- Evidence snapshots → Organization model: snapshots evidence (evidence: `tgi/acquisition_snapshot.py`)
- Evidence snapshots → Organization snapshot: uses frame view (evidence: `tgi/acquisition_snapshot.py`)
- Acquisition witness → Evidence snapshots: checks acquisition (evidence: `tgi/acquisition_witness.py`)
- Acquisition witness → Organization snapshot: takes snapshot (evidence: `tgi/acquisition_witness.py`)
- Acquisition witness → Scalar identity: encodes sources (evidence: `tgi/acquisition_witness.py`)
- Acquisition witness → Frame engine: canonicalizes evidence (evidence: `tgi/acquisition_witness.py`)
- Measured layout → Scalar identity: encodes values (evidence: `tgi/measured_context_layout.py`)
- Context laws → Organization model: uses organization (evidence: `tgi/measured_context_laws.py`)
- Context laws → Evidence snapshots: snapshots acquisition (evidence: `tgi/measured_context_laws.py`)
- Context laws → Acquisition witness: certifies evidence (evidence: `tgi/measured_context_laws.py`)
- Context laws → Measured layout: builds layout (evidence: `tgi/measured_context_laws.py`)
- Context verification → Evidence snapshots: checks acquisition (evidence: `tgi/measured_context_laws_check.py`)
- Context verification → Acquisition witness: verifies witness (evidence: `tgi/measured_context_laws_check.py`)
- Context verification → Measured layout: rebuilds layout (evidence: `tgi/measured_context_laws_check.py`)
- Context verification → Context laws: checks policy (evidence: `tgi/measured_context_laws_check.py`)
- Goal workflows → Observed actuation: uses runtime (evidence: `tgi/guarded_word_goal_workflow.py`)
- Goal workflows → Organization model: uses organization (evidence: `tgi/guarded_word_goal_workflow.py`)
- Goal workflows → Scalar identity: uses identities (evidence: `tgi/guarded_word_goal_workflow.py`)
- Goal workflows → Frame engine: uses frame engine (evidence: `tgi/guarded_word_goal_workflow.py`)
- Researcher → Response atlas: submits evidence (evidence: `README.md`)
- Researcher → Endpoint transport: requests transport (evidence: `README.md`)
- Researcher → NMU substitution: requests substitution (evidence: `README.md`)
