Files
archie/internal/app/controlplane/soul.go
T
sam 23307d9462 feat(gateway): load SOUL into the chat prompt per turn
SOUL now owns the prompt identity slot via a per-turn source: a stored soul
resource wins once saved, otherwise the identity's SOUL file, then the
shipped default. The gateway watches the resource so a dashboard edit
reaches the next turn without a restart; a file read error degrades to the
default and logs once.

The persona prompt plumbing is replaced by the SOUL source; the persona
surface itself (registry, wire, page, commands) stays for archie-core-7ftt.
2026-10-05 17:14:20 +11:00

33 lines
870 B
Go

package controlplane
import (
"encoding/json"
"github.com/samcharles93/archie-core/internal/config"
"github.com/samcharles93/archie-core/internal/domain/agent"
)
// SoulKind is the control-plane resource holding the agent's SOUL document.
const SoulKind = "soul"
func soulDefinition() Definition {
return Definition{
Kind: SoulKind,
Title: "SOUL",
Document: agent.Soul{},
ApplyMode: "live",
// Seeded empty. An unowned SOUL reads the identity's file and then the
// shipped default; the first dashboard save takes ownership.
Seed: func(config.Config) any { return agent.Soul{} },
Validate: func(input []byte) error {
return validateAs(input, func(s agent.Soul) error { return s.Validate() })
},
}
}
func decodeSoul(input []byte) (agent.Soul, error) {
var soul agent.Soul
err := json.Unmarshal(input, &soul)
return soul, err
}