diff --git a/apps/server/src/test/kotlin/com/correx/apps/server/bridge/DomainEventMapperTest.kt b/apps/server/src/test/kotlin/com/correx/apps/server/bridge/DomainEventMapperTest.kt index c9ee0228..8caa10d6 100644 --- a/apps/server/src/test/kotlin/com/correx/apps/server/bridge/DomainEventMapperTest.kt +++ b/apps/server/src/test/kotlin/com/correx/apps/server/bridge/DomainEventMapperTest.kt @@ -35,7 +35,6 @@ import com.correx.core.events.types.ToolInvocationId import com.correx.core.events.types.TransitionId import com.correx.core.events.types.ValidationReportId import com.correx.core.inference.TokenUsage -import kotlinx.datetime.Clock import kotlinx.datetime.Instant import kotlinx.coroutines.test.runTest import org.junit.jupiter.api.Assertions.assertEquals diff --git a/core/agents/src/main/kotlin/com/correx/core/agents/Module.kt b/core/agents/src/main/kotlin/com/correx/core/agents/Module.kt deleted file mode 100644 index 77592b23..00000000 --- a/core/agents/src/main/kotlin/com/correx/core/agents/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.agents - -object Module diff --git a/core/artifacts/src/main/kotlin/com/correx/core/artifacts/Module.kt b/core/artifacts/src/main/kotlin/com/correx/core/artifacts/Module.kt deleted file mode 100644 index dc7696da..00000000 --- a/core/artifacts/src/main/kotlin/com/correx/core/artifacts/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.artifacts - -object Module diff --git a/core/config/src/main/kotlin/com/correx/core/config/Module.kt b/core/config/src/main/kotlin/com/correx/core/config/Module.kt deleted file mode 100644 index b624861d..00000000 --- a/core/config/src/main/kotlin/com/correx/core/config/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.config - -object Module diff --git a/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt b/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt index a45770af..124e4f9d 100644 --- a/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt +++ b/core/config/src/test/kotlin/com/correx/core/config/ConfigLoaderTest.kt @@ -1,8 +1,6 @@ package com.correx.core.config import org.junit.jupiter.api.Test -import java.nio.file.Files -import java.nio.file.Paths import kotlin.test.assertEquals class ConfigLoaderTest { diff --git a/core/context/src/main/kotlin/com/correx/core/context/Module.kt b/core/context/src/main/kotlin/com/correx/core/context/Module.kt deleted file mode 100644 index eb314a1c..00000000 --- a/core/context/src/main/kotlin/com/correx/core/context/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.context - -object Module diff --git a/core/observability/src/main/kotlin/com/correx/core/observability/Module.kt b/core/observability/src/main/kotlin/com/correx/core/observability/Module.kt deleted file mode 100644 index e2599e12..00000000 --- a/core/observability/src/main/kotlin/com/correx/core/observability/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.observability - -object Module diff --git a/core/policies/src/main/kotlin/com/correx/core/policies/Module.kt b/core/policies/src/main/kotlin/com/correx/core/policies/Module.kt deleted file mode 100644 index 5d8d8389..00000000 --- a/core/policies/src/main/kotlin/com/correx/core/policies/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.policies - -object Module diff --git a/core/router/src/main/kotlin/com/correx/core/router/Module.kt b/core/router/src/main/kotlin/com/correx/core/router/Module.kt deleted file mode 100644 index 3d2dd20a..00000000 --- a/core/router/src/main/kotlin/com/correx/core/router/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.router - -object Module diff --git a/core/stages/src/main/kotlin/com/correx/core/stages/Module.kt b/core/stages/src/main/kotlin/com/correx/core/stages/Module.kt deleted file mode 100644 index 95f480dc..00000000 --- a/core/stages/src/main/kotlin/com/correx/core/stages/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.stages - -object Module diff --git a/core/tools/src/main/kotlin/com/correx/core/tools/Module.kt b/core/tools/src/main/kotlin/com/correx/core/tools/Module.kt deleted file mode 100644 index e7279e5b..00000000 --- a/core/tools/src/main/kotlin/com/correx/core/tools/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.core.tools - -object Module diff --git a/core/transitions/src/main/kotlin/com/correx/core/transitions/execution/StageExecutor.kt b/core/transitions/src/main/kotlin/com/correx/core/transitions/execution/StageExecutor.kt new file mode 100644 index 00000000..a56b37cf --- /dev/null +++ b/core/transitions/src/main/kotlin/com/correx/core/transitions/execution/StageExecutor.kt @@ -0,0 +1,7 @@ +package com.correx.core.transitions.execution + +interface StageExecutor { + fun execute( + request: StageExecutionRequest + ): StageExecutionResult +} \ No newline at end of file diff --git a/core/transitions/src/main/kotlin/com/correx/core/transitions/policy/CyclePolicyResolver.kt b/core/transitions/src/main/kotlin/com/correx/core/transitions/policy/CyclePolicyResolver.kt new file mode 100644 index 00000000..9d51e70a --- /dev/null +++ b/core/transitions/src/main/kotlin/com/correx/core/transitions/policy/CyclePolicyResolver.kt @@ -0,0 +1,12 @@ +package com.correx.core.transitions.policy + +class CyclePolicyResolver( + private val bindings: Set +) { + + fun resolve(signature: CycleSignature): CyclePolicy? { + return bindings + .firstOrNull { it.cycle == signature } + ?.policy + } +} \ No newline at end of file diff --git a/core/transitions/src/main/kotlin/com/correx/core/transitions/policy/PolicyValidation.kt b/core/transitions/src/main/kotlin/com/correx/core/transitions/policy/PolicyValidation.kt new file mode 100644 index 00000000..9540494a --- /dev/null +++ b/core/transitions/src/main/kotlin/com/correx/core/transitions/policy/PolicyValidation.kt @@ -0,0 +1,23 @@ +package com.correx.core.transitions.policy + +class PolicyValidation { + fun validate( + bindings: Set, + knownCycles: Set + ): List { + + val errors = mutableListOf() + + val bound = bindings.map { it.cycle }.toSet() + + val unbound = knownCycles - bound + + if (unbound.isNotEmpty()) { + errors += unbound.map { + "Cycle $it has no policy binding" + } + } + + return errors + } +} \ No newline at end of file diff --git a/infrastructure/artifacts-cas/src/test/kotlin/com/correx/infrastructure/artifactscas/compact/CompactorTest.kt b/infrastructure/artifacts-cas/src/test/kotlin/com/correx/infrastructure/artifactscas/compact/CompactorTest.kt index 11bbfa50..2f6edd33 100644 --- a/infrastructure/artifacts-cas/src/test/kotlin/com/correx/infrastructure/artifactscas/compact/CompactorTest.kt +++ b/infrastructure/artifacts-cas/src/test/kotlin/com/correx/infrastructure/artifactscas/compact/CompactorTest.kt @@ -18,7 +18,6 @@ import kotlinx.datetime.Clock import org.junit.jupiter.api.Assertions.assertArrayEquals import org.junit.jupiter.api.Assertions.assertEquals import org.junit.jupiter.api.Assertions.assertFalse -import org.junit.jupiter.api.Assertions.assertNotNull import org.junit.jupiter.api.Assertions.assertNull import org.junit.jupiter.api.Assertions.assertTrue import org.junit.jupiter.api.Test diff --git a/infrastructure/inference/src/main/kotlin/com/correx/infrastructure/inference/Module.kt b/infrastructure/inference/src/main/kotlin/com/correx/infrastructure/inference/Module.kt deleted file mode 100644 index 6ad3ebe4..00000000 --- a/infrastructure/inference/src/main/kotlin/com/correx/infrastructure/inference/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.infrastructure.inference - -object Module diff --git a/infrastructure/scheduler/src/main/kotlin/com/correx/infrastructure/scheduler/Module.kt b/infrastructure/scheduler/src/main/kotlin/com/correx/infrastructure/scheduler/Module.kt deleted file mode 100644 index 4390fdc9..00000000 --- a/infrastructure/scheduler/src/main/kotlin/com/correx/infrastructure/scheduler/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.infrastructure.scheduler - -object Module diff --git a/infrastructure/security/src/main/kotlin/com/correx/infrastructure/security/Module.kt b/infrastructure/security/src/main/kotlin/com/correx/infrastructure/security/Module.kt deleted file mode 100644 index f668be80..00000000 --- a/infrastructure/security/src/main/kotlin/com/correx/infrastructure/security/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.infrastructure.security - -object Module diff --git a/infrastructure/telemetry/src/main/kotlin/com/correx/infrastructure/telemetry/Module.kt b/infrastructure/telemetry/src/main/kotlin/com/correx/infrastructure/telemetry/Module.kt deleted file mode 100644 index 17c21994..00000000 --- a/infrastructure/telemetry/src/main/kotlin/com/correx/infrastructure/telemetry/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.infrastructure.telemetry - -object Module diff --git a/interfaces/api/src/main/kotlin/com/correx/interfaces/api/Module.kt b/interfaces/api/src/main/kotlin/com/correx/interfaces/api/Module.kt deleted file mode 100644 index e6a4e8a6..00000000 --- a/interfaces/api/src/main/kotlin/com/correx/interfaces/api/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.interfaces.api - -object Module diff --git a/interfaces/cli/src/main/kotlin/com/correx/interfaces/cli/Module.kt b/interfaces/cli/src/main/kotlin/com/correx/interfaces/cli/Module.kt deleted file mode 100644 index 1630b446..00000000 --- a/interfaces/cli/src/main/kotlin/com/correx/interfaces/cli/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.interfaces.cli - -object Module diff --git a/interfaces/sdk/src/main/kotlin/com/correx/interfaces/sdk/Module.kt b/interfaces/sdk/src/main/kotlin/com/correx/interfaces/sdk/Module.kt deleted file mode 100644 index 0b8c78a6..00000000 --- a/interfaces/sdk/src/main/kotlin/com/correx/interfaces/sdk/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.interfaces.sdk - -object Module diff --git a/plugins/compressors/src/main/kotlin/com/correx/plugins/compressors/Module.kt b/plugins/compressors/src/main/kotlin/com/correx/plugins/compressors/Module.kt deleted file mode 100644 index 2b7d1126..00000000 --- a/plugins/compressors/src/main/kotlin/com/correx/plugins/compressors/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.plugins.compressors - -object Module diff --git a/plugins/policies/src/main/kotlin/com/correx/plugins/policies/Module.kt b/plugins/policies/src/main/kotlin/com/correx/plugins/policies/Module.kt deleted file mode 100644 index 99b1bfab..00000000 --- a/plugins/policies/src/main/kotlin/com/correx/plugins/policies/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.plugins.policies - -object Module diff --git a/plugins/providers/src/main/kotlin/com/correx/plugins/providers/Module.kt b/plugins/providers/src/main/kotlin/com/correx/plugins/providers/Module.kt deleted file mode 100644 index 3a035432..00000000 --- a/plugins/providers/src/main/kotlin/com/correx/plugins/providers/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.plugins.providers - -object Module diff --git a/plugins/stages/src/main/kotlin/com/correx/plugins/stages/Module.kt b/plugins/stages/src/main/kotlin/com/correx/plugins/stages/Module.kt deleted file mode 100644 index 7fccb6f1..00000000 --- a/plugins/stages/src/main/kotlin/com/correx/plugins/stages/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.plugins.stages - -object Module diff --git a/plugins/tools/src/main/kotlin/com/correx/plugins/tools/Module.kt b/plugins/tools/src/main/kotlin/com/correx/plugins/tools/Module.kt deleted file mode 100644 index 827cce10..00000000 --- a/plugins/tools/src/main/kotlin/com/correx/plugins/tools/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.plugins.tools - -object Module diff --git a/plugins/transitions/src/main/kotlin/com/correx/plugins/transitions/Module.kt b/plugins/transitions/src/main/kotlin/com/correx/plugins/transitions/Module.kt deleted file mode 100644 index c76c9771..00000000 --- a/plugins/transitions/src/main/kotlin/com/correx/plugins/transitions/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.plugins.transitions - -object Module diff --git a/plugins/validators/src/main/kotlin/com/correx/plugins/validators/Module.kt b/plugins/validators/src/main/kotlin/com/correx/plugins/validators/Module.kt deleted file mode 100644 index e98d3400..00000000 --- a/plugins/validators/src/main/kotlin/com/correx/plugins/validators/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.plugins.validators - -object Module diff --git a/testing/approvals/src/main/kotlin/com/correx/testing/approvals/Module.kt b/testing/approvals/src/main/kotlin/com/correx/testing/approvals/Module.kt deleted file mode 100644 index 404f1c3e..00000000 --- a/testing/approvals/src/main/kotlin/com/correx/testing/approvals/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.testing.approvals - -object Module diff --git a/testing/contracts/src/testFixtures/kotlin/com/correx/testing/contracts/fixtures/projections/ReplayContractTest.kt b/testing/contracts/src/testFixtures/kotlin/com/correx/testing/contracts/fixtures/projections/ReplayContractTest.kt new file mode 100644 index 00000000..c7c98cc0 --- /dev/null +++ b/testing/contracts/src/testFixtures/kotlin/com/correx/testing/contracts/fixtures/projections/ReplayContractTest.kt @@ -0,0 +1,35 @@ +package com.correx.testing.contracts.fixtures.projections + +import com.correx.core.events.stores.EventStore +import com.correx.core.events.types.EventId +import com.correx.core.events.types.SessionId +import com.correx.core.sessions.projections.replay.EventReplayer +import com.correx.testing.fixtures.EventFixtures.newEvent +import kotlinx.coroutines.runBlocking +import org.junit.jupiter.api.Assertions.assertEquals +import org.junit.jupiter.api.Test + +abstract class ReplayContractTest { + + protected abstract fun store(): EventStore + + protected abstract fun replayer( + store: EventStore + ): EventReplayer + + @Test + fun `rebuild is deterministic`(): Unit = runBlocking { + val store = store() + + repeat(50) { + store.append(newEvent(EventId("e$it"), SessionId("s1"))) + } + + val replayer = replayer(store) + + val state1 = replayer.rebuild(SessionId("s1")) + val state2 = replayer.rebuild(SessionId("s1")) + + assertEquals(state1, state2) + } +} \ No newline at end of file diff --git a/testing/deterministic/src/main/kotlin/com/correx/testing/deterministic/Module.kt b/testing/deterministic/src/main/kotlin/com/correx/testing/deterministic/Module.kt deleted file mode 100644 index 72d22d1c..00000000 --- a/testing/deterministic/src/main/kotlin/com/correx/testing/deterministic/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.testing.deterministic - -object Module diff --git a/testing/integration/src/main/kotlin/com/correx/testing/integration/Module.kt b/testing/integration/src/main/kotlin/com/correx/testing/integration/Module.kt deleted file mode 100644 index dac6e0eb..00000000 --- a/testing/integration/src/main/kotlin/com/correx/testing/integration/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.testing.integration - -object Module diff --git a/testing/projections/src/main/kotlin/com/correx/testing/projections/Module.kt b/testing/projections/src/main/kotlin/com/correx/testing/projections/Module.kt deleted file mode 100644 index 1b5e1b82..00000000 --- a/testing/projections/src/main/kotlin/com/correx/testing/projections/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.testing.projections - -object Module diff --git a/testing/replay/src/main/kotlin/com/correx/testing/replay/Module.kt b/testing/replay/src/main/kotlin/com/correx/testing/replay/Module.kt deleted file mode 100644 index fe0f3048..00000000 --- a/testing/replay/src/main/kotlin/com/correx/testing/replay/Module.kt +++ /dev/null @@ -1,3 +0,0 @@ -package com.correx.testing.replay - -object Module