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:
@@ -9,7 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/rockliang/poimen/workflows/internal/routing"
|
||||
"github.com/rockliang/poimen/workflows/statemachine"
|
||||
"github.com/rockliang/poimen/workflows/workflow"
|
||||
"github.com/stretchr/testify/require"
|
||||
"go.temporal.io/sdk/client"
|
||||
)
|
||||
@@ -69,12 +69,12 @@ func TestTemporalRoutingWorkflow(t *testing.T) {
|
||||
|
||||
// Submit to Temporal
|
||||
workflowID := "test-routing-" + time.Now().Format("20060102-150405")
|
||||
input := statemachine.RoutingWorkflowInput{Spec: output.Spec}
|
||||
input := workflow.RoutingWorkflowInput{Spec: output.Spec}
|
||||
|
||||
run, err := c.ExecuteWorkflow(ctx, client.StartWorkflowOptions{
|
||||
ID: workflowID,
|
||||
TaskQueue: "poimen-taskqueue",
|
||||
}, statemachine.RoutingWorkflow, input)
|
||||
}, workflow.RoutingWorkflow, input)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Logf("Workflow submitted: ID=%s, RunID=%s", run.GetID(), run.GetRunID())
|
||||
@@ -118,18 +118,18 @@ func TestTemporalRoutingWorkflow(t *testing.T) {
|
||||
}
|
||||
|
||||
workflowID := "test-pass-only-" + time.Now().Format("20060102-150405")
|
||||
input := statemachine.RoutingWorkflowInput{Spec: spec}
|
||||
input := workflow.RoutingWorkflowInput{Spec: spec}
|
||||
|
||||
run, err := c.ExecuteWorkflow(ctx, client.StartWorkflowOptions{
|
||||
ID: workflowID,
|
||||
TaskQueue: "poimen-taskqueue",
|
||||
}, statemachine.RoutingWorkflow, input)
|
||||
}, workflow.RoutingWorkflow, input)
|
||||
require.NoError(t, err)
|
||||
|
||||
t.Logf("Pass-only workflow submitted: ID=%s", run.GetID())
|
||||
|
||||
// Wait for result (Pass states don't need workers)
|
||||
var result statemachine.RoutingWorkflowOutput
|
||||
var result workflow.RoutingWorkflowOutput
|
||||
err = run.Get(ctx, &result)
|
||||
require.NoError(t, err)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user