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 c228b54fd7
commit 9c9e9450bc
54 changed files with 847 additions and 1901 deletions
+9 -9
View File
@@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/assert"
"go.temporal.io/sdk/client"
"github.com/rockliang/poimen/workflows/internal/config"
"github.com/rockliang/poimen/workflows/statemachine"
"github.com/rockliang/poimen/workflows/workflow"
)
// TestTemporalConnection verifies the worker is connected and healthy
@@ -67,7 +67,7 @@ func TestActivityExecution(t *testing.T) {
runResp, err := c.ExecuteWorkflow(ctx, client.StartWorkflowOptions{
ID: workflowID,
TaskQueue: "poimen-taskqueue",
}, statemachine.TestWorkflow)
}, workflow.TestWorkflow)
assert.NoError(t, err, "failed to execute test workflow")
assert.NotNil(t, runResp, "workflow response should not be nil")
@@ -136,28 +136,28 @@ func TestOrchestratorWorkflowIntegration(t *testing.T) {
defer cancel()
// Create minimal orchestrator input
input := statemachine.OrchestratorInput{
input := workflow.OrchestratorInput{
RemoteURL: "https://forgejo.riotpiao.com/rock/poimen",
TargetRepoPath: "/tmp/test-poimen-integration",
Milestone: "T0",
Config: statemachine.OrchestratorConfig{
Config: workflow.OrchestratorConfig{
SystemPrompt: "You are a code generation assistant. Generate simple test code.",
RolePrompts: map[string]statemachine.PromptSpec{
RolePrompts: map[string]workflow.PromptSpec{
"planner": {
TemplateRef: "planner/default.tmpl",
Model: statemachine.ModelSpec{
Model: workflow.ModelSpec{
ModelID: "ornith",
},
},
"judge": {
TemplateRef: "judge/default.tmpl",
Model: statemachine.ModelSpec{
Model: workflow.ModelSpec{
ModelID: "ornith",
},
},
"implementer": {
TemplateRef: "implementer/default.tmpl",
Model: statemachine.ModelSpec{
Model: workflow.ModelSpec{
ModelID: "claude-sonnet-5",
},
},
@@ -170,7 +170,7 @@ func TestOrchestratorWorkflowIntegration(t *testing.T) {
runResp, err := c.ExecuteWorkflow(ctx, client.StartWorkflowOptions{
ID: workflowID,
TaskQueue: "poimen-taskqueue",
}, statemachine.OrchestratorWorkflow, input)
}, workflow.OrchestratorWorkflow, input)
assert.NoError(t, err, "failed to execute orchestrator workflow")
t.Logf("✅ Orchestrator workflow started: %s", workflowID)