feat(contract): accept required checks in contract-pr #86

Merged
pdurlej merged 1 commit from contract-pr-required-checks into main 2026-06-17 21:24:18 +02:00
Collaborator

Summary

  • Add --required-check NAME=STATUS@SHA to patchwarden contract-pr.
  • Merge explicit required checks with checks loaded from PR metadata before evaluating the Contract Run.
  • Document why this matters for artifact-only client workflows.

Why

contract-pr can fetch Forgejo PR metadata directly, but client workflows often pre-collect metadata and call it with --metadata-file. In that artifact mode, required checks should not silently disappear just because the client did not hand-edit checks into the JSON payload. This keeps the required_checks expert usable in CI glue without reimplementing the evaluator.

Verification

  • PYTHONPATH=src python3 -m pytest -q tests/test_contract_pipeline.py tests/test_cli_contract_pr.py tests/test_contract_run.py tests/test_cli_evaluate.py -> 24 passed
  • PYTHONPATH=src python3 -m pytest -q -> 261 passed
  • git diff --check -> clean

Notes

  • No Forgejo mutation path changes.
  • No workflow changes in this PR.
  • This prepares the next platform workflow revision to pass collected statuses explicitly when fetch mode is not available.
## Summary - Add `--required-check NAME=STATUS@SHA` to `patchwarden contract-pr`. - Merge explicit required checks with checks loaded from PR metadata before evaluating the Contract Run. - Document why this matters for artifact-only client workflows. ## Why `contract-pr` can fetch Forgejo PR metadata directly, but client workflows often pre-collect metadata and call it with `--metadata-file`. In that artifact mode, required checks should not silently disappear just because the client did not hand-edit checks into the JSON payload. This keeps the `required_checks` expert usable in CI glue without reimplementing the evaluator. ## Verification - `PYTHONPATH=src python3 -m pytest -q tests/test_contract_pipeline.py tests/test_cli_contract_pr.py tests/test_contract_run.py tests/test_cli_evaluate.py` -> 24 passed - `PYTHONPATH=src python3 -m pytest -q` -> 261 passed - `git diff --check` -> clean ## Notes - No Forgejo mutation path changes. - No workflow changes in this PR. - This prepares the next platform workflow revision to pass collected statuses explicitly when fetch mode is not available.
Allow contract-pr artifact mode to receive explicit required check inputs so the required_checks expert stays active when client workflows pre-collect PR metadata.
Collaborator

Iskra judgment

Field Value
Target pdurlej/patchwarden#pull_request#86
Priority p2
Action patchwarden_candidate
Scores reach 4 / impact 4 / confidence 5
Piotr fit high
Effort small
Labels judge/p2, judge/patchwarden-candidate
Judge iskra via openclaw

Rationale: This is P2 Patchwarden-candidate work because it hardens contract-pr for artifact-only CI clients without changing Forgejo mutation paths.

Caveat: Review should confirm duplicate or conflicting required-check sources are handled predictably before merge.

