wanderland-witness
Wanderland Witness
Oculus API regression test suite. The diff IS the error signal from the attractor.
Overview
Wanderland Witness is an external test harness that exercises core Oculus API operations and compares output against a known-good reference. Any drift from the reference represents an error signal - the system deviating from its stable attractor.
Control Theory Framing: In control systems, an attractor is a stable state the system naturally evolves toward. The reference file represents our attractor - the expected behavior. When the actual output drifts from the reference, the diff quantifies the error signal that needs correction.
Usage
# Run tests, show diff if any
wanderland-witness
# Update reference from current output
wanderland-witness --update
# Show full output
wanderland-witness --verbose
# Write results to this node
wanderland-witness --nodeFiles
| File | Purpose |
|---|---|
~/.local/bin/wanderland-witness |
Test script |
~/.local/share/wanderland/witness/reference.txt |
Expected output (attractor) |
~/.local/share/wanderland/witness/output.txt |
Latest run output |
~/.local/share/wanderland/witness/diff.txt |
Error signal (when present) |
Tests
1. Basic Node Read
Tests the fundamental node retrieval at all sprouting levels.
Endpoints: GET /api/oculus/node/{slug}?level={level}
Sprouting Levels (Jack and the Beanstalk pattern):
- π± seed/raw - Magic bean, raw markdown
- πΏ sprout/substituted - Variables resolved
- πͺ΄ stalk/interpolated - Includes assembled
- βοΈ clouds/rendered - Fences executed (default)
Implementation: api.py:583-613
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 583-613
title: Node Read Implementationβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| Read node (default) | β | Returns markdown |
| Read node (seed/raw) | β | No processing |
| Read node (sprout) | β | Variables resolved |
| Read node (clouds) | β | Fences executed |
2. Peek Operations
Tests reading values at deep paths using unified addressing grammar.
Endpoint: GET /api/oculus/peek/{slug}?path={path}&level={level}
Unified Addressing Grammar:
sectionβ prose + rendered fencessection.yamlβ first YAML fence datasection.yaml[0]β explicit first YAML fencesection.pantryβ fence with label="pantry"section.fences[*]β all fencessection.fences[type=ruby]β filtered fences
ISA Levels (Q/K/V attention semantics):
@L3β Code: raw fence content ("what are you made of?")@L4β Data: parsed/executed result ("what do you produce?")@L5β Document: formatted for display ("how do you present?")
Implementation: api.py:1864-1894
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 1864-1894
title: Peek Implementationβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| Peek prose section | β | PathResolutionError if no fences (expected) |
| Peek YAML data | β | Returns parsed fence data |
| Peek at L3 (sprout) | β | Variables resolved |
| Peek at L4 (stalk) | β | Interpolated |
| Peek at L5 (clouds) | β | Fully rendered |
3. Fence Discovery
Tests querying and retrieving fence metadata.
Endpoints:
GET /api/oculus/fences- List all fencesGET /api/oculus/fences?type={type}- Filter by fence typeGET /api/oculus/fences?slug={slug}- Filter by nodeGET /api/oculus/fences/{fence_id}- Get specific fence
Addressing Modes:
- Label:
list-bookmarks(global lookup) - Slug:Label:
fence-bookmarks:list-bookmarks - Slug:Index:
fence-bookmarks:3
Implementation: api.py:3623-3675 and api.py:4340-4434
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 3623-3675
title: Get Fence by IDβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 4340-4380
title: List/Query Fencesβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| List all fences | β | Returns 414+ fences |
| Query by type | β | Filters by python, yaml, etc |
| Query by slug | β | Returns fences for specific node |
| Get fence by label | β | Global label lookup |
| Get fence by slug:label | β | Scoped lookup |
4. Fence Execution
Tests executing fences with various addressing modes.
Endpoints:
POST /api/oculus/fences/{fence_id}/execute- By labelPOST /api/oculus/nodes/{slug}/fences/{fence_id}/execute- By slug
Request Body:
{
"params": {"key": "value"},
"format": "json",
"force": false
}Implementation: api.py:4000-4340 and api.py:4603-4802
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 4000-4060
title: Fence Execute Endpointβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| Execute by label | β | Global fence lookup |
| Execute by slug:label | β | Scoped execution |
| Execute by slug:index | β | Positional addressing |
| Execute with params | β | Passes config to fence |
5. Virtual Fences
Tests detection and querying of virtual fences (TODO lists, tables, etc).
Endpoints:
GET /api/oculus/virtual-fences- List all virtual fencesGET /api/oculus/virtual-fences?fence_type={type}- Filter by type
Virtual Fence Types:
virtual:todo-list- Markdown checklistsvirtual:table- Markdown tablesvirtual:callout- Admonition blocks
Implementation: api.py:5199-5258
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 5199-5258
title: Virtual Fences Queryβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| List virtual fences | β | Returns 200+ detected patterns |
| Query by type | β | Filters todo-list, table, etc |
6. Graph Structure
Tests graph navigation and structure queries.
Endpoints:
GET /api/oculus/edges/{slug}- Get directional linksGET /api/oculus/edges/{slug}?depth={n}- Multi-hop traversalGET /api/oculus/nodes- List all nodesGET /api/oculus/nodes/similar/{slug}- Fuzzy search
Direction Convention:
- North: Parent/overview
- South: Children/details
- East/West: Siblings/related
Implementation: api.py:1426-1572
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 1426-1480
title: Get Node Edgesβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 1508-1572
title: List Nodes & Similarβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| Get node edges | β | Returns N/S/E/W links |
| Get edges (depth=2) | β | Multi-hop traversal |
| List nodes | β | Returns 1800+ nodes |
| Find similar | β | Fuzzy matching works |
7. Tags
Tests tag-based discovery and filtering.
Endpoints:
GET /api/oculus/tags- List all tags with countsGET /api/oculus/tags/find/{tag}- Find nodes with tag
Tag Conventions:
namespace:valuefor categories (e.g.,status:active)- Simple tags for topics
Implementation: api.py:2873-2919
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 2873-2919
title: Tag Operationsβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| List all tags | β | Returns taxonomy with counts |
| Find by tag | β | Returns matching node slugs |
8. Reading Lists
Tests the reading list pattern (semantic bookmarking).
Fences:
get-reading-list- Get slugs for a topicexecute-reading-list- Load all nodes
Implementation: See [[required-reading]] node
| Test | Status | Notes |
|---|---|---|
| Get reading list fence | β | Fence metadata returned |
| Execute reading list | β | Returns slugs for topic |
9. Search & Grep
Tests full-text search using ripgrep.
Endpoints:
GET /api/oculus/grep?q={query}- Search contentGET /api/oculus/grep?q={query}&mode=count- Match counts
Options:
mode: matches, files, countlimit: max resultscontext: lines around matchglob: file pattern filter
Implementation: api.py:2697-2873
source: $REPOS/wanderland/oculus-api/oculus/api.py
lines: 2697-2760
title: Grep/Search Endpointβ Fence Execution Error: "'code-window' - Down the rabbit hole we went, but that node doesn't exist! Try 'oculus list' to see what's available."
| Test | Status | Notes |
|---|---|---|
| Grep search | β | Returns results array |
| Grep count mode | β | Returns match count |
Run History
runs:
- timestamp: "2026-01-10T20:53:33-05:00"
status: PASS
tests: 30
drift_lines: 0
note: Reference updated with correct API routesRun Tracking Fence
{
"timestamp": "2026-01-27T14:44:21.392854",
"status": "UNKNOWN",
"tests": 0,
"drift_lines": 0,
"note": ""
}Latest Run
Full output: ~/.local/share/wanderland/witness/output.txt
Reference: ~/.local/share/wanderland/witness/reference.txt
Diff (if any): ~/.local/share/wanderland/witness/diff.txt
Run wanderland-witness --verbose to see full test output.
Related
- [[cmd-peek]] - Peek command documentation
- [[cmd-poke]] - Poke command documentation
- [[fence-architecture-pattern]] - Fence system design
- [[required-reading]] - Reading list pattern
Slots
North
slots:
- slug: oculus
context:
- Linking witness to main oculus nodeSouth
slots: []East
slots:
- slug: wtf-am-i-doing
context:
- Linking to activity introspection dashboardWest
slots: []Provenance
Document
- Status: π΄ Unverified
Changelog
- 2026-01-11 01:54: Node created by mcp - Creating wanderland-witness documentation node with API test coverage