Finish Face to Persona vocabulary migration
This commit is contained in:
parent
184e3242a9
commit
48128675c1
16 changed files with 146 additions and 145 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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 "<aside class=\\"status-panel\\" aria-label=\\"Compact swarm status\\"><h2><span>VOID</span><span>" + esc(String(summary.state || "UNK").slice(0, 4).toUpperCase()) + "</span></h2><div class=\\"status-grid\\">" +
|
||||
hud("WDOG", organCode(watchdog), organFill(watchdog), organWarn(watchdog)) +
|
||||
hud("ORCH", shortState(snapshot.orchestrator?.state), statusFill(snapshot.orchestrator?.state), statusWarn(snapshot.orchestrator?.state)) +
|
||||
hud("FACE", organCode(face), organFill(face), organWarn(face)) +
|
||||
hud("PERS", organCode(persona), organFill(persona), organWarn(persona)) +
|
||||
hud("MOOD", organCode(mood), organFill(mood), organWarn(mood)) +
|
||||
hud("RUM", organCode(rumination), organFill(rumination), organWarn(rumination)) +
|
||||
hud("MESH", shortState(snapshot.cultMesh?.writeStatus), meshOk, snapshot.cultMesh?.writeStatus !== "ok") +
|
||||
|
|
|
|||
|
|
@ -219,8 +219,8 @@ async function main(): Promise<void> {
|
|||
return;
|
||||
}
|
||||
|
||||
const faceRegistry = await loadPersonaIdentityRegistry(config.repoDiscordIdentitiesPath);
|
||||
const registry = personaRegistryAsRepoDiscordRegistry(faceRegistry);
|
||||
const personaRegistry = await loadPersonaIdentityRegistry(config.repoDiscordIdentitiesPath);
|
||||
const registry = personaRegistryAsRepoDiscordRegistry(personaRegistry);
|
||||
const state = await readHeartbeatState(config.repoPersonaHeartbeats.statePath);
|
||||
const restStates = await loadRepoPersonaRestStates(registry.identities, config.storageRoot, state, { dryRun });
|
||||
const now = new Date();
|
||||
|
|
@ -1917,8 +1917,8 @@ async function assembleRepoPersonaTurnPrompt(input: {
|
|||
memorySurfacePath?: string;
|
||||
conversationSurfacePath?: string;
|
||||
}> {
|
||||
const faceRegistry = await loadPersonaIdentityRegistry(input.config.repoDiscordIdentitiesPath);
|
||||
const registry = personaRegistryAsRepoDiscordRegistry(faceRegistry);
|
||||
const personaRegistry = await loadPersonaIdentityRegistry(input.config.repoDiscordIdentitiesPath);
|
||||
const registry = personaRegistryAsRepoDiscordRegistry(personaRegistry);
|
||||
const identity = registry.identities.find(
|
||||
(entry) => entry.id.toLowerCase() === input.identityId.toLowerCase(),
|
||||
);
|
||||
|
|
@ -4776,8 +4776,6 @@ const TOPIC_STOP_WORDS = new Set([
|
|||
"even",
|
||||
"every",
|
||||
"exactly",
|
||||
"face",
|
||||
"faces",
|
||||
"from",
|
||||
"give",
|
||||
"going",
|
||||
|
|
@ -5007,12 +5005,12 @@ function buildJurisdictionDiveDirective(
|
|||
}
|
||||
|
||||
function renderRepoCharacterIdentityDoctrine(identity: RepoDiscordIdentity): string {
|
||||
const face = buildEpiphanyIdentityRegistry({ identities: [identity] }).personas[0];
|
||||
const persona = buildEpiphanyIdentityRegistry({ identities: [identity] }).personas[0];
|
||||
return loadPromptTemplate("repo-character-identity.prompt.md", {
|
||||
displayName: identity.displayName,
|
||||
repoName: identity.repoName,
|
||||
originName: face?.epiphanyDisplayName ?? identity.repoName,
|
||||
characterDescription: projectCharacterDescription(face?.description ?? identity.description),
|
||||
originName: persona?.epiphanyDisplayName ?? identity.repoName,
|
||||
characterDescription: projectCharacterDescription(persona?.description ?? identity.description),
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -5128,7 +5126,7 @@ function migrateLegacyHeartbeatState(
|
|||
: index * baseRecoveryMinutes;
|
||||
|
||||
return {
|
||||
identityId: participant.identityId ?? `legacy-face-${index + 1}`,
|
||||
identityId: participant.identityId ?? `legacy-persona-${index + 1}`,
|
||||
repoName: participant.repoName ?? "unknown",
|
||||
displayName: participant.displayName ?? participant.identityId ?? `Legacy Persona ${index + 1}`,
|
||||
initiativeSpeed: speed,
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ try {
|
|||
}
|
||||
|
||||
const renderedText = renderToolText(result);
|
||||
if (/No schema is registered for persisted document type "void\.face_affect"/i.test(renderedText)) {
|
||||
if (/No schema is registered for persisted document type "void\.persona_affect"/i.test(renderedText)) {
|
||||
throw new Error("MCP Persona-state read still lacks the void.persona_affect document schema.");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ import { fileURLToPath } from "node:url";
|
|||
|
||||
const repoRoot = resolve(fileURLToPath(new URL("..", import.meta.url)));
|
||||
const identity = process.argv[2] ?? "libby";
|
||||
const tempDir = await mkdtemp(join(tmpdir(), "voidbot-face-projection-"));
|
||||
const tempDir = await mkdtemp(join(tmpdir(), "voidbot-persona-projection-"));
|
||||
const outPath = join(tempDir, `${identity}.md`);
|
||||
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue