feat(brain): a sandboxed language model session with an MCP channel to the box

The brain: a long-running Claude Code session, confined with bwrap to
its workspace, that hears the box through a channel and works the TV
with the box's ir and look capabilities.

- brain/channel.js: MCP on stdio to the brain (reply, say, ir_listen,
  ir_send, look, report_problem), and the ask capability, behind a
  gate, to the box
- brain/ask.js: the conversations between them; report.js: an issue on
  one repository, by a token that can do nothing else
- brain/brain.service: the session in tmux, in bwrap: a read-only
  system, an empty home but for its workspace, keys, and claude
- brain/instructions.md: how to work the TV; it imports household.md,
  who's who (an example, with no real people)
- brain/Makefile: make install, attach, status
- checks: brain-js (unit tests), brain (the package, put together)

Generated-by: Claude Opus 5.5
This commit is contained in:
dckc committed 2026-12-02 18:57:08 -06:00
1 parent 190600a696
commit 5cbea49349
16 files changed
+927 -1

No files matched your search

+5
View File
@@ -41,6 +41,8 @@
speech-js = pkgs.callPackage ./speech/default.nix { };
box-js = pkgs.callPackage ./box/default.nix { };
earcons = pkgs.callPackage ./box/earcons.nix { };
brain = pkgs.callPackage ./brain/brain.nix { src = self; };
brain-js = pkgs.callPackage ./brain/default.nix { };
});
# nix develop --command make test
@@ -58,6 +60,9 @@
'';
speech = self.packages.${pkgs.stdenv.hostPlatform.system}.speech-js;
box-js = self.packages.${pkgs.stdenv.hostPlatform.system}.box-js;
brain-js = self.packages.${pkgs.stdenv.hostPlatform.system}.brain-js;
# The channel, its unit, and its instructions, put together.
brain = self.packages.${pkgs.stdenv.hostPlatform.system}.brain;
# Doctests, and pyflakes for the names doctests don't reach.
box-py = pkgs.runCommand "box-py-doctests" { nativeBuildInputs = [ (python pkgs) ]; } ''
cd ${./box/body}