Gap 8 (frontmatter plugins key): add Plugins []string to Metadata.Archie struct. Parses the plugins list from SKILL.md YAML frontmatter per PRD section 5. Gap 2 (grace period): add GracePeriod field to container.Config, distinct from MaxUptime. MaxUptime = total container lifetime cap. GracePeriod = idle time after task completion before kill. Documented per PRD sections 1 and 4. Gap 6 (task.json): add TaskPayload struct and WriteTaskJSON function to internal/container. Daemon writes the task payload to <workspace>/task.json before container start, matching the PRD section 3 /data/task.json boot brief.
41 lines
1.1 KiB
Go
41 lines
1.1 KiB
Go
package skill
|
|
|
|
import "testing"
|
|
|
|
// ── regression: Gap 8 — frontmatter missing plugins key ─────────────
|
|
|
|
func TestFrontmatterMetadataArchieHasPluginsField(t *testing.T) {
|
|
// Gap 8: Frontmatter.Metadata.Archie has Tools and Engine only.
|
|
// PRD section 5 shows a plugins array in metadata.archie:
|
|
// plugins: [plugins/custom-gate.go, plugins/gosec-check.go]
|
|
|
|
fm, _, err := Parse([]byte(`---
|
|
name: test-skill
|
|
description: desc
|
|
version: 1.0.0
|
|
metadata:
|
|
archie:
|
|
tools: [go]
|
|
engine: any
|
|
plugins:
|
|
- plugins/custom-gate.go
|
|
- plugins/gosec-check.go
|
|
---
|
|
Body.
|
|
`))
|
|
if err != nil {
|
|
t.Fatal(err)
|
|
}
|
|
if fm.Metadata.Archie == nil {
|
|
t.Fatal("Metadata.Archie is nil")
|
|
}
|
|
if len(fm.Metadata.Archie.Plugins) != 2 {
|
|
t.Error("Gap 8: Frontmatter.Metadata.Archie has no Plugins field, or " +
|
|
"it didn't parse the plugins list. Add a Plugins []string field to " +
|
|
"the Metadata.Archie struct per PRD section 5.")
|
|
}
|
|
if fm.Metadata.Archie.Plugins[0] != "plugins/custom-gate.go" {
|
|
t.Errorf("Plugins[0] = %q, want plugins/custom-gate.go", fm.Metadata.Archie.Plugins[0])
|
|
}
|
|
}
|