Skip to content

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

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.

  • Use an issue_comment workflow on one open issue labeled agent-publish, restricted to the allowlisted actor prillcode and a /publish-bot JSON command naming a chatgpt/ or agent/ 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 current main.
  • Create one commit authored and committed by commitmentdesk-dev[bot] <361400784+commitmentdesk-dev[bot]@users.noreply.github.com>, append a bot Signed-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.
  • 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.
  • 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.