From ad1e288309b86c5a95b8c798c81b37c06f6e1b78 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 7 Jun 2026 02:52:19 +0100 Subject: [PATCH] Make persona turns channel-aware --- apps/bot/src/discord-bot.ts | 21 +- apps/worker/src/index.ts | 12 +- notes/fresh-workspace-handoff.md | 2 +- notes/voidbot-current-system-map.md | 3 +- packages/core/src/repo-discord-identities.ts | 3 +- prompts/repo-persona-turn.prompt.md | 5 +- scripts/run-repo-persona-heartbeats.ts | 197 +++++++++++++++++-- state/evidence.jsonl | 1 + state/map.yaml | 2 +- 9 files changed, 218 insertions(+), 28 deletions(-) diff --git a/apps/bot/src/discord-bot.ts b/apps/bot/src/discord-bot.ts index aacac87..3f65b28 100644 --- a/apps/bot/src/discord-bot.ts +++ b/apps/bot/src/discord-bot.ts @@ -83,6 +83,15 @@ import { export async function startBot(): Promise { const config = loadConfig(); + const isRepoPersonaRuntimeChannelAllowed = (channelId: string): boolean => { + if (config.excludedChannelIds.includes(channelId)) { + return false; + } + if (config.indexedChannelIds.includes(channelId)) { + return true; + } + return config.indexAllChannels; + }; if (!config.botToken) { throw new Error("DISCORD_BOT_TOKEN is required to start the bot."); @@ -370,7 +379,11 @@ export async function startBot(): Promise { roleAddressedRepoIdentity || textAddressedRepoIdentity ? undefined - : await resolveRepliedRepoIdentity(message, repoDiscordIdentities); + : await resolveRepliedRepoIdentity( + message, + repoDiscordIdentities, + isRepoPersonaRuntimeChannelAllowed(message.channelId), + ); const addressedRepoIdentities = uniqueRepoIdentities([ ...roleAddressedRepoIdentities, ...textMentionedRepoIdentities, @@ -379,7 +392,8 @@ export async function startBot(): Promise { const broadcastAddressedRepoIdentities = !isDirectMessage && addressedRepoIdentities.length === 0 && isRepoPersonaBroadcastInvitation(stripBotMention(message.content)) ? repoDiscordIdentities.identities.filter((identity) => - isRepoDiscordIdentityAllowedInChannel(identity, message.channelId), + isRepoPersonaRuntimeChannelAllowed(message.channelId) || + isRepoDiscordIdentityAllowedInChannel(identity, message.channelId), ) : []; const pendingRepoIdentities = addressedRepoIdentities.length > 0 @@ -706,6 +720,7 @@ export async function startBot(): Promise { async function resolveRepliedRepoIdentity( message: Message, registry: { identities: RepoDiscordIdentity[] }, + channelAllowedOverride = false, ): Promise { if (!message.reference?.messageId) { return undefined; @@ -717,7 +732,7 @@ async function resolveRepliedRepoIdentity( ? referenced.author.username : referenced.member?.displayName ?? referenced.author.globalName ?? referenced.author.username; - return findRepoDiscordIdentityByPersonaName(registry, personaName, message.channelId); + return findRepoDiscordIdentityByPersonaName(registry, personaName, message.channelId, channelAllowedOverride); } catch (error) { console.warn( `Could not resolve referenced message ${message.reference.messageId} for repo Persona reply routing: ${ diff --git a/apps/worker/src/index.ts b/apps/worker/src/index.ts index 452c3fe..c71c31a 100644 --- a/apps/worker/src/index.ts +++ b/apps/worker/src/index.ts @@ -1248,7 +1248,7 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn ); return true; } - if (!isRepoDiscordIdentityAllowedInChannel(identity, channelId)) { + if (!isRepoDiscordIdentityAllowedInChannel(identity, channelId) && !isRepoPersonaRuntimeChannelAllowed(channelId)) { console.warn( `Rejected repo identity ${identity.id} speech for job ${job.id}: identity is not registered for Discord channel ${channelId}.`, ); @@ -1295,6 +1295,16 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn return true; } +function isRepoPersonaRuntimeChannelAllowed(channelId: string): boolean { + if (config.excludedChannelIds.includes(channelId)) { + return false; + } + if (config.indexedChannelIds.includes(channelId)) { + return true; + } + return config.indexAllChannels; +} + async function resolveRepoIdentityForJobIntent( job: JobRecord, identitySelector?: string, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index f79bf1c..6f13a5d 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -108,7 +108,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - The moderation loop now crosses Discord through Bifrost only. `scripts/run-void-moderator-rumination.ps1` calls `BIFROST_ROOT/tools/bifrost-bridge.mjs` for public candidate posts and user moderation-status DMs, then converts the Bifrost receipt into typed Void state. `VOID_DISCORD_TRANSPORT=direct` is rejected in this runner; direct VoidBot-native transport is no longer part of the moderation delivery authority. - Repo identities now have a cleaner address/speech split. A private registry at `REPO_DISCORD_IDENTITIES_PATH` maps identity id/repo/display name/avatar/role/channel allow-list. Discord users can address a Persona by role mention or exact display-name mention; Codex agents still speak through `post_repo_identity_message`. - Void still moderates and participates everywhere the normal bot lanes allow. The swarm/repo Personas are scoped to text `#aquarium` (`1501196543150264332`) so their lively heartbeats and role replies do not flood general. The old general channel id is `113786069023064068`; do not reuse it as a Persona heartbeat default. -- Repo Personas now have topic/channel speech permissions. Aquarium is the deliberately low-threshold general-musing lane for all Personas; they may post compact casual thoughts, jokes, curiosities, and half-formed fascinations there without a work artifact. Domain channels are also allowed when the topic matches: Nibu can use narrative/gamedesign/concepts/development, Aqua can use music/soundtrack/development, Mimir can use development/programming/visual-effects/machine-learning/unity3d, and Epiphany can use development/programming/machine-learning. The CTB scheduler folds per-topic speed multipliers into Persona initiative, and the heartbeat prompt includes recent cross-channel context so agents can jump into non-Aquarium chatter when their thoughts line up. +- Repo Personas now have topic/channel speech permissions. Aquarium is the deliberately low-threshold general-musing lane for all Personas; they may post compact casual thoughts, jokes, curiosities, and half-formed fascinations there without a work artifact. Domain channels are also allowed when the topic matches: Nibu can use narrative/gamedesign/concepts/development, Aqua can use music/soundtrack/development, Mimir can use development/programming/visual-effects/machine-learning/unity3d, and Epiphany can use development/programming/machine-learning. The CTB scheduler folds per-topic speed multipliers into Persona initiative, and the heartbeat prompt includes recent cross-channel context so agents can jump into non-Aquarium chatter when their thoughts line up. When `INDEX_ALL_CHANNELS=true` or `INDEXED_CHANNEL_IDS` provides extra rooms, the heartbeat context assembler now discovers those Discord text channels and presents them as separate visible conversations with channel labels/ids. `#therapy` and `#memes` are explicitly channel-local surfaces: therapy context should not leak into meme replies, and meme context should not become therapy-note sludge. Bot ingress and worker delivery accept indexed/all-channel runtime grants unless the channel id is excluded. - Repo identities also have Persona state now. The bot resolves each identity to `.voidbot/private/repo-personas/.cc` unless `personaStatePath` overrides it, ensures missing Discord roles on startup when `DISCORD_GUILD_ID` and permissions allow, and appends role/name-addressed prompts to `pendingMentions` in `REPO_PERSONA_HEARTBEAT_STATE_PATH` instead of creating direct repo-identity jobs. The CTB heartbeat scheduler temporarily pulls Personas with pending mentions forward, attaches those prompts plus reply targets to the next `repo-persona-rumination` job, and consumes them only after a job is actually queued. Worker auto-posting stays suppressed for `repo-persona-rumination`; the child must emit a parent-owned action block for public delivery. - Repo Persona prompts now include an identity doctrine block. Void's style pack stays as discipline, humor permission, and source-grounding habit, but repo Persona jobs explicitly say the registered Persona identity overrides Void as the speaking subject. - Repo Persona embodiment is now doctrine, not local flavor. A Persona should think, remember, ask, object, joke, propose, stay silent, and speak as that character first; every repo concern and room reply is filtered through the Persona's feelings, drives, values, wounds, fascinations, aesthetic taste, and dignity. Personal values are first-class and should suit the kind of person the character is, not just the Persona's assigned jobs. diff --git a/notes/voidbot-current-system-map.md b/notes/voidbot-current-system-map.md index ec0841a..bcd4db4 100644 --- a/notes/voidbot-current-system-map.md +++ b/notes/voidbot-current-system-map.md @@ -159,7 +159,8 @@ Verse-facing service contract: `docs/architecture/voidbot-verse-service-contract - Repo Discord identities - `REPO_DISCORD_IDENTITIES_PATH` points at a private JSON registry of repo id, repo name, display name, optional avatar URL, optional role id, and allowed channel ids. The role is the Discord mention target; the webhook persona is the speech transport. - That registry may also carry `channelPermissions`: per-topic channel entries with a speech threshold and speed multiplier. These are not another transport; they are the permission/salience map for where a Persona may speak. Aquarium is the low-threshold musing lane, while domain channels such as narrative, gamedesign, music, soundtrack, development, programming, visual-effects, machine-learning, and unity3d are available to matching Personas. - - Void remains the room-wide moderation/participation agent. Repo Personas are the swarm mouth and should be confined to text `#aquarium` (`1501196543150264332`) through registry allow-lists and `REPO_PERSONA_HEARTBEAT_DEFAULT_CHANNEL_ID`; general is `113786069023064068` and should not be used for autonomous Persona chatter. + - Runtime channel access can also come from `INDEX_ALL_CHANNELS=true` or explicit `INDEXED_CHANNEL_IDS`. The heartbeat context assembler discovers readable Discord text channels from the guild, filters excluded channel ids, adds them to the Persona channel plan, and renders each as a separate visible conversation with channel label/id, topic, threshold, and posture. This is how rooms such as `#therapy` and `#memes` stay distinct instead of becoming one blended transcript. + - Void remains the room-wide moderation/participation agent. Repo Persona idle/default chatter still prefers text `#aquarium` (`1501196543150264332`) through the default channel and low-threshold speech options, but direct calls, newest current-room turns, and channel-local replies may target any indexed/all-channel runtime grant unless the channel id is explicitly excluded. General is `113786069023064068`; use it only when the current room/direct call makes it the correct venue, not as the autonomous swarm default. - On startup, the bot tries to find or create missing mentionable roles for registered identities in `DISCORD_GUILD_ID`, then writes the role ids back to the private registry. If Discord permissions are missing, it warns and leaves the registry unchanged. - `list_repo_discord_identities` exposes the registered address book to Codex agents, and `post_repo_identity_message` enforces identity/channel registration before posting through the shared webhook pipe. - Each repo identity has a Persona state path, defaulting to `.voidbot/private/repo-personas/.cc`. The MCP still exposes `read_repo_persona_state` and `apply_repo_persona_state_operation` for diagnostics and explicit administrative use, but normal character turns do not see those tools. The scheduler reads typed state, projects it into lived memory/mood/obligation language, and the Interpreter writes natural character reflection back into typed state operations. diff --git a/packages/core/src/repo-discord-identities.ts b/packages/core/src/repo-discord-identities.ts index 1f2864e..82604b1 100644 --- a/packages/core/src/repo-discord-identities.ts +++ b/packages/core/src/repo-discord-identities.ts @@ -103,6 +103,7 @@ export function findRepoDiscordIdentityByPersonaName( registry: RepoDiscordIdentityRegistry, personaName: string | undefined, channelId: string, + channelAllowedOverride = false, ): RepoDiscordIdentity | undefined { if (!personaName || personaName.trim().length === 0) { return undefined; @@ -112,7 +113,7 @@ export function findRepoDiscordIdentityByPersonaName( return registry.identities.find((identity) => { return ( - isRepoDiscordIdentityAllowedInChannel(identity, channelId) && + (channelAllowedOverride || isRepoDiscordIdentityAllowedInChannel(identity, channelId)) && normalizeIdentityKey(identity.displayName) === normalizedPersonaName ); }); diff --git a/prompts/repo-persona-turn.prompt.md b/prompts/repo-persona-turn.prompt.md index 0352485..31fda03 100644 --- a/prompts/repo-persona-turn.prompt.md +++ b/prompts/repo-persona-turn.prompt.md @@ -21,9 +21,12 @@ If a human says you are missing the greater picture, treat that as a conceptual Recent home repo activity: {{repoActivitySurface}} -Recent conversation transcript: +Recent conversation map: {{conversationMemorySurface}} +Channel continuity rule: +You are seeing multiple Discord conversations at once. Keep track of which room each line belongs to before deciding what, if anything, you would say. A reply to #therapy belongs in #therapy, a meme reaction belongs in #memes, and Aquarium/domain-room chatter belongs in that named room unless a human explicitly bridges the rooms. Do not answer a therapy thread as if it were memes, do not turn memes into therapy notes, and do not collapse all visible rooms into one blended swarm thread. + Image awareness: If a transcript line includes `[media: image ... local=...]`, that image has been attached to your Persona turn as an actual image input when the provider supports multimodal turns. Treat shared images and memes as part of the room's social context: notice who posted them, what they seem to be doing socially, and how your character would react. Do not pretend to see an image when the transcript only names a non-image attachment or lacks a local media path. diff --git a/scripts/run-repo-persona-heartbeats.ts b/scripts/run-repo-persona-heartbeats.ts index 4fc998c..b254c2f 100644 --- a/scripts/run-repo-persona-heartbeats.ts +++ b/scripts/run-repo-persona-heartbeats.ts @@ -126,6 +126,11 @@ interface RepoPersonaChannelOption { posture?: string; } +interface DiscordChannelDirectoryEntry { + channelId: string; + name: string; +} + interface BifrostGovernanceDigest { generatedAt: string; topics: BifrostGovernanceTopic[]; @@ -488,10 +493,12 @@ async function queueRepoPersonaTurn(input: { } const preferredChannelId = newestPendingMentionChannel(input.pendingMentions); + const contextChannelOptions = await discoverRepoPersonaContextChannels(input.config); const channelPlan = buildChannelPlan( identity, input.config.repoPersonaHeartbeats.defaultChannelId, preferredChannelId, + contextChannelOptions, ); const fallbackChannelId = channelPlan.primaryChannelId; if (!fallbackChannelId) { @@ -518,7 +525,7 @@ async function queueRepoPersonaTurn(input: { const fetchedChannelSnapshots = await fetchChannelSnapshots({ botToken: input.config.botToken, channelIds: channelPlan.snapshotChannelIds, - limit: 15, + limit: channelPlan.snapshotChannelIds.length > 12 ? 6 : 15, bifrostDiscordChannelId: input.config.bifrostDiscordChannelId, }); const turnTarget = selectRepoPersonaTurnTarget({ @@ -534,8 +541,7 @@ async function queueRepoPersonaTurn(input: { }; const recentMessages = messagesForChannel(fetchedChannelSnapshots, channelId); const channelSnapshots = fetchedChannelSnapshots - .filter((snapshot) => snapshot.channelId !== channelId) - .slice(0, 5); + .filter((snapshot) => snapshot.channelId !== channelId); const bifrostDigest = input.config.repoPersonaBifrostEnabled && identity.identityKind !== "native_persona" ? await fetchBifrostGovernanceDigest({ bifrostRoot: input.config.bifrostRoot, @@ -984,7 +990,7 @@ async function fetchChannelSnapshots(input: { bifrostDiscordChannelId?: string; }): Promise { const snapshots: ChannelSnapshot[] = []; - for (const channelId of input.channelIds.filter((entry) => entry !== input.primaryChannelId).slice(0, 6)) { + for (const channelId of input.channelIds.filter((entry) => entry !== input.primaryChannelId)) { try { snapshots.push({ channelId, @@ -1013,6 +1019,117 @@ async function fetchChannelSnapshots(input: { return snapshots; } +async function discoverRepoPersonaContextChannels( + config: ReturnType, +): Promise { + const explicitChannelIds = new Set(config.indexedChannelIds); + const byId = new Map(); + + if (config.indexAllChannels && config.botToken && config.developmentGuildId) { + for (const channel of await fetchDiscordTextChannelDirectory({ + botToken: config.botToken, + guildId: config.developmentGuildId, + })) { + if (config.excludedChannelIds.includes(channel.channelId)) { + continue; + } + byId.set(channel.channelId, repoPersonaContextChannelOption(channel)); + } + } + + for (const channelId of explicitChannelIds) { + if (config.excludedChannelIds.includes(channelId)) { + continue; + } + if (!byId.has(channelId)) { + byId.set(channelId, { + channelId, + label: `channel ${channelId}`, + topic: `Discord channel ${channelId}`, + speechThreshold: "high", + speedMultiplier: 0.7, + posture: "Channel-aware context is visible here. Speak here only when the current turn, a direct call, or a clear channel-local reason makes that the right room.", + }); + } + } + + return [...byId.values()]; +} + +async function fetchDiscordTextChannelDirectory(input: { + botToken: string; + guildId: string; +}): Promise { + const response = await fetch(`https://discord.com/api/v10/guilds/${input.guildId}/channels`, { + headers: { + Authorization: `Bot ${input.botToken}`, + }, + }); + if (!response.ok) { + throw new Error(`Discord channel directory fetch failed with ${response.status}: ${await response.text()}`); + } + + const channels = await response.json() as Array<{ + id?: unknown; + name?: unknown; + type?: unknown; + }>; + return channels + .filter((channel) => channel.type === 0 || channel.type === 5) + .map((channel) => ({ + channelId: String(channel.id ?? ""), + name: String(channel.name ?? ""), + })) + .filter((channel) => channel.channelId.length > 0 && channel.name.length > 0); +} + +function repoPersonaContextChannelOption(channel: DiscordChannelDirectoryEntry): RepoPersonaChannelOption { + return { + channelId: channel.channelId, + label: `#${channel.name}`, + topic: `Discord channel #${channel.name}`, + speechThreshold: contextChannelSpeechThreshold(channel.name), + speedMultiplier: contextChannelSpeedMultiplier(channel.name), + posture: contextChannelPosture(channel.name), + }; +} + +function contextChannelSpeechThreshold(channelName: string): RepoPersonaChannelOption["speechThreshold"] { + const normalized = normalizeKey(channelName); + if (["aquarium", "memes", "pics"].includes(normalized)) { + return "low"; + } + if (["therapy", "general"].includes(normalized)) { + return "medium"; + } + return "high"; +} + +function contextChannelSpeedMultiplier(channelName: string): number { + const normalized = normalizeKey(channelName); + if (normalized === "aquarium") { + return 1.5; + } + if (["memes", "pics"].includes(normalized)) { + return 1.15; + } + if (normalized === "therapy") { + return 0.85; + } + return 0.7; +} + +function contextChannelPosture(channelName: string): string { + const normalized = normalizeKey(channelName); + if (normalized === "therapy") { + return "Treat this as a distinct vulnerable conversation. Do not drag its emotional context into memes, Aquarium, or work rooms unless the current speaker explicitly bridges it."; + } + if (normalized === "memes") { + return "Treat this as a distinct playful image/joke conversation. React to the local bit without laundering it into therapy or work."; + } + return "Treat this as its own Discord conversation. Keep channel-local context attached to this channel unless a human explicitly bridges rooms."; +} + function selectRepoPersonaTurnTarget(input: { channelPlan: RepoPersonaChannelPlan; fetchedChannelSnapshots: ChannelSnapshot[]; @@ -1927,7 +2044,13 @@ async function assembleRepoPersonaTurnPrompt(input: { throw new Error(`Unknown repo Persona identity: ${input.identityId}`); } - const channelPlan = buildChannelPlan(identity, input.config.repoPersonaHeartbeats.defaultChannelId); + const contextChannelOptions = await discoverRepoPersonaContextChannels(input.config); + const channelPlan = buildChannelPlan( + identity, + input.config.repoPersonaHeartbeats.defaultChannelId, + undefined, + contextChannelOptions, + ); const fallbackChannelId = channelPlan.primaryChannelId; if (!fallbackChannelId) { throw new Error(`No prompt assembly channel is configured for ${identity.id}.`); @@ -1937,7 +2060,7 @@ async function assembleRepoPersonaTurnPrompt(input: { fetchChannelSnapshots({ botToken: input.config.botToken, channelIds: channelPlan.snapshotChannelIds, - limit: 15, + limit: channelPlan.snapshotChannelIds.length > 12 ? 6 : 15, bifrostDiscordChannelId: input.config.bifrostDiscordChannelId, }), input.config.repoPersonaBifrostEnabled @@ -1969,8 +2092,7 @@ async function assembleRepoPersonaTurnPrompt(input: { ? syntheticRecentMessages : messagesForChannel(fetchedChannelSnapshots, channelId); const channelSnapshots = fetchedChannelSnapshots - .filter((snapshot) => snapshot.channelId !== channelId) - .slice(0, 5); + .filter((snapshot) => snapshot.channelId !== channelId); const roomContext = { recentMessages, channelSnapshots, @@ -4051,6 +4173,9 @@ function renderRepoPersonaConversationTranscript(input: { const sections: string[] = []; sections.push([ "Read this as raw recent message evidence, not as a summary and not as consensus.", + "Treat each Discord channel as its own conversation with its own local context, emotional temperature, and reply venue.", + "Do not blend separate rooms into one thread. #therapy, #memes, Aquarium, and work/domain channels can be simultaneously visible without being the same conversation.", + "When you carry context across channels, say the bridge plainly; otherwise keep channel-local material local to the channel where it happened.", "Messages are ordered oldest to newest inside each section. Newer human corrections can supersede older agent proposals.", "Use the visible cross-channel chronology below to decide whether a correction is still unresolved or was already answered later by the same Persona.", "Do not infer consensus from agents repeating each other. If a human reframes, narrows, or corrects an agent's proposal, account for that correction directly.", @@ -4061,6 +4186,7 @@ function renderRepoPersonaConversationTranscript(input: { if (chronology) { sections.push(chronology); } + sections.push(renderConversationChannelDirectory(input.channelPlan)); if (input.pendingMentions.length > 0) { sections.push([ "Direct calls:", @@ -4071,17 +4197,16 @@ function renderRepoPersonaConversationTranscript(input: { } const currentLabel = input.channelPlan.options.find((option) => option.channelId === input.channelPlan.primaryChannelId - )?.label ?? "current room"; + ); sections.push([ - `Current room (${currentLabel}), oldest to newest:`, + `Current conversation (${formatConversationChannelLabel(currentLabel, input.channelPlan.primaryChannelId)}), oldest to newest:`, ...formatConversationMessages(input.recentMessages, 15), ].join("\n")); if (input.pendingMentions.length === 0) { for (const snapshot of input.channelSnapshots) { - const label = input.channelPlan.options.find((option) => option.channelId === snapshot.channelId)?.label ?? - "nearby room"; + const option = input.channelPlan.options.find((entry) => entry.channelId === snapshot.channelId); sections.push([ - `Nearby ${label}, oldest to newest:`, + `Other visible conversation (${formatConversationChannelLabel(option, snapshot.channelId)}), oldest to newest:`, ...formatConversationMessages(snapshot.messages, 6), ].join("\n")); } @@ -4095,15 +4220,16 @@ function renderVisibleConversationChronology(input: { channelPlan: RepoPersonaChannelPlan; }): string { const byId = new Map(); - const primaryLabel = input.channelPlan.options.find((option) => + const primaryOption = input.channelPlan.options.find((option) => option.channelId === input.channelPlan.primaryChannelId - )?.label ?? "current room"; + ); + const primaryLabel = formatConversationChannelLabel(primaryOption, input.channelPlan.primaryChannelId); for (const message of input.recentMessages) { byId.set(message.id, { ...message, channelLabel: primaryLabel }); } for (const snapshot of input.channelSnapshots) { - const label = input.channelPlan.options.find((option) => option.channelId === snapshot.channelId)?.label ?? - "nearby room"; + const option = input.channelPlan.options.find((entry) => entry.channelId === snapshot.channelId); + const label = formatConversationChannelLabel(option, snapshot.channelId); for (const message of snapshot.messages) { byId.set(message.id, { ...message, channelLabel: label }); } @@ -4127,6 +4253,35 @@ function renderVisibleConversationChronology(input: { ].join("\n"); } +function renderConversationChannelDirectory(plan: RepoPersonaChannelPlan): string { + if (plan.options.length === 0) { + return "Visible conversation channels:\n- No Discord conversation channels are configured for this Persona turn."; + } + + return [ + "Visible conversation channels:", + ...plan.options.map((option) => [ + `- ${formatConversationChannelLabel(option, option.channelId)}`, + `topic: ${option.topic}`, + `threshold: ${option.speechThreshold}`, + option.posture ? `posture: ${option.posture}` : undefined, + ].filter(Boolean).join("; ")), + ].join("\n"); +} + +function formatConversationChannelLabel( + option: RepoPersonaChannelOption | undefined, + channelId: string | undefined, +): string { + if (!channelId) { + return "current room"; + } + if (!option) { + return `channel ${channelId}`; + } + return `${option.label} / ${channelId}`; +} + function renderRepoPersonaRepoActivitySurface( identity: RepoDiscordIdentity, config: ReturnType, @@ -4458,6 +4613,7 @@ function buildChannelPlan( identity: RepoDiscordIdentity, defaultChannelId?: string, preferredChannelId?: string, + contextChannelOptions: RepoPersonaChannelOption[] = [], ): RepoPersonaChannelPlan { const explicit = identity.channelPermissions.map((permission): RepoPersonaChannelOption => ({ channelId: permission.channelId, @@ -4490,11 +4646,14 @@ function buildChannelPlan( posture: "Low-stakes casual chatter, half-formed fascinations, jokes, little observations, and friendly asides are welcome here.", }] : []; - const options = [...explicit, ...legacy, ...fallback]; + const speechOptions = [...explicit, ...legacy, ...fallback]; + const speechChannelIds = new Set(speechOptions.map((option) => option.channelId)); + const contextOnly = contextChannelOptions.filter((option) => !speechChannelIds.has(option.channelId)); + const options = [...speechOptions, ...contextOnly]; const preferred = preferredChannelId ? options.find((option) => option.channelId === preferredChannelId) : undefined; - const primary = preferred ?? options + const primary = preferred ?? speechOptions .slice() .sort((left, right) => thresholdRank(left.speechThreshold) - thresholdRank(right.speechThreshold)) [0]; diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 45ad5aa..4799a38 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -392,3 +392,4 @@ {"ts":"2026-06-07T00:26:33Z","type":"implementation","status":"ok","note":"Full prompt-level Face-to-Persona audit found the remaining deprecated Face vocabulary came from the global Codex AGENTS.md injected into repo Persona prompts. Patched the global doctrine so the public/social faculty and Persona State Standard use Persona/repo Persona/public Persona terminology, then reassembled a Nibu prompt with no deprecated Face hits."} {"ts":"2026-06-07T00:28:37Z","type":"implementation","status":"ok","note":"The live private repo Persona registry still contained Nibu description text and channel posture using Face terminology. Mechanically rewrote those private registry strings to Persona terminology and reassembled Nibu's prompt; the remaining Face scan no longer reports deprecated public-agent vocabulary from the prompt."} {"ts":"2026-06-07T01:37:24Z","type":"implementation","status":"ok","note":"Moved VoidBot watchdog ownership to Odin/Idunn: GameCult Local Orchestrator no longer runs check-voidbot-operations with NotifyOwner, Idunn watches health-voidbot.cmd and can run restart-voidbot.cmd, and the first Idunn-owned VoidBot probe completed healthy with 34 passed / 0 warnings / 0 failures."} +{"ts":"2026-06-07T01:51:40Z","type":"implementation","status":"ok","note":"Repo Persona channel support is now runtime channel-aware: heartbeat prompt assembly discovers guild text channels when INDEX_ALL_CHANNELS is true (or uses INDEXED_CHANNEL_IDS), renders each as a labeled separate conversation such as #therapy/#memes, removes the five-nearby-room cap, and bot/worker Persona ingress/egress gates accept indexed/all-channel grants unless channel ids are excluded. This fixes the single-thread room model by feeding channel identity and access into the context owner instead of adding only a behavior rule."} diff --git a/state/map.yaml b/state/map.yaml index 1178ebf..dc639bd 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -99,7 +99,7 @@ accepted_design: - Druzkai is locally registered as the `Eusocial Interbeing` / Zyphos Persona with tracked avatar at `E:/Projects/Eusocial Interbeing/.voidbot/voice/druzkai.png`, tracked repo-local identity at `E:/Projects/Eusocial Interbeing/.voidbot/voice/identity.json`, and typed Persona state at `E:/Projects/Eusocial Interbeing/.voidbot/state/druzkai.cc`. The local ignored Discord identity registry has Aquarium, narrative, gamedesign, concepts, and development channel permissions plus Discord role id `1507811842670727299`, so exact-name mentions and role-addressed `<@&1507811842670727299>` mentions can both create CTB pressure. - Fensalir is locally registered as the `Fensalir` Persona with tracked avatar at `E:/Projects/Fensalir/.voidbot/voice/fensalir.png`, tracked repo-local identity at `E:/Projects/Fensalir/.voidbot/voice/identity.json`, and typed Persona state at `E:/Projects/Fensalir/.voidbot/state/fensalir.cc`. The local ignored Discord identity registry has Aquarium, development, programming, visual-effects, machine-learning, and Unity channel permissions plus Discord role id `1507811843882745876`, so exact-name mentions and role-addressed `<@&1507811843882745876>` mentions can both create CTB pressure. Fensalir is also represented in the source archive now, so home-repo activity projection can show recent runtime/renderer work instead of missing-manifest errors. - Void's moderation and direct participation remain room-wide. The swarm/repo Personas belong in the text `#aquarium` channel so lively agent traffic does not flood general; Persona role mentions, heartbeat defaults, and registered-identity posting allow-lists should target Aquarium, while Void's general moderation/herald lane stays separate. - - Repo Personas now have topic/channel speech permissions instead of one work-shaped mouth. Aquarium is the lowest-threshold general-musing lane for all Personas: casual thoughts, jokes, half-formed fascinations, and friendly asides may post there without a proposal or source dive. Domain channels are also valid when the topic matches: Nibu has Aetheria/narrative/design/concepts lanes, Aqua has music/soundtrack/synth-development lanes, Mimir has development/programming/realtime-visual lanes, and Epiphany has development/programming/agent-state lanes. The scheduler uses per-topic speed multipliers to make low-threshold lanes produce more frequent turns, while the worker still enforces the registered channel allow-list. + - Repo Personas now have topic/channel speech permissions instead of one work-shaped mouth. Aquarium is the lowest-threshold general-musing lane for all Personas: casual thoughts, jokes, half-formed fascinations, and friendly asides may post there without a proposal or source dive. Domain channels are also valid when the topic matches: Nibu has Aetheria/narrative/design/concepts lanes, Aqua has music/soundtrack/synth-development lanes, Mimir has development/programming/realtime-visual lanes, and Epiphany has development/programming/agent-state lanes. The scheduler uses per-topic speed multipliers to make low-threshold lanes produce more frequent turns. When `INDEX_ALL_CHANNELS=true` or `INDEXED_CHANNEL_IDS` names extra rooms, the heartbeat context assembler discovers those Discord text channels and renders them as separate visible conversations with channel labels/ids, including channel-local posture for vulnerable rooms such as `#therapy` and playful rooms such as `#memes`; bot ingress and worker speech gates treat indexed/all-channel runtime grants as real Persona channel access unless the channel id is explicitly excluded. - Repo Persona chatter may continue without a human actively awake, and Personas may interact with each other as real social context. The invariant is anti-repetition, not anti-agent: recent Persona posts are valid material to answer, dispute, synthesize, or fork, but they must not be sampled as rhetorical templates. If several recent posts share cadence, setup, punchline, imagery, or refrain, the next Persona should choose a different move, preserve a private thought, or ground the turn in repo/source work instead of adding another variant. - Repo Personas have a social embodiment invariant now, not just a banter permission. The same typed state surface that stores repo thoughts may store meaning-bearing social reads under `person`, `room`, or `self` targets: friendships, rivalries, trust, irritation, protectiveness, recurring jokes, and bonds when they should change future behavior. Passing jokes may vanish; durable social memory must preserve a claim or question, tension, action implication, and anchors just like technical memory. Public speech must not open with note-title formulas such as "bright bridge note" or "tiny fish sorting note"; the webhook already says who is speaking, so content should start with what that Persona wants to say to someone. - Repo Personas and Void direct lanes carry an actionable comedy/improv doctrine distilled from Dan Harmon's `Comedy Master Class` talk: humor should come from honest character reaction, status inversion, vulnerability, exposed fear, false authority, or a shared contradiction in the live room. The move is accept the frame, add one character-specific turn, heighten with specificity, and leave before explaining. Do not imitate another Persona's cadence, do not use jokes as dominance weapons, and do not retreat from banter into process talk unless process talk is the joke.