lantern

oculus-cache-architecture

Oculus Cache Architecture

The layered rug: immutable at the bottom, progressively derived upward.

The Stack

┌─────────────────────────────────────────────┐
│  COMPOSE (clouds)   ← middleware cache      │
│  "your opinion, man"                        │
├─────────────────────────────────────────────┤
│  DATA               ← execution output      │
│  RUG #2 (sacred)                            │
├─────────────────────────────────────────────┤
│  INTERPOLATED       ← components expanded   │
│  (stalk)                                    │
├─────────────────────────────────────────────┤
│  SUBSTITUTED        ← variables resolved    │
│  (sprout)                                   │
├─────────────────────────────────────────────┤
│  CONTENT (seed)     ← raw tokens            │
│  RUG #1 (sacred)    ← THE SOURCE OF TRUTH   │
└─────────────────────────────────────────────┘
         ↑ IMMUTABLE - nothing touches this

Two Rugs

From [[lebowski-corollary]]:

Rug What Mutability
Content Raw tokens in the file NEVER MUTATE
Data Execution output NEVER MUTATE

The transformation Content → Data is pure. No middleware in the arrow.

Middleware can only create opinions at the compose level.

The Waterfall

When you request something, holes fill from below:

REQUEST: "Give me X at compose level"
         │
         ↓
    ┌─────────────────┐
    │  COMPOSE CACHE  │ ← got it? return it
    └────────┬────────┘
             │ miss
             ↓
    ┌─────────────────┐
    │      DATA       │ ← got it? render up
    └────────┬────────┘
             │ miss
             ↓
    ┌─────────────────┐
    │    CONTENT      │ ← always here
    └────────┬────────┘
             │
             ↓
         RENDER UP
         to fill the hole

You always have content. The rug is always there. So any hole can be filled by walking down to content and rendering back up.

Cache Invalidation

Trivial. Just delete.

  • Delete any level → next request regenerates from below
  • Modify content → everything above is stale, regenerates on demand
  • No explicit invalidation logic needed

The graph is self-healing. Poke a hole anywhere, it fills from below.

Conflict Resolution

When two things disagree:

Thing A (cached) ←── disagree? ──→ Thing B (cached)
        │                                  │
        └──────────┬───────────────────────┘
                   │
                   ↓ wipe both
                   
        ┌──────────────────────┐
        │      CONTENT         │  ← the rug
        └──────────────────────┘
                   │
                   ↓ both reload
                   
Thing A (fresh) ←──── agree ────→ Thing B (fresh)

No merge logic. No three-way diffs. Just:

  • Disagreement detected
  • Wipe both caches
  • Both regenerate from content
  • Agreement guaranteed (same source)

The rug is the arbiter.

The Rules

  • Content → Data is pure - no middleware in the transformation
  • Data is sacred - middleware can't mutate it
  • Middleware creates opinions - cached at compose level
  • Holes fill from below - always have content to rebuild
  • Conflicts resolve by wipe - regenerate from shared source

See Also

  • [[lebowski-corollary]] - the rug is the source of truth
  • [[oculus-trinity]] - prose/code/data transforms
  • [[oculus-path-resolution]] - unified addressing

North

slots:
- context:
  - Content is the rug, data is opinion
  slug: lebowski-corollary
- context:
  - Linking cache architecture to lebowski corollary
  slug: lebowski-corollary

East

slots:
- context:
  - Transforms between prose/code/data use this cache
  slug: oculus-trinity
- context:
  - Linking trinity to cache architecture
  slug: oculus-trinity

West

slots:
- context:
  - All cache levels accessed via unified paths
  slug: oculus-path-resolution
- context:
  - Linking path-resolution to cache architecture
  slug: oculus-path-resolution
↑ northlebowski-corollary
→ eastoculus-trinity