feat: StackMemory portal + shared brain + VISION.md meta-loop (24/7 agents)#16
Closed
jonathanpeterwu wants to merge 5 commits into
Closed
feat: StackMemory portal + shared brain + VISION.md meta-loop (24/7 agents)#16jonathanpeterwu wants to merge 5 commits into
jonathanpeterwu wants to merge 5 commits into
Conversation
Self-hosted portal that streams a persistent tmux Claude Code session to the browser over Socket.io + node-pty, designed to run on a small VPS behind Tailscale. - PortalServer (Express + Socket.io + node-pty) attaching to tmux new-session -A so the agent survives browser/portal restarts - Token auth (auto-generated, 0600) gating both page + WS handshake - Embedded xterm.js UI (no build step, ships in dist) - stackmemory portal start|status|stop|token CLI - Hetzner cloud-init, setup.sh, and systemd unit for 24/7 operation - docs/guides/PORTAL.md walkthrough https://claude.ai/code/session_01Gk8DiqCeG9uMaWT9RprwP1
A knowledge layer every agent (Claude, Codex, OpenCode, Hermes) reads from and writes to. Each experiment/decision/insight is recorded with a summary and conclusion, scoped to a repo (projectId) and org (workspaceId), so mutual thinking compounds across tools and machines. - BrainStore: local SQLite store (record/recall/supersede), repo+org scoped - BrainSync: isolated online push/pull (newest-wins, offline-safe) reusing the Provenant auth/endpoint — never touches the frame CloudSyncEngine - stackmemory brain record|recall|list|show|sync|status CLI - openBrain() resolves scope/db/auth like stackmemory sync - 14 tests (store scoping, supersede, upsert, sync cursor, conflict, offline) - docs/guides/BRAIN.md Agents connect by shelling out to the CLI, matching the existing Codex/OpenCode/Hermes wrapper integration model. https://claude.ai/code/session_01Gk8DiqCeG9uMaWT9RprwP1
A meta-orchestration layer one level above a single goal. A VISION.md (north-star mission + guardrails + ordered objectives + hard limits) drives a bounded loop that draws work from BOTH the objectives and a monitored signal inbox, delegates one item per tick to the conductor, and records the outcome to the shared brain so thinking compounds. - vision-file: parse/scaffold VISION.md, toggle objective checkboxes - signals: JSONL inbox for the monitored source (bugs, CI, issues) - vision-loop: select (signals outrank objectives) -> guardrail-gate -> brain-dedupe (no repeats) -> delegate (injected) -> record -> mark done - guardrails: maxIterations, maxIterationsPerDay, consecutive-failure circuit breaker, requireApproval, daily-resetting persisted state - stackmemory conductor vision init|status|signal|plan|run - run is plan-only unless --delegate-cmd is given (anti-haywire default) - 13 tests; docs/guides/VISION.md https://claude.ai/code/session_01Gk8DiqCeG9uMaWT9RprwP1
…dexedAccess The whole-repo typecheck OOMs in this environment; a scoped tsc pass over the new modules surfaced strict-mode violations esbuild/vitest don't catch: - exactOptionalPropertyTypes: stop assigning undefined to optional props (conditional spreads for supersededBy/refs/error/query fields; splitList now returns string[]) - noUncheckedIndexedAccess: guard regex-group and array-index access in the VISION.md parser and the loop's objective selection - tidy strict index access in the brain/vision tests Scoped typecheck (source + tests) now passes clean; 42 tests still green. https://claude.ai/code/session_01Gk8DiqCeG9uMaWT9RprwP1
CI lints the whole repo (eslint 'src/**/*.ts'); 146 pre-existing prettier/prettier errors in files unrelated to this PR were failing the lint job (main is red for the same reason). Auto-formats the 5 offending files so PR CI can go green. No behavior change. https://claude.ai/code/session_01Gk8DiqCeG9uMaWT9RprwP1
Collaborator
Author
|
Closing as superseded. The portal + brain + vision feature from this branch already merged to The only commits here not in #15 — the strict-mode type fixes and the pre-existing prettier cleanup — have been rebased onto current Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A three-layer stack for running agents 24/7: a browser portal into a persistent tmux Claude Code session, a shared brain that compounds context per repo + org, and a guardrailed vision meta-loop above the conductor that draws work from both VISION.md objectives and a monitored signal stream.
stackmemory portal)tmux new-session -AClaude Code session. Express + Socket.io + node-pty, token auth, embedded xterm.js UI. Hetznercloud-init.yaml+setup.sh+ systemd unit + Tailscale for 24/7 operation.stackmemory brain)projectId) and org (workspaceId). Agents record experiment summaries/conclusions and recall them; isolated, offline-safe online sync (newest-wins) reusing the Provenant auth — never touches the frameCloudSyncEngine.stackmemory conductor vision)--delegate-cmdis given.How they compose: the portal keeps the agent alive 24/7; the vision loop reads
VISION.md(the guardrail), picks the next objective or signal, delegates to the conductor, and writes the conclusion to the brain — which every agent (Claude, Codex, OpenCode, Hermes) reads, so mutual thinking compounds.Commits
feat(portal)— browser terminal into a 24/7 tmux Claude Code sessionfeat(brain)— shared, compounding context state per repo + orgfeat(vision)— VISION.md meta-loop above the conductorfix(brain,vision)—exactOptionalPropertyTypes+noUncheckedIndexedAccessstrict-mode fixesTests
42 new tests (15 portal, 14 brain, 13 vision), all green. Lint clean, build green.
Docs
docs/guides/PORTAL.md,docs/guides/BRAIN.md,docs/guides/VISION.md.Notes / follow-ups
/v1/brain/push|pull) need deploying inpackages/provenant; the client speaks the documented contract and runs local-first until then.server.ts— nativebrain_record/brain_recallMCP tools can follow.npm run typecheckOOMs in CI's default heap on this repo; the new modules were verified with a scopedtscpass (source + tests, exit 0).https://claude.ai/code/session_01Gk8DiqCeG9uMaWT9RprwP1
Generated by Claude Code