[Phase 2.2] Synthesis activities (5 activities) #13
+7
-43
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user