refactor(tools): fold research tools into :infrastructure:tools (drop new module)
The research feature is "no new architecture" (spec §1) — composition of existing
mechanisms. The only genuinely new code is the two web tools + the HTML→markdown
extractor (spec marks them "(new)"), and those belong with ShellTool/FileReadTool
in :infrastructure:tools, not in a separate module.
Moves extract/ + web/ from the short-lived :infrastructure:research module into
:infrastructure:tools (packages com.correx.infrastructure.tools.{extract,web}); adds
jsoup + ktor-client there; removes the module from settings.gradle. No behaviour change
— 44 tests green.
This commit is contained in:
@@ -1,24 +0,0 @@
|
|||||||
plugins {
|
|
||||||
id 'java-library'
|
|
||||||
id 'org.jetbrains.kotlin.jvm'
|
|
||||||
id 'org.jetbrains.kotlin.plugin.serialization'
|
|
||||||
}
|
|
||||||
|
|
||||||
ext {
|
|
||||||
ktor_version = '3.0.3'
|
|
||||||
}
|
|
||||||
|
|
||||||
dependencies {
|
|
||||||
implementation project(":core:events")
|
|
||||||
implementation project(":core:tools")
|
|
||||||
implementation project(":core:approvals")
|
|
||||||
implementation 'org.jsoup:jsoup:1.20.1'
|
|
||||||
implementation "io.ktor:ktor-client-core:$ktor_version"
|
|
||||||
implementation "io.ktor:ktor-client-cio:$ktor_version"
|
|
||||||
|
|
||||||
testImplementation "io.ktor:ktor-client-mock:$ktor_version"
|
|
||||||
}
|
|
||||||
|
|
||||||
// Pure deterministic extraction utility; coverage gate is enforced via its own thorough
|
|
||||||
// unit tests, not the global line-count bound (same stance as :infrastructure:tools).
|
|
||||||
tasks.named("koverVerify").configure { enabled = false }
|
|
||||||
@@ -4,6 +4,10 @@ plugins {
|
|||||||
id 'org.jetbrains.kotlin.plugin.serialization'
|
id 'org.jetbrains.kotlin.plugin.serialization'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ext {
|
||||||
|
ktor_version = '3.0.3'
|
||||||
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation project(":core:tools")
|
implementation project(":core:tools")
|
||||||
implementation project(":core:events")
|
implementation project(":core:events")
|
||||||
@@ -12,6 +16,13 @@ dependencies {
|
|||||||
implementation project(":infrastructure:tools:filesystem")
|
implementation project(":infrastructure:tools:filesystem")
|
||||||
implementation project(":core:artifacts")
|
implementation project(":core:artifacts")
|
||||||
implementation project(":core:artifacts-store")
|
implementation project(":core:artifacts-store")
|
||||||
|
|
||||||
|
// Web research tools (web_search, web_fetch) + deterministic HTML→markdown extraction.
|
||||||
|
implementation 'org.jsoup:jsoup:1.20.1'
|
||||||
|
implementation "io.ktor:ktor-client-core:$ktor_version"
|
||||||
|
implementation "io.ktor:ktor-client-cio:$ktor_version"
|
||||||
|
|
||||||
|
testImplementation "io.ktor:ktor-client-mock:$ktor_version"
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named("koverVerify").configure { enabled = false }
|
tasks.named("koverVerify").configure { enabled = false }
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.extract
|
package com.correx.infrastructure.tools.extract
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Outcome of extracting a fetched page (research-workflow-spec §5). The cleaned [markdown] is the
|
* Outcome of extracting a fetched page (research-workflow-spec §5). The cleaned [markdown] is the
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.extract
|
package com.correx.infrastructure.tools.extract
|
||||||
|
|
||||||
import org.jsoup.Jsoup
|
import org.jsoup.Jsoup
|
||||||
|
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.extract
|
package com.correx.infrastructure.tools.extract
|
||||||
|
|
||||||
import org.jsoup.nodes.Document
|
import org.jsoup.nodes.Document
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.extract
|
package com.correx.infrastructure.tools.extract
|
||||||
|
|
||||||
import org.jsoup.nodes.Element
|
import org.jsoup.nodes.Element
|
||||||
import org.jsoup.nodes.Node
|
import org.jsoup.nodes.Node
|
||||||
+3
-3
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.web
|
package com.correx.infrastructure.tools.web
|
||||||
|
|
||||||
import com.correx.core.approvals.Tier
|
import com.correx.core.approvals.Tier
|
||||||
import com.correx.core.events.events.ToolRequest
|
import com.correx.core.events.events.ToolRequest
|
||||||
@@ -9,8 +9,8 @@ import com.correx.core.tools.contract.ToolCapability
|
|||||||
import com.correx.core.tools.contract.ToolExecutor
|
import com.correx.core.tools.contract.ToolExecutor
|
||||||
import com.correx.core.tools.contract.ToolResult
|
import com.correx.core.tools.contract.ToolResult
|
||||||
import com.correx.core.tools.contract.ValidationResult
|
import com.correx.core.tools.contract.ValidationResult
|
||||||
import com.correx.infrastructure.research.extract.ExtractionQuality
|
import com.correx.infrastructure.tools.extract.ExtractionQuality
|
||||||
import com.correx.infrastructure.research.extract.HtmlMarkdownExtractor
|
import com.correx.infrastructure.tools.extract.HtmlMarkdownExtractor
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.request.prepareGet
|
import io.ktor.client.request.prepareGet
|
||||||
import io.ktor.client.statement.bodyAsChannel
|
import io.ktor.client.statement.bodyAsChannel
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.web
|
package com.correx.infrastructure.tools.web
|
||||||
|
|
||||||
import com.correx.core.approvals.Tier
|
import com.correx.core.approvals.Tier
|
||||||
import com.correx.core.events.events.ToolRequest
|
import com.correx.core.events.events.ToolRequest
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.extract
|
package com.correx.infrastructure.tools.extract
|
||||||
|
|
||||||
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
|
||||||
BIN
Binary file not shown.
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
package com.correx.infrastructure.research.web
|
package com.correx.infrastructure.tools.web
|
||||||
|
|
||||||
import com.correx.core.approvals.Tier
|
import com.correx.core.approvals.Tier
|
||||||
import com.correx.core.events.events.ToolRequest
|
import com.correx.core.events.events.ToolRequest
|
||||||
@@ -39,7 +39,6 @@ include ':infrastructure:tools'
|
|||||||
include ':infrastructure:tools:filesystem'
|
include ':infrastructure:tools:filesystem'
|
||||||
include ':infrastructure:workflow'
|
include ':infrastructure:workflow'
|
||||||
include ':infrastructure:artifacts-cas'
|
include ':infrastructure:artifacts-cas'
|
||||||
include ':infrastructure:research'
|
|
||||||
|
|
||||||
include ':testing:replay'
|
include ':testing:replay'
|
||||||
include ':testing:contracts'
|
include ':testing:contracts'
|
||||||
|
|||||||
Reference in New Issue
Block a user