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
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"name": "morphogen",
"source": "./",
"description": "Improve a system at any scope, from one cell to the whole, behind a judge the agent cannot edit.",
"version": "0.9.0"
"version": "0.10.0"
}
]
}
2 changes: 1 addition & 1 deletion .claude-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"$schema": "https://anthropic.com/claude-code/plugin.schema.json",
"name": "morphogen",
"version": "0.9.0",
"version": "0.10.0",
"description": "Improve a system at any scope, from one cell to the whole, behind a judge the agent cannot edit: structure, judge, evidence and optimizers over MCP.",
"author": {
"name": "OpenReplicant"
Expand Down
6 changes: 3 additions & 3 deletions BRIEF.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Morphogen: the design

The design behind rebuild 7: what Morphogen is, why, and what it rests on. What is built, and how
to use it, is in [README.md](README.md). The previous build is on the
[`rebuild-6`](https://github.com/OpenReplicant/Morphogen/tree/rebuild-6) branch, with
[LESSONS.md](https://github.com/OpenReplicant/Morphogen/blob/rebuild-6/docs/restart/LESSONS.md),
to use it, is in [README.md](README.md). The previous build is at the tag
[`archive/rebuild-6`](https://github.com/OpenReplicant/Morphogen/tree/archive/rebuild-6), with
[LESSONS.md](https://github.com/OpenReplicant/Morphogen/blob/archive/rebuild-6/docs/restart/LESSONS.md),
what it taught. Issue numbers (#43, #45) refer to this repository's history.

## Morphogen in one page
Expand Down
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Changelog

## 0.10.0 (draft, not tagged)

The first public release of rebuild 7: the judge, the kit around it, and the GitHub judge that reads the catalog.

**The judge.** Scores a candidate commit against a base by the base's rules: measurement outside the candidate,
paired rounds with a sign test (A/A: identical code passed 0 of 12), held-out answers given only to the base's
scorer, default deny on what a cell may change, neighbours' interface tests and the system guard. Every verdict goes
into a hash-chained evidence log. The red team holds 61 known cheats, and each must keep failing.

**Ways in.**
- `morphogen judge`, `change`, `measure`, `tune`, `status` on the command line, and an MCP server with 13 tools.
- `morphogen request`: one document in, one verdict out (#78), for a system outside this repository.
- `morphogen intake`: the judge held by another Unix user, so the author cannot read the answers (#83).
- `morphogen pr` and `.github/workflows/judge.yml`: a pull request judged on GitHub Actions by the catalog on main
(#106). It ran live for the first time on 2026-11-27, in a throwaway pull request on a fixture catalog: an honest
change passed and a widened `change` was refused (#107).

**The kit.** The map and the catalog are Backstage entity files (`catalog-info.yaml` and its Location targets), with
`spec.morphogen` on the entities (#102, #103; schema `schemas/morphogen-spec.v1.json`). Skills: `map`, `catalog`,
`research`, `morphogen`; agents `worker` and `reviewer`. Optimizers: grid, random, hill-climb with restarts,
annealing, Optuna and GEPA (optional extras), and the selector.

**Systems where they run.** Env values from a file outside the commits, services from a fixed image on an internal
network, and model calls counted at a gateway by the operator's meter (#79, #80).

**Demos.** `fernhill` (an engagement on a made-up firm with the kit alone, #104) and `research-loop` (evidence claims
from papers and from MetaSoar's own trials, as data, #105).

**Known limits.** See README, "Limits". In particular: on GitHub the held-out answers share the runner with
candidate code, and only the container keeps them apart. The dogfood caller (`.github/workflows/morphogen.yml`)
still pins the rebuild-8 judge (`b921c9b`).

**Versions.** The Python package and the Claude Code plugin are both 0.10.0. The package was 0.8.0 and the plugin
0.9.0 before.
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Morphogen (rebuild 7)

Read BRIEF.md first; it is the design. The previous build is on the `rebuild-6` branch, with
Read BRIEF.md first; it is the design. The previous build is at the tag `archive/rebuild-6`, with
docs/restart/LESSONS.md.

## Layout
Expand Down
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Copyright 2026 OpenReplicant

Licensed under the Apache License, Version 2.0.

The first iteration (Morphogen and the Knowledge Kernel) is preserved on the
branch first-iteration, with its own NOTICE.
The first iteration (Morphogen and the Knowledge Kernel) is in this repository's
history at commit cc3b77d, with its own NOTICE.
18 changes: 15 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -361,9 +361,9 @@ directory, so it can only answer. The cell's `description` is its objective.
| Evidence | `evidence.py` | an append-only, hash-chained log of measured and stated claims, in git's own directory |
| 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 |
| Interfaces | `cli.py`, `mcp_server.py`, `ui.py` | the command line, an MCP server with 13 tools, and a local read-only web UI |
| 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) |
| Schemas | `schemas/` | the evidence record (v1); the `spec.morphogen` fields of the catalog entities the code loads (v1; a test keeps them equal); the research loop's evidence claim (v1, draft) |

### The system guard

Expand Down Expand Up @@ -471,6 +471,14 @@ description; without one, the change is judged as one that claims no improvement
job signs the verdict (Sigstore, keyless by default), posts `morphogen/verdict` on the head commit and keeps the
verdict and the run's evidence records as artifacts; a judge that fails is posted as a stop, never a pass.

**On GitHub, only the container keeps the answers from the candidate.** The `judge` job clones the private material
into the runner's temporary directory, on the same virtual machine where the candidate's commands run. A candidate
cannot read it because its container mounts only the candidate's tree, read-only, with no network. Nothing else
stands between them: the containers run as the image's user (root, for `python:3.12-slim`) under the runner's Docker
daemon, with Docker's default capabilities, so a container escape would reach the answers and anything else on the
runner. The rebuild-8 judge that the dogfood caller still pins (`b921c9b`) ran candidates in a job that never had
the answers on disk. The trade-off is open (see "Limits").

## What the judge guarantees

- **The rules are the base's.** The catalog files and everything a cell's `change` does not name come
Expand Down Expand Up @@ -543,6 +551,10 @@ Details are from each project's own docs or source, read on 2026-11-04 and 2026-
insist with `requires: [network_isolated, private_paths_hidden, ...]`. Containers use
`sandbox_image` (default `python:3.12-slim`), so a cell's dependencies must be in that image.
- **The scorer runs without a container**: it is the judge's code from the base commit.
- **On GitHub, the held-out answers share the runner with candidate code.** Container isolation (no network, only
the candidate's tree mounted) is the only thing between them; the containers are not hardened further (no
`--cap-drop`, no `no-new-privileges`, root inside). Keep cases the candidate must never see on a judge it cannot
reach ("A judge the author cannot reach"), or accept that a container escape on the runner would expose them.
- **Settings are read statically.** Code that changes a setting at run time is the reviewer's to
catch. TOML keys can be read but not yet written by `tune`.
- **Default deny is as narrow as `change`.** `change: "**"` would open everything but the project
Expand All @@ -566,6 +578,6 @@ Details are from each project's own docs or source, read on 2026-11-04 and 2026-
tests/ its tests and red team; fixture projects in tests/fixture*.py
.claude-plugin/ the plugin and marketplace manifests
skills/, agents/ the skills (Agent Skills format) and Claude Code agents
schemas/ published JSON Schemas (evidence record; spec.morphogen, a draft)
schemas/ published JSON Schemas (evidence record, spec.morphogen, evidence claim)
demos/ projects Morphogen can build and drive (the core never imports from them)
BRIEF.md the design; PLAN.md the way there
27 changes: 19 additions & 8 deletions demos/research-loop/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ Nothing here runs a model. These are records, and a check that they hold togethe
| Path | What it holds |
| --- | --- |
| `catalog-info.yaml` | the `metasoar` System, and a `Location` naming the two files below |
| `catalog/map.yaml` | our side: three roles (`decision-backend`, its `readout-calibration`, `think-router`) and this system's conditions as `Resource`s (LFM3 1.7B Q6_K, Inkling 2 Mini Q4_K, llama.cpp b12627, the GTX 1070 with 8 GB, JevBench at `ed50fe0`) |
| `catalog/options.yaml` | 13 options, one `Component` with `spec.lifecycle: candidate` per method the papers measured; each lists its claim files in `spec.morphogen.evaluation.evidence` |
| `catalog/map.yaml` | our side: four roles (`decision-backend`, its `readout-calibration`, `think-router`, and `intent-handler` for E-17) and this system's conditions as `Resource`s (LFM3 1.7B Q6_K, Inkling 2 Mini Q4_K, llama.cpp b12627, the GTX 1070 with 8 GB, JevBench at `ed50fe0`, TabMWP at `5a1a522`) |
| `catalog/options.yaml` | 14 options, one `Component` with `spec.lifecycle: candidate` per method: 13 the papers measured, and MetaSoar's own `handler-ladder`; each lists its claim files in `spec.morphogen.evaluation.evidence` |
| `claims/arxiv-*/` | 18 claims from the five papers, one file each ([schemas/evidence-claim.v1.json](../../schemas/evidence-claim.v1.json)), with their conditions and their status for `system:default/metasoar` |
| `claims/e04a/`, `claims/probe/` | 7 of our own observations: six from E-04a's LFM3 run, one from the probe the note records. Each is a claim with `source.kind: trial` (or `probe`) and `reporting: ours`, which a paper claim's outcome links to |
| `claims/e04a/`, `claims/e17/`, `claims/probe/` | 12 of our own observations: six from E-04a's LFM3 run and one from its Inkling 2 Mini run, four from the handler ladder (E-17, E-17b, E-17c, E-17d), one from the probe the note records. Each is a claim with `source.kind: trial` (or `probe`) and `reporting: ours`, which a paper claim's outcome links to |
| `check.py` | validates every claim and every option, and the links between them |

The claims are not `Location` targets, so the judge never reads them (docs/research-loop.md, "Where evidence claims
Expand All @@ -27,7 +27,7 @@ live").

| Claim (paper) | Option | Status here | p (transfer) |
| --- | --- | --- | --- |
| `gates-likelihood-readout-27-31b-matches-jev` (2610.00346) | likelihood-readout | **did-not-transfer** (E-04a; falsifier met) | none written before |
| `gates-likelihood-readout-27-31b-matches-jev` (2610.00346) | likelihood-readout | **did-not-transfer** for LFM3 1.7B (E-04a; falsifier met); **replicated** for Inkling 2 Mini, about 26B (E-04a; falsifier not met) | none written before |
| `gates-temperature-fixes-calibration` (2610.00346) | temperature-scaling | **replicated** on our setup | none written before |
| `gates-order-effects-untrained` (2610.00346) | likelihood-readout | **replicated** on our setup (a different swap) | none written before |
| `jeval-first-token-readout` (2610.03935) | likelihood-readout | **replicated**, in the qualitative sense only | none written before |
Expand All @@ -44,7 +44,17 @@ live").
likelihood of each option key, matched Jev. Read the same way, LFM3 1.7B untuned reached a pooled accuracy of 0.528
[0.508, 0.547], against Jev 1.13's 0.842 [0.828, 0.857], on the same 3,412 JevBench cases. Its coverage at 5% risk
was 0.09, against Jev's 0.67. After one temperature per slice, its calibration error matched Jev's (0.026 against
0.024), so the claim about temperature scaling did hold here. The gap is accuracy, not calibration.
0.024), so the claim about temperature scaling did hold here. The gap is accuracy, not calibration. Inkling 2 Mini,
a mixture of experts of about 26B, close to the paper's sizes, reached 0.810 [0.775, 0.843] against Jev's 0.843 on a
sample of 779 cases: 3.3 points below (paired interval [-6.5, -0.3]), with coverage at 5% risk 0.51 against 0.64.
So the claim transferred at the paper's size and not at 1.7B. On those 779 cases d1-2B reached 0.633 and LFM3 0.561.
The claim has one assessment per model, both for `system:default/metasoar`.

**The handler ladder** (MetaSoar E-17 to E-17d, `claims/e17/`) is MetaSoar's own method, with no paper behind it. On
its own 300-case TabMWP stream, templates and handlers answered 58.7% of the last 150 cases at -1.3 points [-3.3,
0.0] against the large model alone. On 150 fresh cases they answered 74.0% but lost 5.3 points [-9.3, -2.0] (E-17b).
Perturbations that keep the answer changed nothing (E-17c). Stricter promotion, a shape gate and a stronger check
removed every error and nearly every cheap answer (8.7%, E-17d).

## How to read it

Expand All @@ -53,12 +63,12 @@ was 0.09, against Jev's 0.67. After one temperature per slice, its calibration e
conditions are only what the note states. Anything that matters but is not stated is listed in
`conditions.unstated`. Phase 1 takes the quotes from the papers themselves.
- **Our own numbers are quoted from MetaSoar at a commit,** and `check.py --metasoar` matches every such quote
against that file. There are 36 quotes in all, from the claims and from the map's evidence annotations.
against that file. There are 43 quotes in all, from the claims and from the map's evidence annotations.
- **The predictions are a draft.** The seven probabilities were written by the agent that recorded this session. It
mapped the note's qualitative status column ("supported", "weak", "brittle out of distribution") onto numbers, and
each one says so in `prediction.by`. The owner should revise them before any outcome arrives. Each has
`before_outcome: true`, so it will count towards calibration (the Brier score in docs/research-loop.md). The three
replicated claims and the one that did not transfer have no prediction. Nobody wrote a probability before E-04a ran,
replicated claims, and the one that did not transfer for LFM3 and was replicated for Inkling, have no prediction. Nobody wrote a probability before E-04a ran,
so they do not count.
- **"Replicated" here means "held on our setup"** (`comparison: our-setup`). It is a transfer test of the method,
not a reproduction of the paper. A did-not-transfer is not a refutation either: the model, its precision, the
Expand All @@ -67,7 +77,8 @@ was 0.09, against Jev's 0.67. After one temperature per slice, its calibration e
`docs/experiments.md`). It is not a candidate the judge decided. So the outcome that did not transfer carries
`verdict.by: falsifier`, and the others carry `by: none`. Once the readout is tuned as a cell, `by: morphogen` will
name the judge's verdict.
- **Inkling 2 Mini** is in the map but in no observation, because its E-04a run was still going.
- **Quotes from 2026-11-26** (the Inkling run and E-17) are from MetaSoar at `22feddc` (its main on 2026-11-27);
the earlier ones stay at `facbe84` and `92105f8`.

## Run the check

Expand Down
27 changes: 26 additions & 1 deletion demos/research-loop/catalog/map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ metadata:
spec: {type: role, lifecycle: experimental, owner: group:default/metasoar, system: metasoar}
---
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: intent-handler
description: >-
The role: answer a recurring intent without the large model (a plan template the small model follows, or a
written handler), falling back to the large model when it does not hold. MetaSoar's handler ladder (M-26).
annotations:
morphogen.dev/evidence: |
stated | OpenReplicant/MetaSoar@22feddc6fa29682e94c2f62fe25da93b559980ab:docs/experiments.md | "**The handler ladder (M-26) cuts model calls on a stream of recurring intents with no loss of accuracy.**"
spec: {type: role, lifecycle: experimental, owner: group:default/metasoar, system: metasoar}
---
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
name: lfm3-1.7b-q6-k
Expand All @@ -55,7 +67,8 @@ metadata:
name: inkling-2-mini-q4-k
description: >-
Inkling 2 Mini, Q4_K, the experts of loop layers 6-12 on the GPU; MetaSoar's slow model. The owner notes it is
strong for its size. Its E-04a run was still going on 2026-11-25, so no claim here holds its numbers.
strong for its size. Its E-04a numbers are in claims/e04a/e04a-inkling-pooled-accuracy.yaml; it is also E-17's
large model.
annotations:
morphogen.dev/evidence: |
stated | OpenReplicant/MetaSoar@facbe842bcc0778afc2fbe2a9801cd9895d46fab:trials/decision-readout/README.md | "`slow` is Inkling 2 Mini Q4_K, with the experts of loop layers 6–12 on the GPU, with thinking off by"
Expand Down Expand Up @@ -95,3 +108,15 @@ metadata:
morphogen.dev/evidence: |
stated | OpenReplicant/MetaSoar@facbe842bcc0778afc2fbe2a9801cd9895d46fab:trials/decision-readout/README.md | "the Leanmcp JevBench release, pinned at revision `ed50fe0`."
spec: {type: dataset, owner: group:default/metasoar, system: metasoar}
---
apiVersion: backstage.io/v1alpha1
kind: Resource
metadata:
name: tabmwp-5a1a522
description: >-
TabMWP (Lu et al., ICLR 2023), tables and math word problems generated from templates, at revision 5a1a522;
`test1k` in one fixed random order is E-17's stream. CC BY-NC-SA 4.0, fetched, not committed.
annotations:
morphogen.dev/evidence: |
stated | OpenReplicant/MetaSoar@22feddc6fa29682e94c2f62fe25da93b559980ab:docs/experiments.md | "TabMWP at `5a1a522` (data CC BY-NC-SA 4.0, fetched, not committed; `dev1k` for prompts, `test1k` for the stream)"
spec: {type: dataset, owner: group:default/metasoar, system: metasoar}
Loading