0018. Bot-authored agent publishing
- Status: Accepted
- Date: 2026-11-26
- Deciders: Aaron (owner)
- Related: ADR 0013, ADR 0014;
openspec/specs/developer-workflow/spec.md
Context
Section titled “Context”The ChatGPT GitHub connector can create branches and post issue comments but cannot dispatch a
workflow. Branches it created merged as prillcode history. The repository needs a constrained
handoff that publishes connector work as commitmentdesk-dev[bot] without running staged agent code
in a privileged workflow.
Decision
Section titled “Decision”- Use an
issue_commentworkflow on one open issue labeledagent-publish, restricted to the allowlisted actorprillcodeand a/publish-botJSON command naming achatgpt/oragent/branch and its exact SHA. - Fetch the staged commit but never check it out. Compute the diff from its merge base with
main, reject.github/**and.gitmodules, cap the patch, verify it applies, and apply it to currentmain. - Create one commit authored and committed by
commitmentdesk-dev[bot] <361400784+commitmentdesk-dev[bot]@users.noreply.github.com>, append a botSigned-off-by, and strip connector-supplied authorship trailers. - Push a
bot/branch and create or update the pull request with a short-lived app token downscoped to Contents write and Pull requests write. The app is not a branch-protection bypass and never merges. - Delete the staged branch after publishing unless the command opts out.
- Allow squash merges only and delete head branches after merge, so a human squash merge produces one
bot-authored commit on
main. - Document the command, setup, safety boundaries, and dry run in
docs/operations/agent-publishing.md.
Consequences
Section titled “Consequences”- Connector branches never merge as
prillcode; the pull request author and squashed commit author are the bot. - The app private key stays in Actions secrets, and the privileged workflow does not execute staged code.
- Workflow, action, parser, CODEOWNERS, and submodule changes need a human-authored pull request.
- The connector’s temporary branch commits remain until deletion but are not merged.
- Branch protection remains a manual step and is unavailable on a private GitHub Free repository.
- Future automation must keep pull request CI credential-free and deployment in protected environments.
Alternatives considered
Section titled “Alternatives considered”- A PAT in the chat: broader, harder to rotate, and exposes a long-lived credential.
- Checking out and squashing the staged branch: runs checkout filters and leaves agent code in the workspace while the app token is available.
- Letting the connector open the pull request: GitHub cannot change the pull request author afterward.
- Rebase and merge: preserves intermediate bot branch commits and rewrites committer data.
ADR 0016 and ADR 0017 are reserved by the active organization-membership and hosted-deployment
plans.