oculus-trinity
The Oculus Trinity
Everything is prose, code, and data at once. The difference is which lens you use.
The Triangle
graph TD
PROSE[π PROSE<br/>raw tokens]
CODE[βοΈ CODE<br/>executable]
DATA[π DATA<br/>structured]
PROSE -->|execute| CODE
PROSE -->|parse/structure| DATA
CODE -->|execute| DATA
CODE -->|print| PROSE
DATA -->|execute| CODE
DATA -->|render| PROSE
style PROSE fill:#e1f5fe
style CODE fill:#fff3e0
style DATA fill:#e8f5e9
Every Transform is One Step
| From | To | How |
|---|---|---|
| Prose β Code | Execute it | The act of executing IS the transform |
| Prose β Data | Parse/structure | Virtual fences, tokenize |
| Code β Data | Execute it | Running produces output |
| Code β Prose | Print it | Source is text |
| Data β Code | Execute it | Run functions on data |
| Data β Prose | Render it | Format/print |
Code and Data are one step apart. Execute in one direction, print in the other.
The Homoiconic Property
Everything is all three simultaneously:
βββββββββββββββββββββββββββββββββββββββββββββββ
β A YAML fence is: β
β β
β β’ PROSE - it's text in a markdown file β
β β’ CODE - it's parseable syntax β
β β’ DATA - it's structured key-values β
β β
β Which one? Depends what you DO with it. β
βββββββββββββββββββββββββββββββββββββββββββββββA TODO list in prose is:
- Prose when you read it
- Data when you query its items
- Code when you execute toggle/add/remove
PokΓ©mon but for Documents
Like type matchups, but for content:
| Content Type | Strong Against | Weak Against |
|---|---|---|
| Prose | Human readers | Machines |
| Code | Execution | Static analysis |
| Data | Queries | Narrative |
Transform to the type that wins your current battle.
Failed Transforms
Errors Are Data
Execution always returns data. If it fails, the data describes the failure:
# Success
{"success": True, "value": {"items": [...]}}
# Failure
{"success": False, "error": "SyntaxError", "message": "unexpected EOF", "stack_trace": "..."}The arrow Content β Data never breaks. You always get data back.
Then:
- Middleware sees error flag, renders appropriately
- Transformers handle it like any other data
- Error-data β Prose: render an error message
- Error-data β Code: generate retry logic
- The trinity still works
No exceptions bubbling. No special error paths. Just data that happens to describe a failure.
The Graph is THE Interface
All access goes through the graph:
- Want tokens? β Graph
- Want data? β Graph
- Want to transform? β Graph
The graph mediates all views. One interface, infinite perspectives.
See Also
- [[oculus-homoiconicity]] - the read-write-execute principle
- [[oculus-cache-architecture]] - how transforms are cached
- [[oculus-path-resolution]] - unified addressing for all types
North
slots:
- context:
- The trinity enables homoiconicity
slug: oculus-homoiconicity
- context:
- Linking trinity to homoiconicity
slug: oculus-homoiconicityWest
slots:
- context:
- Transforms are cached at the compose level
slug: oculus-cache-architecture
- context:
- Linking trinity to cache architecture
slug: oculus-cache-architecture
- context:
- Linking verification to trinity - the transformation matrix it references
slug: wanderland-paper-verificationEast
slots:
- context:
- All types use the same addressing
slug: oculus-path-resolution
- context:
- Linking path-resolution to trinity
slug: oculus-path-resolution
β northoculus-homoiconicity
β eastoculus-path-resolution