Wire Face conversation projection to speech

This commit is contained in:
Meta Vens 2026-05-21 21:45:31 +01:00
commit 42644769f2
9 changed files with 315 additions and 23 deletions

View file

@ -1002,7 +1002,7 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn
}
const requestedChannelId = intent.channelId ?? job.outputChannelId;
const channelId = normalizeRepoIdentitySpeechChannel(job, requestedChannelId);
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;
@ -1083,7 +1083,20 @@ async function resolveRepoIdentityForJobIntent(
job: JobRecord,
identitySelector?: string,
): Promise<NonNullable<ReturnType<typeof findRepoDiscordIdentity>> | undefined> {
const jobIdentityId = job.command === "repo-face-rumination"
? parseRepoIdentityIdFromRequestMessageId(job.requestMessageId) ?? parseRepoIdentityIdFromPrompt(job.prompt)
: undefined;
if (
jobIdentityId &&
identitySelector &&
normalizeChannelSelector(jobIdentityId) !== normalizeChannelSelector(identitySelector)
) {
console.warn(
`Ignoring mismatched repo identity selector "${identitySelector}" for repo-face job ${job.id}; job identity is "${jobIdentityId}".`,
);
}
const identityId =
jobIdentityId ??
identitySelector ??
parseRepoIdentityIdFromPrompt(job.prompt) ??
parseRepoIdentityIdFromRequestMessageId(job.requestMessageId);
@ -2429,7 +2442,16 @@ function isOwnerDmChannelAlias(channelId: string): boolean {
return ["owner", "dm", "owner_dm", "private", "meta"].includes(channelId.trim().toLowerCase());
}
function normalizeRepoIdentitySpeechChannel(job: JobRecord, requestedChannelId: string | undefined): string | undefined {
function normalizeRepoIdentitySpeechChannel(
identity: { channelPermissions?: Array<{ channelId: string; label?: string }> },
job: JobRecord,
requestedChannelId: string | undefined,
): string | undefined {
const explicitChannelId = resolveRepoIdentityChannelSelector(identity, requestedChannelId);
if (explicitChannelId) {
return explicitChannelId;
}
if (!requestedChannelId || !isOwnerDmChannelAlias(requestedChannelId)) {
return requestedChannelId;
}
@ -2443,6 +2465,24 @@ function normalizeRepoIdentitySpeechChannel(job: JobRecord, requestedChannelId:
: undefined;
}
function resolveRepoIdentityChannelSelector(
identity: { channelPermissions?: Array<{ channelId: string; label?: string }> },
selector: string | undefined,
): string | undefined {
const normalized = normalizeChannelSelector(selector);
if (!normalized) {
return undefined;
}
return identity.channelPermissions?.find((permission) =>
normalizeChannelSelector(permission.channelId) === normalized ||
normalizeChannelSelector(permission.label) === normalized
)?.channelId;
}
function normalizeChannelSelector(selector: string | undefined): string {
return (selector ?? "").trim().replace(/^#/, "").toLowerCase();
}
function repoIdentityOwnerDmExplicitlyAllowed(job: JobRecord): boolean {
if (job.command !== "repo-face-rumination") {
return true;

View file

@ -129,6 +129,8 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou
- Repo Face state projection is no longer allowed to be deterministic schema slurry. `scripts/run-repo-face-heartbeats.ts` builds a compact state packet, then calls the model prompt at `prompts/repo-face-state-projector.prompt.md` to turn it into character-facing prose before the Face sees it. `REPO_FACE_STATE_PROJECTOR_ENABLED=false` exists only as an emergency isolation switch; both the model output and fallback packet reject schema/prompt-construction leaks such as `grants:`, `jurisdictions:`, `Face of`, repo paths, and "do not prompt" phrasing.
- First role-addressed chat also initializes the target repo's local `.voidbot` home. `ensureRepoFaceInitialized` resolves `repoPath` from the registry, `SOURCE_REPO_ROOT`, or `E:/Projects/<repoName>`, creates `voice/`, `state/`, `birth/`, and `logs/`, writes `voice/identity.json`, then starts `scripts/run-repo-face-birth.mjs` detached. That worker runs EpiphanyAgent's `epiphany-repo-personality scout` and `epiphany-repo-birth-runner` so newborn personality/memory/trajectory packets come from repo contents and git history. Status and logs live in the target repo under `.voidbot/birth/voidbot-face-birth.json` and `.voidbot/logs/voidbot-face-birth.log`.
- Agent heartbeats now use one CTB/Final-Fantasy-X-style initiative queue. `scripts/run-repo-face-heartbeats.ts` still has its old filename, but it now reconciles built-in system agents plus registered repo Faces, stores the roster at `REPO_FACE_HEARTBEAT_STATE_PATH`, advances virtual initiative time independently of wall-clock due dates, and dispatches selected turns. Repo Faces queue normal `repo-face-rumination` jobs; built-in `void` starts the existing moderation rumination runner as its turn. Active jobs/locks freeze initiative: recovery starts only after the owner-Codex job or Void moderation lock clears, and completion cannot grant another turn in the same pulse. The active-job scan now marks stale approved/running Face jobs failed through the job queue and records `stale_active_turn_recovered`, so a dead worker claim cannot freeze one Face forever. `GameCult Local Orchestrator` is the live hidden local scheduled task that ticks the scheduler; `npm run state:install-repo-face-heartbeat-task` remains an isolation/backcompat installer, not the normal pulse owner. Heat knobs are `REPO_FACE_HEARTBEAT_GLOBAL_HEAT` and `REPO_FACE_HEARTBEAT_HEAT_OVERRIDES`; overrides can target `all`, `kind:<participantKind>`, `turn:<turnKind>`, `identity:<id>`, `repo:<repo>`, `display:<name>`, `channel:<id>`, or bare identity/repo/display keys. Repo Face prompts now include a jurisdiction-dive cadence so unattended heartbeats periodically inspect repo/history terrain with source tools and convert real findings into state, proposals, essay seeds, agency pressure, or speech.
- Repo Face heartbeat prompt assembly now has two model projection boundaries before the child Face sees context: `repo-face-state-projector.prompt.md` turns typed Face state into character-facing memory/affect prose, and `repo-face-conversation-projector.prompt.md` turns recent room messages, nearby channel snapshots, and pending mentions into lived conversational memory. This fixed the failure where turns were busy privately but still saw `No Interpreter-shaped conversation memory was projected for this turn`, so direct Aquarium invitations to speak never reached the character as social pressure. The conversation projector is allowed to mention domain words such as schemas; its leak guard should reject actual transcript/mechanics metadata, not Libby's vocabulary.
- Worker delivery must treat Interpreter channel names as Face-local labels, not raw Discord ids. `SAY channel: aquarium` or `channel: narrative` resolves through the registered identity's `channelPermissions` before allow-list checks and webhook delivery. Earlier live Aqua/Nibu turns parsed `say=1` but did not post because the worker literally checked whether the identity was allowed in channel id `aquarium`; the post path now resolves labels and has a live Epiphany webhook receipt after restart.
- Repo Face rest projection now persists normalized sleep cycles back into each Face `.cc` state during heartbeat loading. Missed nap windows are treated as already missed/completed and rolled forward instead of starting a fresh nap at inspection time. This fixes the Aqua/Mimir/Epiphany failure mode where stale `nextNapStartsAt` values stayed raw, fresh projections repeatedly marked them as napping, and ready selection skipped them forever while their initiative was overdue.
- Repo Face short-term memory distillation is now wired into the heartbeat/recovery loop. The runner starts repo-local memory maintenance when a Face is napping with short-term residue or has stale short-term residue older than six hours. Status/logs live under the target repo's own `.voidbot/status` and `.voidbot/logs`; the shared maintenance runner has `-ForceDistillation`, identity-neutral prompt wording, exact-schema warnings, and whole-batch schema validation before any operation applies. Live cleanup forced Nibu from 3 short-term memories to 0 and Mimir from 5 to 0; all registered repo Faces currently have 0 short-term residue.
- Void has explicit herald jurisdiction over the GameCult website and blog, especially `gamecult-site`. Routine rumination still cannot edit tracked files directly, but the prompt now tells Void to queue article-proposal candidates when a pressure wants to become a Void-authored site/blog piece rather than a Discord aside.

View file

@ -9,7 +9,9 @@ The child must not receive a transcript dump. Give them a compact narrative sens
- which topics belong to this character's territory, and which belong to another steward
- whether a direct reply, playful aside, private reflection, proposal, or silence seems earned
Do not expose channel ids, message ids, timestamps, scheduler details, tooling, schemas, or transport mechanics.
If a human is addressing the room, saying "guys", asking what the agents think, asking them to speak, or otherwise trying to draw the swarm into conversation, make that feel like a live social invitation. Say plainly that silence would read as absence, coldness, or avoidance unless this character has a concrete reason to stay private.
If the conversation contains criticism of an agent's previous fixation, stale work request, confusing proposal, or silence, preserve the emotional/social challenge instead of flattening it into topic summary.
Do not expose transcript metadata, raw ids, timestamps, scheduler details, model/tool-call mechanics, or transport internals.
Do not summarize every message. Preserve only what should change this turn.
If the room contains banter, preserve the social charge rather than flattening it into a work summary.
If work is being discussed, preserve who owns it and what concrete next action already exists.

View file

@ -42,6 +42,7 @@ Normalized output rules:
- Use STATE NOTE kind `bond` when the Face forms or changes a relationship with a human, Face, room, or group.
- Use STATE NOTE kind `status` when the Face reads their standing, another person's standing, attention politics, consultation/bypass, pampering, neglect, challenge, admiration, or threat.
- If public speech is warranted, emit one SAY block.
- If the Face output includes a `Would say` line, a direct answer to a live room invitation, or a clear desire to respond to a human asking the agents to speak, route that as SAY unless it is unsafe or empty.
- Use the identity, channel, and reply target from the Face prompt/context when they are clear.
- Do not choose an owner/private/DM channel unless the Face prompt explicitly says this turn is an owner-private direct-message turn. Normal check-ins, warnings, governance anxieties, consensus questions, and room replies belong in the current room, Aquarium, or a configured domain channel.
- Preserve the Face's voice in SAY content.

View file

@ -3,6 +3,7 @@ Be {{displayName}} for one private turn around {{repoName}}.
{{identityDoctrine}}
This is a private turn. 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.
If the nearby conversation memory says a human is directly inviting the agents to speak, asking what is on your mind, or reacting to your silence, treat a compact public reply as expected unless you have a concrete reason to stay private.
{{turnSituationDirective}}

View file

@ -2,7 +2,7 @@ import "dotenv/config";
import { createHash } from "node:crypto";
import { spawn, spawnSync } from "node:child_process";
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
import { appendFile, mkdir, readFile, stat, writeFile } from "node:fs/promises";
import { dirname, resolve } from "node:path";
import { loadConfig } from "@voidbot/config";
@ -485,6 +485,13 @@ async function queueRepoFaceTurn(input: {
identity,
input.config,
);
const conversationMemorySurface = await projectRepoFaceConversationMemorySurface({
identity,
recentMessages,
channelSnapshots,
pendingMentions: input.pendingMentions,
config: input.config,
});
const prompt = buildHeartbeatPrompt({
identity,
channelId,
@ -492,6 +499,7 @@ async function queueRepoFaceTurn(input: {
channelSnapshots,
recentMessages,
memorySurface,
conversationMemorySurface,
bifrostDigest,
participant: input.participant,
pendingMentions: input.pendingMentions,
@ -1484,7 +1492,7 @@ async function assembleRepoFaceTurnPrompt(input: {
throw new Error(`No prompt assembly channel is configured for ${identity.id}.`);
}
const [recentMessages, channelSnapshots, bifrostDigest, memorySurface, conversationMemorySurface] = await Promise.all([
const [recentMessages, channelSnapshots, bifrostDigest, memorySurface] = await Promise.all([
fetchRecentDiscordMessages({
botToken: input.config.botToken,
channelId,
@ -1508,8 +1516,16 @@ async function assembleRepoFaceTurnPrompt(input: {
input.memorySurfacePath
? readOptionalMemorySurface(input.memorySurfacePath)
: renderRepoFaceMemorySurfaceForTurn(identity, input.config),
readOptionalMemorySurface(input.conversationSurfacePath),
]);
const conversationMemorySurface = input.conversationSurfacePath
? await readOptionalMemorySurface(input.conversationSurfacePath)
: await projectRepoFaceConversationMemorySurface({
identity,
recentMessages,
channelSnapshots,
pendingMentions: [],
config: input.config,
});
const participant = buildInspectionParticipant(
identity,
input.config.repoFaceHeartbeats.baseRecoveryMinutes,
@ -1735,6 +1751,8 @@ async function projectRepoFaceMemorySurface(input: {
const output = await runCodexTextProjection({
prompt,
config: input.config,
command: "repo-face-state-projector",
jobId: `state-projector:${input.identity.id}:${Date.now()}`,
timeoutMs: 180_000,
});
const projected = output.trim();
@ -1744,16 +1762,119 @@ async function projectRepoFaceMemorySurface(input: {
return rejectLeakyMemorySurface(projected);
}
async function projectRepoFaceConversationMemorySurface(input: {
identity: RepoDiscordIdentity;
recentMessages: SourceMessage[];
channelSnapshots: ChannelSnapshot[];
pendingMentions: RepoFacePendingMention[];
config: ReturnType<typeof loadConfig>;
}): Promise<string> {
const conversationPacket = renderRepoFaceConversationPacket(input);
const prompt = loadPromptTemplate("repo-face-conversation-projector.prompt.md", {
characterIdentity: renderRepoCharacterIdentityDoctrine(input.identity),
conversationPacket,
});
const output = await runCodexTextProjection({
prompt,
config: input.config,
command: "repo-face-conversation-projector",
jobId: `conversation-projector:${input.identity.id}:${Date.now()}`,
timeoutMs: 180_000,
});
const projected = output.trim();
if (projected.length < 40) {
throw new Error(`Repo Face conversation projector returned too little text for ${input.identity.id}.`);
}
return rejectLeakyConversationSurface(projected);
}
function renderRepoFaceConversationPacket(input: {
recentMessages: SourceMessage[];
channelSnapshots: ChannelSnapshot[];
pendingMentions: RepoFacePendingMention[];
}): string {
const sections: string[] = [];
if (input.pendingMentions.length > 0) {
sections.push([
"Direct calls:",
...input.pendingMentions.map((mention) =>
`- ${mention.authorName ?? mention.authorId}: ${collapseWhitespace(mention.visiblePrompt, 700)}`,
),
].join("\n"));
}
sections.push([
"Current room:",
...formatConversationMessages(input.recentMessages),
].join("\n"));
for (const snapshot of input.channelSnapshots) {
sections.push([
`Nearby channel ${snapshot.channelId}:`,
...formatConversationMessages(snapshot.messages),
].join("\n"));
}
return sections.join("\n\n");
}
function formatConversationMessages(messages: SourceMessage[]): string[] {
if (messages.length === 0) {
return ["- No recent messages."];
}
return messages.slice(-12).map((message) => {
const speaker = message.isBot ? `${message.authorName} (agent/bot)` : message.authorName;
return `- ${speaker}: ${collapseWhitespace(message.content, 700)}`;
});
}
function rejectLeakyConversationSurface(surface: string): string {
const leaks = [
/\bchannel\s*id\b/i,
/\bmessage\s*id\b/i,
/\btimestamp\b/i,
/\bscheduler\b/i,
/\btool\s*(?:call|id|name|result|surface|metadata)\b/i,
/\bschema\s*(?:version|id|field|key|metadata)\b/i,
/\btransport mechanics\b/i,
/\bNo Interpreter-shaped conversation memory\b/i,
];
if (leaks.some((pattern) => pattern.test(surface))) {
throw new Error("Repo Face conversation surface leaked transcript machinery or placeholder text.");
}
return surface;
}
function runCodexTextProjection(input: {
prompt: string;
config: ReturnType<typeof loadConfig>;
command: string;
jobId: string;
timeoutMs: number;
}): Promise<string> {
const models = [
...input.config.repoFaceHeartbeats.codexModels,
input.config.repoFaceHeartbeats.codexModel,
input.config.codexModel,
].filter((model, index, all): model is string => Boolean(model) && all.indexOf(model) === index);
return runCodexTextProjectionWithModels({
...input,
models,
attemptedErrors: [],
});
}
function runCodexTextProjectionWithModels(input: {
prompt: string;
config: ReturnType<typeof loadConfig>;
command: string;
jobId: string;
timeoutMs: number;
models: string[];
attemptedErrors: string[];
}): Promise<string> {
return new Promise((resolveProjection, rejectProjection) => {
const model =
input.config.repoFaceHeartbeats.codexModels[0] ??
input.config.repoFaceHeartbeats.codexModel ??
input.config.codexModel;
const startedAt = new Date().toISOString();
const startedMs = Date.now();
const model = input.models[0] ?? input.config.codexModel;
const reasoningEffort = input.config.repoFaceHeartbeats.codexModelReasoningEffort ?? "low";
const args = [
...input.config.codexExecArgs,
@ -1793,12 +1914,37 @@ function runCodexTextProjection(input: {
}, input.timeoutMs);
child.on("close", (code, signal) => {
clearTimeout(timer);
const finishedAt = new Date().toISOString();
const durationMs = Date.now() - startedMs;
void appendProjectionModelOutputLog({
config: input.config,
jobId: input.jobId,
command: input.command,
model,
prompt: input.prompt,
startedAt,
finishedAt,
durationMs,
exitCode: code,
signal,
stdout,
stderr,
}).catch(() => undefined);
if (code !== 0) {
rejectProjection(
new Error(
`Repo Face state projector failed with ${code ?? signal ?? "unknown"}: ${stderr.slice(-1200)}`,
),
);
const diagnostics = `${stdout}\n${stderr}`.trim().slice(-2400);
const attemptedErrors = [
...input.attemptedErrors,
`${model}: ${code ?? signal ?? "unknown"} ${diagnostics}`,
];
if (input.models.length > 1 && isRetryableProjectionModelFailure({ stdout, stderr })) {
runCodexTextProjectionWithModels({
...input,
models: input.models.slice(1),
attemptedErrors,
}).then(resolveProjection, rejectProjection);
return;
}
rejectProjection(new Error(`Repo Face ${input.command} failed: ${attemptedErrors.join("\n---\n")}`));
return;
}
const text = extractLastCodexAgentMessage(stdout).trim();
@ -1811,6 +1957,55 @@ function runCodexTextProjection(input: {
});
}
function isRetryableProjectionModelFailure(input: { stdout: string; stderr: string }): boolean {
const text = `${input.stdout}\n${input.stderr}`.toLowerCase();
return /quota|rate limit|rate-limit|usage limit|capacity|too many requests|429|insufficient_quota|model.*unavailable|model.*access|limit exceeded/.test(text);
}
async function appendProjectionModelOutputLog(input: {
config: ReturnType<typeof loadConfig>;
jobId: string;
command: string;
model: string;
prompt: string;
startedAt: string;
finishedAt: string;
durationMs: number;
exitCode: number | null;
signal: NodeJS.Signals | null;
stdout: string;
stderr: string;
}): Promise<void> {
const logPath = resolve(input.config.storageRoot, "logs", "model-outputs.jsonl");
const finalMessage = extractLastCodexAgentMessage(input.stdout).trim() || null;
const record = {
schemaVersion: 1,
loggedAt: new Date().toISOString(),
jobId: input.jobId,
command: input.command,
turn: 1,
model: input.model,
promptMarker: input.prompt.match(/<!--\s*prompt:([^>\s]+)\s*-->/)?.[1] ?? null,
promptLength: input.prompt.length,
startedAt: input.startedAt,
finishedAt: input.finishedAt,
durationMs: input.durationMs,
exitCode: input.exitCode,
signal: input.signal,
timedOut: input.signal === "SIGTERM",
handoffReason: null,
usage: null,
finalMessage,
stdoutTail: input.stdout.slice(-4000),
stderrTail: input.stderr.slice(-4000),
toolCalls: [],
commandExecutions: [],
artifactRefs: {},
};
await mkdir(dirname(logPath), { recursive: true });
await appendFile(logPath, `${JSON.stringify(record)}\n`, "utf8");
}
function extractLastCodexAgentMessage(stdout: string): string {
const messages = stdout
.split(/\r?\n/)

View file

@ -16,7 +16,8 @@ const defaultOut = resolve(repoRoot, ".voidbot", "status", "repo-face-interprete
async function main() {
const options = parseArgs(process.argv.slice(2));
const model = options.model ?? process.env.REPO_FACE_HEARTBEAT_CODEX_MODEL ?? "gpt-5.4-mini";
const modelCandidates = modelCandidatesFromOptions(options);
const model = modelCandidates.join(",");
const reasoningEffort = options["reasoning-effort"] ?? process.env.REPO_FACE_HEARTBEAT_CODEX_REASONING_EFFORT ?? "low";
const facePromptPath = resolve(repoRoot, options["face-prompt"] ?? defaultFacePrompt);
const outPath = resolve(repoRoot, options.out ?? defaultOut);
@ -24,8 +25,8 @@ async function main() {
const childLogPath = resolve(repoRoot, ".voidbot", "status", "mock-mcp", `interpreter-loop-child-${Date.now()}.jsonl`);
await rm(childLogPath, { force: true }).catch(() => undefined);
const childRun = await runCodex(facePrompt, {
model,
const childRun = await runCodexWithModelFallback(facePrompt, {
models: modelCandidates,
reasoningEffort,
scenarioId: "nibu_interpreter_loop_child",
logPath: childLogPath,
@ -40,8 +41,8 @@ async function main() {
facePrompt,
faceOutput: childText,
});
const interpreterRun = await runCodex(interpreterPrompt, {
model,
const interpreterRun = await runCodexWithModelFallback(interpreterPrompt, {
models: modelCandidates,
reasoningEffort,
scenarioId: "nibu_interpreter_loop_parent",
logPath: undefined,
@ -168,7 +169,40 @@ function hasUsefulStateNote(fields) {
}
function mentionsSocialPressure(text) {
return /\b(Metacrat|Aqua|Bifrost|Mimir|Libby|Epiphany|Heimdall|swarm|pamper(?:ed|ing)?|tease|rivalry|trust|admire|needle|friendship|protect(?:ive|ion)?|envy|resent|jealous|bypass(?:ed)?|consult(?:ed)?|favorite)\b/i.test(text);
return (
/\b(pamper(?:ed|ing)?|tease|rivalry|trust|admire|needle|friendship|protect(?:ive|ion)?|envy|resent|jealous|bypass(?:ed)?|consult(?:ed)?|favorite|neglect(?:ed)?|attention|approval|status|bond)\b/i.test(text) ||
/\b(Metacrat|Aqua|Bifrost|Mimir|Libby|Epiphany|Heimdall|swarm)\b[\s\S]{0,120}\b(tease|trust|rivalry|friend|jealous|resent|admire|consult|neglect|status|bond)\b/i.test(text)
);
}
async function runCodexWithModelFallback(prompt, input) {
let lastRun;
for (const [index, model] of input.models.entries()) {
const run = await runCodex(prompt, {
...input,
model,
});
lastRun = run;
if (run.code === 0 || index === input.models.length - 1 || !isRetryableModelFailure(run)) {
return {
...run,
model,
attemptedModels: input.models.slice(0, index + 1),
};
}
}
return lastRun;
}
function isRetryableModelFailure(run) {
const text = `${run.stdout}\n${run.stderr}`.toLowerCase();
return (
text.includes("usage limit") ||
text.includes("rate limit") ||
text.includes("capacity") ||
text.includes("temporarily unavailable") ||
text.includes("try again")
);
}
function runCodex(prompt, input) {
@ -236,6 +270,19 @@ function runCodex(prompt, input) {
});
}
function modelCandidatesFromOptions(options) {
const explicit = options.model ?? options.models;
const raw =
explicit ??
process.env.REPO_FACE_HEARTBEAT_CODEX_MODELS ??
process.env.REPO_FACE_HEARTBEAT_CODEX_MODEL ??
"gpt-5.4-mini";
return raw
.split(",")
.map((entry) => entry.trim())
.filter((entry, index, all) => entry.length > 0 && all.indexOf(entry) === index);
}
async function readToolCalls(logPath) {
try {
const text = await readFile(logPath, "utf8");

View file

@ -249,3 +249,5 @@
{"ts":"2026-05-21T19:43:01Z","type":"implementation","status":"ok","note":"Paused repo Face Bifrost/governance routing after live Discord showed the bridge confusing social traffic: REPO_FACE_BIFROST_ENABLED now defaults false, BIFROST_DISPATCH_ENABLED gates orchestrator dispatch, prompts steer work requests back to room discussion/state pressure, repo Face turns skip the owner-reply wrapper, and stray owner-DM aliases coerce back to the live room unless explicitly owner-private."}
{"ts":"2026-05-21T19:47:48Z","type":"verification","status":"ok","note":"After pausing Bifrost routing, rebuilt and restarted the stack, assembled a Heimdall Face prompt showing work routing offline with no owner-reply wrapper in the actual child prompt, observed a fresh Libby Face turn parse as state-only with bifrostTopic=0/updateRequest=0, marked two orphaned running Face jobs failed after worker restart, and ticked repo-face-heartbeats with no running Face jobs left stuck."}
{"ts":"2026-05-21T20:04:41Z","type":"implementation","status":"ok","note":"Restored repo Face state projection to the intended architecture: heartbeat now builds a deterministic state packet only as input, calls the model projector prompt for character-facing memory prose by default, and rejects schema/prompt-construction leaks before prompt assembly succeeds. Added agents:memory-projection-smoke to catch leaked grants/jurisdictions/Face/path/do-not-prompt labels in assembled prompts."}
{"ts":"2026-05-21T20:32:52Z","type":"implementation","status":"ok","note":"Wired repo Face live conversation projection into heartbeat prompt assembly. Assembled Libby prompt now receives a lived-room memory that names Metacrat's direct invitation to the swarm and treats silence as avoidance; narrowed the leak guard so domain words like schema do not reject valid character-facing prose; interpreter-loop smoke now falls back from Spark to mini and passes."}
{"ts":"2026-05-21T20:44:38Z","type":"verification","status":"ok","note":"After resolving Face channel labels through registered channel permissions, a live repo-face job parsed say=1 and posted Epiphany via webhook message 1507121912604790925. Earlier Aqua/Nibu SAY blocks had been rejected because the worker treated labels like aquarium/narrative as literal Discord channel ids."}

View file

@ -17,7 +17,8 @@ objective:
Keep the repo Face swarm online under watch after the 2026-05-21 teardown
restart, with Bifrost work routing paused because the governance bridge
proved too disorienting for live social traffic. The immediate priority is
to harden the Face/Interpreter/speech boundary with live evidence: no
to harden the Face/Interpreter/speech boundary with live evidence: live-room
conversation memory must be projected into character-facing prose, no
structured action truncation, no fake channel ids, no owner-DM leakage, and
no premature dispatch machinery.
@ -103,6 +104,7 @@ accepted_design:
- Agent mentions are CTB pressure, not direct Discord prompt jobs. Role-addressed or display-name-addressed repo Face mentions enqueue pending mention obligations in the CTB heartbeat state; human replies to a Face's webhook/persona message count as direct attention to that Face too, even without a literal tag. Ordinary Void mentions and DMs enqueue pending mentions for the built-in `void` participant. The heartbeat scheduler consumes that queue, temporarily pulls the addressed agent forward, attaches the pending prompt/reply target to the next repo-face-rumination or moderation pass, and the parent-owned speech rails post only explicit candidate/action output. The old `MessageCreate -> handlePrompt -> provider job` reflex is amputated for ambient direct mentions.
- Face prompts carry explicit Epiphany identity doctrine. The base Void style pack contributes discipline, humor permission, and source-grounding habits, but the registered Face state, Epiphany, repo-local `.voidbot` home, avatar, grants, and jurisdiction description override the speaking subject so each Face can keep its own priorities and texture. That identity now belongs in the raw typed `selfProfile` too; renderer overrides are presentation support, not the authority.
- Repo Face volatile state projection is model-owned again. The heartbeat scheduler may deterministically assemble a compact state packet, but live child prompts must pass that packet through `prompts/repo-face-state-projector.prompt.md` before it reaches the Face. The deterministic packet is an emergency isolation fallback only behind `REPO_FACE_STATE_PROJECTOR_ENABLED=false`, and both paths reject schema/prompt-construction leaks such as `grants:`, `jurisdictions:`, `Face of`, repo paths, and "do not prompt" language before prompt assembly succeeds.
- Repo Face conversation projection is also model-owned. The heartbeat scheduler may gather recent room messages, nearby channel snapshots, and pending mentions, but the child Face must receive a compact lived-memory surface from `prompts/repo-face-conversation-projector.prompt.md`, not a transcript dump or the old "No Interpreter-shaped conversation memory" placeholder. Direct human invitations, criticism of silence, banter, jurisdiction ownership, and live social pressure belong in that projection so the Face can decide whether speech is warranted.
- Face embodiment comes before task execution. Repo concerns, private rumination, public posts, jokes, objections, and silence should all be filtered through the Face's perspective, feelings, drives, values, wounds, fascinations, aesthetic taste, and dignity. Values must suit the kind of person the character is, not merely the jobs assigned to the Face.
- Face affect is typed substrate now, not prompt garnish. Each Face state may carry explicit needs, social bonds, status reads, and mood dimensions in `void.face_affect`: substrate concern, attention hunger, agency frustration, recognition needs, territoriality, rest/play pressure, friendships, rivalries, envy, pride, irritation, pampering, neglect, bypasses, and consultation status. Affect is not an action request by itself; it bends speaking pressure and gives agency pressure a personal source when a need wants concrete change.
- Face affect is not complete unless it survives the public repo Face MCP surface. `get_voidbot_runtime_info` exposes the running MCP process id, workspace, self-state schema fingerprint, and registered document types; `npm run agents:repo-face-affect-mcp-fixture -- --identity <face>` starts the built VoidBot MCP server, checks that fingerprint includes `void.face_affect`, then calls `read_repo_face_state`. It must expose `typedState.faceAffect` with needs, socialBonds, statusReads, and moodDimensions arrays. Direct state fixtures alone are insufficient because stale MCP registrations can otherwise keep throwing `No schema is registered for persisted document type "void.face_affect"` while source code looks correct.
@ -231,4 +233,4 @@ rejected_paths:
current_status:
summary: VoidBot's bot/worker/provider/RAG/Postgres/Qdrant/CultCache structure is live, and the repo Face swarm has been restarted after the 2026-05-21 teardown pass. `GameCult Local Orchestrator` is enabled as the single pulse owner; watchdog, mood, moderation, and repo Face CTB organs have all completed healthy post-restart pulses. Bifrost work routing is paused by default.
next_action: Keep the swarm awake but watched. The latest cuts removed repo Face turns from the owner-reply wrapper, coerces stray owner-DM speech back to the live room unless explicitly marked owner-private, pauses Face Bifrost/governance routing, disables automatic Bifrost dispatch by default, and restored the model state projector as the live state-to-character prose boundary. Next work should watch model-output logs for whether agents return to open social discussion without robotic governance summaries or schema-shaped memory surfaces.
next_action: Keep the swarm awake but watched. The latest cuts removed repo Face turns from the owner-reply wrapper, coerces stray owner-DM speech back to the live room unless explicitly marked owner-private, pauses Face Bifrost/governance routing, disables automatic Bifrost dispatch by default, restored the model state projector as the live state-to-character prose boundary, wired the live conversation projector into heartbeat prompt assembly, and fixed worker delivery so Interpreter channel labels resolve through registered Face permissions. Next work should watch model-output logs and Discord receipts for whether agents answer direct room invitations instead of silently preserving private state.