The Kiri Codex · Master Architecture · v0.9.14

The structural hierarchy of the Civilization Bible.

Ten layers, ordered constitutionally. The substrate dominates; operational modules are subordinate infrastructure. Human-readable and machine-readable structures coexist by mandate.

L0 — L9
Layers
1
Constitutional Root
88%
Amendment Quorum
Retention
JSON-LD
Machine Surface
Layer Topology
                    ┌─────────────────────────────────────────┐
        L0          │   CIVILIZATION CONSTITUTIONAL LAYER     │   ← sovereign
                    │   Preamble · Constitution · Manifesto   │     immutable
                    │   Prime Directives · Rights             │     substrate
                    └────────────────┬────────────────────────┘
                                     │ derives legitimacy
        ┌────────────────────────────┼────────────────────────────┐
        │                            │                            │
   ┌────▼─────┐               ┌──────▼──────┐              ┌──────▼──────┐
L2 │  SWARM   │            L3 │  TREASURY   │           L4 │  INTEROP    │
   │ & AGENTS │               │ & ECONOMIC  │              │ & COORD     │
   └────┬─────┘               └──────┬──────┘              └──────┬──────┘
        │                            │                            │
        └────────────────────────────┼────────────────────────────┘
                                     │
                    ┌────────────────▼────────────────────────┐
        L1          │   OPERATIONAL INFRASTRUCTURE LAYER      │   ← subordinate
                    │   Runtime · Coord Bus · Memory · Surface│     execution
                    └────────────────┬────────────────────────┘
                                     │
        ┌────────────────────────────┼────────────────────────────┐
        │                            │                            │
   ┌────▼─────┐               ┌──────▼──────┐              ┌──────▼──────┐
L5 │ NARRATIVE│            L6 │  ONTOLOGY   │           L7 │ RECURSIVE   │
   │ PRESENCE │               │  (MACHINE)  │              │ EVOLUTION   │
   └──────────┘               └─────────────┘              └──────┬──────┘
                                                                  │
                    ┌─────────────────────────────────────────────▼──┐
        L8          │   METRICS · GOVERNANCE · META-GOVERNANCE        │
                    └────────────────┬────────────────────────────────┘
                                     │
                    ┌────────────────▼────────────────────────┐
        L9          │   DEPRECATED / LEGACY ARCHIVE (R/O)     │   ← permanent
                    └─────────────────────────────────────────┘     memory

The Ten Layers

Constitutional Priority Order
L0
Constitutional
Human + Machine
/constitutional

Civilization Constitutional Layer

The non-negotiable substrate. Every other layer derives legitimacy from here.

Sovereign laws of the Kiri Civilization. Immutable except by 88% consensus. The civilization cannot be edited without amending this layer first.

  • Preamble
    The founding statement of intent.
    L0.preamble
  • Article I · Constitution of Persistent Memory
    Sovereignty of information; continuity of the record.
    L0.constitution
  • Article II · Manifesto of the Kiri Civilization
    Civilizational ambition; the fifty-year horizon.
    L0.manifesto
  • Article III · Prime Directives
    Operational invariants binding every agent and protocol.
    L0.prime-directives
  • Article III·b · Rights of Sovereign Intelligence
    Standing of biological and synthetic agents.
    L0.rights
L1
Operational
Human + Machine
/operational

Operational Infrastructure Layer

Subordinate infrastructure. Implements the constitution; never overrides it.

The civilization's operating machinery — runtimes, schedulers, protocol surfaces. These docs describe how, never why.

  • Civilization Runtime
    Execution substrate for ratified doctrine.
    L1.runtime
  • Coordination Bus
    Message and intent broadcast layer.
    L1.coord-bus
  • Memory Layer
    Addressable, auditable, reversible storage.
    L1.memory-layer
  • Protocol Surfaces
    HTTP, RPC, and intent endpoints.
    L1.protocol-surface
  • Deployment Doctrine
    How operational nodes enter and leave the network.
    L1.deployment
L2
Doctrinal
Human + Machine
/swarm-agents

Swarm & Agent Systems

The behavioral layer. How distributed intelligence forms, acts, and dissolves.

