app

package
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 23, 2026 License: MIT Imports: 15 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SoulApplication

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().

func (*SoulApplication) Capture

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

func (app *SoulApplication) GetIdentitySummary(ctx context.Context, agentID string) (string, error)

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

PatchIdentity applique un patch structuré sur l'identité de l'agent.

func (*SoulApplication) Recall

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL