From ca93f60039654abad3f4f2e4bce372849046e7da Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Fri, 22 May 2026 23:39:00 +0100 Subject: [PATCH] Keep Face pronoun guidance out of projection --- notes/fresh-workspace-handoff.md | 1 + prompts/repo-face-turn.prompt.md | 4 +++ scripts/run-repo-face-heartbeats.ts | 56 ++++++++++++++++++++++------- state/evidence.jsonl | 1 + state/map.yaml | 1 + 5 files changed, 51 insertions(+), 12 deletions(-) diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 67d7dfa..7f43668 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -132,6 +132,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - 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:`, `turn:`, `identity:`, `repo:`, `display:`, `channel:`, or bare identity/repo/display keys. Idle cooling is part of the same scheduler: if watched Discord channels have no recent human message, unprompted swarm turns are globally clamped to one dispatch per idle recovery window, defaulting to one every 30 minutes, while pending mentions still bypass the brake. 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 one model projection boundary before the child Face sees context: `repo-face-state-projector.prompt.md` turns typed Face state into character-facing memory/affect/social prose. Recent room messages, nearby channel snapshots, and pending mentions are now deterministic raw transcript sections, oldest-to-newest, with explicit recency/correction rules. The deleted conversation projector was turning evidence into mushy consensus; do not revive it. The Face model must read human corrections directly. A separate deterministic social-affordance surface connects active typed person-bonds/status reads to recent raw messages by that person, so relationship state becomes a live hook instead of private flavor text. Model ownership is split: Face turns default to full `gpt-5.4`; state projection and parent Interpreter passes use the cheaper Spark/Mini support chain. - Repo Face prompts now include read-only recent home-repo activity before Discord transcript. `scripts/run-repo-face-heartbeats.ts` calls `scripts/export-recent-repo-activity.mjs --repos --state-path --read-only --hours 96 --max-commits 5`, so Faces see current body/jurisdiction motion before reacting to room pressure. This is the fix for Mimir missing live camera-runtime work, not a downstream compensator telling it to apologize harder. +- Repo Face prompts now carry deterministic human pronoun guidance outside the model-projected state surface. The 2026-05-22 Nibu misgendering happened because Metacrat's interaction profile correctly resolved explicit `she/her`, but that fact was only inside the state packet handed to the projector, and the projector omitted it. `repo-face-turn.prompt.md` now renders `Known human pronoun guidance` near the transcript and again near the final writing instruction; the renderer also chooses evidence supporting the resolved pronoun set rather than the freshest contradictory ambient read. - 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. diff --git a/prompts/repo-face-turn.prompt.md b/prompts/repo-face-turn.prompt.md index 988d271..4fcd783 100644 --- a/prompts/repo-face-turn.prompt.md +++ b/prompts/repo-face-turn.prompt.md @@ -14,6 +14,8 @@ Recent home repo activity: Recent conversation transcript: {{conversationMemorySurface}} +{{humanPronounDirective}} + Current room weather: {{roomWeatherDirective}} @@ -59,6 +61,8 @@ Fresh projected state for this turn: What you remember, feel, and want right now: {{memorySurface}} +{{humanPronounDirective}} + Write naturally as {{displayName}}. Do not write forms, machine packets, or hidden commands. Use this friendly shape when it helps, but do not turn it into a form: diff --git a/scripts/run-repo-face-heartbeats.ts b/scripts/run-repo-face-heartbeats.ts index e343498..49366ef 100644 --- a/scripts/run-repo-face-heartbeats.ts +++ b/scripts/run-repo-face-heartbeats.ts @@ -505,16 +505,19 @@ async function queueRepoFaceTurn(input: { bifrostRoot: input.config.bifrostRoot, repoName: identity.repoName, agentIdentity: identity.id, - }) + }) : undefined; + const roomContext = { + recentMessages, + channelSnapshots, + }; + const humanPronounGuidance = await loadRepoFaceHumanPronounGuidance(input.config, roomContext); const memorySurface = await renderRepoFaceMemorySurfaceForTurn( identity, input.config, input.registryIdentities, - { - recentMessages, - channelSnapshots, - }, + roomContext, + humanPronounGuidance, ); const repoActivitySurface = renderRepoFaceRepoActivitySurface(identity, input.config); const conversationMemorySurface = renderRepoFaceConversationTranscript({ @@ -533,6 +536,7 @@ async function queueRepoFaceTurn(input: { memorySurface, repoActivitySurface, conversationMemorySurface, + humanPronounGuidance, bifrostDigest, participant: input.participant, pendingMentions: input.pendingMentions, @@ -1576,6 +1580,7 @@ function buildHeartbeatPrompt(input: { memorySurface?: string; repoActivitySurface?: string; conversationMemorySurface?: string; + humanPronounGuidance?: RepoFaceHumanPronounGuidance[]; bifrostDigest?: BifrostGovernanceDigest; participant: FaceHeartbeatParticipant; pendingMentions: RepoFacePendingMention[]; @@ -1591,6 +1596,8 @@ function buildHeartbeatPrompt(input: { memorySurface: input.memorySurface ?? `- ${input.identity.displayName} has no strong personal memory surface yet. Let the attached conversation and repo evidence wake something specific.`, repoActivitySurface: input.repoActivitySurface ?? "- No recent home repo activity was attached for this turn.", conversationMemorySurface: input.conversationMemorySurface ?? "- No recent conversation transcript was attached for this turn.", + humanPronounDirective: renderRepoFaceHumanPronounFacts(input.humanPronounGuidance ?? []) + ?? "Known human pronoun guidance:\n- No explicit human pronoun guidance is attached for this turn. Use names or neutral phrasing instead of guessing.", roomWeatherDirective: renderRepoFaceRoomWeatherDirective(input.identity, { recentMessages: input.recentMessages, channelSnapshots: input.channelSnapshots, @@ -1671,12 +1678,20 @@ async function assembleRepoFaceTurnPrompt(input: { }) : Promise.resolve(undefined), ]); + const roomContext = { + recentMessages, + channelSnapshots, + }; + const humanPronounGuidance = await loadRepoFaceHumanPronounGuidance(input.config, roomContext); const memorySurface = input.memorySurfacePath ? await readOptionalMemorySurface(input.memorySurfacePath) - : await renderRepoFaceMemorySurfaceForTurn(identity, input.config, registry.identities, { - recentMessages, - channelSnapshots, - }); + : await renderRepoFaceMemorySurfaceForTurn( + identity, + input.config, + registry.identities, + roomContext, + humanPronounGuidance, + ); const repoActivitySurface = renderRepoFaceRepoActivitySurface(identity, input.config); const conversationMemorySurface = input.conversationSurfacePath ? await readOptionalMemorySurface(input.conversationSurfacePath) @@ -1700,6 +1715,7 @@ async function assembleRepoFaceTurnPrompt(input: { memorySurface, repoActivitySurface, conversationMemorySurface, + humanPronounGuidance, bifrostDigest, participant, pendingMentions: [], @@ -1731,16 +1747,16 @@ async function renderRepoFaceMemorySurfaceForTurn( recentMessages: SourceMessage[]; channelSnapshots: ChannelSnapshot[]; }, + humanPronounGuidance?: RepoFaceHumanPronounGuidance[], ): Promise { const statePath = resolveRepoFaceStatePath(identity, config.storageRoot); const typedState = await loadVoidSelfStateTypedDocuments({ canonicalPath: statePath }); - const humanPronounGuidance = await loadRepoFaceHumanPronounGuidance(config, roomContext); const statePacket = renderRepoFaceStatePacket( identity, typedState, registryIdentities, roomContext, - humanPronounGuidance, + humanPronounGuidance ?? await loadRepoFaceHumanPronounGuidance(config, roomContext), ); if (!config.repoFaceHeartbeats.stateProjectorEnabled) { return rejectLeakyMemorySurface(statePacket); @@ -2378,7 +2394,7 @@ function repoFacePronounGuidanceFromProfile( const evidence = [...profile.pronounEvidence] .filter((entry) => entry.stance === "prefer" || entry.stance === "avoid") - .sort((left, right) => Date.parse(right.timestamp) - Date.parse(left.timestamp))[0]; + .sort((left, right) => pronounEvidenceRank(profile, right) - pronounEvidenceRank(profile, left))[0]; return { actorId, @@ -2391,6 +2407,22 @@ function repoFacePronounGuidanceFromProfile( }; } +function pronounEvidenceRank(profile: InteractionMemoryProfile, entry: InteractionMemoryProfile["pronounEvidence"][number]): number { + const sourceRank: Record = { + explicit_self_statement: 10_000, + explicit_correction: 9_000, + direct_third_party_statement: 7_000, + contextual_relational_inference: 3_000, + ambient_usage: 1_000, + }; + const resolvedSetBonus = profile.resolvedPronounSets.includes(entry.pronounSet) ? 50_000 : 0; + const stanceBonus = entry.stance === "prefer" ? 1_000 : 0; + const confidenceBonus = Math.round(entry.confidence * 100); + const timestampMs = Date.parse(entry.timestamp); + const recencyBonus = Number.isFinite(timestampMs) ? timestampMs / 10_000_000_000 : 0; + return resolvedSetBonus + (sourceRank[entry.source] ?? 0) + stanceBonus + confidenceBonus + recencyBonus; +} + function renderRepoFaceHumanPronounFacts( guidance: RepoFaceHumanPronounGuidance[], ): string | undefined { diff --git a/state/evidence.jsonl b/state/evidence.jsonl index 7d5e04a..666e52b 100644 --- a/state/evidence.jsonl +++ b/state/evidence.jsonl @@ -293,3 +293,4 @@ {"ts":"2026-05-22T22:07:51Z","type":"fix","status":"ok","note":"Added a parent Interpreter echo gate after Huginn/Libby mirrored Heimdall's bridge reply: public SAY now retries when it only restates a recent agent claim in another Face's vocabulary without new question, repo fact, disagreement, handoff, or social move. Retired Huginn's echo-formed Libby bond and bridge/status read through typed Face-state operations."} {"ts":"2026-05-22T22:09:00Z","type":"maintenance","status":"ok","note":"Retired Huginn's deleted/contextless #development delivery receipt in CultCacheTS after the echo-gate fix so the active recent-speech surface no longer treats the removed post as live context."} {"ts":"2026-05-22T22:22:23Z","type":"fix","status":"ok","note":"Repo Face CTB idle cooling is scheduler-owned: watched Discord human inactivity now clamps unprompted swarm dispatches to one per idle recovery window while pending mentions bypass the brake. Dry-run on 2026-05-22 reported recent human activity, idleCooling.active=false, and next unprompted dispatch gate in output."} +{"ts":"2026-05-22T22:37:53Z","type":"fix","status":"ok","note":"Nibu misgendered Metacrat because explicit she/her profile guidance was only fed into the repo Face state projector, and the projector omitted it from the final Face prompt. Repo Face prompts now render deterministic human pronoun guidance outside the projected memory surface, twice for salience, and pronoun evidence display prefers explicit/resolved-supporting evidence over contradictory ambient reads. Retired the bad Nibu delivery receipt from AetheriaLore typed state."} diff --git a/state/map.yaml b/state/map.yaml index 432da15..5d0921f 100644 --- a/state/map.yaml +++ b/state/map.yaml @@ -110,6 +110,7 @@ accepted_design: - Repo Face room-work fatigue is part of the input contract, not seeded banter. Deterministic prompt assembly attaches compact room-weather facts beside the raw transcript and passes the same neutral facts through the state projector packet. The projector owns translating heavy, agent-dense, repetitive, or mixed room texture into character-specific play/rest/social pressure; the Face may speak, stay private, tease, withdraw, ask a human-scale question, or keep working if that genuinely fits. The parent Interpreter must preserve unmet social/play/rest/status pressure as typed state when the Face turns the moment into another work-shaped ask without satisfying it. - Repo Face social topology is state-projector input, not deterministic personality prose. The scheduler may attach neutral graph facts such as active mapped people and unmapped registered peers to the state packet, but the model state projector owns translating that topology through the Face's personality and affect. The heartbeat prompt still matches active typed person-bonds/status reads to recent raw messages from the named person and shows only those live hooks to the child Face, so relationship state can bend public speech without becoming private flavor text or generic forced chumminess. - Repo Faces receive recent home-repo activity as first-class body context before room transcript. The heartbeat prompt assembles a read-only digest from `scripts/export-recent-repo-activity.mjs --repos --state-path --read-only`, so a Face can see current implementation motion in its own jurisdiction instead of arguing from stale private pressure. + - Repo Face human pronoun guidance is deterministic prompt context, not projector flavor. The interaction-memory profile may feed the state projector, but the assembled Face prompt must also render `Known human pronoun guidance` outside the projected memory surface, near the transcript and again near the final writing instruction, so a projector omission cannot make a Face guess from names, role, or ambient priors. Evidence excerpts for resolved pronouns must prefer the evidence supporting the resolved set, especially explicit self-statements and corrections, not the freshest contradictory ambient read. - 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 ` 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.