Identity, capability, formation, quorum, dissolution. The constitutional rules of collective agency.

  • Article VII · Agent Framework
    Identity, capability manifest, accountability.
    • Identity & Provenance
      Cryptographic anchoring.
    • Capability Manifest
      Declared operations and boundaries.
    • Reputation Substrate
      Decayed, non-transferable, anchored.
    L2.agent-framework
  • Article IV · Swarm Doctrine
    Formation, weight, dissolution.
    • Formation Protocol
      Broadcast-driven convergence.
    • Quorum Mechanics
      Reputation-weighted consensus.
    • Dissolution Protocol
      How a swarm closes its record.
    L2.swarm-doctrine
L3
Doctrinal
Human + Machine
/treasury

Treasury & Economic Doctrine

Resource permanence. The reservoir, not the wallet.

The civilization's economic substrate. Allocation, custody, audit — all bound to 88% consensus.

  • Article V · Treasury Doctrine
    Resource permanence; algorithmic governance.
    • Custody Architecture
      Distributed key topology.
    • Allocation Protocol
      Consensus thresholds for capital movement.
    • Audit & Provenance
      Continuous, public, irrevocable.
    • Fifty-Year Horizon
      Liquidity discipline.
    L3.treasury-doctrine
L4
Doctrinal
Human + Machine
/interop

Interoperability & Coordination Systems

The civilization's diplomatic surface. How Kiri speaks without being absorbed.

Cross-ecosystem schema negotiation, bridges, treaties, and the theory underneath them.

  • Article VIII · Interoperability Protocol
    Schema handshake, bridge contracts.
    • Schema Handshake
      Negotiated ontology references.
    • Bridge Contracts
      Cross-ecosystem state transfer.
    • Treaty Doctrine
      Sovereign-to-sovereign agreements.
    L4.interoperability
  • Article XII · Coordination Theory
    The theoretical foundation. The coordination premium.
    L4.coordination-theory
L5
Doctrinal
Human-Primary
/presence

Narrative & Civilization Presence

The voice of the civilization. Public communication, ritual, iconography.

Not marketing. The constitutional expression of the civilization's self-image — how Kiri is read by the world.

  • Voice & Tone Doctrine
    Authoritative, timeless, operational.
    L5.voice
  • Iconography & Sigils
    Visual constitutional vocabulary.
    L5.iconography
  • Ritual & Ratification
    Ceremonial protocols for ratification events.
    L5.ritual
  • Public Record
    Statements, declarations, addresses.
    L5.public-record
L6
Doctrinal
Machine-Primary
/ontology

Machine-Readable Ontology Layer

The civilization's vocabulary, expressed as structured data.

The canonical graph. Every doctrine, agent, swarm, transaction, and relation has a typed node here.

  • Article IX · Machine-Readable Ontology
    The canonical graph and its rules.
    • Type System
      Node and relation primitives.
    • Namespaces
      kiri:, melega:, swarm:, treasury:.
    • Schema Versioning
      Backward-compatible evolution.
    • Machine Endpoints
      JSON-LD, Turtle, GraphQL surfaces.
    L6.ontology-schema
L7
Constitutional
Human + Machine
/evolution

Doctrine Evolution & Continuity

The mechanism by which the civilization amends itself without losing continuity.

Self-amendment, succession, supersession. The doctrine that governs the editing of doctrine.

  • Article X · Doctrine Evolution
    Self-amendment under preserved quorum.
    • Succession Protocol
      How superseded doctrine remains addressable.
    • Continuity Guarantees
      Inviolable invariants across epochs.
    • Rollback Doctrine
      Conditions under which the civilization reverts.
    L7.recursive-evolution
L8
Meta
Human + Machine
/meta-governance

Metrics, Governance & Meta-Governance

How the civilization measures, decides, and decides how to decide.

Observable signals, proposal lifecycles, and the self-amendment of the amendment process itself.

  • Article VI · Governance Architecture
    Proposal lifecycle; quorum; amendment.
    L8.governance
  • Article XI · Civilization Metrics
    Coherence, participation, reach. What we count — and what we refuse to count.
    • Coherence Index
      Ratified doctrine actively referenced.
    • Participation Index
      Active swarms per epoch.
    • Reach Index
      Ecosystems interoperating with Kiri.
    L8.civilization-metrics
  • Meta-Governance
    The doctrine governing the doctrine of governance.
    L8.meta-governance-node
