Implement closed-loop workspace follow-ups

This commit is contained in:
2026-07-15 23:48:12 +04:00
parent 3a48ecd24f
commit ed7efb6072
51 changed files with 702 additions and 54 deletions
+2
View File
@@ -23,6 +23,8 @@ CORREX kernel team. Config schema changes affect all consumers — coordinate wi
- Config is read from disk; it is not event-sourced. Do not add event/state/reducer structures here.
- `ConfigHolder` is the shared mutable reference injected into consumers. Never read the file directly in domain code — always go through `ConfigHolder`.
- `CorrexConfigWriter` regenerates TOML from the in-memory model; round-tripping loses comments by design.
- `[git]` is opt-in server transport configuration (`enabled`, `remote`, `base_branch`, optional `author`); it is off by default.
- `ModelConfig.contextSize` defaults to 24,576 tokens; explicit `context_size` remains the operator override for smaller local-model windows.
## Verification
@@ -199,7 +199,7 @@ object ConfigLoader {
private const val DEFAULT_CONVERSATION_KEEP_LAST = 6
private const val DEFAULT_RETRIEVAL_K = 5
private const val DEFAULT_TOKEN_BUDGET = 4096
private const val DEFAULT_MODEL_CONTEXT_SIZE = 8192
private const val DEFAULT_MODEL_CONTEXT_SIZE = 24_576
private const val DEFAULT_PROJECT_MEMORY_K = 5
private const val DEFAULT_PROJECT_MAX_DEPTH = 4
private const val DEFAULT_PROJECT_INJECT_TOP_K = 30
@@ -735,6 +735,14 @@ object ConfigLoader {
repeatPenalty = samplingSection["repeat_penalty"]?.let { asDouble(it) },
)
val gitSection = sections["git"] ?: emptyMap()
val git = GitConfig(
enabled = asBoolean(gitSection["enabled"], false),
remote = asString(gitSection["remote"], "origin"),
baseBranch = asString(gitSection["base_branch"], "main"),
author = asString(gitSection["author"], ""),
)
return CorrexConfig(
server = server,
tui = tui,
@@ -749,6 +757,7 @@ object ConfigLoader {
personalization = personalization,
orchestration = orchestration,
sampling = sampling,
git = git,
)
}
@@ -18,6 +18,21 @@ data class CorrexConfig(
val orchestration: OrchestrationKnobs = OrchestrationKnobs(),
val sampling: SamplingConfig = SamplingConfig(),
val health: HealthConfig = HealthConfig(),
val git: GitConfig = GitConfig(),
)
/**
* Optional transport for a server-owned checkout. Each run executes on a `run/<sessionId>` branch
* based on [baseBranch] and pushes that branch on terminal completion; the working directory stays
* a real local path, never a remote URL or mounted client filesystem.
*/
@Serializable
data class GitConfig(
val enabled: Boolean = false,
val remote: String = "origin",
val baseBranch: String = "main",
/** Optional Git author value, for example `Correx <correx@example.invalid>`. */
val author: String = "",
)
/**
@@ -283,7 +298,8 @@ data class L3Config(
data class ModelConfig(
val id: String,
val modelPath: String,
val contextSize: Int = 8192,
/** Default window for implementation stages; leave headroom above their 24K prompt budget. */
val contextSize: Int = 24_576,
val params: Map<String, String> = emptyMap(),
val capabilities: Map<String, Double> = emptyMap(),
)
@@ -109,6 +109,12 @@ object CorrexConfigWriter {
cfg.sampling.minP?.let { b.kv("min_p", it) }
cfg.sampling.repeatPenalty?.let { b.kv("repeat_penalty", it) }
b.section("git")
b.kv("enabled", cfg.git.enabled)
b.kv("remote", str(cfg.git.remote))
b.kv("base_branch", str(cfg.git.baseBranch))
b.kv("author", str(cfg.git.author))
b.section("personalization")
b.kv("enabled", cfg.personalization.enabled)
b.kv("learn", cfg.personalization.learn)
@@ -434,7 +434,7 @@ class ConfigLoaderTest {
assertEquals(1, result.models.size)
assertEquals("local-model", result.models[0].id)
assertEquals("/models/local.gguf", result.models[0].modelPath)
assertEquals(8192, result.models[0].contextSize)
assertEquals(24_576, result.models[0].contextSize)
}
@Test
@@ -37,6 +37,7 @@ class CorrexConfigWriterTest {
),
personalization = PersonalizationConfig(enabled = true, learn = true),
project = ProjectConfig(enabled = true, root = "/repo", memoryK = 8, maxDepth = 6, injectTopK = 40),
git = GitConfig(enabled = true, remote = "gitea", baseBranch = "develop", author = "Correx <bot@example.test>"),
modelsSettings = ModelsSettings(defaultModel = "m1", host = "0.0.0.0", port = 10001),
orchestration = OrchestrationKnobs(stageTimeoutMs = 90_000, journalCompactionTokenThreshold = 12_000),
providers = listOf(