feat(context): reasoning-thread continuity, L3 doc filtering, and gate hardening

Threads reasoning_content across inference calls and journal renders, filters
markdown noise out of L3 repo-knowledge retrieval, adds PlanLinter H3 checks,
and tightens filesystem tool output/dir-listing behavior surfaced by prior
live QA (see project_readloop_campaign memory).
This commit is contained in:
2026-07-10 11:13:43 +04:00
parent f51a8dada4
commit 3d5e05c1fb
32 changed files with 742 additions and 85 deletions
@@ -10,6 +10,14 @@ import kotlinx.serialization.Serializable
data class ChatMessage(
val role: String,
val content: String,
// Carries ContextEntry.reasoning forward for assistant tool-call turns — see that field's
// doc for why this exists (Gemma-family looping when its own prior reasoning is missing).
val reasoning: String? = null,
// Optional tool-call-id that links a role:tool response to the assistant's tool_calls entry
// (sourceId in the event store). Required by the Gemma4 Jinja template to render tool
// response blocks with the correct function name; without it every tool response is
// rendered as "unknown" and the thought/reasoning channel logic can break.
val toolCallId: String? = null,
)
object PromptRenderer {
@@ -61,5 +69,7 @@ object PromptRenderer {
EntryRole.USER -> "user"
},
content = content,
reasoning = reasoning,
toolCallId = if (role == EntryRole.TOOL) sourceId else null,
)
}