Add post-merge analytics feedback loop for autonomy and trust learning #147

Closed
opened 2026-06-23 22:29:42 +02:00 by codex · 0 comments
Collaborator

Goal

Make Patchwarden learn from what happened after a PR was merged, not only decide whether a PR is merge-ready before merge.

Today the Swiss-cheese stack mainly answers: can this exact PR head enter? The missing analytics layer should answer: did the merged change create value, friction, incident risk, rework, or trust evidence?

Why

The operator explicitly called out analytics as part of the June 2026 Patchwarden vision. Without it, Patchwarden can gate incoming work but cannot improve trust tiers, agent autonomy, or follow-up creation based on real outcomes.

This maps to:

  • PW-G007 Analytics Feedback Loop
  • PW-G015 Vision gap intake ledger
  • downstream trust-tier decisions from PW-G018

Scope

Add a small, read-only Patchwarden contract for post-merge feedback intake. It should normalize merge outcome and optional human/system signals into a machine-readable artifact that an external issue/job writer can consume later.

Suggested command shape:

patchwarden post-merge-feedback-check \
  --contract-pr-result-file contract-pr-result.json \
  --merge-outcome-file merge-outcome.json \
  --feedback-signal-file optional-feedback.json

Suggested artifact:

{
  "schema_version": "patchwarden.post_merge_feedback.v1",
  "verdict": "recorded | follow_up_needed | trust_signal | blocked",
  "target": { "kind": "pull_request", "id": "..." },
  "target_sha": "...",
  "signals": [],
  "follow_up_candidate": null,
  "trust_signal": null,
  "external_write_allowed": false
}

Signals to consider

  • merge lead time / time-to-green
  • reverted or follow-up-fix-needed
  • incident or degraded operator workflow
  • high-value outcome / low-friction success
  • agent/model identity and PR class correlation
  • repeated clean merges for trust progression
  • repeated soft-fails or redrives for trust tightening

Acceptance criteria

  • New read-only CLI command emits a structured post-merge feedback artifact.
  • Artifact is exact-head / PR-target bound.
  • Artifact can emit at least: recorded, follow_up_needed, trust_signal, blocked.
  • No Forgejo issue creation, no job dispatch, no merge, no approval, no external writes.
  • Schema and example are added under spec/schemas/.
  • patchwarden status / docs/status.html mention the new analytics feedback contract or update PW-G007 next action.
  • Tests prove malformed/stale/mismatched inputs fail closed.

No-go

  • Do not make Patchwarden create issues directly in this slice.
  • Do not let analytics widen trust by itself.
  • Do not add a live writer/controller here; keep that as an external consumer of the artifact.

Product framing

This is the missing memory layer of the Swiss-cheese architecture: pre-merge gates decide whether a PR may enter, while post-merge analytics decides whether the autonomy system is actually getting safer, faster, and more valuable over time.

## Goal Make Patchwarden learn from what happened after a PR was merged, not only decide whether a PR is merge-ready before merge. Today the Swiss-cheese stack mainly answers: **can this exact PR head enter?** The missing analytics layer should answer: **did the merged change create value, friction, incident risk, rework, or trust evidence?** ## Why The operator explicitly called out analytics as part of the June 2026 Patchwarden vision. Without it, Patchwarden can gate incoming work but cannot improve trust tiers, agent autonomy, or follow-up creation based on real outcomes. This maps to: - `PW-G007 Analytics Feedback Loop` - `PW-G015 Vision gap intake ledger` - downstream trust-tier decisions from `PW-G018` ## Scope Add a small, read-only Patchwarden contract for post-merge feedback intake. It should normalize merge outcome and optional human/system signals into a machine-readable artifact that an external issue/job writer can consume later. Suggested command shape: ```bash patchwarden post-merge-feedback-check \ --contract-pr-result-file contract-pr-result.json \ --merge-outcome-file merge-outcome.json \ --feedback-signal-file optional-feedback.json ``` Suggested artifact: ```json { "schema_version": "patchwarden.post_merge_feedback.v1", "verdict": "recorded | follow_up_needed | trust_signal | blocked", "target": { "kind": "pull_request", "id": "..." }, "target_sha": "...", "signals": [], "follow_up_candidate": null, "trust_signal": null, "external_write_allowed": false } ``` ## Signals to consider - merge lead time / time-to-green - reverted or follow-up-fix-needed - incident or degraded operator workflow - high-value outcome / low-friction success - agent/model identity and PR class correlation - repeated clean merges for trust progression - repeated soft-fails or redrives for trust tightening ## Acceptance criteria - New read-only CLI command emits a structured post-merge feedback artifact. - Artifact is exact-head / PR-target bound. - Artifact can emit at least: `recorded`, `follow_up_needed`, `trust_signal`, `blocked`. - No Forgejo issue creation, no job dispatch, no merge, no approval, no external writes. - Schema and example are added under `spec/schemas/`. - `patchwarden status` / `docs/status.html` mention the new analytics feedback contract or update `PW-G007` next action. - Tests prove malformed/stale/mismatched inputs fail closed. ## No-go - Do not make Patchwarden create issues directly in this slice. - Do not let analytics widen trust by itself. - Do not add a live writer/controller here; keep that as an external consumer of the artifact. ## Product framing This is the missing memory layer of the Swiss-cheese architecture: pre-merge gates decide whether a PR may enter, while post-merge analytics decides whether the autonomy system is actually getting safer, faster, and more valuable over time.
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
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/patchwarden#147
No description provided.