c8559676ed
executus CI / test (push) Has been cancelled
Merges the skill half of the persona/skill pair plus the second nested module. (Squashed onto main from phase-4b-skill; the audit/budget/persona batteries it was stacked on already landed via the P4 merge.) - skill/: clean-redesign Skill noun + LEAN SkillStore (lifecycle/versions/ schedule only) + ToRunnable + Memory default. - contrib/store/: separate go.mod carrying modernc.org/sqlite, so the driver never enters the core go.sum. db.Budget()/Personas()/Skills()/Audit() back all four store seams (JSON-blob + indexed columns; round-trip tested). Includes the verified gadfly #5 fixes (AppendVersion tx+UNIQUE+error, Mark*ScheduledRun atomic json_set, busy_timeout, NaN guard). - CI: builds + tests the nested module and asserts it owns the sqlite driver. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
29 lines
1.4 KiB
Go
29 lines
1.4 KiB
Go
package skill
|
|
|
|
import "time"
|
|
|
|
// SkillVersion is one immutable snapshot of a Skill at the moment it
|
|
// was saved. The skill_versions table is append-only; pruning is by
|
|
// retention policy in PruneOldVersions.
|
|
//
|
|
// Why: edit history with rollback (v3) and the admin pin gate (v3 Phase 4)
|
|
// both need a stable snapshot of the skill at a known version. The Snapshot
|
|
// field carries the FULL Skill struct so a later restore or pin produces
|
|
// the exact agent definition that was saved — system_prompt, tools,
|
|
// schedule, every field — not a synthesized partial snapshot.
|
|
//
|
|
// What: identity (UUID per snapshot) + skill ref + version-string copy +
|
|
// the full Skill payload + audit fields (saved_by, saved_at, edit_summary).
|
|
//
|
|
// Test: see skill_version_test.go for round-trip, list ordering, prune
|
|
// retention, and version-by-number disambiguation coverage.
|
|
type SkillVersion struct {
|
|
ID string // UUID per snapshot (NOT the skill's ID)
|
|
SkillID string // FK to skills.id (conceptually; not enforced by GORM)
|
|
Version string // Skill.Version at save time (semver)
|
|
Snapshot Skill // full Skill struct embedded; serialised as JSON
|
|
SavedBy string // caller member ID (or "" for builtin loader / pre-v3)
|
|
SavedAt time.Time // wall-clock save time
|
|
EditSummary string // optional human-readable note ("changed model tier", "...")
|
|
}
|