pkg/cmd/tef/TODO.md
This document tracks pending implementation work for the Task Execution Framework.
The following components need implementation to make TEF fully functional:
TEF requires a PlannerManager implementation that integrates with an orchestration engine.
Priority: HIGH - Required for any workflow execution
Create pkg/cmd/tef/planners/temporal/ with:
manager.go: Implements PlannerManager using Temporal client
type TemporalManager struct {
basePlanner *BasePlanner
client temporal.Client
}
func (m *TemporalManager) StartWorker(ctx context.Context, planID string) error {
// Create temporal worker
// Register workflow and activities
// Start listening for executions
}
func (m *TemporalManager) ExecutePlan(ctx context.Context, input interface{}, planID string) (string, error) {
// Start temporal workflow execution
}
workflow.go: Translates task graph into Temporal workflow
status.go: Queries Temporal for execution status
Implement remaining PlannerManager methods:
GetExecutionStatus()ListExecutions()ListAllPlanIDs()ResumeTask()Alternative Options: Airflow, Cadence, custom scheduler, or any orchestration engine
Complete the CLI command generation in pkg/cmd/tef/cli/commands.go.
Priority: HIGH - Required for user interaction
Implement initializeWorkerCLI() function:
func initializeWorkerCLI(ctx context.Context, rootCmd *cobra.Command, registries []planners.Registry) {
// For each plan registry:
// - Create start-worker <planname> command
// - Create execute <planname> command
// - Create gen-view <planname> command
// - Add commands to rootCmd
}
For each registered plan, auto-generate:
start-worker <planname>: Start a worker for the planexecute <planname>: Execute the plan with JSON inputgen-view <planname>: Generate workflow visualizationresume <planname>: Resume callback tasks (if applicable)Create plan packages under pkg/cmd/tef/plans/.
Priority: MEDIUM - Required for testing and validation
Create plan packages (e.g., demo/, pua/, etc.)
Implement the Registry interface for each plan:
GetPlanName(): Return unique plan identifierGetPlanDescription(): Return plan descriptionGetWorkflowVersion(): Return workflow versionGeneratePlan(): Build task execution graphParsePlanInput(): Parse and validate JSON inputPrepareExecution(): Set up plan resourcesAddStartWorkerCmdFlags(): Add plan-specific CLI flagsRegister plans in pkg/cmd/tef/plans/registry.go:
func RegisterPlans(pr *planners.PlanRegistry) {
demo.RegisterDemoPlans(pr)
pua.RegisterPUAPlans(pr)
myplan.RegisterMyPlanPlans(pr)
// ... more plans
}
Create REST API server and handlers.
Priority: LOW - Optional, CLI is primary interface
Create pkg/cmd/tef/api/:
server.go: HTTP server implementationhandlers/v1/: API handlers for plans, executions, statusPOST /v1/plans/{plan_id}/executions - Execute a plan
GET /v1/plans/{plan_id}/executions - List executions
GET /v1/plans/{plan_id}/executions/{id} - Get execution status
POST /v1/plans/{plan_id}/executions/{id}/steps/{step_id}/resume - Resume callback task
GET /v1/plans - List all plans
GET / - UI (optional)
Implement comprehensive request tracing for debugging and observability:
X-Request-ID Header Support:
X-Request-ID headers and propagate through entire request lifecycleX-Request-ID in all response headers (both success and error responses)Distributed Tracing:
traceparent, tracestate headers)Logging and Correlation:
Error Responses:
X-Request-ID in error responsesThis enables end-to-end request tracking across distributed components and simplifies debugging of production issues.
Implement worker process that runs orchestration engine and executes workflows.
Priority: HIGH - Required for execution (part of orchestration engine integration)
Add comprehensive testing for all components.
Priority: MEDIUM - Required for reliability
Complete and refine documentation.
Priority: MEDIUM - In progress
Set up build and deployment infrastructure.
Priority: LOW - Can be done after implementation
Once components are implemented:
# Build TEF
./dev build tef
# Start orchestration engine (e.g., Temporal)
temporal server start-dev
# Start a worker
./bin/tef start-worker demo --plan-variant dev
# Execute a plan
./bin/tef execute demo '{"message": "Hello", "count": 5}' dev
# Check status
./bin/tef status demo <workflow-id>
When implementing any of these components:
/CLAUDE.md)cockroachdb/errorsFor questions about implementation:
pkg/cmd/tef/planners/