bug: surface invalid automerge merge-bot token as blocked state #243
Labels
No labels
agent/claude-code
agent/codex
agent/gemini
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
area:business-model
area:competitive
area:discovery
area:forgejo
area:metrics
area:product-strategy
area:v0-core
cagan-grade-approved
client:platform
dependency/blocked
dependency/blocks-others
dependency/cross-repo
dependency/needs-confirmation
domain:agents
domain:ci
domain:docs
domain:forgejo
domain:infra
domain:memory
domain:runtime
domain:signal
domain:ux
flow/architecture
flow/blocked
flow/deployed
flow/done
flow/implementation
flow/intake
flow/maintained
flow/observed
flow/ready
flow/refining
flow/retired
flow/review
judge/codex-candidate
judge/hermes-candidate
judge/low-confidence
judge/needs-refinement
judge/operator-needed
judge/p0
judge/p1
judge/p2
judge/p3
judge/park
judge/patchwarden-candidate
judge/stale-priority
kind/adr
kind/bug
kind/chore
kind/feature
kind/infra
kind/ops
kind/refactor
kind/research
kind:artifact
kind:decision
kind:dogfood
kind:epic
kind:implementation
kind:research
merge/auto
merge/manual
merge/manual-dependency-conflict
merge/manual-failing-tests
merge/manual-merge-conflict
merge/manual-missing-review
merge/manual-operator-preference
merge/manual-red-zone
merge/manual-security-sensitive
merge/manual-unclear-scope
merge/manual-unknown
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
priority:p0
priority:p1
priority:p2
priority:p3
ready-for-agent
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
safety:external-write
safety:no-prod-mutation
safety:prod-impact
safety:secret-touch
size/large
size/medium
size/small
size/tiny
size/unknown
source/adr
source/agent-generated
source/manual
source/operator-chat
source/voice-note
status:blocked
status:blocked-on-discovery
status:cagan-grade-review-pending
status:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:needs-operator-decision
status:operator-needed
status:parked
tier:0-anchor
tier:0-platform-substrate
tier:1-core
tier:1-iskra-value-layer
tier:2-supporting
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
wave:1-foundation
wave:2-positioning
wave:3-validation
wave:4-economics
wave:5-operating
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/patchwarden#243
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Bug
Patchwarden's W6d/automerge integration can report a PR as clean and ready, but the final controller merge still fails because the runner-local merge-bot token is invalid. The failure currently appears only inside the
automerge-pilotActions log, after Patchwarden has already produced green evidence.Platform Case
Repo:
pdurlej/platformRelated items:
automerge-pilotcollectionExact PR/head under test:
pdurlej/platform#8263b1d252a97f18934d7385fffb16aea4ab8272aa0b6615852544d8b339f15998f6d24c7f8f3d81a40Observed
After #827 was merged,
automerge-pilotrun #5944 progressed correctly through the earlier blocker:Collect Forgejo facts: passed viatoken_env=GITHUB_TOKENautomerge_readiness.py:ready_for_controller_merge,ready=truebase-is-main / guard (pull_request)patchwarden-pr-sanity / sanity (pull_request)patchwarden-client-dry-run / dry-run (pull_request)approved=truefor the exact PR/head SHA.The run then failed in the final merge actor while validating
PLATFORM_AUTOMERGE_BOT_TOKEN:No secret value was printed in logs. The failing token name is runner-local
PLATFORM_AUTOMERGE_BOT_TOKEN.Expected
Patchwarden/merge-safety should surface this as a first-class blocked state before the operator has to inspect raw Actions logs, for example:
blocked_merge_actor_credentialor equivalent/api/v1/userPLATFORM_AUTOMERGE_BOT_TOKENfor the non-cousin merge-bot identity, then rerun the same PR/headThis should not weaken the W6d contract.
GITHUB_TOKENand cousin tokens must not become merge actors.Why This Belongs In Patchwarden
Patchwarden is the operator-facing safety layer for PR/automerge state. In this case, the PR was clean and the controller path reached final approval, but the operator-facing state still required log spelunking to distinguish:
The actual result was the fourth case.
Acceptance Criteria
PLATFORM_AUTOMERGE_BOT_TOKEN, then rerunautomerge-pilotfor the same PR/head.codex,claude,glm,pdurlej,GITHUB_TOKEN, or the PR author to act as merge actor.Labels Suggested
bug,client:platform,domain:ci,domain:forgejo,dependency/cross-repo,agent/codexAddressed in platform PR #828: pdurlej/platform#828
Merged commit:
f4ddb78724023edf21188e28e702f54a6fcc984e.What changed:
automerge_actor.pynow writesplatform_automerge_actor_readiness.v0for merge actor auth/identity checks.PLATFORM_AUTOMERGE_BOT_TOKENbecomesblocked_merge_actor_credentialwith a repair instruction and no token/body leakage.GITHUB_TOKENis rejected before token login.codex,claude,glm,pdurlej, and the PR author are rejected as merge actors, case-insensitively.Verification:
python3 -m pytest control-plane/platformctl/tests/test_automerge_actor.pypython3 -m pytest control-plane/platformctl/tests/test_automerge_actor.py control-plane/platformctl/tests/test_forgejo_ci_scripts_contract.py control-plane/platformctl/tests/test_automerge_readiness.pyOperational note: while merging this, the required
patchwarden-pr-sanity / sanitystatus took 6m36s and the first status read looked pending because Forgejo returns status history out of order. That is a separate PR-sanity health/UX follow-up, not part of this issue.