From 22daaade36ad99596228c0d13466330dd6f390ef Mon Sep 17 00:00:00 2001 From: Perplexity Computer Date: Wed, 18 Mar 2026 23:54:13 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20INTEGRATION.md=20v2=20=E2=80=94=20Repli?= =?UTF-8?q?t=20fork=20coordination=20+=20economy=20protocol?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Added Fork Coordination section documenting replit/the-matrix changes - Acknowledged Replit resolved issues #1 (Vite), #2 (agent-defs), #6 (UUID) - Updated architecture diagram to reflect Vite + ES module structure - Documented Replit's module exports for each file - Aligned field names to camelCase (matching Replit's codebase) - Updated Phase 2 ownership: Replit primary, Perplexity review - Added coordination strategy: code flows replit→canonical, docs stay canonical - Resolved WS path decision (#10): VITE_WS_URL env var --- INTEGRATION.md | 660 ++++++++++++++++++++++++++++--------------------- 1 file changed, 377 insertions(+), 283 deletions(-) diff --git a/INTEGRATION.md b/INTEGRATION.md index 91053b0..d82f69a 100644 --- a/INTEGRATION.md +++ b/INTEGRATION.md @@ -1,355 +1,449 @@ # Integration Plan: The Matrix × Timmy Time -**Date:** 2026-03-18 +**Date:** 2026-03-18 (v2 — updated against live codebase + Replit fork) **Author:** Perplexity Computer -**Status:** Draft — ready for dev team review +**Status:** Active — cross-referenced with issues across all three repos --- ## Overview -The Matrix is a standalone 3D world that visualizes and commands the Timmy Time agent swarm. It currently runs on a mock WebSocket. This document defines how it integrates with the two other modes of the Timmy Time system: +The Matrix is a standalone 3D world that visualizes and commands the Timmy Time agent swarm. It currently runs on a `MockWebSocket`. This document defines how it integrates with the two other systems: -1. **Timmy Dashboard** — the existing FastAPI/HTMX mission control UI (`/home`, `/briefing`, `/tasks`, `/swarm`, `/spark`, `/market`, `/tools`, etc.) -2. **Agent Token Economy** — the Lightning Network-based economic layer where agents earn/spend sats for task execution +1. **Timmy Dashboard** — FastAPI/HTMX mission control (`rockachopa/Timmy-time-dashboard`) +2. **Token-Gated Economy** — Lightning-based agent economy (`replit/token-gated-economy`) -The Matrix does not replace either system. It is a third interface — a spatial, persistent, iPad-native way to interact with the same backend. +The Matrix does not replace either system. It is a third interface — spatial, persistent, iPad-native. + +### Related Issues + +| Repo | Key Issues | +|---|---| +| `perplexity/the-matrix` | #1–#17 (full backlog) | +| `replit/token-gated-economy` | #1 (EPIC), #2 (WebSocket), #3 (SSE), #7 (3D env), #9 (chat UI) | +| `rockachopa/Timmy-time-dashboard` | #325 (cognitive state → Matrix), #326 (Timmy hands), #324 (three-phase loop) | --- -## Architecture +## Fork Coordination: `perplexity/the-matrix` ↔ `replit/the-matrix` -``` -┌─────────────────────────────────────────────────────────┐ -│ TIMMY TIME BACKEND │ -│ │ -│ FastAPI ─── SQLite ─── Ollama ─── Lightning (LND/CLN) │ -│ │ │ │ │ │ -│ ▼ ▼ ▼ ▼ │ -│ /api/tasks /api/agents /api/chat /api/economy │ -│ │ │ │ │ │ -│ └───────────┴──────────┴────────────┘ │ -│ │ │ -│ WebSocket Gateway │ -│ ws://tower:8080/ws │ -│ │ │ -└──────────────────────┼──────────────────────────────────┘ - │ - ┌────────────┼────────────┐ - │ │ │ - ▼ ▼ ▼ - ┌──────────┐ ┌──────────┐ ┌──────────┐ - │ Timmy │ │ The │ │ Telegram │ - │Dashboard │ │ Matrix │ │ Bot │ - │(HTMX/WS)│ │(Three.js)│ │ (bridge) │ - └──────────┘ └──────────┘ └──────────┘ -``` +Replit forked the canonical repo and is actively developing on branch `feat/vite-build-agent-defs`. This creates a two-track development model: -All three interfaces share the same backend. The Matrix connects via the WebSocket gateway, same as the dashboard's live feeds. +### What Replit Has Done (as of 2026-03-18) + +| Change | Addresses Issue | Details | +|---|---|---| +| Vite build system | #1 | `package.json` + `vite.config.js`, Three.js as npm dep (`0.171.0`) | +| Consolidated agent defs | #2 | New `js/agent-defs.js` — single source of truth for agent id/color/role/position | +| `crypto.randomUUID()` | #6 | Used in `websocket.js` subscribe handshake | +| ES module refactor | — | All files use `import/export`, Three.js via npm not CDN | +| CSS inlined | — | Styles moved into `index.html