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
49 changes: 49 additions & 0 deletions .github/workflows/site.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# The research site (site/): build it from the claim, role and option files and deploy it to GitHub Pages.
# Not enabled: it runs only when started by hand, and deploying needs Pages turned on with "GitHub Actions" as its
# source (Settings > Pages). To deploy on every change to main, add the `push` trigger below.
name: research-site
on:
workflow_dispatch:
# push:
# branches: [main]
# paths: [site/**, demos/research-loop/**, schemas/evidence-claim.v1.json, .github/workflows/site.yml]

permissions:
contents: read

concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Install PyYAML and jsonschema (a venv; hash-locked wheels only)
run: |
python3 -m venv "$RUNNER_TEMP/site"
"$RUNNER_TEMP/site/bin/pip" install --quiet --only-binary=:all: --require-hashes -r requirements.lock
- name: Test the build
run: '"$RUNNER_TEMP/site/bin/python" -m unittest tests.test_site -v'
- name: Build
run: '"$RUNNER_TEMP/site/bin/python" site/build.py --out site/_build'
- uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: site/_build

deploy:
needs: build
runs-on: ubuntu-24.04
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deploy.outputs.page_url }}
steps:
- id: deploy
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
2 changes: 2 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,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 by `site/build.py` from the evidence claims, the map and the
options (`site/README.md`); `.github/workflows/site.yml` deploys it to Pages when started by hand.

## Rules
- Look it up before relying on it: read a tool's or library's current docs before designing
Expand Down
1 change: 1 addition & 0 deletions site/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_build/
57 changes: 57 additions & 0 deletions site/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# The research site

A static site for the research loop ([docs/research-loop.md](../docs/research-loop.md)): the claims the research
agent has catalogued, their status for this system, its transfer predictions against outcomes, and the roles it
watches for. `build.py` reads the files named in `config.toml` (EvidenceClaim files,
[schemas/evidence-claim.v1.json](../schemas/evidence-claim.v1.json); the map and options as Backstage entity files)
and writes plain HTML into `_build/`. No server, no database, no tracking, nothing loaded from another host.

`config.toml` points at [demos/research-loop](../demos/research-loop): the claims under `claims/` (searched
recursively, so `claims/arxiv-ID/` is found), the map, `options.yaml` and the agent's `found.yaml` (a catalog file
that does not exist yet is skipped), and the agent's own files in `research/` (its README, "Files a website reads"):
`queue.json`, `watch.yaml`, `seen.jsonl`, and `index.json`, which the build checks against the claim files.

## Build and preview

```sh
uv run python site/build.py # or: python3 site/build.py (needs PyYAML; validates with jsonschema if installed)
python3 -m http.server 8000 -d site/_build # then open http://localhost:8000
uv run python site/build.py --root ../other-checkout --out /tmp/site # build another checkout's data
uv run python -m unittest tests.test_site -v
```

Every claim is validated against the schema first; an invalid file stops the build.

## Pages

| Page | What it shows |
| --- | --- |
| `index.html` | the feed, newest first, filtered in the page by search, role, source and status (kept in the address, so a view can be shared); works without JavaScript, unfiltered |
| `claims/<name>.html` | one claim: the quote and whether it was checked, the measure and effect, the conditions and what the source left unstated, the transfer prediction and its reason, the cheapest trial that would settle it (`assessments[].trial`) and its place in the queue, the outcome with its trial and verdict |
| `queue.html` | next to test: the agent's `queue.json`, best first, with its plan, cost, score and any 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`'s topics, and what became of the papers in `seen.jsonl`), the roles in the map, the options catalogued for each, and this system's conditions |
| `how.html` | the loop: watch, read, catalogue, predict, test behind the judge, score the prediction |
| `data/claims.json` | the same records, for other tools |

## Steering

The buttons open a prefilled GitHub new-issue page (title, body, labels); nothing is sent until the person submits
it. Each body ends with a `research-action:` line (`prioritise`, `reject`, `dispute`, `question`, `propose-role`,
`propose-option`), with `research-claim:` and `claim-file:` for a claim and `role:` for an option proposed for a
role; the agent reads those lines first (`morphogen/research.py`, `parse_issue`). The labels in `config.toml` are
the fallback: `research:prioritise`, `research:reject`, and `research:question` for the rest. GitHub applies labels
from a link only for people who can triage the repository. Text from papers never goes into an issue body, since it is rendered as Markdown.

## Safety

Claim text comes from papers. Every string from a file is HTML-escaped where it is written, a link from a file is
written only if it is http or https, and each page sets a content security policy that allows only its own
scripts and styles. `tests/test_site.py` builds a claim full of markup and a `javascript:` link and checks that
none of it comes through.

## Deploying

`.github/workflows/site.yml` tests, builds and deploys `_build/` to GitHub Pages. It runs only when started by hand
until its `push` trigger is uncommented, and it needs Pages set to "GitHub Actions" in the repository's settings.
Links are relative, so the site works at `https://<owner>.github.io/Morphogen/` or on a custom domain.
Loading