feat: modelo Log y CRUD en fn_operations
Tipo Log con niveles debug/info/warn/error, source, entity_id y execution_id opcionales. Migración 003_logs.sql y funciones InsertLog, GetLog, ListLogs con filtros combinables. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -145,6 +145,28 @@ type AssertionResult struct {
|
||||
EvaluatedAt time.Time `json:"evaluated_at"`
|
||||
}
|
||||
|
||||
// LogLevel represents the severity of a log entry.
|
||||
type LogLevel string
|
||||
|
||||
const (
|
||||
LogDebug LogLevel = "debug"
|
||||
LogInfo LogLevel = "info"
|
||||
LogWarn LogLevel = "warn"
|
||||
LogError LogLevel = "error"
|
||||
)
|
||||
|
||||
// Log is a free-form operational event within a project context.
|
||||
type Log struct {
|
||||
ID string `json:"id"`
|
||||
Level LogLevel `json:"level"`
|
||||
Source string `json:"source"` // who: agent, pipeline, reactive_loop, function name...
|
||||
EntityID string `json:"entity_id"` // optional context
|
||||
ExecutionID string `json:"execution_id"` // optional context
|
||||
Message string `json:"message"`
|
||||
Metadata map[string]any `json:"metadata"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
}
|
||||
|
||||
// TypeSnapshot is an immutable copy of a registry type at point of use.
|
||||
type TypeSnapshot struct {
|
||||
ID string `json:"id"`
|
||||
|
||||
Reference in New Issue
Block a user