05ae530442
Install current verified harness releases inside Docker, preserve persistent accounts and settings, and provide separate interactive and pipeline model defaults with terminal onboarding and fuzzy pickers. Add Docker-aware authoring transport, Pi stage execution, bounded workflow controls, reliable final-result readback and usage settlement, and finite short-lived CLI pipe draining. Keep dated installation evidence and packaged authoring guidance consistent. Verified with a real Docker installation, both harness stages and interactive authors, the built-in plan/implement/review starter, independent host race/vet checks, installer tests, and packaged skill tests. Generated release receipts stay ignored in clean checkouts.
47 lines
1.3 KiB
Go
47 lines
1.3 KiB
Go
package pipeline
|
|
|
|
import (
|
|
"maps"
|
|
"sort"
|
|
"strings"
|
|
|
|
"git.a-wan.net/alan/pipelines/internal/stage"
|
|
)
|
|
|
|
// StageDefinition adapts normalized/persisted graph data for type implementations.
|
|
// Copies keep implementations from accidentally modifying immutable graph history.
|
|
func StageDefinition(s Stage) stage.Definition {
|
|
blocks := maps.Clone(s.Blocks)
|
|
if blocks == nil {
|
|
blocks = map[string]string{}
|
|
}
|
|
delete(blocks, "input") // Retired contracts in historical graph JSON are ignored.
|
|
delete(blocks, "limits")
|
|
delete(blocks, "memory")
|
|
for name, value := range map[string]string{"output": s.Output, "prompt": s.Prompt} {
|
|
if value != "" {
|
|
blocks[name] = value
|
|
}
|
|
}
|
|
configs := maps.Clone(s.Configs)
|
|
keys := make([]string, 0, len(configs))
|
|
for key := range configs {
|
|
keys = append(keys, key)
|
|
}
|
|
sort.Strings(keys)
|
|
lines := []string{"type=" + stage.EffectiveType(s.Type)}
|
|
for _, key := range keys {
|
|
lines = append(lines, key+"="+configs[key])
|
|
}
|
|
blocks["configs"] = strings.Join(lines, "\n")
|
|
def := stage.Definition{Key: s.Key, Type: stage.EffectiveType(s.Type), Blocks: blocks, Configs: configs, Edges: maps.Clone(s.Edges)}
|
|
if s.Notify != nil {
|
|
for _, kind := range s.Notify.Artifacts {
|
|
if kind == "files" {
|
|
def.ReportFileArtifacts = true
|
|
}
|
|
}
|
|
}
|
|
return def
|
|
}
|