From 35d9d1e0f3c6681c8120982c1cf2bede9a61f4f4 Mon Sep 17 00:00:00 2001 From: Pierre Mardon Date: Mon, 5 Oct 2026 13:16:26 +0200 Subject: [PATCH] A draft pull request opened with the description of the state script, and nothing of the session's In 3 of the 6 runs of the fourth campaign of the evaluations that had a `gh` to call, the draft pull request was opened with the text `surface-status pr-body` prints followed by a line of attribution, where the prompt says "and nothing else" (#93). The stand-in `gh` of #91 let it be seen for the first time. The two commands did not ask for the same thing. `/surface-plan` named `gh pr create --draft` "with [...] that description" and `gh pr edit --body`, and left the session to carry the text: every session wrote it to a file of its own first, and three added a footer to it. `/surface-execute` gives the output of the script to `gh pr edit --body-file -` on its standard input, and no refresh of the three runs played whole carries one. `/surface-plan` now does the same: the output of the script is given to `gh` on its standard input, with `gh pr create --draft --body-file -` when the branch has no pull request and `gh pr edit --body-file -` when it has one. Measured on `05-fine-cap`, where the footer was written in two runs of two: three runs played to the hand over, three drafts opened from the standard input with the description alone, and at every hand over the description is the one the script prints. 19 sessions, 4.94 USD. --- skills/surface-plan/SKILL.md | 2 +- tests/prompts/test_surface_plan.py | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/skills/surface-plan/SKILL.md b/skills/surface-plan/SKILL.md index 5736063..4d3ecd4 100644 --- a/skills/surface-plan/SKILL.md +++ b/skills/surface-plan/SKILL.md @@ -150,7 +150,7 @@ The developer amends a plan only when it is their turn: awaiting approval, or bl - Commit only the files of the plan folder, by path, following the repository's conventions. Each journal line goes in the commit of the files it describes. Never other changes of the working tree. - Before the first push of the branch (it has no upstream yet), read the CI configuration. If its triggers react to a push of this branch or to the opening of a pull request, draft included, warn the developer, say what would run, and wait for their agreement. Write their answer into `interview.md` under "Git", so a relaunch does not ask again. Declined: push nothing, say the plan is committed locally, and go to step 11. - Push the branch, setting its upstream. -- The pull request opens as a draft at the first `plan-drafted`. Its description is the text `surface-status pr-body` prints, and nothing else (it takes no argument, since it describes every plan of the branch). No pull request yet: `gh pr create --draft`, with a title after the repository's conventions and that description. One exists: replace its description with `gh pr edit --body`. Refresh it the same way at the end of every launch that pushes. +- The pull request opens as a draft at the first `plan-drafted`. Its description is the text `surface-status pr-body` prints, and nothing else (it takes no argument, since it describes every plan of the branch): the output of the script is given to `gh` on its standard input, so that no text of yours stands between the two. No pull request yet: `gh pr create --draft --body-file -`, with a title after the repository's conventions. One exists: `gh pr edit --body-file -`. Refresh it the same way at the end of every launch that pushes. - Nothing else is written on the pull request, and you never mark it ready for review. Its comments are read only when the developer asks for it explicitly. - Without `gh` or a remote, say so, give the description, and stop after the commit. diff --git a/tests/prompts/test_surface_plan.py b/tests/prompts/test_surface_plan.py index 6c4c68d..00f089e 100644 --- a/tests/prompts/test_surface_plan.py +++ b/tests/prompts/test_surface_plan.py @@ -699,8 +699,14 @@ def test_the_draft_pull_request_opens_at_the_first_plan_drafted() -> None: body = _body() steps = "\n".join(_git_steps()) assert "opens as a draft at the first `plan-drafted`" in steps - assert "`gh pr create --draft`" in steps assert "`surface-status pr-body` prints, and nothing else" in steps + # The script's output goes to `gh` as it is, as at every refresh of `/surface-execute`: left + # to carry the text itself, a session wrote it to a file and added a line of its own. + assert "the output of the script is given to `gh` on its standard input" in steps + assert "so that no text of yours stands between the two" in steps + assert "`gh pr create --draft --body-file -`" in steps + assert "`gh pr edit --body-file -`" in steps + assert "`gh pr edit --body`" not in steps assert "Nothing else is written on the pull request" in steps assert "never mark it ready for review" in steps assert "read only when the developer asks for it explicitly" in steps