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:
2026-04-12 17:29:41 +02:00
parent 1a3e77b0d5
commit 54e62ecb91
8 changed files with 647 additions and 19 deletions
+31
View File
@@ -120,6 +120,7 @@ type App struct {
DirPath string `json:"dir_path"`
ContentHash string `json:"content_hash"`
RepoURL string `json:"repo_url"`
ProjectID string `json:"project_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
@@ -141,6 +142,7 @@ type Analysis struct {
RepoURL string `json:"repo_url"`
DirPath string `json:"dir_path"`
ContentHash string `json:"content_hash"`
ProjectID string `json:"project_id"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
@@ -193,6 +195,35 @@ type UnitTest struct {
UpdatedAt time.Time `json:"updated_at"`
}
// Project groups apps, analysis and vaults under a common theme.
type Project struct {
ID string `json:"id"`
Name string `json:"name"`
Description string `json:"description"`
Tags []string `json:"tags"`
RepoURL string `json:"repo_url"`
DirPath string `json:"dir_path"`
Documentation string `json:"documentation"`
Notes string `json:"notes"`
ContentHash string `json:"content_hash"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// Vault is a data store (symlink or directory) associated with a project or the registry.
type Vault struct {
ID string `json:"id"`
Name string `json:"name"`
ProjectID string `json:"project_id"`
Description string `json:"description"`
Path string `json:"path"`
Symlink bool `json:"symlink"`
Tags []string `json:"tags"`
ContentHash string `json:"content_hash"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
// GenerateID builds the canonical ID: {name}_{lang}_{domain}
func GenerateID(name, lang, domain string) string {
return name + "_" + lang + "_" + domain