Files
correx/docs/sample-config.toml
kami 1b58bc325e wip(freestyle/acr): grounding & edit-tool fixes + ACR-compiler experiment
This branch's uncommitted WIP, committed together (entangled at file level).
Distinct pieces of work:

Freestyle QA fixes (this session):
- FileEditTool: pre-validate replace anchor in validateRequest — reject a
  missing/ambiguous target BEFORE the approval gate, mirroring read/write's
  file-not-found / read-before-write pre-checks. Shared not-found/ambiguous
  messages between validate and execute so they can't drift.
- PlanGrounder: add `scanned` flag; when no RepoMapComputedEvent was recorded,
  repoMapPaths is "unknown" not "empty workspace" — skip scope grounding
  (which proves a path ABSENT) so real paths (apps/server/**) aren't falsely
  rejected. Build-manifest check still runs.
- FreestyleDriver: wire scanned=(repoMap!=null); on plan rejection emit a
  session-terminal WorkflowFailedEvent so a rejected run reads FAILED, not the
  COMPLETED-lie (last verdict was the planning-phase WorkflowCompleted).
- ServerModule: resolve project-memory workspace root from the session's bound
  workspace (sessionWorkspaceRoot) instead of boot-static pm.repoRoot(), fixing
  the workspace-binding divergence (correx vs empty scratch dir). Retire tracked
  in Vikunja #266.
- LaunchRegistrationRaceTest: join registered jobs before asserting launchCount
  — computeIfAbsent returns the Job immediately but the fire-and-forget launch
  body lagged awaitAll (the 49-vs-50 flake).

ACR concept-compiler experiment (pre-existing WIP on this branch):
- ExecutionPlanCompiler/Model/PlanLinter, #264 needs-seam (sessionArtifacts),
  LSP diagnostics subsystem (LspDiagnosticEvents/Runner/Lsp4j), BootWorkspace,
  config surface, workflow prompts/schemas, orchestrator advance-don't-rerun.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-19 01:20:37 +04:00

155 lines
6.2 KiB
TOML

# CORREX Configuration Sample
# Place at ~/.config/correx/config.toml
[server]
host = "localhost"
port = 8080
[tui]
theme = "dark"
session_list_limit = 5
[cli]
default_output = "human"
[tools]
sandbox_root = "~/.config/correx/sandbox"
working_dir = "/tmp"
default_system_prompt_path = "~/.config/correx/prompts/default_system.md"
[tools.shell]
enabled = true
allowed_executables = ["bash", "sh", "python3", "node"]
[tools.file_read]
enabled = true
[tools.file_write]
enabled = true
[tools.file_edit]
enabled = true
# ─────────────────────────────────────────────────────────────
# Managed model configuration (Slice 1: correx spawns + owns llama-server)
#
# When [[models]] is present, correx launches llama-server at boot and kills it on
# shutdown. Use this instead of (or alongside) [[providers]].
#
# [models] — global settings for the managed llama-server process
# [[models]] — one entry per model file; correx will load the defaultModel at startup.
# ─────────────────────────────────────────────────────────────
[models]
default_model = "mistral-7b" # which [[models]] entry to load at boot
llama_server_bin = "llama-server" # path to the llama-server binary (default: llama-server)
host = "127.0.0.1" # host for llama-server to bind / correx to connect
port = 10000 # port for llama-server
[[models]]
id = "mistral-7b"
model_path = "~/models/mistral-7b-gguf/model.gguf"
context_size = 8192
capabilities = { General = 1.0, Coding = 0.7, Reasoning = 0.6, Summarization = 0.8, ToolCalling = 0.5 }
# Example: additional model (swap via TUI in a later slice)
# [[models]]
# id = "codellama-7b"
# model_path = "~/models/codellama-7b-gguf/model.gguf"
# context_size = 4096
# capabilities = { General = 0.8, Coding = 1.0, Reasoning = 0.7, Summarization = 0.6, ToolCalling = 0.7 }
# ─────────────────────────────────────────────────────────────
# Legacy static provider configuration (array of tables)
# Use [[providers]] when correx should connect to an already-running llama-server
# (i.e. you launch the server yourself externally).
# If [[models]] is configured, [[providers]] entries are registered as additional
# static providers alongside the managed one.
# ─────────────────────────────────────────────────────────────
# [[providers]]
# id = "local-llama"
# type = "llamacpp"
# model_id = "mistral-7b"
# model_path = "~/models/mistral-7b-gguf/model.gguf"
# url = "http://127.0.0.1:10000"
# capabilities = { General = 1.0, Coding = 0.7, Reasoning = 0.6, Summarization = 0.8, ToolCalling = 0.5 }
# Project-scoped, cross-session memory (distilled decision journal + repo map).
# When enabled, decisions are distilled to durable per-repo memory at session end and
# retrieved at the next session's start via the L3 path.
[project]
enabled = false
root = "" # repo root key; empty = current working dir
memory_k = 5 # distilled decisions retrieved per session start
# Repo-map indexer (emits a ranked file/symbol index as a recorded observation at session
# start; a top-K slice rides in context as droppable L3 memory — paths + symbol names only).
max_depth = 4 # directory recursion cap
inject_top_k = 30 # entries injected into context (ranked by score)
# ignore_globs = [".git", "node_modules", "build", "target", ".gradle", "dist", ".idea"]
# Talkie: the conversational front-end (CHAT triage + STEERING into a running workflow).
# (Legacy section name [router] is still read as a fallback.)
[talkie]
conversation_keep_last = 6 # how many recent chat turns to keep in context
retrieval_k = 5 # L3 memory hits to retrieve per query
token_budget = 4096 # context budget for Talkie prompts
# Sampling/length for Talkie chat + steering replies.
[talkie.generation]
temperature = 0.7
top_p = 0.9
max_tokens = 512
# Narration (the live workflow commentary). max_tokens is higher than chat so
# reasoning models can finish "thinking" and still emit the line; max_per_run caps how
# many narrations fire per workflow run.
[talkie.narration]
temperature = 0.7
top_p = 0.9
max_tokens = 1024
max_per_run = 100
# Embedder + L3 vector memory. Shared infra: the orchestrator uses these for workflow
# repo-knowledge retrieval, not just the Talkie chat layer — hence top-level, not [router.*].
# (Legacy [router.embedder] / [router.l3] are still read as a fallback.)
[embedder]
backend = "noop" # or "llamacpp"
dimension = 1536
# url = "http://127.0.0.1:11000"
# model_id = "nomic-embed-text"
[l3]
backend = "in_memory" # or "turbovec"
# persist_path = "~/.config/correx/l3/index.tq"
# python_executable = "python3"
# script_path = "~/.config/correx/python/turbovec_sidecar.py"
# dim = 1536
# bit_width = 4
# Custom artifact kinds. Each entry points to a JSON file holding the kind's JSON
# schema (object type, typed properties, required, additionalProperties). Workflows
# may then declare `produces` slots of this kind; LLM-emitted kinds are validated
# against the declared schema. schema_path is absolute, ~-relative, or relative to
# this config file's directory.
# [[artifacts]]
# id = "review_report"
# schema_path = "schemas/review_report.json"
# llm_emitted = true
#
# Review loops escalate to the synthesized recovery stage after this many review→rework cycles.
# [orchestration]
# review_loop_max_cycles = 3
#
# The bundled examples/workflows/review_loop.toml uses this kind: the reviewer emits a
# review_report whose `verdict` field gates the implementer↔reviewer loop via
# artifact_field_equals transitions. See docs/schemas/review_report.json for the schema.
[[artifacts]]
id = "execution_plan"
schema_path = "schemas/execution_plan.json"
llm_emitted = true
[[artifacts]]
id = "dod"
schema_path = "schemas/dod.json"
llm_emitted = true