chore(cleanup): remove dead Module stubs and unused imports; restore deferred files
Deletes 21 Module.kt scaffolding objects that were never wired into any DI registry. Removes unused imports across 8 production and 3 test files. Restores StageExecutor, CyclePolicyResolver, PolicyValidation, and ReplayContractTest — these are deferred features, not dead code.
This commit is contained in:
@@ -35,7 +35,6 @@ import com.correx.core.events.types.ToolInvocationId
|
|||||||
import com.correx.core.events.types.TransitionId
|
import com.correx.core.events.types.TransitionId
|
||||||
import com.correx.core.events.types.ValidationReportId
|
import com.correx.core.events.types.ValidationReportId
|
||||||
import com.correx.core.inference.TokenUsage
|
import com.correx.core.inference.TokenUsage
|
||||||
import kotlinx.datetime.Clock
|
|
||||||
import kotlinx.datetime.Instant
|
import kotlinx.datetime.Instant
|
||||||
import kotlinx.coroutines.test.runTest
|
import kotlinx.coroutines.test.runTest
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.agents
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.artifacts
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.config
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,8 +1,6 @@
|
|||||||
package com.correx.core.config
|
package com.correx.core.config
|
||||||
|
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
import java.nio.file.Files
|
|
||||||
import java.nio.file.Paths
|
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
class ConfigLoaderTest {
|
class ConfigLoaderTest {
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.context
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.observability
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.policies
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.router
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.stages
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.core.tools
|
|
||||||
|
|
||||||
object Module
|
|
||||||
+7
@@ -0,0 +1,7 @@
|
|||||||
|
package com.correx.core.transitions.execution
|
||||||
|
|
||||||
|
interface StageExecutor {
|
||||||
|
fun execute(
|
||||||
|
request: StageExecutionRequest
|
||||||
|
): StageExecutionResult
|
||||||
|
}
|
||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package com.correx.core.transitions.policy
|
||||||
|
|
||||||
|
class CyclePolicyResolver(
|
||||||
|
private val bindings: Set<CyclePolicyBinding>
|
||||||
|
) {
|
||||||
|
|
||||||
|
fun resolve(signature: CycleSignature): CyclePolicy? {
|
||||||
|
return bindings
|
||||||
|
.firstOrNull { it.cycle == signature }
|
||||||
|
?.policy
|
||||||
|
}
|
||||||
|
}
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
package com.correx.core.transitions.policy
|
||||||
|
|
||||||
|
class PolicyValidation {
|
||||||
|
fun validate(
|
||||||
|
bindings: Set<CyclePolicyBinding>,
|
||||||
|
knownCycles: Set<CycleSignature>
|
||||||
|
): List<String> {
|
||||||
|
|
||||||
|
val errors = mutableListOf<String>()
|
||||||
|
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
-1
@@ -18,7 +18,6 @@ import kotlinx.datetime.Clock
|
|||||||
import org.junit.jupiter.api.Assertions.assertArrayEquals
|
import org.junit.jupiter.api.Assertions.assertArrayEquals
|
||||||
import org.junit.jupiter.api.Assertions.assertEquals
|
import org.junit.jupiter.api.Assertions.assertEquals
|
||||||
import org.junit.jupiter.api.Assertions.assertFalse
|
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.assertNull
|
||||||
import org.junit.jupiter.api.Assertions.assertTrue
|
import org.junit.jupiter.api.Assertions.assertTrue
|
||||||
import org.junit.jupiter.api.Test
|
import org.junit.jupiter.api.Test
|
||||||
|
|||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.infrastructure.inference
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.infrastructure.scheduler
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.infrastructure.security
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.infrastructure.telemetry
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.interfaces.api
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.interfaces.cli
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.interfaces.sdk
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.plugins.compressors
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.plugins.policies
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.plugins.providers
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.plugins.stages
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.plugins.tools
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.plugins.transitions
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.plugins.validators
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.testing.approvals
|
|
||||||
|
|
||||||
object Module
|
|
||||||
+35
@@ -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<S> {
|
||||||
|
|
||||||
|
protected abstract fun store(): EventStore
|
||||||
|
|
||||||
|
protected abstract fun replayer(
|
||||||
|
store: EventStore
|
||||||
|
): EventReplayer<S>
|
||||||
|
|
||||||
|
@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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.testing.deterministic
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.testing.integration
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.testing.projections
|
|
||||||
|
|
||||||
object Module
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
package com.correx.testing.replay
|
|
||||||
|
|
||||||
object Module
|
|
||||||
Reference in New Issue
Block a user