From 01c20bfc015938f54865d48ac43e8fe4c67c1c08 Mon Sep 17 00:00:00 2001 From: poimen Date: Tue, 8 Sep 2026 17:05:36 -0700 Subject: [PATCH] refactor: import synthesis types from pkg/types DRY fix: Activity package now imports shared types from pkg/types/synthesis.go. Re-exported as type aliases for backward compatibility. Removes duplicate type definitions, coordinates with PR #12. --- activity/synthesis.go | 50 ++++++------------------------------------- 1 file changed, 7 insertions(+), 43 deletions(-) diff --git a/activity/synthesis.go b/activity/synthesis.go index 0a4988c..2ea9551 100644 --- a/activity/synthesis.go +++ b/activity/synthesis.go @@ -10,6 +10,7 @@ import ( "strings" "github.com/rockliang/poimen/workflows/internal/memory" + "github.com/rockliang/poimen/workflows/pkg/types" ) // SynthesisActivities holds dependencies for synthesis pipeline activities. @@ -22,49 +23,12 @@ func NewSynthesisActivities(memClient *memory.Client) *SynthesisActivities { return &SynthesisActivities{memClient: memClient} } -// SynthesisInput mirrors workflow.SynthesisInput for activity deserialization. -type SynthesisInput struct { - Project string `json:"project"` - Source string `json:"source"` - Text string `json:"text"` - Kind string `json:"kind"` - Tags []string `json:"tags,omitempty"` -} - -// ExtractedEntity represents an entity found during synthesis. -type ExtractedEntity struct { - Name string `json:"name"` - EntityType string `json:"entity_type"` - Confidence float64 `json:"confidence"` -} - -// ExtractedFact represents a fact extracted during synthesis. -type ExtractedFact struct { - Subject string `json:"subject"` - Predicate string `json:"predicate"` - Object string `json:"object"` - Confidence float64 `json:"confidence"` -} - -// ContradictionResult represents a contradiction detection result. -type ContradictionResult struct { - FactA ExtractedFact `json:"fact_a"` - FactB ExtractedFact `json:"fact_b"` - Severity string `json:"severity"` - AutoResolved bool `json:"auto_resolved"` - QueuedReview bool `json:"queued_review"` -} - -// PersistInput groups all synthesis results for persistence. -type PersistInput struct { - ChunkID string `json:"chunk_id"` - Project string `json:"project"` - Source string `json:"source"` - Kind string `json:"kind"` - Entities []ExtractedEntity `json:"entities"` - Facts []ExtractedFact `json:"facts"` - Contradictions []ContradictionResult `json:"contradictions"` -} +// Re-export shared types from pkg/types +type SynthesisInput = types.SynthesisInput +type ExtractedEntity = types.ExtractedEntity +type ExtractedFact = types.ExtractedFact +type ContradictionResult = types.ContradictionResult +type PersistInput = types.PersistInput // ChunkAndEmbedActivity chunks text and generates a chunk ID. // Stage 1: Creates a deterministic chunk ID from content hash,