Workflow Self-Anneal
Purpose
Perform a controlled, auditable improvement pass on instructions and process docs to reduce repeated failures while preserving human control.
This skill optimizes process reliability, not model internals.
Hard safety constraints
- No unbounded loops or autonomous "improve forever" behavior.
- Max one anneal pass per invocation; max three proposed doc changes.
- No deploy/publish success claims without verification evidence.
- Do not modify security/permission policy automatically; propose only.
- If evidence insufficient, return
NO_CHANGEwith missing-evidence list.
Trigger conditions
- Same failure pattern ≥2 times in 7 days.
- Session crash/restart/tooling instability.
- Instructions contradicted by observed actions.
- Pre-merge gate requires hardening evidence.
- Repeated carryover/blocked items across iterations.
- PR/merge latency breaches targets or reopened issues trend up.
- Commits exist without linked GitHub issues (process drift).
- Consultant check registry returns ≥1 FAIL on domain:governance.
- Fleet check
fleet-002(cost-budget) FAIL for ≥2 consecutive cycles.
Consultant Integration
Self-anneal may be invoked automatically from consultant-feedback.js when gov-002 (baton-artifact-presence) or gov-003 (event-emission) FAIL — these are workflow process failures, not implementation bugs.
Check IDs are managed in scripts/global/consultant-checks.js (3 domains: governance/tools/fleet).
Input collection
Collect: execution artifacts (logs, errors, checks), instructions/workflow docs, recent commits/PR notes. If unavailable, declare missing and stop.
Analysis protocol
- Detect mismatch: expected vs observed behavior.
- Classify root cause:
ambiguity|missing guardrail|stale instruction|tool fragility|human override. - Assess recurrence risk:
low|medium|highby frequency and blast radius. - Detect Agile drift signals: carryover, blocked age, review/merge latency, reopen rate.
- Ticket linkage:
git log --oneline | wc -lvs--grep='#'. If <80%, flagticket-linkage-drift. - PR coverage: commits vs
gh pr list --state all. If 0 PRs, flagpr-coverage-drift. - Event gaps: count events in
.dashboard/events.jsonlper role transition. If <1 event per baton handoff, flagevent-emission-drift.
- Ticket linkage:
- Propose minimal fix: smallest docs/workflow delta preventing recurrence.
- Define verification gate: objective checks confirming the fix.
Output format (required)
Return exactly this structure:
SELF_ANNEAL_REPORT
context: <session-start|post-failure|pre-merge|post-release>
scope: <workflow|stability|qa|git>
observation: [...]
expected_behavior: [...]
mismatch: [...]
root_cause: <ambiguity|missing guardrail|stale instruction|tool fragility|human override>
risk: <low|medium|high>
drift_signals:
- metric: <carryover|blocked-age|review-latency|merge-latency|reopen-rate|ticket-linkage|pr-coverage>
trend: <improving|stable|degrading> evidence: <artifact>
proposed_changes:
1) file: <path> change_type: <add|edit|remove> rationale: <why>
verification_plan:
- check: <objective> pass_condition: <measurable>
decision: <apply|defer|NO_CHANGE>
missing_evidence: <none or list>
Change targeting guidance
Prioritize: project runbooks/checklists, workflow docs, system-stability docs, learnings docs.
Stop conditions
Return NO_CHANGE if: change cannot be validated objectively, evidence is missing, change expands permissions, or same fix was already applied.
For iterative anneal loops (refinement passes), call shouldStop(...) from scripts/global/anneal-stop.js after every iteration (Epic #1568 AC-5, #1574). Stop when: deterministic gates green, OR iterations >= 3, OR |rubric_mean_delta| <= 0.5. Continuation past a stop requires ANNEAL_OVERRIDE_CONTINUE: rationale comment from the operator and is logged as event:kill-switch-bypass.
Quality bar
Good anneal output is: specific (concrete artifacts), minimal (smallest viable delta), testable (pass/fail checks), traceable (rationale + risk), trend-aware (drift reducing).
Visual verification rule (publish/UX scope)
For UX-rendered changes: require post-change visual inspection artifact. Do not allow ticket closure from DOM/CI checks alone. If visual evidence is missing, decision must be defer.