fix(canary): include PR body in reviewer context #449

Merged
pdurlej merged 1 commit from codex/w6/governance-plan into main 2026-05-24 21:12:45 +02:00
Collaborator

Canary status: missing — rely on required Forgejo checks before merge

Canary Context Pack

Product story

Reviewer automation is only useful if reviewers see the operator intent and PR contract. Today the canary and Patchwarden paths can see the title, changed files, and diff, but not the PR body/Canary Context Pack.

What changed

  • canary-required.yml captures the PR body from the trusted event payload and passes it to run_review --pr-description-file.
  • patchwarden-pr-sanity.yml captures the PR body from the trusted event payload and passes it to pr_sanity --pr-description-file.
  • pr_sanity.py includes PR body in model prompts and records only descriptionPresent in JSON output, not the raw body.
  • W6 is marked active and W5 foundation is marked closed enough to proceed.

Why it changed

This starts W6a by addressing #85: AI reviewers should not infer intent from diff alone.

Files touched

  • .forgejo/workflows/canary-required.yml
  • .forgejo/workflows/patchwarden-pr-sanity.yml
  • control-plane/platformctl/ci/pr_sanity.py
  • control-plane/platformctl/tests/test_pr_sanity.py
  • state/STATUS_NOW.md
  • state/cycle/W5-modularity-foundation-output.md
  • state/cycle/W6-agent-ci-governance-output.md
  • state/roadmap/current-platform-roadmap.md

Relevant context

  • Milestone 06 / W6a CI guardrails
  • Issue #85
  • ADR-0017 no stacked PRs / branch protection context
  • docs/forgejo-agent-operations.md

Runtime evidence

No runtime mutation. Repo-only workflow/tooling/status update.

Known constraints

The PR body is already Forgejo PR metadata. This change does not print it into status docs or Patchwarden JSON; it only feeds it to reviewer prompts and stores the CI artifact already scoped to the PR run.

Explicit out-of-scope

  • No autonomous merge policy yet.
  • No branch-protection UI/API mutation.
  • No Forgejo runner or production runtime mutation.
  • No sensitive-path routing enforcement change yet; that remains #86/W6c.

Requested decision

Merge if required Forgejo checks are green.

Merge blockers

  • Workflow lint fails.
  • Patchwarden/canary cannot collect the PR body artifact.
  • pr_sanity tests fail.

Spec sources read

  • state/STATUS_NOW.md
  • state/roadmap/current-platform-roadmap.md
  • docs/forgejo-agent-operations.md
  • .forgejo/workflows/canary-required.yml
  • .forgejo/workflows/patchwarden-pr-sanity.yml
  • .forgejo/workflows/platformctl-plan.yml
  • .forgejo/workflows/workflow-lint.yml
  • control-plane/platformctl/ci/pr_sanity.py
  • control-plane/platformctl/tools/run_review.py
  • control-plane/platformctl/tools/providers/_base.py

Test plan

  • PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_pr_sanity.py control-plane/platformctl/tests/test_run_review.py → 50 passed
  • python3 control-plane/platformctl/ci/lint_workflows.py --policy .forgejo/ci-policy.yaml --workflows .forgejo/workflows --markdown /tmp/w6-workflow-lint.md --json /tmp/w6-workflow-lint.json → passed with 0 findings
  • git diff --check → clean

Closes #85

Canary status: missing — rely on required Forgejo checks before merge ## Canary Context Pack ### Product story Reviewer automation is only useful if reviewers see the operator intent and PR contract. Today the canary and Patchwarden paths can see the title, changed files, and diff, but not the PR body/Canary Context Pack. ### What changed - `canary-required.yml` captures the PR body from the trusted event payload and passes it to `run_review --pr-description-file`. - `patchwarden-pr-sanity.yml` captures the PR body from the trusted event payload and passes it to `pr_sanity --pr-description-file`. - `pr_sanity.py` includes PR body in model prompts and records only `descriptionPresent` in JSON output, not the raw body. - W6 is marked active and W5 foundation is marked closed enough to proceed. ### Why it changed This starts W6a by addressing #85: AI reviewers should not infer intent from diff alone. ### Files touched - `.forgejo/workflows/canary-required.yml` - `.forgejo/workflows/patchwarden-pr-sanity.yml` - `control-plane/platformctl/ci/pr_sanity.py` - `control-plane/platformctl/tests/test_pr_sanity.py` - `state/STATUS_NOW.md` - `state/cycle/W5-modularity-foundation-output.md` - `state/cycle/W6-agent-ci-governance-output.md` - `state/roadmap/current-platform-roadmap.md` ### Relevant context - Milestone 06 / W6a CI guardrails - Issue #85 - ADR-0017 no stacked PRs / branch protection context - `docs/forgejo-agent-operations.md` ### Runtime evidence No runtime mutation. Repo-only workflow/tooling/status update. ### Known constraints The PR body is already Forgejo PR metadata. This change does not print it into status docs or Patchwarden JSON; it only feeds it to reviewer prompts and stores the CI artifact already scoped to the PR run. ### Explicit out-of-scope - No autonomous merge policy yet. - No branch-protection UI/API mutation. - No Forgejo runner or production runtime mutation. - No sensitive-path routing enforcement change yet; that remains #86/W6c. ### Requested decision Merge if required Forgejo checks are green. ### Merge blockers - Workflow lint fails. - Patchwarden/canary cannot collect the PR body artifact. - `pr_sanity` tests fail. ## Spec sources read - `state/STATUS_NOW.md` - `state/roadmap/current-platform-roadmap.md` - `docs/forgejo-agent-operations.md` - `.forgejo/workflows/canary-required.yml` - `.forgejo/workflows/patchwarden-pr-sanity.yml` - `.forgejo/workflows/platformctl-plan.yml` - `.forgejo/workflows/workflow-lint.yml` - `control-plane/platformctl/ci/pr_sanity.py` - `control-plane/platformctl/tools/run_review.py` - `control-plane/platformctl/tools/providers/_base.py` ## Test plan - `PYTHONPATH=control-plane python3 -m pytest control-plane/platformctl/tests/test_pr_sanity.py control-plane/platformctl/tests/test_run_review.py` → 50 passed - `python3 control-plane/platformctl/ci/lint_workflows.py --policy .forgejo/ci-policy.yaml --workflows .forgejo/workflows --markdown /tmp/w6-workflow-lint.md --json /tmp/w6-workflow-lint.json` → passed with 0 findings - `git diff --check` → clean Closes #85
fix(canary): include PR body in reviewer context
All checks were successful
base-is-main / guard (pull_request) Successful in 1s
canary-required / collect-diff (pull_request) Successful in 5s
infra-docs-drift / docs-drift (pull_request) Successful in 4s
patchwarden-pr-sanity / collect-diff (pull_request) Successful in 4s
python-ci / Python 3.12 (pull_request) Successful in 43s
python-ci / Python 3.13 (pull_request) Successful in 42s
workflow-lint / lint (pull_request) Successful in 6s
canary-required / canary (pull_request) Successful in 14s
platformctl plan / auto-apply scope (pull_request) Successful in 22s
pyfallow / Pyfallow gate (control-plane) (pull_request) Successful in 20s
python-ci / Python 3.11 (pull_request) Successful in 41s
patchwarden-pr-sanity / sanity (pull_request) Successful in 22s
a265455647
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
1 participant
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!449
No description provided.