[Phase 2.1] Synthesis workflow definition #12

Merged
rock merged 3 commits from feat/phase-2.1-synthesis-workflow into main 2026-09-09 00:37:21 +00:00
3 Commits
Author SHA1 Message Date
poimen 7be93d1d16 fix: remove duplicate PersistInput type definition
CI / CI (pull_request) Successful in 4m33s
Type already re-exported from pkg/types at top of file
2026-09-08 17:06:44 -07:00
poimen 5ccc3711e6 refactor: extract synthesis types to pkg/types
CI / CI (pull_request) Failing after 2m17s
DRY fix: Shared types (SynthesisInput, ExtractedEntity, ExtractedFact,
ContradictionResult, PersistInput) moved to pkg/types/synthesis.go.

Both workflow and activity packages now import from pkg/types.
Re-exported as type aliases for backward compatibility.

Fixes: Duplicate type definitions between workflow and activity packages.
2026-09-08 17:05:17 -07:00
poimen 9020ccf839 feat(phase-2.1): synthesis workflow definition
CI / CI (pull_request) Successful in 4m1s
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
2026-09-08 16:35:36 -07:00