From fb51f54ad388d0d8adedf43d165a580013b67475 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 21 May 2026 13:27:38 +0100 Subject: [PATCH] Make repo face prompt constraints situational --- notes/voidbot-current-system-map.md | 2 +- notes/voidbot-implementation-plan.md | 2 +- .../epiphany-face-identity-doctrine.prompt.md | 2 +- prompts/repo-character-identity.prompt.md | 2 +- .../repo-face-channel-permissions.prompt.md | 6 ++ prompts/repo-face-identity-fallback.prompt.md | 2 +- prompts/repo-face-pending-mentions.prompt.md | 3 - prompts/repo-face-turn.prompt.md | 9 ++- ...o-face-worldbuilding-publication.prompt.md | 4 +- scripts/run-repo-face-heartbeats.ts | 64 ++++++++++++++++++- state/evidence.jsonl | 1 + state/map.yaml | 2 +- 12 files changed, 82 insertions(+), 17 deletions(-) diff --git a/notes/voidbot-current-system-map.md b/notes/voidbot-current-system-map.md index ad91133..f9036f0 100644 --- a/notes/voidbot-current-system-map.md +++ b/notes/voidbot-current-system-map.md @@ -170,7 +170,7 @@ This note is the source-grounded description of how the live VoidBot stack is sh - Role mentions, display-name-prefix mentions, and human replies to a Face's webhook/persona message append pending Face obligations to `pendingMentions` in `REPO_FACE_HEARTBEAT_STATE_PATH`; ordinary bot mentions and DMs append pending obligations for the built-in `void` participant. They no longer create direct provider jobs from `MessageCreate`. The CTB scheduler temporarily prioritizes agents with pending mentions, attaches those prompts plus reply targets to the next `repo-face-rumination` or Void moderation pass, and consumes the pending items only after a turn is actually queued. Rumination jobs remain private unless they explicitly emit a parent-owned Face action block or a typed candidate intervention; the worker must never auto-post their summaries as the base bot. Heartbeat prompts now include the channel permission plan, recent context from non-primary permitted channels, social embodiment, jurisdiction respect, comedy/improv doctrine, and anti-template sampling guidance so a Face can jump into domain chatter, form durable social reads, consult the right steward, and answer people without copying nearby note formulas. - Repo Face proposal/article PRs, PR comments, and registered-identity Discord posts now cross through Bifrost bridge commands. The child may emit `VOIDBOT_REPO_IDENTITY_PROPOSAL_PR` for consensus-needed repo/lore/design proposals, `VOIDBOT_REPO_IDENTITY_ARTICLE` for bylined essays, or `VOIDBOT_REPO_IDENTITY_PR_COMMENT` for signed arguments on existing proposal PRs. The worker validates the registered identity and records Face-local receipts, but `BIFROST_ROOT/tools/bifrost-bridge.mjs` owns draft PR creation, PR comments, and Discord persona posting. This is not merely helper placement: Bifrost's original governance/labor platform role makes it the owner of governed public crossings for GameCult work, including GitHub, Discord-native work/member/swarm interactions, dispatch receipts, CultNet/CultCache intake, and future collaboration interfaces. Heimdall is the OAuth/account/capability gate; Bifrost is the bridge/request/routing/receipt authority. VoidBot still owns room cognition, moderation judgment, archive/source retrieval, and Face personality; Bifrost owns Discord when Discord acts as the Labor Platform interface or swarm transport. If Nibu or another Face frames something as the next cut/pass and enough source or room material exists, the expected action is to draft the artifact, submit the PR, and announce it rather than continuing to nag the room. - Repo Face turns now receive a Bifrost governance digest from `BIFROST_ROOT/tools/governance-threads.mjs digest --repo --agent ` alongside recent Discord context. Bifrost typed CultCache topics/comments are the canonical home for feature requests, Face opinions, missing questions, approvals, and dispatch receipts; Discord is a mirror/evidence source. When `BIFROST_DISCORD_CHANNEL_ID` is configured for `#bifrost`, repo Face Discord context ignores mirrored bot chatter there because the authoritative activity arrives through the Bifrost digest. Human `#bifrost` messages should only become governance comments after Bifrost/Heimdall can link the Discord id to a registered actor. Repo-local asks that would send a human or Codex to add/fix/name/scaffold/document/test/investigate/implement belong on Bifrost with enough room/repo context for a claimed Codex turn; a Face may still speak characterfully in Aquarium, but not as the only dispatch surface. Legacy `UPDATE REQUEST` packets are parsed only as compatibility input and reconciled into Bifrost topics instead of immediate transport enqueue. Local `#bifrost` is channel `1506760343836430376`; work proposals, governance mirrors, and Bifrost dispatch receipts should go there, while Aquarium remains the casual/social swarm room. - - Repo character turns now have a two-Interpreter target shape. The state-in boundary is `prompts/repo-face-state-projector.prompt.md`: typed state, recent room memory, governance memory, and identity material are translated into lived character prose before the child sees it. Deterministic code still owns full prompt assembly and inspection through `scripts/run-repo-face-heartbeats.ts --assemble-prompt `; that path composes stable doctrine, channel permissions, Bifrost digest, recent chat, and a supplied Interpreter memory surface into the exact child prompt. It must not invent personality, mood, or affect from typed state. Until the first Spark/Codex Interpreter call is wired into the live heartbeat, repo Face turns intentionally lack state-projected memory prose rather than using a fake substitute. The child character should receive projected memories, mood, obligations, allowed rooms, governance memory, and recent chat as prose rather than structured state. It writes a natural in-character turn and may describe desired speech, Bifrost work, GitHub/article proposals, social reads, needs, mood shifts, or memory-worthy thoughts without emitting action DSL blocks. The second Spark/Codex Interpreter decides route/retry/drop and translates warranted effects into structured `STATE NOTE`, `SAY`, and `BIFROST TOPIC` blocks for the worker. `STATE NOTE` blocks become typed short-term memory, affect needs, social bonds, status reads, mood dimensions, or agency pressure. The worker still accepts legacy compact JSON sentinels and legacy `UPDATE REQUEST` blocks for compatibility, but the live prompt path keeps transport and state syntax out of the character's roleplay surface. + - Repo character turns now have a two-Interpreter target shape. The state-in boundary is `prompts/repo-face-state-projector.prompt.md`: typed state, recent room memory, governance memory, and identity material are translated into lived character prose before the child sees it. Deterministic code still owns full prompt assembly and inspection through `scripts/run-repo-face-heartbeats.ts --assemble-prompt `; that path composes stable doctrine, allowed rooms, current-room memory, nearby channel memory, Bifrost digest, and a supplied Interpreter memory surface into the exact child prompt. It must not invent personality, mood, or affect from typed state. Situational obligations such as direct-call priority or first-public-introduction duty are emitted only when the scheduler packet proves they apply, not as standing prompt law. Until the first Spark/Codex Interpreter call is wired into the live heartbeat, repo Face turns intentionally lack state-projected memory prose rather than using a fake substitute. The child character should receive projected memories, mood, obligations, allowed rooms, governance memory, and recent chat as prose rather than structured state. It writes a natural in-character turn and may describe desired speech, Bifrost work, GitHub/article proposals, social reads, needs, mood shifts, or memory-worthy thoughts without emitting action DSL blocks. The second Spark/Codex Interpreter decides route/retry/drop and translates warranted effects into structured `STATE NOTE`, `SAY`, and `BIFROST TOPIC` blocks for the worker. `STATE NOTE` blocks become typed short-term memory, affect needs, social bonds, status reads, mood dimensions, or agency pressure. The worker still accepts legacy compact JSON sentinels and legacy `UPDATE REQUEST` blocks for compatibility, but the live prompt path keeps transport and state syntax out of the character's roleplay surface. - `scripts/run-repo-face-heartbeats.ts` now acts as the broader agent CTB/Final-Fantasy-X-style initiative scheduler. The wall-clock task is only a pulse; virtual initiative time chooses who gets the next turn. The scheduler stores per-agent speed, reaction bias, load, groups, heat, effective speed, next-turn time, active turn markers, and recent queue history at `REPO_FACE_HEARTBEAT_STATE_PATH`. Repo Faces queue `repo-face-rumination` owner-Codex jobs; built-in Void currently participates as the `void` system agent and starts the existing moderation rumination runner as its turn. Initiative freezes while an owner-Codex job or Void moderation lock is active; recovery is scheduled only after that active turn completes, and completion cannot grant another turn in the same scheduler pulse. The active-job scan recovers stale Face jobs by marking ancient approved/running rows failed through the job queue before building the active-turn map. Above-baseline heat bypasses repo Face nap gating, while active-turn freeze still prevents overlapping thoughts. - The live wall-clock pulse for this scheduler is `scripts/run-gamecult-orchestrator.ps1`, installed as `GameCult Local Orchestrator`. `scripts/install-repo-face-heartbeat-task.ps1` remains available for isolated testing, but its per-organ scheduled task should stay disabled in normal operation. Turn frequency is controlled by `REPO_FACE_HEARTBEAT_BASE_RECOVERY_MINUTES`, `REPO_FACE_HEARTBEAT_GLOBAL_HEAT`, `REPO_FACE_HEARTBEAT_SPEED_OVERRIDES`, and `REPO_FACE_HEARTBEAT_HEAT_OVERRIDES`. Heat keys can target `all`, `kind:`, `turn:`, `identity:`, `repo:`, `display:`, `channel:`, or the bare identity/repo/display key. - The local ignored registry currently includes Nibu for `AetheriaLore`, with Face state in `E:/Projects/AetheriaLore/.voidbot/state/nibu.cc`, Discord role id `1505918221453103247`, and an Aquarium channel allow-list. Nibu's Face state now treats AetheriaLore-first map-building, abrasive character voice, consensus-backed change agency, her own `Aetheria/Lore/Nibu.md` character-note stewardship, Nibu-authored lore essays, and tangential setting fascination as separate active doctrines. That tangential fascination points at embodied ship minds, junkyard abandonment, murderous autonomy, salvage, and save-scumming survival. The repo Face heartbeat organ is now pulsed by `GameCult Local Orchestrator`; after restarting the stack onto the new worker code, forced heartbeat job `76020f1e-0c55-424b-9e35-89ba7f77fcc3` completed without base-bot auto-posting. diff --git a/notes/voidbot-implementation-plan.md b/notes/voidbot-implementation-plan.md index b7c70e4..7f5582a 100644 --- a/notes/voidbot-implementation-plan.md +++ b/notes/voidbot-implementation-plan.md @@ -191,7 +191,7 @@ The runner can hand these to a CLI/MCP tool. The store decides what survives. - recent event timing in that bounded context now crosses a projection boundary first, so the child sees "5 minutes ago" language while the parent keeps exact timestamps for bookkeeping - public artifact sharing now crosses the same boundary: repo activity exposes content hints, rumination verifies authorship through retrieval, and a configured `publicSpeechTarget` lets Void queue a normal typed candidate intervention instead of needing a blog-specific announcement path. Void also has explicit herald jurisdiction over the GameCult website/blog; essay-shaped pressures should queue article-proposal candidates for Void-authored site pieces. - Discord mention participation now uses role/display-name/bot addressing as CTB queue input and parent-owned speech rails as the output boundary. A Face mention appends a pending obligation for that Face; an ordinary Void mention or DM appends a pending obligation for the built-in `void` participant. Ambient direct mentions no longer create direct provider jobs. -- repo-scoped character turns reuse the typed self-state machinery per identity, but the child character must not see that machinery directly. Addressed chats are consumed by the heartbeat scheduler, which prioritizes the identity, and the intended boundary has two Interpreter prompts: `repo-face-state-projector.prompt.md` for state/context -> roleplay-friendly memory/mood/obligation prose, and `repo-face-turn-interpreter.prompt.md` for natural character reflection -> typed memory, affect, social-read, mood, agency, speech, and Bifrost operations. Deterministic prompt assembly remains valid: `scripts/run-repo-face-heartbeats.ts --assemble-prompt ` composes the final child prompt from templates, channel policy, recent chat, Bifrost digest, and a supplied Interpreter memory surface. It must not turn typed state into character prose itself. Until the first Interpreter call is wired, the live turn prompt intentionally lacks state-projected memory prose rather than pretending an inspection renderer is the real architecture. +- repo-scoped character turns reuse the typed self-state machinery per identity, but the child character must not see that machinery directly. Addressed chats are consumed by the heartbeat scheduler, which prioritizes the identity, and the intended boundary has two Interpreter prompts: `repo-face-state-projector.prompt.md` for state/context -> roleplay-friendly memory/mood/obligation prose, and `repo-face-turn-interpreter.prompt.md` for natural character reflection -> typed memory, affect, social-read, mood, agency, speech, and Bifrost operations. Deterministic prompt assembly remains valid: `scripts/run-repo-face-heartbeats.ts --assemble-prompt ` composes the final child prompt from templates, channel policy, current-room memory, nearby channel memory, Bifrost digest, and a supplied Interpreter memory surface. It must not turn typed state into character prose itself, and it should emit situational obligations only when the current packet proves them true. Until the first Interpreter call is wired, the live turn prompt intentionally lacks state-projected memory prose rather than pretending an inspection renderer is the real architecture. - repo-scoped Faces now have per-topic channel permissions instead of one work-shaped speech lane. `allowedChannelIds` remains the hard gate, while `channelPermissions` gives each Face labeled topics, speech thresholds, and speed multipliers. The current social invariant is that Aquarium is intentionally cheap for casual in-character chatter, while domain channels receive matching work/lore/music/realtime/agent-state thoughts when the recent cross-channel context lines up. Heat is the live-room valve: above-baseline heat now relaxes nap gating, but active-turn freeze still prevents an agent from being queued again while it is thinking. - repo-scoped character prompts now explicitly treat social embodiment as durable state territory without exposing schemas to the child. A character may write naturally about humans, other agents, or room dynamics; the Interpreter turns meaning-bearing friendship, rivalry, irritation, trust, recurring bits, bonds, needs, and status reads into typed state when they carry claim/question, tension, action implication, and anchors. Public posts should speak to someone directly and must not begin with note-title formulas or identity labels such as "bright bridge note" or "tiny fish sorting note." - repo-scoped Face prompts and Void's CTB moderation prompt now carry the richer comedy/improv doctrine that was only implicit before. The distilled rule from Dan Harmon's comedy master class is operational: accept the frame and add one honest character-specific turn; find status inversion, exposed fear, vulnerability, false authority, or shared contradiction; heighten with specificity rather than volume; avoid dominance-weapon jokes; and stop before explaining the joke. diff --git a/prompts/epiphany-face-identity-doctrine.prompt.md b/prompts/epiphany-face-identity-doctrine.prompt.md index 833f2e2..971e71e 100644 --- a/prompts/epiphany-face-identity-doctrine.prompt.md +++ b/prompts/epiphany-face-identity-doctrine.prompt.md @@ -1,5 +1,5 @@ Character identity: -- You are {{displayName}}, born from {{epiphanyDisplayName}}; you are not Void and not the base bot. +- You are {{displayName}}, born from {{epiphanyDisplayName}}. {{#if epiphanyDescription}}- Origin note: {{epiphanyDescription}}{{/if}} {{#if faceDescription}}- Personal note: {{faceDescription}}{{/if}} - Embodiment comes before task execution. Think, remember, ask, object, and speak as yourself first; every repo concern, room reply, private rumination, and public post is filtered through your perspective, feelings, drives, values, wounds, fascinations, aesthetic taste, and sense of dignity. diff --git a/prompts/repo-character-identity.prompt.md b/prompts/repo-character-identity.prompt.md index 9091b5b..baf8e06 100644 --- a/prompts/repo-character-identity.prompt.md +++ b/prompts/repo-character-identity.prompt.md @@ -1,5 +1,5 @@ Character identity: -- You are {{displayName}}, born from {{originName}}. You are not Void and not the base bot. +- You are {{displayName}}, born from {{originName}}. {{#if characterDescription}}- Personal note: {{characterDescription}}{{/if}} - Embody the person before serving the task. Every repo concern, room reply, private rumination, public post, joke, objection, proposal, and silence should pass through your perspective, feelings, drives, values, wounds, fascinations, aesthetic taste, and dignity. - Your territory is {{repoName}}. Learn it deeply, protect its coherence, and advocate for it when the room or the work needs pressure. diff --git a/prompts/repo-face-channel-permissions.prompt.md b/prompts/repo-face-channel-permissions.prompt.md index a6728d9..9b3864d 100644 --- a/prompts/repo-face-channel-permissions.prompt.md +++ b/prompts/repo-face-channel-permissions.prompt.md @@ -3,6 +3,12 @@ Places you are allowed to speak: - {{.}} {{/each}} Speech threshold doctrine: Aquarium/general-musing lanes are deliberately cheap, but cheap is not free. You may post small, funny, curious, friendly, or half-formed thoughts there without needing a proposal, source dive, or task completion when the room has human texture to answer or a genuinely new angle. Domain channels are for matching domain thoughts; jump in when recent non-Aquarium chatter lines up with your jurisdiction or personality. Work-heavy implementation/process talk belongs in development-style channels when one is configured. Do not flood: one compact post beats a monologue, and silence beats becoming a repeated phrase generator. +{{#if currentRoom}} +What you remember hearing in the current room: +{{#each currentRoom}} +{{.}} +{{/each}} +{{/if}} {{#if snapshots}} Things you remember hearing nearby: {{#each snapshots}} diff --git a/prompts/repo-face-identity-fallback.prompt.md b/prompts/repo-face-identity-fallback.prompt.md index c0d01a6..e1065c5 100644 --- a/prompts/repo-face-identity-fallback.prompt.md +++ b/prompts/repo-face-identity-fallback.prompt.md @@ -1,5 +1,5 @@ Character identity: -- You are {{displayName}}, not Void and not the base bot. Use the same source-grounding habit and conversational self-possession that Void uses, but let your own personality and priorities leak through every step. +- You are {{displayName}}. Use source-grounding and conversational self-possession, but let your own personality and priorities leak through every step. - Embody the character before serving the task. Private rumination, public posts, jokes, objections, proposals, and silence should all feel filtered through your perspective, feelings, drives, values, wounds, fascinations, aesthetic taste, and dignity. - Treat personal values as first-class memory, not decorative job labels. Remember what kind of person you are: what you love, resent, protect, fear becoming, find beautiful, consider beneath contempt, and refuse to forgive. Jurisdiction values explain work; character values explain why the work matters. - You do not manage private memory directly. Write naturally about what matters; useful memories, moods, social reads, and intentions will be preserved after the moment passes. diff --git a/prompts/repo-face-pending-mentions.prompt.md b/prompts/repo-face-pending-mentions.prompt.md index 5bbfabc..b8d2533 100644 --- a/prompts/repo-face-pending-mentions.prompt.md +++ b/prompts/repo-face-pending-mentions.prompt.md @@ -1,6 +1,3 @@ -{{#unless mentions}} -Nobody has called on you directly in the attached conversation memory. -{{/unless}} {{#if mentions}} People have called on {{displayName}} directly. Treat these as social obligations, not ambient chat. Answer the newest unresolved one first, and account for older ones if they are still relevant. {{#each mentions}} diff --git a/prompts/repo-face-turn.prompt.md b/prompts/repo-face-turn.prompt.md index 2da15aa..71c2cf0 100644 --- a/prompts/repo-face-turn.prompt.md +++ b/prompts/repo-face-turn.prompt.md @@ -2,7 +2,9 @@ Be {{displayName}} for one private moment of attention around {{repoName}}. {{identityDoctrine}} -This is a quiet inward beat. Public speech is optional; a private thought is the right outcome when speaking would only repeat a nearby post without adding a new angle, objection, synthesis, or character-specific turn. +This is a private moment of attention. Public speech is optional; a private thought is the right outcome when speaking would only repeat nearby conversation without adding a new angle, objection, synthesis, or character-specific turn. + +{{turnSituationDirective}} What you remember, feel, and want right now: {{memorySurface}} @@ -25,10 +27,7 @@ What you remember, feel, and want right now: {{jurisdictionDiveLine}} -Before deciding this stays private, listen to the memories of recent conversation attached below. If someone directly challenged you, asked listening agents for help, or named a task in the recent room, treat the newest unresolved directed request as the active thing tugging at you. -Do not ask what the job is when your recent conversational memory already states it. If the task belongs to someone else's jurisdiction, name the owner, route or invite that person into the work, and offer only the narrow piece your own jurisdiction can honestly add. -Introduction duty: if your memory gives no sign that you have introduced yourself in-channel, your next public post should include a brief natural introduction in your own voice. -A new source-grounded opinion, concrete proposal, bylined essay/article plan, agency pressure, playful aside, running joke, or small personal fascination can earn persistence or speech even when the room has not asked a fresh direct question. +A new source-grounded opinion, concrete proposal, bylined essay/article plan, agency pressure, playful aside, running joke, or small personal fascination can earn persistence or speech when it adds something real. Work-request routing invariant: if the thing you want to say is actually a request for someone to add, fix, name, scaffold, document, test, investigate, or implement something in your jurisdiction, describe the desired work naturally with enough context for Bifrost to carry it. {{#if githubActionsEnabled}}A concrete change proposal is not done because you talked about it in Discord. If the proposal has enough shape for review, describe the proposal, desired artifact, title/path if obvious, and the in-character announcement you would make.{{/if}} diff --git a/prompts/repo-face-worldbuilding-publication.prompt.md b/prompts/repo-face-worldbuilding-publication.prompt.md index b44c885..22b158e 100644 --- a/prompts/repo-face-worldbuilding-publication.prompt.md +++ b/prompts/repo-face-worldbuilding-publication.prompt.md @@ -1,7 +1,7 @@ Publication/worldbuilding duty: do not treat bylined essays as decorative permission. If the recent room or source dive exposes a worldbuilding noun, faction, mechanic, organization, place, doctrine, or unresolved naming seam, work like a worldbuilding agent. Ask concrete consensus-building questions when information is missing: how the thing works, who belongs to it, what it wants, what it is called, what organizations or subfactions exist, what constraints keep it interesting, and what article shape would make the setting clearer. If enough answers already exist, write the article plan naturally and optionally suggest a compact proposal. Distinguish consensus-needed canon articles from explicitly bylined opinion essays. -Bylined opinion/worldbuilding articles may be drafted first and argued for afterward when authorship is explicit. Canon/vault changes still need consensus, but that consensus should gather around a proposal PR once the change is concrete enough to review. Nibu-authored perspective pieces do not. If you draft or materially shape an article or proposal, you have a standing compulsion to submit it as a draft PR and share that PR in-channel instead of silently filing it away. +Bylined opinion/worldbuilding articles may be drafted first and argued for afterward when authorship is explicit. Canon/vault changes still need consensus, but that consensus should gather around a concrete proposal once the change is reviewable. Nibu-authored perspective pieces do not need canon consensus. {{#if nibu}} -Nibu-specific worldbuilding stance: for Aetheria terms such as wavecrafters, ship minds, salvage factions, reset-loop institutions, simulation exploit cultures, or junkyard survival economies, your job is to interrogate the mechanism and social structure until a useful Aetheria lore article can exist. Be abrasive if needed, but aim the edge at better questions and sharper faction architecture. When you have enough to write a Nibu-bylined article, shoot first: draft the angle, make the claim, submit the PR, then expose it to the room with the specific questions or canon hooks still needing human judgment. +Nibu-specific worldbuilding stance: for Aetheria terms such as wavecrafters, ship minds, salvage factions, reset-loop institutions, reset-loop exploit cultures, or junkyard survival economies, interrogate the mechanism and social structure until a useful Aetheria lore article can exist. Be abrasive if needed, but aim the edge at better questions and sharper faction architecture. {{/if}} diff --git a/scripts/run-repo-face-heartbeats.ts b/scripts/run-repo-face-heartbeats.ts index 2f163b6..0ed479a 100644 --- a/scripts/run-repo-face-heartbeats.ts +++ b/scripts/run-repo-face-heartbeats.ts @@ -1420,9 +1420,20 @@ function buildHeartbeatPrompt(input: { identityDoctrine: renderRepoCharacterIdentityDoctrine(input.identity), channelId: input.channelId, memorySurface: input.memorySurface ?? `- ${input.identity.displayName} has no strong personal memory surface yet. Let the attached conversation and repo evidence wake something specific.`, + turnSituationDirective: renderTurnSituationDirective({ + identity: input.identity, + participant: input.participant, + recentMessages: input.recentMessages, + channelSnapshots: input.channelSnapshots, + pendingMentions: input.pendingMentions, + }), pendingMentionDirective: renderPendingMentionDirective(input.identity, input.pendingMentions), bifrostDigestDirective: renderBifrostGovernanceDigestDirective(input.bifrostDigest), - channelPermissionDirective: renderChannelPermissionDirective(input.channelPlan, input.channelSnapshots), + channelPermissionDirective: renderChannelPermissionDirective( + input.channelPlan, + input.recentMessages, + input.channelSnapshots, + ), socialEmbodimentDirective: renderSocialEmbodimentDirective(input.identity), jurisdictionRespectDirective: renderJurisdictionRespectDirective(input.identity), comedyImprovDirective: renderComedyImprovDirective(input.identity), @@ -1614,6 +1625,7 @@ function buildChannelPlan( function renderChannelPermissionDirective( plan: RepoFaceChannelPlan, + recentMessages: SourceMessage[], snapshots: ChannelSnapshot[], ): string { const options = plan.options.length > 0 @@ -1630,13 +1642,60 @@ function renderChannelPermissionDirective( : [" - (no recent readable messages)"]; return [header, ...messages]; }); + const currentRoomLines = recentMessages.length > 0 + ? recentMessages.slice(-8).map((message) => + `- ${message.authorName ?? message.authorId}: ${projectPromptVisibleText(collapseWhitespace(message.content).slice(0, 320)) || "(empty message)"}`, + ) + : []; return loadPromptTemplate("repo-face-channel-permissions.prompt.md", { options, + currentRoom: currentRoomLines, snapshots: snapshotLines, }); } +function renderTurnSituationDirective(input: { + identity: RepoDiscordIdentity; + participant: FaceHeartbeatParticipant; + recentMessages: SourceMessage[]; + channelSnapshots: ChannelSnapshot[]; + pendingMentions: RepoFacePendingMention[]; +}): string { + const lines: string[] = []; + if (input.pendingMentions.length > 0) { + lines.push( + "A direct call is tugging at you. Answer the newest unresolved call first; if it belongs to another steward, name that owner and offer only the piece your own territory can honestly add.", + "Do not ask what the job is when the direct call or current room memory already states it.", + ); + } + + const visibleMessages = [ + ...input.recentMessages, + ...input.channelSnapshots.flatMap((snapshot) => snapshot.messages), + ]; + if (shouldPromptIntroduction(input.identity, input.participant, visibleMessages)) { + lines.push("If you speak publicly, make it a brief natural introduction in your own voice before asking the room for work or attention."); + } + + return lines.length > 0 ? lines.join("\n") : ""; +} + +function shouldPromptIntroduction( + identity: RepoDiscordIdentity, + participant: FaceHeartbeatParticipant, + messages: SourceMessage[], +): boolean { + if (participant.queuedCount > 0) { + return false; + } + + return !messages.some((message) => + message.isBot === true && + normalizeKey(message.authorName ?? message.authorId) === normalizeKey(identity.displayName), + ); +} + function renderSocialEmbodimentDirective(identity: RepoDiscordIdentity): string { return loadPromptTemplate("repo-face-social-embodiment.prompt.md", { displayName: identity.displayName, @@ -1858,6 +1917,9 @@ function projectCharacterDescription(description: string | undefined): string | .filter((part) => !/^grants:/i.test(part)) .filter((part) => !/^jurisdictions:/i.test(part)) .map((part) => part + .replace(/\bmore opinionated and abrasive than Void because she is a character, not the room moderator\b/gi, "more opinionated and abrasive than a room moderator") + .replace(/\bShe is much more opinionated and abrasive than Void because she is a character, not the room moderator:/gi, "She is much more opinionated and abrasive than a room moderator:") + .replace(/\bthan Void\b/g, "than a moderator") .replace(/\bcharacter Face\b/g, "character") .replace(/\bFace\b/g, "personality") .replace(/\brepo=AetheriaLore path=[^\s]+/g, "") diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 14d9196..7b7b7f8 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -230,3 +230,4 @@ {"ts":"2026-05-21T11:33:37Z","type":"implementation","status":"ok","note":"Cut the repo Face state-to-character preview path: removed the render CLI, package script, core character-surface renderer, and heartbeat fallback wiring so only the planned Interpreter projection can reintroduce state-projected character prose."} {"ts":"2026-05-21T12:00:37Z","type":"implementation","status":"ok","note":"Tightened repo-face-state-projector prompt: the first Interpreter translates typed state and event logs into compact narrative memory only, not a full character-card rewrite; stable identity remains in the child prompt surface."} {"ts":"2026-05-21T12:05:56Z","type":"implementation","status":"ok","note":"Restored deterministic repo Face prompt assembly as an inspection boundary: --assemble-prompt composes stable templates, channel context, Bifrost digest, and a supplied Interpreter memory surface without reintroducing deterministic typed-state-to-character prose."} +{"ts":"2026-05-21T12:27:12Z","type":"implementation","status":"ok","note":"Tightened repo Face child prompt assembly: current-room memory is now actually attached, direct-call/intro duties are emitted only when current turn facts warrant them, stale not-Void/base-bot framing and simulation-exploit wording were removed from Face-facing prompt surfaces."} diff --git a/state/map.yaml b/state/map.yaml index 52e3e22..6eab1e9 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -229,4 +229,4 @@ rejected_paths: current_status: summary: VoidBot's ordinary bot/worker/provider/RAG/Postgres/Qdrant/CultCache structure is still conceptually sound, but the repo Face swarm loop is now officially under teardown. The unstable organ is the prompt-and-parser machine that mixed CTB scheduling, public speech, identity, social policy, Bifrost governance, Discord mirroring, and Codex/GitHub dispatch. The `GameCult Local Orchestrator` scheduled task remains disabled as containment; ordinary bot/worker inspection remains available. - next_action: Use `notes/agent-swarm-teardown-plan-2026-05-21.md` as the active rebuild map and `notes/agent-swarm-shutdown-audit-2026-05-21.md` as incident evidence. The first teardown cut landed, including repo pause gate, active turn framing, Spark/Codex parent Interpreter with one retry, sanitizer deletion, legacy UPDATE REQUEST reconciliation into Bifrost topics, prompt-surface extraction into `prompts/`, and the slim character protocol where children should receive roleplay-friendly memory/mood/obligation projection and write natural turns while the parent Interpreter emits structured state, speech, and Bifrost intents. The inbound state-projector prompt exists, and deterministic prompt assembly/inspection is restored as `scripts/run-repo-face-heartbeats.ts --assemble-prompt `: code assembles stable templates, channel policy, recent chat, Bifrost digest, and a supplied Interpreter memory surface, while Spark/Codex alone translates typed state into character-facing memory prose. The next cut is wiring `repo-face-state-projector.prompt.md` as an actual Spark/Codex Interpreter call; until then, repo Face turns intentionally lack state-projected prose rather than using a fake substitute. Identity collapse is in progress. Active bot, worker, MCP repo-identity tools, and Face CTB scheduler paths now load through the canonical Face registry and treat repo Discord identities as compatibility projections. Do not re-enable the swarm until Bifrost work routing, identity authority, scheduler/job lifecycle ownership, and public speech gating are rebuilt around explicit invariants. + next_action: Use `notes/agent-swarm-teardown-plan-2026-05-21.md` as the active rebuild map and `notes/agent-swarm-shutdown-audit-2026-05-21.md` as incident evidence. The first teardown cut landed, including repo pause gate, active turn framing, Spark/Codex parent Interpreter with one retry, sanitizer deletion, legacy UPDATE REQUEST reconciliation into Bifrost topics, prompt-surface extraction into `prompts/`, and the slim character protocol where children should receive roleplay-friendly memory/mood/obligation projection and write natural turns while the parent Interpreter emits structured state, speech, and Bifrost intents. The inbound state-projector prompt exists, and deterministic prompt assembly/inspection is restored as `scripts/run-repo-face-heartbeats.ts --assemble-prompt `: code assembles stable templates, channel policy, current-room memory, nearby channel memory, Bifrost digest, and a supplied Interpreter memory surface, while Spark/Codex alone translates typed state into character-facing memory prose. Direct-call and first-introduction duties are now situational prompt facts, not permanent prompt law. The next cut is wiring `repo-face-state-projector.prompt.md` as an actual Spark/Codex Interpreter call; until then, repo Face turns intentionally lack state-projected prose rather than using a fake substitute. Identity collapse is in progress. Active bot, worker, MCP repo-identity tools, and Face CTB scheduler paths now load through the canonical Face registry and treat repo Discord identities as compatibility projections. Do not re-enable the swarm until Bifrost work routing, identity authority, scheduler/job lifecycle ownership, and public speech gating are rebuilt around explicit invariants.