governance: ADR-0017 — no stacked PRs to main + 4-layer guard (operator-protection) #220
No reviewers
Labels
No labels
W6d-automerge-calibration
agent/claude-code
agent/codex
agent/hermes
agent/iskra
agent/ollama
agent/patchwarden
automerge-candidate
class/security-sensitive
cutover-gate
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
iterating
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
large-impact
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
meta
mode:operator-only
mode:patchwarden-iskra-approved
mode:safe-auto
needs-operator-decision
needs-triage
not-ready
observed/erroring
observed/needs-followup
observed/pending
observed/retire-candidate
observed/unused
observed/used
operator-emotional
owner-attention
phase/02
phase/03
priority:p0
priority:p1
priority:p2
priority:p3
proposed
ready-for-agent
ready-for-operator
recovery
review:claude-reviewed
review:codex-reviewed
review:dziadek-reviewed
review:needs-human
risk/exposure
risk/process
risk/product
risk/runtime
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:codex-ready
status:merged:pending-evidence
status:needs-evidence
status:operator-needed
status:parked
tier/full
tier/lite
tier/stacked
tier:0-platform-substrate
tier:1-iskra-value-layer
tier:2-tools-products-modules
type:bug
type:chore
type:docs
type:feat
type:policy
type:research
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
pdurlej/platform!220
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/orders/adr-0017-stack-guards"
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?
Tier classification per ADR-0007: Lite (4-layer guard, ~565 LoC additive, no sacred paths, no schema, no runtime; two new workflows are read-only / comment-only-during-soak / no secrets consumed). Operator may upgrade to Full if preferred — both workflows parseable, both small enough to spot-review.
Why now
Responds to operator's exact ask 2026-05-12 01:45 CEST:
Incident context: on 2026-05-11/12 night, Phase 3 apply chain was authored as 7 stacked PRs (#161–#167). Operator clicked Merge in Forgejo UI 7 times. Only #162 + #161 (independent) actually landed on
origin/main. PRs #163–#167 merged into the stack-branches, not main. Forgejo UI reportedmerged: True5 times silently incorrectly. Codex diagnosed during wake-up cross-check and opened rescue PR #215.ADR-0017 closes the trap class.
Four layers (defense in depth)
.forgejo/workflows/base-is-main.yml.forgejo/workflows/merged-in-main-audit.ymldecisions/0017-...md+REVIEW.md§ Stack guard ruletier/stackedlabel + consolidator-PR planstate/pan-herbatka-day1-checklist.md§ 13Files (5 changed, +415 lines)
decisions/0017-no-stacked-prs-to-main.md— full ADR with git-log evidence from the incident.forgejo/workflows/base-is-main.yml— Layer 1 (~90 LoC; yaml-parseable; no secrets).forgejo/workflows/merged-in-main-audit.yml— Layer 2 (~130 LoC; soak-period mode initially)REVIEW.md— Stack guard rule (~30 LoC, inserted between Risk-proportional tier and Re-review convergence sections)state/pan-herbatka-day1-checklist.md— § 13 amendment (~35 LoC, operator-facing affordance)What this PR does NOT do
Operator's North Star check
Does this PR reduce operator-attention-cost?
Verdict: ship.
Test plan
tier/stackedlabel + consolidator-PR) is sufficient for the rare legitimate-stack casebase-is-main / guardas required status check (the auto-opened follow-up issue describes the click path)Spec sources read
decisions/0001-canary-mandatory-pm-cadence.md(canary baseline)decisions/0007-risk-proportional-canary.md(tier discipline; classifying this PR as Lite)REVIEW.mdexisting structure (insertion point + style)state/pan-herbatka-day1-checklist.md§ 12 (insertion point for new § 13).forgejo/workflows/canary-required.yml(workflow style + trust-boundary header reference)pdurlej/platformmain 2026-05-12 02:00 CEST (incident evidence; cited in ADR § References)🍵 Drafted by claude (Pan Herbatka) 2026-05-12 02:00 CEST.
Refs: PR #215 (Codex rescue, in flight), PR #187 (ADR renumeration merged 01:51, separate fire), ADR-0007 (Lite tier framework this PR uses)
mainwithbase-is-main / guardrequired (QUEUED — post-RS2000 cutover only) #243Operator-action note — branch protection toggle QUEUED, not immediate
Layer 1 status check
base-is-main / guardis inert until operator enables "Require status checks to pass before merging" in Forgejo branch-protection settings formain. That's by design — workflow ships green-on-day-1, activation is operator-controlled.Per operator decision 2026-05-12 ~02:15 CEST: DO NOT enable now. Codex is approaching first RS2000 cutover (PR #215 + apply pipeline first real use); zero-changes window applies.
Follow-up issue auto-opened: #243 with label
owner-attention— will surface instate/STATUS_NOW.mdOwner Action Board on next wakeup. Issue body lists exact preconditions (cutover done + 24h smoke pass + no in-flight stacks) before operator clicks the toggle.Until then:
Full defense activates the moment branch protection toggle flips — operator-controlled timing.
🍵