auto(0129): agents_dashboard — secret_store_cpp_infra + CMakeLists register #4

Open
dataforge wants to merge 615 commits from auto/0129 into master
6 changed files with 100 additions and 2 deletions
Showing only changes of commit c72ae15429 - Show all commits
+49
View File
@@ -0,0 +1,49 @@
## Extraccion de funciones desde repos externos (`sources/`)
### Workflow
1. Clonar repo en `sources/<nombre>` (gitignored, solo el manifest `sources/sources.yaml` se versiona)
2. El agente analiza el repo y propone funciones candidatas
3. Las funciones se **copian y adaptan** al formato del registry (.go/.py/.sh/.ts + .md con frontmatter)
4. `fn index` las registra. El manifest se actualiza con las funciones extraidas.
### Filtro de calidad (obligatorio antes de extraer)
Una funcion externa solo se extrae si cumple TODOS estos criterios:
- **Firma generica**: no depende de tipos internos del repo origen ni de config hardcodeada
- **Sin estado global**: no usa variables globales, singletons, ni init() con side effects
- **Dependencias minimas**: solo stdlib o dependencias ya presentes en fn_registry
- **Pura si es posible**: si la funcion puede ser pura, debe extraerse como pura
- **Sin credenciales**: no contiene secrets, API keys, ni paths absolutos
- **Testeable**: la logica debe poder validarse con tests unitarios
- **No duplicada**: consultar registry.db con FTS5 antes de extraer para evitar duplicados
- **Licencia compatible**: el repo debe tener licencia permisiva (MIT, Apache 2.0, BSD, etc.)
### Adaptacion al extraer
- Renombrar a snake_case siguiendo la convencion del registry
- Adaptar firma para usar tipos nativos (no tipos internos del repo)
- Crear .md con frontmatter completo incluyendo `source_repo`, `source_license`, `source_file`
- Actualizar `sources/sources.yaml` con la extraccion
### Campos de atribucion en frontmatter
```yaml
source_repo: "https://github.com/user/project"
source_license: "MIT"
source_file: "pkg/original_file.go"
```
Estos campos se indexan en registry.db y permiten consultar:
```sql
SELECT id, source_repo, source_license FROM functions WHERE source_repo != '';
```
### Lenguajes soportados para extraccion
Cualquier lenguaje puede analizarse como fuente. El destino depende de la naturaleza de la funcion:
- Algoritmos/logica pura → Go (functions/{domain}/) o Python (python/functions/{domain}/)
- Scripts/utilidades sistema → Bash (bash/functions/{domain}/)
- UI/frontend → TypeScript (frontend/functions/{domain}/)
- C/Rust/otros → Traducir a Go o Python, manteniendo la semantica original
+3
View File
@@ -37,6 +37,9 @@ python/.venv/
# Node / pnpm
**/node_modules/
# Sources — repos externos clonados (solo se versiona el manifest)
sources/*/
# OS
.DS_Store
Thumbs.db
+4
View File
@@ -18,6 +18,10 @@ tested: false
tests: []
test_file_path: ""
file_path: "functions/core/filter_slice.go"
# Source attribution (solo para funciones extraidas de repos externos)
# source_repo: "https://github.com/user/project"
# source_license: "MIT"
# source_file: "pkg/utils.go"
---
## Ejemplo
@@ -0,0 +1,8 @@
-- Source attribution for functions extracted from external repositories.
ALTER TABLE functions ADD COLUMN source_repo TEXT NOT NULL DEFAULT '';
ALTER TABLE functions ADD COLUMN source_license TEXT NOT NULL DEFAULT '';
ALTER TABLE functions ADD COLUMN source_file TEXT NOT NULL DEFAULT '';
ALTER TABLE types ADD COLUMN source_repo TEXT NOT NULL DEFAULT '';
ALTER TABLE types ADD COLUMN source_license TEXT NOT NULL DEFAULT '';
ALTER TABLE types ADD COLUMN source_file TEXT NOT NULL DEFAULT '';
+16 -2
View File
@@ -32,6 +32,11 @@ type rawFunction struct {
TestFilePath string `yaml:"test_file_path"`
FilePath string `yaml:"file_path"`
// Source attribution
SourceRepo string `yaml:"source_repo"`
SourceLicense string `yaml:"source_license"`
SourceFile string `yaml:"source_file"`
// Component fields
Props []PropDef `yaml:"props"`
Emits []string `yaml:"emits"`
@@ -50,8 +55,11 @@ type rawType struct {
Definition string `yaml:"definition"`
Description string `yaml:"description"`
Tags []string `yaml:"tags"`
UsesTypes []string `yaml:"uses_types"`
FilePath string `yaml:"file_path"`
UsesTypes []string `yaml:"uses_types"`
FilePath string `yaml:"file_path"`
SourceRepo string `yaml:"source_repo"`
SourceLicense string `yaml:"source_license"`
SourceFile string `yaml:"source_file"`
}
// rawApp mirrors the YAML frontmatter of an app .md file.
@@ -146,6 +154,9 @@ func ParseFunctionMD(path string, root string) (*Function, error) {
HasState: raw.HasState,
Framework: raw.Framework,
Variant: raw.Variant,
SourceRepo: raw.SourceRepo,
SourceLicense: raw.SourceLicense,
SourceFile: raw.SourceFile,
}
if root != "" && raw.FilePath != "" {
@@ -196,6 +207,9 @@ func ParseTypeMD(path string, root string) (*Type, error) {
Description: raw.Description,
Tags: raw.Tags,
UsesTypes: raw.UsesTypes,
SourceRepo: raw.SourceRepo,
SourceLicense: raw.SourceLicense,
SourceFile: raw.SourceFile,
Examples: sections.example,
Notes: sections.notes,
Documentation: sections.documentation,
+20
View File
@@ -0,0 +1,20 @@
# Manifest de repositorios externos para extraccion de funciones.
# Cada entrada registra un repo clonado en sources/ y las funciones extraidas.
#
# Formato:
# - repo: https://github.com/user/project
# license: MIT
# cloned_dir: project # nombre del directorio en sources/
# extracted: # funciones ya extraidas (el agente las registra)
# - id: func_name_go_core
# source_file: pkg/utils.go # path relativo dentro del repo original
# date: 2026-03-29
#
# Workflow:
# 1. Clonar repo en sources/: git clone <url> sources/<nombre>
# 2. Invocar agente extractor para analizar y proponer funciones
# 3. El agente copia, adapta, crea .go + .md con atribucion
# 4. fn index para registrar en registry.db
# 5. Actualizar este manifest con las funciones extraidas
repos: []