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.
This commit is contained in:
+7
-43
@@ -10,6 +10,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/rockliang/poimen/workflows/internal/memory"
|
"github.com/rockliang/poimen/workflows/internal/memory"
|
||||||
|
"github.com/rockliang/poimen/workflows/pkg/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SynthesisActivities holds dependencies for synthesis pipeline activities.
|
// SynthesisActivities holds dependencies for synthesis pipeline activities.
|
||||||
@@ -22,49 +23,12 @@ func NewSynthesisActivities(memClient *memory.Client) *SynthesisActivities {
|
|||||||
return &SynthesisActivities{memClient: memClient}
|
return &SynthesisActivities{memClient: memClient}
|
||||||
}
|
}
|
||||||
|
|
||||||
// SynthesisInput mirrors workflow.SynthesisInput for activity deserialization.
|
// Re-export shared types from pkg/types
|
||||||
type SynthesisInput struct {
|
type SynthesisInput = types.SynthesisInput
|
||||||
Project string `json:"project"`
|
type ExtractedEntity = types.ExtractedEntity
|
||||||
Source string `json:"source"`
|
type ExtractedFact = types.ExtractedFact
|
||||||
Text string `json:"text"`
|
type ContradictionResult = types.ContradictionResult
|
||||||
Kind string `json:"kind"`
|
type PersistInput = types.PersistInput
|
||||||
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"`
|
|
||||||
}
|
|
||||||
|
|
||||||
// ChunkAndEmbedActivity chunks text and generates a chunk ID.
|
// ChunkAndEmbedActivity chunks text and generates a chunk ID.
|
||||||
// Stage 1: Creates a deterministic chunk ID from content hash,
|
// Stage 1: Creates a deterministic chunk ID from content hash,
|
||||||
|
|||||||
Reference in New Issue
Block a user