# Invariants, Failure Modes & Safe-Change Rules

> A synthesis of the rules that hold across the whole brain: the page-level invariants (compiled truth is rewritten, timeline is append-only), the storage-scope invariant (transcripts/ and media/ are db_only — never git-tracked), the philosophy invariants (the four interlocking claims must stay coherent), the content decay invariant (business facts and audits expire fastest), and the safe-change checklist (what you can freely edit, what requires care, and what breaks the system). Closes with the core prediction: a reader who holds these invariants can navigate any page in the brain without reopening the README.

- Repository: garrytan/anara-brain
- GitHub: https://github.com/garrytan/anara-brain
- Human wiki: https://grok-wiki.com/public/wiki/garrytan-anara-brain-352efa33f049
- Complete Markdown: https://grok-wiki.com/public/wiki/garrytan-anara-brain-352efa33f049/llms-full.txt

## Source Files

- `gbrain.yml`
- `README.md`
- `RESOLVER.md`
- `concepts/faith-agency-paradox.md`
- `concepts/progress-is-positivity.md`
- `methodology/three-pillars.md`

---

<details>
<summary>Relevant source files</summary>
The following files were used as context for generating this wiki page:

- [gbrain.yml](gbrain.yml)
- [README.md](README.md)
- [RESOLVER.md](RESOLVER.md)
- [schema.md](schema.md)
- [concepts/faith-agency-paradox.md](concepts/faith-agency-paradox.md)
- [concepts/progress-is-positivity.md](concepts/progress-is-positivity.md)
- [concepts/body-as-vehicle.md](concepts/body-as-vehicle.md)
- [methodology/three-pillars.md](methodology/three-pillars.md)
- [content/philosophy-map.md](content/philosophy-map.md)
</details>

# Invariants, Failure Modes & Safe-Change Rules

This page synthesizes the rules that hold across the entire anara-brain. It is written for an AI agent or human maintainer who needs to make changes without breaking the brain's coherence — and for a reader who wants to understand the system deeply enough to navigate it without reopening the README every session.

The brain has two kinds of invariants: **structural invariants** (rules about how pages are built and stored) and **philosophical invariants** (rules about how ideas must interlock). Violating a structural invariant produces corrupt or unqueryable data. Violating a philosophical invariant produces a brain that gives contradictory answers about Joseph's worldview. Both are failure modes. This page identifies each class, explains why it exists, and closes with a concrete safe-change checklist.

---

## Structural Invariants

### Invariant 1: Compiled Truth Is Always Rewritten; Timeline Is Never Edited

Every page follows the two-layer architecture declared in `README.md`:

```
Above the line: Compiled Truth  ← LIVING — rewrite freely when the picture changes
Below the line: Timeline        ← IMMUTABLE — append only, never edited after writing
```

The compiled-truth section is a **synthesis**: it should always reflect the most accurate current state, incorporating all evidence from the timeline below and any external updates. It is explicitly expected to change.

The timeline section is an **evidence log**: it is append-only and reverse-chronological. New entries go at the top. Entries already written are never corrected, re-dated, or deleted — they are the primary record.

**Why this matters:** The compiled truth is what an AI agent reads first to answer a query quickly. If the timeline were editable, historical reconstructions would be unreliable. If the compiled truth were append-only, it would grow stale and agents would receive contradictory current-state claims.

**Failure mode:** An editor who adds a timeline entry *and* forgets to update the compiled truth produces a brain where the "current state" section says one thing and the timeline implies something newer. An editor who edits a past timeline entry forges the evidentiary record.

Sources: [README.md:17-37]()

---

### Invariant 2: Storage Scope — `transcripts/` and `media/` Are `db_only`

The `gbrain.yml` configuration declares two storage scopes:

```yaml
storage:
  db_tracked:
    - people/
    - methodology/
    - content/
    - reading/
    - projects/
    - concepts/
    - clients/
  db_only:
    - transcripts/
    - media/
```

`db_only` directories are ingested into the knowledge database but are **not git-tracked**. This means:

- `transcripts/` and `media/` files do not belong in version control commits.
- Querying these files requires the database layer; they are not reliable for raw-file searches in a fresh git checkout.
- Compiled concepts and methodology pages that cite transcripts should include the relevant distilled content, because the transcript may not be accessible outside the database.

**Why this matters:** Transcripts are raw primary source material — often verbose, redundant, and referencing external URLs. Storing them only in the database keeps git history clean and prevents the transcript layer from being treated as authoritative schema pages. `media/` (images, audio, video assets) has obvious reasons for database-only storage.

**Failure mode:** A contributor who commits a file into `transcripts/` or `media/` via git is violating the storage scope. The brain's query contract assumes these paths live in the database, not the tree. A compiled concept page that relies entirely on a transcript link (without distilling content) will produce dead references in a git-only context.

Sources: [gbrain.yml:5-16]()

---

### Invariant 3: Frontmatter Is Never Optional

Every page requires at minimum four fields:

```yaml
type:    # one of: person, methodology, concept, content, client-note,
         #         reading, event, project, analysis, reference, transcript, brain
title:   # human-readable
created: # YYYY-MM-DD
tags:    # at least one tag
```

