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.2 KiB
2.2 KiB
core/transitions — AGENTS.md
Purpose
FSM/workflow graph execution: defines the WorkflowGraph (stages and transition edges), resolves which transition to take at each step, executes stages, and detects cycles.
Ownership
CORREX kernel team.
Local Contracts
WorkflowGraph— the workflow DAG: stages (StageConfig) connected byTransitionEdges.TransitionResolver/DefaultTransitionResolver— evaluatesTransitionConditions againstEvaluationContextto pick the next stage.TransitionCondition— sealed interface for conditions. Built-in:AlwaysTrue,VariableEquals,ArtifactFieldEquals,ArtifactConditions, and composites (Composites).StageExecutor— executes a single stage given aStageExecutionRequest; returnsStageExecutionResult.StageExecutionEventMapper/DefaultStageExecutionEventMapper— maps stage execution results to domain events.TransitionDecision/TransitionOrdering— decision and ordering types.EvaluationContext— runtime context for condition evaluation.PromptResolver— resolves prompt templates for a stage from config.CycleExtractor/CycleDfs/DetectedCycle/CycleCanonicalizer— detect and canonicalize cycles in the workflow graph (used bycore:validation).DeterministicAdjacencyBuilder/GraphOrdering— deterministic graph traversal for consistent ordering.VisitState— DFS traversal state.
Work Guidance
DefaultTransitionResolveris stateless per call — it readsEvaluationContext, not persisted state.- Stage events are recorded by
DefaultStageExecutionEventMapper; the mapper must emit events for every outcome (success, failure, skip). WorkflowGraphis built from config/TOML at session start; it is immutable during a session.- Cycle detection (
CycleExtractor) runs during graph validation (core:validation), not at runtime.
Verification
./gradlew :core:transitions:test --rerun-tasks
Tests in testing/transitions/ (DefaultTransitionResolverTest, TransitionFuzzTest, TransitionEventSerializationTest) and testing/replay/ (TransitionReplayIntegrationTest).
Child DOX Index
No child AGENTS.md (leaf module).