refactor(v0): move hardcoded issue/PR policies to TOML (Opus 4.6 review §II.3) #81
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#81
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?
Goal
Close the last unaddressed code weakness from the 2026-05-28 Cloud Opus 4.6 repo review (§II.4 "Hardkodowane polityki w kodzie Pythona"): several policy constants are hardcoded in
src/patchwarden/, so changing them needs a code commit. Move them into the policy bundle TOML with a hardcoded fallback — exactly the pattern slice B (#78) used for repair classes.What's hardcoded today
src/patchwarden/issue_check.py:REQUIRED_SECTIONS(dict of section → alias tuples, incl. Polish aliases),NO_GO_LABELS, and anyOWNER_ATTENTION_LABELSif present.src/patchwarden/policy_bundle.py(orpr_check.py):SENSITIVE_CLASSIFICATIONS(the frozenset of classes that force manual review).Read these first to get the EXACT current values — behavior must stay byte-for-byte identical when no TOML overrides are given.
Scope
policies/platform.v0.toml(and mirror iniskra-openclaw.v0.tomlif it has issue gating) for:[issue_check]→required_sections(table of section → list-of-aliases),no_go_labels(list)[classification.sensitive])tomllib, same as slice B). When a section is absent, fall back to the hardcoded default which STAYS in the module as the canonical default.evaluate_issue/ classification the same wayevaluate_pull_requestalready takes aPolicyBundle.Hard constraints (this is a refactor — behavior must not change)
tests/test_issue_check.py,tests/test_pr_check.py,tests/test_policy_bundle.pymust pass UNCHANGED. Do not edit those tests except to add new ones.ValueError(fail-safe), never a permissive/empty policy (same discipline as slice B).src/patchwarden/(tomllibis stdlib). unittest, not pytest.tests/test_d20_architectural_boundary.py; it must stay green.schema_version.Acceptance
PYTHONPATH=src python3 -m unittest discover tests→ all green (existing count + new tests).grep -rnE "import (toml|tomlkit|yaml|requests|httpx)" src/patchwarden/→ zero hits (tomllib stdlib is fine).git grep -n "REQUIRED_SECTIONS\|NO_GO_LABELS\|SENSITIVE_CLASSIFICATIONS" src/still shows the constants present (as fallback defaults).Spec sources
src/patchwarden/issue_check.py,src/patchwarden/policy_bundle.py,src/patchwarden/pr_check.pypolicies/platform.v0.tomlsrc/patchwarden/runtime_repair.pyREPAIR_CLASS_POLICIES TOML loader (PR #78) — mirror its loader + fallback + fail-safe shapeStatus flow
ready-for-agent→ agent claims → PR → operator review → mergeCreated 2026-06-08 by claude. Atomic for a cousin (gemini via Antigravity) — same validated pattern as #78.