Skip to content

GitHub judge reading the catalog: judge.yml and morphogen pr - #106

Merged
OpenReplicant merged 1 commit into
mainfrom
claude/catalog-judge
Nov 26, 2026
Merged

OpenReplicant merged 1 commit into
mainfrom
claude/catalog-judge

Conversation

@OpenReplicant

Copy link
Copy Markdown
Owner

A GitHub judge that reads the catalog (spec.morphogen on the entities of catalog-info.yaml) instead of the old .morphogen/policy.json, which judge.yml reads at b921c9b (rebuild 8), the only commit where it exists.

What it adds

  • morphogen pr (morphogen/pullrequest.py): judges a pull request with nobody at the keyboard. It makes no judgement of its own. It works out what to hand the judge, writes a request/v1 outside the repository and runs it (request.run).
    • The candidate is the head, or the head merged onto the base (git merge-tree, nothing checked out) when the branch is behind. The rules are always main's as it is now.
    • A pull request that touches a --protect glob is refused before anything runs, and the refusal is recorded.
    • A pull request that touches no file any cell may change, and no rule file, is a pass (not judged).
    • Anything else is judged: kind: judge when the description has a line morphogen-target: cell:NAME, otherwise kind: change.
    • --local is the operator's morphogen.local.yaml from a private repository. Relative paths in it are read from its own directory, and any rule in it is refused.
    • --sandbox none is refused unless --unsandboxed is passed. The workflow never passes it.
    • The pr-verdict/v1 document is always written. If the judge cannot judge, the document says stop.
  • .github/workflows/judge.yml, a reusable workflow with two jobs:
    • judge has only contents: read. It fetches the base and head as git objects and installs the judge at judge-ref from requirements.lock: hash-locked wheels, exported from uv.lock. It clones cases-repo outside the repository using MORPHOGEN_CASES_TOKEN, then runs morphogen pr in docker or podman. Afterwards it removes the private material and uploads the verdict and the evidence records.
    • post has statuses and id-token. It signs the verdict with cosign (keyless by default) and posts morphogen/verdict on the head commit. If the judge failed, it posts a stop, never a pass.
  • tests/test_pullrequest.py: 24 tests. They cover the paths above and the cheats through them: widening change in the catalog (with a target and without one), editing only the catalog, deleting it, committing a morphogen.local.yaml, editing a protected workflow, carrying rules in the local file, running unsandboxed, and adding the first catalog. They also check the workflow's invariants (actions pinned by commit, permissions, the description never reaching a script) and that requirements.lock matches uv.lock.

Guarantees, old against new

Old (b921c9b) Here
policy read from the base the catalog read from the base commit by the judge (rules_config, structure_of); main's own workflow, via pull_request_target
protected paths refused catalog files and morphogen.local.yaml refused by the judge (default deny); the caller's protected globs refused by morphogen pr
measurement outside the candidate the judge's wrapper and the base's scorer, unchanged
held-out answers kept away from the candidate in a private repo cloned to $RUNNER_TEMP, outside the repo and every worktree; given only to the base's scorer (MORPHOGEN_PRIVATE); every candidate command runs in a container with no network that sees only its own tree; sandbox: none refused
signed verdict, posted status, failure means stop the same: cosign bundle, morphogen/verdict from the Actions token or the App, stop on any failure; the evidence records (hash chain) kept as an artifact

Weaker than before: the old run job never had the answers on disk at all. Here the answers sit on the same runner as the containers, and container isolation is what keeps them hidden. That is the package's own private_paths_hidden guarantee. There is also no served-case count and no sealed case sets yet.

Not changed

dogfood/ and .github/workflows/morphogen.yml still call judge.yml@b921c9b. Moving them is not yet safe: main has no catalog-info.yaml for the toy, and its held-out cases are in the rebuild-8 store format. Because this PR touches .github/** and morphogen/**, the dogfood judge will refuse it, and a person merges it through the ruleset bypass.

Checked

  • uv run --extra optuna --extra gepa python -m unittest discover -s tests -t .: 307 tests, OK (12 skipped; main has 283 tests with the same 12 skips).
  • actionlint 1.7.12 with shellcheck 0.11.0 (both installed from PyPI): clean.
  • I ran the workflow's own shell steps on a fixture project behind a local bare "GitHub", with the judge installed from requirements.lock. The judged pass, the catalog refusal, the not-judged change, the protected-path refusal and the stop all came out right. Docker was not used here, so the judge step ran with --sandbox none --unsandboxed.
  • Not run: a real Actions run, the container sandbox, cosign signing, posting the status, or the Podman test suite.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KhsqyvvvxYb2257ynXFbe9

The reusable workflow existed only at the rebuild-8 commits (b921c9b), where it
reads .morphogen/policy.json. This one reads catalog-info.yaml through the
package's own judge: `morphogen pr` works out what to hand the judge and runs it
as a request (request.py), so the rules come from the base commit, a candidate
that changes a catalog file or morphogen.local.yaml is refused, and the held-out
answers go only to the base's scorer.

morphogen/pullrequest.py (`morphogen pr`): the candidate is the head, or the head
merged onto the base (git merge-tree, no checkout) when the branch is behind; a
pull request touching a --protect glob is refused before anything runs (and
recorded); one touching no file any cell may change and no rule file is a pass
(not judged); otherwise kind judge on a `morphogen-target: cell:NAME` line in
the description, else kind change. --local is the operator's
morphogen.local.yaml from a private repository, relative paths read from its
directory, rules in it refused. --sandbox none is refused without
--unsandboxed. The pr-verdict/v1 document is always written; a judge that cannot
judge writes a stop.

.github/workflows/judge.yml: `judge` (contents: read) fetches base and head as
git objects, installs the judge from requirements.lock (uv export of uv.lock,
hash-locked wheels), clones the private material outside the repository, runs
`morphogen pr` in docker or podman, removes the material, keeps the verdict and
evidence records. `post` (statuses, id-token) signs the verdict with cosign
and posts morphogen/verdict; a failed judge is posted as a stop.

tests/test_pullrequest.py: the paths above, and the cheats through them
(widen `change` in the catalog with and without a target, edit only the
catalog, delete it, commit a local file, edit a protected workflow, carry
rules in the local file, run unsandboxed, add the first catalog); the
workflow's invariants (pinned actions, permissions, no description in a
script) and the lock against uv.lock.

The dogfood caller stays on b921c9b: main has no catalog-info.yaml for the
toy, and its held-out cases are in the rebuild-8 store format.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KhsqyvvvxYb2257ynXFbe9
@OpenReplicant
OpenReplicant deployed to morphogen-judge November 26, 2026 00:01 — with GitHub Actions Active
@OpenReplicant
OpenReplicant deployed to morphogen-judge November 26, 2026 00:01 — with GitHub Actions Active
@OpenReplicant
OpenReplicant marked this pull request as ready for review November 26, 2026 01:03
@OpenReplicant
OpenReplicant merged commit 870c6f7 into main Nov 26, 2026
4 of 5 checks passed

This branch was successfully deployed

1 active deployment
morphogen-judge — fdb13f44 Deployed Nov 26, 2026 by OpenReplicant via judge / score #34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant