diff --git a/internal/app/archied/step_vocabulary.go b/internal/app/archied/step_vocabulary.go index 9ab601321..a36ce8621 100644 --- a/internal/app/archied/step_vocabulary.go +++ b/internal/app/archied/step_vocabulary.go @@ -31,7 +31,7 @@ func stepVocabulary() (*workflow.Manager, error) { return workflowsteps.NewManag // (main.go's Run) before buildDaemon captures the client. // // It is deliberately not part of openStateStoreAdapter, which the gateway root -// shares: the gateway reads catalog, runtime settings and personas, never a +// shares: the gateway reads catalog, runtime settings and SOUL, never a // workflow definition, so registering a vocabulary there would be the dead // vocabulary this shape removed from internal/app/archiemessaging -- a root that // cannot consume it must not be failed by it. diff --git a/internal/app/archiegateway/gateway_runtime.go b/internal/app/archiegateway/gateway_runtime.go index 7689cd80c..0ad67e794 100644 --- a/internal/app/archiegateway/gateway_runtime.go +++ b/internal/app/archiegateway/gateway_runtime.go @@ -20,7 +20,7 @@ import ( "github.com/samcharles93/archie-core/internal/tools" ) -// setupChatRuntime wires the model runtime, tool registry, persona registry, +// setupChatRuntime wires the model runtime, tool registry, SOUL, // chat task creator/controller, default chat identity and the release-update // service. The daemon and the standalone Gateway build through this one // constructor so the two processes cannot diverge. @@ -41,20 +41,6 @@ func (b *server) setupChatRuntime(ctx context.Context, cfg config.Config, actor chatModels.SetModelCatalog(catalog) b.chatModels = chatModels - // ── Persona registry ───────────────────────────────────────────── - if b.personas == nil { - personas, version, err := b.controlPlane.Personas(ctx) - if err != nil { - return fmt.Errorf("load personas: %w", err) - } - b.personas = gateway.NewPersonaRegistry(nil) - b.applyPersonas(personas, version) - b.applyStatus.Report(ctx, controlplane.PersonasKind, version, nil) - if err := b.watchPersonas(ctx, version); err != nil { - return fmt.Errorf("watch personas: %w", err) - } - } - // ── SOUL ───────────────────────────────────────────────────────── if b.soul == nil { soul, version, err := b.controlPlane.Soul(ctx) @@ -167,40 +153,9 @@ func watchStatus[T any]( }) } -// watchPersonas keeps the persona stream established for the life of the -// process. The first stream is opened synchronously, so a control plane that -// cannot be watched at all fails the boot that asked for it rather than -// leaving the process running personas it can no longer update; after that the -// watch reconnects instead of ending (see servicekit.KeepWatch). -func (b *server) watchPersonas(ctx context.Context, version int64) error { - updates, err := b.controlPlane.WatchPersonas(ctx, version) - if err != nil { - return err - } - watchStatus(ctx, b.applyStatus.Report, b.log, - controlplane.PersonasKind, "personas", version, updates, - b.controlPlane.WatchPersonas, - func(update controlplane.AppliedPersonas) int64 { return update.Version }, - func(update controlplane.AppliedPersonas) error { return update.Err }, - func(update controlplane.AppliedPersonas) error { - b.applyPersonas(update.Collection, update.Version) - return nil - }) - return nil -} - -func (b *server) applyPersonas(collection agent.PersonaCollection, version int64) { - personas := make([]gateway.Persona, 0, len(collection.Personas)) - for _, persona := range collection.Personas { - personas = append(personas, gateway.Persona{Name: persona.Name, Prompt: persona.Prompt}) - } - b.personas.Replace(personas, collection.Default) - b.log.Info("personas applied", "version", version) -} - // watchSoul keeps the soul stream established for the life of the process, so // a dashboard edit reaches the next turn without a restart. The stream rides -// the same outage bookkeeping as personas (watchStatus). +// the same outage bookkeeping as curators (watchStatus). func (b *server) watchSoul(ctx context.Context, version int64) error { updates, err := b.controlPlane.WatchSoul(ctx, version) if err != nil { @@ -235,7 +190,6 @@ func (b *server) setupGatewayChat(ctx context.Context, actor gateway.ChatTaskAct router.Limiter = b.rateLimiter router.Version = fmt.Sprintf("Archie\nGateway: %s\nRuntime: %s", buildinfo.Version, buildinfo.Runtime) router.Models = b.chatModels - router.Personas = b.personas router.Updates = b.updateService router.InitSessions(b.chatSessionStore) configureTaskCommands(router, b.chatTasks, b.chatController, chatTaskListerAdapter{tasks: b.stateStore.Tasks}, b.defaultChatIdentity) @@ -269,7 +223,7 @@ func (b *server) setupGatewayChat(ctx context.Context, actor gateway.ChatTaskAct router.Log = b.log return &gateway.LocalChatAdapter{ Router: router, Sessions: b.chatSessionStore, Turns: gateway.NewTurns(b.log), - Models: b.chatModels, Personas: b.personas, TaskActor: actor, Tasks: b.stateStore, + Models: b.chatModels, TaskActor: actor, Tasks: b.stateStore, VoiceAvailable: b.transcriber != nil, }, nil } diff --git a/internal/app/archiegateway/server.go b/internal/app/archiegateway/server.go index 2d70aad78..c6e8fa0a2 100644 --- a/internal/app/archiegateway/server.go +++ b/internal/app/archiegateway/server.go @@ -85,7 +85,6 @@ type server struct { mcpMu sync.Mutex mcpApplied map[string]appliedMCPServer chatModels *chatModelManager - personas *gateway.PersonaRegistry soul *soulSource memEngines *domainmemory.Registry curatorRegistry *curator.Registry diff --git a/internal/app/controlplane/client.go b/internal/app/controlplane/client.go index bdaf8a7ef..c1f417caa 100644 --- a/internal/app/controlplane/client.go +++ b/internal/app/controlplane/client.go @@ -152,34 +152,6 @@ type AppliedSettings struct { Err error } -func (c *Client) Personas(ctx context.Context) (agent.PersonaCollection, int64, error) { - response, err := c.rpc.Query(ctx, &pb.QueryRequest{Kind: PersonasKind}) - if err != nil { - return agent.PersonaCollection{}, 0, controlplanerpc.ClientError(err) - } - collection, err := decodePersonas(response.Resource.ValueJson) - return collection, response.Resource.Version, err -} - -type AppliedPersonas struct { - Collection agent.PersonaCollection - Version int64 - Err error -} - -func (c *Client) WatchPersonas(ctx context.Context, afterVersion int64) (<-chan AppliedPersonas, error) { - stream, err := c.rpc.Watch(ctx, &pb.WatchRequest{Kind: PersonasKind, AfterVersion: afterVersion}) - if err != nil { - return nil, controlplanerpc.ClientError(err) - } - return watchUpdates(ctx, stream, - func(resource *pb.Resource) AppliedPersonas { - collection, err := decodePersonas(resource.ValueJson) - return AppliedPersonas{Collection: collection, Version: resource.Version, Err: err} - }, - func(err error) AppliedPersonas { return AppliedPersonas{Err: err} }), nil -} - func (c *Client) Soul(ctx context.Context) (agent.Soul, int64, error) { response, err := c.rpc.Query(ctx, &pb.QueryRequest{Kind: SoulKind}) if err != nil { diff --git a/internal/app/controlplane/definitions.go b/internal/app/controlplane/definitions.go index 9a1aa00c4..146368bb2 100644 --- a/internal/app/controlplane/definitions.go +++ b/internal/app/controlplane/definitions.go @@ -8,7 +8,7 @@ import ( // Schemas are not declared here: each Definition names its document type, and // Definition.Descriptor derives the JSON Schema from it (internal/app/controlplane/schema.go). func builtinDefinitions(steps workflow.StepRegistry, settings map[string]any) []Definition { - definitions := []Definition{taskPolicyDefinition(), workflowDefinition(), workflowDefinitionsDefinition(steps, settings), workflowEnablementDefinition(), personaDefinition(), curatorDefinition(), soulDefinition(), scheduleDefinition(), agentProfileDefinition(), playbooksDefinition(), skillsDefinition(), credentialBindingsDefinition(), identityGrantsDefinition(), reviewSettingsDefinition(), orgModelPolicyDefinition()} + definitions := []Definition{taskPolicyDefinition(), workflowDefinition(), workflowDefinitionsDefinition(steps, settings), workflowEnablementDefinition(), curatorDefinition(), soulDefinition(), scheduleDefinition(), agentProfileDefinition(), playbooksDefinition(), skillsDefinition(), credentialBindingsDefinition(), identityGrantsDefinition(), reviewSettingsDefinition(), orgModelPolicyDefinition()} definitions = append(definitions, modelDefinitions()...) definitions = append(definitions, operationalDefinitions()...) return definitions diff --git a/internal/app/controlplane/instance_only_test.go b/internal/app/controlplane/instance_only_test.go index 1430a3939..0f257ff89 100644 --- a/internal/app/controlplane/instance_only_test.go +++ b/internal/app/controlplane/instance_only_test.go @@ -14,7 +14,7 @@ func TestInstanceOnlyKindsRefuseOtherOrgs(t *testing.T) { }{ {"another org writes an instance setting", "acme", ToolSettingsKind, true}, {"the system org writes an instance setting", storecontract.DefaultOrgID, ToolSettingsKind, false}, - {"another org writes an org-scoped kind", "acme", PersonasKind, false}, + {"another org writes an org-scoped kind", "acme", SoulKind, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/internal/app/controlplane/personas.go b/internal/app/controlplane/personas.go deleted file mode 100644 index aba1613be..000000000 --- a/internal/app/controlplane/personas.go +++ /dev/null @@ -1,29 +0,0 @@ -package controlplane - -import ( - "encoding/json" - - "github.com/samcharles93/archie-core/internal/config" - "github.com/samcharles93/archie-core/internal/domain/agent" -) - -const PersonasKind = "personas" - -func personaDefinition() Definition { - return Definition{ - Kind: PersonasKind, - Title: "Personas", - Document: agent.PersonaCollection{}, - ApplyMode: "live", - Seed: func(config.Config) any { return agent.ShippedPersonas() }, - Validate: func(input []byte) error { - return validateAs(input, func(collection agent.PersonaCollection) error { return collection.Validate() }) - }, - } -} - -func decodePersonas(input []byte) (agent.PersonaCollection, error) { - var collection agent.PersonaCollection - err := json.Unmarshal(input, &collection) - return collection, err -} diff --git a/internal/channels/telegram/commands.go b/internal/channels/telegram/commands.go index 63d20c7c4..265568169 100644 --- a/internal/channels/telegram/commands.go +++ b/internal/channels/telegram/commands.go @@ -24,7 +24,6 @@ var gatewayCommandSpecs = []commandSpec{ {Command: "version", Description: "Show installed Archie versions", Usage: "/version"}, {Command: "update", Description: "Check for Archie updates", Usage: "/update"}, {Command: "model", Description: "Choose a provider and model or switch directly", Usage: "/model [provider/model]"}, - {Command: "personality", Description: "Choose a communication style", Usage: "/personality [name]"}, {Command: "spawn", Description: "Create a tracked task", Usage: "/spawn [identity=name] [repo=owner/name] [workflow=name]