Task Workflow Validation Pipeline

Task Workflow Validation Pipeline

5-Stage Validation Pipeline for Badlucksbane Lab Automation

This document describes the end-to-end validation pipeline that ensures quality, security, and authenticity across all automated tasks in the Planner-Worker system.


Pipeline Overview

┌─────────────────────────────────────────────────────────────────────────────┐
│                         TASK LIFECYCLE                                          │
├─────────────────────────────────────────────────────────────────────────────┤
│                                                                              │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐                 │
│  │   STAGE 1    │───▶│   STAGE 2    │───▶│   STAGE 3    │                 │
│  │ Input         │    │ Process       │    │ Output       │                 │
│  │ Validation    │    │ Validation    │    │ Validation    │                 │
│  └──────────────┘    └──────────────┘    └──────────────┘                 │
│           │                   │                   │                           │
│           ▼                   ▼                   ▼                           │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐                 │
│  │ Planner       │    │ Worker        │    │ Post-Worker  │                 │
│  │ (Observer)    │    │ (Nurturer)    │    │ Quality      │                 │
│  └──────────────┘    └──────────────┘    └──────────────┘                 │
│                                                                              │
│           │                   │                   │                           │
│           ▼                   ▼                   ▼                           │
│  ┌──────────────┐    ┌──────────────┐    ┌──────────────┐                 │
│  │ validate-     │    │ validate-     │    │ validate-     │                 │
│  │ planner-      │    │ worker-       │    │ deployment   │                 │
│  │ task.sh       │    │ output.sh     │    │ .sh          │                 │
│  └──────────────┘    └──────────────┘    └──────────────┘                 │
│                                                                              │
│           │                   │                   │                           │
│           ▼                   ▼                   ▼                           │
│  ┌─────────────────────────────────────────────────────────────────────┐   │
│  │                        STAGE 4 & 5                                │   │
│  │              Deployment & System Verification                      │   │
│  └─────────────────────────────────────────────────────────────────────┘   │
│                                                                              │
└─────────────────────────────────────────────────────────────────────────────┘

Stage-by-Stage Details

Stage 1: Input Validation (Planner)

Purpose: Prevent bad tasks from entering the system at the source.

Implementation: [LOCAL_BIN_PATH]validate-planner-task.sh

Checks:

When: Before task creation in planner.sh

Result: Tasks that fail validation are logged and rejected; Planner continues without creating the task.


Stage 2: Process Validation (Worker)

Purpose: Ensure task execution produced quality output.

Implementation: [LOCAL_BIN_PATH]validate-worker-output.sh

Checks:

When: After LLM returns TASK_COMPLETED but before closing the task in worker.sh

Result: Tasks that fail validation remain open and are retried in the next worker run.


Stage 3: Output Validation (Post-Worker)

Purpose: Verify the output meets quality standards.

Implementation: Integrated into validate-worker-output.sh

Checks:

When: Immediately after task execution, as part of process validation

Result: Output that fails is flagged; task remains open for correction.


Stage 4: Deployment Validation (CI/CD)

Purpose: Ensure deployments succeed and content reaches production.

Implementation: .gitea/workflows/deploy.yml

Checks:

When: Automatically triggered on git push via Gitea Actions

Result: Failed deployments prevent task closure and trigger alerts.


Stage 5: System-Level Validation (Safeguard)

Purpose: Monitor overall system health and auto-repair critical issues.

Implementation: [LOCAL_BIN_PATH]safeguard-check.sh

Checks:

When:

Result: Critical issues are auto-detected and auto-repaired; system remains healthy without manual intervention.


Validation Scripts Reference

ScriptLocationPurposeStage
validate-planner-task.sh[LOCAL_BIN_PATH]Input validation for new tasks1
validate-worker-output.sh[LOCAL_BIN_PATH]Process/output validation2, 3
validate-no-forbidden-patterns.sh[LOCAL_BIN_PATH]Check for sensitive/forbidden content2, 3
validate-git-state.sh[LOCAL_BIN_PATH]Verify git is clean and synced2
validate-notebook-quality.sh[LOCAL_BIN_PATH]Ensure notebook entries are substantive2, 3
safeguard-check.sh[LOCAL_BIN_PATH]System health monitoring and auto-repair5

Hand-off Criteria Between Stages

Planner → Worker

Worker → Post-Worker

Post-Worker → Deployment

Deployment → System

System → Archive


Pipeline Visibility and Auditability

Logs

All validation results are logged to:

Metrics

Tracked in beads database:

Alerts

Failed validations trigger:

  1. Log entries with specific error messages
  2. Task remains open for retry
  3. After 3 consecutive failures: escalation to P0 priority

Failed Stage Handling

StageFailure ActionRetryEscalation
1 (Input)Task rejected, loggedNeverNone (prevented at source)
2 (Process)Task remains openNext worker runAfter 3 fails → P0
3 (Output)Task remains openNext worker runAfter 3 fails → P0
4 (Deployment)Pipeline fails, alertManual retryImmediate
5 (System)Auto-repair task createdAutomaticImmediate


Success Metrics

The pipeline is considered healthy when:


Last updated: 2026-08-02 This pipeline ensures the Lab Authenticity Principle: No claims without proof, no placeholder content.