71a73a4fa2
Tool fixes: - FileWriteTool, FileEditTool: resolve relative paths against workingDir instead of JVM cwd - FileReadTool: remove allowedPaths restriction — reads are unrestricted - ShellTool: add workingDir for ProcessBuilder, remove environment().clear(), fail-open when allowedExecutables empty Config: - Add [tools] section to config.toml: sandbox_root, working_dir, shell_allowed_executables, default_system_prompt_path - Three-level resolution: env var > config file > hardcoded default - OrchestrationConfig sandboxRoot and defaultSystemPromptPath now sourced from CorrexConfig - Single defaultOrchestrationConfig in ServerModule, shared by SessionRoutes and GlobalStreamHandler Dead code: - Delete EventTypes.kt — orphaned string constants duplicating serialization annotations Static analysis: - Remove 10 unused imports across 9 files - Remove redundant return in ReplayOrchestrator - Remove redundant suspend from ApprovalCoordinator.handleResponse - Fix unreachable InputMode.None branch in InputBar - Enable full detekt rule sets in detekt.yml
131 lines
4.1 KiB
Groovy
131 lines
4.1 KiB
Groovy
import io.gitlab.arturbosch.detekt.Detekt
|
|
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
|
|
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
|
|
|
|
plugins {
|
|
id 'org.jetbrains.kotlin.jvm' version '2.2.10' apply false
|
|
id 'org.jetbrains.kotlin.plugin.serialization' version '2.2.10' apply false
|
|
id 'org.jetbrains.kotlin.plugin.compose' version '2.2.10' apply false
|
|
id "io.gitlab.arturbosch.detekt" version "1.23.7"
|
|
id "org.jetbrains.kotlinx.kover" version "0.8.3"
|
|
id "org.sonarqube" version "5.1.0.4882"
|
|
}
|
|
|
|
ext {
|
|
kotlin_version = '2.2.10'
|
|
kotlinx_coroutines_version = '1.9.0'
|
|
kotlinx_serialization_version = '1.7.3'
|
|
kotlinx_datetime_version = '0.6.2'
|
|
junit_version = '5.11.0'
|
|
sqlite_jdbc_version = '3.47.1.0'
|
|
|
|
exposed_version = '0.57.0'
|
|
ktor_version = '3.0.3'
|
|
hoplite_version = '2.8.2'
|
|
sqlite_jdbc_version = '3.47.1.0'
|
|
}
|
|
|
|
allprojects {
|
|
group = 'com.correx'
|
|
version = '0.1.0'
|
|
|
|
repositories {
|
|
mavenCentral()
|
|
google()
|
|
}
|
|
}
|
|
|
|
subprojects {
|
|
pluginManager.withPlugin("org.jetbrains.kotlin.jvm") {
|
|
|
|
apply plugin: "io.gitlab.arturbosch.detekt"
|
|
apply plugin: "org.jetbrains.kotlinx.kover"
|
|
|
|
detekt {
|
|
toolVersion = "1.23.7"
|
|
config.setFrom("$rootDir/detekt.yml")
|
|
buildUponDefaultConfig = true
|
|
ignoreFailures = false
|
|
}
|
|
|
|
kover {
|
|
reports {
|
|
verify {
|
|
rule {
|
|
minBound(70)
|
|
}
|
|
}
|
|
filters {
|
|
excludes {
|
|
classes("*Generated*")
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.named("check") {
|
|
dependsOn("test")
|
|
dependsOn("detekt")
|
|
dependsOn("koverVerify")
|
|
}
|
|
}
|
|
|
|
plugins.withId('org.jetbrains.kotlin.jvm') {
|
|
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(21)
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinx_coroutines_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-serialization-json:$kotlinx_serialization_version"
|
|
implementation "org.xerial:sqlite-jdbc:$sqlite_jdbc_version"
|
|
implementation "org.jetbrains.kotlinx:kotlinx-datetime:$kotlinx_datetime_version"
|
|
testImplementation "org.junit.jupiter:junit-jupiter:$junit_version"
|
|
}
|
|
|
|
test {
|
|
useJUnitPlatform()
|
|
testLogging {
|
|
events "passed", "skipped", "failed", "standardOut", "standardError"
|
|
showStandardStreams = true
|
|
exceptionFormat = 'full'
|
|
}
|
|
afterSuite { desc, result ->
|
|
if (!desc.parent) { // Only log for the final root suite
|
|
def duration = (result.endTime - result.startTime) / 1000
|
|
|
|
println """
|
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
tests: ${result.testCount}
|
|
passed: ${result.successfulTestCount}
|
|
failed: ${result.failedTestCount}
|
|
skipped: ${result.skippedTestCount}
|
|
|
|
result: ${result.resultType}
|
|
time: ${duration}s
|
|
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
"""
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(Detekt).configureEach {
|
|
reports {
|
|
html.required.set(true)
|
|
xml.required.set(true)
|
|
txt.required.set(false)
|
|
}
|
|
}
|
|
|
|
tasks.withType(KotlinCompile).configureEach {
|
|
compilerOptions {
|
|
jvmTarget = JvmTarget.JVM_21
|
|
freeCompilerArgs.add("-Xcontext-receivers")
|
|
}
|
|
}
|
|
}
|
|
} |