Documentation
¶
Overview ¶
Package app implémente le wiring de l'application SOUL Connecte tous les composants selon l'architecture hexagonale.
config_loader.go — YAML configuration loading for SOUL. Reads a soul config file (config.yaml or the path provided) and maps the relevant fields to SoulConfig. Missing files are silently ignored; only parsing errors are returned.
Index ¶
- type SoulApplication
- func (app *SoulApplication) Capture(ctx context.Context, request *valueobjects.SoulCaptureRequest) (*entities.IdentitySnapshot, error)
- func (app *SoulApplication) CheckDrift(ctx context.Context, agentID string, ...) (*valueobjects.IdentityDriftReport, error)
- func (app *SoulApplication) Close() error
- func (app *SoulApplication) GetDriftReport(ctx context.Context, agentID string, windowSize int) (*valueobjects.IdentityDriftReport, error)
- func (app *SoulApplication) GetEvolutionSummary(ctx context.Context, agentID string) (string, error)
- func (app *SoulApplication) GetIdentityHistory(ctx context.Context, agentID string, limit int) ([]*entities.IdentitySnapshot, error)
- func (app *SoulApplication) GetIdentitySummary(ctx context.Context, agentID string) (string, error)
- func (app *SoulApplication) HandleModelSwap(ctx context.Context, agentID, previousModel, newModel string) (*valueobjects.IdentityContextPrompt, error)
- func (app *SoulApplication) PatchIdentity(ctx context.Context, agentID string, patch *valueobjects.IdentityPatch) (*entities.IdentitySnapshot, *interactors.UpdateResult, error)
- func (app *SoulApplication) Recall(ctx context.Context, query *valueobjects.SoulQuery) (*valueobjects.IdentityContextPrompt, error)
- func (app *SoulApplication) UpdateFromDirective(ctx context.Context, agentID, directive, reason string) (*entities.IdentitySnapshot, *interactors.UpdateResult, error)
- type SoulConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SoulApplication ¶
type SoulApplication struct {
// Storage
Storage ports.SoulStorage
// Services
Extractor ports.IdentityExtractor
Composer ports.IdentityComposer
DriftDetector ports.IdentityDriftDetector
SwapHandler ports.ModelSwapHandler
Merger ports.SoulMerger
// Use Cases
CaptureUC *interactors.IdentityCaptureUseCase
RecallUC *interactors.IdentityRecallUseCase
DriftUC *interactors.DriftDetectionUseCase
SwapUC *interactors.ModelSwapUseCase
EvolutionUC *interactors.IdentityEvolutionUseCase
MergeUC *interactors.IdentityMergeUseCase
UpdateUC *interactors.IdentityUpdateUseCase
}
SoulApplication représente l'application SOUL complète C'est le point d'entrée central qui orchestre tous les use cases.
func NewSoulApplication ¶
func NewSoulApplication(config *SoulConfig) (*SoulApplication, error)
NewSoulApplication crée et configure l'application SOUL
func NewSoulApplicationWithDB ¶
func NewSoulApplicationWithDB(db *sql.DB) (*SoulApplication, error)
NewSoulApplicationWithDB crée l'application SOUL en réutilisant une connexion *sql.DB existante. Utilisé quand SOUL est embarqué dans MIRA — la connexion n'est PAS fermée par Close(). Utilise la configuration par défaut. Pour passer une configuration personnalisée, utilisez NewSoulApplicationWithDBAndConfig.
func NewSoulApplicationWithDBAndConfig ¶ added in v0.0.4
func NewSoulApplicationWithDBAndConfig(db *sql.DB, config *SoulConfig) (*SoulApplication, error)
NewSoulApplicationWithDBAndConfig crée l'application SOUL en réutilisant une connexion *sql.DB existante avec une configuration personnalisée. Utilisé quand SOUL est embarqué dans MIRA — la connexion n'est PAS fermée par Close(). Si config est nil, les valeurs par défaut sont utilisées.
func (*SoulApplication) Capture ¶
func (app *SoulApplication) Capture(ctx context.Context, request *valueobjects.SoulCaptureRequest) (*entities.IdentitySnapshot, error)
Capture capture l'identité depuis une conversation
func (*SoulApplication) CheckDrift ¶
func (app *SoulApplication) CheckDrift(ctx context.Context, agentID string, currentIdentity *entities.IdentitySnapshot) (*valueobjects.IdentityDriftReport, error)
CheckDrift vérifie la dérive identitaire
func (*SoulApplication) Close ¶
func (app *SoulApplication) Close() error
Close ferme l'application proprement
func (*SoulApplication) GetDriftReport ¶
func (app *SoulApplication) GetDriftReport(ctx context.Context, agentID string, windowSize int) (*valueobjects.IdentityDriftReport, error)
GetDriftReport retourne le rapport de dérive
func (*SoulApplication) GetEvolutionSummary ¶
func (app *SoulApplication) GetEvolutionSummary(ctx context.Context, agentID string) (string, error)
GetEvolutionSummary retourne un résumé de l'évolution
func (*SoulApplication) GetIdentityHistory ¶
func (app *SoulApplication) GetIdentityHistory(ctx context.Context, agentID string, limit int) ([]*entities.IdentitySnapshot, error)
GetIdentityHistory retourne l'historique des snapshots
func (*SoulApplication) GetIdentitySummary ¶
GetIdentitySummary retourne un résumé lisible de l'identité
func (*SoulApplication) HandleModelSwap ¶
func (app *SoulApplication) HandleModelSwap(ctx context.Context, agentID, previousModel, newModel string) (*valueobjects.IdentityContextPrompt, error)
HandleModelSwap gère un changement de modèle
func (*SoulApplication) PatchIdentity ¶
func (app *SoulApplication) PatchIdentity(ctx context.Context, agentID string, patch *valueobjects.IdentityPatch) (*entities.IdentitySnapshot, *interactors.UpdateResult, error)
PatchIdentity applique un patch structuré sur l'identité de l'agent.
func (*SoulApplication) Recall ¶
func (app *SoulApplication) Recall(ctx context.Context, query *valueobjects.SoulQuery) (*valueobjects.IdentityContextPrompt, error)
Recall récupère l'identité pour injection dans le contexte LLM
func (*SoulApplication) UpdateFromDirective ¶
func (app *SoulApplication) UpdateFromDirective(ctx context.Context, agentID, directive, reason string) (*entities.IdentitySnapshot, *interactors.UpdateResult, error)
UpdateFromDirective parse une directive en langage naturel et l'applique comme patch d'identité.
type SoulConfig ¶
type SoulConfig struct {
StoragePath string `json:"storage_path"` // Chemin vers la base SQLite (partagée avec MIRA)
DriftThreshold float64 `json:"drift_threshold"` // Seuil de détection de dérive (0-1)
MaxContextTokens int `json:"max_context_tokens"` // Budget de tokens pour le prompt d'identité
// Extraction configuration
MinTraitConfidence float64 `json:"min_trait_confidence"` // Default: 0.3
MinObservationsForTrait int `json:"min_observations_for_trait"` // Default: 5
// Drift detection configuration
DriftWindowSize int `json:"drift_window_size"` // Default: 10
AutoCheckAfterCapture bool `json:"auto_check_after_capture"` // Default: true
// Model swap configuration
AutoReinforce bool `json:"auto_reinforce"` // Default: true
// Evolution tracking
EvolutionEnabled bool `json:"evolution_enabled"` // Default: true
MaxHistoryVersions int `json:"max_history_versions"` // Default: 100
// MCP server configuration (for HTTP transport - future use)
MCPEnabled bool `json:"mcp_enabled"`
MCPHost string `json:"mcp_host"` // Default: "localhost"
MCPPort int `json:"mcp_port"` // Default: 8081
}
SoulConfig configure l'application SOUL
func DefaultConfig ¶
func DefaultConfig() *SoulConfig
DefaultConfig retourne la configuration par défaut
func LoadConfig ¶
func LoadConfig(filePath string) (*SoulConfig, error)
LoadConfig builds a SoulConfig by starting from DefaultConfig, then overlaying values from the YAML file (if it exists), and returning the result. CLI flags are applied by the caller after this returns.
func LoadConfigFile ¶
func LoadConfigFile(path string) (*SoulConfig, error)
LoadConfigFile loads a YAML config file and returns a *SoulConfig. Fields not present in the file keep their zero value; callers should merge with DefaultConfig() beforehand. If the file does not exist, a nil config and no error are returned so callers can fall back to defaults gracefully.
func (*SoulConfig) Validate ¶
func (c *SoulConfig) Validate() error
Validate checks that configuration values are within valid ranges.