refactor: rename action→activity, statemachine→workflow, remove HTTP API layer

- action/ → activity/ (Temporal activities)
- statemachine/ → workflow/ (Temporal workflows)
- Removed internal/api/ and cmd/server/ (api-gw handles HTTP, Temporal is the API)
- Created pkg/types/types.go as single source of truth for all shared types
- Extracted CallRoleLLM helper (DRY: implementer/planner/judge shared pattern)
- Fixed circular import: workflow_graph_query uses string activity names
- Fixed logger.logf → logger.Info/Warn (method didn't exist)
- Fixed routing types: added Branches, Activity, BackoffSeconds, TaskActivity
- Fixed db.Canvas.Name, db.Client→DB, GetWorkflow→FetchWorkflow
- Removed unused imports
- All tests pass, build clean, vet clean
This commit is contained in:
Test
2026-09-05 23:59:13 -07:00
parent b7aa1fb293
commit 9ec7e6a344
54 changed files with 847 additions and 1901 deletions
+43
View File
@@ -0,0 +1,43 @@
package activity
import (
"context"
"os/exec"
)
// RunIntegrationTestInput is input to RunIntegrationTestActivity.
type RunIntegrationTestInput struct {
WorktreePath string
TestCmd string
}
// RunIntegrationTestOutput is the output of RunIntegrationTestActivity.
type RunIntegrationTestOutput struct {
Passed bool
Logs string
}
// RunIntegrationTestActivity runs integration tests in the worktree.
func RunIntegrationTestActivity(ctx context.Context, in RunIntegrationTestInput) (RunIntegrationTestOutput, error) {
if in.TestCmd == "" {
// No test command, assume pass
return RunIntegrationTestOutput{Passed: true, Logs: "No test command provided"}, nil
}
// Run test command
cmd := exec.CommandContext(ctx, "sh", "-c", in.TestCmd)
cmd.Dir = in.WorktreePath
output, err := cmd.CombinedOutput()
if err != nil {
return RunIntegrationTestOutput{
Passed: false,
Logs: string(output) + "\nError: " + err.Error(),
}, nil
}
return RunIntegrationTestOutput{
Passed: true,
Logs: string(output),
}, nil
}