# nolane-x/nolane-habitat architecture

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

- Interactive diagram: https://gitdiagram.com/nolane-x/nolane-habitat
- Repository: https://github.com/nolane-x/nolane-habitat

## Overview

Nolane Habitat is a local, durable project-intelligence environment for coding agents. The principal workflow is to inspect a source tree and build revision-aware semantic context, let an agent reason about project state, govern source changes, execute and verify work, then preserve evidence and checkpoints for later sessions. The graph also includes documented cognition, learning, and observability capabilities. Several internal links are based on README descriptions rather than inspected call sites; those are marked dashed with no evidence path.

Main entry points: [`habitat/_workspace_core.py`](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/_workspace_core.py) (Workspace intelligence), [`habitat/storage.py`](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/storage.py) (Workspace database), [`habitat/execution.py`](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/execution.py) (Execution and receipts), [`habitat/repositories/learning.py`](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/repositories/learning.py) (Project memory and epistemics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Agent interface"]
  node_protocol["Agent protocol<br/>[protocol.py]"]
  node_workspace["Workspace facade<br/>[workspace.py]"]
end

subgraph group_world["Project intelligence"]
  node_core["Workspace intelligence<br/>[_workspace_core.py]"]
  node_semantic["Semantic analysis<br/>[project.py]"]
  node_compiler["Source compiler<br/>[compiler.py]"]
  node_context["Context compiler and VM<br/>[_compiler_base.py]"]
  node_projectworld["Project and counterfactual worlds<br/>[project_world.py]"]
  node_cognition["Project cognition twins<br/>[effect_twin.py]"]
end

subgraph group_governance["Governed work"]
  node_truth["Evidence authority<br/>[authority.py]"]
  node_mutation["Governed mutations<br/>[mutation.py]"]
  node_execution["Execution and receipts<br/>[execution.py]"]
  node_containment["Containment evidence<br/>[containment.py]"]
  node_verification["Testing impact<br/>[impact.py]"]
  node_executive["Executive trajectory<br/>[executive.py]"]
end

subgraph group_persistence["Durable state"]
  node_storage[("Workspace database<br/>[storage.py]")]
  node_memory["Project memory and epistemics<br/>[learning.py]"]
  node_learning["Learning plane<br/>[model.py]"]
end

subgraph group_operations["Operations and insight"]
  node_backend["Local execution provider<br/>[local.py]"]
  node_observatory["Observatory projection<br/>[observatory.py]"]
  node_browser["Browser operator context"]
end

node_agent(("Coding agent"))

node_agent -->|"sends requests"| node_protocol
node_protocol -->|"dispatches operations"| node_workspace
node_workspace -.->|"delegates workspace work"| node_core
node_core -.->|"builds semantic state"| node_semantic
node_semantic -->|"uses source analysis"| node_compiler
node_agent -.->|"requests task context"| node_context
node_context -.->|"pages exact source"| node_core
node_core -.->|"projects worlds"| node_projectworld
node_core -.->|"derives project twins"| node_cognition
node_core -.->|"tracks evidence authority"| node_truth
node_agent -.->|"stages source changes"| node_mutation
node_mutation -.->|"journals transitions"| node_storage
node_agent -.->|"requests execution"| node_execution
node_execution -.->|"delegates execution"| node_backend
node_backend -->|"reports containment"| node_containment
node_execution -.->|"records verification evidence"| node_verification
node_executive -->|"persists trajectory"| node_storage
node_core -.->|"maintains project memory"| node_memory
node_memory -->|"reads and writes records"| node_storage
node_learning -.->|"evaluates policy candidates"| node_memory
node_observatory -.->|"projects durable state"| node_storage
node_browser -.->|"supplies operator context"| node_core

click node_protocol "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/protocol.py"
click node_workspace "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/workspace.py"
click node_core "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/_workspace_core.py"
click node_semantic "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/semantic/project.py"
click node_compiler "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/compiler.py"
click node_context "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/context/_compiler_base.py"
click node_projectworld "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/project_world.py"
click node_cognition "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/effect_twin.py"
click node_truth "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/truth/authority.py"
click node_mutation "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/mutation.py"
click node_execution "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/execution.py"
click node_containment "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/security/containment.py"
click node_verification "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/testing/impact.py"
click node_executive "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/executive.py"
click node_storage "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/storage.py"
click node_memory "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/repositories/learning.py"
click node_learning "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/learning_plane/model.py"
click node_backend "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/backends/local.py"
click node_observatory "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/observatory.py"
click node_browser "https://github.com/nolane-x/nolane-habitat/blob/main/habitat/ui/browser_provider.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_protocol,node_workspace toneBlue
class node_core,node_semantic,node_compiler,node_context,node_projectworld,node_cognition toneAmber
class node_truth,node_mutation,node_execution,node_containment,node_verification,node_executive toneMint
class node_storage,node_memory,node_learning toneRose
class node_backend,node_observatory,node_browser,node_agent toneIndigo
```

## Components

### Agent interface

- [Agent protocol](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/protocol.py): `habitat/protocol.py`
- [Workspace facade](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/workspace.py): `habitat/workspace.py`

### Project intelligence

- [Workspace intelligence](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/_workspace_core.py): `habitat/_workspace_core.py`
- [Semantic analysis](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/semantic/project.py): `habitat/semantic/project.py`
- [Source compiler](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/compiler.py): `habitat/compiler.py`
- [Context compiler and VM](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/context/_compiler_base.py): `habitat/context/_compiler_base.py`
- [Project and counterfactual worlds](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/project_world.py): `habitat/project_world.py`
- [Project cognition twins](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/effect_twin.py): `habitat/effect_twin.py`

### Governed work

- [Evidence authority](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/truth/authority.py): `habitat/truth/authority.py`
- [Governed mutations](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/mutation.py): `habitat/mutation.py`
- [Execution and receipts](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/execution.py): `habitat/execution.py`
- [Containment evidence](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/security/containment.py): `habitat/security/containment.py`
- [Testing impact](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/testing/impact.py): `habitat/testing/impact.py`
- [Executive trajectory](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/executive.py): `habitat/executive.py`

### Durable state

- [Workspace database](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/storage.py): `habitat/storage.py`
- [Project memory and epistemics](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/repositories/learning.py): `habitat/repositories/learning.py`
- [Learning plane](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/learning_plane/model.py): `habitat/learning_plane/model.py`

### Operations and insight

- [Local execution provider](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/backends/local.py): `habitat/backends/local.py`
- [Observatory projection](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/observatory.py): `habitat/observatory.py`
- [Browser operator context](https://github.com/nolane-x/nolane-habitat/blob/main/habitat/ui/browser_provider.py): `habitat/ui/browser_provider.py`

### Other components

- **Coding agent**

## Connections

- Coding agent → Agent protocol: sends requests
- Agent protocol → Workspace facade: dispatches operations (evidence: `habitat/protocol.py`)
- Workspace facade → Workspace intelligence: delegates workspace work
- Workspace intelligence → Semantic analysis: builds semantic state (evidence: `habitat/_workspace_core.py`)
- Semantic analysis → Source compiler: uses source analysis (evidence: `habitat/semantic/project.py`)
- Coding agent → Context compiler and VM: requests task context (evidence: `README.md`)
- Context compiler and VM → Workspace intelligence: pages exact source (evidence: `README.md`)
- Workspace intelligence → Project and counterfactual worlds: projects worlds (evidence: `README.md`)
- Workspace intelligence → Project cognition twins: derives project twins (evidence: `README.md`)
- Workspace intelligence → Evidence authority: tracks evidence authority (evidence: `README.md`)
- Coding agent → Governed mutations: stages source changes (evidence: `README.md`)
- Governed mutations → Workspace database: journals transitions (evidence: `README.md`)
- Coding agent → Execution and receipts: requests execution (evidence: `README.md`)
- Execution and receipts → Local execution provider: delegates execution (evidence: `README.md`)
- Local execution provider → Containment evidence: reports containment (evidence: `habitat/backends/local.py`)
- Execution and receipts → Testing impact: records verification evidence (evidence: `README.md`)
- Executive trajectory → Workspace database: persists trajectory (evidence: `habitat/storage.py`)
- Workspace intelligence → Project memory and epistemics: maintains project memory (evidence: `README.md`)
- Project memory and epistemics → Workspace database: reads and writes records (evidence: `habitat/repositories/learning.py`)
- Learning plane → Project memory and epistemics: evaluates policy candidates (evidence: `README.md`)
- Observatory projection → Workspace database: projects durable state (evidence: `README.md`)
- Browser operator context → Workspace intelligence: supplies operator context (evidence: `README.md`)
