The hierarchy connects parent state files to child state files in a tree. The mesh connects state files to shared nested directories in a graph. Where the hierarchy asks “which scope owns this file?”, the mesh asks “which state files care about this directory entry?” A single audit log, a single artifact, or a single memory entry can be referenced byDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/bitwikiorg/continuity/llms.txt
Use this file to discover all available pages before exploring further.
STATE.md, LEARNINGS.md, and ARTIFACTS.md simultaneously — each file interpreting the same content from its own perspective. This page explains how the mesh is declared, what patterns it enables, and when to use it.
Mesh vs hierarchy
These two mechanisms are complementary, not competing. Hierarchy is always the foundation; mesh adds cross-cutting relationships on top of it.| Dimension | Hierarchy | Mesh |
|---|---|---|
| Shape | Tree — one parent, many children | Graph — many-to-many edges |
| Direction | Top-down authority and scope | Any direction — indexers point to shared dirs |
| Purpose | Scope isolation and safety inheritance | Shared content without duplication |
| Example | STATE.md → project-a/STATE.md | STATE.md and LEARNINGS.md both index audits/ |
| When it forms | Automatically on directory nesting | Explicitly declared in ## Mesh index sections |
| Risk | None — structural default | Spaghetti if added too early or without discipline |
Concrete mesh patterns
Three recurring patterns show up across different agent workloads. Each demonstrates the same principle: one entry in a shared directory is referenced by multiple root state files.Pattern 1: Shared history
STATE.md and LEARNINGS.md both index the audits/ directory. When a security audit runs, a single file lands in audits/. Two state files reference it for different purposes:
STATE.mdreferences it as current system health: “secure as of 2026-06-29”LEARNINGS.mdreferences it as a learned rule: “rate limiting prevents brute force”
Pattern 2: Cross-cutting memory
MEMORY.md and KNOWLEDGE.md both index entries under memory/semantic-*. A single fact — the production server’s IP address — lives in one place and is surfaced by both files:
MEMORY.mdreferences it as “current server IP: 192.0.2.1”KNOWLEDGE.mdreferences it as an infrastructure fact in the broader knowledge catalog
Pattern 3: Artifact provenance
ARTIFACTS.md and STATE.md both index the artifacts/ directory. A generated API specification lives in artifacts/ and is tracked from two angles:
ARTIFACTS.mdtracks it as a deliverable: “api-v2.spec.md exists and is current”STATE.mdtracks it as a state signal: “current spec version: v2”
Mesh declaration syntax
The mesh is explicit, not automatic. Each state file that participates in a mesh declares its edges in a## Mesh index section. No declaration means no edge — this prevents accidental cross-referencing.
audits/ directory appears in both STATE.md and LEARNINGS.md — that overlap is the mesh edge.
The query pattern payoff
Explicit mesh indexes make cross-module impact visible. With a fully declared mesh, you can ask:“I changedThe agent traces the mesh:src/shared/auth.ts. Which STATE files indexsrc/shared/? What depends on this?”
Locate the shared directory
src/shared/STATE.md declares it indexes src/shared/ — direct ownership identified.Trace cross-module edges
backend/api/STATE.md declares it indexes ../../src/shared/artifacts/ — upstream dependency found.Follow audit edges
SECURITY.md indexes audits/, which contains 2026-06-29-auth-audit.md referencing auth logic — security impact surfaced.When to mesh — and when to skip
Mesh when…
- The same event matters to multiple concerns (state + learning + memory)
- You want history without bloating current state files
- Multiple agents share overlapping context
- An artifact is tracked both as a deliverable and as a state signal
Skip meshing when…
- Data is truly private to one concern and no other file needs it
- You are on the Minimum tier — keep the system simple
- The directory is owned and read by exactly one state file
- You have not yet hit the problem the mesh solves
Start hierarchy, add mesh
The hierarchy is your safe default. Do not add mesh edges speculatively. Add them only when you encounter one of these concrete triggers:- The same audit entry is being referenced in both
STATE.mdandLEARNINGS.md - A memory entry is needed by both
MEMORY.mdandKNOWLEDGE.md - An artifact is tracked in both
ARTIFACTS.mdandSTATE.md
Index vs copy
Mesh relationships are built on references, not copies. The audit file lives inaudits/ once. State files hold pointers — filenames, timestamps, content hashes. The directory holds the payload.
Schema and mesh are interconnected
The ontology’s three-class taxonomy determines which files can participate in which kinds of mesh edges:| Class | Can mesh? | Direction | Why |
|---|---|---|---|
State (root .md files) | Yes — outbound only | Indexes History and Library dirs | State files are always the indexer, never the indexed |
| History (append-only dirs) | Yes — inbound only | Indexed by multiple State files | One audit entry serves many concerns |
| Library (curated dirs) | Yes — bidirectional | Indexed by State; can index other Library | Memory entries can reference knowledge docs |
snapshots/ entry (History class) can serve both STATE.md and LEARNINGS.md. A memory/ entry (Library class) can serve both MEMORY.md and KNOWLEDGE.md. But STATE.md itself is never indexed by another file — it is always the indexer.
Schema changes require mesh updates. Adding a new state file means declaring its edges or it remains isolated. Removing a state file means removing all edges that pointed to it.
INIT.md validation catches dangling edges before they silently break the system.Nesting
The hierarchy that underpins the mesh — how parent-child scope resolution works.
Vector Retrieval
Schema-validated mesh at scale: machine-readable edges, CI validation, and semantic search.
Ontology
State, History, and Library — the three classes that define meshability rules.
Hooks
Automate re-indexing and re-embedding when mesh edges change.