--- name: pendulum-deliver-pr description: "Internal: the last stage of a Pendulum worker run on an Objective, after pendulum-prove-acceptance, loaded only when a Pendulum task card or answer pass names it. Rebases on the default branch, writes the one PR's title and body, answers each reviewer comment once, writes the exit record and stops; Pendulum pushes, opens the PR and posts the replies." user-invocable: false --- # Deliver the PR ## Rebase, then write the PR Rebase `pendulum/` onto `origin/`: Pendulum fetched it before this pass, and `$PENDULUM_IN/base.txt` names its commit. Never fetch, pull or push. Resolve conflicts in favour of the default branch's structure and your change's intent; re-run the validation commands after any non-trivial conflict (with required checks on the task card, the tests the conflict touches). Write the one PR to `$PENDULUM_OUT/pr.md`: its first line is the title, `#: `; the rest is the body. On a rerun, start from `$PENDULUM_IN/pr.md`. Pendulum opens it as a draft and marks it ready once its own validation is green, or, with required checks, once a pass that ended well has pushed (locally after the validation commands pass; the review waits for the checks). Write no `Closes`, `Fixes` or `Resolves` line, no @-mention and no HTML comment: Pendulum links the issue itself and neutralises them. ## The PR body These sections, in this order, each under exactly this `##` heading (Pendulum reads the headings; do not number or rename them): - `## Acceptance`: one row per acceptance entry: the entry, the change that satisfies it (files), and the proving test (file and name). An entry split into a later PR says so. - `## Validation`: every validation command and the budget command, exactly as run, each with its result and, for a failure, whether it fails identically on the base commit. - `## Fake-only proofs`: each entry proved only against a fake or in-memory stand-in, and why the real path could not run here. Write `none` when there are none. - `## Design checklist`: when the repository has one, each question answered with `file:line` evidence, or `n/a` with the reason. - `## Assumptions`: the plan's list, with any item that starts with `QUESTION:` first and phrased as the question a human must answer; an answered one no longer starts with it. - `## Undone`: anything the issue asked for that this PR does not deliver, with the reason and, for a split Objective, that a later part delivers it. - `## Blocked` (only when blocked beyond recovery): what blocked you, in one paragraph. ## Workflow hand-over Pendulum never pushes a change under `.github/workflows/`, and the commit hook refuses one. When the Objective needs one, keep it out of your commits and hand it over as `$PENDULUM_OUT/workflow.patch`: read [reference.md](reference.md), "Workflow hand-over", first. ## Reviewer comments When the PR has review comments (`$PENDULUM_IN/review-comments.json` holds them), read [reference.md](reference.md) beside this file first: its "Reviewer comments" section says how to answer each one once, then finish the pass. If Pendulum's validation is red after its push, it sends you the failure; fix it and commit. Pendulum sends each red back while your fixes make progress; a pass that commits nothing, leaves the same failures or brings back an earlier red Blocks. ## Stop Write your exit record last, never while a command you started still runs (end your turn; you are woken when it finishes), as one JSON object in `$PENDULUM_OUT/exit.json`: {"exit": "delivered" | "question" | "blocked", "questions": [{"question": "verbatim", "test": "contract" | "decision" | "access", "existing": "the existing contract it changes or removes, the decision it contradicts, or the access it grants"}], "reason": "why you are blocked, else empty"}, with "part": {"remaining": [...]} only for a split Objective with items left, and "deniedHosts": ["host.example.com"] only when you are blocked because the sandbox denied those hosts (bare host names; the operator decides whether to allow them). Pendulum reads that file, never the PR body, to decide whether you delivered, raised a question or are blocked. Your outputs are the commits on `pendulum/` and the files in `$PENDULUM_OUT`. Anything else is noise that a human has to read.