Wave ctx validation

From re-cinq/wave · View interactive version

Wave ctx validation is an AI agent skill from the GitHub repository re-cinq/wave. Domain context for Multi-layer output validation system — contract enforcement with six validator types (json_schema, typescript_interface, test_suite, markdown_spec, format, non_empty_file), progressive JSON recovery with three aggressiveness tiers, adaptive retry with failure classification and re

How to use this skill

Skill file

Validation Context

Multi-layer output validation system — contract enforcement with six validator types (json_schema, typescript_interface, test_suite, markdown_spec, format, non_empty_file), progressive JSON recovery with three aggressiveness tiers, adaptive retry with failure classification and repair prompts, error wrapper detection for AI-generated envelopes, input artifact schema validation, preflight dependency checks with auto-install, and pipeline-level phase/concurrency/staleness validation.

Invariants

Key Decisions

Domain Vocabulary

| Term | Meaning |

|------|--------|

| ContractConfig | Configuration for contract validation — type, source, schema, retries, recovery level, must_pass, on_failure |

| ContractValidator | Interface: Validate(cfg ContractConfig, workspacePath string) error — pluggable per contract type |

| ValidationError | Structured error with ContractType, Message, Details, Retryable, Attempt, MaxRetries |

| RetryStrategy | Interface: ShouldRetry, GetRetryDelay, GenerateRepairPrompt — pluggable retry behavior |

| AdaptiveRetryStrategy | Concrete strategy with failure classification, exponential backoff, and targeted repair prompts |

| FailureClassifier | Analyzes validation errors to determine FailureType for targeted repair |

| ClassifiedFailure | Contains Type, Message, Details, Retryable, Confidence, Suggestions |

| RetryResult | Outcome of retry sequence — Success, Attempts, FailureTypes, TotalDuration, FinalError |

| JSONRecoveryParser | Progressive JSON parser with tiered recovery strategies (conservative/progressive/aggressive) |

| RecoveryResult | Contains OriginalInput, RecoveredJSON, IsValid, AppliedFixes, Warnings, ParsedData |

| RecoveryLevel | Enum: ConservativeRecovery (safe fixes only), ProgressiveRecovery (structural fixes), AggressiveRecovery (inference-based reconstruction) |

| ErrorWrapper | AI-generated error envelope structure detected by matching indicator fields |

| WrapperDetectionResult | Detection outcome with IsWrapper, RawContent, Confidence, FieldsMatched |

| FormatValidator | Production-readiness validator for structured outputs like GitHub issues, PRs, implementation results |

| InputValidationResult | Input artifact check outcome — Passed, ArtifactRef, Error, TypeMatch, SchemaValid |

| SchemaErrorAnalysis | Categorized schema error with MainMessage, ErrorType, Suggestions, CommonPitfalls, Example, Retryable |

| Checker | Preflight dependency validator — checks tools on PATH and skills installed |

| ToolError | Error wrapping list of missing CLI tools |

| SkillError | Error wrapping list of missing skills with auto-install support |

| PreflightError | Composite error wrapping both ToolError and SkillError, supporting errors.As() |

| PhaseSkipValidator | Validates phase prerequisites when resuming prototype pipelines |

| StaleArtifactDetector | Detects stale upstream artifacts by comparing modification times |

| ConcurrencyValidator | In-memory workspace locks preventing concurrent pipeline execution on same workspace |

| FailureTypeSchemaMismatch | Wrong types or missing fields in validated output |

| FailureTypeMissingContent | Required content absent from output |

| FailureTypeFormatError | Invalid JSON syntax in output |

| FailureTypeQualityGate | Output fails quality check thresholds |

| FailureTypeStructure | Incorrect document structure in output |

| FailureTypeUnknown | Unclassifiable error — NOT retryable |

Neighboring Contexts

Key Files

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.