chore: auto-commit (95 archivos)
- cmd/fn/doctor.go - cmd/fn/main.go - cpp/apps/primitives_gallery/playground/tables/CMakeLists.txt - cpp/apps/primitives_gallery/playground/tables/data_table.cpp - cpp/apps/primitives_gallery/playground/tables/data_table_logic.cpp - cpp/apps/primitives_gallery/playground/tables/data_table_logic.h - cpp/apps/primitives_gallery/playground/tables/self_test.cpp - cpp/apps/primitives_gallery/playground/tables/tql.cpp - cpp/apps/primitives_gallery/playground/tables/viz.cpp - cpp/apps/primitives_gallery/playground/tables/viz.h - ... Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -44,6 +44,10 @@ func cmdDoctor(args []string) {
|
||||
doctorUnused(r, jsonOut)
|
||||
case "cpp-apps":
|
||||
doctorCppApps(r, jsonOut)
|
||||
case "ml":
|
||||
doctorML(r, jsonOut)
|
||||
case "vaults":
|
||||
doctorVaults(r, jsonOut)
|
||||
default:
|
||||
fmt.Fprintf(os.Stderr, "unknown doctor subcommand: %s\n", sub)
|
||||
doctorUsage()
|
||||
@@ -65,6 +69,8 @@ Subcommands:
|
||||
uses-functions Audit imports reales vs uses_functions del app.md
|
||||
unused Funciones del registry sin consumidores
|
||||
cpp-apps Conformidad de apps C++ con cpp/PATTERNS.md (cfg.about, dockspace, menubar)
|
||||
ml Entorno ML: GPUs NVIDIA, CUDA toolkit, venv Python, paquetes torch/diffusers, CLIs y vault
|
||||
vaults Salud de vaults: directorio, layout, índice, staleness, drift
|
||||
|
||||
Flags:
|
||||
--json Salida JSON (para scripting/agentes)`)
|
||||
@@ -103,6 +109,16 @@ func doctorAll(root string, jsonOut bool) {
|
||||
} else {
|
||||
all["cpp_apps_error"] = err.Error()
|
||||
}
|
||||
if v, err := infra.AuditMlEnv(root); err == nil {
|
||||
all["ml"] = v
|
||||
} else {
|
||||
all["ml_error"] = err.Error()
|
||||
}
|
||||
if v, err := infra.VaultDoctor(root); err == nil {
|
||||
all["vaults"] = v
|
||||
} else {
|
||||
all["vaults_error"] = err.Error()
|
||||
}
|
||||
emit(all)
|
||||
return
|
||||
}
|
||||
@@ -119,6 +135,10 @@ func doctorAll(root string, jsonOut bool) {
|
||||
doctorUnused(root, false)
|
||||
fmt.Println("\n=== C++ apps standard conformance ===")
|
||||
doctorCppApps(root, false)
|
||||
fmt.Println("\n=== ML environment ===")
|
||||
doctorML(root, false)
|
||||
fmt.Println("\n=== Vaults ===")
|
||||
doctorVaults(root, false)
|
||||
}
|
||||
|
||||
func doctorCppApps(root string, jsonOut bool) {
|
||||
@@ -280,6 +300,81 @@ func doctorUnused(root string, jsonOut bool) {
|
||||
fmt.Printf("\n%d unused functions (candidates to remove).\n", len(unused))
|
||||
}
|
||||
|
||||
func doctorVaults(root string, jsonOut bool) {
|
||||
entries, err := infra.VaultDoctor(root)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if jsonOut {
|
||||
emit(entries)
|
||||
return
|
||||
}
|
||||
if len(entries) == 0 {
|
||||
fmt.Println("No vaults declared (no projects/*/vaults/vault.yaml found).")
|
||||
return
|
||||
}
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
fmt.Fprintln(w, "NAME\tSTATUS\tFILES\tINDEXED\tISSUES")
|
||||
ok := 0
|
||||
for _, e := range entries {
|
||||
issues := "-"
|
||||
if len(e.Issues) > 0 {
|
||||
issues = strings.Join(e.Issues, "; ")
|
||||
}
|
||||
fmt.Fprintf(w, "%s\t%s\t%d\t%d\t%s\n",
|
||||
e.VaultName, e.Status, e.DiskFiles, e.IndexedFiles, issues)
|
||||
if e.Status == "ok" {
|
||||
ok++
|
||||
}
|
||||
}
|
||||
w.Flush()
|
||||
fmt.Printf("\n%d/%d vaults healthy.\n", ok, len(entries))
|
||||
}
|
||||
|
||||
func doctorML(root string, jsonOut bool) {
|
||||
report, err := infra.AuditMlEnv(root)
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
if jsonOut {
|
||||
emit(report)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Printf("GPUs detected: %d\n", len(report.Gpus))
|
||||
for _, g := range report.Gpus {
|
||||
fmt.Printf(" [%d] %s VRAM: %d/%d MiB Driver: %s CUDA: %s\n",
|
||||
g.Index, g.Name, g.VramFreeMb, g.VramTotalMb, g.DriverVersion, g.CudaVersion)
|
||||
}
|
||||
fmt.Println()
|
||||
|
||||
w := tabwriter.NewWriter(os.Stdout, 0, 0, 2, ' ', 0)
|
||||
fmt.Fprintln(w, "CHECK\tSTATUS\tVERSION\tDETAIL")
|
||||
for _, c := range report.Checks {
|
||||
version := c.Version
|
||||
if version == "" {
|
||||
version = "-"
|
||||
}
|
||||
detail := c.Detail
|
||||
if len(detail) > 60 {
|
||||
detail = detail[:60] + "..."
|
||||
}
|
||||
if detail == "" {
|
||||
detail = "-"
|
||||
}
|
||||
fmt.Fprintf(w, "%s\t%s\t%s\t%s\n", c.Name, c.Status, version, detail)
|
||||
}
|
||||
w.Flush()
|
||||
|
||||
overall := "OK"
|
||||
if !report.OverallOK {
|
||||
overall = "INCOMPLETE"
|
||||
}
|
||||
fmt.Printf("\nOverall ML environment: %s\n", overall)
|
||||
}
|
||||
|
||||
func emit(v any) {
|
||||
b, err := json.MarshalIndent(v, "", " ")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user