From 1d8e87c32956a41bcac11910eb041697614739fe Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 14:34:55 -0800 Subject: [PATCH] The docs follow the re-cut: a new framework, the old one archived; README, CLAUDE.md, repos and the plan's intro rewritten (S-215) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Khsqyv3JB21BJ91MipHNhp --- CLAUDE.md | 26 ++-- DECISIONS.md | 1 + README.md | 61 ++++---- docs/archive/framework-s185.md | 183 ++++++++++++++++++++++ docs/framework.md | 273 +++++++++++++-------------------- docs/plan.md | 17 +- docs/repos.md | 18 +-- 7 files changed, 350 insertions(+), 229 deletions(-) create mode 100644 docs/archive/framework-s185.md diff --git a/CLAUDE.md b/CLAUDE.md index 4dcb3a2..c3a27d7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,21 +1,23 @@ # Substrate -An operating system for AI agents (S-185): a top-level orchestrator (an ordinary LLM harness given skills, MCP -servers and hooks) that maps, orchestrates and optimises a working system, on a kernel made of Postgres where -everything is an object. Its shape is `docs/framework.md`; what is built next is `docs/plan.md` ("Next, in order"), -the one plan; every default and its reason is in `DECISIONS.md` (append-only). Read the plan first. +The default distribution (S-209 to S-214): an agent harness (Claude Code first) configured to get things done with +two products, interactively. **Morphogen** is the kit (map, research, catalog, optimise, on Backstage files, no +database); **the Kernel** is Postgres made into a kernel, a layer above the kit that ingests its files; Substrate adds +its optional parts onto the kernel (the environment and gates, the channel, the MCP router, the assistant's view) and +the stack. Its shape is `docs/framework.md`; where each part goes is `docs/parts.md`; what is built next is +`docs/plan.md` ("The re-cut"), the one plan; every default and its reason is in `DECISIONS.md` (append-only). Read +the plan first. This is the **fresh tree** (S-137). v1 is tagged `v1-final` and its plans are in `docs/archive/`: history, not plans to work from. v1's databases are kept in the same Postgres volume (`workbench`, `gateway`) and dumped in `.state/backups/`; what people stated there comes back as data imported into the new store. -The layers (S-185, `docs/framework.md`, `docs/repos.md`): **the Kernel** (Postgres made into a kernel), **Substrate** -(the orchestrator kit, the adapters, the reference stack), **Morphogen** (the optimiser, a Claude Code plugin), -**distributions** (folders in `distributions/` here for now), **MetaSoar** (the research). Every dependency is a -contract, never another project's code. Environments are OpenEnv environments (S-184). Name parts by their role and -models by their alias (`fast`, `slow`, `cloud`), never by model. **The table below is what is in the tree today.** -The old assistant (the companion, the voice head, the worker, blocks, the components judge, the ladder's code) was -removed on 2026-11-23 (S-194): the assistant starts again from scratch, not ported; git keeps the old parts. +The projects (S-209, S-212; `docs/framework.md`, `docs/repos.md`): **Morphogen** (the kit), **the Kernel**, **Substrate** +(the default distribution), **MetaSoar** (the research). A part of Substrate is a kernel module only when it needs the +kernel; otherwise it is an Agent Skill, an MCP server, a compose service or an outside service (S-213). Every +dependency is a contract, never another project's code. Name parts by their role and models by their alias (`fast`, +`slow`, `cloud`), never by model. **The table below is what is in the tree today, before the parts move** +(`docs/parts.md`). The old assistant was removed on 2026-11-23 (S-194); git keeps it. | Part | Where | Role | | --- | --- | --- | @@ -54,7 +56,7 @@ removed on 2026-11-23 (S-194): the assistant starts again from scratch, not port committed) may be recommended whatever their licence, with the licence named (S-188). Check before adding. 8. **Every change ends with `scripts/check.sh` passing**, and `scripts/test.sh` where tests exist, or with the failure named and explained. -9. **Morphogen is the optimiser** (S-185; it was out of the build only so it could be iterated on quickly): use it +9. **Morphogen is the kit** (S-209: map, research, catalog, optimise; S-185 made it the optimiser): use it through its contract (the cell file, its Claude Code plugin and MCP server), never by importing its code; change it only by pull request in its own repository, like any upstream project (the `upstream` skill). diff --git a/DECISIONS.md b/DECISIONS.md index 33aaec6..a11d743 100644 --- a/DECISIONS.md +++ b/DECISIONS.md @@ -222,3 +222,4 @@ Status: **decided** (owner agreed), **adopted** (recommended and taken; confirm | S-212 | **Substrate is the home of the kernel's optional modules and the default distribution; the kernel's core ships without them; agents and experiments build on the distribution** (2026-11-24; the owner: "the desktop UI and other things which could be Colonel modules but we would not bundle them with the core instead they would ship separately and that's where substrate could be the home of these things which are nice options to have but should not necessarily ship with the core and we'll just included in a default distribution and then we can build all our other agents or experiments on top of that distribution"). Amends S-211 (b) and (d): the parts S-211 sent into the kernel's repository stay here instead, written to the kernel's module contract (S-203) and shipped from this repository. (a) **The kernel's core** is what every kernel user needs and nothing more: knowledge, review, authentication, the module contract and the record. (b) **Substrate's modules**, optional, each a kernel module of its own: the live environment and its gates (its `propose` on the kernel's review lane), the channel into a harness, the MCP router, the desktop (the window manager, the launcher, framed apps) and the assistant's conversation. The desktop's window manager is in the kernel's shell today (the kernel's D-127): whether it moves out to a Substrate module is the kernel's decision, by its own pull request. (c) **The default distribution**, also here: the kernel's core, Substrate's modules, Morphogen's plugin, a harness configured to use them (Claude Code first), and the default stack (the model gateway, local models). (d) **Built on it:** our other agents and experiments (the assistant, MetaSoar's work, the games and embodied environments), each a distribution or a module on top of the default one. (e) **Order:** Morphogen's kit first; then Substrate's parts as kernel modules, in place; then the default distribution; then the test of the bet (S-211 c). `docs/kernel-moves.md` becomes `docs/parts.md`. | direction set | | S-213 | **A part is a kernel module only when it needs the kernel; the desktop is built here, for use cases** (2026-11-24; the owner: "we're not thinking everything in substrate is going to be packaged as a knowledge kernel module it might be a skill or an mCP server or some default collection of external services"; "now we can build the desktop separately and for use cases rather than just the hypothetical that we would leave in Colonel and once it's solidified it could be made perfect for the core distribution of Colonel and only the substrate specific parts or other system parts layered on top"; "it might wind up being its own product too ... probably not where the money is"). Amends S-212 (b). (a) **The rule:** a part of Substrate is a kernel module only when it needs the kernel (its own role, its data in the kernel's database, the review lane); otherwise it is the standard type it already is: an Agent Skill, an MCP server, a compose service, or an external service in the default collection. So the environment and its gates are a kernel module; the channel and the router are MCP servers (the router a compose service whose registry is in the environment module); the gateway and local models are external services. (b) **The desktop** (a modular web UI that hosts anything, and that agents can drive) is built in this repository against real use cases, not left in the kernel as a hypothetical; once it settles it may go into the kernel's core distribution, leaving only Substrate's own parts layered on it here, or become a product of its own. It is not where the money is (S-210), so it is built only as far as the use cases need. | direction set | | S-214 | **The desktop stays in the kernel; Substrate's own parts are installed onto its kernel instance** (2026-11-24; the owner: "maybe we should leave the 'desktop ui' where it is if its under the kernel repo, and we'll add substrate-specific parts in substrate's repo to be installed on its kernel instance. simpler, right?"). Supersedes S-213 (b); S-213 (a), the rule for what is a kernel module, stands. The desktop (the window manager, the launcher, framed apps) is the kernel's shell (`modules/ui`, the kernel's D-127) and stays in the kernel's repository; it grows there, by the kernel's pull requests, as use cases need. Substrate's own parts (the assistant's conversation view, the environment module, the channel and router as MCP servers) stay in this repository and are installed onto the kernel instance the default distribution runs, the way any module is. | direction set | +| S-215 | **The documentation follows the re-cut: a new `docs/framework.md`, the old one archived; the README, `CLAUDE.md`, `docs/repos.md` and the plan's intro rewritten** (2026-11-24; the owner: "Update all readmes and strategy documentation"). The shape S-209 to S-214 decided is now what the docs say: two products (Morphogen, the kit; the kernel) and the default distribution (Substrate), with MetaSoar the research. The S-185 framework (objects and traits, the orchestrator, slots, OpenEnv adopted fully) is kept whole as `docs/archive/framework-s185.md`; earlier rows that cite `docs/framework.md` sections mean that file. The other repositories' READMEs and strategy documents follow by their own pull requests (Morphogen #102, MetaSoar #11, a kernel docs PR). | done | diff --git a/README.md b/README.md index 57b8fb0..9cf1e65 100644 --- a/README.md +++ b/README.md @@ -2,34 +2,37 @@ > **Map, design and orchestrate software, agents and organisations. Optimise all the things!** -**An operating system for AI agents.** Today's agents live in a terminal where everything is a file. Here a working -system (a business, a codebase, a household, a game) lives in a **kernel** made of Postgres, where everything is an -object: state, actions behind permission gates (`free`, `propose` for your approval, `deny`), events anyone allowed -can subscribe to, and every change recorded. A **top-level orchestrator**, an ordinary LLM harness (Claude Code -first) given skills, MCP servers and hooks, keeps that system working: it **maps** it, **orchestrates** it through -sub-agents in shared environments (any harness, any model, or no model), and **optimises** it through an optimiser -whose judge it cannot edit, toward goals you set, asking before anything that matters. Harnesses join unmodified, -models come through one gateway, tools through MCP, and environments through [OpenEnv](https://huggingface.co/docs/openenv), -so a change can be rehearsed on a copy before it runs for real. - -| Part | What it is | -| --- | --- | -| **[Knowledge Kernel](https://github.com/OpenReplicant/kernel)** | Postgres made into a kernel: knowledge with provenance, objects and gated actions, logins and row-level security, the record | -| **Substrate** (this repository) | the orchestrator kit (skills `map`, `catalog`, `research`, `orchestrate`, `optimize`; hooks; adapters for OpenEnv, the model endpoint and compose), the reference stack, and the documentation | -| **[Morphogen](https://github.com/OpenReplicant/Morphogen)** | the optimiser, a Claude Code plugin: cells, optimizers behind a judge they cannot edit, an evidence log | -| **Distributions** (`distributions/`, here for now) | what is built with it: a personal assistant (to be designed anew), the SMB Foundry, games | -| **[MetaSoar](https://github.com/OpenReplicant/MetaSoar)** | the research on cognitive architecture: System 1 distilled from experience (M-17) | - -Every dependency between them is a contract, not another project's code: the shape, the slots and what each needs -are in [`docs/framework.md`](docs/framework.md); what is built next is [`docs/plan.md`](docs/plan.md). +**The default distribution:** an agent harness set up to get things done with two products, interactively. It +starts with Claude Code, for its Anthropic subscription. Substrate adds no core of its own. It is the configuration, +the optional parts installed onto the kernel, and the stack that runs them (S-211 to S-214). -**Where it stands (2026-11-23):** the stack below runs on one machine. The OpenEnv spike passed (S-192) and -Morphogen is installed as the optimiser, with Substrate's catalog as its map (S-193). The first assistant (a companion, -a voice head, a worker) was removed (S-194): the assistant starts again from scratch, on this shape. +| Project | What it is | +| --- | --- | +| **[Morphogen](https://github.com/OpenReplicant/Morphogen)** | **the kit:** map a system (interviews, design work, fact-finding), research and catalogue the options for each part, and optimise behind a judge the optimiser cannot edit. Files only, in Backstage's catalog format, on any harness; no database (S-209) | +| **[Knowledge Kernel](https://github.com/OpenReplicant/kernel)** | Postgres made into a kernel: knowledge with provenance, review, logins and row-level security, the record, a module contract, and a desktop in the browser. An optional layer above Morphogen: it ingests the same catalog files when indexing, search or graph traversal are wanted | +| **Substrate** (this repository) | the default distribution: the kernel's core, Substrate's optional parts installed onto it (the live environment and its gates, the channel into a harness, the MCP router, the assistant's view in the kernel's desktop), Morphogen's plugin, a configured harness, a model gateway and local models | +| **[MetaSoar](https://github.com/OpenReplicant/MetaSoar)** | the research: cognitive architecture, and System 1 skills (learned policies, observers and cases in an Agent Skill's folder, each judged as a Morphogen cell) | + +A part of Substrate is a kernel module only when it needs the kernel: its own role, its data in the kernel's +database, the review lane. Otherwise it is the standard thing it already is: an Agent Skill, an MCP server, a +compose service or an outside service (S-213). Our agents and experiments are built on this distribution. Every +dependency is a contract (Backstage files, MCP, OpenEnv, Morphogen's cells, an OpenAI- or Anthropic-compatible +endpoint), never another project's code. The shape is [`docs/framework.md`](docs/framework.md); where each part +goes is [`docs/parts.md`](docs/parts.md); what is built next is [`docs/plan.md`](docs/plan.md). + +**The bet:** an ordinary strong harness in a well-built environment is the agent we want. It holds where one +implementation project runs end to end on a demo small business without new core code: Morphogen maps the business +and picks an opportunity, the harness carries it out under the kernel's gates, a person approves what matters, and +Morphogen judges the result (S-211). + +**Where it stands (2026-11-24):** the stack below runs on one machine, and a person has talked to the assistant in +the kernel's desktop (S-208). The re-cut is decided and the parts are not moved yet. The work goes to Morphogen +(the kit) and the kernel first. ## What runs -The reference stack. Everything is in containers under Podman compose, published on 127.0.0.1 only. +The stack as it is in the tree today, before the parts move (`docs/parts.md`). Everything is in containers under +Podman compose, published on 127.0.0.1 only. | Part | Where | What it does | | --- | --- | --- | @@ -95,16 +98,18 @@ local models keep everything on this machine. ## Not built yet -`docs/plan.md`, "Next, in order": the repository in its shape; one database, the kernel's; the `orchestrate`, -`optimize` and `rtfm` skills and gate hooks; everything on top of the shape; the bootstrap instance; a new -assistant, designed from scratch; the SMB Foundry distribution. +`docs/plan.md`, "The re-cut": Morphogen as the kit (its pull request), Substrate's parts in their types, the +default distribution, and the test of the bet on a demo small business. ## Where to read more - [`docs/plan.md`](docs/plan.md): the steps, and where each stands -- [`docs/framework.md`](docs/framework.md): the shape: layers, the orchestrator, objects, slots and contracts +- [`docs/framework.md`](docs/framework.md): the shape: the projects, the contracts between them, what Substrate adds +- [`docs/parts.md`](docs/parts.md): every part of this tree and where it goes +- [`docs/morphogen-kit.md`](docs/morphogen-kit.md): Morphogen as the kit, the proposal for its pull request - [`docs/repos.md`](docs/repos.md): what each repository owns and depends on - [`docs/research/`](docs/research/): the prior-art research behind the shape (2026-11-23) +- [`docs/archive/framework-s185.md`](docs/archive/framework-s185.md): the shape before the re-cut (objects, traits, the orchestrator, OpenEnv), history - [`DECISIONS.md`](DECISIONS.md): every default, every measurement behind it, and why (append-only) - `CLAUDE.md`: the parts and the rules for working on it diff --git a/docs/archive/framework-s185.md b/docs/archive/framework-s185.md new file mode 100644 index 0000000..9676ce4 --- /dev/null +++ b/docs/archive/framework-s185.md @@ -0,0 +1,183 @@ +# The framework + +What Substrate is, its parts, and how they plug together (S-184 to S-186, 2026-11-23). **Re-cut by S-209 +(2026-11-24):** mapping, research, cataloguing and optimising are one file-based kit in Morphogen, needing no +database; the kernel is the layer above it, ingesting its files; Substrate is what runs on both. This document is +rewritten to match once Morphogen's pull request lands (`docs/morphogen-kit.md`). Every default and its reason +is in `DECISIONS.md`. The framework this replaces (S-125 onward) is `docs/archive/framework-s125.md`: history. + +## In one paragraph + +**An operating system for AI agents.** Today's agents live in a terminal where everything is a file: one agent, one +context, permissions by convention. Here a working system (a business, a codebase, a household, a game) lives in a +**kernel** where everything is an object: state, actions behind permission gates, events anyone allowed can subscribe +to, and every change recorded. **A top-level orchestrator keeps that system working:** it **maps** it (what the parts +are, what they do, how they connect), **orchestrates** it (sub-agents in shared environments: any harness, any +model, or no model), and **optimises** it (through an optimiser it delegates to, judged before anything changes), +toward goals and values a person sets, asking before anything that matters. It hosts your tools rather than +replacing them: Claude Code or any harness joins unmodified, models come through one gateway, tools through MCP, +environments through OpenEnv, so a change can be rehearsed on a copy before it runs for real. + +## The layers + +Like GNU on Linux, with Postgres made into the kernel: + +| Layer | Is | Defines or does | +| --- | --- | --- | +| **Kernel** ([OpenReplicant/kernel](https://github.com/OpenReplicant/kernel)) | Postgres made into a kernel | The standards: **knowledge** (claims with provenance, review, recall), **interaction** (objects with properties, actions and events; gates `free`, `propose`, `deny`; queues), **authentication** (a login per component, row-level security), **pluggability** (how a component describes itself and plugs in), and the record. Its modules are data transformations and what happens at the Postgres level | +| **Substrate** (this repository) | The orchestrator kit | A little agent framing on the kernel's standards: an ordinary LLM harness given skills, MCP servers and hooks so that it maps, orchestrates and optimises its system. Plus the adapters, the reference stack and this document | +| **Morphogen** ([OpenReplicant/Morphogen](https://github.com/OpenReplicant/Morphogen)) | The optimiser | A sub-agent pluggable into anyone's system: cells (what may change, how it is run, what is better, what must keep passing), optimizers behind a judge they cannot edit, the still-works gate, the system guard, an evidence log | +| **Distributions** (`distributions/` here) | What is built with it | Kinds of environments, multi-stage agents, the assistant, the SMB Foundry or AI ERP; each composed of components. Folders in this repository until Substrate's shape is settled | +| **MetaSoar** ([OpenReplicant/MetaSoar](https://github.com/OpenReplicant/MetaSoar)) | The research | Cognitive architecture: impasse-driven compilation (M-17), System 1 distilled from experience; experiments on OpenEnv | + +## The orchestrator + +``` + intentions, goals, values ── the person (approves through propose gates) + │ + ┌──────────────▼───────────────────────────────────────────────┐ + │ the orchestrator: an ordinary LLM harness (Claude Code first)│ + │ skills: map · catalog · research · orchestrate · optimize │ + │ MCP: the kernel; Morphogen; what it installs (approved)│ + │ hooks: gates enforced inside the harness too │ + │ models: any, through the gateway │ + └──────┬──────────────────────────────┬────────────────────────┘ + │ observes (subscriptions) │ delegates, adjusts + ┌──────▼──────────────────────────────▼────────────────────────┐ + │ environments: objects · gated actions · events · the record │ + │ shared by sub-agents: harness sub-agents, OpenEnv │ + │ environments, custom MCP components │ + └──────────────────────────────────────────────────────────────┘ +``` + +- **Map:** the `map` skill decomposes a system into parts, roles and interfaces, written as Backstage entities (the + `catalog/` files, read into the kernel, S-176) with evidence. +- **Catalog and research:** for each intended component without a hard dependency, the `catalog` and `research` + skills fill the catalog with candidates and test them against the need, so the best fit is chosen, not + remembered. +- **Orchestrate:** the orchestrator watches its system by subscription and delegates work: a quick task to its own + sub-agents, long or risky work to a separate harness process with its own login, rehearsal to an OpenEnv + environment in simulation, deterministic work to an MCP component. +- **Optimise:** the `optimize` skill chooses what to improve and which optimiser does it (S-198). **Morphogen** (its + Claude Code plugin) changes files and settings in a cell and judges them by tests and a measure; **an OpenEnv + environment's rubrics** score a model's or a policy's episodes, and a trainer (reinforcement learning, distillation) + learns from those scores. A winner becomes a proposal the person approves. Who proposes never grades their own + work: the judge, a cell's tests or an environment's rubric, is outside what is being changed. +- **Error correction and monitoring** are the same loop: observe, notice, delegate or optimise, verify. +- **Autopoiesis:** Substrate's own stack is an environment like any other (its compose file goes into the map and + back out, S-177), so the orchestrator maintains and grows its own system with the same skills. + +## Everything is an object + +One kind of thing: an **object** with **properties** (its state), **actions** (messages it accepts, each behind a +gate) and **events** (messages it sends). Everything else is a **trait**, not a type: + +| What it used to be called | As an object | +| --- | --- | +| artifact | an object with read and write actions and the trait **versioned** (revisions and provenance) | +| component, agent, handler | an object with the trait **active**: it subscribes and acts on its own | +| environment | an object with the trait **container**: it holds objects, so environments nest | +| stream, source | an object's events; a source is a component that turns a protocol's data into events | +| actuator | an object's action; a gate is a policy on it | +| the blackboard | all objects' properties, in one database | +| a component's view | a query over the objects its login may see | + +Objects talk only by messages (pgmq), never by reaching into each other's state, so permissions and the record hold. +Use traits, not inheritance. The Agents & Artifacts model (CArtAgO) is the closest precedent; its words are ours too: +an agent **focuses** on an object to perceive it; observable **state** is replayable, **signals** are transient. +W3C WoT Thing Description 1.1 is the shape of an object's description. + +**Rules:** a source runs only while something subscribes to it; starting a new source or handler is a proposal (what +is read is the person's call, docs/privacy.md P1, and so is the cost); large or fast data travels by reference. +**One database, the kernel's** (S-190): the kernel defines the schemas and the ways of doing things, and Substrate +follows them, so knowledge and the environment's live state are schemas in one database, and one transaction or +trigger can change an object and record its version. (A third party's private store, such as the gateway's, may +stay a database of its own on the same server.) + +## Slots: every dependency is a contract + +| Slot | Contract | Default filler | Could also be | +| --- | --- | --- | --- | +| Environment and delegation | OpenEnv (production and simulation) + MCP; A2A's task states for a delegated task | the kernel's Postgres environment, served as OpenEnv | any OpenEnv environment, any MCP server, a harness sub-agent | +| The map | Backstage entity files, over MCP | the kernel | the plain files in `catalog/` | +| The optimiser (S-198) | Morphogen's cell contract (files and settings); OpenEnv's rubrics (a model's or a policy's behaviour) | Morphogen; an OpenEnv environment with a trainer | anyone's optimiser and judge | +| The harness | skills, MCP servers, hooks | Claude Code | any harness that takes them | +| Models | an OpenAI- or Anthropic-compatible endpoint | Bifrost (`gateway`) | any gateway, a provider directly | + +No cycles: the kernel needs only Postgres; Morphogen needs cell files (and reads Backstage when present); Substrate +needs only the contracts; distributions need Substrate and the fillers they choose. The test: Substrate pointed at a +folder of catalog files and one OpenEnv environment still runs. + +**Delegation has three kinds of filler,** all on MCP: an **OpenEnv environment** (episodes, rubrics, packaging: +rehearsal and Morphogen's cases), a **harness sub-agent** (Claude Code's own sub-agents for quick work inside the +orchestrator's session; a separate harness process, with its own login, context and record, for long or risky +work), and **custom** (a service, a script, a non-LLM agent). OpenEnv already treats a harness as an environment +(RFC 005), so the line between them is thin. + +## Modules: how everything runs (S-203) + +The owner: "modular execution ... even if that's just launching containers or processes and communicating with them +over whatever is configured, it doesn't have to be complicated and it should not be monolithic", and "everything is +culminating around MCP as a common interface, which OpenEnv is doing". It is the block design (S-164, S-173, S-174) +applied to everything, the kernel's own modules included. + +- **A module is a manifest and its code**, nothing else: what it is, the interfaces it provides and requires (MCP + tools first; anything else described as a WoT form: protocol, address, content type), how it runs, its own + Postgres role and clearance, and the effects of its tools (`changes_world` puts a tool behind a gate). The kernel's + module manifest already says most of this (`runtime`, `interfaces`, `mcp.expose`, `agent`, `clearance`). +- **How it runs is one of three, chosen per module:** on demand (a process per call, JSON or MCP over stdio; about + 19 ms for a Python block, S-173), a kept process (process-compose, the lead candidate, S-173), or a container (a + compose service). Nothing runs inside another module's process: `kk serve`'s fixed list of in-process workers is + split into modules that each run on their own. +- **Running them is decoding, not a runtime of ours** (S-174): the manifests of what a distribution installs are + written out as a compose file and a process list, and the runtime's state is read back. A runner is a decoder and + an encoder, swappable like any module. +- **MCP is how they meet.** Each module serves its own tools; an MCP router (picked with the `research` skill) puts + the installed modules' tools behind one endpoint for agents and for the desktop (the shell is an MCP client, the + kernel's D-44), checks the caller's token and applies the gates there: a `changes_world` tool goes through + `propose` and waits in the one review lane. OpenEnv environments join the same way. Modules still reach the + kernel's data only by its contract: read the `api` views in their own role, write by change sets. + +What this makes of the layers: + +| Layer | Holds | +| --- | --- | +| **Kernel core** | the schema (claims, change sets, scopes and clearance, agents and runs, the review lane, the applied order); the module contract (manifest, role, install, decode to a runtime); `kk`; the MCP router; the validator on the write path; the shell with Search, Review, Change sets, Graph, Me and Settings | +| **Kernel modules** | everything else the kernel ships, each run on its own, a default set installed by `kk init` (belief, recall, packs, the gitleaks filter) and families installed by name (evidence, memory, maps, process, ops, papers); the environment (live state, queues, gates) as one of them | +| **Substrate** | its own modules from its own repository (its read model and tools, the assistant's chat view, the Morphogen encoder), its peripherals (the gateway, local models, the front door, the tools container) and the orchestrator kit (harness, skills, hooks, Morphogen, OpenEnv) | +| **Distributions** | configuration only: which modules, packs, views, apps, skills, gates and privacy defaults, and demo data, bundled as compose (the kernel's D-118, D-120) | + +## OpenEnv, adopted fully (S-184) + +Substrate's environments **are** OpenEnv environments: its classes, server, clients, simulation episodes and +rubrics, production mode, harness adapter and packaging, used as they are. What OpenEnv lacks is built inside our +environments, not around them: state in Postgres (so many sessions share one live environment), the database's +logins (OpenEnv's server has no auth: keep it behind ours), approval gates as tool behaviour, events to subscribers. +Simulation `reset` clones a template database, so a change is rehearsed on a copy of the real data: Foundry's +"what-if", with the judge built in. Pinned `openenv` 0.12.0; early development, weekly releases: keep our code +against it thin. A spike proves seven points first (`docs/plan.md`). + +## Rules that run through it + +- **The cache rule:** an LLM's view of an environment is rendered so it only grows at the end: fixed parts first, + events in order, volatile parts (the time, the current focus) last; a conversation stays on one model unless + switching pays for the reprocessing; compaction is rare and in large chunks. +- **Labels are outcomes,** never a decider's own choice; feedback may arrive long after, by the id of what it judges. +- **Gates:** `free`, `propose` (waits for a person), `deny`; enforced by the database, and by hooks inside the + harness so a sub-agent cannot route around them. +- **Privacy:** `docs/privacy.md`; nothing personal leaves the machine unless a rule is loosened for a named stream. + +## What it takes from elsewhere + +Agents & Artifacts (focus, state and signals, workspaces); W3C WoT (an object's description); Palantir Foundry's +Ontology (object types, links, actions validated, permissioned and audited, what-if); BDI's discipline (a typed +vocabulary, a validator, retraction on failure) as tables and gate checks, not a BDI runtime; OpenEnv; MCP; A2A's +task states; CloudEvents for event envelopes; Home Assistant's stable ids; PostgREST and pgmq as parts. The research +behind this: `docs/research/Object environments prior art.md`. + +## What looks new + +As far as the research searched: trait-based objects whose actions sit behind free, propose and deny gates in one +Postgres that is blackboard, bus, auth and record; unmodified harnesses joining through the model endpoint; an +optimiser whose judge the optimizer cannot edit, wired to the map; and (MetaSoar's) a System 1 distilled from the +record that makes the system cheaper as it learns. diff --git a/docs/framework.md b/docs/framework.md index 9676ce4..7f56e78 100644 --- a/docs/framework.md +++ b/docs/framework.md @@ -1,183 +1,116 @@ # The framework -What Substrate is, its parts, and how they plug together (S-184 to S-186, 2026-11-23). **Re-cut by S-209 -(2026-11-24):** mapping, research, cataloguing and optimising are one file-based kit in Morphogen, needing no -database; the kernel is the layer above it, ingesting its files; Substrate is what runs on both. This document is -rewritten to match once Morphogen's pull request lands (`docs/morphogen-kit.md`). Every default and its reason -is in `DECISIONS.md`. The framework this replaces (S-125 onward) is `docs/archive/framework-s125.md`: history. +What Substrate is, what it is made of, and how the projects plug together (S-209 to S-214, 2026-11-24). Every +default and its reason is in `DECISIONS.md`. The shape this replaces (S-185: "an operating system for AI agents", +objects and traits, the orchestrator) is `docs/archive/framework-s185.md`, kept as history. Its ideas about objects, +gates and OpenEnv still hold where they sit now: in the kernel and in Substrate's optional parts. ## In one paragraph -**An operating system for AI agents.** Today's agents live in a terminal where everything is a file: one agent, one -context, permissions by convention. Here a working system (a business, a codebase, a household, a game) lives in a -**kernel** where everything is an object: state, actions behind permission gates, events anyone allowed can subscribe -to, and every change recorded. **A top-level orchestrator keeps that system working:** it **maps** it (what the parts -are, what they do, how they connect), **orchestrates** it (sub-agents in shared environments: any harness, any -model, or no model), and **optimises** it (through an optimiser it delegates to, judged before anything changes), -toward goals and values a person sets, asking before anything that matters. It hosts your tools rather than -replacing them: Claude Code or any harness joins unmodified, models come through one gateway, tools through MCP, -environments through OpenEnv, so a change can be rehearsed on a copy before it runs for real. +Two products and a distribution. **Morphogen** maps a system, researches and catalogues the options for each of its +parts, and optimises it behind a judge the optimiser cannot edit, all in plain files on whatever harness the user +picks. **The kernel** is Postgres made into a kernel: knowledge with provenance, review, logins, the record, a +module contract and a desktop. It ingests Morphogen's files when someone wants search and graph traversal. +**Substrate** is the default distribution: an agent harness set up to use both, interactively, with the optional +parts that let agents act in a live system under gates installed onto the kernel. **MetaSoar** is the research, +first of all System 1 skills. Our agents and experiments are built on the distribution. -## The layers +## The projects -Like GNU on Linux, with Postgres made into the kernel: - -| Layer | Is | Defines or does | +| Project | Is | Needs | | --- | --- | --- | -| **Kernel** ([OpenReplicant/kernel](https://github.com/OpenReplicant/kernel)) | Postgres made into a kernel | The standards: **knowledge** (claims with provenance, review, recall), **interaction** (objects with properties, actions and events; gates `free`, `propose`, `deny`; queues), **authentication** (a login per component, row-level security), **pluggability** (how a component describes itself and plugs in), and the record. Its modules are data transformations and what happens at the Postgres level | -| **Substrate** (this repository) | The orchestrator kit | A little agent framing on the kernel's standards: an ordinary LLM harness given skills, MCP servers and hooks so that it maps, orchestrates and optimises its system. Plus the adapters, the reference stack and this document | -| **Morphogen** ([OpenReplicant/Morphogen](https://github.com/OpenReplicant/Morphogen)) | The optimiser | A sub-agent pluggable into anyone's system: cells (what may change, how it is run, what is better, what must keep passing), optimizers behind a judge they cannot edit, the still-works gate, the system guard, an evidence log | -| **Distributions** (`distributions/` here) | What is built with it | Kinds of environments, multi-stage agents, the assistant, the SMB Foundry or AI ERP; each composed of components. Folders in this repository until Substrate's shape is settled | -| **MetaSoar** ([OpenReplicant/MetaSoar](https://github.com/OpenReplicant/MetaSoar)) | The research | Cognitive architecture: impasse-driven compilation (M-17), System 1 distilled from experience; experiments on OpenEnv | - -## The orchestrator - -``` - intentions, goals, values ── the person (approves through propose gates) - │ - ┌──────────────▼───────────────────────────────────────────────┐ - │ the orchestrator: an ordinary LLM harness (Claude Code first)│ - │ skills: map · catalog · research · orchestrate · optimize │ - │ MCP: the kernel; Morphogen; what it installs (approved)│ - │ hooks: gates enforced inside the harness too │ - │ models: any, through the gateway │ - └──────┬──────────────────────────────┬────────────────────────┘ - │ observes (subscriptions) │ delegates, adjusts - ┌──────▼──────────────────────────────▼────────────────────────┐ - │ environments: objects · gated actions · events · the record │ - │ shared by sub-agents: harness sub-agents, OpenEnv │ - │ environments, custom MCP components │ - └──────────────────────────────────────────────────────────────┘ -``` - -- **Map:** the `map` skill decomposes a system into parts, roles and interfaces, written as Backstage entities (the - `catalog/` files, read into the kernel, S-176) with evidence. -- **Catalog and research:** for each intended component without a hard dependency, the `catalog` and `research` - skills fill the catalog with candidates and test them against the need, so the best fit is chosen, not - remembered. -- **Orchestrate:** the orchestrator watches its system by subscription and delegates work: a quick task to its own - sub-agents, long or risky work to a separate harness process with its own login, rehearsal to an OpenEnv - environment in simulation, deterministic work to an MCP component. -- **Optimise:** the `optimize` skill chooses what to improve and which optimiser does it (S-198). **Morphogen** (its - Claude Code plugin) changes files and settings in a cell and judges them by tests and a measure; **an OpenEnv - environment's rubrics** score a model's or a policy's episodes, and a trainer (reinforcement learning, distillation) - learns from those scores. A winner becomes a proposal the person approves. Who proposes never grades their own - work: the judge, a cell's tests or an environment's rubric, is outside what is being changed. -- **Error correction and monitoring** are the same loop: observe, notice, delegate or optimise, verify. -- **Autopoiesis:** Substrate's own stack is an environment like any other (its compose file goes into the map and - back out, S-177), so the orchestrator maintains and grows its own system with the same skills. - -## Everything is an object - -One kind of thing: an **object** with **properties** (its state), **actions** (messages it accepts, each behind a -gate) and **events** (messages it sends). Everything else is a **trait**, not a type: - -| What it used to be called | As an object | +| **Morphogen** | the kit: map, research, catalog, optimise; the judge at its core | files: a Backstage catalog and the operator's private file; any harness that takes Agent Skills and MCP | +| **Kernel** | Postgres made into a kernel; its core is what every kernel user needs (knowledge, review, authentication, the module contract, the record), and its desktop | Postgres | +| **Substrate** | the default distribution: configuration, its optional parts, the stack | the kernel, Morphogen's plugin, a harness, a model endpoint, all through their contracts | +| **MetaSoar** | the research: cognitive architecture, System 1 skills | OpenEnv for experiments; Morphogen to judge | + +No cycles. Morphogen needs no kernel, the kernel needs no Morphogen, and Substrate needs both only through their +contracts. + +## Morphogen: the kit (S-209) + +- **Map:** interview a person, work through a hypothetical design, find facts through whatever the harness can + reach; build the map out step by step and detail the parts that matter. +- **Research and catalog:** for each role a part plays, search openly for options and document each one with its + interfaces and adjustable parameters, or at least a link to its docs once it is chosen. Documentation is fetched + into markdown files by a docs MCP server (to be picked with the `research` skill). +- **Optimise:** cells say what may change, how it is run and measured, and which tests must keep passing. The + selector chooses scope, optimiser and measure; adapters hand a cell to GEPA, Optuna, OpenEvolve, AFlow or a + Claude Code worker. The judge decides on cases the optimiser never saw. +- **Orchestrate:** nothing to build. The harness does it, given MCP servers for access. + +**One format:** every committed artifact is a Backstage catalog entity. Morphogen's own fields go under +`spec.morphogen`: an option is a Component marked `candidate`, a cell's rules sit on the entity it judges, and an +interface's tests sit on its API. The operator's private file (held-out answers, sandbox, budget) stays outside the +catalog. Backstage can show it all as a web UI and is never required. **How it ships:** a core Python package (CLI, +MCP server, schemas, judge), Agent Skills folders any harness can load, and a thin package per harness (the Claude +Code plugin first). The proposal is `docs/morphogen-kit.md`. + +## The kernel, above the kit + +The kernel stores and governs. Its `encoder-backstage` ingests Morphogen's catalog files as claims, so a map can be +searched, traversed and reviewed there. Its core ships without Substrate's parts. Its desktop (windows, a launcher, +framed apps) stays in the kernel and grows there (S-214). + +## Substrate: the default distribution (S-211 to S-214) + +**What it is:** an agent harness configured to get things done with the kernel and Morphogen, interactively. It +starts with Claude Code for the Anthropic subscription; OpenHands is a candidate if a harness built to run for +months is needed. It adds no core of its own. + +**What it adds:** + +| Part | Type | | --- | --- | -| artifact | an object with read and write actions and the trait **versioned** (revisions and provenance) | -| component, agent, handler | an object with the trait **active**: it subscribes and acts on its own | -| environment | an object with the trait **container**: it holds objects, so environments nest | -| stream, source | an object's events; a source is a component that turns a protocol's data into events | -| actuator | an object's action; a gate is a policy on it | -| the blackboard | all objects' properties, in one database | -| a component's view | a query over the objects its login may see | - -Objects talk only by messages (pgmq), never by reaching into each other's state, so permissions and the record hold. -Use traits, not inheritance. The Agents & Artifacts model (CArtAgO) is the closest precedent; its words are ours too: -an agent **focuses** on an object to perceive it; observable **state** is replayable, **signals** are transient. -W3C WoT Thing Description 1.1 is the shape of an object's description. - -**Rules:** a source runs only while something subscribes to it; starting a new source or handler is a proposal (what -is read is the person's call, docs/privacy.md P1, and so is the cost); large or fast data travels by reference. -**One database, the kernel's** (S-190): the kernel defines the schemas and the ways of doing things, and Substrate -follows them, so knowledge and the environment's live state are schemas in one database, and one transaction or -trigger can change an object and record its version. (A third party's private store, such as the gateway's, may -stay a database of its own on the same server.) - -## Slots: every dependency is a contract - -| Slot | Contract | Default filler | Could also be | -| --- | --- | --- | --- | -| Environment and delegation | OpenEnv (production and simulation) + MCP; A2A's task states for a delegated task | the kernel's Postgres environment, served as OpenEnv | any OpenEnv environment, any MCP server, a harness sub-agent | -| The map | Backstage entity files, over MCP | the kernel | the plain files in `catalog/` | -| The optimiser (S-198) | Morphogen's cell contract (files and settings); OpenEnv's rubrics (a model's or a policy's behaviour) | Morphogen; an OpenEnv environment with a trainer | anyone's optimiser and judge | -| The harness | skills, MCP servers, hooks | Claude Code | any harness that takes them | -| Models | an OpenAI- or Anthropic-compatible endpoint | Bifrost (`gateway`) | any gateway, a provider directly | - -No cycles: the kernel needs only Postgres; Morphogen needs cell files (and reads Backstage when present); Substrate -needs only the contracts; distributions need Substrate and the fillers they choose. The test: Substrate pointed at a -folder of catalog files and one OpenEnv environment still runs. - -**Delegation has three kinds of filler,** all on MCP: an **OpenEnv environment** (episodes, rubrics, packaging: -rehearsal and Morphogen's cases), a **harness sub-agent** (Claude Code's own sub-agents for quick work inside the -orchestrator's session; a separate harness process, with its own login, context and record, for long or risky -work), and **custom** (a service, a script, a non-LLM agent). OpenEnv already treats a harness as an environment -(RFC 005), so the line between them is thin. - -## Modules: how everything runs (S-203) - -The owner: "modular execution ... even if that's just launching containers or processes and communicating with them -over whatever is configured, it doesn't have to be complicated and it should not be monolithic", and "everything is -culminating around MCP as a common interface, which OpenEnv is doing". It is the block design (S-164, S-173, S-174) -applied to everything, the kernel's own modules included. - -- **A module is a manifest and its code**, nothing else: what it is, the interfaces it provides and requires (MCP - tools first; anything else described as a WoT form: protocol, address, content type), how it runs, its own - Postgres role and clearance, and the effects of its tools (`changes_world` puts a tool behind a gate). The kernel's - module manifest already says most of this (`runtime`, `interfaces`, `mcp.expose`, `agent`, `clearance`). -- **How it runs is one of three, chosen per module:** on demand (a process per call, JSON or MCP over stdio; about - 19 ms for a Python block, S-173), a kept process (process-compose, the lead candidate, S-173), or a container (a - compose service). Nothing runs inside another module's process: `kk serve`'s fixed list of in-process workers is - split into modules that each run on their own. -- **Running them is decoding, not a runtime of ours** (S-174): the manifests of what a distribution installs are - written out as a compose file and a process list, and the runtime's state is read back. A runner is a decoder and - an encoder, swappable like any module. -- **MCP is how they meet.** Each module serves its own tools; an MCP router (picked with the `research` skill) puts - the installed modules' tools behind one endpoint for agents and for the desktop (the shell is an MCP client, the - kernel's D-44), checks the caller's token and applies the gates there: a `changes_world` tool goes through - `propose` and waits in the one review lane. OpenEnv environments join the same way. Modules still reach the - kernel's data only by its contract: read the `api` views in their own role, write by change sets. - -What this makes of the layers: - -| Layer | Holds | +| The live environment: signals, a queue per actuator, gates (`free`, `propose`, `deny`) whose `propose` goes to the kernel's review lane, the record | a kernel module (it needs the kernel's database and review lane) | +| The channel: an environment's events into a harness session | an MCP server | +| The MCP router: one endpoint for every tool, each call an action behind its gate | an MCP server, run as a compose service | +| The assistant's conversation | a view installed into the kernel's desktop | +| The harness's configuration: settings, hooks, MCP servers, Morphogen's plugin pinned | configuration | +| The model gateway (Bifrost) and local models (llama.cpp, Ollama) | compose services, configured | +| Bringing it up and checking it (`scripts/`, the compose file) | the distribution's own | + +**The rule** (S-213): a part is a kernel module only when it needs the kernel. Otherwise it is the standard thing it +already is: an Agent Skill, an MCP server, a compose service or an outside service. `docs/parts.md` lists every +part of the tree and where it goes. + +**The bet** (S-211): an ordinary strong harness in a well-built environment is the agent we want. It holds where +one implementation project runs end to end on a demo small business with no new core code, and it fails wherever +that run needs some. + +## MetaSoar: System 1 skills + +An Agent Skill's folder can hold scripts and other files, not just instructions. A System 1 skill adds three things +by convention: **policies** (a response script and its trigger), **observers** (how state is watched for triggers) +and **cases** (the record each policy was learned from and is judged on). The observer is a swappable interface: +state goes in, a policy and a confidence come out. It can be a feature-detector script, rules, a small model's +probabilities, the nearest past case or a tabular model. Below the confidence threshold, the model reads the skill's +instructions as it does today; the case is recorded and can become a new policy. Every policy and observer is a +Morphogen cell, judged by something other than its author. The spec is MetaSoar's (`docs/system1-skills.md`, M-19). + +## The business (S-210) + +Morphogen mapping small and medium businesses: their organisation and systems mapped, optimisation opportunities +found, each written up as an implementation project. It can run with a client's own material and access, or on +public sources as prospecting before a first call. Substrate is how those projects are then carried out for a +client. The business itself is worked in a session of its own. + +## Contracts + +| Between | Contract | | --- | --- | -| **Kernel core** | the schema (claims, change sets, scopes and clearance, agents and runs, the review lane, the applied order); the module contract (manifest, role, install, decode to a runtime); `kk`; the MCP router; the validator on the write path; the shell with Search, Review, Change sets, Graph, Me and Settings | -| **Kernel modules** | everything else the kernel ships, each run on its own, a default set installed by `kk init` (belief, recall, packs, the gitleaks filter) and families installed by name (evidence, memory, maps, process, ops, papers); the environment (live state, queues, gates) as one of them | -| **Substrate** | its own modules from its own repository (its read model and tools, the assistant's chat view, the Morphogen encoder), its peripherals (the gateway, local models, the front door, the tools container) and the orchestrator kit (harness, skills, hooks, Morphogen, OpenEnv) | -| **Distributions** | configuration only: which modules, packs, views, apps, skills, gates and privacy defaults, and demo data, bundled as compose (the kernel's D-118, D-120) | - -## OpenEnv, adopted fully (S-184) - -Substrate's environments **are** OpenEnv environments: its classes, server, clients, simulation episodes and -rubrics, production mode, harness adapter and packaging, used as they are. What OpenEnv lacks is built inside our -environments, not around them: state in Postgres (so many sessions share one live environment), the database's -logins (OpenEnv's server has no auth: keep it behind ours), approval gates as tool behaviour, events to subscribers. -Simulation `reset` clones a template database, so a change is rehearsed on a copy of the real data: Foundry's -"what-if", with the judge built in. Pinned `openenv` 0.12.0; early development, weekly releases: keep our code -against it thin. A spike proves seven points first (`docs/plan.md`). - -## Rules that run through it - -- **The cache rule:** an LLM's view of an environment is rendered so it only grows at the end: fixed parts first, - events in order, volatile parts (the time, the current focus) last; a conversation stays on one model unless - switching pays for the reprocessing; compaction is rare and in large chunks. -- **Labels are outcomes,** never a decider's own choice; feedback may arrive long after, by the id of what it judges. +| a map, its catalogs and its targets | Backstage entity files, Morphogen's fields under `spec.morphogen` | +| a harness and its tools | MCP; Agent Skills; hooks | +| an optimiser and the judge | Morphogen's cells: a space, an evaluator the optimiser does not hold, one verdict | +| an environment and its agents | OpenEnv (episodes, rubrics, simulation), MCP | +| a caller and a model | an OpenAI- or Anthropic-compatible endpoint | +| a module and the kernel | the kernel's module contract (a manifest, its code, its own role) | + +## Rules that still run through it + - **Gates:** `free`, `propose` (waits for a person), `deny`; enforced by the database, and by hooks inside the harness so a sub-agent cannot route around them. +- **Who proposes never grades their own work:** the judge (a cell's tests, an environment's rubric) is outside + what is being changed. +- **Labels are outcomes,** never a decider's own choice; feedback may arrive long after, by the id of what it judges. - **Privacy:** `docs/privacy.md`; nothing personal leaves the machine unless a rule is loosened for a named stream. - -## What it takes from elsewhere - -Agents & Artifacts (focus, state and signals, workspaces); W3C WoT (an object's description); Palantir Foundry's -Ontology (object types, links, actions validated, permissioned and audited, what-if); BDI's discipline (a typed -vocabulary, a validator, retraction on failure) as tables and gate checks, not a BDI runtime; OpenEnv; MCP; A2A's -task states; CloudEvents for event envelopes; Home Assistant's stable ids; PostgREST and pgmq as parts. The research -behind this: `docs/research/Object environments prior art.md`. - -## What looks new - -As far as the research searched: trait-based objects whose actions sit behind free, propose and deny gates in one -Postgres that is blackboard, bus, auth and record; unmodified harnesses joining through the model endpoint; an -optimiser whose judge the optimizer cannot edit, wired to the map; and (MetaSoar's) a System 1 distilled from the -record that makes the system cheaper as it learns. diff --git a/docs/plan.md b/docs/plan.md index 455ec8a..31caaed 100644 --- a/docs/plan.md +++ b/docs/plan.md @@ -4,14 +4,13 @@ The one current plan (S-124, 2026-11-17). It replaces the plans in `docs/archive the experiment-first direction, the handoff, the task briefs); those are kept as history and are not to be worked from. Every default and its reason is still in `DECISIONS.md`. -## What Substrate is now (S-185, 2026-11-23) +## What Substrate is now (S-209 to S-214, 2026-11-24) -**An operating system for AI agents:** a top-level orchestrator (an ordinary LLM harness, Claude Code first, given -skills, MCP servers and hooks) that maps, orchestrates and optimises a working system, on a kernel made of Postgres -where everything is an object. Its shape, layers, slots and contracts are `docs/framework.md`. Environments are -OpenEnv environments (S-184); the optimiser is Morphogen's Claude Code plugin; what is built with it lives in -`distributions/` (S-185, S-186). The steps table below is the history of how the current parts came to be; what -comes next is "Next, in order". +**The default distribution:** an agent harness (Claude Code first) configured to get things done with the kernel +and Morphogen, interactively, with Substrate's optional parts installed onto the kernel. Morphogen is the kit (map, +research, catalog, optimise, on files); the kernel is the layer above it; MetaSoar is the research. The shape is +`docs/framework.md`, every part and where it goes is `docs/parts.md`. The steps table further down is the history +of how the current parts came to be; what comes next is "The re-cut" just below. ## The re-cut, and what comes first (S-209, S-210, 2026-11-24) @@ -73,7 +72,7 @@ in v1. v1's databases are in `.state/backups/` (2026-11-17); what people stated | 9 | **Adaptive video game playing** (S-142): after the avatar, the companion plays games as environments (the screen and game state as sensors, input as gated actuators) and gets better at a game from its own record, by distilled components judged against pass-through | the owner picks the first game; done-when is set then | | 10 | The next embodied child: Resonite (in-world editing; ResoniteLink's WebSocket and community MCP servers, every world-changing tool gated), VRChat, Virt-A-Mate or a ROS2 simulation (the owner's pick), by the same adapter pattern | the companion acts there through the same avatar actuators, under the same gates and budget | -Self-levers beyond budget and model choice, and the other layers in `docs/framework.md`, come as these steps +Self-levers beyond budget and model choice, and the other layers in `docs/archive/framework-s185.md`, come as these steps need them, each tested against pass-through. The UI is no longer frozen: add what these steps need, and nothing they don't. @@ -122,7 +121,7 @@ are views of the same items and claims; what can be said in one format can be ca OTel Collector picked with the `research` skill, traces to a viewer and metrics to Prometheus, which the kernel's `observer-prometheus` turns into observed claims; a component's card carries measured latency and cost. - **Agents:** the orchestrator is an ordinary harness (S-185); sub-agents are harness sub-agents, OpenEnv - environments or MCP components (`docs/framework.md`, "Slots"). The one assistant of S-181 (the voice front end + environments or MCP components (`docs/archive/framework-s185.md`, "Slots"). The one assistant of S-181 (the voice front end and one loop over model rungs) is the assistant distribution's design (S-186). `scripts/trials/harness/candidates.json` holds the surveyed harnesses. diff --git a/docs/repos.md b/docs/repos.md index 6f07fb6..1cd65aa 100644 --- a/docs/repos.md +++ b/docs/repos.md @@ -1,17 +1,15 @@ # The repositories and what each owns -The layers are in `docs/framework.md` (S-185), re-cut by S-209: mapping, research, cataloguing and optimising become -one file-based kit in Morphogen; the kernel ingests its files; Substrate is what runs on both (`docs/morphogen-kit.md`; -until Morphogen's pull request lands, the table below is what is in the tree). Every dependency between them is a contract (OpenEnv, MCP, Backstage -entity files, Morphogen's cell file, an OpenAI- or Anthropic-compatible model endpoint), never another project's code. +The shape is `docs/framework.md` (S-209 to S-214). Every dependency between them is a contract (Backstage entity +files, MCP, Agent Skills, OpenEnv, Morphogen's cells, an OpenAI- or Anthropic-compatible model endpoint, the +kernel's module contract), never another project's code. | Repository | Owns | Depends on | | --- | --- | --- | -| **Kernel** (OpenReplicant/kernel) | Postgres made into a kernel: knowledge (claims with provenance, belief and clearance; review; recall; the memory and `substrate` MCP profiles), interaction (objects, gated actions, events, queues: the `env` schema moves into its database, S-190), authentication, pluggability; its modules are data transformations and what happens at the Postgres level; its own distributions folder (`business`, `devops`, `papers`, `process-maps`) | Postgres | -| **Substrate** (this one) | The orchestrator kit: skills (`map`, `catalog`, `research`, `orchestrate`, `optimize`, `setup`, `upstream`), hooks, the channel, the catalog (`catalog/`), the adapters (OpenEnv, the model proxy, compose decoding), the reference stack (compose, the gateway, the tools container, scripts), this documentation; and, until Substrate's shape is settled, the distributions as folders (`distributions/`) | the contracts; the Kernel, Morphogen, Bifrost and Claude Code as default fillers | -| **Morphogen** (OpenReplicant/Morphogen) | The optimiser: cells, optimizers behind a judge they cannot edit, the still-works gate, the system guard, the evidence log; shipped as a Claude Code plugin with an MCP server. Its own repository on purpose: the judge's independence from what the optimizer edits is the point. Changes by pull request there | cell files; reads Backstage entities when present | -| **MetaSoar** (OpenReplicant/MetaSoar) | The research: cognitive architecture (impasse-driven compilation, M-17; System 1 from experience), its experiments on OpenEnv, atlas and the Soar 9.6.5 baseline | OpenEnv; the assistant distribution's ladder for M-17 | +| **Morphogen** (OpenReplicant/Morphogen) | The kit: map, research, catalog and optimise, on files only. Its skills (`map`, `catalog`, `research`, `morphogen`), its file formats (Backstage entities with `spec.morphogen`; the operator's private file), the judge, its optimiser adapters, the evidence log; a core Python package, Agent Skills, a Claude Code plugin. Changes by pull request there | files; any harness that takes Agent Skills and MCP | +| **Kernel** (OpenReplicant/kernel) | Postgres made into a kernel. Its core: knowledge (claims with provenance, belief and clearance; review; recall), authentication, the module contract, the record, and its desktop (the shell with windows, launcher and framed apps). Its modules, including `encoder-backstage`, which ingests Morphogen's files. Its own distributions folder (`business`, `devops`, `papers`, `process-maps`). Its Substrate-specific modules (`encoder-substrate`, `view-substrate`, kernel-mcp's `substrate` profile) are retired together once Morphogen's skills replace Substrate's | Postgres | +| **Substrate** (this one) | The default distribution: the harness's configuration, its optional parts installed onto the kernel (the environment and gates, the channel, the MCP router, the assistant's view), the stack (compose, the gateway, local models, the tools container, scripts), the `setup` and `upstream` skills, `distributions/`, and this documentation | the kernel, Morphogen, Bifrost and Claude Code as default fillers, through their contracts | +| **MetaSoar** (OpenReplicant/MetaSoar) | The research: cognitive architecture (impasse-driven compilation, M-17), System 1 skills (M-19), its experiments on OpenEnv, atlas and the Soar 9.6.5 baseline | OpenEnv; Morphogen to judge | envkit, the in-process scheduler MetaSoar's worlds ran on, was retired from Substrate in S-196: environments are -OpenEnv environments (S-184), and MetaSoar's worlds move onto OpenEnv (its unmerged `claude/envkit` branch keeps the -old work; git keeps Substrate's copy). +OpenEnv environments (S-184).