# Harness Control-Loop Diagram Toolkit schema: `PAISEH-TK-1.0` Source artifact: Chapter 6 **Harness Control-Loop Diagram** Complete `../common-artifact-header.md` first. The diagram and tables form one enforceable control specification. ## 1. Workflow Definition - Purpose and trigger/request identity: - Harness owner: - Authoritative state source and concurrency rule: - Policy, Prompt Specification, and Context Plan references: - Outer attempt, time, invocation, and resource budgets: - Terminal outcome vocabulary: ## 2. Control-Loop Diagram ```mermaid stateDiagram-v2 [*] --> Admitted Admitted --> Prepared Prepared --> Invoking Invoking --> Validating Validating --> Accepted Validating --> Recoverable Validating --> AwaitingApproval Recoverable --> Prepared Recoverable --> Failed AwaitingApproval --> Accepted AwaitingApproval --> Prepared AwaitingApproval --> Cancelled Accepted --> [*] Failed --> [*] Cancelled --> [*] ``` Adapt states to the workflow while preserving active, recoverable, waiting, approval, degraded, and terminal distinctions. ## 3. State Catalog | State | Purpose/authoritative data | Entry criteria | Allowed exits | Invariant | Timeout/cancellation | | --- | --- | --- | --- | --- | --- | | | | | | | | ## 4. Transition Contract | From -> To | Trigger | Guard and decision owner | Model influence | Mutation and budget | Failure path | Control event | | --- | --- | --- | --- | --- | --- | --- | | | | | | | | | ## 5. Validation and Disposition | Layer | Input/rule owner | Failure reason | Permitted disposition | Prohibited shortcut | | --- | --- | --- | --- | --- | | Invocation | | | | | | Structural | | | | | | Referential | | | | | | Constraint | | | | | | Admissibility | | | | | | Completion | | | | | ## 6. Recovery, Fallback, and Approval | Path/gate | Eligible reason or decision | Required material change/evidence | Budget or scope | Preserved/weakened guarantee | Authority/expiry | Exhaustion/rejection outcome | | --- | --- | --- | --- | --- | --- | --- | | | | | | | | | ## 7. Completion and Local Checks - Terminal outcomes and completion evidence: - Duplicate, late, stale, or conflicting event behavior: - Replay and concurrency checks: - Budget and recovery-exhaustion checks: - Approval binding, expiry, rejection, and timeout checks: - Cancellation and terminal-state checks: - Effective release and emitted receipt references: