Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
07fb83f
The product cut: one database, the desktop as an environment, the pil…
claude Nov 23, 2026
d60be06
One database: the environment's schema in the kernel's database, subs…
claude Nov 23, 2026
578b2eb
Modules run on their own and meet over MCP; the layers re-cut (S-203)
claude Nov 23, 2026
847bb63
The MCP router trial: agentgateway passes the router's cases; the ker…
claude Nov 24, 2026
f994ec7
Our own MCP router in Go over the environment: servers and tools in P…
claude Nov 24, 2026
ef48e75
The router's test secret marked as a fixture for gitleaks (S-205)
claude Nov 24, 2026
44ca4cd
The desktop as an environment: the conversation as signals, the Assis…
claude Nov 24, 2026
c94c594
Handoff: S-197 to S-206, the desktop, the router, the assistant
claude Nov 24, 2026
daec1d3
Kernel pinned at c443238 (#139 merged): the stack runs its image, no …
claude Nov 24, 2026
6b8a977
The owner's first conversation with the assistant: trials get their o…
claude Nov 24, 2026
4539d3f
The re-cut: map, research, catalog and optimise as one file-based kit…
claude Nov 24, 2026
342c08d
The kit's proposal: two files, options as Backstage Components, docs …
claude Nov 24, 2026
dc9562c
The kit's proposal: every committed artifact in Backstage's format, m…
claude Nov 24, 2026
f60d800
Substrate is a default configuration; its parts become kernel modules…
claude Nov 24, 2026
4bdd070
Substrate is the home of the kernel's optional modules and the defaul…
claude Nov 24, 2026
01e9195
A part is a kernel module only when it needs the kernel; the desktop …
claude Nov 24, 2026
d0063bc
The desktop stays in the kernel; Substrate's parts install onto its k…
claude Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .claude/skills/setup/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ default, or docker) and, if 5432, 8090 or 11434 is taken, other ports. Never ech
## 3. The stack

Run `scripts/up.sh`. It renders the gateway's config, starts the stack and the tools container, makes the
`substrate` database and the gateway's, and runs `scripts/check.sh`. If a service does not come up, read its
logs (`scripts/logs.sh db|gateway|ollama`), find the cause, fix it in this repository, and run `scripts/up.sh`
`kernel` database (the kernel's schemas and the environment's `env`, S-202) and the gateway's, and runs `scripts/check.sh`. If a service does not come up, read its
logs (`scripts/logs.sh db|gateway|ollama|kernel|ui|caddy`), find the cause, fix it in this repository, and run `scripts/up.sh`
again. Known causes:

