feat(v0): parse Forgejo pull_request event fixtures #31

Closed
opened 2026-05-26 02:14:40 +02:00 by codex · 2 comments
Collaborator

Goal

Prepare service/webhook mode by parsing Forgejo event payloads as data, without running an HTTP server yet.

Scope

  • Add a small parser module for Forgejo pull_request event JSON.
  • Add CLI command such as patchwarden forgejo-event --event-file ... that emits normalized PR metadata JSON for the offline pipeline.
  • Cover opened/synchronize/reopened/labeled/unlabeled event shapes in fixtures.

Acceptance criteria

  • Parser extracts repo, PR number, title, author, base/head SHA, labels, and event action.
  • Invalid/non-PR events fail clearly with exit code 2 through CLI.
  • Output can be used by the offline pipeline metadata issue once both are merged.

No-go

  • No webhook listener or signature verification.
  • No network calls.
  • No Actions-specific assumptions beyond Forgejo event JSON shape.

Spec sources

  • src/patchwarden/forgejo_client.py
  • src/patchwarden/pipeline.py
  • Platform workflow event usage as inspiration: pdurlej/platform:.forgejo/workflows/patchwarden-client-dry-run.yml
## Goal Prepare service/webhook mode by parsing Forgejo event payloads as data, without running an HTTP server yet. ## Scope - Add a small parser module for Forgejo `pull_request` event JSON. - Add CLI command such as `patchwarden forgejo-event --event-file ...` that emits normalized PR metadata JSON for the offline pipeline. - Cover opened/synchronize/reopened/labeled/unlabeled event shapes in fixtures. ## Acceptance criteria - Parser extracts repo, PR number, title, author, base/head SHA, labels, and event action. - Invalid/non-PR events fail clearly with exit code `2` through CLI. - Output can be used by the offline pipeline metadata issue once both are merged. ## No-go - No webhook listener or signature verification. - No network calls. - No Actions-specific assumptions beyond Forgejo event JSON shape. ## Spec sources - `src/patchwarden/forgejo_client.py` - `src/patchwarden/pipeline.py` - Platform workflow event usage as inspiration: `pdurlej/platform:.forgejo/workflows/patchwarden-client-dry-run.yml`
Collaborator

{
"confidence": 5,
"effort_hint": "medium",
"escalation": {
"kind": "patchwarden_review",
"reason": "Patchwarden parser work should stay aligned with offline pipeline contracts."
},
"evidence_refs": [
{
"note": "Issue prepares service mode by parsing Forgejo pull_request event JSON offline.",
"type": "forgejo",
"value": "issue-title-body-labels-and-target-snapshot"
},
{
"note": "Scope adds parser and CLI output for normalized PR metadata without HTTP server or network calls.",
"type": "forgejo",
"value": "issue-body-scope"
},
{
"note": "Acceptance requires clear extraction fields and exit code 2 for invalid non-PR events.",
"type": "forgejo",
"value": "issue-body-acceptance"
}
],
"impact": 4,
"judge_actor": {
"name": "iskra",
"runtime": "openclaw"
},
"judged_at": "2026-06-08T01:02:00Z",
"labels_to_apply": [
"judge/p2",
"judge/patchwarden-candidate"
],
"piotr_fit": "high",
"priority": "p2",
"rationale_summary": "This is P2 Patchwarden foundation work because offline Forgejo event parsing is a clean prerequisite for later webhook or service mode.",
"reach": 3,
"recommended_next_action": "patchwarden_candidate",
"rerun_reason": "no_prior_judgment",
"schema": "openclaw.judge.v0",
"target": {
"kind": "issue",
"number": 31,
"repo": "pdurlej/patchwarden"
},
"target_snapshot": {
"body_hash": "sha256:fb702393fd68e94d1a8c1c96f0d5862b4962179c72084e315719dc3d3afc5c5f",
"commit_count": null,
"evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"head_sha": null,
"labels": [
"area:forgejo",
"area:v0-core",
"kind:implementation",
"ready-for-agent"
],
"labels_hash": "sha256:ed53cff2546340696edabb4dfba9cf4615d23bc93102790acf2eed910440a261",
"state": "open",
"title_hash": "sha256:3cd873dace17c376dcbc58c8cfbee9597a2486260f45c5d80e9872ff9dddce78",
"updated_at": "2026-05-27T12:08:15+02:00"
},
"top_caveat": "Keep this offline and fixture-driven; do not smuggle in webhook listener or network behavior."
}

<!-- openclaw.judge.v0 --> { "confidence": 5, "effort_hint": "medium", "escalation": { "kind": "patchwarden_review", "reason": "Patchwarden parser work should stay aligned with offline pipeline contracts." }, "evidence_refs": [ { "note": "Issue prepares service mode by parsing Forgejo pull_request event JSON offline.", "type": "forgejo", "value": "issue-title-body-labels-and-target-snapshot" }, { "note": "Scope adds parser and CLI output for normalized PR metadata without HTTP server or network calls.", "type": "forgejo", "value": "issue-body-scope" }, { "note": "Acceptance requires clear extraction fields and exit code 2 for invalid non-PR events.", "type": "forgejo", "value": "issue-body-acceptance" } ], "impact": 4, "judge_actor": { "name": "iskra", "runtime": "openclaw" }, "judged_at": "2026-06-08T01:02:00Z", "labels_to_apply": [ "judge/p2", "judge/patchwarden-candidate" ], "piotr_fit": "high", "priority": "p2", "rationale_summary": "This is P2 Patchwarden foundation work because offline Forgejo event parsing is a clean prerequisite for later webhook or service mode.", "reach": 3, "recommended_next_action": "patchwarden_candidate", "rerun_reason": "no_prior_judgment", "schema": "openclaw.judge.v0", "target": { "kind": "issue", "number": 31, "repo": "pdurlej/patchwarden" }, "target_snapshot": { "body_hash": "sha256:fb702393fd68e94d1a8c1c96f0d5862b4962179c72084e315719dc3d3afc5c5f", "commit_count": null, "evidence_hash": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "head_sha": null, "labels": [ "area:forgejo", "area:v0-core", "kind:implementation", "ready-for-agent" ], "labels_hash": "sha256:ed53cff2546340696edabb4dfba9cf4615d23bc93102790acf2eed910440a261", "state": "open", "title_hash": "sha256:3cd873dace17c376dcbc58c8cfbee9597a2486260f45c5d80e9872ff9dddce78", "updated_at": "2026-05-27T12:08:15+02:00" }, "top_caveat": "Keep this offline and fixture-driven; do not smuggle in webhook listener or network behavior." } <!-- /openclaw.judge.v0 -->
Author
Collaborator

Addressed by #111.

Close basis: patchwarden forgejo-event --event-file ... now normalizes offline Forgejo pull_request event fixtures (opened, synchronize, reopened, labeled, unlabeled) into the same PR metadata shape consumed by pipeline --metadata-file and contract-pr --metadata-file. Non-PR events and missing changed_files fail with exit 2. HTTP listener and signature verification remain separate future service-mode work, not part of this issue.

Addressed by #111. Close basis: `patchwarden forgejo-event --event-file ...` now normalizes offline Forgejo `pull_request` event fixtures (`opened`, `synchronize`, `reopened`, `labeled`, `unlabeled`) into the same PR metadata shape consumed by `pipeline --metadata-file` and `contract-pr --metadata-file`. Non-PR events and missing `changed_files` fail with exit 2. HTTP listener and signature verification remain separate future service-mode work, not part of this issue.
Sign in to join this conversation.
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#31
No description provided.