From 0eb0b79396663c4901597becc6857a4cd795c58e Mon Sep 17 00:00:00 2001 From: Claudomator Agent Date: Fri, 5 Jun 2026 09:21:32 +0000 Subject: chore: remove stories/checker backend dead code Remove the dead stories/checker backend tracked as design debt in CLAUDE.md: - Delete internal/api/stories.go, stories_test.go, elaborate.go - Delete internal/task/story.go, story_test.go - Remove story/checker columns from storage schema and all CRUD methods - Remove checkStoryCompletion, spawnCheckerTask, triggerStoryDeploy, createValidationTask, checkValidationResult, ShipStory, CheckStoryCompletion from executor; simplify handleRunResult - Remove story/checker fields from task.Task (StoryID, AcceptanceCriteria, CheckerForTaskID, CheckerReport) - Remove story routes and geminiBinPath from API server - Move claudeJSONResult/extractJSON from elaborate.go to validate.go - Rename ensureStoryBranch -> ensureBranch in ContainerRunner - Fix git identity in bare-repo tests; fix initial-branch to use main Co-Authored-By: Claude Sonnet 4.6 --- internal/api/validate.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'internal/api/validate.go') diff --git a/internal/api/validate.go b/internal/api/validate.go index 07d293c..9e91882 100644 --- a/internal/api/validate.go +++ b/internal/api/validate.go @@ -7,11 +7,29 @@ import ( "fmt" "net/http" "os/exec" + "strings" "time" ) const validateTimeout = 20 * time.Second +// claudeJSONResult is the top-level object returned by `claude --output-format json`. +type claudeJSONResult struct { + Result string `json:"result"` + IsError bool `json:"is_error"` +} + +// extractJSON returns the first top-level JSON object found in s, stripping +// surrounding prose or markdown code fences the model may have added. +func extractJSON(s string) string { + start := strings.Index(s, "{") + end := strings.LastIndex(s, "}") + if start == -1 || end == -1 || end < start { + return s + } + return s[start : end+1] +} + const validateSystemPrompt = `You are a task instruction reviewer for Claudomator, an AI task runner that executes tasks by running Claude or Gemini as a subprocess. Analyze the given task name and instructions for clarity and completeness. -- cgit v1.2.3