- **A refused Postgres password**: the volume (`substrate_db-data`) outlived the `.env` that made it. Keep the
Expand Down
4 changes: 4 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ UI_PORT=8100
KERNEL_URL=
# the kernel's secrets, generated once (deploy/secrets.txt)
KK_AUTHENTICATOR_PASSWORD=
# the MCP router's and its connectors' logins to the kernel's database (S-205)
MCP_ROUTER_DB_PASSWORD=
MCP_CONNECTOR_DB_PASSWORD=
MCP_DESKTOP_DB_PASSWORD=
KK_JWT_SECRET=
# OpenRouter models a caller may use (comma-separated names or regex:...); empty: free ones only
GATEWAY_OPENROUTER_MODELS=
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ jobs:
include:
- {name: db, context: deploy/postgres, file: deploy/postgres/Dockerfile}
- {name: tools, context: deploy/tools, file: deploy/tools/Containerfile}
- {name: mcp-router, context: mcp-router, file: mcp-router/Containerfile}
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1
Expand Down
2 changes: 2 additions & 0 deletions .gitleaksignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# a test fixture in the router's tests (S-205), not a secret; the line is marked gitleaks:allow since
f994ec7540ed56c52824f1823012cce936d203cd:mcp-router/router_test.go:generic-api-key:16
11 changes: 7 additions & 4 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ removed on 2026-11-23 (S-194): the assistant starts again from scratch, not port
| Part | Where | Role |
| --- | --- | --- |
| The store | the Knowledge Kernel (S-153, S-154, S-156: the UI and the skills read it from the kernel's database `kernel`, the agent's tools are the kernel's MCP `substrate` profile; `scripts/kernel.sh`); the old `store` package is retired and its schema was dropped on 2026-11-23 (S-191; a dump is in `.state/backups/`) | Wikibase's data model with OpenWiki's pinned evidence (S-135, S-138): entities, statements with ranks, references, spans, revisions, a page per entity; the agent's tools over MCP, and maps, roles, interfaces and catalogs (S-139; the `map` and `catalog` skills) |
| The real-time environment | `environment/` (schema `env` in `environment/sql/`, migrated by `environment/db.py`, the channel in `environment/channel.py`) on pgmq in the same Postgres | signals logged whole and fanned out as topics, a queue per actuator behind its gate (`free`, `propose`, `deny`), the channel into Claude Code, archived only on `ack` (S-143) |
| The real-time environment | `environment/` (schema `env` in `environment/sql/`, migrated by `environment/db.py`, the channel in `environment/channel.py`) on pgmq, in the kernel's database `kernel` (S-202, the kernel's D-126: one database) | signals logged whole and fanned out as topics, a queue per actuator behind its gate (`free`, `propose`, `deny`), the channel into Claude Code, archived only on `ack` (S-143) |
| The model gateway | container `gateway` (Bifrost), `scripts/gateway.py` | every model call goes through it with its caller's key and is recorded there, not by the caller (S-77) |
| Local models | container `ollama`; containers `llm` and `llm-fast` (llama.cpp, profile `llm`) | Ollama for the store's embeddings; two chat models (S-169): the slow capable one, Inkling 2 Mini on the CPU, at the gateway as `local/slow`; the fast one, LFM3 1.7B on the GPU, as `fast/fast` (the alias names the role, not the model; Gemma is retired) |
| Tools | `bin/`, container `substrate-tools` | the scripts' Python and gitleaks, run in a container as you (S-19) |
| The UI | `ui/` (`ui/server.py`, `ui/static`), compose service `ui` on 127.0.0.1:8100 | the store's pages and maps as diagrams (S-140), read-only; v1's Workbench rebuilt, with no name of its own (S-141) |
| The desktop | compose service `caddy` (`deploy/caddy/Caddyfile`, `deploy/caddy/apps.json`) on 127.0.0.1:8080, in front of the kernel's `kk serve`; its framed apps on 8081 (the gateway's dashboard) and 8082 (the map pages) | the kernel's UI shell as a desktop (the kernel's D-127): a launcher and windows for search, review, change sets, the graph, the view modules and framed apps, each app on an origin of its own with its headers rewritten in the proxy; MCP over HTTP at `/mcp`; a person signs in with `scripts/kernel.sh person NAME` (S-199, S-200) |
| The MCP router | `mcp-router/` (Go), compose services `mcp-router` (its endpoint and page, 127.0.0.1:8083 through Caddy) and one connector per server (`mcp-kernel`); its rules in `environment/sql/010_mcp.sql` | one MCP endpoint for agents and the desktop in front of every connected MCP server; each server and tool registered in the environment, each tool an actuator behind its gate, each call an action recorded and, when it changes the world, waiting for a person on the router's page (S-203, S-205) |
| The desktop and the assistant | `desktop/` (`server.py`; the Assistant view module, mounted into the kernel's container), compose services `desktop` and its connector `mcp-desktop`; `environment/sql/011_desktop.sql`; `scripts/assistant.sh` | the conversation between a person and the agents as signals: the person talks in the desktop's Assistant window, an agent (a Claude Code session started by `scripts/assistant.sh`) hears it on the channel and answers, shows and asks through the router (S-206) |
| Images | `.github/workflows/images.yml`, `image_ref` in `scripts/lib.sh` | `ghcr.io/openreplicant/substrate-{db,tools}` and the kernel's image are pulled (tags `SUBSTRATE_IMAGE_TAG`, `KERNEL_IMAGE_TAG`); compose keeps `build:` as the fallback (S-167) |
| Glue | `scripts/`, `deploy/` | brings the parts up and connects them |

Expand Down Expand Up @@ -70,13 +72,14 @@ removed on 2026-11-23 (S-194): the assistant starts again from scratch, not port
scripts/bootstrap.sh # once per machine: host tools, images (pulled from ghcr.io/openreplicant, built when not; S-167), the tools container
scripts/up.sh # the stack (db, gateway, ollama, ui), the tools container, the databases; then check.sh
scripts/check.sh # is everything up and wired
scripts/test.sh [FILE...] # the test suites, in the tools container
scripts/test.sh [FILE...] # the test suites, in the tools container (the kernel's in its image, the router's Go tests in Go's)
scripts/build.sh [db|tools|kernel] # none: pull published images, build what did not pull; SUBSTRATE_BUILD=1 builds all
scripts/logs.sh SERVICE # db, gateway, ollama, kernel, ui, caddy, llm, llm-fast
scripts/logs.sh SERVICE # db, gateway, ollama, kernel, ui, caddy, mcp-router, mcp-kernel, llm, llm-fast
scripts/tools.sh start|stop|status
scripts/kernel.sh init|catalog|login NAME|mcp NAME|person NAME # the Knowledge Kernel: its schema, the catalog into it, an agent's login, its MCP server, a person's sign-in
scripts/assistant.sh # the assistant: a Claude Code session you talk to in the desktop's Assistant window (S-206)
scripts/down.sh [--volumes] # stop (deleting data asks first)
python3 scripts/gateway.py render|keys # the gateway's config from .env and its callers
bin/in-tools python3 scripts/db.py init # the databases and the environment's schema (environment/sql/)
bin/in-tools python3 scripts/db.py init # the kernel's database and the environment's schema in it (environment/sql/)
bin/in-tools python3 scripts/env.py waiting|decide|publish|actuators|gate|queues # the environment, as a person
```
Loading