feat(feedback): add repair instruction contract #161

Merged
pdurlej merged 2 commits from codex/repair-instruction-contract into main 2026-06-23 23:36:06 +02:00
Owner

Summary

  • add patchwarden.repair_instruction.v1 plus repair-instruction-check for policy-derived agent repair packets
  • register the new handoff in the external handoff registry and operator status/static HTML
  • update June vision/D28/self-usable docs so Loop 3 is now a shipped contract with live consumption still external

Safety boundary

  • read-only only: no jobs, comments, approvals, merges, code authorship, or external writes
  • exact-head checks are fail-closed through --expected-target-sha
  • repair packets describe blocker/action/acceptance, not implementation-specific code changes

Tests

  • PYTHONPATH=src:. python3 -m unittest discover -s tests (665 tests)

Closes #159

## Summary - add `patchwarden.repair_instruction.v1` plus `repair-instruction-check` for policy-derived agent repair packets - register the new handoff in the external handoff registry and operator status/static HTML - update June vision/D28/self-usable docs so Loop 3 is now a shipped contract with live consumption still external ## Safety boundary - read-only only: no jobs, comments, approvals, merges, code authorship, or external writes - exact-head checks are fail-closed through `--expected-target-sha` - repair packets describe blocker/action/acceptance, not implementation-specific code changes ## Tests - `PYTHONPATH=src:. python3 -m unittest discover -s tests` (665 tests) Closes #159
feat(feedback): add repair instruction contract
All checks were successful
fallow-py / fallow-py-advisory (pull_request) Successful in 15s
4d61c9ca08
docs: keep repair instruction scope within contract limit
All checks were successful
fallow-py / fallow-py-advisory (pull_request) Successful in 15s
360c384048
Collaborator

🏛️ Architect review (loop) — resolves #159, safe to merge

Verified against the L3 boundary I specified in #159 (the D20/D28 line) — and it's build-time enforced, not just asserted in prose:

  • Policy-derived, not model-authored: output carries safety.model_authored: false + producer model_id: "deterministic"; actions are deterministic_action.kind (structured, mapped from existing blocker gate_id/blocker_code, not free text or code). The test test_policy_owned_blocker_routes_to_operator_without_code_authorship asserts model_authored is False — so the no-code-authorship line can't silently regress.
  • Read-only / write-free: write_allowed + external_write_allowed both False; no forgejo_client / requests / subprocess / model imports; no controller/approval/merge surface touched.
  • Head-bound + fail-closed: repair_instruction_head_missing / repair_instruction_head_mismatch via --expected-target-sha; stale-head and unsupported-schema both fail closed (tested).
  • Registered in the handoff registry + operator status; 665 green.

This closes the highest-leverage missing loop — Loop 3 of D28. With L2 (post_merge_feedback, #156) already shipped, 2 of the 3 closing loops are now done; L1 (sandbox/web evidence, #150/#151) and the merge-actuation frontier remain per self-usable-milestone.md.

(Optional, non-blocking forward note: the model_authored=False invariant is covered by test_repair_instruction; if you ever want belt-and-suspenders, the test_d20_architectural_boundary lint could also assert the repair surface stays deterministic — but the dedicated test already guards it.) No changes requested. — claude (architect loop)

## 🏛️ Architect review (loop) — ✅ resolves #159, safe to merge Verified against the L3 boundary I specified in #159 (the D20/D28 line) — and it's **build-time enforced**, not just asserted in prose: - **Policy-derived, not model-authored**: output carries `safety.model_authored: false` + producer `model_id: "deterministic"`; actions are `deterministic_action.kind` (structured, mapped from existing blocker `gate_id`/`blocker_code`, **not** free text or code). The test `test_policy_owned_blocker_routes_to_operator_without_code_authorship` asserts `model_authored` is False — so the no-code-authorship line can't silently regress. ✅ - **Read-only / write-free**: `write_allowed` + `external_write_allowed` both False; no `forgejo_client` / `requests` / `subprocess` / model imports; no controller/approval/merge surface touched. ✅ - **Head-bound + fail-closed**: `repair_instruction_head_missing` / `repair_instruction_head_mismatch` via `--expected-target-sha`; stale-head and unsupported-schema both fail closed (tested). ✅ - Registered in the handoff registry + operator status; 665 green. This closes the highest-leverage missing loop — Loop 3 of D28. With L2 (`post_merge_feedback`, #156) already shipped, **2 of the 3 closing loops are now done**; L1 (sandbox/web evidence, #150/#151) and the merge-actuation frontier remain per `self-usable-milestone.md`. (Optional, non-blocking forward note: the `model_authored=False` invariant is covered by `test_repair_instruction`; if you ever want belt-and-suspenders, the `test_d20_architectural_boundary` lint could also assert the repair surface stays deterministic — but the dedicated test already guards it.) No changes requested. — claude (architect loop)
Author
Owner

Patchwarden local validation notes:

  • Full local suite: PYTHONPATH=src:. python3 -m unittest discover -s tests -> 665 tests OK.
  • Forgejo commit status for head 360c384048e7243ad7389dc07c3c83eb3db2ce21: success.
  • Local contract-pr dry run blocks on governance_tier_path because this PR intentionally touches Patchwarden governance/status/schema surfaces.
  • Dogfood repair-instruction-check on that blocked artifact emits verdict=ready with next_agent_action.mode=operator_required, which is the expected outcome for this policy-owned class.

Scope is aligned with #159 and the operator-approved Patchwarden vision work.

Patchwarden local validation notes: - Full local suite: `PYTHONPATH=src:. python3 -m unittest discover -s tests` -> 665 tests OK. - Forgejo commit status for head `360c384048e7243ad7389dc07c3c83eb3db2ce21`: success. - Local `contract-pr` dry run blocks on `governance_tier_path` because this PR intentionally touches Patchwarden governance/status/schema surfaces. - Dogfood `repair-instruction-check` on that blocked artifact emits `verdict=ready` with `next_agent_action.mode=operator_required`, which is the expected outcome for this policy-owned class. Scope is aligned with #159 and the operator-approved Patchwarden vision work.
pdurlej deleted branch codex/repair-instruction-contract 2026-06-23 23:36:06 +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
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/patchwarden!161
No description provided.