Skip to content
Draft
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
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ docs/restart/LESSONS.md.
- `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.
- `site/`: the research site, static HTML built with Astro (`site/src/`) from the evidence claims, the map and the
options named in a config file (`site/README.md`): `site/config.toml` for the demo, anyone's own through
- `site/`: the Morphogen site (map, catalog, research, optimise), static HTML built with Astro (`site/src/`) from the evidence claims, the map, the
options and the judge's verdict log named in a config file (`site/README.md`): `site/config.toml` for the demo, anyone's own through
`morphogen site build`. `.github/workflows/site.yml` deploys the demo to Pages when started by hand.

## Rules
Expand Down
10 changes: 10 additions & 0 deletions demos/fernhill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ options catalogued for one role, cells drafted for one opportunity) and a demo o
| `prompt.md`, `run.sh`, `check.py` | the engagement unattended: a fresh project from `material/`, Claude Code with only the plugin, then the checks of its result |
| [runs/](runs/) | unattended runs: each one's report and `check.py` output |

## As a site

uv run morphogen site build --config demos/fernhill/site.toml --out _site

builds the map (the firm's parts, the interfaces between them, owners), the catalog (four options for job
scheduling, none measured) and Optimise (the quote calculator as a cell). The judge's verdicts from the first run are
not on it: the evidence log lives in git's own directory and was not committed, so Optimise says that and shows no
verdict. To show them, rerun the judge and export its log with `morphogen evidence --limit 100000 > verdicts.json`,
then set `verdicts` in `site.toml`.

## The first run (2026-11-24)

- **Mapped:** the firm as a System, 5 teams, 6 process steps, its tools and 2 roles; 40 evidence quotes, all found
Expand Down
26 changes: 26 additions & 0 deletions demos/fernhill/site.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Fernhill's site: the made-up firm mapped from its documents to opportunities (site/README.md, "The config file").
# Build it with `uv run morphogen site build --config demos/fernhill/site.toml --out _site`. Paths are relative to
# this file. Fernhill has no research claims, so the research pages are empty and leave the header; the map, the
# catalog (four options for job scheduling) and Optimise (one cell, the quote calculator) show.

[site]
title = "Fernhill Kitchens"
description = "A made-up kitchen firm, mapped from its documents: teams, process, tools, the quote calculator as a cell, and options for job scheduling."
owner = "OpenReplicant"
repo = "OpenReplicant/Morphogen"
branch = "main"
system = "system:default/fernhill"

[sources]
# The map: the System, its teams, the process steps, the tools and the cell. The Location in catalog-info.yaml names
# the files under catalog/, and they are read through it.
map = ["engagement/catalog-info.yaml"]
# The options catalogued for the job-scheduling role.
options = ["engagement/catalog/scheduling.yaml"]
# The judge's verdict log, exported with `morphogen evidence --limit 100000 > verdicts.json`: none is kept here, since
# the evidence log lives in git's own directory, not in the repository. Optimise says so rather than inventing one.
# verdicts = "engagement/verdicts.json"
claims = []

[nav]
pages = ["map", "catalog", "optimise", "search"]
8 changes: 6 additions & 2 deletions morphogen/site.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ def _q(s: str) -> str:
catalog = ["catalog-info.yaml", "catalog"] # Backstage entity files, or folders of them; a missing one is skipped
research = "research" # queue.json, watch.yaml, seen.jsonl, index.json (each optional)
content = {content} # Markdown pages
# map = ["catalog/map.yaml"] # more entity files for the map (read with `catalog`)
# options = ["catalog/options.yaml"] # more entity files for the options catalogued for roles
# verdicts = "verdicts.json" # the judge's log: morphogen evidence --limit 100000 > verdicts.json

# The labels on each steering link (the agent reads the `research-action:` line in the body first).
[labels]
Expand All @@ -114,8 +117,9 @@ def _q(s: str) -> str:
# logo = "logo.svg" # in the header, and the icon

[nav]
# Any of: claims, queue, predictions, roles, map, notes, search. Pages with `nav: N` in front matter come after.
pages = ["claims", "queue", "predictions", "roles", "map", "notes"]
# Any of: claims, queue, predictions, roles, map, catalog, optimise, notes, search. catalog and optimise leave the
# header when there is nothing to show. Pages with `nav: N` in front matter come after.
pages = ["claims", "queue", "predictions", "roles", "map", "catalog", "optimise", "notes"]
"""

ABOUT = """\
Expand Down
66 changes: 55 additions & 11 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
# The research site

A static site for the research loop ([docs/research-loop.md](../docs/research-loop.md)), for any system running
Morphogen: the claims the research agent has catalogued, their status for that system, its transfer predictions
against outcomes, and the roles it watches for, with a page for every claim, paper, trial, model, option and role and
the links between them. Built with [Astro](https://astro.build) 7 into plain HTML; the interactive parts use
# The Morphogen site

A static site for any system running Morphogen, covering the kit's four verbs: **map** (the system's parts, the
interfaces they provide and consume, their owners and dependencies), **catalog** (the options for each role, side by
side), **research** (the claims the research agent has catalogued from papers, their status for that system, its
transfer predictions against outcomes: [docs/research-loop.md](../docs/research-loop.md)) and **optimise** (the cells
that may change, and the judge's verdict on each change). Every page is built from files; a page whose files are
absent leaves the header, so a research-only site is still a research-only site. There is a page for every claim,
paper, trial, model, option, role, component, interface and owner, and the links between them. Built with [Astro](https://astro.build) 7 into plain HTML; the interactive parts use
[Alpine.js](https://alpinejs.dev)'s CSP build, served from the site itself. No server, no database, no tracking,
nothing loaded from another host. Everything specific to one system (its sources, name, owner, repository, labels,
theme and navigation) comes from a config file; this folder holds only the templates.
Expand Down Expand Up @@ -48,6 +51,9 @@ system = "system:default/orchard" # the System each claim's status is shown f
[sources]
claims = ["claims"] # searched recursively for EvidenceClaim files
catalog = ["catalog-info.yaml", "catalog"] # Backstage entity files or folders of them; a missing one is skipped
# map = ["catalog/map.yaml"] # entity files for the map and for the options: the same kind of file as
# options = ["catalog/options.yaml"] # `catalog`, read with it, named apart so a config says which is which
# verdicts = "verdicts.json" # the judge's log (below); optional
research = "research" # queue.json, watch.yaml, seen.jsonl, index.json (each optional)
content = "site" # Markdown pages (optional)
# schema = "evidence-claim.v1.json" # default: Morphogen's schemas/evidence-claim.v1.json
Expand All @@ -65,10 +71,10 @@ css = "brand/theme.css" # served as assets/user/theme.css, after style.css:
logo = "brand/logo.svg" # .svg, .png, .webp or .jpg; in the header and as the icon

[nav]
# The header's pages, in order, from: claims, queue, predictions, roles, map, notes (shown once a note exists),
# search; `{ page = "search", text = "Find" }` renames one. Markdown pages with `nav: N` follow. Every page is
# The header's pages, in order, from: claims, queue, predictions, roles, map, catalog (once a role or option exists),
# optimise (once there is a cell or a verdict), notes (once a note exists), search; `{ page = "search", text = "Find" }` renames one. Markdown pages with `nav: N` follow. Every page is
# built either way.
pages = ["claims", "queue", "predictions", "roles", "map", "notes"]
pages = ["claims", "queue", "predictions", "roles", "map", "catalog", "optimise", "notes"]
# Other links go in the same list as `{ text, href }`. An absolute http(s) URL or a path starting with `/` is written
# as it is (a URL gets rel="noopener"); anything else is relative to the site and gets the base path from `--base`.
# pages = ["claims", "queue", { text = "Lab", href = "https://example.org/lab" }, { text = "Home", href = "/" }]
Expand All @@ -81,7 +87,40 @@ label = "Fund this" # the link's text (default "Fund th
The funding figures themselves (a bar, price, share funded, a "ready" badge and the source) come from `queue.json`
(`research/funding.yaml`, `morphogen.research rank`): a claim whose row has no `cost_money` shows none of it.

Morphogen's own demo builds from [config.toml](config.toml), which points at [demos/research-loop](../demos/research-loop).
### The entity files

The map is Backstage `catalog-info.yaml` files (and the files a `Location` in them names, read relative to the file
that names them). The site reads `System`, `Component`, `API`, `Resource`, `Group` and `User`. A Component with
`spec.type: role` is a role, one with `spec.lifecycle: candidate` an option for the role in its
`spec.morphogen.fills`, any other a component; `providesApis`, `consumesApis`, `dependsOn`, `owner` and `subcomponentOf`
become references, each shown both ways. An owner with no `Group` or `User` file still gets a page. A **cell** is a
component (or the System) with `spec.morphogen.run` (or `tests`), read with the System's `defaults` under it; the
System's `spec.morphogen.autonomy` says whether a pass on its lifecycle may be merged by an agent (default: a person
reviews). An option's `spec.morphogen` fields `parameters` (a JSON Schema), `licence`, `docs.url` and `evaluation`
fill the catalog.

### The verdict log

`[sources] verdicts` names a file made from the judge's evidence log, which lives in git's own directory and is not
committed:

```sh
morphogen evidence --limit 100000 > verdicts.json # a JSON array; JSON lines work too
```

The page shows each record with `kind: verdict`: the change proposed (commits, settings moved, files), passed or
refused, the measures (base, candidate, gain, interval, sign test) and the reasons rebuilt from the record's outcome
the way the judge words them, and the gate (who may merge). A verdict is listed under the cell it names (`cell`,
`cells` or `subject.system`), and one for a cell the map lacks is listed apart. The evidence chain checks each
record's `prev` and `hash` (SHA-256 of its canonical JSON, over the numbers as the file wrote them); an edited record
is named. The judge's own records carry no signature or transparency-log entry; if a record has a `signature`,
`attestation`, `transparency`, `rekor`, `log_index` or `inclusion_proof` field, it is shown as recorded and not
checked. A file that does not exist is skipped with a warning; one that is not JSON stops the build.

Morphogen's own demo builds from [config.toml](config.toml), which points at [demos/research-loop](../demos/research-loop);
[demos/fernhill/site.toml](../demos/fernhill/site.toml) builds the made-up firm: its map, the options catalogued for
job scheduling, and its one cell. Fernhill has no verdict log (its evidence log was never committed), so Optimise
says so and shows none.

## Working on the templates

Expand Down Expand Up @@ -148,6 +187,9 @@ used twice stops the build), and joins them into one graph: entities, typed refe
| option | `options/<name>.html` | a Component with `lifecycle: candidate` |
| role | `roles/<name>.html` | a Component with `type: role` |
| system | `systems/<name>.html` | the System |
| component | `components/<name>.html` | any other Component |
| api | `apis/<name>.html` | an API: who provides and consumes it, its tests |
| group | `owners/<name>.html` | a Group or User, or a name given as an owner |
| page | `<path>.html` | a Markdown file in `content/` |

References: a claim's `about` (option), `role`, `source` (paper or trial), `conditions.*.ref` (measured on),
Expand All @@ -166,7 +208,9 @@ questions (`watch.yaml`), what has been tested and what is next in the queue.
| `queue.html` | next to test: `queue.json`, best first, with plan, cost, score, funding (when there is a `funding.yaml`), steering, and buttons to prioritise or reject |
| `predictions.html` | predictions waiting for a trial, and a calibration chart with the Brier score once predictions written before an outcome have one |
| `roles.html` | what the agent watches (`watch.yaml`, `seen.jsonl`), the roles, the options for each, and this system's conditions |
| `map.html` | the relations graph, laid out at build time (`src/lib/layout.mjs`); a static SVG of links, with highlighting and filters in Alpine |
| `map.html` | the system's graph (parts, interfaces, dependencies; only when the map has any), a table of every part with its owner, interfaces, dependencies and dependents, and the research's relations graph; static SVGs laid out at build time (`src/lib/layout.mjs`), with highlighting and filters in Alpine |
| `catalog.html` | per role: a table comparing its options (interfaces, parameters, licence, docs, measurements, claims), then each option's parameters, measurements and the trade-offs its claims report |
| `optimise.html` | the cells (what may change, the score, what the judge last measured, autonomy), the verdicts on each, and the evidence chain |
| `search.html` | everything by kind; with JavaScript, a search over `data/search.json` (the header's box lands here) |
| `notes.html` | notes and announcements from `content/` |
| `data/claims.json`, `data/graph.json`, `data/search.json` | the records, the whole graph (with the calibration pairs and Brier score), the search index |
Expand Down
2 changes: 1 addition & 1 deletion site/public/assets/site.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ document.addEventListener("alpine:init", function () {

// Search over data/search.json (fetched from this site only). ?q= from the header's search box fills it in.
var KIND = { claim: "Claim", paper: "Paper", trial: "Trial", option: "Option", role: "Role", resource: "Resource",
component: "Component", system: "System", page: "Page" };
component: "Component", api: "API", group: "Owner", system: "System", page: "Page" };
Alpine.data("search", function () {
return {
off: true, q: "", rows: [], results: [], countText: "",
Expand Down
26 changes: 26 additions & 0 deletions site/public/assets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,29 @@ details ul { margin-top: 8px; font-size: 0.88rem; }
.funding { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 0.9rem; margin: 6px 0; }
.fund-bar { width: 120px; }
.tag-ready { background: var(--good-bg); color: var(--good); border-color: currentColor; font-weight: 650; }

/* The system's map, the catalog and the Optimise page */
.sec { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.85rem; color: var(--accent-2); margin: 24px 0 6px; }
.tbl.wrap td, .tbl.wrap td:last-child { white-space: normal; }
.tbl.wrap th[scope=row] { text-align: left; font-weight: 500; text-transform: none; letter-spacing: 0; font-size: 0.92rem; color: var(--text); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.graph .t-api rect { stroke: var(--pred); stroke-dasharray: 4 2; }
.graph .t-group rect { stroke: var(--muted); }
.graph .t-component rect, .graph .t-option rect { stroke: var(--text); stroke-opacity: 0.5; }
.graph .node.cell rect { stroke: var(--good); stroke-width: 2; fill: var(--good-bg); }
.graph .edge.r-provides { stroke: var(--pred); stroke-opacity: 0.55; }
.graph .edge.r-consumes { stroke: var(--accent-2); stroke-opacity: 0.45; stroke-dasharray: 5 3; }
.graph .edge.r-depends-on { stroke: var(--warn); stroke-opacity: 0.5; }
.optdetail { display: grid; gap: 10px; }
.optdetail .opt { list-style: none; }
.optdetail code, .cell-card code, .verdict code { font-family: var(--mono); font-size: 0.88em; background: var(--panel-2); padding: 1px 4px; border-radius: 4px; overflow-wrap: anywhere; }
.res-sum { display: block; margin-top: 4px; }
.finding-better { color: var(--good); } .finding-worse { color: var(--bad); }
.verdicts { display: grid; gap: 12px; }
.verdict { border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; background: var(--bg); list-style: none; }
.verdict:target { outline: 2px solid var(--accent); outline-offset: 2px; }
.vhead { margin: 0 0 6px; }
.statement-small { margin: 0 0 8px; color: var(--muted); font-size: 0.92rem; }
.breaks { overflow-wrap: anywhere; word-break: break-all; }
.verbs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); margin: 16px 0 0; padding: 0; list-style: none; }
.verbs .card { padding: 12px 14px; }
.verbs h3 { margin: 0 0 4px; }
6 changes: 6 additions & 0 deletions site/src/components/EntityList.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
// Entities as a comma-separated run of links, or the words `empty` when there are none.
import { link } from "../lib/text.mjs";
const { items, empty = "none named" } = Astro.props;
---
{items.length ? items.map((x, i) => <>{i > 0 && ", "}<a class="mono" href={link(x.url)}>{x.title}</a></>) : <span class="muted">{empty}</span>}
24 changes: 24 additions & 0 deletions site/src/components/Interfaces.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
// What an entity offers and needs, as the map says: the interfaces it provides and consumes, its owner, what it
// depends on and what depends on it. Shown only for what it has. An API shows who provides and who consumes it.
import { up } from "../lib/text.mjs";
const { site, ent, depth = 0 } = Astro.props;
const u = up(depth);
const consumers = site.ins(ent, "consumes");
const all = [
["Provides", site.outs(ent, "provides")],
["Consumes", site.outs(ent, "consumes")],
["Provided by", site.ins(ent, "provides")],
["Consumed by", consumers],
["Depends on", site.outs(ent, "depends-on")],
["Dependents", site.ins(ent, "depends-on")],
].filter(([, l]) => l.length);
const owners = site.outs(ent, "owned-by");
const owned = ent.type === "group" ? site.ins(ent, "owned-by") : [];
---
{(all.length > 0 || owners.length > 0 || owned.length > 0) && <section class="panel" aria-labelledby="if-h"><h2 id="if-h">Interfaces and ownership</h2>
<dl class="kv">
{owners.length > 0 && <><dt>Owner</dt><dd>{owners.map((o, i) => <>{i > 0 && ", "}<a class="mono" href={`${u}${o.url}`}>{o.name}</a></>)}</dd></>}
{all.map(([label, items]) => <><dt>{label}</dt><dd>{items.map((x, i) => <>{i > 0 && ", "}<a class="mono" href={`${u}${x.url}`}>{x.title}</a></>)}</dd></>)}
{owned.length > 0 && <><dt>Owns</dt><dd>{owned.map((x, i) => <>{i > 0 && ", "}<a class="mono" href={`${u}${x.url}`}>{x.name}</a></>)}</dd></>}
</dl></section>}
Loading