fix(schema): review-artifact soft-fail fields + add finding-resolution schema (closes #72) #80

Merged
pdurlej merged 1 commit from gemini/issue-72 into main 2026-06-08 21:46:38 +02:00
Collaborator

Authored by gemini (Gemini 3.1 Pro via Antigravity), Swarmheart worker under claude's arbitration. claude read both schema changes against the real review_run.py / resolve_findings.py output shapes and confirmed no version bump.

What

Fixes the two real contract drifts that #71's jsonschema contract test surfaced (and #62 documented via assertRaises). The schemas now match what the code actually emits.

Drift 1 — review-artifact rejected soft-fail runtime_metadata

review-artifact.schema.json now models the soft-fail fields review_run emits (PR #54): model_used (str), fell_back (bool), error_kind (enum transport|unparseable), error_detail (str). A real soft-fail review artifact now validates.

Drift 2 — finding-resolution.schema.json was missing

New schema for resolve_findings() output (patchwarden.finding_resolution.v1): verdict PASS/HOLD, findings[], blockers[] (incl. the soft_fail_review_unreliable shape with null finding_id), target, registry ids. Plus a validating example finding-resolution.hold.json.

claude's review

  • No version bump — both stay .v1 (patchwarden.review_artifact.v1, patchwarden.finding_resolution.v1). We made the schema match what .v1 already emits, exactly as #72 required.
  • Soft-fail fields match review_run.py; finding-resolution shape matches resolve_findings.py (verified against the source).
  • additionalProperties: false retained → still catches future drift.
  • Tests flipped: the two assertRaises(ValidationError) cases are now positive validate(); real PASS/HOLD/soft-fail resolve outputs validate against the new schema; deliberately-invalid cases still raise.

Arbiter verification (claude)

  • PYTHONPATH=src python3 -m unittest discover tests220/220 OK.
  • Scope: spec/schemas/review-artifact.schema.json (+6), spec/schemas/finding-resolution.schema.json (new +116), spec/schemas/examples/finding-resolution.hold.json (new +36), tests/test_artifact_schema_contract.py (+56). No src/ changes.
  • jsonschema test-only; D20 boundary passes.

Closes #72. Closes the loop opened by gemini's own #62 — the contract tests now enforce the correct contracts, not the drifted ones.

> **Authored by gemini** (Gemini 3.1 Pro via Antigravity), Swarmheart worker under claude's arbitration. claude read both schema changes against the real `review_run.py` / `resolve_findings.py` output shapes and confirmed no version bump. ## What Fixes the two real contract drifts that #71's jsonschema contract test surfaced (and #62 documented via `assertRaises`). The schemas now match what the code actually emits. ## Drift 1 — review-artifact rejected soft-fail `runtime_metadata` `review-artifact.schema.json` now models the soft-fail fields `review_run` emits (PR #54): `model_used` (str), `fell_back` (bool), `error_kind` (enum `transport`|`unparseable`), `error_detail` (str). A real soft-fail review artifact now validates. ## Drift 2 — `finding-resolution.schema.json` was missing New schema for `resolve_findings()` output (`patchwarden.finding_resolution.v1`): verdict `PASS`/`HOLD`, `findings[]`, `blockers[]` (incl. the `soft_fail_review_unreliable` shape with null `finding_id`), target, registry ids. Plus a validating example `finding-resolution.hold.json`. ## claude's review - ✅ **No version bump** — both stay `.v1` (`patchwarden.review_artifact.v1`, `patchwarden.finding_resolution.v1`). We made the schema match what `.v1` already emits, exactly as #72 required. - ✅ Soft-fail fields match `review_run.py`; finding-resolution shape matches `resolve_findings.py` (verified against the source). - ✅ `additionalProperties: false` retained → still catches future drift. - ✅ Tests flipped: the two `assertRaises(ValidationError)` cases are now positive `validate()`; real PASS/HOLD/soft-fail resolve outputs validate against the new schema; deliberately-invalid cases still raise. ## Arbiter verification (claude) - `PYTHONPATH=src python3 -m unittest discover tests` → **220/220 OK**. - Scope: `spec/schemas/review-artifact.schema.json` (+6), `spec/schemas/finding-resolution.schema.json` (new +116), `spec/schemas/examples/finding-resolution.hold.json` (new +36), `tests/test_artifact_schema_contract.py` (+56). **No `src/` changes.** - `jsonschema` test-only; D20 boundary passes. Closes #72. Closes the loop opened by gemini's own #62 — the contract tests now enforce the *correct* contracts, not the drifted ones.
Extended review-artifact.schema.json to allow soft-fail metadata fields
emitted by review_run.py when Ollama fails to answer. Created
finding-resolution.schema.json to formally validate the schema emitted
by resolve_findings.py, complete with its specific blockers shape for
soft-fails. Added tests and verified compliance.

Co-Authored-By: Gemini 3.1 Pro (Antigravity) <noreply@antigravity.google>
pdurlej deleted branch gemini/issue-72 2026-06-08 21:46:39 +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
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!80
No description provided.