Repository navigation
GitHub judge reading the catalog: judge.yml and morphogen pr - #106
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 26, 2026 01:03
This was referenced Nov 27, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A GitHub judge that reads the catalog (
spec.morphogenon the entities ofcatalog-info.yaml) instead of the old.morphogen/policy.json, whichjudge.ymlreads atb921c9b(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 arequest/v1outside the repository and runs it (request.run).git merge-tree, nothing checked out) when the branch is behind. The rules are always main's as it is now.--protectglob is refused before anything runs, and the refusal is recorded.kind: judgewhen the description has a linemorphogen-target: cell:NAME, otherwisekind: change.--localis the operator'smorphogen.local.yamlfrom a private repository. Relative paths in it are read from its own directory, and any rule in it is refused.--sandbox noneis refused unless--unsandboxedis passed. The workflow never passes it.pr-verdict/v1document is always written. If the judge cannot judge, the document saysstop..github/workflows/judge.yml, a reusable workflow with two jobs:judgehas onlycontents: read. It fetches the base and head as git objects and installs the judge atjudge-reffromrequirements.lock: hash-locked wheels, exported fromuv.lock. It clonescases-repooutside the repository usingMORPHOGEN_CASES_TOKEN, then runsmorphogen prin docker or podman. Afterwards it removes the private material and uploads the verdict and the evidence records.posthasstatusesandid-token. It signs the verdict with cosign (keyless by default) and postsmorphogen/verdicton 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: wideningchangein the catalog (with a target and without one), editing only the catalog, deleting it, committing amorphogen.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 thatrequirements.lockmatchesuv.lock.Guarantees, old against new
rules_config,structure_of); main's own workflow, viapull_request_targetmorphogen.local.yamlrefused by the judge (default deny); the caller'sprotectedglobs refused bymorphogen pr$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: nonerefusedmorphogen/verdictfrom the Actions token or the App, stop on any failure; the evidence records (hash chain) kept as an artifactWeaker 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_hiddenguarantee. There is also no served-case count and no sealed case sets yet.Not changed
dogfood/and.github/workflows/morphogen.ymlstill calljudge.yml@b921c9b. Moving them is not yet safe: main has nocatalog-info.yamlfor the toy, and its held-out cases are in the rebuild-8 store format. Because this PR touches.github/**andmorphogen/**, 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).actionlint1.7.12 withshellcheck0.11.0 (both installed from PyPI): clean.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.🤖 Generated with Claude Code
https://claude.ai/code/session_01KhsqyvvvxYb2257ynXFbe9