d26f20c316
Root Child DOX Index assembled, plus a per-module AGENTS.md across the tree (core/*, infrastructure/*, apps/*, testing/*, and docs/examples/frontend/etc), each following the DOX section shape: Purpose, Ownership, Local Contracts, Work Guidance, Verification, Child DOX Index.
2.8 KiB
2.8 KiB
core/validation — AGENTS.md
Purpose
Layered validation pipeline: validates workflow graphs (structure, cycles, reachability), session state, semantic rules, JSON schema conformance, and artifact payloads before any state-mutating operation proceeds.
Ownership
CORREX kernel team. Hard Invariant #7 applies here: LLM outputs are untrusted until this pipeline approves them.
Local Contracts
ValidationPipeline— top-level entry point; runs all registered validators in sequence and collectsValidationReport.Validator— interface for a single validator. ReturnsValidationOutcome(pass/warn/fail) withValidationIssuelist.- Built-in validators:
GraphValidator— validatesWorkflowGraph: reachability, cycle detection (viacore:transitionsCycleExtractor), missing tool references.SemanticValidator— appliesSemanticRules to workflow/stage definitions.SessionValidator— validates session preconditions before launch.TransitionValidator— validates transition edge definitions.ArtifactPayloadValidator— validates artifact payloads againstJsonSchema.JsonSchemaValidator— JSON schema conformance check.SceneValidator— validates scene definitions.
ValidationReport/ValidationIssue/ValidationOutcome/ValidationSeverity/ValidationSection/ValidationLocation— report structure types.ValidationContext— context passed to all validators (session, graph, config).ValidationRiskStats— risk statistics derived from validation results, consumed bycore:risk.ApprovalRequest/ApprovalTrigger— approval-related types used during validation-triggered approval flows.CyclePolicy/CyclePolicyBinding/CycleSignature/CycleSignatureFactory/CycleExitRule— cycle policy enforcement: detects recurring cycle patterns and applies policy (warn/fail/allow).RiskSummary— local re-export of risk summary type used in validation output.MissingToolRule/SemanticRule— built-in semantic rule implementations.
Work Guidance
- Add new validators by implementing
Validatorand registering inValidationPipeline. Do not add validation logic directly toSessionOrchestratoror other callers. ValidationPipelinemust be run before any inference call processes its output (Hard Invariant #7).CyclePolicyis the mechanism for allowing controlled cycles in workflows; do not bypass it.GraphValidatorcallsCycleExtractorfromcore:transitions— this is the one legitimate cross-core reference; it is structural, not domain logic.
Verification
./gradlew :core:validation:test --rerun-tasks
Tests in testing/deterministic/ (GraphValidatorTest) and testing/contracts/ (ContextSnapshotTest).
Child DOX Index
No child AGENTS.md (leaf module).