docs(decisions): ADR 0002 — CI enforcement of canary 3+3 + hard iteration cap #44
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!44
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "claude/decisions/adr-0002-ci-enforcement"
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?
Canary status: missing — fire canary 3+3 before merge
Closes ADR 0001 enforcement open_loop 3 weeks early (deadline target was W21 2026 / ~2026-05-24). Lands today (2026-05-03) in same cycle as ADR 0001 amendments + STATE_OF_PLATFORM v2 + AGENTS.md per operator's 5-step plan.
Canary Context Pack
Product story
ADR 0001 made canary 3+3 mandatory; enforcement is currently convention-only (Rule 1a inline as interim). Operator: non-technical owner needs CI-level enforcement so the rule doesn't get silently re-forgotten under productivity pressure (the exact failure mode ADR 0001 was bounding). ADR 0002 adds Forgejo Actions workflow that mechanically blocks merge without
approve_merge, plus formalizes hard 3-iter cap with 6 named terminal actions.What changed
decisions/0002-ci-enforcement-canary.md(150 lines, Nygard format, 4 rules, consequences, compliance, rollback, open_loops captured).forgejo/workflows/canary-required.yml(154 lines): runs on PR opened/synchronize/reopened for relevant paths, generates diff + files, runs platformctl.tools.run_review, checks decision_packet.md, sets check statusWhy it changed
ADR 0001 v1 canary HIGH risk: 'Mandatory rule unenforced at operator decision surface' (product-gpt). Inline mitigation Rule 1a was operator-amended fix in v2. Full mitigation is CI. Operator's 5-step plan today brought it forward.
Files touched
decisions/0002-ci-enforcement-canary.md(new, 150 lines).forgejo/workflows/canary-required.yml(new, 154 lines)Relevant context
platformctl.tools.run_review— orchestrator script that workflow invokesRuntime evidence
N/A — workflow added but does not activate until: (a) ZAI_API_KEY repo secret set, (b) CANARY_FORGEJO_TOKEN repo secret set, (c) branch protection on main configured to require canary-required check, (d) forgejo-runner verified capable. All four are TASKs in ADR §Open loops.
Known constraints
Explicit out-of-scope
Requested decision
approve_merge after canary 3+3 passes. PR size: Large (ADR + CI + workflow rule). Hard iter cap: 3.
Merge blockers
Test plan
canary-requiredcheckAmendment iter 2 (commit
2462362) per Oracle review 2026-05-04. Authored asclaude.5 Oracle amendments + Oracle escalation discipline section. Amendments: independent-quality-voices phrasing aligned with #42; calendar-first "~3 weeks" removed (replaced with attention-bounded sequencing); Canary status state set aligned with ADR 0002 6 terminal actions; "surface to operator BEFORE acting" → "surface ambiguity with proposed default + consequence + fallback"; canary-scope-when-missing → classify by paths+size and propose default. Plus new section: Oracle is LAST RESORT (not primary review); when YES (iter-3 cap reached + no clear terminal; cross-cutting arch decisions); when NO (routine PRs, "want second opinion", "feels hard"); why discipline matters; format for legitimate escalation.
Ready for operator review. Per ADR 0001 hard 3-iter cap: this is iter 2 of 3. If canary re-fired and finds new issues, iter 3 forces terminal action choice per ADR 0002 Rule 2.
Amendment iter 2 (commit
78be3b6) per Oracle review 2026-05-04 — substantive security architecture rewrite. Authored asclaude.CRITICAL fix: v1 workflow ran PR-controlled code (
platformctl.tools.run_review) with secrets (ZAI_API_KEY,CANARY_FORGEJO_TOKEN) in environment — classic supply-chain attack vector (a malicious PR could modifyrun_review.pyto exfiltrate secrets).v2 architecture: 2-job pattern with strict trust boundary:
collect-diff(UNPRIVILEGED): alpine:3.19,permissions: contents: readonly,persist-credentials: falseon checkout, NO secrets in env. Generates diff + files-changed list, classifies canary-required paths via in-job grep (not workflowpaths:filter — undocumented in target Forgejo). Uploads as workflow artifact.canary(PRIVILEGED, secret-bearing):needs: collect-diff, runs only if matched_lines!=0. Has secrets. Checks out BASE/MAIN ONLY — never PR head. Downloads PR diff artifact (data only). Runsplatformctl.tools.run_reviewfrom base/main code path. PR head content NEVER imported, scripted, or executed.Other Oracle findings addressed:
Accepted→Accepted design, NOT operationalwith explicit 5-precondition gate (secrets configured + runner verified + branch protection + first test PR passes + trust boundary verified)state/reports/STATE_OF_PLATFORM_*.mdnow exclusively in canary-paths (not doc-only-carveout);state/cycle-counter.mdadded to carveout list insteaddecision_packet.json(jq-parsed, machine-readable) instead of markdown grep ondecision_packet.md${FORGEJO_OUTPUT:-$GITHUB_OUTPUT}fallback per Forgejo Actions compatibilitypaths:filter onpull_requestnot relied upon (in-job classifier incollect-diffdoes the filtering)--post-forgejo-comment(Forgejo API). Sidesteps the skip-ci recursion question entirely (Forgejo's actual skip tokens noted in workflow comment for future reference:[skip ci],[ci skip],[no ci],[skip actions],[actions skip])Ready for operator review. Per ADR 0001 hard 3-iter cap: this is iter 2 of 3 (iter 1 = Oracle external review). If canary re-fired and finds new issues, iter 3 forces terminal action choice per ADR 0002 Rule 2.
pdurlej/platformapdurlej/iskra-openclaw— co gdzie mieszka #74