Files
archie/internal/releaseupdate/topology.go
T
sam f92c5b4536
ci/woodpecker/pr/quality Pipeline was successful
Quality / check (pull_request) Canceled after 7m39s
chore(runtime): delete Kit and external agent harness support (#1877)
Archie runs its own agent loop only. Removes Kit resolution and launch,
the harness runner and adapters, the setup terminal and sandbox view,
harness secrets and OAuth capture (table dropped in migration 0075), the
task-tools contract that only Kit containers reached, and the
sandbox-kit-spec dependency. Agent profiles carry image and tools only.
The egress proxy keeps the model-session path; the sandbox relay code
stays for #1867.
2026-11-12 21:29:05 +11:00

37 lines
1.2 KiB
Go

package releaseupdate
import (
"fmt"
"slices"
)
type Topology struct {
Units []string `json:"units"`
ConfigSections []string `json:"config_sections"`
// Binaries are the release's host binaries that run beside the units
// without a service of their own. They are installed and switched with
// the units and are never started, stopped or demanded as a unit.
Binaries []string `json:"binaries,omitempty"`
}
// apps returns the binaries the release installs: its units, and the host
// binaries that run beside them without a service.
func (t Topology) apps() []string { return append(slices.Clone(t.Units), t.Binaries...) }
// MigrationPlan preserves the release's dependency order. Unknown observations
// require every step to be checked manually rather than assuming a partial host.
func (t Topology) MigrationPlan(units, sections map[string]bool) []string {
var steps []string
for _, section := range t.ConfigSections {
if !sections[section] {
steps = append(steps, fmt.Sprintf("configure [%s]", section))
}
}
for _, unit := range t.Units {
if !units[unit] {
steps = append(steps, fmt.Sprintf("install and enable %s.service", unit))
}
}
return steps
}