Skip to content

Instantly share code, notes, and snippets.

@dhaupin
Created May 30, 2026 02:29
Show Gist options
  • Select an option

  • Save dhaupin/9c8f5fe9652943541f031a15c9fc8679 to your computer and use it in GitHub Desktop.

Select an option

Save dhaupin/9c8f5fe9652943541f031a15c9fc8679 to your computer and use it in GitHub Desktop.
Vant-0.8.6-flow
╔══════════════════════════════════════════════════════════════════════╗
║ vant.js (MAIN) ║
╠══════════════════════════════════════════════════════════════════════╣
║ ║
║ init() ──────→ boot.init() ║
║ └─ 1. sudo.createTask() ║
║ └─ 2. sandbox.init() ║
║ └─ 3. qos.init() ║
║ └─ 4. escrow init ║
║ └─ 5. lock.init() ║
║ └─ 6. audit.init() ║
║ └─ 7. brain.init() ║
║ └─ 8. islands init ║
║ └─ 9. shell.setTaskId() ║
║ └─ 10. tmp.setTaskId() ║
║ ║
║ think(query) ║
║ ├─ islands.findTriggers() ─→ which islands to load ║
║ ├─ search.queryBrain() ────→ BM25 + RRF + rerank ║
║ └─ islands.autoHydrate() ─────→ lazy-load data ║
║ ║
║ learn(key, content) ║
║ ├─ brain.write() ║
║ ├─ memoize.set() ──────────────────────→ LRU cache ║
║ └─ audit.log() ║
║ ║
║ remember(key, content?) ║
║ ├─ content? → memoize.set() + brain.append() ║
║ └─ else → memoize.get() ║
║ ║
║ act(operation) ║
║ ├─ lock.acquire() ──────────────────→ serialize ║
║ ├─ execute (function or pass-through) ║
║ ├─ audit.log() ║
║ └─ lock.release() ║
║ ║
╚══════════════════════════════════════════════════════════════════════╝
↓ wires through, extends, or wraps ↓
╔══════════════════════════════════════════════════════════════════════╗
║ framework.js ║
║ (middleware with security chain) ║
╠══════════════════════════════════════════════════════════════════════╣
║ execute() = VAF.validate + QoS.ratelimit + Escrow.quota ║
║ └─→ vant.act() ║
║ ║
║ computeEval() = security chain → runtime.compute.eval() ║
║ embedText() = security chain → runtime.embed.embed() ║
║ ║
║ Re-exports ALL of vant.js (lines 175-195) ║
╚══════════════════════════════════════════════════════════════════════╝
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment