From d84052ad0a9750503718468e567ba2dae81282c5 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Thu, 28 May 2026 20:54:10 +0100 Subject: [PATCH] Add sibling speech duplicate gate --- apps/worker/src/index.ts | 235 +++++++++++++++++++++++++--- notes/fresh-workspace-handoff.md | 2 +- notes/voidbot-current-system-map.md | 2 +- state/map.yaml | 1 + 4 files changed, 212 insertions(+), 28 deletions(-) diff --git a/apps/worker/src/index.ts b/apps/worker/src/index.ts index 04e0634..a35c8d5 100644 --- a/apps/worker/src/index.ts +++ b/apps/worker/src/index.ts @@ -19,6 +19,7 @@ import { type JobQueue, loadFaceIdentityRegistry, loadSystemMessageCatalog, + loadVoidSelfStateTypedDocuments, resolveRepoFaceStatePath, type SystemMessageCatalog, } from "@voidbot/core"; @@ -433,8 +434,34 @@ async function processJob(job: JobRecord): Promise { ); } let repoIdentityPostDelivered = 0; + let repoIdentityPostRejectedDuplicate = 0; if (!proposalPrSubmitted && !prCommentSubmitted && !articlePrSubmitted) { for (const post of repoIdentityPosts.slice(0, 1)) { + const resolvedPost = await resolveRepoIdentityPostIntent(job, post); + if (!resolvedPost) { + continue; + } + const siblingDuplicate = await detectRepoFaceRecentSiblingSpeechDuplicate(job, resolvedPost); + if (siblingDuplicate) { + console.warn( + `Rejected repo identity ${resolvedPost.identity.id} speech for job ${job.id}: ${siblingDuplicate.reason}`, + ); + await auditLog.record({ + type: "repo_face.speech_rejected_recent_sibling_duplicate", + actorId: job.requester.id, + jobId: job.id, + provider: job.provider, + details: { + identityId: resolvedPost.identity.id, + channelId: resolvedPost.channelId, + reason: siblingDuplicate.reason, + duplicateReceiptKey: siblingDuplicate.receiptKey, + duplicatePreview: siblingDuplicate.preview, + }, + }); + repoIdentityPostRejectedDuplicate += 1; + continue; + } if (await postRepoIdentityIntent(job, post)) { repoIdentityPostDelivered += 1; } @@ -463,6 +490,7 @@ async function processJob(job: JobRecord): Promise { bifrostTopicSubmitted, updateRequestRoutedToBifrostTopic, ignoredGithubActionIntents, + repoIdentityPostRejectedDuplicate, reason: proposalPrSubmitted ? "repo_face_rumination_submitted_registered_identity_proposal_pr" @@ -476,6 +504,8 @@ async function processJob(job: JobRecord): Promise { ? "repo_face_rumination_routed_legacy_update_request_to_bifrost_topic" : repoIdentityPostDelivered > 0 ? "repo_face_rumination_posted_as_registered_identity" + : repoIdentityPostRejectedDuplicate > 0 + ? "repo_face_rumination_speech_rejected_recent_sibling_duplicate" : repoIdentityPosts.length > 0 ? "repo_face_rumination_speech_rejected_by_parent_interpreter" : `${job.command}_private_summary`, @@ -1112,6 +1142,13 @@ interface RepoIdentityPostIntent { replyToMessageId?: string; } +interface ResolvedRepoIdentityPostIntent { + identity: NonNullable>; + channelId: string; + content: string; + replyToMessageId?: string; +} + interface RepoIdentityStateNoteIntent { identity?: string; kind: "memory" | "need" | "bond" | "status" | "mood" | "bias" | "agency" | "doctrine"; @@ -1205,34 +1242,22 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn throw new Error("DISCORD_BOT_TOKEN is required for Bifrost to post repo identity responses."); } - const identity = await resolveRepoIdentityForJobIntent(job, intent.identity); - if (!identity) { - console.warn(`Rejected repo identity speech for job ${job.id}: could not resolve identity.`); + const resolved = await resolveRepoIdentityPostIntent(job, intent); + if (!resolved) { return false; } - - const requestedChannelId = intent.channelId ?? repoIdentityDefaultSpeechChannel(job); - const channelId = normalizeRepoIdentitySpeechChannel(identity, job, requestedChannelId); - if (!channelId) { - console.warn(`Rejected repo identity ${identity.id} speech for job ${job.id}: no Discord channel was available.`); - return false; - } - if (requestedChannelId && requestedChannelId !== channelId) { - console.warn( - `Coerced repo identity ${identity.id} speech for job ${job.id} from "${requestedChannelId}" to conversation channel ${channelId}.`, - ); - } + const { identity, channelId, content, replyToMessageId } = resolved; const sourceDocuments = await sourceArchiveRepository.listByRepo(identity.repoName).catch(() => []); - const content = resolveRepoIdentityPostArtifactLinks({ + const linkedContent = resolveRepoIdentityPostArtifactLinks({ repoName: identity.repoName, - content: intent.content.trim(), + content, documents: sourceDocuments, }); if (isOwnerDmChannelAlias(channelId)) { const dmChannelId = await openOwnerDmChannel(); const postedMessages = await postDiscordBotMessageChunks( dmChannelId, - renderRepoIdentityOwnerDm(identity, content), + renderRepoIdentityOwnerDm(identity, linkedContent), ); const lastPosted = postedMessages[postedMessages.length - 1]; if (!lastPosted) { @@ -1241,7 +1266,7 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn await recordRepoIdentityDeliveryReceipt({ identity, channelId: dmChannelId, - content, + content: linkedContent, replyToMessageId: undefined, messageId: lastPosted?.id, transport: "bot", @@ -1261,15 +1286,15 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn return false; } - if (content.length > 1900) { + if (linkedContent.length > 1900) { throw new Error( - `Repo identity ${identity.id} SAY content is too long for one Discord message (${content.length} characters).`, + `Repo identity ${identity.id} SAY content is too long for one Discord message (${linkedContent.length} characters).`, ); } - if (/\S(?:\.\.\.|\u2026)$/.test(content)) { + if (/\S(?:\.\.\.|\u2026)$/.test(linkedContent)) { throw new Error(`Repo identity ${identity.id} SAY content appears mechanically truncated.`); } - const contentFile = await writeBifrostPayloadFile(job, `${identity.id}-discord-post.md`, content); + const contentFile = await writeBifrostPayloadFile(job, `${identity.id}-discord-post.md`, linkedContent); const posted = runBifrostBridge([ "discord-post", "--channel-id", @@ -1279,7 +1304,7 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn "--persona-name", identity.displayName, ...(identity.avatarUrl ? ["--persona-avatar-url", identity.avatarUrl] : []), - ...(intent.replyToMessageId ? ["--reply-to-message-id", intent.replyToMessageId] : []), + ...(replyToMessageId ? ["--reply-to-message-id", replyToMessageId] : []), ], { retries: 1 }); if (!posted.messageId || !posted.transport) { throw new Error(`Bifrost Discord bridge returned no message receipt for job ${job.id}.`); @@ -1287,8 +1312,8 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn await recordRepoIdentityDeliveryReceipt({ identity, channelId, - content, - replyToMessageId: intent.replyToMessageId, + content: linkedContent, + replyToMessageId, messageId: posted.messageId, transport: posted.transport, }).catch((error: unknown) => { @@ -1301,6 +1326,164 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn return true; } +async function resolveRepoIdentityPostIntent( + job: JobRecord, + intent: RepoIdentityPostIntent, +): Promise { + const identity = await resolveRepoIdentityForJobIntent(job, intent.identity); + if (!identity) { + console.warn(`Rejected repo identity speech for job ${job.id}: could not resolve identity.`); + return undefined; + } + + const requestedChannelId = intent.channelId ?? repoIdentityDefaultSpeechChannel(job); + const channelId = normalizeRepoIdentitySpeechChannel(identity, job, requestedChannelId); + if (!channelId) { + console.warn(`Rejected repo identity ${identity.id} speech for job ${job.id}: no Discord channel was available.`); + return undefined; + } + if (requestedChannelId && requestedChannelId !== channelId) { + console.warn( + `Coerced repo identity ${identity.id} speech for job ${job.id} from "${requestedChannelId}" to conversation channel ${channelId}.`, + ); + } + + return { + identity, + channelId, + content: intent.content.trim(), + replyToMessageId: intent.replyToMessageId, + }; +} + +async function detectRepoFaceRecentSiblingSpeechDuplicate( + job: JobRecord, + post: ResolvedRepoIdentityPostIntent, +): Promise<{ reason: string; receiptKey?: string; preview?: string } | undefined> { + if (job.command !== "repo-face-rumination" || isOwnerDmChannelAlias(post.channelId)) { + return undefined; + } + + const registry = await loadRegisteredFaceRepoRegistry(); + const siblingIdentities = registry.identities.filter((identity) => + identity.id !== post.identity.id && + isRepoDiscordIdentityAllowedInChannel(identity, post.channelId) + ); + if (siblingIdentities.length === 0) { + return undefined; + } + + const now = Date.now(); + const recentWindowMs = 12 * 60_000; + for (const sibling of siblingIdentities) { + const statePath = resolveRepoFaceStatePath(sibling, config.storageRoot); + let receipts: Awaited>["speechReceipts"]["recentReceipts"]; + try { + const state = await loadVoidSelfStateTypedDocuments({ + canonicalPath: statePath, + identity: { + agentId: sibling.id, + publicName: sibling.displayName, + publicDescription: sibling.description, + }, + }); + receipts = state.speechReceipts.recentReceipts; + } catch (error) { + const message = error instanceof Error ? error.message : String(error); + console.warn(`Could not inspect recent sibling speech for ${sibling.id}: ${message}`); + continue; + } + + for (const receipt of receipts) { + if (receipt.channelId !== post.channelId || !receipt.preview) { + continue; + } + if (post.replyToMessageId && receipt.replyToMessageId && receipt.replyToMessageId !== post.replyToMessageId) { + continue; + } + const sentAtMs = Date.parse(receipt.sentAt); + if (!Number.isFinite(sentAtMs) || now - sentAtMs > recentWindowMs) { + continue; + } + const similarity = textJaccardSimilarity(post.content, receipt.preview); + if (similarity < 0.62) { + continue; + } + return { + reason: `recent sibling Face ${sibling.id} already posted a highly similar message in this channel (${similarity.toFixed(2)} similarity).`, + receiptKey: receipt.receiptKey, + preview: receipt.preview, + }; + } + } + + return undefined; +} + +function textJaccardSimilarity(left: string, right: string): number { + const leftTerms = new Set(speechSimilarityTerms(left)); + const rightTerms = new Set(speechSimilarityTerms(right)); + const union = new Set([...leftTerms, ...rightTerms]).size; + if (union === 0) { + return 0; + } + let intersection = 0; + for (const term of leftTerms) { + if (rightTerms.has(term)) { + intersection += 1; + } + } + return intersection / union; +} + +function speechSimilarityTerms(value: string): string[] { + return value + .toLowerCase() + .replace(/https?:\/\/\S+/g, " ") + .replace(/[`*_~]/g, "") + .replace(/[^\p{L}\p{N}\s'-]/gu, " ") + .split(/\s+/) + .map((term) => term.replace(/^[-']+|[-']+$/g, "")) + .filter((term) => term.length >= 4 && !SPEECH_DUPLICATE_STOP_WORDS.has(term)); +} + +const SPEECH_DUPLICATE_STOP_WORDS = new Set([ + "about", + "after", + "again", + "already", + "another", + "because", + "before", + "being", + "could", + "does", + "doing", + "from", + "have", + "here", + "into", + "just", + "like", + "make", + "more", + "only", + "same", + "should", + "still", + "that", + "their", + "there", + "thing", + "this", + "what", + "when", + "where", + "which", + "with", + "would", +]); + async function resolveRepoIdentityForJobIntent( job: JobRecord, identitySelector?: string, diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 3fda4ea..9afa972 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -154,7 +154,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou ## Likely Next Bounded Move -- Keep the swarm down after the explicit 2026-05-27 shutdown. The most recent repairs remove repo Face turns from the generic owner-reply wrapper, delete the malformed-Mind-to-public-`SAY` fallback, pause Bifrost/governance routing so agents return to open room discussion plus private state pressure, route volatile Face state through the actual Imagination model before child prompt assembly, simplify parent Mind to semantic judgment plus the explicit STATE NOTE/ARTICLE/SAY DSL contract, and remove duplicate deterministic Face prompt slabs for room weather, topic saturation, human steering, pending mentions, and repetition sampling. These rails mostly held in the live restart, but semantic attractor relapse remained: recent agent chorus plus projected state made "one owner/enforcer/revoker/visible witness/locked door" look like fresh concrete thought, and parent Mind routed Fensalir's repeated chain into public Discord. +- Keep the swarm down after the explicit 2026-05-27 shutdown. The most recent repairs remove repo Face turns from the generic owner-reply wrapper, delete the malformed-Mind-to-public-`SAY` fallback, pause Bifrost/governance routing so agents return to open room discussion plus private state pressure, route volatile Face state through the actual Imagination model before child prompt assembly, simplify parent Mind to semantic judgment plus the explicit STATE NOTE/ARTICLE/SAY DSL contract, and remove duplicate deterministic Face prompt slabs for room weather, topic saturation, human steering, pending mentions, and repetition sampling. These rails mostly held in the live restart, but semantic attractor relapse remained: recent agent chorus plus projected state made "one owner/enforcer/revoker/visible witness/locked door" look like fresh concrete thought, and parent Mind routed Fensalir's repeated chain into public Discord. Worker delivery now also has a final parallel-turn duplicate gate: before Bifrost/webhook posting, it compares the resolved `SAY` against recent same-channel typed speech receipts from sibling Faces and rejects highly similar posts that another parallel Face already delivered. - Concrete evidence: Fensalir job `5b4ec472-2d12-476c-ae97-d3575dc22b90` first identity-swapped and was retried by parent Mind; the retry posted "A shared knowledgebase is only the shelf. I want the specimen jar..." as message `1509252193302216749`. Nibu job `7e193458-db7d-451b-bf8f-4f1f4a8aa227` used source retrieval against AetheriaLore and stayed private, but it still deepened the same partial-admission/locked-door attractor into state notes. The repair cuts the lexical leak and the split owner: `detectRoomTopicSaturation` / `renderRepoFaceTopicSaturationFacts` are removed, semantic graph clusters expose saturation/novelty plus recent-conversation and Face-state overlap without ranked term labels, `repo-face-state-projector.prompt.md` treats semantic saturation as pressure rather than thought content, and `repo-face-turn-interpreter.prompt.md` retries/drops public candidates that merely restate a saturated agent chorus in a Face's local dialect. Verified with `npm run typecheck`, static saturation-owner guards, `npm run agents:memory-projection-smoke -- libby`, and `npm run agents:interpreter-loop-smoke`. Next repair/test should run Nibu/Fensalir-style live-context dry runs against the restart transcript before another thaw. - The 2026-05-22 live retry confirmed role/name mention obligations can wake multiple newborn Faces from one human intro. Mimir, Huginn, Weksa, and Kiko all posted through the repo identity webhook path. If a Face speaks with its name but no avatar, inspect `.voidbot/private/repo-discord-identities.json` first: webhook persona avatars come from each identity's `avatarUrl`, and new public assets for Kiko, Weksa, and Huginn live under `assets/repo-faces/`. - Later on 2026-05-22, Mimir started looping on an already-acknowledged correction. Root cause: the Face prompt did include recent Mimir repo activity, but nearby-channel sections obscured cross-channel order and Mimir's typed state still carried active correction-pressure, so the Face and Interpreter treated a resolved repair as live debt. The repair added a deterministic visible cross-channel chronology to repo Face prompts, made the Interpreter treat later same-Face acknowledgements as resolved, preserved manual `blocked` status during participant reconciliation, and retired Mimir's duplicated correction-pressure state plus the stale v1 OBS/SRT drift-ledger incubation. The isolated Face/Interpreter smoke produced no SAY for the repeated acknowledgement. diff --git a/notes/voidbot-current-system-map.md b/notes/voidbot-current-system-map.md index 8c5a37d..1265c28 100644 --- a/notes/voidbot-current-system-map.md +++ b/notes/voidbot-current-system-map.md @@ -178,7 +178,7 @@ This note is the source-grounded description of how the live VoidBot stack is sh - Role mentions, whole-message display-name 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`. Name matching is exact-token matching across the message, not only prefix matching, so a human introduction such as "Meet Kiko, Huginn and Weksa" queues all named Faces. Mention detection may happen outside regular autonomous Face chatter lanes such as general; speech still crosses the normal registered channel/action rails, and the scheduler attaches the source channel snapshot so the Face can see where the call came from. 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 parent-owned action blocks before Bifrost bridge commands. Bylined essays use the Interpreter-owned `ARTICLE` block: the Face writes naturally, the Interpreter extracts structured title/description/author/date/tags/path/body fields, and deterministic worker code renders/validates YAML frontmatter before calling `BIFROST_ROOT/tools/bifrost-bridge.mjs` for a draft PR and persona announcement. The old `VOIDBOT_REPO_IDENTITY_ARTICLE` JSON sentinel is cut. Proposal PR and PR-comment sentinels still exist as compatibility rails. 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. - 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 an Imagination plus Mind shape. The state-in boundary is `prompts/repo-face-state-projector.prompt.md`: typed state and identity material are translated into lived character prose before the child sees it. Imagination must surface values, drives, wounds, fascinations, aesthetic taste, dignity, mood, needs, social reads, bonds, agency pressure, research hints, semantic thought clusters, and the personality-specific meaning of sparse or dense social topology when the state contains those facts. The deterministic state packet feeding Imagination is intentionally verbose and parent-facing: it exposes private notes, values, activation vectors, runtime rest/speaking pressure, affect needs, bonds, status reads, mood dimensions, durable memories, short-term residue, agency pressures, incubating thoughts, candidate speech pressure, recent speech residue, social graph facts, room weather, and semantic curiosity graph attractors so every included variable can appear directly or bend behavior. The curiosity graph is built by seeding history/source vector retrieval from current room context, nearby channels, typed Face state, and home-jurisdiction identity, then decoding retrieved chunks into weighted attractor clusters with prominence, saturation, novelty, density, jurisdiction fit, suggested motion, and evidence labels. Imagination owns turning those neutral facts into lived curiosity, boredom, fatigue, territorial pull, underexplored intrigue, or a closing/pivot impulse; deterministic code must not decide the feeling. Deterministic code may also attach neutral graph facts such as mapped people and unmapped registered peers to the projector packet, but it must not decide whether that feels like anxiety, territorial scouting, or nothing. Deterministic code attaches recent read-only home-repo activity before chat, using the Face's own state path as the repo-activity cursor source, so current implementation motion is visible as body context. Current-room and nearby-channel logs no longer cross a model conversation projector; deterministic code attaches raw oldest-to-newest transcript evidence with explicit recency/correction rules so the Face can notice human reframes directly. 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, research/archive capability guidance, Bifrost digest, projected memory/affect prose, home-repo activity, live social affordances, and raw conversation evidence into the exact child prompt. It must not invent personality, mood, affect, or social memory 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. The child character writes a natural in-character turn on full `gpt-5.4` and may describe desired speech, repo/article proposals, social reads, needs, mood shifts, or memory-worthy thoughts without emitting action DSL blocks. The parent Mind prompt at `prompts/repo-face-turn-interpreter.prompt.md` also runs on capable model defaults and decides route/retry/drop, translating warranted effects into structured `STATE NOTE` and `SAY` blocks for the worker while governance dispatch remains paused. `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 an Imagination plus Mind shape. The state-in boundary is `prompts/repo-face-state-projector.prompt.md`: typed state and identity material are translated into lived character prose before the child sees it. Imagination must surface values, drives, wounds, fascinations, aesthetic taste, dignity, mood, needs, social reads, bonds, agency pressure, research hints, semantic thought clusters, and the personality-specific meaning of sparse or dense social topology when the state contains those facts. The deterministic state packet feeding Imagination is intentionally verbose and parent-facing: it exposes private notes, values, activation vectors, runtime rest/speaking pressure, affect needs, bonds, status reads, mood dimensions, durable memories, short-term residue, agency pressures, incubating thoughts, candidate speech pressure, recent speech residue, social graph facts, room weather, and semantic curiosity graph attractors so every included variable can appear directly or bend behavior. The curiosity graph is built by seeding history/source vector retrieval from current room context, nearby channels, typed Face state, and home-jurisdiction identity, then decoding retrieved chunks into weighted attractor clusters with prominence, saturation, novelty, density, jurisdiction fit, suggested motion, and evidence labels. Imagination owns turning those neutral facts into lived curiosity, boredom, fatigue, territorial pull, underexplored intrigue, or a closing/pivot impulse; deterministic code must not decide the feeling. Deterministic code may also attach neutral graph facts such as mapped people and unmapped registered peers to the projector packet, but it must not decide whether that feels like anxiety, territorial scouting, or nothing. Deterministic code attaches recent read-only home-repo activity before chat, using the Face's own state path as the repo-activity cursor source, so current implementation motion is visible as body context. Current-room and nearby-channel logs no longer cross a model conversation projector; deterministic code attaches raw oldest-to-newest transcript evidence with explicit recency/correction rules so the Face can notice human reframes directly. 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, research/archive capability guidance, Bifrost digest, projected memory/affect prose, home-repo activity, live social affordances, and raw conversation evidence into the exact child prompt. It must not invent personality, mood, affect, or social memory 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. The child character writes a natural in-character turn on full `gpt-5.4` and may describe desired speech, repo/article proposals, social reads, needs, mood shifts, or memory-worthy thoughts without emitting action DSL blocks. The parent Mind prompt at `prompts/repo-face-turn-interpreter.prompt.md` also runs on capable model defaults and decides route/retry/drop, translating warranted effects into structured `STATE NOTE` and `SAY` blocks for the worker while governance dispatch remains paused. `STATE NOTE` blocks become typed short-term memory, affect needs, social bonds, status reads, mood dimensions, or agency pressure. At delivery time, the worker resolves any `SAY` into identity/channel/content and checks recent typed speech receipts from sibling Faces allowed in that channel; a highly similar same-channel post from another parallel Face is rejected before Bifrost/webhook delivery and logged as `repo_face.speech_rejected_recent_sibling_duplicate`. 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. Repo Face speaking pressure feeds scheduler urgency: high `needToSpeak`, novelty, and confession pressure raise effective speed and can pull `nextTurnAt` closer. 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/state/map.yaml b/state/map.yaml index 56c6252..8a92c5f 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -169,6 +169,7 @@ accepted_design: - Public repo Face speech must remain in the conversation that gave it meaning unless the Face explicitly chose another registered channel. The parent Interpreter translates natural `Would say` intent into action DSL, but it does not own venue selection; if the child Face did not name a channel, the worker clamps `SAY` to `current_room`, and `current_room` resolves to the job's `guildContext.channelId` before channel allow-list checks. Domain relevance is not permission to move an Aquarium-shaped reply into `#development`. - Parent Mind speech routing must distinguish a Face's public intent from its explanation of silence. `Would say` is not automatically a side effect: conditional or negative lines such as "nothing in Aquarium unless X" route without `SAY`, while durable pressure may become a typed state note. Otherwise private restraint gets laundered into public noise. - Agreement between Faces must earn its airtime. Parent Mind should retry or drop a public `SAY` that merely restates a recent agent claim in another Face's vocabulary without adding a concrete question, ordinary-language clarification, source/repo fact, disagreement, handoff, or social move. This is the Interpreter's job because it judges the actual proposed speech after the Face has formed it; negative prompting in parent Imagination or the child Face is not enough. Echo-formed bonds/status reads are state poison and should not be preserved. + - Parallel-scheduled Face speech also has a final parent-owned duplicate gate at delivery time. The worker resolves a proposed `SAY` into identity/channel/content, inspects recent typed speech receipts from sibling Faces allowed in that channel, and rejects highly similar same-channel posts from the last short window before Bifrost/webhook delivery. This is a race-condition guard, not a language-police organ: the Face and Interpreter still own meaning, while the worker owns the last-mile fact that another parallel turn may already have said the same thing. - Parent Mind prompts should stay semantic, not scar-tissue-shaped. `prompts/repo-face-turn-interpreter.prompt.md` owns route/retry/drop judgment and the STATE NOTE/ARTICLE/SAY DSL contract, but it should not grow a checklist for every recent live failure. General ownership, context uptake, legibility, consent, and echo/correction judgment belong there; incident ledgers belong in evidence, handoff, or tests. - Imagination prompts should stay semantic, not scar-tissue-shaped. `prompts/repo-face-state-projector.prompt.md` owns translation from typed state plus raw evidence into lived character memory; deterministic code should provide facts, not regex meaning tribunals. The child Face prompt should stay small: identity, global doctrine, raw repo/conversation evidence, tool/channel affordances, projected state, and a compact writing shape. Do not re-add separate deterministic room-weather, topic-saturation, pending-mention, human-steering, repetition-sampling, or loop-vocabulary rewrite slabs unless they protect a hard transport invariant rather than interpreting language. - Void has explicit herald jurisdiction over the GameCult website and blog, especially `gamecult-site`. Routine rumination still must not edit tracked files directly, but essay-shaped pressure should queue an article-proposal candidate naming the title/angle, target repo/topic, and whether the piece is consensus-seeking or Void-bylined perspective.