feat(tdd): inject session history into green and refactor worker prompts

Adds SessionsDir to tdd.Config, session_id to tool input schemas, and a
prependHistory method that reads the session JSONL log and prepends a
formatted history block to the task prompt before worker invocation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Mathias Bergqvist
2026-04-19 10:18:23 +02:00
parent 858a9ba1a1
commit 582ca5019b
4 changed files with 64 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ type Config struct {
SkillPrompt string
ExecutorFn ExecutorFn // nil = no executor (tests that don't reach execute())
DefaultModel string
SessionsDir string // optional: path to brain/sessions/ for history injection
}
type Skill struct {
@@ -63,6 +64,7 @@ func (s *Skill) Tools() []registry.ToolDef {
"test_path": strProp,
"model": strProp,
"test_cmd": strProp,
"session_id": strProp,
},
),
},
@@ -77,6 +79,7 @@ func (s *Skill) Tools() []registry.ToolDef {
"impl_path": strProp,
"model": strProp,
"test_cmd": strProp,
"session_id": strProp,
},
),
},