Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 16 additions & 1 deletion BRIEF.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ what it taught. Issue numbers (#43, #45) refer to this repository's history.

## Morphogen in one page

**What it is now: the kit, with the judge at its core.** Morphogen maps a system, researches and catalogues the
options for each role, and optimises behind its judge, on files only, on any harness. The map, the options and
(in phase 2) the cells are all Backstage catalog entities, with Morphogen's own fields under one namespaced key,
`spec.morphogen`; documentation is fetched into markdown files. The judge stays the core and stays independent:
the skills that write the map and the catalog write what the judge reads from the base commit, and no candidate
may touch it. Everything below about the judge, the cell and the optimizers is unchanged. **Coming, phase 2:** the
cell format moves from `morphogen.yaml` onto the entities (draft: `schemas/morphogen-spec.v0.json`); until then
`morphogen.yaml` is what the judge reads.

**Where it sits.** The Knowledge Kernel is an optional layer above the kit: it ingests the same Backstage files when
someone wants indexing, search or graph traversal, and the kit never requires it. Substrate is the default
distribution that installs Morphogen's plugin, like any user. MetaSoar's System 1 skills convention (MetaSoar pull
request #11: policies, observers and cases in a skill folder, each a Morphogen cell) is a planned consumer of the
judge. The way there is the kit section of [PLAN.md](PLAN.md).

**The core** is what nothing else provides:

- a judge the improver cannot edit: the rules come from the base commit, the measurements are
Expand Down Expand Up @@ -44,7 +59,7 @@ hold (`evaluate(candidate) -> score, diagnostics`, which is a probe), and one ve
judge on their best. Grid, random, hill-climb, Optuna, GEPA, or a quorum of models used as a
scorer all fit it.

**The family** around it, each judged the same way: the mapper (a skill that drafts the map), the
**The family** around it, each judged the same way: the mapper, cataloguer and researcher (skills that draft the map and the options for each role), the
builder (ordinary Claude Code, making red tests green), domain modules (skills, an ontology,
resolver settings and log parsers, bundled) around a shared knowledge base joined by the entity
resolver, and deployment, whose canary stage is the online half of the gate.
Expand Down
6 changes: 4 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ docs/restart/LESSONS.md.
`backstage.py` (catalog-info.yaml files as a source of cells),
`status.py` (where a project stands and the next step),
`documents.py` (morphogen.yaml's settings, and the target spec a cell compiles to), `request.py` (one document in, one verdict out), `intake.py` (the judge held by another user: a candidate arrives as a git bundle), `cli.py`, `mcp_server.py`, `ui.py` and `ui.html` (the read-only web UI).
- `.claude-plugin/`, `skills/`, `agents/`: the Claude Code plugin around the MCP server. Skills:
`morphogen` (improve a cell) and `map` (draft morphogen.yaml's cells).
- `.claude-plugin/`, `skills/`, `agents/`: the Claude Code plugin around the MCP server. Skills (the kit):
`morphogen` (improve a cell), `map` (take a system apart into Backstage entity files and draft cells),
`catalog` and `research` (options for a role, as `lifecycle: candidate` Components). `schemas/morphogen-spec.v0.json`
is the draft of the `spec.morphogen` fields; phase 2 loads them, morphogen.yaml still works until then.
- `tests/`: the core's tests and red team; fixture projects in `tests/fixture*.py`, the timed
sample's files in `tests/fixtures`.
- `demos/`: projects Morphogen can build and drive. The core never imports from them.
Expand Down
33 changes: 33 additions & 0 deletions PLAN.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,38 @@
# Plan: Morphogen small, with everything above it plugged in

> **Since 2026-11-24 Morphogen is the kit** (Substrate's S-209): map a system, research and catalogue the options
> for each role, and optimise behind the judge, on files only, on any harness. The judge below is still the core.
> The kit's phases, K1 to K4, are the next section; phases 0 to 7 after it are the judge's, and stay as written.

## The kit: the way there

Everything committed becomes a Backstage catalog entity; Morphogen's own fields go under one key,
`spec.morphogen` ([schemas/morphogen-spec.v0.json](schemas/morphogen-spec.v0.json), a draft). An option for a role
is a `Component` with `spec.lifecycle: candidate`; a cell's rules go on the entity it judges; sub-grain cells are
`Component`s nested with `subcomponentOf`; an interface's tests go on its `API`; settings and shared defaults go on
the `System`. `morphogen.local.yaml` stays as it is.

- **K1, skills and schema (this pull request, #102).** README, BRIEF and the skills say what Morphogen is now; the
`map` skill is merged with Substrate's and writes entity files; new `catalog` and `research` skills; the draft
schema. No code behaviour changes; `morphogen.yaml` still works. Open check before K2: that Backstage's `API` and
`System` kinds leave `spec` open the way `Component` does.
- **K2, cells into entities.** Load `spec.morphogen` from the catalog files; check a cell's settings against its
option's parameter schema; default deny covers every catalog file the judge reads (a red-team test across files
first); `morphogen.yaml` is removed with **no back-compatibility**, since only our own projects use it (Substrate,
the demos), and they are moved by hand. Decide whether `lifecycle: candidate` entities are skipped as cells.
- **K3, documentation as files.** A documentation MCP server that turns web documentation into markdown files,
chosen with the `research` skill (a local one first: a hosted one sends what is looked up off the machine). Its
output is a folder of markdown beside the catalog, named in each option's `docs.path`.
- **K4, packaging per harness.** The core Python package (schemas, judge, adapters, CLI, MCP server); the skills as
plain Agent Skills any harness that reads `SKILL.md` can load, naming MCP tools by the server's own names; and a
thin package per harness (the Claude Code plugin first, each other written when a user needs it).

**Where it sits.** The kernel (the Knowledge Kernel) is an optional layer above the kit: when someone wants indexing,
search or graph traversal, the kernel ingests the same Backstage files. The kit never requires it. Substrate is the
default distribution (a configured harness, the kernel's modules and a default stack) and installs Morphogen's plugin
like any user. **A planned consumer of the judge:** MetaSoar's System 1 skills convention (MetaSoar pull request #11:
policies, observers and cases in a skill folder, each a Morphogen cell).

Morphogen keeps the part nothing else provides: a judge the improver cannot edit, the "still
works" gate, the system guard and the evidence log. Everything else is a source it reads or a slot
it fills:
Expand Down
50 changes: 38 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
# Morphogen

**A judge for self-improving systems.** Point any optimizer or coding agent at part of a system (a
prompt, a setting, a function, a skill, a service) and Morphogen decides whether the change is
really better: by rules taken from the last approved version, with measurements taken outside the
code, on cases the optimizer never saw, without breaking a neighbour or making the whole system
worse. Every verdict goes into a log that cannot be quietly edited.

Morphogen does not propose changes. Optimizers do that, and they plug into it. Tools that describe
a system, such as Backstage, sit above it. [BRIEF.md](BRIEF.md) is the design (its first section is
**A kit for improving a system, with a judge at its core.** Morphogen **maps** a system (what it is made of, the
role each part plays, the interfaces that make parts interchangeable), **researches and catalogues** the options
for each role, and **optimises** behind a judge: point any optimizer or coding agent at part of the system (a
prompt, a setting, a function, a skill, a service) and the judge decides whether the change is really better, by
rules taken from the last approved version, with measurements taken outside the code, on cases the optimizer
never saw, without breaking a neighbour or making the whole system worse. Every verdict goes into a log that
cannot be quietly edited.

It works on files only, on any harness that reads Agent Skills: the map and the catalog are Backstage catalog
entity files in your repository (no database, no server), the documentation of an option is markdown files, and
the judge is a Python package with an MCP server. The Claude Code plugin is the first packaging; other
harnesses get a thin manifest over the same core and skills.

**The judge stays the core, and stays independent.** The mapping and cataloguing skills write the map and the
catalog, which the judge reads from the base commit and no candidate may touch: what an optimizer may edit is
still only what a cell's `change` names. Morphogen does not propose changes itself; optimizers do that, and they
plug into it. [BRIEF.md](BRIEF.md) is the design (its first section is
the one-page version) and [PLAN.md](PLAN.md) the way there; this file is the case for Morphogen and
how to use what is built.

**Where it sits.** The Knowledge Kernel is an optional layer above the kit: it ingests the same Backstage files for
indexing, search and graph traversal, and the kit never requires it. Substrate is the default distribution (a
configured harness, the kernel and a default stack) and installs Morphogen's plugin like any user. MetaSoar's
System 1 skills convention (policies, observers and cases in a skill folder, each a Morphogen cell) is a planned
consumer of the judge. The way there is [PLAN.md](PLAN.md).

## Why a judge, on top of optimizers

**An optimizer is only as honest as its evaluator.** It maximises whatever score it is given. Give a
Expand Down Expand Up @@ -78,6 +93,14 @@ hole it closes.

## The cell format

> **Coming, phase 2.** The cell format below is today's. The kit moves every committed artifact into Backstage
> catalog entities: a cell's rules go on the entity it judges under one namespaced key, `spec.morphogen`; an
> option for a role is a `Component` with `spec.lifecycle: candidate`; sub-grain cells are `Component`s nested
> with `subcomponentOf`; an interface's tests go on its `API` entity; the project's settings and shared defaults go
> on the `System` entity. The fields are drafted in [`schemas/morphogen-spec.v0.json`](schemas/morphogen-spec.v0.json)
> and carried over unchanged from what a cell accepts below. `morphogen.local.yaml` stays as it is. Until phase 2
> lands, `morphogen.yaml` is what the judge reads, and this reference is current.

One `morphogen.yaml` at the project's root:

```yaml
Expand Down Expand Up @@ -193,8 +216,9 @@ described this way.
Install it from GitHub, not from a local clone: a clone added as a marketplace runs the plugin from
the clone itself, so the judge would be the candidate you are changing. To move to a newer version,
`/plugin marketplace update morphogen`, then `/plugin update morphogen@morphogen`, and restart
Claude Code. The plugin brings the MCP server, the `morphogen` skill (improve a cell honestly), the
`map` skill (draft the cells), and the `worker` and `reviewer` agents. It needs
Claude Code. The plugin brings the MCP server, four skills (`map`: take a system apart into Backstage entity files with
evidence and draft its cells; `catalog`: find options for a role; `research`: choose one from the catalogs;
`morphogen`: improve a cell honestly), and the `worker` and `reviewer` agents. It needs
[uv](https://docs.astral.sh/uv/) on the path.

**Starting fresh.** In a git repository, ask Claude to start Morphogen here. The map skill calls
Expand Down Expand Up @@ -279,7 +303,8 @@ directory, so it can only answer. The cell's `description` is its objective.
| Observers | `observers.py` | `command` (a command after each run) and `otel` (an OpenTelemetry receiver in the judge that adds up each run's telemetry, such as Claude Code's cost, tokens and tool results) |
| Optimizers | `optimize.py` | a catalog behind one contract: grid, random, hill-climb (with `restarts`) and simulated annealing (`anneal`), built in; Optuna and GEPA adapters (optional extras); and the `selector`, whose bandit policy (primed by earlier verdicts, with a stagnation signal) chooses which proposes next. A model-based policy is planned; packages add more through the `morphogen.optimizers` entry point. `tune` checks, writes and probes each proposal and judges the best |
| Interfaces | `cli.py`, `mcp_server.py`, `ui.py` | the command line, an MCP server with 11 tools, and a local read-only web UI |
| Plugin | `.claude-plugin/`, `skills/`, `agents/` | the Claude Code plugin around the MCP server |
| Plugin | `.claude-plugin/`, `skills/`, `agents/` | the Claude Code plugin around the MCP server; the skills (`map`, `catalog`, `research`, `morphogen`) are plain Agent Skills any harness can load |
| Schemas | `schemas/` | the evidence record (v1); the `spec.morphogen` fields of the catalog entities (draft, phase 1; not read yet) |

### The system guard

Expand Down Expand Up @@ -441,6 +466,7 @@ Details are from each project's own docs or source, read on 2026-11-04 and 2026-
morphogen/ the core, its CLI, MCP server and web UI
tests/ its tests and red team; fixture projects in tests/fixture*.py
.claude-plugin/ the plugin and marketplace manifests
skills/, agents/ the Claude Code skills and agents
skills/, agents/ the skills (Agent Skills format) and Claude Code agents
schemas/ published JSON Schemas (evidence record; spec.morphogen, a draft)
demos/ projects Morphogen can build and drive (the core never imports from them)
BRIEF.md the design; PLAN.md the way there
2 changes: 2 additions & 0 deletions demos/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Demos

> These projects describe themselves in `morphogen.yaml` and `catalog-info.yaml` today. In phase K2 of the kit ([PLAN.md](../PLAN.md)) their cells move onto Backstage entities under `spec.morphogen` and `morphogen.yaml` is removed, with no back-compatibility; the demos are moved by hand.

Projects a fresh Morphogen instance can start building, and that Morphogen can then drive. Each
is a component that stands alone, or a larger system built from them.

Expand Down
Loading