These are declared in both `gbrain.yml` (as `frontmatter.required`) and in `schema.md` as the universal required block. All downstream query patterns in `RESOLVER.md` — type-based search, tag-based search — depend on this frontmatter being consistently present.

**Failure mode:** A page missing `type` cannot be routed by the RESOLVER's "search by type" strategy. A page missing `tags` breaks the "search by tag" path. A page missing `created` breaks chronological sorting. Because the brain is queried by an AI agent that reads frontmatter first, any page with incomplete frontmatter is effectively invisible to the primary query paths.

Sources: [gbrain.yml:18-24](), [schema.md:19-27]()

---

### Invariant 4: Markdown Links, Not Wikilinks

Internal links must use standard markdown format:

```markdown
[Page Title](path/to/page.md)
```

Wikilink-style syntax (`[[Page Title]]`) is explicitly prohibited. This keeps the brain portable across renderers, git hosts, and agent contexts that do not implement wikilink parsers.

**Failure mode:** Wikilinks silently break in any context that does not resolve them (standard GitHub Markdown rendering, most AI reading contexts). A contributor who introduces wikilinks adds links that appear to exist but cannot be followed.

Sources: [README.md:79]()

---

### Invariant 5: File Naming Is Lowercase and Hyphenated

```
people:    firstname-lastname.md
concepts:  descriptive-slug.md          (e.g., progress-is-positivity.md)
general:   lowercase-hyphenated.md
```

The RESOLVER maps queries to specific file paths by name. If a file is named differently than the convention, resolver links break silently.

**Failure mode:** A file named `ProgressIsPositivity.md` or `progress_is_positivity.md` will not be reachable via the resolver link `[Progress Is Positivity](progress-is-positivity.md)`. The brain's navigation contract depends on naming conventions being enforced uniformly.

Sources: [README.md:82-86](), [RESOLVER.md:31]()

---

## Philosophy Invariants

The brain encodes Joseph's worldview as a network of interlocking concepts. Each concept node has cross-links to adjacent concepts. These links are not decorative — they represent logical dependencies. If one node is changed in isolation, the adjacent nodes may become incoherent.

### The Four Interlocking Claims

The philosophy map in `content/philosophy-map.md` synthesizes Joseph's worldview into several claims. Four of them are tightly coupled and must stay mutually coherent:

```text
┌──────────────────────────────────────────────────────────┐
│  Progress Is Positivity  ←──────→  Body as Vehicle       │
│          ↕                                  ↕             │
│  Faith-Agency Paradox    ←──────→  Identity Through Action│
└──────────────────────────────────────────────────────────┘
```

**Claim A — Progress Is Positivity:** The felt experience of forward motion (physical, psychological, spiritual) is itself the source of meaning and healing. Not the destination — the motion.

**Claim B — Body as Vehicle:** The body is the primary vehicle of transformation. Change happens in the body first; psychological and identity change follow proprioceptive shift. The chain is: move → feel → think → become.

**Claim C — Faith-Agency Paradox:** Full effort (radical self-responsibility) and full surrender (trust in God/the larger arc) are held simultaneously. Neither collapses to the other. The two poles are the structure of a well-lived life, not a contradiction to be resolved.

**Claim D — Identity Through Action:** Identity follows action, not intention. You move yourself into a new identity; you do not think yourself there.

These four claims are load-bearing for each other:

| If you change… | You break… |
|---|---|
| "Progress is the goal" (add outcome-focus) | Claim A — denies that motion is the source, not destination |
| "Mind is primary" (Cartesian frame) | Claim B — contradicts embodied-first model |
| "Just pick a side: agency OR surrender" | Claim C — collapses the paradox into generic hustle or passive spirituality |
| "Set intentions and let them manifest" | Claim D — breaks the action-first identity model |

**Failure mode:** A content page or methodology page that inadvertently advocates for outcome-focus, mind-first transformation, pure hustle culture, or pure spiritual passivity will contradict the philosophical foundation. The brain will give the AI agent inconsistent answers when asked about Joseph's worldview.

Sources: [concepts/progress-is-positivity.md:48-54](), [concepts/body-as-vehicle.md:29-35](), [concepts/faith-agency-paradox.md:33-64](), [content/philosophy-map.md:54-71]()

---

### The "Shadow" Note on Progress

`concepts/progress-is-positivity.md` explicitly documents the shadow side of the core claim:

> "Progress can also become a trap. If your identity depends on always moving forward, what happens when you plateau?"

The mature version is: **progress is positivity, but you are not your progress.** This nuance is load-bearing. Content that endorses pure progress-as-identity (without the shadow) contradicts the therapy arc documented in the philosophy map and the "value from story, not status" claim. It also contradicts the body-as-vehicle concept by implying that physical progress is an end in itself rather than a vehicle for something deeper.

**Failure mode:** A new concept page or content piece that treats "progress is positivity" as a simple motivational slogan — without the shadow — contradicts the documented philosophical maturity of the concept.

