refactor(agent): drop the SOUL upgrade branch with no shipped template

ShippedSoul returned an empty SoulDocument.Legacy, so SoulSuperseded,
replaceSoul and SoulUpgraded had no production producer: the only body the
build ships is its current default, which classifies as SoulCurrent, and only
tests constructed a Legacy document. No earlier SOUL ever shipped (the file was
introduced with the starter in cc83c9ae), so the upgrade path has nothing to
consume.

Remove the speculative machinery and keep the behaviour that is real: seed the
starter when no file exists, recognise the shipped default as current, and
preserve every other body, including a template-shaped edit. A build that
supersedes the starter reintroduces the upgrade together with the old body it
consumes.
This commit is contained in:
sam committed 2026-10-02 11:59:54 +10:00
1 parent 656d21520f
commit 457da2e97d
5 files changed
+75 -166

No files matched your search

+6 -8
View File
@@ -617,12 +617,11 @@ func (b *boot) loadCatalog(ctx context.Context, cfgPath string) {
b.log.Info("model catalog loaded", "providers", len(catalog.Providers), "models", len(models))
}
// seedSoul writes the starter SOUL beside the config on first run, and upgrades
// a file that is still exactly a shipped template, so the identity a user can
// edit exists before the SOUL loader (#439) reads it. It runs on the full
// process's boot tail rather than in loadConfig: an offline command such as
// `-requeue` reads the config but must not write the operator's files. A
// failure is logged, not fatal -- the loader falls back to the embedded
// seedSoul writes the starter SOUL beside the config on first run, so the
// identity a user can edit exists before the SOUL loader (#439) reads it. It
// runs on the full process's boot tail rather than in loadConfig: an offline
// command such as `-requeue` reads the config but must not write the operator's
// files. A failure is logged, not fatal -- the loader falls back to the embedded
// default, so a read-only config directory must not stop the process
// (docs/prds/soul.md, "Prompt and failure contract").
func (b *boot) seedSoul(cfgPath string) {
@@ -631,8 +630,7 @@ func (b *boot) seedSoul(cfgPath string) {
b.log.Warn("soul: starter file unavailable", "err", err)
return
}
switch result.Action {
case configuration.SoulCreated, configuration.SoulUpgraded:
if result.Action == configuration.SoulCreated {
b.log.Info("soul: starter file written", "path", result.Path, "action", result.Action)
}
}