feat: registry_api + fn sync — sincronización de registry.db entre PCs

Nuevo sistema para mantener datos no regenerables (proposals, apps, projects,
analysis, vaults, pc_locations) sincronizados entre múltiples máquinas via
una API HTTP central desplegada en organic-machine.com.

- Migración 011: tabla pc_locations (mapa de ubicaciones por PC)
- registry/models.go: struct PcLocation
- registry/store.go: CRUD PcLocation + helpers de sync
- cmd/fn/sync.go: subcomando fn sync (push+pull, status, locations)
- bash/functions/infra/setup_registry_api: pipeline de deploy Docker+Traefik
- CLAUDE.md: documentación de sync y pc_locations

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-15 02:12:38 +02:00
parent 295ab491a3
commit 28364cf212
9 changed files with 820 additions and 2 deletions
+13
View File
@@ -224,6 +224,19 @@ type Vault struct {
UpdatedAt time.Time `json:"updated_at"`
}
// PcLocation maps an entity to a directory path on a specific PC.
type PcLocation struct {
ID string `json:"id"`
EntityType string `json:"entity_type"`
EntityID string `json:"entity_id"`
PcID string `json:"pc_id"`
DirPath string `json:"dir_path"`
Status string `json:"status"`
Notes string `json:"notes"`
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