一键导入
resetting
On verify or judge fail, append a non-null lesson to the Ledger and re-queue the task. Null lessons are refused; the task escalates instead.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
On verify or judge fail, append a non-null lesson to the Ledger and re-queue the task. Null lessons are refused; the task escalates instead.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Dispatch one fresh subagent per plan task inside a per-task git worktree. Capture diff and tool output; never carry state across dispatches.
Author a machine-readable contract before execution. Produces anvil/contract.yml with four verification-level slots per criterion and Ledger-sourced counter-examples.
Decompose a confirmed contract into an atomic task DAG with wave ordering. Every task cites one or more contract criterion ids.
Bootstrap loader for the DG-Anvil plugin. Enumerates the five primitives, seven skills, five commands, and the core loop. Loaded at session-start.
Meta-skill governing every change to any skill file. Requires a RED-then-GREEN subagent pressure transcript before a skill change is accepted.
Dispatch the Court on evidence-only inputs (contract + diff + verify output + confidence). The Court is not a persona; it is a structured adjudicator.
| name | resetting |
| description | On verify or judge fail, append a non-null lesson to the Ledger and re-queue the task. Null lessons are refused; the task escalates instead. |
This skill closes the failure loop. When Verify or the Court reports fail, the skill composes a lesson from the captured Verify evidence and appends it to the global Ledger at ~/.anvil/ledger.jsonl. The task is then re-queued with the injected counter-example in the contract's counter_examples map. A reset that cannot produce a non-null lesson escalates the task rather than appending a null lesson.
Invoked by the orchestrator when verifying.allGreen === false or when the Court returns request-changes with a non-empty gap. Not invoked by user prompts directly. Runs at most loop_cap times per task before the task is escalated.
Two entry points: reactive (fires when Verify or Court fails during a run) and retroactive (fires at /ship for post-ship bug-fix intents that passed cleanly). Both route through cli/lib/ledger-write.js - it remains the single writer to ~/.anvil/ledger.jsonl.
<worktreePath>/anvil/verify/verify-result.json and the per-criterion failures.contract_gap (the criterion the contract failed to constrain), evidence (the Verify probe output that demonstrated the gap), remediation (the one-sentence counter-example the next contract should inject). All three must be non-null and non-empty.ledger-write.append(lesson). If any required field is null or empty, E_NULL_LESSON is thrown; the reset path catches this and escalates the task instead of appending a null lesson.counter_examples map. The task's loop_count increments by one.loop_count reaches the task's loop_cap, the task is escalated (status escalated) rather than re-queued. The escalation surface presents the options to the user.The contract-drafter agent may have populated contract.shipped_gap_note_draft because source_intent referenced an existing file. At /ship, after the whole-branch Court returns green, the orchestrator presents the draft note to the user for binary-ish confirmation. If the user confirms (or edits), this retroactive entry point fires:
ledger-write.retroactive({ contract, confirmed_gap_note, criterion_id, source_intent, patterns }) where:
confirmed_gap_note: the user-confirmed (or user-edited) gap note from the /ship gate.criterion_id: the contract criterion that guarded against the gap (the one that passed Verify and whose statement becomes the lesson's remediation).source_intent: the original /start intent string.patterns: the pattern tags extracted during contract drafting.ledger-write.retroactive enforces structural non-null:
confirmed_gap_note must be a non-empty string (rejects null-lesson smuggling).criterion_id MUST exist in contract.criteria. If the user cannot name one, the retroactive path refuses (E_INVALID_LESSON, rule: unknown_criterion_id) and /ship proceeds without a lesson.source_intent must be non-empty.ledger-write.retroactive runs a Jaccard similarity check against existing lessons. If any existing lesson's contract_gap is >= 0.7 similar to the new one, the new lesson writes supersedes: [<oldId>] (up to three) instead of appending a near-duplicate. This prevents Ledger flood.[shipped_gap, post_hoc] plus normalized pattern tags./ship continues to the PR open. The lesson is visible in the next anvil ledger query run.skip at the /ship gate, NO retroactive lesson is written. /ship proceeds normally.Reject the following shortcuts:
remediation is fine as a placeholder." cli/lib/ledger-write.js refuses the append; placeholders are denied at the write path (structural guard; E_NULL_LESSON).If any of these conditions obtain, the reset is refused:
contract_gap, evidence, or remediation field is null or empty; this is a null lesson and is refused by ledger-write.append (failure-taxonomy row 20: Null-lesson escape hatch).loop_cap; no further reset is attempted; the task is escalated.E_INVALID_SUPERSESSION).criterion_id. Without a structural criterion reference, the lesson's remediation has no passing-evidence bar and the write is refused.Each reset checks:
ledger-write.append(lesson) returned { appended: true } with a valid lesson id.counter_examples map was updated with the new lesson's id and remediation text.loop_count incremented by exactly one.loop_cap, the task's status became escalated and no append occurred.