package hostbox import ( "crypto/sha256" "encoding/hex" "encoding/json" "github.com/carlosframework/platform/internal/hostwrite" ) // LaunchSpec is a digest preimage, never authority. Root compares its digest // with the authoritative attempt and hashes the executable independently. type LaunchSpec struct { Identity hostwrite.Identity Executable, Digest string Args, Env []string } func (s LaunchSpec) Hash() (string, error) { raw, err := json.Marshal(s) if err != nil { return "", err } sum := sha256.Sum256(raw) return hex.EncodeToString(sum[:]), nil }