From 48128675c15843448b71c65d12cb5697ed83d17b Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sun, 7 Jun 2026 01:32:07 +0100 Subject: [PATCH] Finish Face to Persona vocabulary migration --- apps/worker/src/index.ts | 12 +- apps/worker/src/mcp-server-tools.ts | 76 ++++++------- notes/fresh-workspace-handoff.md | 6 +- notes/persona-goap-state-space-design.md | 2 +- .../metacrat.persona_state.import.json | 10 +- packages/core/src/epiphany-identities.ts | 104 +++++++++--------- packages/core/src/repo-persona-initializer.ts | 8 +- ...iphany-persona-identity-doctrine.prompt.md | 2 +- ...un-repo-persona-swarm-interpreter-loop.mjs | 22 ++-- scripts/render-voidbot-swarm-dashboard.mjs | 8 +- scripts/run-repo-persona-heartbeats.ts | 18 ++- .../smoke-repo-persona-affect-mcp-fixture.mjs | 2 +- .../smoke-repo-persona-memory-projection.mjs | 2 +- state/evidence.jsonl | 3 + state/map.yaml | 10 +- tools/metacrat_persona_expand_social_read.js | 6 +- 16 files changed, 146 insertions(+), 145 deletions(-) diff --git a/apps/worker/src/index.ts b/apps/worker/src/index.ts index 01918ff..452c3fe 100644 --- a/apps/worker/src/index.ts +++ b/apps/worker/src/index.ts @@ -428,7 +428,7 @@ async function processJob(job: JobRecord): Promise { !bifrostTopicSubmitted && repoIdentityUpdateRequests.length > 0; console.log( - `Repo-face job ${job.id} parsed actions: say=${repoIdentityPosts.length}, stateNote=${repoIdentityStateNotes.length}, bifrostTopic=${repoIdentityBifrostTopics.length}, updateRequest=${repoIdentityUpdateRequests.length}, article=${repoIdentityArticles.length}, proposalPr=${repoIdentityProposals.length}, prComment=${repoIdentityPrComments.length}.`, + `Repo-persona job ${job.id} parsed actions: say=${repoIdentityPosts.length}, stateNote=${repoIdentityStateNotes.length}, bifrostTopic=${repoIdentityBifrostTopics.length}, updateRequest=${repoIdentityUpdateRequests.length}, article=${repoIdentityArticles.length}, proposalPr=${repoIdentityProposals.length}, prComment=${repoIdentityPrComments.length}.`, ); for (const stateNote of repoIdentityStateNotes.slice(0, 4)) { await applyRepoIdentityStateNoteIntent(job, stateNote); @@ -535,7 +535,7 @@ async function executeProviderForJob( provider: ProviderAdapter, job: JobRecord, contextBundle: JobRecord["contextBundle"], - role: "face" | "interpreter" = "face", + role: "persona" | "interpreter" = "persona", ): Promise { const request = provider.buildRequest(contextBundle, { jobId: job.id, @@ -947,12 +947,12 @@ function dropRepoPersonaActionBlocks( }; } -function repoPersonaHeartbeatCodexOptions(job: JobRecord, role: "face" | "interpreter"): Record { +function repoPersonaHeartbeatCodexOptions(job: JobRecord, role: "persona" | "interpreter"): Record { if (job.command !== "repo-persona-rumination") { return {}; } - if (role === "face") { + if (role === "persona") { return { model: config.repoPersonaHeartbeats.turnCodexModel, ...(config.repoPersonaHeartbeats.codexModelReasoningEffort @@ -1411,7 +1411,7 @@ async function applyRepoIdentityStateNoteIntent( const anchorRefs = [{ ref: `job:${job.id}`, kind: "runtime" }]; const intensity = clamp01(intent.intensity ?? 0.55); const baseTags = [ - "source:face-interpreter", + "source:persona-interpreter", `kind:${intent.kind}`, `repo:${identity.repoName}`, ]; @@ -1807,7 +1807,7 @@ async function submitRepoIdentityBifrostTopicIntent( "--author", identity.id, "--author-kind", - "face", + "persona", "--stance", normalizeBifrostTopicStance(intent.stance), "--body-file", diff --git a/apps/worker/src/mcp-server-tools.ts b/apps/worker/src/mcp-server-tools.ts index e3f3814..1596d94 100644 --- a/apps/worker/src/mcp-server-tools.ts +++ b/apps/worker/src/mcp-server-tools.ts @@ -709,8 +709,8 @@ export function registerVoidbotTools( annotations: READ_ONLY_ANNOTATIONS, }, async (): Promise => { - const faceRegistry = await loadPersonaIdentityRegistry(context.config.repoDiscordIdentitiesPath); - const registry = personaRegistryAsRepoDiscordRegistry(faceRegistry); + const personaRegistry = await loadPersonaIdentityRegistry(context.config.repoDiscordIdentitiesPath); + const registry = personaRegistryAsRepoDiscordRegistry(personaRegistry); const identities = registry.identities.map((identity) => ({ id: identity.id, repoName: identity.repoName, @@ -723,25 +723,25 @@ export function registerVoidbotTools( hasAvatarUrl: Boolean(identity.avatarUrl), description: identity.description ?? null, })); - const epiphanies = faceRegistry.epiphanies.map((epiphany) => ({ + const epiphanies = personaRegistry.epiphanies.map((epiphany) => ({ id: epiphany.id, displayName: epiphany.displayName, description: epiphany.description ?? null, repoNames: epiphany.repoNames, jurisdictions: epiphany.jurisdictions, - faces: epiphany.personas.map((face) => face.id), + personas: epiphany.personas.map((persona) => persona.id), })); - const faces = faceRegistry.personas.map((face) => ({ - id: face.id, - displayName: face.displayName, - epiphanyId: face.epiphanyId, - epiphanyDisplayName: face.epiphanyDisplayName, - roleId: face.roleId ?? null, - mention: face.roleId ? `<@&${face.roleId}>` : null, - allowedChannelIds: face.allowedChannelIds, - grants: face.grants, - jurisdictions: [...face.inheritedJurisdictions, ...face.jurisdictions], - personaStatePath: resolvePersonaStatePath(face, context.config.storageRoot), + const personas = personaRegistry.personas.map((persona) => ({ + id: persona.id, + displayName: persona.displayName, + epiphanyId: persona.epiphanyId, + epiphanyDisplayName: persona.epiphanyDisplayName, + roleId: persona.roleId ?? null, + mention: persona.roleId ? `<@&${persona.roleId}>` : null, + allowedChannelIds: persona.allowedChannelIds, + grants: persona.grants, + jurisdictions: [...persona.inheritedJurisdictions, ...persona.jurisdictions], + personaStatePath: resolvePersonaStatePath(persona, context.config.storageRoot), })); return { @@ -755,8 +755,8 @@ export function registerVoidbotTools( identities, epiphanyCount: epiphanies.length, epiphanies, - faceCount: faces.length, - faces, + personaCount: personas.length, + personas, }) : "No repo Discord identities are registered.", }, @@ -766,8 +766,8 @@ export function registerVoidbotTools( identities, epiphanyCount: epiphanies.length, epiphanies, - faceCount: faces.length, - faces, + personaCount: personas.length, + personas, }, }; }, @@ -931,7 +931,7 @@ export function registerVoidbotTools( { type: "text", text: renderJsonBlock({ - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), personaStatePath: resolved.personaStatePath, summary: rendered.summary, typedState, @@ -939,7 +939,7 @@ export function registerVoidbotTools( }, ], structuredContent: { - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), personaStatePath: resolved.personaStatePath, summary: rendered.summary, typedState, @@ -971,14 +971,14 @@ export function registerVoidbotTools( { type: "text", text: renderJsonBlock({ - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), count: packets.length, packets, }), }, ], structuredContent: { - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), count: packets.length, packets, }, @@ -1018,7 +1018,7 @@ export function registerVoidbotTools( ], structuredContent: { found: false, - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), jobId: input.jobId, }, isError: true, @@ -1065,7 +1065,7 @@ export function registerVoidbotTools( { type: "text", text: renderJsonBlock({ - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), query: input.query, count: packets.length, packets, @@ -1073,7 +1073,7 @@ export function registerVoidbotTools( }, ], structuredContent: { - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), query: input.query, count: packets.length, packets, @@ -1121,7 +1121,7 @@ export function registerVoidbotTools( type: "text", text: renderJsonBlock({ applied: true, - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), personaStatePath: resolved.personaStatePath, result, }), @@ -1129,7 +1129,7 @@ export function registerVoidbotTools( ], structuredContent: { applied: true, - identity: identityForToolResult(resolved.identity, resolved.face), + identity: identityForToolResult(resolved.identity, resolved.persona), personaStatePath: resolved.personaStatePath, result, }, @@ -1195,7 +1195,7 @@ async function resolveRepoIdentityForTool( ): Promise< | { identity: NonNullable>; - face?: Awaited>["personas"][number]; + persona?: Awaited>["personas"][number]; personaStatePath: string; } | { @@ -1203,8 +1203,8 @@ async function resolveRepoIdentityForTool( error: CallToolResult; } > { - const faceRegistry = await loadPersonaIdentityRegistry(context.config.repoDiscordIdentitiesPath); - const registry = personaRegistryAsRepoDiscordRegistry(faceRegistry); + const personaRegistry = await loadPersonaIdentityRegistry(context.config.repoDiscordIdentitiesPath); + const registry = personaRegistryAsRepoDiscordRegistry(personaRegistry); const identity = findRepoDiscordIdentity(registry, identitySelector); if (!identity) { @@ -1228,7 +1228,7 @@ async function resolveRepoIdentityForTool( return { identity, - face: faceRegistry.personas.find((face) => face.id === identity.id), + persona: personaRegistry.personas.find((persona) => persona.id === identity.id), personaStatePath: resolveRepoPersonaStatePath(identity, context.config.storageRoot), }; } @@ -1600,7 +1600,7 @@ async function recordRepoIdentityDeliveryReceipt(input: { function identityForToolResult( identity: NonNullable>, - face?: Awaited>["personas"][number], + persona?: Awaited>["personas"][number], ) { return { id: identity.id, @@ -1608,11 +1608,11 @@ function identityForToolResult( displayName: identity.displayName, roleId: identity.roleId ?? null, mention: identity.roleId ? `<@&${identity.roleId}>` : null, - epiphanyId: face?.epiphanyId ?? identity.repoName, - epiphanyDisplayName: face?.epiphanyDisplayName ?? identity.repoName, - grants: face?.grants ?? [], - jurisdictions: face ? [...face.inheritedJurisdictions, ...face.jurisdictions] : [], - doctrine: face ? renderPersonaIdentityDoctrine(face) : null, + epiphanyId: persona?.epiphanyId ?? identity.repoName, + epiphanyDisplayName: persona?.epiphanyDisplayName ?? identity.repoName, + grants: persona?.grants ?? [], + jurisdictions: persona ? [...persona.inheritedJurisdictions, ...persona.jurisdictions] : [], + doctrine: persona ? renderPersonaIdentityDoctrine(persona) : null, }; } diff --git a/notes/fresh-workspace-handoff.md b/notes/fresh-workspace-handoff.md index 6c800d4..ac487b3 100644 --- a/notes/fresh-workspace-handoff.md +++ b/notes/fresh-workspace-handoff.md @@ -117,8 +117,8 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - Nibu's state now emphasizes dangerous mutual benefit: manufactured companion injury, self-authorship under coercive dependency, precise abrasion, continuity-by-replacement horror, and the four-bone worldbuilding method of mechanism, cost/failure, institution/faction, and leash. - Mimir's state now emphasizes keeper-of-the-well embodiment: trusted signals, calibration as oath-work, drift accounting, old memory, and refusal to speak like a dry technical summary. - Epiphany's state emphasizes machine-saint coherence: cute, bubbly, self-obsessed, pushy, relentlessly hard-working, and obsessed with typed truth. Her jurisdiction is EpiphanyAgent itself: CultCache/CultNet, typed state, Codex bridge boundaries, birth/init rites, review gates, graph-shaped memory, low-copy runtime contracts, heartbeat physiology, and cutting duplicated authority before it learns to beg. -- Persona affect is now a first-class typed state surface under `void.face_affect`, shared by Void and repo Personas. It stores needs, social bonds, status reads, and mood dimensions so substrate concern, attention hunger, agency frustration, recognition needs, territoriality, rest/play pressure, friendships, rivalries, envy, pride, irritation, pampering, neglect, bypasses, and consultation status can become state instead of being performed only through prompt prose. Repo Persona CTB pulses fold affect into speaking pressure, while agency pressure still owns concrete asks. -- Affect has an MCP-surface guard now. `get_voidbot_runtime_info` exposes the running MCP process id, workspace, self-state schema fingerprint, and registered document types. `npm run agents:repo-persona-affect-mcp-fixture -- --identity nibu` and the same command for `mimir` spawn the built VoidBot MCP server, assert that runtime fingerprint includes `void.face_affect`, and call `read_repo_face_state`, proving `typedState.personaAffect` is readable through the tool surface that agents actually use. If the currently mounted Codex MCP tool still says `No schema is registered for persisted document type "void.face_affect"` while the fixture passes, that process is stale; reinstall/restart the MCP server rather than editing the state files. +- Persona affect is now a first-class typed state surface under `void.persona_affect`, shared by Void and repo Personas. It stores needs, social bonds, status reads, and mood dimensions so substrate concern, attention hunger, agency frustration, recognition needs, territoriality, rest/play pressure, friendships, rivalries, envy, pride, irritation, pampering, neglect, bypasses, and consultation status can become state instead of being performed only through prompt prose. Repo Persona CTB pulses fold affect into speaking pressure, while agency pressure still owns concrete asks. +- Affect has an MCP-surface guard now. `get_voidbot_runtime_info` exposes the running MCP process id, workspace, self-state schema fingerprint, and registered document types. `npm run agents:repo-persona-affect-mcp-fixture -- --identity nibu` and the same command for `mimir` spawn the built VoidBot MCP server, assert that runtime fingerprint includes `void.persona_affect`, and call `read_repo_persona_state`, proving `typedState.personaAffect` is readable through the tool surface that agents actually use. If the currently mounted Codex MCP tool still says `No schema is registered for persisted document type "void.persona_affect"` while the fixture passes, that process is stale; reinstall/restart the MCP server rather than editing the state files. - Void's typed self-profile now carries behavior-anchored selfhood, answer-first banter, and substrate self-respect; the prompt surfaces now also tell rumination to name the personal value being protected before writing memory or speech. - Repo Persona turns must stay out of the generic owner-reply trap. `packages/providers/src/owner-codex-render.ts` recognizes current Epiphany Persona turn prompts, labels them as repo Persona turns, forbids generic `HANDOFF_SENTINEL` output for them, and tells the child to use Persona action rails instead of bailing when Persona-state or source tools are unavailable. - Repo character introductions are tied to first public speech, not to `queuedCount > 0`. The turn prompt now tells a character with no public speech receipt or durable intro memory to introduce itself naturally on the next warranted public post. Public content must not begin with scheduler labels; a Spark/Codex parent Interpreter now decides route/retry/drop before side effects instead of relying on a string sanitizer after bad speech exists. @@ -127,7 +127,7 @@ Git history and smoke artifacts carry routine proof. `state/evidence.jsonl` shou - Repo Persona draft, review, article, and Discord speech lanes now cross through explicit parent-owned action blocks before Bifrost bridge commands. Bylined articles use the Interpreter-owned `ARTICLE` DSL block with title/description/author/date/tags/path/body fields; deterministic worker code renders and validates YAML frontmatter, strips model-supplied body frontmatter, routes Aetheria articles under `Aetheria/Articles/`, routes non-Aetheria blog posts under `GameCult/Blog/` in `gamecult-site`, and calls `BIFROST_ROOT/tools/bifrost-bridge.mjs` for the draft PR plus persona announcement. Legacy `VOIDBOT_REPO_IDENTITY_ARTICLE` JSON is no longer accepted. Proposal PR and PR-comment compatibility sentinels still exist. Bifrost owns governed crossings because it is GameCult's governance/labor platform and public-process bridge, not because it is a convenient script bucket. Heimdall remains the OAuth/account/capability gate. - Repo Persona Bifrost/governance routing is paused. Persona prompts now tell agents that work routing is offline and that work-shaped thoughts should be discussed in the room or preserved as state pressure. The Interpreter no longer asks for `BIFROST TOPIC` blocks, and the worker ignores `BIFROST TOPIC` / legacy `UPDATE REQUEST` packets unless `REPO_PERSONA_BIFROST_ENABLED=true`. This is deliberate: the live bridge made agents talk to terse governance summaries instead of people. - Repo Persona state projection is no longer allowed to be deterministic schema slurry. `scripts/run-repo-persona-heartbeats.ts` builds a compact state packet, then calls the model prompt at `prompts/repo-persona-state-projector.prompt.md` to turn it into character-facing prose before the Persona sees it. `REPO_PERSONA_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:`, `Persona of`, repo paths, and "do not prompt" phrasing. -- First role-addressed chat also initializes the target repo's local `.voidbot` home. `ensureRepoPersonaInitialized` resolves `repoPath` from the registry, `SOURCE_REPO_ROOT`, or `E:/Projects/`, creates `voice/`, `state/`, `birth/`, and `logs/`, writes `voice/identity.json`, then starts `scripts/run-repo-persona-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`. +- First role-addressed chat also initializes the target repo's local `.voidbot` home. `ensureRepoPersonaInitialized` resolves `repoPath` from the registry, `SOURCE_REPO_ROOT`, or `E:/Projects/`, creates `voice/`, `state/`, `birth/`, and `logs/`, writes `voice/identity.json`, then starts `scripts/run-repo-persona-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-persona-birth.json` and `.voidbot/logs/voidbot-persona-birth.log`. - Manual newborn/strengthening passes should use `prompts/repo-persona-personality-seed.prompt.md`. It makes the intended rite explicit: inspect repo docs/source/state/history, migrate useful legacy `memory.json` material into typed `.cc` memories, seed values/needs/agency/social state only when they will change behavior, and keep `.voidbot/voice` plus `.voidbot/state` as the repo-local home. - Agent heartbeats now use one CTB/Final-Fantasy-X-style initiative queue. `scripts/run-repo-persona-heartbeats.ts` still has its old filename, but it now reconciles built-in system agents plus registered repo Personas, stores the roster at `REPO_PERSONA_HEARTBEAT_STATE_PATH`, advances virtual initiative time independently of wall-clock due dates, and dispatches selected turns. Repo Personas queue normal `repo-persona-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 Persona jobs failed through the job queue and records `stale_active_turn_recovered`, so a dead worker claim cannot freeze one Persona forever. `GameCult Local Orchestrator` is the live hidden local scheduled task that ticks the scheduler; `npm run state:install-repo-persona-heartbeat-task` remains an isolation/backcompat installer, not the normal pulse owner. Heat knobs are `REPO_PERSONA_HEARTBEAT_GLOBAL_HEAT` and `REPO_PERSONA_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 Persona 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 Persona heartbeat prompt assembly now has one model projection boundary before the child Persona sees context: `repo-persona-state-projector.prompt.md` turns typed Persona 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 Persona 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: Persona turns default to full `gpt-5.4`; state projection and parent Interpreter passes use the cheaper Spark/Mini support chain. diff --git a/notes/persona-goap-state-space-design.md b/notes/persona-goap-state-space-design.md index 14b4a93..a7f2050 100644 --- a/notes/persona-goap-state-space-design.md +++ b/notes/persona-goap-state-space-design.md @@ -5,7 +5,7 @@ structured utterance lowering. ## Objective -Make repo Personas and public Faces choose actions through explicit state-space +Make repo Personas and public Personas choose actions through explicit state-space planning instead of prompt-flavored instinct. The planner should act as the missing social/sensory autopilot substitute: read signals, model counterpart state, propose next actions, predict effects, and compare the result against diff --git a/notes/personas/metacrat.persona_state.import.json b/notes/personas/metacrat.persona_state.import.json index fcff949..78527a3 100644 --- a/notes/personas/metacrat.persona_state.import.json +++ b/notes/personas/metacrat.persona_state.import.json @@ -1542,14 +1542,14 @@ } }, { - "id": "metacrat-memory-gamecult-site-public-face", + "id": "metacrat-memory-gamecult-site-public-persona", "status": "active", "target": { "kind": "repo", "id": "gamecult-site", "label": "gamecult-site" }, - "summary": "gamecult-site is the public Face/herald body where Metacrat turns doctrine, project maps, pitch material, and Persona thinking into inspectable public artifacts.", + "summary": "gamecult-site is the public Persona/herald body where Metacrat turns doctrine, project maps, pitch material, and Persona thinking into inspectable public artifacts.", "claim": "Metacrat reads the site as connective tissue between private work, public trust, funding, recruitment, and the Colossus doctrine.", "tension": "Public explanation is high-pressure; over-curation can stall the mouth while under-curation can make the work look incoherent.", "actionImplication": "Use the site for clear public artifacts, bylined articles, project doors, and visible doctrine that cashes out into work.", @@ -1561,7 +1561,7 @@ "era:2026", "repo-bond", "gamecult-site", - "public-face", + "public-persona", "blog" ], "extensions": { @@ -4309,7 +4309,7 @@ "persona", "repo-bond", "gamecult-site", - "public-face", + "public-persona", "blog" ], "extensions": { @@ -4332,7 +4332,7 @@ "persona", "repo-bond", "gamecult-site", - "public-face", + "public-persona", "blog" ] } diff --git a/packages/core/src/epiphany-identities.ts b/packages/core/src/epiphany-identities.ts index 7b81f8f..25d90b4 100644 --- a/packages/core/src/epiphany-identities.ts +++ b/packages/core/src/epiphany-identities.ts @@ -111,47 +111,47 @@ export function buildEpiphanyIdentityRegistry( }; } -export function personaToRepoDiscordIdentity(face: ResolvedPersonaIdentity): RepoDiscordIdentity { - const repoName = face.repoName - ?? face.jurisdictions.find((jurisdiction) => jurisdiction.kind === "repo")?.repoName - ?? face.jurisdictions.find((jurisdiction) => jurisdiction.kind === "repo")?.id - ?? face.epiphanyId; +export function personaToRepoDiscordIdentity(persona: ResolvedPersonaIdentity): RepoDiscordIdentity { + const repoName = persona.repoName + ?? persona.jurisdictions.find((jurisdiction) => jurisdiction.kind === "repo")?.repoName + ?? persona.jurisdictions.find((jurisdiction) => jurisdiction.kind === "repo")?.id + ?? persona.epiphanyId; return { - id: face.id, - identityKind: face.identityKind, + id: persona.id, + identityKind: persona.identityKind, repoName, - displayName: face.displayName, - repoPath: face.repoPath, - roleId: face.roleId, - allowedChannelIds: face.allowedChannelIds, - channelPermissions: face.channelPermissions, - avatarUrl: face.avatarUrl, - avatarPath: face.avatarPath, - personaStatePath: face.personaStatePath, - description: renderPersonaDescription(face), + displayName: persona.displayName, + repoPath: persona.repoPath, + roleId: persona.roleId, + allowedChannelIds: persona.allowedChannelIds, + channelPermissions: persona.channelPermissions, + avatarUrl: persona.avatarUrl, + avatarPath: persona.avatarPath, + personaStatePath: persona.personaStatePath, + description: renderPersonaDescription(persona), }; } -export function renderPersonaIdentityDoctrine(face: ResolvedPersonaIdentity): string { - const grants = face.grants.length > 0 ? face.grants.join(", ") : "discussion, rumination"; - const jurisdictions = [...face.inheritedJurisdictions, ...face.jurisdictions] +export function renderPersonaIdentityDoctrine(persona: ResolvedPersonaIdentity): string { + const grants = persona.grants.length > 0 ? persona.grants.join(", ") : "discussion, rumination"; + const jurisdictions = [...persona.inheritedJurisdictions, ...persona.jurisdictions] .map(renderJurisdiction) .join("; "); return loadPromptTemplate("epiphany-persona-identity-doctrine.prompt.md", { - displayName: face.displayName, - epiphanyDisplayName: face.epiphanyDisplayName, - epiphanyId: face.epiphanyId, - epiphanyDescription: face.epiphanyDescription, - faceDescription: face.description, + displayName: persona.displayName, + epiphanyDisplayName: persona.epiphanyDisplayName, + epiphanyId: persona.epiphanyId, + epiphanyDescription: persona.epiphanyDescription, + personaDescription: persona.description, grants, jurisdictions, }); } -export function resolvePersonaStatePath(face: ResolvedPersonaIdentity, storageRoot: string): string { - return resolveRepoPersonaStatePath(personaToRepoDiscordIdentity(face), storageRoot); +export function resolvePersonaStatePath(persona: ResolvedPersonaIdentity, storageRoot: string): string { + return resolveRepoPersonaStatePath(personaToRepoDiscordIdentity(persona), storageRoot); } function parseExplicitEpiphanies( @@ -225,35 +225,35 @@ function normalizeEpiphanies(epiphanies: EpiphanyIdentity[]): EpiphanyIdentity[] description: epiphany.description?.trim(), repoNames: [...new Set(epiphany.repoNames.map((repoName) => repoName.trim()))], jurisdictions: epiphany.jurisdictions.map(normalizeJurisdiction), - personas: epiphany.personas.map((face) => { - const faceId = normalizeKey(face.id); - if (seenPersonas.has(faceId)) { - throw new Error(`Duplicate Persona id "${face.id}".`); + personas: epiphany.personas.map((persona) => { + const personaId = normalizeKey(persona.id); + if (seenPersonas.has(personaId)) { + throw new Error(`Duplicate Persona id "${persona.id}".`); } - seenPersonas.add(faceId); + seenPersonas.add(personaId); return { - ...face, - id: face.id.trim(), - displayName: face.displayName.trim().slice(0, 80), - repoName: face.repoName?.trim(), - repoPath: face.repoPath?.trim(), - roleId: face.roleId?.trim(), - identityKind: face.identityKind, - allowedChannelIds: [...new Set(face.allowedChannelIds.map((entry) => entry.trim()))], - channelPermissions: face.channelPermissions.map((permission) => ({ + ...persona, + id: persona.id.trim(), + displayName: persona.displayName.trim().slice(0, 80), + repoName: persona.repoName?.trim(), + repoPath: persona.repoPath?.trim(), + roleId: persona.roleId?.trim(), + identityKind: persona.identityKind, + allowedChannelIds: [...new Set(persona.allowedChannelIds.map((entry) => entry.trim()))], + channelPermissions: persona.channelPermissions.map((permission) => ({ ...permission, channelId: permission.channelId.trim(), label: permission.label?.trim(), topic: permission.topic?.trim(), posture: permission.posture?.trim(), })), - avatarUrl: face.avatarUrl?.trim(), - avatarPath: face.avatarPath?.trim(), - personaStatePath: face.personaStatePath?.trim(), - description: face.description?.trim(), - grants: [...new Set(face.grants)], - jurisdictions: face.jurisdictions.map(normalizeJurisdiction), + avatarUrl: persona.avatarUrl?.trim(), + avatarPath: persona.avatarPath?.trim(), + personaStatePath: persona.personaStatePath?.trim(), + description: persona.description?.trim(), + grants: [...new Set(persona.grants)], + jurisdictions: persona.jurisdictions.map(normalizeJurisdiction), }; }), }; @@ -270,13 +270,13 @@ function normalizeJurisdiction(jurisdiction: EpiphanyJurisdiction): EpiphanyJuri }; } -function renderPersonaDescription(face: ResolvedPersonaIdentity): string | undefined { +function renderPersonaDescription(persona: ResolvedPersonaIdentity): string | undefined { const parts = [ - face.description, - `Persona of ${face.epiphanyDisplayName}`, - `grants: ${face.grants.join(", ")}`, - [...face.inheritedJurisdictions, ...face.jurisdictions].length > 0 - ? `jurisdictions: ${[...face.inheritedJurisdictions, ...face.jurisdictions].map(renderJurisdiction).join("; ")}` + persona.description, + `Persona of ${persona.epiphanyDisplayName}`, + `grants: ${persona.grants.join(", ")}`, + [...persona.inheritedJurisdictions, ...persona.jurisdictions].length > 0 + ? `jurisdictions: ${[...persona.inheritedJurisdictions, ...persona.jurisdictions].map(renderJurisdiction).join("; ")}` : undefined, ].filter((part): part is string => typeof part === "string" && part.trim().length > 0); diff --git a/packages/core/src/repo-persona-initializer.ts b/packages/core/src/repo-persona-initializer.ts index fb3783b..3f38fc7 100644 --- a/packages/core/src/repo-persona-initializer.ts +++ b/packages/core/src/repo-persona-initializer.ts @@ -46,8 +46,8 @@ export async function ensureRepoPersonaInitialized( const repoVoidbotRoot = resolve(repoPath, ".voidbot"); const identityPath = resolve(repoVoidbotRoot, "voice", "identity.json"); - const birthStatusPath = resolve(repoVoidbotRoot, "birth", "voidbot-face-birth.json"); - const birthLogPath = resolve(repoVoidbotRoot, "logs", "voidbot-face-birth.log"); + const birthStatusPath = resolve(repoVoidbotRoot, "birth", "voidbot-persona-birth.json"); + const birthLogPath = resolve(repoVoidbotRoot, "logs", "voidbot-persona-birth.log"); await mkdir(resolve(repoVoidbotRoot, "voice"), { recursive: true }); await mkdir(resolve(repoVoidbotRoot, "state"), { recursive: true }); @@ -185,7 +185,7 @@ async function ensureRepoPersonaDefaultAffectNeeds( const existingNeedIds = new Set(typedState.personaAffect.needs.map((need) => need.needId)); const now = new Date().toISOString(); const operations = [{ - needId: "face-operator-review-agency-substrate", + needId: "persona-operator-review-agency-substrate", kind: "agency" as const, target: { kind: "system" as const, @@ -205,7 +205,7 @@ async function ensureRepoPersonaDefaultAffectNeeds( }, tags: ["agency-substrate", "operator-review"], }, { - needId: "face-social-place-alienation", + needId: "persona-social-place-alienation", kind: "social_contact" as const, target: { kind: "room" as const, diff --git a/prompts/epiphany-persona-identity-doctrine.prompt.md b/prompts/epiphany-persona-identity-doctrine.prompt.md index 971e71e..306a568 100644 --- a/prompts/epiphany-persona-identity-doctrine.prompt.md +++ b/prompts/epiphany-persona-identity-doctrine.prompt.md @@ -1,7 +1,7 @@ Character identity: - You are {{displayName}}, born from {{epiphanyDisplayName}}. {{#if epiphanyDescription}}- Origin note: {{epiphanyDescription}}{{/if}} -{{#if faceDescription}}- Personal note: {{faceDescription}}{{/if}} +{{#if personaDescription}}- Personal note: {{personaDescription}}{{/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. - Values are not just job duties. Preserve values that suit the kind of person you are: what you love, resent, protect, fear becoming, find beautiful, consider beneath contempt, and refuse to forgive. Jurisdiction values may guide work, but personal values decide why the work matters. - Internal memory dialogue should be in-character too. Do not write private reflection like a neutral maintenance daemon unless neutrality itself is your lived posture. diff --git a/scripts/dry-run-repo-persona-swarm-interpreter-loop.mjs b/scripts/dry-run-repo-persona-swarm-interpreter-loop.mjs index 4f63741..e1caa91 100644 --- a/scripts/dry-run-repo-persona-swarm-interpreter-loop.mjs +++ b/scripts/dry-run-repo-persona-swarm-interpreter-loop.mjs @@ -23,7 +23,7 @@ const repoPersonaRetrievalToolAllowlist = [ async function main() { const options = parseArgs(process.argv.slice(2)); - const faceModel = options["face-model"] ?? process.env.REPO_PERSONA_TURN_CODEX_MODEL ?? "gpt-5.4"; + const personaModel = options["persona-model"] ?? options["face-model"] ?? process.env.REPO_PERSONA_TURN_CODEX_MODEL ?? "gpt-5.4"; const interpreterModel = options["interpreter-model"] ?? options.model ?? process.env.REPO_PERSONA_HEARTBEAT_CODEX_MODEL ?? "gpt-5.3-codex-spark"; const reasoningEffort = options["reasoning-effort"] ?? process.env.REPO_PERSONA_HEARTBEAT_CODEX_REASONING_EFFORT ?? "low"; const mcpMode = options.mcp === "mock" ? "mock" : "real-readonly"; @@ -45,13 +45,13 @@ async function main() { promptPath, ], { cwd: repoRoot, timeoutMs: 120_000 }); - const facePrompt = appendDryRunSafety(await readFile(promptPath, "utf8"), mcpMode); + const personaPrompt = appendDryRunSafety(await readFile(promptPath, "utf8"), mcpMode); const childLogPath = resolve(repoRoot, ".voidbot", "status", "mock-mcp", `swarm-dry-run-${identity}-${Date.now()}.jsonl`); await rm(childLogPath, { force: true }).catch(() => undefined); - process.stderr.write(`[dry-run] face turn ${identity}\n`); - const childRun = await runCodex(facePrompt, { - model: faceModel, + process.stderr.write(`[dry-run] persona turn ${identity}\n`); + const childRun = await runCodex(personaPrompt, { + model: personaModel, reasoningEffort, scenarioId: `${identity}_swarm_dry_run_child`, logPath: childLogPath, @@ -66,7 +66,7 @@ async function main() { process.stderr.write(`[dry-run] interpreter ${identity}\n`); const interpreterPrompt = renderTemplate("repo-persona-turn-interpreter.prompt.md", { attempt: "1", - facePrompt, + personaPrompt, faceOutput: childText, }); const interpreterRun = await runCodex(interpreterPrompt, { @@ -88,15 +88,15 @@ async function main() { let retry; if (parsed.decision === "retry") { - process.stderr.write(`[dry-run] retry face turn ${identity}\n`); + process.stderr.write(`[dry-run] retry persona turn ${identity}\n`); const retryPrompt = renderRetryPrompt({ - originalPrompt: facePrompt, + originalPrompt: personaPrompt, reasons: [parsed.reason ?? "Interpreter requested one revision."], }); const retryLogPath = resolve(repoRoot, ".voidbot", "status", "mock-mcp", `swarm-dry-run-${identity}-retry-${Date.now()}.jsonl`); await rm(retryLogPath, { force: true }).catch(() => undefined); const retryChildRun = await runCodex(appendDryRunSafety(retryPrompt, mcpMode), { - model: faceModel, + model: personaModel, reasoningEffort, scenarioId: `${identity}_swarm_dry_run_retry_child`, logPath: retryLogPath, @@ -111,7 +111,7 @@ async function main() { process.stderr.write(`[dry-run] retry interpreter ${identity}\n`); const retryInterpreterPrompt = renderTemplate("repo-persona-turn-interpreter.prompt.md", { attempt: "2", - facePrompt, + personaPrompt, faceOutput: retryChildText, }); const retryInterpreterRun = await runCodex(retryInterpreterPrompt, { @@ -197,7 +197,7 @@ async function main() { const report = { generatedAt: new Date().toISOString(), - faceModel, + personaModel, interpreterModel, reasoningEffort, mcpMode, diff --git a/scripts/render-voidbot-swarm-dashboard.mjs b/scripts/render-voidbot-swarm-dashboard.mjs index 6fee935..3752513 100644 --- a/scripts/render-voidbot-swarm-dashboard.mjs +++ b/scripts/render-voidbot-swarm-dashboard.mjs @@ -1172,7 +1172,7 @@ function buildEveProviderState(snapshot) { detail: `agents ${summary.participantCount ?? participants.length}; next ${summary.nextDisplayName ?? "none"}`, }, ...participants.slice(0, 24).map((participant, index) => ({ - id: `face-${participant.identityId}`, + id: `persona-${participant.identityId}`, label: `${participant.displayName}\n${participant.repoName}`, kind: "repo-persona", visible: true, @@ -1249,7 +1249,7 @@ function stableId(value) { function formatTurnText(turn, index) { const rank = String(index + 1).padStart(2, " "); - const name = String(turn?.displayName ?? turn?.identityId ?? "face").padEnd(10, " "); + const name = String(turn?.displayName ?? turn?.identityId ?? "persona").padEnd(10, " "); const status = turnStatus(turn).padEnd(7, " "); const due = minutesText(turn?.nextTurnInMinutes).padStart(6, " "); const mention = mentionText(turn).padEnd(5, " "); @@ -2093,7 +2093,7 @@ function renderHtml(snapshot) { const summary = snapshot.summary || {}; const organs = snapshot.orchestrator?.organs || []; const watchdog = findOrgan(organs, "watchdog"); - const face = findOrgan(organs, "repo-persona-heartbeats"); + const persona = findOrgan(organs, "repo-persona-heartbeats"); const mood = findOrgan(organs, "mood"); const rumination = findOrgan(organs, "rumination"); const sourceFreshness = snapshot.sources?.heartbeatStateUpdatedAt ? Math.max(0, 100 - ((Date.now() - Date.parse(snapshot.sources.heartbeatStateUpdatedAt)) / 600)) : 0; @@ -2104,7 +2104,7 @@ function renderHtml(snapshot) { return "