4-stage pipeline as Temporal workflow: Stage 1: ChunkAndEmbed — chunk text + generate embeddings Stage 2: ExtractEntities — LLM entity extraction with reflection Stage 3: ExtractFacts — pattern + LLM fact extraction Stage 4: DetectContradictions — pre-filter + LLM verification Stage 5: PersistSynthesis — save all results to DB Types: SynthesisInput, SynthesisResult, ExtractedEntity, ExtractedFact, ContradictionResult, PersistInput Retry: 3 attempts, exponential backoff (1s → 2s → 4s) Each stage fails independently with wrapped errors. Tests: 5 pass (success, contradictions, entity fail, chunk fail, fields) Build: clean, 36 packages pass
- 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