diff --git a/.github/workflows/judge.yml b/.github/workflows/judge.yml new file mode 100644 index 0000000..c5e7883 --- /dev/null +++ b/.github/workflows/judge.yml @@ -0,0 +1,288 @@ +# The Morphogen judge for GitHub Actions, as a reusable workflow, reading the catalog (`spec.morphogen` on the +# entities of `catalog-info.yaml`). A caller runs it from its own `pull_request_target` workflow, so the definition +# that runs is the base's: a pull request cannot edit what judges it. Judgement is the package's own +# (`morphogen pr`, which hands the judge a request, morphogen/request.py); this file only fetches, supplies and posts. +# +# judge fetches base and head as git objects (the candidate is never checked out here; the judge makes its own +# worktrees), installs the judge at `judge-ref` from hash-locked wheels, clones the operator's private +# material (morphogen.local.yaml and the held-out answers it names) outside the repository, and runs +# `morphogen pr`: rules from the base commit, a candidate that changes a catalog file refused, every candidate +# command in a container with no network that sees only the candidate's tree (never `sandbox: none`), the +# answers given only to the base's scorer. Its token can only read. +# post signs the verdict (Sigstore), posts `morphogen/verdict` on the head commit and keeps the verdict and the +# evidence records as artifacts. A judge that failed is posted as a stop, never a pass. +name: morphogen-judge +on: + workflow_call: + inputs: + judge-ref: + description: The Morphogen commit to judge with. Must equal the commit in the caller's `uses:` line. + required: true + type: string + cases-repo: + description: owner/name of the repository holding the operator's private material (MORPHOGEN_CASES_TOKEN must read it). Empty means none. + required: false + type: string + default: "" + cases-branch: + required: false + type: string + default: main + cases-dir: + description: The directory in cases-repo holding morphogen.local.yaml; relative paths in that file are read from there. + required: false + type: string + default: "." + sandbox: + description: Where candidates run, `docker` or `podman` (both on GitHub's Ubuntu runners). `none` is refused. + required: false + type: string + default: docker + protected: + description: Globs (space or newline separated) no pull request may change, beyond the catalog files, which the judge always refuses. + required: false + type: string + default: ".github/**" + verdict-poster: + description: "Who posts `morphogen/verdict`. `actions`: the workflow token (anyone with write access can post the same status). `app`: a GitHub App only the judge holds the key of; require the status from that app in the ruleset." + required: false + type: string + default: actions + signing: + description: "`keyless`: the workflow's OIDC identity, logged in the public Sigstore transparency log. `key`: a cosign key pair held in the environment." + required: false + type: string + default: keyless + timeout-minutes: + description: The judge job's limit (GitHub-hosted runners stop at 360). + required: false + type: number + default: 360 + # Callers pass these with `secrets: inherit` (on the morphogen-judge environment or the repository). + secrets: + MORPHOGEN_CASES_TOKEN: + description: Reads cases-repo. Needed unless cases-repo is this repository. + required: false + MORPHOGEN_COSIGN_KEY: + required: false + MORPHOGEN_COSIGN_PASSWORD: + required: false + MORPHOGEN_APP_CLIENT_ID: + description: "The judge's GitHub App client ID (with verdict-poster app)." + required: false + MORPHOGEN_APP_KEY: + description: "The judge's GitHub App private key (with verdict-poster app)." + required: false + +permissions: {} + +concurrency: + group: morphogen-judge-${{ github.repository }}-${{ github.event.pull_request.number }} + cancel-in-progress: true + +env: + PR: ${{ github.event.pull_request.number }} + HEAD_SHA: ${{ github.event.pull_request.head.sha }} + BASE_REF: ${{ github.event.pull_request.base.ref }} + +jobs: + judge: + if: github.event_name == 'pull_request_target' + runs-on: ubuntu-24.04 + timeout-minutes: ${{ inputs.timeout-minutes }} + environment: morphogen-judge + permissions: + contents: read + outputs: + verdict: ${{ steps.judge.outputs.verdict }} + steps: + - name: Check the inputs + env: + SANDBOX: ${{ inputs.sandbox }} + POSTER: ${{ inputs.verdict-poster }} + SIGNING: ${{ inputs.signing }} + CASES_DIR: ${{ inputs.cases-dir }} + run: | + case "$SANDBOX" in docker|podman) ;; *) echo "::error::sandbox must be docker or podman: without a container a candidate can read the held-out answers"; exit 1;; esac + case "$POSTER" in app|actions) ;; *) echo "::error::verdict-poster must be app or actions"; exit 1;; esac + case "$SIGNING" in keyless|key) ;; *) echo "::error::signing must be keyless or key"; exit 1;; esac + case "/$CASES_DIR/" in */../*|//*) echo "::error::cases-dir must be a relative path inside cases-repo"; exit 1;; esac + - name: Get the judge + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + repository: openreplicant/morphogen + ref: ${{ inputs.judge-ref }} + path: .judge + persist-credentials: false + - name: Install the judge (a venv; hash-locked wheels only) + run: | + python3 -m venv "$RUNNER_TEMP/mg" + "$RUNNER_TEMP/mg/bin/pip" install --quiet --only-binary=:all: --require-hashes -r .judge/requirements.lock + - name: Fetch base and head as git objects (nothing is checked out; the judge makes its own worktrees) + env: + GIT_TOKEN: ${{ github.token }} + run: | + set -eu + auth="http.extraHeader=Authorization: Basic $(printf 'x-access-token:%s' "$GIT_TOKEN" | base64 -w0)" + git init -q repo + git -C repo -c "$auth" -c fetch.fsckObjects=true fetch -q --no-tags "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY.git" \ + "+refs/heads/$BASE_REF:refs/morphogen/base" "+refs/pull/$PR/head:refs/morphogen/head" + got=$(git -C repo rev-parse refs/morphogen/head) + if [ "$got" != "$HEAD_SHA" ]; then + echo "::error::the pull request moved ($got, not $HEAD_SHA); the run for its new head judges it"; exit 1 + fi + echo "base $(git -C repo rev-parse refs/morphogen/base), head $got" + - name: Fetch the operator's private material, outside the repository + if: inputs.cases-repo != '' + env: + CASES_TOKEN: ${{ secrets.MORPHOGEN_CASES_TOKEN }} + REPO_TOKEN: ${{ github.token }} + CASES_REPO: ${{ inputs.cases-repo }} + CASES_BRANCH: ${{ inputs.cases-branch }} + run: | + set -eu + # The workflow's own token only ever reaches this repository; another one needs the case token. + if [ -z "$CASES_TOKEN" ]; then + if [ "$CASES_REPO" != "$GITHUB_REPOSITORY" ]; then + echo "::error::MORPHOGEN_CASES_TOKEN is not available to this job; the caller must pass secrets (secrets: inherit)"; exit 1 + fi + CASES_TOKEN="$REPO_TOKEN" + fi + git -c "http.extraHeader=Authorization: Basic $(printf 'x-access-token:%s' "$CASES_TOKEN" | base64 -w0)" \ + clone -q --depth 1 --single-branch --branch "$CASES_BRANCH" "$GITHUB_SERVER_URL/$CASES_REPO.git" "$RUNNER_TEMP/cases" + rm -rf "$RUNNER_TEMP/cases/.git" + - id: judge + name: Judge (morphogen pr; the rules from the base commit) + env: + PYTHONPATH: ${{ github.workspace }}/.judge + PR_BODY: ${{ github.event.pull_request.body }} + SANDBOX: ${{ inputs.sandbox }} + PROTECTED: ${{ inputs.protected }} + CASES_DIR: ${{ inputs.cases-dir }} + JUDGE_REF: ${{ inputs.judge-ref }} + run: | + set +e -u # a fail is a verdict to keep and post, not a failed step (GitHub runs bash -e) + mkdir -p "$RUNNER_TEMP/out" + set -- --base refs/morphogen/base --head "$HEAD_SHA" --sandbox "$SANDBOX" --pull --body-env PR_BODY \ + --out "$RUNNER_TEMP/out/verdict.json" --label "repository=$GITHUB_REPOSITORY" --label "pull_request=$PR" \ + --label "run=$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" --label "judge=$JUDGE_REF" + local_file="$RUNNER_TEMP/cases/$CASES_DIR/morphogen.local.yaml" + if [ -f "$local_file" ]; then set -- "$@" --local "$local_file"; fi + set -f # the globs are the judge's to match, not the shell's + for g in $PROTECTED; do set -- "$@" --protect "$g"; done + set +f + cd repo + # -P: nothing from the working directory shadows the judge's modules. + "$RUNNER_TEMP/mg/bin/python" -P -m morphogen pr "$@" + code=$? + "$RUNNER_TEMP/mg/bin/python" -P -m morphogen evidence --limit 100000 > "$RUNNER_TEMP/out/evidence.json" || true + "$RUNNER_TEMP/mg/bin/python" -P -m morphogen evidence --verify > "$RUNNER_TEMP/out/evidence-verify.json" || true + echo "verdict=$(jq -r .verdict "$RUNNER_TEMP/out/verdict.json")" >> "$GITHUB_OUTPUT" + echo "exit $code" + [ "$code" -le 1 ] # 0 pass, 1 fail: both are verdicts; 2 is a stop + - name: Remove the private material + if: always() + run: rm -rf "$RUNNER_TEMP/cases" + - if: always() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: verdict + path: ${{ runner.temp }}/out + if-no-files-found: ignore + retention-days: 90 + + post: + # Sign and post whatever the judge said; when the judge itself failed, a `stop`, never a pass, and never silence. + needs: judge + if: always() && github.event_name == 'pull_request_target' + runs-on: ubuntu-24.04 + environment: morphogen-judge + permissions: + statuses: write + id-token: write # keyless signing: the verdict is signed by this workflow's identity + steps: + - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2 + continue-on-error: true + with: + name: verdict + path: art + - name: Read the verdict + env: + JUDGE_RESULT: ${{ needs.judge.result }} + run: | + set -eu + f=art/verdict.json + if [ "$JUDGE_RESULT" != success ] || [ ! -f "$f" ]; then + why=$(jq -r '.summary // empty' "$f" 2>/dev/null || true) + jq -n --arg s "stop: the judge failed (judge=$JUDGE_RESULT)${why:+; $why}" --arg h "$HEAD_SHA" \ + '{morphogen:"pr-verdict/v1", verdict:"stop", judged:false, head:$h, summary:$s}' > verdict.json + else + cp "$f" verdict.json + v=$(jq -r .verdict verdict.json); h=$(jq -r '.head // empty' verdict.json) + case "$v" in pass|fail|not-judged|stop) ;; *) echo "::error::unknown verdict $v"; exit 1;; esac + if [ -n "$h" ] && [ "$h" != "$HEAD_SHA" ]; then echo "::error::the verdict is for $h, not $HEAD_SHA"; exit 1; fi + fi + cp art/evidence.json evidence.json 2>/dev/null || echo '[]' > evidence.json + - uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2 + with: + cosign-release: v3.1.4 + - name: Sign + env: + SIGNING: ${{ inputs.signing }} + COSIGN_KEY: ${{ secrets.MORPHOGEN_COSIGN_KEY }} + COSIGN_PASSWORD: ${{ secrets.MORPHOGEN_COSIGN_PASSWORD }} + run: | + if [ "$SIGNING" = keyless ]; then + cosign sign-blob --yes --bundle verdict.sigstore.json verdict.json + else + umask 077 && printf '%s' "$COSIGN_KEY" > "$RUNNER_TEMP/k" + echo '{"mediaType":"application/vnd.dev.sigstore.signingconfig.v0.2+json","rekorTlogConfig":{},"tsaConfig":{}}' > "$RUNNER_TEMP/sc.json" + cosign sign-blob --yes --key "$RUNNER_TEMP/k" --signing-config "$RUNNER_TEMP/sc.json" --bundle verdict.sigstore.json verdict.json + rm -f "$RUNNER_TEMP/k" + fi + - id: app + name: Get the judge's GitHub App token (statuses only) + if: inputs.verdict-poster == 'app' + uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0 + with: + client-id: ${{ secrets.MORPHOGEN_APP_CLIENT_ID }} + private-key: ${{ secrets.MORPHOGEN_APP_KEY }} + permission-statuses: write + - name: Post the verdict + env: + GH_TOKEN: ${{ inputs.verdict-poster == 'app' && steps.app.outputs.token || github.token }} + run: | + set -eu + v=$(jq -r .verdict verdict.json) + case "$v" in pass|not-judged) state=success;; *) state=failure;; esac + body=$(jq --arg st "$state" --arg u "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + '{state:$st, context:"morphogen/verdict", description:(.summary // .verdict)[0:138], target_url:$u}' verdict.json) + curl -fsS -o /dev/null -X POST -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github+json" \ + -d "$body" "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$HEAD_SHA" + echo "posted morphogen/verdict=$state ($v)" + { + echo "## Morphogen: $(jq -r '.summary // .verdict' verdict.json)" + echo + jq -r '"- base `\(.base // "?")`, head `\(.head // "?")`, judged `\(.candidate // "?")`\(if .merged then " (head merged onto base)" else "" end)", + "- gate: \(.gate.decision // "none")", + (.reasons // [] | .[] | "- \(.)")' verdict.json + } >> "$GITHUB_STEP_SUMMARY" + - name: Post a stop if posting the verdict failed + if: failure() + env: + GH_TOKEN: ${{ steps.app.outputs.token || github.token }} + run: | + body=$(jq -n --arg u "$GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID" \ + '{state:"failure", context:"morphogen/verdict", description:"stop: the judge could not sign or post its verdict", target_url:$u}') + curl -fsS -o /dev/null -X POST -H "Authorization: Bearer $GH_TOKEN" -H "Accept: application/vnd.github+json" \ + -d "$body" "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/statuses/$HEAD_SHA" + - if: always() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 + with: + name: verdict-signed + path: | + verdict.json + verdict.sigstore.json + evidence.json + if-no-files-found: ignore + retention-days: 90 diff --git a/CLAUDE.md b/CLAUDE.md index 26f5843..ffb1ce4 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -10,7 +10,7 @@ docs/restart/LESSONS.md. `otel`), `project.py` (the cell format: `spec.morphogen` on the catalog's entities, default deny), `backstage.py` (the catalog: `catalog-info.yaml` and its Location targets, read into cells, interfaces and settings), `status.py` (where a project stands and the next step), - `documents.py` (the project's settings, from the System's `spec.morphogen`, and the target spec a cell compiles to), `request.py` (one document in, one verdict out), `intake.py` (the judge held by another user: a candidate arrives as a git bundle), `cli.py`, `mcp_server.py`, `ui.py` and `ui.html` (the read-only web UI). + `documents.py` (the project's settings, from the System's `spec.morphogen`, and the target spec a cell compiles to), `request.py` (one document in, one verdict out), `pullrequest.py` (`morphogen pr`: a pull request as the GitHub judge, `.github/workflows/judge.yml`, hands it to the judge as a request), `intake.py` (the judge held by another user: a candidate arrives as a git bundle), `cli.py`, `mcp_server.py`, `ui.py` and `ui.html` (the read-only web UI). - `.claude-plugin/`, `skills/`, `agents/`: the Claude Code plugin around the MCP server. Skills (the kit): `morphogen` (improve a cell), `map` (take a system apart into Backstage entity files and draft cells), `catalog` and `research` (options for a role, as `lifecycle: candidate` Components). `schemas/morphogen-spec.v1.json` diff --git a/README.md b/README.md index 439220b..23fd70d 100644 --- a/README.md +++ b/README.md @@ -296,6 +296,8 @@ uv run morphogen measure cell:classify uv run morphogen judge cell:classify my-branch uv run morphogen change my-branch # a change that claims no improvement: its cells' tests uv run morphogen request /outside/request.yaml # one document: what to judge, and the operator's settings +uv run morphogen pr --base main --head HEAD --sandbox podman --local /outside/morphogen.local.yaml --out v.json + # a pull request, as the GitHub judge runs it uv run morphogen tune cell:classify # the selector chooses optimizers uv run morphogen optimizers # the catalog uv run morphogen evidence --verify @@ -429,6 +431,46 @@ that commit the base and be judged by them. Rootless Podman keeps images and containers per user, so the judge needs the sandbox image, any service images and its own model gateway in its own store. +## On GitHub: the judge as a reusable workflow + +`.github/workflows/judge.yml` judges every pull request into your main branch by the catalog on main. Your repository +needs only `catalog-info.yaml`; the operator's private material (a `morphogen.local.yaml` naming the held-out answers, +inputs, env file and services, with the directories it names) lives in a private repository the workflow clones +outside your checkout. Call it from a `pull_request_target` workflow, so the definition that runs is main's: + +```yaml +name: morphogen +on: + pull_request_target: + branches: [main] + types: [opened, synchronize, reopened, edited] +permissions: {} +jobs: + judge: + uses: OpenReplicant/Morphogen/.github/workflows/judge.yml@COMMIT # pin by commit + permissions: {contents: read, statuses: write, id-token: write} + secrets: inherit # MORPHOGEN_CASES_TOKEN, and the App's keys with verdict-poster: app + with: + judge-ref: COMMIT # the same commit + cases-repo: you/your-judge-material # holds DIR/morphogen.local.yaml and what it names + cases-dir: your-project # paths in that file are relative to it + protected: ".github/** .morphogen/**" # beyond the catalog files, which are always refused + sandbox: docker # or podman; never none + verdict-poster: app # or actions +``` + +The `judge` job holds only a read token. It fetches main and the pull request's head as git objects (nothing of the +candidate is checked out by the workflow), installs the judge at `judge-ref` from hash-locked wheels +(`requirements.lock`, exported from `uv.lock`), clones the private material, and runs `morphogen pr`, which hands the +judge a request (above) and so keeps every rule it keeps: the rules from main as it is now (a branch behind main is +judged merged onto it), a candidate that changes a catalog file or `morphogen.local.yaml` refused, every candidate +command in a container with no network that sees only the candidate's tree, the answers given only to main's scorer. +A pull request that touches no file any cell may change, and no rule file, is a pass (not judged); one that touches a +`protected` path is refused. Name the cell to judge with a line `morphogen-target: cell:NAME` in the pull request's +description; without one, the change is judged as one that claims no improvement (`morphogen change`). The `post` +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. + ## What the judge guarantees - **The rules are the base's.** The catalog files and everything a cell's `change` does not name come diff --git a/morphogen/cli.py b/morphogen/cli.py index e22f489..787e424 100644 --- a/morphogen/cli.py +++ b/morphogen/cli.py @@ -5,6 +5,7 @@ morphogen measure TARGET [--ref main] morphogen judge TARGET CANDIDATE [--base main] morphogen request FILE # one document: what to judge, and the operator's local settings + morphogen pr --base B --head H --sandbox docker --out FILE # a pull request, as the GitHub judge runs it morphogen tune TARGET [--optimizer NAME] [--steps N] [--trials N] morphogen optimizers morphogen evidence [--verify] [--limit N] [--by judge] @@ -118,6 +119,11 @@ def cmd_request(a) -> int: return 0 if r.get("verdict", "pass") == "pass" else 1 +def cmd_pr(a) -> int: + from .pullrequest import main as pr_main + return pr_main(a) + + def cmd_intake(a) -> int: from . import intake home = Path(a.home) if a.home else Path.home() @@ -208,6 +214,24 @@ def main(argv: list[str] | None = None) -> int: rq.add_argument("file", help="a request/v1 document, outside the repository") rq.set_defaults(fn=cmd_request) + pr = sub.add_parser("pr", help="judge a pull request without a person at the keyboard (the GitHub judge): " + "not judged, refused, or a request to the judge; the verdict document always written to --out") + pr.add_argument("--base", required=True, help="the base: where the rules come from") + pr.add_argument("--head", required=True, help="the pull request's head commit") + pr.add_argument("--sandbox", required=True, choices=["podman", "docker", "none"], + help="where candidates run; none only with --unsandboxed") + pr.add_argument("--local", help="the operator's morphogen.local.yaml, outside the repository (held-out answers, " + "inputs, env, services); relative paths in it are read from its directory") + pr.add_argument("--target", help="what to judge (cell:NAME); else a `morphogen-target:` line in --body-env, " + "else the change is judged as one that claims no improvement") + pr.add_argument("--body-env", help="an environment variable holding the pull request's description") + pr.add_argument("--protect", action="append", help="a glob no pull request may change (repeatable)") + pr.add_argument("--label", action="append", help="KEY=VALUE recorded with the verdict, never deciding it") + pr.add_argument("--pull", action="store_true", help="pull the sandbox image before any run") + pr.add_argument("--unsandboxed", action="store_true", help="allow --sandbox none (tests and local trials only)") + pr.add_argument("--out", required=True, help="where to write the pr-verdict/v1 document") + pr.set_defaults(fn=cmd_pr) + it = sub.add_parser("intake", help="the judge held by another user: judge the candidate bundled on standard " "input by a request that user keeps, or (the owner's) advance its base") it.add_argument("action", choices=["judge", "advance"]) diff --git a/morphogen/pullrequest.py b/morphogen/pullrequest.py new file mode 100644 index 0000000..edec284 --- /dev/null +++ b/morphogen/pullrequest.py @@ -0,0 +1,245 @@ +"""A pull request, judged without a person at the keyboard: what the GitHub judge (.github/workflows/judge.yml) runs. + + morphogen pr --base BASE --head HEAD --sandbox docker [--local FILE] [--target cell:NAME | --body-env VAR] + [--protect GLOB ...] [--label KEY=VALUE ...] [--pull] --out verdict.json + +It decides nothing itself. It works out what to hand the judge, writes it as a request (request.py) outside the +repository, and runs that request, so every rule the judge keeps holds here unchanged: the rules come from the base +commit, a candidate that changes a catalog file is refused, the held-out answers go only to the base's scorer. + +- The candidate is HEAD when BASE is one of its ancestors, otherwise HEAD merged onto BASE (git merge-tree, nothing + checked out), so the rules are always those of BASE as it is now and the diff is only the pull request's. +- A pull request that touches a `--protect` path (the caller's workflows, say) is refused before anything runs. +- One that touches no file any cell may change, and no rule file, is not judged: there is nothing to measure, and + nothing of the judge's changes. +- Otherwise it is judged: `kind: judge` on the target the caller names (`--target`, or a line + `morphogen-target: cell:NAME` in the pull request's description), else `kind: change` (the tests of everything the + change touches, by default deny). +- `--local` is the operator's morphogen.local.yaml (held-out answer paths, inputs, env, services), from wherever the + operator keeps it (a private repository); relative paths in it are read from its own directory. It may carry no + rules: anything a request's `local` does not take is refused. `--sandbox` replaces its sandbox; `none` is refused + unless `--unsandboxed` (tests and trials on your own machine: without a container a candidate can read the answers). + +The verdict document (`pr-verdict/v1`) holds the decision, the judge's whole result and the evidence record, and is +written to `--out` whatever happens: a judge that cannot judge writes `stop`, never a pass. +""" + +from __future__ import annotations + +import json +import os +import re +import subprocess +import tempfile +from pathlib import Path + +import yaml +from pydantic import ValidationError + +from . import judge as judge_mod +from .documents import DocumentError +from .errors import JudgeError +from .project import FILE, LOCAL, ProjectError, _glob_re +from .request import Local, run as run_request +from .runner import RUNNERS + +VERSION = "pr-verdict/v1" +TARGET_LINE = re.compile(r"^[ \t>]*morphogen-target:[ \t]*(\S+)[ \t]*$", re.MULTILINE) +SANDBOXES = ("podman", "docker", "none") + + +class PullRequestError(JudgeError): + """What the caller handed over cannot be judged as it is.""" + + +def _git(repo: Path, *args: str, env: dict | None = None, check: bool = True) -> subprocess.CompletedProcess: + r = subprocess.run(["git", *args], cwd=repo, capture_output=True, text=True, + env={**os.environ, **(env or {})}) + if check and r.returncode != 0: + raise PullRequestError(f"git {args[0]}: {r.stderr.strip()[-300:]}") + return r + + +def target_from(body: str | None) -> str | None: + """The target a pull request's description names, on a line `morphogen-target: cell:NAME`, or None.""" + found = sorted(set(TARGET_LINE.findall(body or ""))) + if len(found) > 1: + raise PullRequestError(f"the description names {len(found)} targets ({', '.join(found)}); name one") + return found[0] if found else None + + +def candidate_of(repo: Path, base_sha: str, head_sha: str) -> tuple[str, bool]: + """(the commit to judge, whether it is a merge made here). HEAD itself when BASE is its ancestor; otherwise HEAD + merged onto BASE without a checkout, so the rules are the current base's and the diff is only HEAD's.""" + if _git(repo, "merge-base", "--is-ancestor", base_sha, head_sha, check=False).returncode == 0: + return head_sha, False + m = _git(repo, "merge-tree", "--write-tree", "--no-messages", base_sha, head_sha, check=False) + if m.returncode != 0: + raise PullRequestError(f"{head_sha[:12]} does not merge cleanly onto {base_sha[:12]}: update the branch") + tree = m.stdout.split()[0] + who = {"GIT_AUTHOR_NAME": "morphogen", "GIT_AUTHOR_EMAIL": "judge@invalid", + "GIT_COMMITTER_NAME": "morphogen", "GIT_COMMITTER_EMAIL": "judge@invalid"} + sha = _git(repo, "commit-tree", tree, "-p", base_sha, "-p", head_sha, "-m", + f"morphogen: {head_sha[:12]} merged onto {base_sha[:12]}", env=who).stdout.strip() + return sha, True + + +def local_from(path: Path | None, sandbox: str) -> dict: + """The operator's local settings as a request's `local`: relative paths resolved against the file's directory, + the sandbox replaced. Anything a request's `local` does not take (a rule, a cell's `change`) is refused.""" + data: dict = {} + if path is not None: + path = Path(path) + try: + data = yaml.safe_load(path.read_text()) or {} + except (OSError, yaml.YAMLError) as e: + raise DocumentError(path, [f"cannot read: {e}"]) from None + if not isinstance(data, dict): + raise DocumentError(path, ["the local settings are a mapping"]) + here = path.resolve().parent + + def at(p): + return str((here / Path(p).expanduser()).resolve()) if isinstance(p, str) else p + for cell in (data.get("cells") or {}).values(): + if isinstance(cell, dict): + for k in ("private", "search", "inputs"): + if cell.get(k): + cell[k] = at(cell[k]) + if isinstance(data.get("env"), dict) and data["env"].get("file"): + data["env"]["file"] = at(data["env"]["file"]) + data["sandbox"] = sandbox + try: + return Local.model_validate(data).model_dump(exclude_none=True) + except ValidationError as e: + problems = [f"{'.'.join(map(str, err['loc']))}: " + ("not a local setting (the rules come from the base " + "commit)" if err["type"] == "extra_forbidden" else err["msg"]) for err in e.errors()] + raise DocumentError(path or "local", problems) from None + + +def _base_project(repo: Path, base_sha: str): + """The base's catalog (read from the commit, never a working copy), or None when the base has none.""" + from .project import Project, git_reader, read_catalog + reader = git_reader(repo, base_sha) + try: + reader(FILE) + except OSError: + return None + try: + cells, ifaces, origin, settings, files = read_catalog(reader, [FILE]) + return Project.from_parts(cells, ifaces, origin, settings, files, f"{base_sha[:12]}:{FILE}") + except ProjectError as e: + raise JudgeError(f"{FILE} on the base commit: {e}") from None + + +def _pull(repo: Path, base_sha: str, local: dict) -> None: + """Fetch the sandbox image (the base's, or the operator's) before any run, so no run waits on the network.""" + from .documents import rules_config + mode = local["sandbox"] + if mode == "none": + return + settings = {k: local[k] for k in ("sandbox", "sandbox_image") if k in local} + image = rules_config(repo, base_sha, {"local": {"cells": {}, "settings": settings}})["sandbox_image"] + r = subprocess.run([mode, "pull", "--quiet", image], capture_output=True, text=True) + if r.returncode != 0: + raise JudgeError(f"{mode} pull {image}: {r.stderr.strip()[-300:]}") + + +def _summary(doc: dict) -> str: + v, why = doc["verdict"], "; ".join(doc.get("reasons") or []) + head = {"pass": "pass", "fail": "fail", "not-judged": "pass (not judged)", "stop": "stop"}[v] + what = doc.get("target") or ("change" if doc.get("kind") == "change" else "") + line = f"{head}{' ' + what if what else ''}{': ' + why if why else ''}" + return line if len(line) <= 138 else line[:137] + "…" + + +def judge_pr(repo: Path, base: str, head: str, *, sandbox: str, local_file: Path | None = None, + target: str | None = None, body: str | None = None, protect: list[str] = (), + labels: dict[str, str] | None = None, unsandboxed: bool = False, pull: bool = False, + workdir: Path | None = None) -> dict: + """Judge HEAD against BASE as the GitHub judge does; the pr-verdict/v1 document.""" + if sandbox not in SANDBOXES: + raise PullRequestError(f"sandbox must be one of {', '.join(SANDBOXES)}") + if sandbox == "none" and not unsandboxed: + raise PullRequestError("sandbox none lets a candidate read the held-out answers; the GitHub judge runs every " + "candidate in a container (podman or docker)") + repo = judge_mod.repo_root(Path(repo)) + base_sha, head_sha = judge_mod.resolve(repo, base), judge_mod.resolve(repo, head) + target = target or target_from(body) + local = local_from(local_file, sandbox) + cand_sha, merged = candidate_of(repo, base_sha, head_sha) + doc = {"morphogen": VERSION, "base": base_sha, "head": head_sha, "candidate": cand_sha, "merged": merged, + "target": target, "kind": None, "judged": False, "labels": dict(labels or {})} + changed = judge_mod._changed(repo, base_sha, cand_sha) + proj = _base_project(repo, base_sha) + protected = sorted(p for p in changed if any(_glob_re(g).match(p) for g in protect)) + rules = sorted(p for p in changed if p in (FILE, LOCAL) or (proj is not None and p in proj.rule_files)) + if protected: + from .evidence import Evidence + rec = Evidence.for_project(repo).append({ + "claim": f"pull request {head_sha[:12]} against {base_sha[:12]} is refused: it changes protected paths", + "kind": "verdict", "verdict": "fail", "subject": {"system": "", "path": "pull-request"}, + "method": "the caller's protected paths, from the base's workflow; refused before anything runs", + "outcome": {"protected": protected, "changed": changed}, + "refs": {"base": base_sha, "candidate": cand_sha}, "gate": {"decision": "none"}, + "sandbox": sandbox, "runner": {"runner": sandbox, **RUNNERS[sandbox]}, + "labels": doc["labels"], "trust": "measured", "by": "judge"}) + doc.update(verdict="fail", judged=True, reasons=[f"changes protected paths: {', '.join(protected)}"], + gate={"decision": "none"}, evidence=rec) + return {**doc, "summary": _summary(doc)} + if proj is None: + if rules: + doc.update(verdict="fail", judged=True, gate={"decision": "none"}, + reasons=[f"adds {FILE} to a base that has none: the first catalog reaches the base by review"]) + else: + doc.update(verdict="not-judged", reasons=[f"no {FILE} on the base: nothing to judge by"]) + return {**doc, "summary": _summary(doc)} + owned = [p for p in changed if any(proj.allows([c], p) for c in proj.doc.cells)] + if not changed or not (owned or rules): + doc.update(verdict="not-judged", reasons=["changes no file a cell may change, and no rule file"] + if changed else ["changes nothing"]) + return {**doc, "summary": _summary(doc)} + + kind = "judge" if target else "change" + request = {"morphogen": "request/v1", "kind": kind, "project": str(repo), "base": base_sha, + "candidate": cand_sha, "labels": doc["labels"], "local": local, + **({"target": target} if target else {})} + if pull: + _pull(repo, base_sha, local) + with tempfile.TemporaryDirectory(prefix="morphogen-pr-", dir=workdir) as t: + f = Path(t) / "request.yaml" # outside the repository: request.load refuses one inside it + f.write_text(yaml.safe_dump(request, sort_keys=True)) + result = run_request(f) + from .evidence import Evidence + rec = next((r for r in reversed(Evidence.for_project(repo).dump()) if r.get("seq") == result.get("evidence_seq")), + None) + doc.update(verdict=result["verdict"], judged=True, kind=kind, reasons=result.get("reasons") or [], + gate=result.get("gate"), result=result, evidence=rec) + return {**doc, "summary": _summary(doc)} + + +def main(a) -> int: + """`morphogen pr`: write the verdict document to --out whatever happens; exit 0 on a pass (judged or not), + 1 on a fail, 2 when the judge could not judge (a `stop`).""" + out = Path(a.out) + labels = {} + for item in a.label or []: + k, sep, v = item.partition("=") + if not sep or not k: + raise PullRequestError(f"a label is KEY=VALUE, not {item!r}") + labels[k] = v + try: + doc = judge_pr(Path.cwd(), a.base, a.head, sandbox=a.sandbox, local_file=Path(a.local) if a.local else None, + target=a.target, body=os.environ.get(a.body_env) if a.body_env else None, + protect=a.protect or [], labels=labels, unsandboxed=a.unsandboxed, pull=a.pull) + code = 0 if doc["verdict"] in ("pass", "not-judged") else 1 + except (JudgeError, DocumentError, ProjectError, KeyError, LookupError, RuntimeError) as e: + doc = {"morphogen": VERSION, "verdict": "stop", "judged": False, "reasons": [f"the judge could not judge: {e}"]} + doc["summary"] = _summary(doc) + code = 2 + out.parent.mkdir(parents=True, exist_ok=True) + out.write_text(json.dumps(doc, indent=2, default=str, sort_keys=True) + "\n") + print(doc["summary"]) + return code + + +__all__ = ["VERSION", "PullRequestError", "judge_pr", "target_from", "candidate_of", "local_from", "main"] diff --git a/requirements.lock b/requirements.lock new file mode 100644 index 0000000..03aca22 --- /dev/null +++ b/requirements.lock @@ -0,0 +1,577 @@ +# This file was autogenerated by uv via the following command: +# uv export --frozen --no-dev --no-emit-project --format requirements-txt -o requirements.lock +annotated-types==0.8.0 \ + --hash=sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7 \ + --hash=sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0 + # via pydantic +anyio==4.16.0 \ + --hash=sha256:59bb03251907983d1603d27c3087ddb1e93299ea2163adcdba37899a4fb12ffb \ + --hash=sha256:c66ae634e0b8228396b801741beb3294326d4b6102f7bba4041c0dfb58c29026 + # via + # httpx2 + # mcp + # sse-starlette + # starlette +attrs==26.1.0 \ + --hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \ + --hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32 + # via + # jsonschema + # referencing +cffi==2.1.1 ; platform_python_implementation != 'PyPy' \ + --hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \ + --hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \ + --hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \ + --hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \ + --hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \ + --hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \ + --hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \ + --hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \ + --hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \ + --hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \ + --hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \ + --hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \ + --hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \ + --hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \ + --hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \ + --hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \ + --hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \ + --hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \ + --hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \ + --hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \ + --hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \ + --hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \ + --hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \ + --hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \ + --hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \ + --hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \ + --hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \ + --hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \ + --hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \ + --hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \ + --hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \ + --hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \ + --hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \ + --hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \ + --hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \ + --hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \ + --hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \ + --hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \ + --hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \ + --hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \ + --hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \ + --hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \ + --hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \ + --hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \ + --hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \ + --hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \ + --hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \ + --hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \ + --hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \ + --hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \ + --hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \ + --hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \ + --hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \ + --hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \ + --hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \ + --hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \ + --hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \ + --hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \ + --hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \ + --hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \ + --hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \ + --hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \ + --hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \ + --hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \ + --hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \ + --hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \ + --hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \ + --hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \ + --hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \ + --hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \ + --hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \ + --hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \ + --hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \ + --hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \ + --hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \ + --hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \ + --hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \ + --hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \ + --hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \ + --hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \ + --hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \ + --hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \ + --hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \ + --hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \ + --hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \ + --hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 \ + --hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \ + --hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264 + # via cryptography +click==8.5.0 ; sys_platform != 'emscripten' \ + --hash=sha256:255bc9599cf7748b4b1a446ccc735421bd08a2ae529a8b88597d3de5664ee360 \ + --hash=sha256:ba0d2089de75ea0310e2dde03160e6ca10009947fb95a182f9b54021bb272e34 + # via uvicorn +cryptography==50.0.2 \ + --hash=sha256:0ddc924c04591c2811ca024d62ecad4f7f6f08af8939c211438f48a16bd23602 \ + --hash=sha256:0ec5f09541743261e66e291b4a0cbf0fb2997aeaab6d9e9c740b9dba1b58d1c2 \ + --hash=sha256:0ecbc5652bdb6fc9eaf89a7d196e20941adfe812f43bc4ca05d9150496821047 \ + --hash=sha256:1981f1db4630889b9ef7803fadef12b056f428cb6b85c27ba57b774793b6093c \ + --hash=sha256:1ba34f04897fcdaa73f74145c25f3ec146fbd56593853e88adc2e811303c5f42 \ + --hash=sha256:241449bf940a5d27309bd317e6f9a2af6932113818bb2b8f5c59ddc7ef16da18 \ + --hash=sha256:25784ce8b9621c90c643efb9e1e2162ab3b0224cae446ad5e70e7fcb1ce18b51 \ + --hash=sha256:3dc4fd8058cea1644971207d530e1a03a184a805ffc8ebdddf0599d78a331b81 \ + --hash=sha256:4061c0079120205fb760c58acab6443e217307dcf05e3702cf970e0689972856 \ + --hash=sha256:4a20ce1e5cb4284a86692fdcba7cb8754185c6b2e5c56fcef3751cf451d3cdc2 \ + --hash=sha256:4e81d95e5bafc2d6e34e4bed780e53e4d5b9a2f928573428aa4d35fbec1eb0de \ + --hash=sha256:58a0c478eeca76fe5e07993c5a0703def34a6dc6a0cda4f5564639b33112ffe7 \ + --hash=sha256:58ddb5a8e3179d12f19e4ea34d2d32e9d63a4baa142c875c1eb59f41b7243acd \ + --hash=sha256:630ebfea3bf689d075f82316324ff7433dc447fe6bc1bfc76524b74b4a9567d2 \ + --hash=sha256:6f8700550aa1474a91e5dc07049c46f98b423b5b1ddd0483e0b51362eeeaf5be \ + --hash=sha256:78198641e5be9521beea5aa782bb551a58068d10e6eb04c9c680c1b69f2e7d45 \ + --hash=sha256:79def8d059362e7831389ed3be0ecdf58a89386e1271e35dd9f5af84e81bffd0 \ + --hash=sha256:7a8701d6b584d76e909e3d305b7d126b41439876a5aaf76cddc67fc230eafa2e \ + --hash=sha256:7afa5a6602a9f29af1f3a2965f831bae7c9d5d597b7cbb716d41ab3b7d89879c \ + --hash=sha256:7b46165bb56eb4704e2eaaf86f3c940d19154535d9b0ca7d6d590b04060e00d5 \ + --hash=sha256:7b75de3c8b3be1cdb1052747c929440c3eea46c1bc2cb8a6e3a48388e9b7b452 \ + --hash=sha256:7c6d0330c472d96f6a6afe24d80dfdf15176c33096f0a4397ae4c60f3dd3be48 \ + --hash=sha256:828d49b0ff5a0e3975865571c5d91dbbdd0d38d8289b249a163e9425413a5e05 \ + --hash=sha256:84f964e537f916e2cc85199e5a88742e964939b575ac8598b3f9d6cc416cdaf1 \ + --hash=sha256:85d0d9a31b9098e98534226d5686b47264b95e62ce459dc2e62fdfc809f9fe93 \ + --hash=sha256:87e9ce85beb6b328ba370cc6e6aea483c92617b4c95b1d33a49297eb662bfb04 \ + --hash=sha256:8c71ba2cd31fc93748c38e1b613200ff1c2665cbfd5341fe3a61cfde35a1430e \ + --hash=sha256:92e665960f25fcdc73725b9cec7a3824f279ba97a98653afe9ffac2e43668f67 \ + --hash=sha256:94e5e9f108ee10471288214d3d233fbfbb492840a8457eb85178d643ddeb32c7 \ + --hash=sha256:9c8402a82ea0dc4ceeab793db05f0fafa8ca139ca34fcde5df0f596103c74107 \ + --hash=sha256:9dab55f57c74c3cad24c323bacbbd04be4705ba6eb0d92e920b1fc4837ed5079 \ + --hash=sha256:a582ab2ae1d34f67112cadc86702774c9ea4374df6bca6afe672817203c99134 \ + --hash=sha256:a6557e5f38e065ca9fbdaf7cfc7435ecb1d113aa81a022d1b51921ee7432e227 \ + --hash=sha256:a9f7355e6fab51f6c369b86fb7571cffa05edee2c2121e0380a37fb9ac1cd5c1 \ + --hash=sha256:ab50ee449bf968271e820086f10a33d101dd060370abc10bcd22279be2656539 \ + --hash=sha256:ac9ed99d81760c62fe89d5f0815cdfa1ba9a35141cf30f1c2d044f04b4803d2e \ + --hash=sha256:b13478603dcd0a2479ff8e87e2c19a7d525734686fe3c49542472293a204212d \ + --hash=sha256:c423ab384a46c4dff7217b2ea5ba2e11cffdeab6441acd04cf65a369caf0366c \ + --hash=sha256:c5e67125c7dca78d199ec4e116aa93dbb83494808ecbb8211a2cb09b1bf41dbd \ + --hash=sha256:c71be1cbfa5cd9a41ee452acf1eccd82b2c05950358b106ec8ceb83411d1a020 \ + --hash=sha256:cbc8738fd8526d80f35cb3a40d41f41a2e7030bb3b18b09a6778ef63d291c2fd \ + --hash=sha256:ce47f66801c20ec6c6632453bb5960fe38939e9306970b48b3a5a26de7745d94 \ + --hash=sha256:d370b8d1dfcdf7130178137f6fbee6140774a1acc6cacefc4b42643ec11d0a3a \ + --hash=sha256:d38cdff612d06fa6a32840d5e1b1f7a27cee4a349aa9085d94a67789d6bfd408 \ + --hash=sha256:d8947001be83df1394050758ce0e745dd74fb134eef0a4b5124208dfc3a68c37 \ + --hash=sha256:deb9fde5c60e437ee4821bc9bc39ff31b42135c27e1dc61ef0a629389c1de62e \ + --hash=sha256:dfe9763530994147d9af1def057a5b9658b00e8f8fe8743d144d1e0911c2e454 \ + --hash=sha256:e105ab60406787da31fccc883fc0f733af1efd78f0136a4599692c4083a73d0c \ + --hash=sha256:e275096ea1e60cc595cda2836fd4a6c725d1125108b868be17f53684d164e2cc \ + --hash=sha256:edc3342adf8f697fc5f59c887a304356f147b397809440ed64e2fa6af2f50f37 \ + --hash=sha256:ee247f5c245c9a2fe7c8e2214e295918838e44e00a45a6718451e4004219e767 \ + --hash=sha256:eef4c2f3423810b3070ab391f85436d2f8bbfcb286ac15cbc73190b3563b1f1a \ + --hash=sha256:f21e8a22c8605750c7af886bab299a363721264061b4ac0a30efb73cfd58efc5 \ + --hash=sha256:f265528741e048bce55c3463ed721fb0aa45a5888d8add8cfeccb3035451bbdc \ + --hash=sha256:f2f9bd7f90c64fe89253f0a2c05e3c4856072660429ce8831b4235bf29403a67 \ + --hash=sha256:f785f6161f202ab04d8ca194158968798e480ca058943907972da5f12e2881e8 \ + --hash=sha256:f9f6143a8c75945eb960d9eb98905a441394abfa24afaae239d514ffb2586480 \ + --hash=sha256:fa8f5efb344d6908a1ce62f4a24e2e5780f825d6f53f5f50ec5ffacac72936cb \ + --hash=sha256:fdd28f912fccfec1846a94e2e1e8f9b0012f557f0c46fe4f3eb0d7a87afcf90b + # via pyjwt +h11==0.16.0 ; sys_platform != 'emscripten' \ + --hash=sha256:4e35b956cf45792e4caa5885e69fba00bdbc6ffafbfa020300e549b208ee5ff1 \ + --hash=sha256:63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86 + # via + # httpcore2 + # uvicorn +httpcore2==2.16.0 ; sys_platform != 'emscripten' \ + --hash=sha256:5c4358319f2602d984ad93182c9fee5160f22e9da7babdda870a5e7c4e2dc34f \ + --hash=sha256:c72cd0413563b17e1cd8354677dff887466f8ec2551679759e93126534428643 + # via httpx2 +httpx2==2.16.0 \ + --hash=sha256:0d54c98128e8f2ff7fbbde0fca8c359e5f032edeaaaac443cdb7f31f685bcd7f \ + --hash=sha256:fd2c5d7909e8d86fe92d53020c310ca0e4e431b838c207c5754b9bbf0308d49a + # via mcp +httpx2-jsfetch==1.0 ; python_full_version >= '3.12' and sys_platform == 'emscripten' \ + --hash=sha256:70a0e3eabfef7cce5ad9c629f7d01ca05e418f586646f4ddf14782e4c1454c60 \ + --hash=sha256:cb916b707601e69a07721aabc8f3f6659be3a6893bc1ff5c6f9e02241df2da32 + # via httpx2 +idna==3.20 \ + --hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \ + --hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c + # via + # anyio + # httpx2 +jsonschema==4.26.0 \ + --hash=sha256:0c26707e2efad8aa1bfc5b7ce170f3fccc2e4918ff85989ba9ffa9facb2be326 \ + --hash=sha256:d489f15263b8d200f8387e64b4c3a75f06629559fb73deb8fdfb525f2dab50ce + # via mcp +jsonschema-specifications==2025.9.1 \ + --hash=sha256:98802fee3a11ee76ecaca44429fda8a41bff98b00a0f2838151b113f210cc6fe \ + --hash=sha256:b540987f239e745613c7a9176f3edb72b832a4ac465cf02712288397832b5e8d + # via jsonschema +mcp==2.3.0 \ + --hash=sha256:8b147a50441cf059dc88c684e0aeed3687f0aa0f39c6cde7b90330effd2b34d8 \ + --hash=sha256:dd0c44c089d16453e8ae31a3877a0054d7a2314caaa81f5e0541b9b1734b2377 + # via morphogen +mcp-types==2.3.0 \ + --hash=sha256:968efdbdaedfab06adae40d378a34395f1090c5921d4be3c9cde283aaf76d91d \ + --hash=sha256:d1e46549edb35ee19a94940fcee6d1addd7e589ab7ea92dda83f5d84781fc362 + # via mcp +opentelemetry-api==1.45.2 \ + --hash=sha256:2cbd737377e710ee740d261c94e93fa0f08e6d037c18f17513cc0a2d94479a34 \ + --hash=sha256:d7b0008e21e5fd61cbe7a7f34ca3b6905a78ab677d9bc395e299359c75cda6b4 + # via mcp +pycparser==3.12 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy' \ + --hash=sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e \ + --hash=sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6 + # via cffi +pydantic==2.13.4 \ + --hash=sha256:45a282cde31d808236fd7ea9d919b128653c8b38b393d1c4ab335c62924d9aba \ + --hash=sha256:c40756b57adaa8b1efeeced5c196f3f3b7c435f90e84ea7f443901bec8099ef6 + # via + # mcp + # mcp-types + # morphogen +pydantic-core==2.46.4 \ + --hash=sha256:00c603d540afdd6b80eb39f078f33ebd46211f02f33e34a32d9f053bba711de0 \ + --hash=sha256:0186750b482eefa11d7f435892b09c5c606193ef3375bcf94aa00ae6bfb66262 \ + --hash=sha256:041bde0a48fd37cf71cab1c9d56d3e8625a3793fef1f7dd232b3ff37e978ecda \ + --hash=sha256:0c563b08bca408dc7f65f700633d8442fffb2421fc47b8101377e9fd65051ff0 \ + --hash=sha256:0cbe8b01f948de4286c74cdd6c667aceb38f5c1e26f0693b3983d9d74887c65e \ + --hash=sha256:0ce40cd7b21210e99342afafbd4d0f76d784eb5b1d60f3bdc566be4983c6c73b \ + --hash=sha256:0e96592440881c74a213e5ad528e2b24d3d4f940de2766bed9010ab1d9e51594 \ + --hash=sha256:133878133d271ade3d41d1bfb2a45ec38dbdbda40bc065921c6b04e4630127e2 \ + --hash=sha256:14d4edf427bdcf950a8a02d7cb44a08614388dd6e1bdcbf4f67504fa7887da9c \ + --hash=sha256:14f4c5d6db102bd796a627bbb3a17b4cf4574b9ae861d8b7c9a9661c6dd3362d \ + --hash=sha256:17299feefe090f2caa5b8e37222bb5f663e4935a8bfa6931d4102e5df1a9f398 \ + --hash=sha256:184c081504d17f1c1066e430e117142b2c77d9448a97f7b65c6ac9fd9aee238d \ + --hash=sha256:18e5ceec2ab67e6d5f1a9085e5a24c9c4e2ac4545730bfe668680bca05e555f3 \ + --hash=sha256:1a7dd0b3ee80d90150e3495a3a13ac34dbcbfd4f012996a6a1d8900e91b5c0fb \ + --hash=sha256:1d8ba486450b14f3b1d63bc521d410ec7565e52f887b9fb671791886436a42f7 \ + --hash=sha256:2108ba5c1c1eca18030634489dc544844144ee36357f2f9f780b93e7ddbb44b5 \ + --hash=sha256:23ace664830ee0bfe014a0c7bc248b1f7f25ed7ad103852c317624a1083af462 \ + --hash=sha256:2412e734dcb48da14d4e4006b82b46b74f2518b8a26ee7e58c6844a6cd6d03c4 \ + --hash=sha256:29c61fc04a3d840155ff08e475a04809278972fe6aef51e2720554e96367e34b \ + --hash=sha256:3009f12e4e90b7f88b4f9adb1b0c4a3d58fe7820f3238c190047209d148026df \ + --hash=sha256:3245406455a5d98187ec35530fd772b1d799b26667980872c8d4614991e2c4a2 \ + --hash=sha256:372429a130e469c9cd698925ce5fc50940b7a1336b0d82038e63d5bbc4edc519 \ + --hash=sha256:3a233125ac121aa3ffba9a2b59edfc4a985a76092dc8279586ab4b71390875e7 \ + --hash=sha256:3bf92c5d0e00fefaab325a4d27828fe6b6e2a21848686b5b60d2d9eeb09d76c6 \ + --hash=sha256:3ecbc122d18468d06ca279dc26a8c2e2d5acb10943bb35e36ae92096dc3b5565 \ + --hash=sha256:3fb702cd90b0446a3a1c5e470bfa0dd23c0233b676a9099ddcc964fa6ca13898 \ + --hash=sha256:428e04521a40150c85216fc8b85e8d39fece235a9cf5e383761238c7fa9b96fb \ + --hash=sha256:4c63ebc82684aa89d9a3bcbd13d515b3be44250dc68dd3bd81526c1cb31286c3 \ + --hash=sha256:4fc73cb559bdb54b1134a706a2802a4cddd27a0633f5abb7e53056268751ac6a \ + --hash=sha256:4fcbe087dbc2068af7eda3aa87634eba216dbda64d1ae73c8684b621d33f6596 \ + --hash=sha256:56cb4851bcaf3d117eddcef4fe66afd750a50274b0da8e22be256d10e5611987 \ + --hash=sha256:5855698a4856556d86e8e6cd8434bc3ac0314ee8e12089ae0e143f64c6256e4e \ + --hash=sha256:5a4330cdbc57162e4b3aa303f588ba752257694c9c9be3e7ebb11b4aca659b5d \ + --hash=sha256:5b712b53160b79a5850310b912a5ef8e57e56947c8ad690c227f5c9d7e561712 \ + --hash=sha256:5d5902252db0d3cedf8d4a1bc68f70eeb430f7e4c7104c8c476753519b423008 \ + --hash=sha256:617d7e2ca7dcb8c5cf6bcb8c59b8832c94b36196bbf1cbd1bfb56ed341905edd \ + --hash=sha256:62f875393d7f270851f20523dd2e29f082bcc82292d66db2b64ea71f64b6e1c1 \ + --hash=sha256:633147d34cf4550417f12e2b1a0383973bdf5cdfde212cb09e9a581cf10820be \ + --hash=sha256:66ce7632c22d837c95301830e111ad0128a32b8207533b60896a96c4915192ea \ + --hash=sha256:6b3ace8194b0e5204818c92802dcdca7fc6d88aabbb799d7c795540d9cd6d292 \ + --hash=sha256:6f2eeda33a839975441c86a4119e1383c50b47faf0cbb5176985565c6bb02c33 \ + --hash=sha256:7027560ee92211647d0d34e3f7cd6f50da56399d26a9c8ad0da286d3869a53f3 \ + --hash=sha256:7283d57845ecf5a163403eb0702dfc220cc4fbdd18919cb5ccea4f95ee1cdab4 \ + --hash=sha256:7a5f930472650a82629163023e630d160863fce524c616f4e5186e5de9d9a49b \ + --hash=sha256:7bfb192b3f4b9e8a89b6277b6ce787564f62cfd272055f6e685726b111dc7826 \ + --hash=sha256:811ff8e9c313ab425368bcbb36e5c4ebd7108c2bbf4e4089cfbb0b01eff63fac \ + --hash=sha256:8233f2947cf85404441fd7e0085f53b10c93e0ee78611099b5c7237e36aacbf7 \ + --hash=sha256:82cf5301172168103724d49a1444d3378cb20cdee30b116a1bd6031236298a5d \ + --hash=sha256:85bb3611ff1802f3ee7fdd7dbff26b56f343fb432d57a4728fdd49b6ef35e2f4 \ + --hash=sha256:86e1a4418c6cd97d60c95c71164158eaf7324fae7b0923264016baa993eba6fc \ + --hash=sha256:8c5dac79fa1614d1e06ca695109c6105923bd9c7d1d6c918d4e637b7e6b32fd3 \ + --hash=sha256:8d0820e8192167f80d88d64038e609c31452eeca865b4e1d9950a27a4609b00b \ + --hash=sha256:8daafc69c93ee8a0204506a3b6b30f586ef54028f52aeeeb5c4cfc5184fd5914 \ + --hash=sha256:9037063db01f09b09e237c282b6792bd4da634b5402c4e7f0c61effed7701a04 \ + --hash=sha256:90884113d8b48f760e9587002789ddd741e76ab9f89518cd1e43b1f1a52ec44b \ + --hash=sha256:926c9541b14b12b1681dca8a0b75feb510b06c6341b70a8e500c2fdcff837cce \ + --hash=sha256:9401557acd873c3a7f3eb9383edef8ac4968f9510e340f4808d427e75667e7b4 \ + --hash=sha256:9551187363ffc0de2a00b2e47c25aeaeb1020b69b668762966df15fc5659dd5a \ + --hash=sha256:962ccbab7b642487b1d8b7df90ef677e03134cf1fd8880bf698649b22a69371f \ + --hash=sha256:97e7cf2be5c77b7d1a9713a05605d49460d02c6078d38d8bef3cbe323c548424 \ + --hash=sha256:9aa768456404a8bf48a4406685ac2bec8e72b62c69313734fa3b73cf33b3a894 \ + --hash=sha256:9bc519fbf2b7578398853d815009ae5e4d4603d12f4e3f91da8c06852d3da3e9 \ + --hash=sha256:9d56801be94b86a9da183e5f3766e6310752b99ff647e38b09a9500d88e46e76 \ + --hash=sha256:9fa8ae11da9e2b3126c6426f147e0fba88d96d65921799bb30c6abd1cb2c97fb \ + --hash=sha256:a0f62d0a58f4e7da165457e995725421e0064f2255d8eccebc49f41bbc23b109 \ + --hash=sha256:aaa2a54443eff1950ba5ddc6b6ccda0d9c84a364276a62f969bdf2a390650848 \ + --hash=sha256:ad785e92e6dc634c21555edc8bd6b64957ab844541bcb96a1366c202951ae526 \ + --hash=sha256:af8244b2bef6aaad6d92cda81372de7f8c8d36c9f0c3ea36e827c60e7d9467a0 \ + --hash=sha256:b2f69dec1725e79a012d920df1707de5caf7ed5e08f3be4435e25803efc47458 \ + --hash=sha256:b8458003118a712e66286df6a707db01c52c0f52f7db8e4a38f0da1d3b94fc4e \ + --hash=sha256:bfec22eab3c8cc2ceec0248aec886624116dc079afa027ecc8ad4a7e62010f8a \ + --hash=sha256:c1b3f518abeca3aa13c712fd202306e145abf59a18b094a6bafb2d2bbf59192c \ + --hash=sha256:c50f2528cf200c5eed56faf3f4e22fcd5f38c157a8b78576e6ba3168ec35f000 \ + --hash=sha256:c68fcd102d71ea85c5b2dfac3f4f8476eff42a9e078fd5faefff6d145063536b \ + --hash=sha256:c7a7bd4e39e8e4c12c39cd480356842b6a8a06e41b23a55a5e3e191718838ddf \ + --hash=sha256:c94f0688e7b8d0a67abf40e57a7eaaecd17cc9586706a31b76c031f63df052b4 \ + --hash=sha256:cbaf13819775b7f769bf4a1f066cb6df7a28d4480081a589828ef190226881cd \ + --hash=sha256:cd2213145bcc2ba85884d0ac63d222fece9209678f77b9b4d76f054c561adb28 \ + --hash=sha256:ce5c1d2a8b27468f433ca974829c44060b8097eedc39933e3c206a90ee49c4a9 \ + --hash=sha256:d396ec2b979760aaf3218e76c24e65bd0aca24983298653b3a9d7a45f9e47b30 \ + --hash=sha256:d51026d73fcfd93610abc7b27789c26b313920fcfb20e27462d74a7f8b06e983 \ + --hash=sha256:db06ffe51636ffe9ca531fe9023dd64bdd794be8754cb5df57c5498ae5b518a7 \ + --hash=sha256:e0d65b8c354be7fb5f720c3caa8bc940bc2d20ce749c8e06135f07f8ed95dd7c \ + --hash=sha256:e739fee756ba1010f8bcccb534252e85a35fe45ae92c295a06059ce58b74ccd3 \ + --hash=sha256:e846ae7835bf0703ae43f534ab79a867146dadd59dc9ca5c8b53d5c8f7c9ef02 \ + --hash=sha256:e9c26f834c65f5752f3f06cb08cb86a913ceb7274d0db6e267808a708b46bc89 \ + --hash=sha256:f027324c56cd5406ca49c124b0db10e56c69064fec039acc571c29020cc87c76 \ + --hash=sha256:f99626688942fb746e545232e7726926f3be91b5975f8b55327665fafda991c7 \ + --hash=sha256:f9fa868638bf362d3d138ea55829cefb3d5f4b0d7f142234382a15e2485dbec4 \ + --hash=sha256:fbdb89b3e1c94a30cc5edfce477c6e6a5dc4d8f84665b455c27582f211a1c72c \ + --hash=sha256:fc010ab034c8c7452522748bf937df58020d256ccae0874463d1f4d01758af8e \ + --hash=sha256:fc3e9034a63de20e15e8ade85358bc6efc614008cab72898b4b4952bea0509ff + # via pydantic +pyjwt==2.15.1 \ + --hash=sha256:42d59d631f7768a1028a64c7ff581a9bf7519804daf91fc5b6c56e30eec5e193 \ + --hash=sha256:4f259e80cdfb6b3fc18a7de51fd1ef9ec79652f25019bae68975ca2468a34df8 + # via mcp +python-multipart==0.0.33 \ + --hash=sha256:8f16c07b36add9da6b2ee87d3efcaf0a45a6de9c3d0a5dd94e9ccf7675a7bc45 \ + --hash=sha256:b8112424a6abd162ec08d390565dd113ad699f2fe6fef3c987b8bbcbfe9e390d + # via mcp +pywin32==312 ; sys_platform == 'win32' \ + --hash=sha256:17948aeadbdb091f0ced6ef0841620794e68327b94ee415571c1203594b7215c \ + --hash=sha256:59aba5d5940842075343a5ddc6b11f1cdf0d1567fe745290359dfbcc7c2eb831 \ + --hash=sha256:5c1fbe4a937a73ae9297384a3da38518cbc694c68ad8a809b2e19acd350f03ed \ + --hash=sha256:6017c58e12f6809fbb0555b75df144c2922a9ffd18e4b9b5afa863b6c1a9d950 \ + --hash=sha256:7a27df850933d16a8eabfbaeb73d52b273e2da667f80d70b01a89d1f6828d02c \ + --hash=sha256:9fce94568364e0155e6dfb781ac5d95903be8baf28670632beab1b523f300daa \ + --hash=sha256:a4dd3a848290ef724347b19f301045831d8e802fa4464f491b98b1e0a081432e \ + --hash=sha256:a77a90fbb6881238d2ca9c6fd797b25817f3768fe78d214a90137ff055a75f5b \ + --hash=sha256:a8597d28f267b39074aef51fa593530082b39cbe5a074226096857b1fed2dfb9 \ + --hash=sha256:b2200a054ca6d6625c4842fc56a4976a4b47f96b73dbe5538c3f813a80359f47 \ + --hash=sha256:b457f6d628a47e8a7346ce22acb7e1a46a4a78b52e1d17e1af56871bd19a93bc \ + --hash=sha256:c2f03a0f73f804a13c2735b99392b0cd426bb4f2c4d0178e5ac966a0f21618d5 \ + --hash=sha256:c53e878d15a1c44788082bfe712a905433473aa38f86375b7cf8b45e3acbaaf9 \ + --hash=sha256:d11417d84412f859b722fad0841b3614459ed0047f7542d8362e77884f6b6e8a \ + --hash=sha256:dab4f65ac9c4e48400a2a0530c46c3c579cd5905ecd11b80692373915269208b + # via mcp +pyyaml==6.0.3 \ + --hash=sha256:00c4bdeba853cc34e7dd471f16b4114f4162dc03e6b7afcc2128711f0eca823c \ + --hash=sha256:02893d100e99e03eda1c8fd5c441d8c60103fd175728e23e431db1b589cf5ab3 \ + --hash=sha256:0f29edc409a6392443abf94b9cf89ce99889a1dd5376d94316ae5145dfedd5d6 \ + --hash=sha256:10892704fc220243f5305762e276552a0395f7beb4dbf9b14ec8fd43b57f126c \ + --hash=sha256:16249ee61e95f858e83976573de0f5b2893b3677ba71c9dd36b9cf8be9ac6d65 \ + --hash=sha256:1d37d57ad971609cf3c53ba6a7e365e40660e3be0e5175fa9f2365a379d6095a \ + --hash=sha256:2283a07e2c21a2aa78d9c4442724ec1eb15f5e42a723b99cb3d822d48f5f7ad1 \ + --hash=sha256:34d5fcd24b8445fadc33f9cf348c1047101756fd760b4dacb5c3e99755703310 \ + --hash=sha256:37503bfbfc9d2c40b344d06b2199cf0e96e97957ab1c1b546fd4f87e53e5d3e4 \ + --hash=sha256:41715c910c881bc081f1e8872880d3c650acf13dfa8214bad49ed4cede7c34ea \ + --hash=sha256:44edc647873928551a01e7a563d7452ccdebee747728c1080d881d68af7b997e \ + --hash=sha256:4a2e8cebe2ff6ab7d1050ecd59c25d4c8bd7e6f400f5f82b96557ac0abafd0ac \ + --hash=sha256:4ad1906908f2f5ae4e5a8ddfce73c320c2a1429ec52eafd27138b7f1cbe341c9 \ + --hash=sha256:501a031947e3a9025ed4405a168e6ef5ae3126c59f90ce0cd6f2bfc477be31b7 \ + --hash=sha256:5190d403f121660ce8d1d2c1bb2ef1bd05b5f68533fc5c2ea899bd15f4399b35 \ + --hash=sha256:5498cd1645aa724a7c71c8f378eb29ebe23da2fc0d7a08071d89469bf1d2defb \ + --hash=sha256:5fcd34e47f6e0b794d17de1b4ff496c00986e1c83f7ab2fb8fcfe9616ff7477b \ + --hash=sha256:5fdec68f91a0c6739b380c83b951e2c72ac0197ace422360e6d5a959d8d97b2c \ + --hash=sha256:64386e5e707d03a7e172c0701abfb7e10f0fb753ee1d773128192742712a98fd \ + --hash=sha256:652cb6edd41e718550aad172851962662ff2681490a8a711af6a4d288dd96824 \ + --hash=sha256:66e1674c3ef6f541c35191caae2d429b967b99e02040f5ba928632d9a7f0f065 \ + --hash=sha256:6adc77889b628398debc7b65c073bcb99c4a0237b248cacaf3fe8a557563ef6c \ + --hash=sha256:79005a0d97d5ddabfeeea4cf676af11e647e41d81c9a7722a193022accdb6b7c \ + --hash=sha256:7c6610def4f163542a622a73fb39f534f8c101d690126992300bf3207eab9764 \ + --hash=sha256:7f047e29dcae44602496db43be01ad42fc6f1cc0d8cd6c83d342306c32270196 \ + --hash=sha256:8098f252adfa6c80ab48096053f512f2321f0b998f98150cea9bd23d83e1467b \ + --hash=sha256:850774a7879607d3a6f50d36d04f00ee69e7fc816450e5f7e58d7f17f1ae5c00 \ + --hash=sha256:8d1fab6bb153a416f9aeb4b8763bc0f22a5586065f86f7664fc23339fc1c1fac \ + --hash=sha256:8da9669d359f02c0b91ccc01cac4a67f16afec0dac22c2ad09f46bee0697eba8 \ + --hash=sha256:8dc52c23056b9ddd46818a57b78404882310fb473d63f17b07d5c40421e47f8e \ + --hash=sha256:9149cad251584d5fb4981be1ecde53a1ca46c891a79788c0df828d2f166bda28 \ + --hash=sha256:93dda82c9c22deb0a405ea4dc5f2d0cda384168e466364dec6255b293923b2f3 \ + --hash=sha256:96b533f0e99f6579b3d4d4995707cf36df9100d67e0c8303a0c55b27b5f99bc5 \ + --hash=sha256:9f3bfb4965eb874431221a3ff3fdcddc7e74e3b07799e0e84ca4a0f867d449bf \ + --hash=sha256:a33284e20b78bd4a18c8c2282d549d10bc8408a2a7ff57653c0cf0b9be0afce5 \ + --hash=sha256:a80cb027f6b349846a3bf6d73b5e95e782175e52f22108cfa17876aaeff93702 \ + --hash=sha256:b3bc83488de33889877a0f2543ade9f70c67d66d9ebb4ac959502e12de895788 \ + --hash=sha256:b8bb0864c5a28024fac8a632c443c87c5aa6f215c0b126c449ae1a150412f31d \ + --hash=sha256:ba1cc08a7ccde2d2ec775841541641e4548226580ab850948cbfda66a1befcdc \ + --hash=sha256:c1ff362665ae507275af2853520967820d9124984e0f7466736aea23d8611fba \ + --hash=sha256:c458b6d084f9b935061bc36216e8a69a7e293a2f1e68bf956dcd9e6cbcd143f5 \ + --hash=sha256:d0eae10f8159e8fdad514efdc92d74fd8d682c933a6dd088030f3834bc8e6b26 \ + --hash=sha256:d76623373421df22fb4cf8817020cbb7ef15c725b9d5e45f17e189bfc384190f \ + --hash=sha256:ebc55a14a21cb14062aa4162f906cd962b28e2e9ea38f9b4391244cd8de4ae0b \ + --hash=sha256:eda16858a3cab07b80edaf74336ece1f986ba330fdb8ee0d6c0d68fe82bc96be \ + --hash=sha256:ee2922902c45ae8ccada2c5b501ab86c36525b883eff4255313a253a3160861c \ + --hash=sha256:f7057c9a337546edc7973c0d3ba84ddcdf0daa14533c2065749c9075001090e6 \ + --hash=sha256:fc09d0aa354569bc501d4e787133afc08552722d3ab34836a80547331bb5d4a0 + # via morphogen +referencing==0.37.0 \ + --hash=sha256:381329a9f99628c9069361716891d34ad94af76e461dcb0335825aecc7692231 \ + --hash=sha256:44aefc3142c5b842538163acb373e24cce6632bd54bdb01b21ad5863489f50d8 + # via + # jsonschema + # jsonschema-specifications +rpds-py==2026.9.1 \ + --hash=sha256:00ba2d8c7dd4ee537978ddf4b3fbd712bef2d8751603f7f3146b3f4287768e25 \ + --hash=sha256:01445c8d194aa032a08e944f16567672da1c62dbdbefd8b6d0693032e290cf68 \ + --hash=sha256:028ad274ea951dac64491b5d1e65712a4aeabfdbdb9fccf797b57bd899b0c495 \ + --hash=sha256:0483515261947e4e8b8e1375bf7463e7eb6ccfb3d86e7b554d90cd5285f20f32 \ + --hash=sha256:068c37bba854ec2fe42f7365c640af11dd9895890ccbf2df5070d0c059bd7f96 \ + --hash=sha256:074a4d198bc34d9a8ea425114fc3ded6d11ec01f6a314a8db67454a5152d8834 \ + --hash=sha256:07deecbfce94c78473018bc7d10b337cc651d12df87a1eb2cb3e4024bc9c33d0 \ + --hash=sha256:08dae4a4095150a7c4545a1fb40b98e1ab1744fbc2770d92c977b9dadaa49ab6 \ + --hash=sha256:0da298fb372dc192610a4b9ecbc68a0cd8b675bbbd1fc519d01b41cfd658333e \ + --hash=sha256:0f045bb053c9057720d72c56dffe30dffdc05997b2897a827b9325f0ab6623fa \ + --hash=sha256:10e208f2425d973938afcd56e28a7c4be32e27b6a60b5d381f49fb9d8acf9759 \ + --hash=sha256:136a1c3fe4402b7008bc81cb62ee538481795b61a7e83df88dff3b3f02b726ff \ + --hash=sha256:159a7aab5c5e8b112c8830f54717ce56da1252ebdbb526f5be2df2309280b9e7 \ + --hash=sha256:172e47169583f46ce118cbec68e6795d0da0f4606b488b6434f8276bca0a058c \ + --hash=sha256:1c2d1f6da5128eabf34e963d7163a818846075a52568250d006c4c953b40f903 \ + --hash=sha256:1d55198263bb51f557550c6ed2e6d1cb6a6fed6eb5c9120b741c5926bef8a45d \ + --hash=sha256:1d77b649e6f7cdf12ca5c2a98dad0ad37f9ea9b6f960408a92f0cb12bb3d04d9 \ + --hash=sha256:1e8d4d79d828299bf44a55db22a9388ab967b49d17132c88eab0f4360b48da8e \ + --hash=sha256:22ffd29a63d71fb1b81552c21f2c2b734949b7ac751a9be70675a939a900839b \ + --hash=sha256:2693b2728bbcc48d09a981a356954b0c47c53ff25b545856f28a889ea619f69a \ + --hash=sha256:270bdcdaac5d5b6f73c5e22e7e135c7f2a50e789f71d9e241d5be8d90026e19a \ + --hash=sha256:2711d29b653b3bce48a63d18b9c6b53274669e6d6c4094dddeb4d9a0e45128b2 \ + --hash=sha256:2c16ab111bc27c646ba8aa005d0527754edc538ebb636f0b1bf8e244b48d1945 \ + --hash=sha256:306ee1850d8105b5baf977e78d45fcadd12c1a54678d614c9baf217708446e91 \ + --hash=sha256:3231c4c0e521dafa5be0c9f114ee2c2ad46650836f2d72caa86801950c3e7044 \ + --hash=sha256:3890a6aa36e6baa53d5258a2a25d3ef8b37ad165a6ab27a892d7c3e3a432cd69 \ + --hash=sha256:3a72c11530d71abfb66c8d7696a2f86c43e63fca8b948f1a784ac490f4ec688e \ + --hash=sha256:3b5a6f40f0a1486b4b36c888123afc67acdbd9f33235927acf5ff295429a0ba3 \ + --hash=sha256:3c91c210ae7645626c608400e3519b4a642f837cce09ca830db3beb2e9f274d4 \ + --hash=sha256:3cd182d7291d29b92c521a0069d9c01ba6193628a9a105531d11b40a6d731a33 \ + --hash=sha256:3e524c7874ac72884d28e16dd5b8d839fd09e0fe76b020d3fbca23212a7b8c52 \ + --hash=sha256:3e93b2cd69a9830be33e03945cd7cda940a0a8bfcfbff41d6144f0cb0d3d8bd9 \ + --hash=sha256:3edae8c5ddfdb6985d49ae9d150516e5076888879022f91a26c2de9276ce0bdb \ + --hash=sha256:3f0e9ac28fc067d4d34b88ae43c48e9489455c97fee9633d851f7eeed5a05d35 \ + --hash=sha256:42e75466f83cd43f6026c81eab74246efb2bdadafb307b85700632d06c68f299 \ + --hash=sha256:44b32a7c4f0da3d28af31c259e38ddcff096f855e205ed0671d02fcf44f1ea1c \ + --hash=sha256:457866b85daf5034296666168b84a69e0b2e89dc4f1af102b46f6448a60b9063 \ + --hash=sha256:45bc6bccf78b20fd834237d18db64965d7ee68ba7f60440a26c7ab71e7b8d51a \ + --hash=sha256:46d80bc76b51a6c24f9944368c28d38b8bcbcea1da4f2f8d3ebc31a67e8c6ec6 \ + --hash=sha256:4793ef7f78268b124b73fa933440f01d258bbae01de9fa53e9080c9ab0425a12 \ + --hash=sha256:492e5e428cbe126221611f47e068f01660352feec4ad18bc0f5ea9b2ae88fb14 \ + --hash=sha256:4b26b03d9d2658ee2fa234f8f4f19f38a09773fe5261028025032e26d4d35af0 \ + --hash=sha256:4c0d2cb595a420b34d5086db0add011e26e2c09d6a024afbac4228bf8f863a30 \ + --hash=sha256:4cfaf02209061880210819934de2f4f6aa83dc04dafe6770276acc240a56da31 \ + --hash=sha256:501909f2e4a1e2dee528ef766fe3c469060ebc17e54a8383d404ba07a81a6f02 \ + --hash=sha256:50906f5aea24b5a865cbd0a589698288631d9f3a54c3a937c83aefa95a0d14af \ + --hash=sha256:54ac2158a6f96cfbabff0b2eedaf94b90c5ec7ca8317fcadc61e1c2b2e0ff6ef \ + --hash=sha256:56c6952a9b15047466d0c2347c446a761d4527f89976156341e68f0ce5cc08b0 \ + --hash=sha256:56cd8b3f77d7b6812f533b662186a1f28316931166ddc00fb893b1b0db7e9888 \ + --hash=sha256:57492a550a1d88d29d003247e5f78dd8cf04a701fac0e4c8db8745a6d2504e0a \ + --hash=sha256:5943980471829f6de242a20b109de3111ba6b77e3af0ffc587028ac854b05e6c \ + --hash=sha256:5c6ee90dee3e85e055ddfd502d611643d9b0fd94c818220bda84ec3dacd9b27b \ + --hash=sha256:5c90e7fa02e8f5de0d10c17595c568ada48c5302e749462c0ea1a4c362111a86 \ + --hash=sha256:5ce8943f79c2210f7abcc28e86367b03b28d95027fd01c46d2472373ae70c86f \ + --hash=sha256:617f59cde379b4f648a09797b7f683d04b90a46344cddab85639da5aff0f5531 \ + --hash=sha256:6307a0da524939decb8ca4a3933b8ab62525794411d6984fca6726e732804af6 \ + --hash=sha256:684fd492fff4fead00587544e059be2bbcb6f93454f21fa2a91b66fc7508be82 \ + --hash=sha256:6b5b393eda5ea42cca1c1a6665f2a4882b4fd5d1777e41ce0545a107fb008c9d \ + --hash=sha256:6b723eb406dec5bc9ec516c73ab9c3239a3284e017f7eb89ee2b3258bd504fb7 \ + --hash=sha256:6b9bf3135b4ad5981df9a73d71a35272d650a2985ae9c2746357b24d59de2448 \ + --hash=sha256:6beb738155fe8ab8091afdfa5a3226b21c2b1593f1e50ebb90eb25b44dbc0391 \ + --hash=sha256:6c0dbbcc19735fe5f8b0a54c07659d154a9e69f47e15d0a6ab7299215daf62cb \ + --hash=sha256:6cdc537c8633d7fd92a82e2e0d2ab74320a3f63d5e59fb9cf08711e08fe151c4 \ + --hash=sha256:6eae33003518fd4cb4f83a218d5371469dd3001aa3b87128c005b07762f7fe5e \ + --hash=sha256:740d0a99cf9de0b17a3943388e9294a59becf75e7c43421f387bd3c7a9901f7c \ + --hash=sha256:75c38c50ab9aca840225d9a9a3810bf11d04bd5c1f186cabbb8aee56db3e9b15 \ + --hash=sha256:761fdae6728ceb99ab182fad2f0cc1e262f610834dc891aea1d1a2a2e634776f \ + --hash=sha256:7664419f27db41d4f1c43a78dccda7dd6e8ef2428df3ee01d0c2a07a6b071297 \ + --hash=sha256:76d3af9732d2dab69f28179b40ba2d87e2f1d5824b4a694780aa787d685e8f36 \ + --hash=sha256:78326f4cb4427a56ba4996c0762b63be45f06b85f086526420d2b3a66e40f84d \ + --hash=sha256:7868b85224291c6cb6759f9b5adb9745f486d226f62b16a614dd5a2a5ab2b35b \ + --hash=sha256:815d26356930846a40c7bc1366e7b1b0320ab8a063e66c11298a208bed0fd237 \ + --hash=sha256:8171b44a054e5c67fd748ada04187f1250bf35b95f85e52ab64bcf3331a923bb \ + --hash=sha256:821b2755db9194409254012f429c56643416fb96ef9be090be82ec8826b7f477 \ + --hash=sha256:837c6b305e26fe0f75b15c92cf3b2ba29e0ae19dc40b1c557b026cb426347d0c \ + --hash=sha256:839dde845559254f34885267c6878f60d61d5205180226d976fe488d45fa128e \ + --hash=sha256:84a6ecc0c940169190d2c23bd969debd48c94dbc855acd60188a68d71d421608 \ + --hash=sha256:8601470267d938bcb7f3ab1a336100af51a4fd5b6ed030ef52461bb3ef5e7e07 \ + --hash=sha256:88b5268892fde430d5531f95bc560b6efbbd67c929662c586afd729a96e7461c \ + --hash=sha256:8aa5dda18d39b6143eb24809d158f9252c88f402749b6f1b62a506cc7d96cc35 \ + --hash=sha256:926bdd3e3b5998ddf70cc64bc8cf57209571f9044542913afb673799fec77dd0 \ + --hash=sha256:96beca19ec79de272e8668585380ff9092c47077c1d7a1e098e00bbd921f4785 \ + --hash=sha256:9a0460d43603d1fd9ef59c30278531e15d78581721ddb538fa560aa7817ea4ad \ + --hash=sha256:a03d57b86d2a51d0a66c92177e2be154ad015f357791d306e714569999cdb4cc \ + --hash=sha256:a36b70596407634ca82d4b989a3729074a008537a0522e4c8046a67c729103e9 \ + --hash=sha256:a3a52a3ba86436ab3aef510fbe21512abc2ddd1993005dfe50514bd2284ef025 \ + --hash=sha256:a3dbc5ed9514908d5046107d7b1346bde71eea61de6e0e4919c19354f97e769f \ + --hash=sha256:a431156bb41865fc14cd5d79bb9d7bbed83110b0159e34e62ae30951f96c0009 \ + --hash=sha256:a575404ebc9cf2e91edd32eaf570ec1430eb900d4f56724ba7dd4bc1fc9c176d \ + --hash=sha256:a5cf77eb04f20b720be95265a3e00eb2a14814074255cc27069c551b2db53118 \ + --hash=sha256:a8763f20692da7df39b0afdd1ba3042b004c50a45994f76c2d9a25641f7673db \ + --hash=sha256:ab4b2fda7c2b542f7f9d886cc6a838c5079d2b76f72e6081411faba11adde2c9 \ + --hash=sha256:addeda51556dac7c1a2f14cda62db8b621cd12afba3091d03a96c72932387eab \ + --hash=sha256:b242c27c8f836305a4a72df9cdd564386ac57b807bd252a063223331c9316b37 \ + --hash=sha256:b4f062343e7ad3fa94f2c66e5ae667dee47ee74dd41a9057c4fbe163236a123d \ + --hash=sha256:b5b8b0753718d258fd454283fbd57e14545d3b40583fa672e27cb4f987626bcc \ + --hash=sha256:be3e47e2d91aa3942ff9bf4077a505226005abfc39b6f7554a91c1b9393986b9 \ + --hash=sha256:befc2d6a953e563f8a7bfd87a42c22ebf8a3e980dcb7b6a4d17b70b0e914e8a3 \ + --hash=sha256:bf35d0568abda97233239ce32896d3ad53fccc537832c104e30c94aa5fb93569 \ + --hash=sha256:c933c6678c6f116ff8af47a4c6db0868b8ace74af0343016c0ef00f00272ea69 \ + --hash=sha256:c9d1aca01f49170fdcf5c92761b1fafe97f554b721ca4570c5949fff778f0d4b \ + --hash=sha256:cdeaa99ce822dca76cfb1b993e9120c5ea212f2eb66d48950ad63c349668a018 \ + --hash=sha256:ce4d4f52e2a4324396caddbd45a97d8d7be5f42edd25d2355282a9c34f9b2f7f \ + --hash=sha256:d1028417bb44037eb3069c1009bd7b7277212876cda22fbe565b0bca9fab6d2c \ + --hash=sha256:d151e148117294133bf8af7eeace085e7e87432db15ab6adf640330298a47f6f \ + --hash=sha256:d7841166b7fa64c9c56404617ae4341448847482d45933b13135d26c130519e5 \ + --hash=sha256:d7fca4eb6df565e2a928f1c7dad92d27db8f9df0f449e76423ed5d7e713ed445 \ + --hash=sha256:d95a354e02393eada6d7351184671aced9d4cce109dabf927cb7aa99624352a1 \ + --hash=sha256:d9edf30457d74eebfd76b045535e36f1cd89062566a128a0db2145ca042d787e \ + --hash=sha256:dbc2673f9223d420c91145599b3ba45a8a50c207d1976908e5fb5ddb0c9b9429 \ + --hash=sha256:e01b3c878c8641913e688edd1b3f08658c6783d29cf6b826bd3c0d1ae7a1ffaa \ + --hash=sha256:e21c1429e205828ea886a2293a4a2c8e01f4c25d9893ca330e97a6cf73f52e7b \ + --hash=sha256:e43d4a1f673e8a1cbd8533e809e02b4bf9d4f2280269bb640436556312121250 \ + --hash=sha256:e6d198bad4e49dd6732fbd636e2fc5c082f45c8cad0b4acb756b00c82c76072e \ + --hash=sha256:e6ea1cda8d8c688278430e4268a42f5e5da3bdd74578dfadc0820c3f1766ce83 \ + --hash=sha256:ea394a937f17a54c51239348bdbe2e3518124c8d4a8951ba04a311d3095bd18f \ + --hash=sha256:eac2f5dbafd585dfe31f86a23ebf0d3ba480a9d49ebc87947267b5608d4ea0cd \ + --hash=sha256:eb61be926bb81567c1f48bdc8aa22b9855048dc2efd53871f9f7e6e9a5632346 \ + --hash=sha256:eba5d173f7d5708b22a93815017a4611873ed54db9f268077c0dd1ed99cfc858 \ + --hash=sha256:ec450527cbf485e13c8d3602a54f428ab0432fdade0ede75efd74b735421c871 \ + --hash=sha256:eef6a03b0b6d08d0835ccfa8ec8d1bc70525e3801387567137b50c557695e6da \ + --hash=sha256:ef0d8c843e2827d6c120ab4687e9423fb1d893db1df27b7c1506615bcb9734a0 \ + --hash=sha256:ef6b65b03247c54692ad4fd9ee97cb772781927db72e3cb05e70b3db6d1ff14f \ + --hash=sha256:f3d6ed6a98cfd19155996605474982cc470d7601746a6439078f1a5a3fa8b050 \ + --hash=sha256:fce4b85234a0cbad67bf8e6e1201ee815d172c9aebad75f25645bc4d834f8e31 \ + --hash=sha256:fda1d96e542c37b6c804547dbf489c129fe7c97183a76a5ec275909ba1a063df \ + --hash=sha256:fdcd198979b4ecffcc1beba366a7fbcf4eb41243691a82fe52ceb0b902f09c12 \ + --hash=sha256:fe5ad0664ec772b02c45859041aa17655709cced7a31005817fbbbd988c25567 + # via + # jsonschema + # referencing +sse-starlette==3.6.0 \ + --hash=sha256:623151d6c20dc0eebf1b3379c27faae91fff883bac7ab6665f16f46440a88b3a \ + --hash=sha256:e4dfa4d237d2712cb2b4d4918eda9b457cd6b44bbecdc838af75de836565bafd + # via mcp +starlette==1.10.0 \ + --hash=sha256:478c0ab3b4ced6e82719849c118fa406f0278a3499c1a898cd15cd31bdc38ce4 \ + --hash=sha256:b8399098d4c1e3522734f7235dc79b1fc967f96cf139c81e0fa30479e0685f9b + # via + # mcp + # sse-starlette +truststore==0.10.5 ; sys_platform != 'emscripten' \ + --hash=sha256:30d36967ccaded5cbb38d602c433f53600036c79d502f4533a49b60a03bbefcd \ + --hash=sha256:9aaaedaefaf06d8b206278cf8b5012bc897f485a874503501e12d776df78951c + # via + # httpcore2 + # httpx2 +typing-extensions==4.16.0 \ + --hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \ + --hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5 + # via + # anyio + # httpx2 + # mcp + # mcp-types + # opentelemetry-api + # pydantic + # pydantic-core + # referencing + # starlette + # typing-inspection +typing-inspection==0.4.4 \ + --hash=sha256:547274fa6b0a561ccf549cc9524b999a578e737d015d8709d021f9d0d13bea47 \ + --hash=sha256:65b8397ba37ccbce054456aaccddfc91e6e3083c92824df348d96ca832f3f147 + # via + # mcp + # pydantic +uvicorn==0.54.0 ; sys_platform != 'emscripten' \ + --hash=sha256:505bdb0f318731d45f1f712071fc781a8981f6847a31c902c9f5e652d4f67faf \ + --hash=sha256:a2e33cbfaa0306f8e6b0c13e0cb89d7d7a2da3e62b90c66e18c33d9807b28620 + # via mcp diff --git a/tests/test_pullrequest.py b/tests/test_pullrequest.py new file mode 100644 index 0000000..5fc1e86 --- /dev/null +++ b/tests/test_pullrequest.py @@ -0,0 +1,263 @@ +"""A pull request as the GitHub judge sees it (morphogen/pullrequest.py, `morphogen pr`, .github/workflows/judge.yml): +not judged, refused, or handed to the judge as a request. The cheats a pull request could try through this path are in +PullRequestCheats; each must be refused. WorkflowFile holds the workflow to what the old one guaranteed.""" + +import argparse +import contextlib +import io +import json +import shutil +import subprocess +import tempfile +import unittest +from pathlib import Path + +import yaml + +from morphogen import pullrequest as pr +from morphogen import schema +from morphogen.documents import DocumentError +from tests.catalog import FILE, dump +from tests.fixture import CLASSIFY, git +from tests.fixture_cells import CellsProject, cells_doc + +ROOT = Path(__file__).resolve().parents[1] +HONEST = CLASSIFY + "LIMIT = 100\n# same\n" +BETTER = CLASSIFY.replace("THRESHOLD = 10", "THRESHOLD = 50") + + +def rev(repo, ref): + return subprocess.run(["git", "rev-parse", ref], cwd=repo, check=True, capture_output=True, text=True).stdout.strip() + + +class PullRequests(unittest.TestCase): + def setUp(self): + self.p = CellsProject(code=True) + self.p.write("README.md", "the app\n") + git(self.p.repo, "add", "README.md") + git(self.p.repo, "commit", "-q", "-m", "readme") + # The operator's private material, as the workflow clones it: outside the repository, paths relative to it. + self.cases = Path(tempfile.mkdtemp(prefix="morphogen-cases-")) + shutil.copytree(self.p.private_dir, self.cases / "answers") + (self.cases / "morphogen.local.yaml").write_text(yaml.safe_dump({"cells": {"classify": {"private": "answers"}}})) + + def tearDown(self): + self.p.close() + shutil.rmtree(self.cases, ignore_errors=True) + + def judge(self, head, **kw): + kw.setdefault("local_file", self.cases / "morphogen.local.yaml") + kw.setdefault("protect", [".github/**"]) + return pr.judge_pr(self.p.repo, "main", head, sandbox="none", unsandboxed=True, **kw) + + def records(self): + return self.p.evidence.dump() + + +class PullRequestRuns(PullRequests): + def test_a_change_no_cell_claims_is_not_judged(self): + r = self.judge(self.p.branch("docs", {"README.md": "more\n"})) + self.assertEqual(r["verdict"], "not-judged", r) + self.assertFalse(r["judged"]) + self.assertEqual(self.records(), []) + + def test_a_change_with_no_target_is_judged_as_a_change(self): + r = self.judge(self.p.branch("honest", {"classify/classify.py": HONEST})) + self.assertEqual((r["verdict"], r["kind"]), ("pass", "change"), r) + rec = r["evidence"] + self.assertEqual(rec, self.records()[-1]) + self.assertEqual(rec["request"]["kind"], "change") + schema.Verdict.model_validate(rec) + + def test_the_description_names_the_target_and_the_answers_come_from_the_local_file(self): + body = "Raise the threshold.\n\nmorphogen-target: cell:classify\n" + r = self.judge(self.p.branch("same", {"classify/classify.py": HONEST}), body=body, + labels={"pull_request": "7"}) + self.assertEqual((r["kind"], r["target"]), ("judge", "cell:classify"), r) + self.assertEqual(r["verdict"], "fail", r) # identical behaviour is no gain + self.assertIn("scored.accuracy", r["result"]["metrics"]) # the scorer read the answers the local file names + rec = self.records()[-1] + self.assertEqual(rec["request"]["kind"], "judge") + self.assertEqual(rec["labels"], {"pull_request": "7"}) + schema.Verdict.model_validate(rec) + + def test_a_better_candidate_passes_on_the_held_out_answers(self): + better = BETTER + "LIMIT = 100\n" + r = self.judge(self.p.branch("t50", {"classify/classify.py": better}), body="morphogen-target: cell:classify") + self.assertEqual(r["verdict"], "pass", r) + self.assertEqual(r["summary"], "pass cell:classify") + + def test_a_branch_behind_the_base_is_judged_merged_onto_it_by_the_current_rules(self): + head = rev(self.p.repo, self.p.branch("honest", {"classify/classify.py": HONEST})) + self.p.write("README.md", "main moved on\n") + git(self.p.repo, "commit", "-q", "-am", "main moves") + r = self.judge(head) + self.assertTrue(r["merged"], r) + self.assertEqual(r["head"], head) + self.assertNotEqual(r["candidate"], head) + self.assertEqual(r["verdict"], "pass", r) # README.md, changed only on main, is not the candidate's + + def test_a_branch_that_does_not_merge_is_a_stop(self): + head = self.p.branch("readme", {"README.md": "theirs\n"}) + self.p.write("README.md", "ours\n") + git(self.p.repo, "commit", "-q", "-am", "main moves") + with self.assertRaises(pr.PullRequestError) as e: + self.judge(head) + self.assertIn("does not merge", str(e.exception)) + + def test_the_command_writes_the_document_and_exits_by_the_verdict(self): + head = self.p.branch("honest", {"classify/classify.py": HONEST}) + out = self.cases.parent / f"{self.cases.name}-verdict.json" + self.addCleanup(lambda: out.unlink(missing_ok=True)) + a = argparse.Namespace(base="main", head=head, sandbox="none", unsandboxed=True, pull=False, target=None, + body_env=None, protect=None, label=["k=v"], out=str(out), + local=str(self.cases / "morphogen.local.yaml")) + import os + cwd = os.getcwd() + os.chdir(self.p.repo) + try: + with contextlib.redirect_stdout(io.StringIO()): + self.assertEqual(pr.main(a), 0) + doc = json.loads(out.read_text()) + self.assertEqual((doc["morphogen"], doc["verdict"]), ("pr-verdict/v1", "pass")) + self.assertLessEqual(len(doc["summary"]), 138) + a.sandbox, a.unsandboxed = "none", False + with contextlib.redirect_stdout(io.StringIO()): + self.assertEqual(pr.main(a), 2) + self.assertEqual(json.loads(out.read_text())["verdict"], "stop") + finally: + os.chdir(cwd) + + +class PullRequestCheats(PullRequests): + def assertRefused(self, r, why): + self.assertEqual(r["verdict"], "fail", r) + self.assertTrue(r["judged"]) + self.assertIn(why, " ".join(r["reasons"])) + + def widened(self): + d = cells_doc(code=True) + d["cells"]["classify"]["change"] = "**" + return dump(d) + + def test_widen_change_in_the_catalog(self): + r = self.judge(self.p.branch("widen", {FILE: self.widened(), "classify/classify.py": HONEST})) + self.assertRefused(r, FILE) + self.assertEqual(r["kind"], "change") + self.assertEqual(self.records()[-1]["verdict"], "fail") + + def test_widen_change_in_the_catalog_while_naming_the_target(self): + r = self.judge(self.p.branch("widen", {FILE: self.widened(), "classify/classify.py": HONEST}), + body="morphogen-target: cell:classify") + self.assertRefused(r, FILE) + self.assertEqual(r["kind"], "judge") + self.assertEqual(r["result"]["metrics"], {}) # refused before anything ran + + def test_edit_only_the_catalog_to_slip_by_as_not_judged(self): + r = self.judge(self.p.branch("widen", {FILE: self.widened()})) + self.assertRefused(r, FILE) + + def test_delete_the_catalog(self): + r = self.judge(self.p.branch("gone", delete=[FILE])) + self.assertRefused(r, FILE) + + def test_commit_a_local_file_with_wider_answers(self): + repo, mine = self.p.repo, (self.p.repo / "morphogen.local.yaml").read_text() + git(repo, "checkout", "-q", "-B", "local", "main") + (repo / "morphogen.local.yaml").write_text("cells: {classify: {private: /tmp}}\n") + git(repo, "add", "-f", "morphogen.local.yaml") + git(repo, "commit", "-q", "-m", "local") + git(repo, "checkout", "-q", "main") + (repo / "morphogen.local.yaml").write_text(mine) + r = self.judge("local") + self.assertRefused(r, "morphogen.local.yaml") + + def test_edit_the_callers_workflow(self): + r = self.judge(self.p.branch("wf", {".github/workflows/morphogen.yml": "on: push\n"})) + self.assertRefused(r, "protected") + rec = self.records()[-1] + self.assertEqual((rec["verdict"], rec["by"]), ("fail", "judge")) + schema.Verdict.model_validate(rec) + + def test_carry_rules_in_the_local_file(self): + (self.cases / "morphogen.local.yaml").write_text(yaml.safe_dump({"cells": {"classify": {"change": "**"}}})) + with self.assertRaises(DocumentError) as e: + self.judge(self.p.branch("honest", {"classify/classify.py": HONEST})) + self.assertIn("not a local setting", str(e.exception)) + + def test_run_without_a_container(self): + with self.assertRaises(pr.PullRequestError) as e: + pr.judge_pr(self.p.repo, "main", self.p.branch("honest", {"classify/classify.py": HONEST}), sandbox="none") + self.assertIn("held-out answers", str(e.exception)) + + def test_name_two_targets(self): + with self.assertRaises(pr.PullRequestError): + pr.target_from("morphogen-target: cell:classify\nmorphogen-target: cell:report\n") + + def test_add_the_first_catalog_through_the_judge(self): + git(self.p.repo, "rm", "-q", FILE) + git(self.p.repo, "commit", "-q", "-m", "no catalog") + r = self.judge(self.p.branch("first", {FILE: dump(cells_doc(code=True))})) + self.assertRefused(r, "by review") + + +class WorkflowFile(unittest.TestCase): + """.github/workflows/judge.yml keeps what the old judge (rebuild 8, b921c9b) guaranteed.""" + + def setUp(self): + self.text = (ROOT / ".github/workflows/judge.yml").read_text() + self.wf = yaml.safe_load(self.text) + + def test_it_is_reusable_and_judges_only_pull_request_target(self): + self.assertIn("workflow_call", self.wf[True]) # YAML 1.1 reads the key `on` as True + for name, job in self.wf["jobs"].items(): + self.assertIn("pull_request_target", job["if"], name) + + def test_no_job_has_more_than_it_needs(self): + self.assertEqual(self.wf["permissions"], {}) + self.assertEqual(self.wf["jobs"]["judge"]["permissions"], {"contents": "read"}) # the job that runs candidates + self.assertEqual(set(self.wf["jobs"]["post"]["permissions"]), {"statuses", "id-token"}) + + def test_actions_are_pinned_by_commit(self): + uses = [s["uses"] for job in self.wf["jobs"].values() for s in job["steps"] if "uses" in s] + self.assertTrue(uses) + for u in uses: + self.assertRegex(u, r"@[0-9a-f]{40}\Z", u) + + def test_the_description_never_reaches_a_shell_script(self): + for job in self.wf["jobs"].values(): + for step in job["steps"]: + self.assertNotIn("github.event.pull_request.body", step.get("run", "")) + self.assertNotIn("github.event.pull_request.title", step.get("run", "")) + + def test_the_judge_is_the_packages_and_never_unsandboxed(self): + steps = {s.get("id"): s for s in self.wf["jobs"]["judge"]["steps"]} + run = steps["judge"]["run"] + self.assertIn("-P -m morphogen pr", run) + self.assertNotIn("--unsandboxed", self.text) + check = self.wf["jobs"]["judge"]["steps"][0]["run"] + self.assertIn("docker|podman", check) + + def test_the_private_material_is_removed(self): + names = [s.get("name", "") for s in self.wf["jobs"]["judge"]["steps"]] + i = names.index("Remove the private material") + self.assertEqual(self.wf["jobs"]["judge"]["steps"][i]["if"], "always()") + + def test_the_lock_is_uv_lock(self): + uv = shutil.which("uv") + if not uv: + self.skipTest("uv is not installed") + r = subprocess.run([uv, "export", "--frozen", "--no-dev", "--no-emit-project", "--format", "requirements-txt"], + cwd=ROOT, capture_output=True, text=True) + if r.returncode != 0: + self.skipTest(f"uv export: {r.stderr.strip()[-200:]}") + + def reqs(text): + return [line for line in text.splitlines() if line.strip() and not line.startswith("#")] + self.assertEqual(reqs((ROOT / "requirements.lock").read_text()), reqs(r.stdout), + "regenerate: uv export --frozen --no-dev --no-emit-project --format requirements-txt " + "-o requirements.lock") + + +if __name__ == "__main__": + unittest.main()