feat: soporte projects y vaults en registry
Añade tablas projects y vaults a registry.db con FTS5, modelos Go,
parser de project.md y vault.yaml, CRUD completo en store, hashing
determinista, validación, y soporte en el indexer para escanear
projects/{name}/ con sus apps, analysis y vaults anidados.
Migration 010 crea las tablas, triggers FTS5, y columna project_id
en apps/analysis. El indexer preserva records remotos (repo_url) al
reindexar, igual que apps/analysis.
This commit is contained in:
@@ -237,6 +237,29 @@ func ValidateAnalysis(a *Analysis, knownFunctions, knownTypes map[string]bool) *
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidateProject checks integrity rules for projects.
|
||||
func ValidateProject(p *Project) *ValidationError {
|
||||
var errs []string
|
||||
|
||||
if p.ID == "" {
|
||||
errs = append(errs, "id is required")
|
||||
}
|
||||
if p.Name == "" {
|
||||
errs = append(errs, "name is required")
|
||||
}
|
||||
if p.Description == "" {
|
||||
errs = append(errs, "description is required")
|
||||
}
|
||||
if p.DirPath != "" && strings.HasPrefix(p.DirPath, "/") {
|
||||
errs = append(errs, "dir_path must be relative to registry root")
|
||||
}
|
||||
|
||||
if len(errs) > 0 {
|
||||
return &ValidationError{ID: p.ID, Errors: errs}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ValidateType checks integrity rules for types.
|
||||
func ValidateType(t *Type, knownTypes map[string]bool) *ValidationError {
|
||||
var errs []string
|
||||
|
||||
Reference in New Issue
Block a user