§ reference · skill

amend

Surgically revises one artifact to clear the failing dimensions a grade panel flagged, re-emitting it in place so the gate re-judges the same channel.

arguments --<channel> <artifact-path> --<channel>-verdicts <verdict-path> [--<channel>-verdicts <verdict-path> ...]

§ 01 · purpose

Purpose

Closes a gate's fix loop *without* a wholesale rewrite: it applies only what the failing verdicts cite and leaves passing content byte-for-byte. The pipeline loops the re-emitted artifact straight back to the grade panel. That re-judging is the only validation, so the skill never self-reviews or asks questions.

§ 02 · when to use

When to use it

  • Dispatched as the revise stage of the pipeline's plan-fix and code-fix loops, after a grade panel returns failing verdicts.
  • Any graded artifact (research, plan, spliced code-bearing plan) needs targeted correction, not redesign.
  • Prefer slice in re-slice mode when the failure is structural. amend may touch only cited lines and cannot split a slice or break a dependency cycle.

§ 03 · inputs

Inputs

Name Required Source
artifact yes The single --<channel> flag that is not a verdicts (-verdicts), citation-floor (-cite-check), or lineage-source (--goal/--research/--subplans) flag
verdicts yes --<channel>-verdicts <path> (repeatable), verdict JSONs under .rpiv/artifacts/verdicts/
citation floors no --<channel>-cite-check <path> (repeatable), cite-check verdict JSONs
lineage sources no --goal, --research, --subplans — read-only context, never the artifact to re-emit
artifact
Parsed generically, agnostic to the channel name. The same reviser serves every gate; on both build fix arms it resolves to --plans. If exactly one artifact flag and at least one verdicts flag cannot be identified, the skill errors and stops.
verdicts
Grouped by dimension; only the latest verdict per dimension counts.
citation floors
The deterministic citation floor's verdicts, threaded alongside the LLM panel's — --plan-cite-check on the plan-fix arm, --code-cite-check on the code-fix arm.
lineage sources
Build fix arms only. A completeness-class finding is repaired by reading the authoritative content here rather than reconstructing it from verdict prose. plan-fix threads all three; code-fix threads only --goal and --research.

§ 04 · outputs

Outputs

Artifact Path Format
The revised artifact, re-emitted at its SAME path unchanged: Edit in place, status: ready preserved, last_updated bumped

§ 05 · key steps

Key steps

  1. Read the artifact fully and every verdict JSON Why: Verdicts accumulate across fix loops, so an older failing verdict may already be superseded. Only the latest per dimension (by graded_at) reflects the gate's current judgment.
  2. Select the failing findings — plus any verdict carrying a risk-duty demotion Why: Dimensions that pass are settled; touching them risks regressing a pass and expands the diff the panel must re-judge for no gain. The one exception is grader-side — a latest-per-dimension verdict with a non-empty risk_duty_demotions array is selected even when its own pass is true. That demotion is a signal to re-judge, not a plan defect: amend manufactures no risks: edits for it, so when nothing else fails the artifact is re-emitted unchanged with only last_updated bumped.
  3. Apply each finding's feedback surgically at its where anchor Why: The verdict's feedback is the instruction set and where locates the exact spot. Changes no finding asked for are scope creep the panel never sanctioned.
  4. Ground codebase-dependent fixes by reading, never editing, the repo Why: The boundary is the working tree. implement owns code. But a code-bearing plan's embedded code blocks are artifact content. So a fabricated edit anchor or drifted file:line inside one is fixed in place like any other finding.
  5. Re-emit to the same path Why: Same filename keeps the artifact's channel latest-wins, so the grade panel re-judges the same unit instead of forking a parallel artifact history.

§ 06 · related skills

upstream grade
downstream gradeimplement