Sources: [concepts/progress-is-positivity.md:57-63](), [content/philosophy-map.md:74-82]()

---

## Content Decay Invariant

Not all pages decay at the same rate. Business facts, content audits, and platform metrics change fastest. Philosophy and methodology change slowest.

```
Fast decay (verify before citing):
  content/youtube-audit.md       — subscriber counts, views, active/dead status
  content/instagram-audit.md     — follower counts, platform activity
  content/website-audit.md       — domain status (Art of Life site was DOWN at audit)
  content/web-presence-audit.md  — composite snapshot
  clients/                       — session counts, current programming, goals

Medium decay (check when used for planning):
  projects/                      — status fields (active/planned/completed/paused)
  people/                        — relationship status, contact info

Slow decay (stable unless Joseph's philosophy changes):
  concepts/                      — philosophical building blocks
  methodology/                   — protocols and frameworks
  reading/                       — influences and takeaways
```

**Why this matters:** The philosophy-map page is explicitly built on evidence from "229 training sessions with Garry Tan" and a specific audit date of 2026-05-21. Subscriber counts in the YouTube audit (1,560 subscribers, 145 videos) are point-in-time snapshots. An AI agent querying for "how many YouTube subscribers does Joseph have?" should treat that answer as stale after weeks; an AI agent querying for "what is Joseph's core philosophy?" can treat the concept pages as durable.

**Failure mode:** Treating audit snapshots as current facts. Any page in `content/` with `type: analysis` and performance metrics should be verified against live sources before being cited as current state.

Sources: [content/youtube-audit.md:1-19](), [content/philosophy-map.md:155-165](), [gbrain.yml:6-16]()

---

## Safe-Change Checklist

### What You Can Freely Edit

| Action | Reason |
|---|---|
| Rewrite the compiled-truth section of any page | This section is explicitly designed to be overwritten as the picture changes |
| Add a new timeline entry at the top of the timeline | Append-only is the intended write pattern |
| Add a new page in `db_tracked` directories with correct frontmatter | Any new page that follows the schema and naming convention is safe |
| Add or update tags on any page | Tags are additive; removing them can break resolver paths but adding them is safe |
| Update `content/` audit pages with fresh snapshots | These are point-in-time records; a new dated entry supersedes the old |
| Add a new concept page that extends the philosophy | New concepts are additive as long as they do not contradict the four interlocking claims |

### What Requires Care

| Action | Risk | Mitigation |
|---|---|---|
| Editing an existing timeline entry | Breaks the immutable log invariant | Instead: add a correction entry dated today with a note |
| Changing a concept page's core claim | May break interlocked philosophy nodes | Check `related_concepts` links and verify coherence with the four claims |
| Renaming a file | Breaks all resolver links and internal markdown links that reference it | Search for all references to the old path first |
| Moving a file between directories | Same as rename; also changes `type` expectation | Verify the `type` frontmatter matches the new directory's intended page type |
| Adding content to `transcripts/` or `media/` | These are `db_only` — git commits including these paths violate the storage scope | Store only in the database layer, not in git |
| Removing a tag used in resolver paths | The RESOLVER uses tag-based search (`type: methodology`, `breathwork`, etc.) | Only remove tags that are not cited in the resolver |

### What Breaks the System

| Action | What Breaks |
|---|---|
| Committing `transcripts/` or `media/` files to git | Storage scope violation; the brain's query contract assumes these live in the database only |
| Omitting required frontmatter fields | Page becomes invisible to type-based and tag-based resolver queries |
| Using wikilinks instead of markdown links | Links silently break outside wikilink-aware renderers |
| Writing a concept page that advocates pure hustle culture or pure spiritual passivity | Contradicts the Faith-Agency Paradox — makes the brain's philosophical answers incoherent |
| Writing a concept page that asserts mind-first transformation | Contradicts Body as Vehicle — breaks the embodied-first model |
| Treating progress as the endpoint rather than the motion | Collapses the Progress Is Positivity concept into toxic positivity; contradicts its documented shadow |
| Editing `gbrain.yml` storage scopes without updating database ingestion configuration | Breaks the storage contract silently — git and database diverge |

---

## Closing Summary

A reader who holds these invariants can navigate any page in the brain without reopening the README: compiled truth is always current and safe to rewrite; the timeline is an append-only evidence log; `transcripts/` and `media/` exist only in the database; every page must carry its four required frontmatter fields; internal links must be standard markdown; file names must be lowercase-hyphenated. On the philosophical layer, four claims form a load-bearing structure — embodiment-first transformation, progress-as-motion-not-destination, the simultaneous holding of agency and surrender, and identity-through-action — and a change to any one of them propagates a coherence obligation to the other three. Audit pages in `content/` are the fastest-decaying part of the brain and should never be treated as current facts; concept and methodology pages are the most durable. The core prediction: an agent that knows these invariants will never produce contradictory answers about Joseph's worldview, will never serve stale business metrics as current state, and will never write to the wrong storage layer.

Sources: [gbrain.yml:1-38](), [README.md:17-110](), [content/philosophy-map.md:35-71]()
