feat: proposals en registry

Añade sistema de proposals al registry: modelos (ProposalKind, ProposalStatus),
CRUD completo (Insert/Get/Update/Delete/List/Search con FTS), validación,
migración 002_proposals.sql y subcomando CLI fn proposal (add/list/show/update).
Motor de migraciones con embed.FS reemplaza schema estático.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-28 17:13:24 +01:00
parent 093367107e
commit 8d98faccd9
9 changed files with 902 additions and 109 deletions
+36
View File
@@ -87,6 +87,42 @@ type Type struct {
UpdatedAt time.Time `json:"updated_at"`
}
// ProposalKind classifies a proposal.
type ProposalKind string
const (
ProposalNewFunction ProposalKind = "new_function"
ProposalNewType ProposalKind = "new_type"
ProposalImproveFunction ProposalKind = "improve_function"
ProposalImproveType ProposalKind = "improve_type"
ProposalNewPipeline ProposalKind = "new_pipeline"
)
// ProposalStatus represents the review state of a proposal.
type ProposalStatus string
const (
ProposalPending ProposalStatus = "pending"
ProposalApproved ProposalStatus = "approved"
ProposalRejected ProposalStatus = "rejected"
ProposalImplemented ProposalStatus = "implemented"
)
// Proposal represents a suggested improvement to the registry.
type Proposal struct {
ID string `json:"id"`
Kind ProposalKind `json:"kind"`
TargetID string `json:"target_id"`
Title string `json:"title"`
Description string `json:"description"`
Evidence map[string]any `json:"evidence"`
Status ProposalStatus `json:"status"`
CreatedBy string `json:"created_by"`
ReviewedBy string `json:"reviewed_by"`
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