chore(damn): detekt, build, tests, formatting

fixed detekt issues where possible.
fixed disttar failing build because tools is added twice in the server module.
added workflowId where required.
fixed some tests not being recognized because of runBlocking without explicit return type.
formatting + imports.
This commit is contained in:
2026-05-22 00:10:05 +04:00
parent 2c459da009
commit f827685ed0
185 changed files with 1134 additions and 832 deletions
@@ -31,4 +31,4 @@ internal class CycleExtractor(
return canonicalize(cycles)
}
}
}
@@ -6,4 +6,4 @@ import com.correx.core.transitions.graph.TransitionEdge
data class DetectedCycle(
val nodes: List<StageId>,
val edges: List<TransitionEdge>
)
)
@@ -18,4 +18,4 @@ internal class DeterministicAdjacencyBuilder {
)
}
}
}
}
@@ -33,4 +33,4 @@ internal object CycleCanonicalizer {
}
.sortedBy { it.nodes.first().value }
}
}
}
@@ -10,4 +10,4 @@ data class EvaluationContext(
val currentStage: StageId,
val artifacts: Map<ArtifactId, ArtifactState> = emptyMap(),
val variables: Map<String, String> = emptyMap(),
)
)
@@ -7,4 +7,4 @@ fun interface TransitionConditionEvaluator {
condition: TransitionCondition,
context: EvaluationContext
): Boolean
}
}
@@ -9,4 +9,4 @@ sealed interface StageExecutionResult {
val reason: String,
val retryable: Boolean,
) : StageExecutionResult
}
}
@@ -4,4 +4,4 @@ interface StageExecutor {
fun execute(
request: StageExecutionRequest
): StageExecutionResult
}
}
@@ -12,4 +12,4 @@ internal fun WorkflowGraph.sortedTransitions(): List<TransitionEdge> =
{ it.id.value },
{ it.to.value }
)
)
)
@@ -4,4 +4,4 @@ import com.correx.core.transitions.evaluation.EvaluationContext
fun interface TransitionCondition {
fun evaluate(context: EvaluationContext): Boolean
}
}
@@ -8,4 +8,4 @@ data class TransitionEdge(
val from: StageId,
val to: StageId,
val condition: TransitionCondition
)
)
@@ -10,6 +10,7 @@ data class WorkflowGraph(
) {
val stageIds: Set<StageId> get() = stages.keys
init {
require(id.isNotBlank()) { "workflow id must not be blank" }
require(start in stages) { "start stage must exist in stages" }
}
}
@@ -44,4 +44,4 @@ class DefaultStageExecutionEventMapper : StageExecutionEventMapper {
)
}
}
}
}
@@ -9,4 +9,4 @@ interface StageExecutionEventMapper {
request: StageExecutionRequest,
result: StageExecutionResult
): List<EventPayload>
}
}
@@ -12,4 +12,4 @@ sealed interface CyclePolicy {
data class Approval(
val timeoutMs: Long
) : CyclePolicy
}
}
@@ -3,4 +3,4 @@ package com.correx.core.transitions.policy
data class CyclePolicyBinding(
val cycle: CycleSignature,
val policy: CyclePolicy
)
)
@@ -9,4 +9,4 @@ class CyclePolicyResolver(
.firstOrNull { it.cycle == signature }
?.policy
}
}
}
@@ -20,4 +20,4 @@ class PolicyValidation {
return errors
}
}
}
@@ -32,4 +32,4 @@ class DefaultTransitionResolver(
}
return TransitionDecision.Stay
}
}
}
@@ -17,4 +17,4 @@ sealed interface TransitionDecision {
) : TransitionDecision
data object NoMatch : TransitionDecision
}
}
@@ -7,4 +7,4 @@ object TransitionOrdering {
compareBy<TransitionEdge> { it.from.value }
.thenBy { it.id.value }
.thenBy { it.to.value }
}
}
@@ -8,4 +8,4 @@ interface TransitionResolver {
graph: WorkflowGraph,
context: EvaluationContext
): TransitionDecision
}
}
@@ -3,4 +3,4 @@ package com.correx.core.transitions.state
internal enum class VisitState {
VISITING,
VISITED
}
}