Skip to content

pr-create is not a forge concept: gh pr create is hardcoded in the skeleton prompts, so non-GitHub forges need a gh shim #1455

Description

@pseudoseed

pr-create is not a forge concept, so gh pr create is hardcoded and non-GitHub forges cannot work without a gh shim

The forge abstraction covers 15 concepts (pr-view, pr-list, pr-exists, pr-merge, issue-view, issue-comment, user-identity, …) and every one of them can be routed to a provider preset. pr-create is not among them.

As a result gh pr create is written literally into the skeleton prompts:

codev-skeleton/porch/prompts/pr.md
codev-skeleton/porch/prompts/review.md
codev-skeleton/protocols/air/prompts/pr.md
codev-skeleton/protocols/spir/prompts/review.md
codev-skeleton/protocols/pir/protocol.md
codev-skeleton/protocols/pir/prompts/review.md
codev-skeleton/protocols/bugfix/protocol.md
codev-skeleton/protocols/maintain/prompts/review.md

There is no configuration that redirects those calls. A project on Gitea or Forgejo with forge.provider: gitea fully configured still has every builder shell out to gh at the moment it opens a PR — the single most important write in the whole protocol.

Why this is a bug rather than a missing feature

The abstraction advertises provider independence and delivers it for reads and for pr-merge. pr-create is the one write that has no route, so the contract is incomplete in a way that is invisible until a builder reaches the PR phase and fails. On our fleet this is masked by a hand-maintained gh→Forgejo shim on PATH; without it, no builder can complete a protocol.

It also interacts badly with overlay tooling that deprecates such shims on the assumption that forge.provider: gitea covers the surface. Deleting the shim on that assumption breaks PR creation for every builder.

Scope of the fix

  1. Add pr-create to the forge contract, alongside the existing concepts.
    Inputs the prompts already have: title, body, base, head. Output: the created PR's number and URL.
  2. Add scripts/forge/github/pr-create.shgh pr create, preserving current behaviour so nothing changes for GitHub users.
  3. Add scripts/forge/gitea/pr-create.shtea pulls create --title --description --base --head, normalized to the same output shape as the GitHub script.
  4. Replace the hardcoded gh pr create in the skeleton prompts with the forge-concept invocation used by the other concepts.

Testing notes for whoever picks this up

  • Body text must survive intact. A shim in our fleet silently dropped --body-file and posted empty bodies at exit 0 for months; assert the created PR's body read back from the server equals the input, not that the command exited 0.
  • tea pulls create uses --description, not --body. Confirm against the installed tea, not from memory — the existing preset was authored against the REST API shape rather than the CLI's, which is what gitea forge preset is broken against the real tea CLI (0.14.2) #1137 / [Bugfix #1137] Fix gitea forge preset against the real tea CLI #1146 are about.
  • Worth confirming whether tea pulls create needs explicit --repo/--login. Autodetect prompting via huh and dying in non-TTY contexts was a real failure on tea 0.11.1; it does not reproduce on 0.14.2 with a single configured login, so any claim here should be version-qualified and tested rather than assumed.

Related

Happy to open a PR for this if the shape above is roughly what you'd want — the pr-create contract signature is the part worth agreeing on before anyone writes it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions