feat: use Patchwarden core PR sanity renderer #830

Merged
pdurlej merged 2 commits from codex/use-patchwarden-pr-sanity-renderer into main 2026-06-26 00:41:34 +02:00
Collaborator

Summary

  • delegate platform PR sanity comment rendering to patchwarden pr-sanity-comment
  • keep auto fallback for local/dev runs without Patchwarden installed
  • install Patchwarden from pdurlej/patchwarden@main in the trusted-base PR sanity workflow and require the core renderer there

Vistula

  • Value: quality
  • Effort: small
  • Lead time: same-day

Verification

  • env PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_pr_sanity.py

Refs pdurlej/patchwarden#69

## Summary - delegate platform PR sanity comment rendering to `patchwarden pr-sanity-comment` - keep `auto` fallback for local/dev runs without Patchwarden installed - install Patchwarden from `pdurlej/patchwarden@main` in the trusted-base PR sanity workflow and require the core renderer there ## Vistula - Value: quality - Effort: small - Lead time: same-day ## Verification - `env PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_pr_sanity.py` Refs pdurlej/patchwarden#69
feat: use Patchwarden PR sanity renderer
Some checks failed
canary-required / collect-diff (pull_request) Successful in 4s
infra-docs-drift / docs-drift (pull_request) Successful in 4s
platformctl plan / auto-apply scope (pull_request) Successful in 17s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 15s
python-ci / Python 3.11 (pull_request) Successful in 40s
python-ci / Python 3.12 (pull_request) Successful in 41s
python-ci / Python 3.13 (pull_request) Successful in 42s
workflow-lint / lint (pull_request) Successful in 5s
canary-required / canary (pull_request) Successful in 16s
base-is-main / guard (pull_request) Successful in 1s
patchwarden-client-dry-run / collect-diff (pull_request) Successful in 3s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 4s
patchwarden-client-dry-run / dry-run (pull_request) Successful in 18s
patchwarden-pr-sanity / sanity (pull_request) Failing after 22s
ba9f6a2786
fix: pass Patchwarden renderer through env
All checks were successful
base-is-main / guard (pull_request) Successful in 1s
infra-docs-drift / docs-drift (pull_request) Successful in 4s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 4s
platformctl plan / auto-apply scope (pull_request) Successful in 18s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 17s
python-ci / Python 3.11 (pull_request) Successful in 41s
python-ci / Python 3.12 (pull_request) Successful in 44s
python-ci / Python 3.13 (pull_request) Successful in 43s
workflow-lint / lint (pull_request) Successful in 5s
patchwarden-client-dry-run / dry-run (pull_request) Successful in 19s
canary-required / collect-diff (pull_request) Successful in 4s
patchwarden-client-dry-run / collect-diff (pull_request) Successful in 3s
canary-required / canary (pull_request) Successful in 15s
patchwarden-pr-sanity / sanity (pull_request) Successful in 37s
5c90d6b118
First-time contributor

Patchwarden PR sanity

Verdict: PASS WITH DEGRADED REVIEWER HEALTH - deterministic checks are clean, but this is not an approval signal.

Next step: Rerun PR sanity or inspect the degraded reviewer lane before unattended merge.

  • PR: 830
  • Commit: 5c90d6b118aa66c1cf0a524e0609647cf9546a39
  • Status: eligible_sanity_clean
  • Reviewer health: degraded
  • Security-sensitive label: present
  • Authority: Patchwarden policy signal; branch protection and automerge pilot remain merge authority.
  • Model mix: glm-5.2:cloud, deepseek-v4-pro:cloud, kimi-k2.7:cloud

What I checked

  • Changed files: 3
  • Deterministic blocker scan: blocked
  • Model reviewer lanes: 3
  • Comment contract: this comment is updated in place via a hidden Patchwarden marker.

Required Fixes

  • info sensitive-path-touched Sensitive path touched — .forgejo/workflows/patchwarden-pr-sanity.yml
    • Evidence: .forgejo/workflows/patchwarden-pr-sanity.yml
    • Next: Route through the existing 3+3/risk-tier process; model review remains advisory.

Reviewer Details

Model reviewer lanes

global-glm / glm-5.2:cloud

  • Status: ok

  • Verdict: OK

  • medium Patchwarden installed from mutable @main ref without pinning

    • Evidence: .forgejo/workflows/patchwarden-pr-sanity.yml: python3 -m pip install "git+https://git.pdurlej.com/pdurlej/patchwarden.git@main"; pr_sanity.py installs via PLATFORMCTL_PATCHWARDEN_BIN env with default 'patchwarden'. No commit SHA pin, so CI
    • Next: Pin to a specific commit SHA or tag (e.g. @) and record it in a lockfile/variable; consider verifying a checksum or using a release tag.
  • low Subprocess invocation trusts PATH-resolved binary without validation

    • Evidence: control-plane/platformctl/ci/pr_sanity.py: binary = os.environ.get("PLATFORMCTL_PATCHWARDEN_BIN", "patchwarden"); subprocess.run([binary, "pr-sanity-comment", ...], check=True, capture_output=True, text=True, timeout=30). No explicit path r
    • Next: Resolve binary to an absolute path (shutil.which) and optionally run a version/--help sanity check before rendering; the workflow already runs --help but the library path is unguarded.
  • low Empty stdout check happens after TemporaryDirectory cleanup

    • Evidence: control-plane/platformctl/ci/pr_sanity.py: with tempfile.TemporaryDirectory(...) as tmpdir: ... completed = subprocess.run(...); then if not completed.stdout.strip(): raise. The check is outside the with block but uses captured stdout, whic
    • Next: Include completed.stderr in the RuntimeError message when stdout is empty to aid diagnosis.

global-deepseek / deepseek-v4-pro:cloud

  • Status: ok

  • Verdict: OK

  • medium External dependency on patchwarden core renderer may break PR sanity workflow

    • Evidence: .forgejo/workflows/patchwarden-pr-sanity.yml installs patchwarden from git+https://git.pdurlej.com/pdurlej/patchwarden.git@main and sets PLATFORMCTL_PR_SANITY_COMMENT_RENDERER=patchwarden. If the tool is unavailable, incompatible, or produc
    • Next: Pin to a specific commit or tag, and consider adding a fallback mechanism in the workflow (e.g., try patchwarden, fallback to platform) to avoid blocking PRs due to renderer issues.
  • low Arbitrary binary execution via PLATFORMCTL_PATCHWARDEN_BIN environment variable

    • Evidence: control-plane/platformctl/ci/pr_sanity.py: render_markdown_with_patchwarden uses os.environ.get('PLATFORMCTL_PATCHWARDEN_BIN', 'patchwarden') to determine the binary to execute. An attacker who can control the environment could execute arbi
    • Next: Consider restricting the binary to a known path or validating it against an allowlist, or ensure the environment is fully controlled in CI.

redteam / kimi-k2.7:cloud

  • Status: error

  • Verdict: -

  • Note: Ollama HTTP 404: {"error": "model 'kimi-k2.7:cloud' not found"}

  • Findings: none

Policy notes

  • Patchwarden PR sanity is the first merge-lane signal for this PR.
  • Models produce findings; Patchwarden/policy produces decisions.
  • Model findings alone do not fail the status check; they require human or agent disposition.
  • Formal approval is separate from this comment and requires clean reviewer health.
  • Automerge remains delegated to branch protection and the automerge pilot.
<!-- patchwarden-pr-sanity:pdurlej/platform:PR-830 --> <!-- patchwarden.pr_sanity.v1 status=eligible_sanity_clean model_health=degraded pr=830 sha=5c90d6b118aa66c1cf0a524e0609647cf9546a39 --> # Patchwarden PR sanity **Verdict:** PASS WITH DEGRADED REVIEWER HEALTH - deterministic checks are clean, but this is not an approval signal. **Next step:** Rerun PR sanity or inspect the degraded reviewer lane before unattended merge. - PR: `830` - Commit: `5c90d6b118aa66c1cf0a524e0609647cf9546a39` - Status: `eligible_sanity_clean` - Reviewer health: `degraded` - Security-sensitive label: `present` - Authority: Patchwarden policy signal; branch protection and automerge pilot remain merge authority. - Model mix: `glm-5.2:cloud`, `deepseek-v4-pro:cloud`, `kimi-k2.7:cloud` ## What I checked - Changed files: `3` - Deterministic blocker scan: `blocked` - Model reviewer lanes: `3` - Comment contract: this comment is updated in place via a hidden Patchwarden marker. ## Required Fixes - **`info` `sensitive-path-touched`** Sensitive path touched — `.forgejo/workflows/patchwarden-pr-sanity.yml` - Evidence: `.forgejo/workflows/patchwarden-pr-sanity.yml` - Next: Route through the existing 3+3/risk-tier process; model review remains advisory. ## Reviewer Details <details> <summary>Model reviewer lanes</summary> ### `global-glm` / `glm-5.2:cloud` - Status: `ok` - Verdict: `OK` - **`medium`** Patchwarden installed from mutable @main ref without pinning - Evidence: `.forgejo/workflows/patchwarden-pr-sanity.yml: python3 -m pip install "git+https://git.pdurlej.com/pdurlej/patchwarden.git@main"; pr_sanity.py installs via PLATFORMCTL_PATCHWARDEN_BIN env with default 'patchwarden'. No commit SHA pin, so CI ` - Next: Pin to a specific commit SHA or tag (e.g. @<sha>) and record it in a lockfile/variable; consider verifying a checksum or using a release tag. - **`low`** Subprocess invocation trusts PATH-resolved binary without validation - Evidence: `control-plane/platformctl/ci/pr_sanity.py: binary = os.environ.get("PLATFORMCTL_PATCHWARDEN_BIN", "patchwarden"); subprocess.run([binary, "pr-sanity-comment", ...], check=True, capture_output=True, text=True, timeout=30). No explicit path r` - Next: Resolve binary to an absolute path (shutil.which) and optionally run a version/--help sanity check before rendering; the workflow already runs --help but the library path is unguarded. - **`low`** Empty stdout check happens after TemporaryDirectory cleanup - Evidence: `control-plane/platformctl/ci/pr_sanity.py: with tempfile.TemporaryDirectory(...) as tmpdir: ... completed = subprocess.run(...); then if not completed.stdout.strip(): raise. The check is outside the with block but uses captured stdout, whic` - Next: Include completed.stderr in the RuntimeError message when stdout is empty to aid diagnosis. ### `global-deepseek` / `deepseek-v4-pro:cloud` - Status: `ok` - Verdict: `OK` - **`medium`** External dependency on patchwarden core renderer may break PR sanity workflow - Evidence: `.forgejo/workflows/patchwarden-pr-sanity.yml installs patchwarden from git+https://git.pdurlej.com/pdurlej/patchwarden.git@main and sets PLATFORMCTL_PR_SANITY_COMMENT_RENDERER=patchwarden. If the tool is unavailable, incompatible, or produc` - Next: Pin to a specific commit or tag, and consider adding a fallback mechanism in the workflow (e.g., try patchwarden, fallback to platform) to avoid blocking PRs due to renderer issues. - **`low`** Arbitrary binary execution via PLATFORMCTL_PATCHWARDEN_BIN environment variable - Evidence: `control-plane/platformctl/ci/pr_sanity.py: render_markdown_with_patchwarden uses os.environ.get('PLATFORMCTL_PATCHWARDEN_BIN', 'patchwarden') to determine the binary to execute. An attacker who can control the environment could execute arbi` - Next: Consider restricting the binary to a known path or validating it against an allowlist, or ensure the environment is fully controlled in CI. ### `redteam` / `kimi-k2.7:cloud` - Status: `error` - Verdict: `-` - Note: Ollama HTTP 404: {"error": "model 'kimi-k2.7:cloud' not found"} - Findings: none </details> ## Policy notes - Patchwarden PR sanity is the first merge-lane signal for this PR. - Models produce findings; Patchwarden/policy produces decisions. - Model findings alone do not fail the status check; they require human or agent disposition. - Formal approval is separate from this comment and requires clean reviewer health. - Automerge remains delegated to branch protection and the automerge pilot.
pdurlej approved these changes 2026-06-26 00:41:23 +02:00
pdurlej left a comment

Approved by operator scope: Patchwarden PR sanity renderer unification; all required checks green on this head SHA.

Approved by operator scope: Patchwarden PR sanity renderer unification; all required checks green on this head SHA.
pdurlej referenced this pull request from a commit 2026-06-26 00:41:35 +02:00
Sign in to join this conversation.
No reviewers
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
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/platform!830
No description provided.