# Skill: task-postflight — Post-dispatch validation + learning loop

# Skill: task-postflight — Post-dispatch validation + learning loop

**Skill path:** `~/.claude/skills/task-postflight/`

## Description

Closes the loop on H/BLOCKER MC tasks after specialist dispatch. Runs Proveo (Angie Jones) validation against MC acceptance criteria, detects anomalies, invokes `/learning-opportunity` if anomaly found (root cause + memory entry), and writes mc.js ready submission with evidence path.

**Trigger:** `/task-postflight <mc_id>`

**Use AFTER:** Specialist dispatch completes for any task that went through `/prompt-forge` or any H/BLOCKER task.

## Workflow

1. **Preconditions:** Verify MC task exists, status is `in_progress`, evidence dir exists (or flag MISSING)
2. **Proveo dispatch:** Spawn Angie Jones (Proveo) to validate against acceptance criteria
3. **Anomaly detection:** Parse Proveo report, classify failure type and severity
4. **Learning-opportunity:** Invoke learning loop on PARTIAL/FAIL verdicts (skip if PASS or known issue)
5. **Memory entry:** Write feedback file if learning-opportunity returns memory path
6. **MC ready:** Submit `mc.js ready` with evidence summary (or BLOCK on FULL\_FAILURE)
7. **Audit trail:** Append JSON line to `~/system/postflight-log.jsonl`

## Proveo Integration

Angie Jones (Proveo) validates against MC acceptance criteria. Expected output:

- **GLOBAL\_VERDICT:** PASS | FAIL | PARTIAL
- **per\_criterion:** List with verdict (PASS | FAIL | SKIP), evidence path, notes
- **anomalies:** List of issues found (empty if PASS)
- **evidence\_paths:** Files verified

Report written to: `/tmp/postflight-<mc_id>/proveo-report.md`

## Anomaly Classification

<table border="1" cellpadding="5" id="bkmrk-verdict-anomaly-clas"> <tr> <th>Verdict</th> <th>Anomaly Class</th> <th>Action</th> </tr> <tr> <td>PASS (all criteria)</td> <td>ANOMALY:NONE</td> <td>Skip to mc.js ready</td> </tr> <tr> <td>PASS (some SKIP)</td> <td>ANOMALY:PARTIAL\_COVERAGE</td> <td>Learning-opportunity (LOW severity)</td> </tr> <tr> <td>PARTIAL</td> <td>ANOMALY:PARTIAL\_FAILURE</td> <td>Learning-opportunity (MEDIUM severity)</td> </tr> <tr> <td>FAIL</td> <td>ANOMALY:FULL\_FAILURE</td> <td>Learning-opportunity (HIGH severity) + BLOCK mc.js ready</td> </tr> <tr> <td>Proveo timeout/error</td> <td>SYNTHESIS:DEGRADED</td> <td>Inline fallback check + escalate to John</td> </tr></table>

## Learning-Opportunity Loop

Invoked when anomaly class is not NONE. Receives:

- Proveo report path
- Evidence directory
- Task context (title, MC ID, specialist)
- Forged prompt path (if available)

**Expected output:**

- Failure type (HALLUCINATION / PROCESS\_SKIP / WRONG\_OUTPUT / KNOWLEDGE\_GAP / REPEAT\_MISTAKE)
- Root cause layer (GOTCHA)
- Fix type (Hook / Tool / Rule / CLAUDE.md / Memory)
- Memory entry path (if memory fix applied)

**Skip learning-opportunity if:**

- Same anomaly tracked in MEMORY.md within last 7 days
- ANOMALY\_SEVERITY = LOW and first occurrence
- Known flaky test pattern

## Cost and Limits

- **Hard cap:** $0.50 per invocation
- **Typical cost:** $0.15 warm cache / $0.40 cold
- **Breakdown:** Proveo dispatch (Sonnet) ~$0.05-0.15 + learning-opportunity ~$0.10-0.25
- **Timeout:** 90 seconds for Proveo report

## Failure Modes

<table border="1" cellpadding="5" id="bkmrk-condition-action-pro"> <tr> <th>Condition</th> <th>Action</th> </tr> <tr> <td>Proveo unavailable</td> <td>SYNTHESIS:DEGRADED — inline fallback, flag in mc.js notes, escalate</td> </tr> <tr> <td>Proveo timeout</td> <td>Same as unavailable</td> </tr> <tr> <td>learning-opportunity fails</td> <td>Log LEARNING:FAILED, skip memory entry, continue with warning</td> </tr> <tr> <td>MEMORY.md write fails</td> <td>Log error, skip index update, include content inline in mc.js notes</td> </tr> <tr> <td>ANOMALY:FULL\_FAILURE</td> <td>Block mc.js ready, write failure-summary.md, report re-dispatch required</td> </tr></table>

## Audit Trail

Every invocation appends one JSON line to `~/system/postflight-log.jsonl`:

```
{"mc_id":9959,"timestamp":"2026-04-28T12:12:00Z","proveo_verdict":"PASS","anomaly_class":"NONE","learning_invoked":false,"ready_status":"submitted","cost_estimate":"$0.15"}
```

Log is lightweight observability — does NOT replace evidence files.

## v0.1 Deferred (post-Akershus 2026-05-04)

- Telemetry: latency p50/p95 per section
- BFPR tracking dashboard: correlate anomaly rate with prompt-forge usage
- Automated regression detection: compare to previous same-specialist tasks
- Slack alerting on ANOMALY:FULL\_FAILURE or SYNTHESIS:DEGRADED
- cost-tracker.js integration

## References

- **Local SKILL.md:** `~/.claude/skills/task-postflight/SKILL.md`
- **Proveo brief:** `~/.claude/skills/task-postflight/references/proveo-brief.md`
- **Learning loop:** `~/.claude/skills/task-postflight/references/learning-loop.md`
- **Mirror pattern:** `~/.claude/skills/prompt-forge/SKILL.md`
- **Related:** ZAKON #25 (john-operating-system.md line 77)

---

*Author: ALAI, 2026*

*Last updated: 2026-04-28*