Summary
Add a validation phase after playbook/skill execution that runs a separate, clean-context Claude session to verify the business task was actually completed correctly. This addresses the problem where agent self-validation during execution is unreliable — the agent may claim success without actually completing all checklist items.
Motivation
When an agent runs a playbook (skill), it self-reports completion. But self-validation within the same context is unreliable: the agent may hallucinate success, skip steps, or mark items complete without verification. A clean validation session with a different prompt framing (auditor vs executor) produces more honest assessment.
Design
Validation Flow
Schedule/Trigger → Agent executes playbook → Execution completes
→ Validation session starts (same agent, clean context)
→ Validator reviews execution output + checklist
→ Pass: mark business_status=completed, notify if configured
→ Fail: mark business_status=failed, notify operator, trigger remediation if configured
Validation Session
- Runs on the same agent (has access to the same files, tools, state)
- Uses a clean context (new Claude session, no carry-over from execution)
- Receives as input:
- The playbook/skill definition (checklist, acceptance criteria)
- The previous execution's output/response
- Instruction to validate, not execute — auditor framing
- Produces structured output:
pass / fail / partial status
- Per-checklist-item validation results
- Evidence for each item (what was checked, what was found)
- Recommended remediation actions if failed
Business Status (new concept)
Execution records currently have a technical status (completed/failed/timeout). Add a business_status field:
pending_validation — execution completed, awaiting validation
validated — validation passed
failed_validation — validation found incomplete/incorrect work
skipped — validation not configured for this schedule
Configuration
- Per-schedule toggle: "Enable post-execution validation"
- Validation prompt template (customizable per schedule, with sensible default)
- On-failure action:
notify_operator (default), retry_execution, notify_only
- Max validation retries before escalating to operator
Operator Notification
- On validation failure: post to operator queue with full context (execution output, validation results, checklist status)
- If Slack notifications configured: also post to Slack channel
- Operator can: acknowledge, trigger re-execution, or mark as acceptable
Database Changes
Add to schedule_executions:
business_status TEXT — validation result
validation_output TEXT — JSON validation details
validated_at TEXT — timestamp
Add to agent_schedules:
validation_enabled INTEGER DEFAULT 0
validation_prompt TEXT — custom validation instructions
on_validation_failure TEXT DEFAULT 'notify_operator'
UI
- Execution history shows both technical status and business status columns
- Validation results expandable in execution detail view
- Per-checklist-item pass/fail indicators
- Schedule config: validation toggle and settings
Acceptance Criteria
Summary
Add a validation phase after playbook/skill execution that runs a separate, clean-context Claude session to verify the business task was actually completed correctly. This addresses the problem where agent self-validation during execution is unreliable — the agent may claim success without actually completing all checklist items.
Motivation
When an agent runs a playbook (skill), it self-reports completion. But self-validation within the same context is unreliable: the agent may hallucinate success, skip steps, or mark items complete without verification. A clean validation session with a different prompt framing (auditor vs executor) produces more honest assessment.
Design
Validation Flow
Validation Session
pass/fail/partialstatusBusiness Status (new concept)
Execution records currently have a technical
status(completed/failed/timeout). Add abusiness_statusfield:pending_validation— execution completed, awaiting validationvalidated— validation passedfailed_validation— validation found incomplete/incorrect workskipped— validation not configured for this scheduleConfiguration
notify_operator(default),retry_execution,notify_onlyOperator Notification
Database Changes
Add to
schedule_executions:business_statusTEXT — validation resultvalidation_outputTEXT — JSON validation detailsvalidated_atTEXT — timestampAdd to
agent_schedules:validation_enabledINTEGER DEFAULT 0validation_promptTEXT — custom validation instructionson_validation_failureTEXT DEFAULT 'notify_operator'UI
Acceptance Criteria
business_statustracked separately from technicalstatus