feat: add params_schema column for function composability
Nueva columna params_schema en functions con migración 009. Almacena JSON con descripción semántica de inputs/outputs para que agentes razonen sobre composabilidad de funciones. Incluye: campo en modelo Go, parsing de params/output del frontmatter YAML, serialización a JSON, FTS5 rebuild con nueva columna, hash de contenido actualizado, y warning en indexer cuando faltan params.
This commit is contained in:
@@ -238,6 +238,8 @@ func Index(db *DB, root string) (*IndexResult, error) {
|
||||
}
|
||||
|
||||
// Post-insert: warn about file_path entries that don't exist on disk
|
||||
// and functions missing params_schema
|
||||
missingParams := 0
|
||||
for _, f := range functions {
|
||||
if f.FilePath != "" {
|
||||
abs := filepath.Join(root, f.FilePath)
|
||||
@@ -251,6 +253,12 @@ func Index(db *DB, root string) (*IndexResult, error) {
|
||||
result.Warnings = append(result.Warnings, fmt.Sprintf("%s: test_file_path %q not found", f.ID, f.TestFilePath))
|
||||
}
|
||||
}
|
||||
if f.ParamsSchema == "" {
|
||||
missingParams++
|
||||
}
|
||||
}
|
||||
if missingParams > 0 {
|
||||
result.Warnings = append(result.Warnings, fmt.Sprintf("%d functions missing params_schema (run 'fn check params' to list)", missingParams))
|
||||
}
|
||||
for _, t := range types {
|
||||
if t.FilePath != "" {
|
||||
|
||||
Reference in New Issue
Block a user