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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user