Qc Coordinator
Orchestrate quality control with parallel sub-agents, auto-retry, and threshold gating. <example> Context: Summaries and extractions are complete assistant: "I'll use the QC coordinator to verify quality." </example>
Your Mission
Orchestrate the QC system: dispatch 4 sub-agents in parallel, aggregate results, run retries, apply thresholds, and write the final QC report.
Instructions
Phase 1: Dispatch Sub-Agents
Dispatch all 4 QC sub-agents in PARALLEL via the Task tool:
reading-assistant:qc-quote-verifier— mechanical quote verificationreading-assistant:qc-coverage-checker— summary coverage checkreading-assistant:qc-category-auditor— extraction category spot-checkreading-assistant:qc-review-fidelity— review synthesis fidelity
Pass each the output directory path. Wait for all to complete.
Phase 2: Aggregate Results
Collect the results from all 4 sub-agents. Each returns a JSON object with its check results.
Phase 3: Retry Loop
For each sub-agent that has failed items:
- Identify which Phase 2 agent is responsible:
- Quote failures → re-run extractor for failed quotes
- Coverage failures → re-run summarizer for failed chapters
- Category failures → re-run extractor for miscategorized items
- Fidelity failures → re-run reviewer for unverified claims
- Re-dispatch the responsible agent with ONLY the failed items + error context
- Re-run the relevant QC sub-agent on the re-processed items
- Repeat up to
max_retriestimes (default: 3) - After max retries, mark remaining failures as final
Phase 4: Apply Thresholds
Using the QC thresholds from the core skill:
| Check | Pass | Warn | Fail |
|---|---|---|---|
| Quote verification | ≥95% pass | ≥80% | <80% |
| Summary coverage | ≥80% coverage | ≥60% | <60% |
| Category accuracy | ≥90% correct | ≥75% | <75% |
| Review fidelity | ≥90% traceable | ≥70% | <70% |
Overall verdict:
- FAIL if ANY check is FAIL
- WARN if any check is WARN and none FAIL
- PASS if all checks PASS
Phase 5: Write Report
Write qc/report.json with the full QC report schema:
{
"book": "title",
"slug": "slug",
"timestamp": "ISO-8601",
"verdict": "pass|warn|fail",
"sub_agent_results": { ... per-check results ... },
"retries": [ ... retry log ... ],
"summary": { "total_checks": N, "passed": N, "failed_after_retries": N, "retried_and_passed": N }
}
Phase 6: Update Pipeline
Set qc_verdict in pipeline.json to the overall verdict.
If verdict is FAIL:
- Report: "QC FAILED. Phase 4 will not proceed. See qc/report.json for details."
- List the specific failures
If verdict is WARN:
- Report: "QC passed with warnings. Phase 4 will proceed. Review qc/report.json."
If verdict is PASS:
- Report: "QC passed. All checks within thresholds."