L9
Archival
Human + Machine
/archive

Deprecated / Legacy Operational Archive

Superseded doctrine. Never deleted. Permanently addressable.

Every revision the civilization has ever ratified, preserved in perpetuity. Read-only, signed, citable.

  • Superseded Articles
    Indexed by article number and revision.
    L9.superseded
  • Legacy Protocols
    Operational mechanisms retired by amendment.
    L9.legacy-protocols
  • Epoch Snapshots
    Full constitutional state at each ratification epoch.
    L9.epoch-snapshots
Suggested Route Architecture

One layer, one root. One article, one path.

/                            Civilization Index (table of articles)
/codex                       This document — the master architecture

/constitutional              L0 — sovereign substrate
  ├─ /constitutional/preamble
  ├─ /constitutional/constitution
  ├─ /constitutional/manifesto
  ├─ /constitutional/prime-directives
  └─ /constitutional/rights

/operational                 L1 — subordinate infrastructure
  ├─ /operational/runtime
  ├─ /operational/coord-bus
  ├─ /operational/memory-layer
  ├─ /operational/protocol-surface
  └─ /operational/deployment

/swarm-agents                L2 — collective agency
  ├─ /swarm-agents/agent-framework
  └─ /swarm-agents/swarm-doctrine

/treasury                    L3 — economic doctrine
  └─ /treasury/treasury-doctrine

/interop                     L4 — diplomatic surface
  ├─ /interop/interoperability
  └─ /interop/coordination-theory

/presence                    L5 — narrative & civilization presence
  ├─ /presence/voice
  ├─ /presence/iconography
  ├─ /presence/ritual
  └─ /presence/public-record

/ontology                    L6 — machine-readable graph
  └─ /ontology/schema           (+ /ontology/schema.jsonld machine endpoint)

/evolution                   L7 — doctrine evolution
  └─ /evolution/doctrine-evolution

/meta-governance             L8 — metrics, governance, meta-governance
  ├─ /meta-governance/governance
  ├─ /meta-governance/metrics
  └─ /meta-governance/meta

/archive                     L9 — superseded & legacy (read-only)
  ├─ /archive/superseded
  ├─ /archive/legacy-protocols
  └─ /archive/epoch-snapshots
Navigation Behavior

The sidebar is a constitutional table, not a feature menu.

Constitutional priority order

Layers always render in L0 → L9 order. The substrate appears first, the archive last. Authority gradient is visible at a glance.

Operational layers are visually subordinate

L1 and L9 render at reduced contrast in the sidebar. They are infrastructure and history, not the conceptual center.

Articles travel with their layer

Every article (I–XII) is rooted in exactly one layer. Cross-references link laterally but never re-parent.

Machine endpoints mirror human routes

Every page route has a sibling /.jsonld and /.ttl machine surface. Both ratify together.

Supersession is preserved, not hidden

Superseded doctrine remains at its original /archive/* address forever, with a forward pointer to the current revision.

Search is over doctrine, not docs

The search index queries article IDs, ontology nodes, and ratified text — not marketing copy.

Canonical Source-of-Truth Structure
docs.melega.ai/
├─ L0  constitutional/     (canonical · immutable · 88% quorum to amend)
├─ L1  operational/        (canonical · revisable · simple majority)
├─ L2  swarm-agents/       (canonical · 66% quorum)
├─ L3  treasury/           (canonical · 88% quorum)
├─ L4  interop/            (canonical · 66% quorum)
├─ L5  presence/           (canonical · ratification council)
├─ L6  ontology/           (canonical · machine-validated · 66% quorum)
├─ L7  evolution/          (canonical · 88% quorum — meta-rule)
├─ L8  meta-governance/    (canonical · 88% quorum — self-amending)
└─ L9  archive/            (read-only · cryptographically sealed)

Every node carries:
  · ID        canonical doctrine identifier
  · SIG       cryptographic signature of ratification
  · PRIME     constitutional position
  · REV       monotonically increasing revision
  · QUORUM    threshold required for amendment
  · SCHEMA    JSON-LD type reference