refactor: import synthesis types from pkg/types
CI / CI (pull_request) Failing after 1m59s

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:
poimen
2026-09-08 17:05:36 -07:00
parent f7b8060cde
commit 01c20bfc01
+7 -43
View File
@@ -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,