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:
2026-03-29 17:31:03 +02:00
parent add09c2faa
commit 169cb0853b
3 changed files with 125 additions and 0 deletions
+22
View File
@@ -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"`