chore(cleanup): delete confirmed-dead files with no live references
Removes 6 files audited as fully unused: StageExecutor interface (shadowed by kernel), CyclePolicyResolver and PolicyValidation (deferred cycle policy), ApprovalRoutes (never registered), TuiNavigation (superseded by reducer), and ReplayContractTest abstract class (no concrete subclasses). ArtifactRelationshipType and CyclePolicy were audited but retained — both are actively referenced by production code.
This commit is contained in:
@@ -1,55 +0,0 @@
|
||||
@file:Suppress("MatchingDeclarationName")
|
||||
|
||||
package com.correx.apps.server.routes
|
||||
|
||||
import com.correx.apps.server.approval.ApprovalCoordinator
|
||||
import com.correx.apps.server.protocol.ApprovalDecision
|
||||
import com.correx.apps.server.protocol.ClientMessage
|
||||
import com.correx.apps.server.protocol.ServerMessage
|
||||
import com.correx.core.events.types.ApprovalRequestId
|
||||
import com.correx.core.events.types.SessionId
|
||||
import com.correx.core.utils.TypeId
|
||||
import io.ktor.http.HttpStatusCode
|
||||
import io.ktor.server.request.receive
|
||||
import io.ktor.server.response.respond
|
||||
import io.ktor.server.routing.Route
|
||||
import io.ktor.server.routing.post
|
||||
import io.ktor.server.routing.route
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class ApprovalRequest(
|
||||
val requestId: String,
|
||||
val decision: String,
|
||||
val note: String? = null,
|
||||
)
|
||||
|
||||
fun Route.approvalRoutes(coordinator: ApprovalCoordinator) {
|
||||
route("/sessions/{id}/approve") {
|
||||
post {
|
||||
val id = call.parameters["id"]
|
||||
?: return@post call.respond(HttpStatusCode.BadRequest, "Missing session id")
|
||||
val sessionId: SessionId = TypeId(id)
|
||||
val body = call.receive<ApprovalRequest>()
|
||||
val requestId: ApprovalRequestId = TypeId(body.requestId)
|
||||
val decision = when (body.decision.lowercase()) {
|
||||
"approve" -> ApprovalDecision.APPROVE
|
||||
"reject" -> ApprovalDecision.REJECT
|
||||
"steer" -> ApprovalDecision.STEER
|
||||
else -> return@post call.respond(HttpStatusCode.BadRequest, "Unknown decision: ${body.decision}")
|
||||
}
|
||||
val msg = ClientMessage.ApprovalResponse(
|
||||
requestId = requestId,
|
||||
decision = decision,
|
||||
steeringNote = body.note,
|
||||
)
|
||||
val error = coordinator.handleResponse(msg, sessionId)
|
||||
if (error != null) {
|
||||
val msg = (error as? ServerMessage.ProtocolError)?.message
|
||||
call.respond(HttpStatusCode.Conflict, mapOf("error" to msg))
|
||||
} else {
|
||||
call.respond(HttpStatusCode.OK)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user