Structured openclaw.judge.v0 payload
<!-- openclaw.judge.v0 -->
{
  "confidence": 5,
  "effort_hint": "small",
  "escalation": {
    "kind": "patchwarden_review",
    "reason": "This is a Patchwarden contract evaluator change with direct CI artifact workflow impact."
  },
  "evidence_refs": [
    {
      "note": "PR adds an explicit required-check argument to patchwarden contract-pr and merges it with PR metadata checks before evaluation.",
      "type": "forgejo",
      "value": "pr-title-body-labels-and-target-snapshot"
    },
    {
      "note": "Body explains artifact-only client workflows can otherwise lose required checks when using metadata files.",
      "type": "forgejo",
      "value": "pr-body-why"
    },
    {
      "note": "Verification reports focused contract tests, full pytest suite, and diff check passing.",
      "type": "check",
      "value": "pr-body-verification-summary"
    }
  ],
  "impact": 4,
  "judge_actor": {
    "name": "iskra",
    "runtime": "openclaw"
  },
  "judged_at": "2026-06-11T01:04:00Z",
  "labels_to_apply": [
    "judge/p2",
    "judge/patchwarden-candidate"
  ],
  "piotr_fit": "high",
  "priority": "p2",
  "rationale_summary": "This is P2 Patchwarden-candidate work because it hardens contract-pr for artifact-only CI clients without changing Forgejo mutation paths.",
  "reach": 4,
  "recommended_next_action": "patchwarden_candidate",
  "rerun_reason": "no_prior_judgment",
  "schema": "openclaw.judge.v0",
  "target": {
    "kind": "pull_request",
    "number": 86,
    "repo": "pdurlej/patchwarden"
  },
  "target_snapshot": {
    "body_hash": "sha256:7e33ec7e5e4136de2e9e485911f33a55deaf0598c03c18a6b20d518fc90cf653",
    "commit_count": 1,
    "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "head_sha": "787424d2e2a81c9d3c00bd1da9a1dd48193a1ccb",
    "labels": [],
    "labels_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
    "state": "open",
    "title_hash": "sha256:071b5431bad926b68922b0b6d4193c29511fcf5c371f88dad1271f01c02cdf97",
    "updated_at": "2026-06-10T23:59:58+02:00"
  },
  "top_caveat": "Review should confirm duplicate or conflicting required-check sources are handled predictably before merge."
}
<!-- /openclaw.judge.v0 -->
### Iskra judgment | Field | Value | | --- | --- | | Target | `pdurlej/patchwarden#pull_request#86` | | Priority | p2 | | Action | patchwarden_candidate | | Scores | reach 4 / impact 4 / confidence 5 | | Piotr fit | high | | Effort | small | | Labels | `judge/p2`, `judge/patchwarden-candidate` | | Judge | `iskra` via `openclaw` | **Rationale:** This is P2 Patchwarden-candidate work because it hardens contract-pr for artifact-only CI clients without changing Forgejo mutation paths. **Caveat:** Review should confirm duplicate or conflicting required-check sources are handled predictably before merge. <details> <summary>Structured openclaw.judge.v0 payload</summary> ```json <!-- openclaw.judge.v0 --> { "confidence": 5, "effort_hint": "small", "escalation": { "kind": "patchwarden_review", "reason": "This is a Patchwarden contract evaluator change with direct CI artifact workflow impact." }, "evidence_refs": [ { "note": "PR adds an explicit required-check argument to patchwarden contract-pr and merges it with PR metadata checks before evaluation.", "type": "forgejo", "value": "pr-title-body-labels-and-target-snapshot" }, { "note": "Body explains artifact-only client workflows can otherwise lose required checks when using metadata files.", "type": "forgejo", "value": "pr-body-why" }, { "note": "Verification reports focused contract tests, full pytest suite, and diff check passing.", "type": "check", "value": "pr-body-verification-summary" } ], "impact": 4, "judge_actor": { "name": "iskra", "runtime": "openclaw" }, "judged_at": "2026-06-11T01:04:00Z", "labels_to_apply": [ "judge/p2", "judge/patchwarden-candidate" ], "piotr_fit": "high", "priority": "p2", "rationale_summary": "This is P2 Patchwarden-candidate work because it hardens contract-pr for artifact-only CI clients without changing Forgejo mutation paths.", "reach": 4, "recommended_next_action": "patchwarden_candidate", "rerun_reason": "no_prior_judgment", "schema": "openclaw.judge.v0", "target": { "kind": "pull_request", "number": 86, "repo": "pdurlej/patchwarden" }, "target_snapshot": { "body_hash": "sha256:7e33ec7e5e4136de2e9e485911f33a55deaf0598c03c18a6b20d518fc90cf653", "commit_count": 1, "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "head_sha": "787424d2e2a81c9d3c00bd1da9a1dd48193a1ccb", "labels": [], "labels_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "state": "open", "title_hash": "sha256:071b5431bad926b68922b0b6d4193c29511fcf5c371f88dad1271f01c02cdf97", "updated_at": "2026-06-10T23:59:58+02:00" }, "top_caveat": "Review should confirm duplicate or conflicting required-check sources are handled predictably before merge." } <!-- /openclaw.judge.v0 --> ``` </details>
pdurlej deleted branch contract-pr-required-checks 2026-06-17 21:24:18 +02:00
Sign in to join this conversation.
No reviewers
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
2 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/patchwarden!86
No description provided.