feat: two-brain topology — WSL Agentic-OS brain + Windows standalone central brain

- brain/graph/sync-to-windows.sh: rebuild WSL brain + push merged graph to C:/Users/Austin/Brains/central
- cron wrapper now also syncs to Windows hourly
- README documents the two-brain layout
- Windows side (C:/Users/Austin/Brains/central): own venv + graphifyy[mcp],
  serve-brain.bat (HTTP MCP :8090), keepalive-brain.bat — fully offline/standalone
This commit is contained in:
Austin 2026-07-26 13:04:16 -07:00
parent 0a28ef0389
commit ced62821dc
3 changed files with 7907 additions and 8035 deletions

View File

@ -2,18 +2,22 @@
One central, queryable brain that project graphs roll up into.
## Topology
- `agentic-os.json` — this project's own code graph (built from `graphify . --code-only`).
- `projects/<name>.json` — each linked project's graph (registered via `link-project.sh`).
- `central-graph.json` — the MERGED cross-repo brain (union of all the above). This is the artifact everything queries.
- `serve-brain.sh` — serves `central-graph.json` over HTTP MCP at `http://127.0.0.1:8090/mcp`.
- Dashboard: the brain directory is mounted at `http://127.0.0.1:8080/brain-graph/`.
## Topology (two brains)
1. **Agentic-OS brain (WSL)** — this folder. `agentic-os.json` + merged `central-graph.json`.
2. **Windows central brain (device-wide, offline, standalone)**`C:\Users\Austin\Brains\central\`.
Its own Python venv + Graphify, serves `central-graph.json` over HTTP MCP at
`http://127.0.0.1:8090/mcp` from Windows. No WSL dependency at query time.
WSL's `sync-to-windows.sh` pushes the merged graph into it hourly.
## Commands
Per-project graphs: `projects/<name>.json` (linked via `link-project.sh`) roll
up into `central-graph.json` here, which is then synced to Windows.
## Commands (WSL side)
```
bash brain/graph/build-central.sh # rebuild central brain (code graph + merge linked projects)
bash brain/graph/build-central.sh # rebuild WSL central brain (code graph + merge linked projects)
bash brain/graph/link-project.sh <name> <graph.json> # register a project's graph into the brain
bash brain/graph/serve-brain.sh # serve central brain over HTTP MCP (:8090)
bash brain/graph/sync-to-windows.sh # rebuild + push merged graph to Windows central brain
bash brain/graph/serve-brain.sh # serve WSL central brain over HTTP MCP (:8090)
```
Set `CENTRAL_BRAIN_PORT` to override the serve port (default 8090).

File diff suppressed because it is too large Load Diff

27
brain/graph/sync-to-windows.sh Executable file
View File

@ -0,0 +1,27 @@
#!/usr/bin/env bash
# Sync the WSL-built central brain into the WINDOWS-native central brain.
#
# The Agentic-OS brain lives in WSL (brain/graph/). The device-wide central
# brain lives on Windows at C:\Users\Austin\Brains\central\, running its own
# Graphify (own venv) — fully offline, no WSL dependency at query time.
#
# This script: rebuild the WSL central brain, then copy central-graph.json
# into the Windows folder so the Windows serve (serve-brain.bat) picks it up.
set -u
DIR="/home/austin/agentic-os"
WIN_BRAIN="/mnt/c/Users/Austin/Brains/central"
cd "$DIR" || { echo "FATAL: cannot cd $DIR"; exit 1; }
echo "==> rebuild WSL central brain"
bash "$DIR/brain/graph/build-central.sh" 2>&1 | tail -3
if [ ! -d "$WIN_BRAIN" ]; then
echo "WARN: Windows brain dir missing ($WIN_BRAIN) — skipping push. Create it + venv first."
exit 0
fi
echo "==> push central-graph.json -> Windows brain"
cp "$DIR/brain/graph/central-graph.json" "$WIN_BRAIN/central-graph.json"
echo " copied -> $WIN_BRAIN/central-graph.json"
echo "==> done. Windows serve (serve-brain.bat) will serve the updated graph on next (re)start."