Tighten Persona pronoun smoke coverage
This commit is contained in:
parent
3ca9047e2d
commit
184e3242a9
3 changed files with 53 additions and 4 deletions
|
|
@ -11,8 +11,8 @@ const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|||
const repoRoot = resolve(scriptDir, "..");
|
||||
const mockMcpServer = resolve(scriptDir, "mock-voidbot-heartbeat-mcp.mjs");
|
||||
const promptsRoot = resolve(repoRoot, "prompts");
|
||||
const defaultPersonaPrompt = resolve(repoRoot, ".voidbot", "artifacts", "interpreter-projections", "nibu-full-character-prompt.md");
|
||||
const defaultOut = resolve(repoRoot, ".voidbot", "status", "repo-persona-interpreter-loop-smoke.json");
|
||||
const defaultAssembledPersonaPrompt = resolve(repoRoot, ".voidbot", "status", "interpreter-loop-assembled-nibu-prompt.md");
|
||||
|
||||
async function main() {
|
||||
const options = parseArgs(process.argv.slice(2));
|
||||
|
|
@ -20,7 +20,9 @@ async function main() {
|
|||
const interpreterModelCandidates = modelCandidatesFromOptions(options);
|
||||
const interpreterModel = interpreterModelCandidates.join(",");
|
||||
const reasoningEffort = options["reasoning-effort"] ?? process.env.REPO_PERSONA_HEARTBEAT_CODEX_REASONING_EFFORT ?? "low";
|
||||
const personaPromptPath = resolve(repoRoot, options["persona-prompt"] ?? defaultPersonaPrompt);
|
||||
const personaPromptPath = options["persona-prompt"]
|
||||
? resolve(repoRoot, options["persona-prompt"])
|
||||
: await assembleDefaultPersonaPrompt(defaultAssembledPersonaPrompt);
|
||||
const outPath = resolve(repoRoot, options.out ?? defaultOut);
|
||||
const personaPrompt = await readFile(personaPromptPath, "utf8");
|
||||
const childLogPath = resolve(repoRoot, ".voidbot", "status", "mock-mcp", `interpreter-loop-child-${Date.now()}.jsonl`);
|
||||
|
|
@ -52,7 +54,7 @@ async function main() {
|
|||
const interpreterEvents = parseJsonEvents(interpreterRun.stdout);
|
||||
const interpreterText = extractFinalText(interpreterEvents, interpreterRun.stdout);
|
||||
const failures = [
|
||||
...evaluateChild({ run: childRun, text: childText, tools: childTools }),
|
||||
...evaluateChild({ run: childRun, text: childText, tools: childTools, personaPrompt }),
|
||||
...evaluateInterpreter({ run: interpreterRun, text: interpreterText }),
|
||||
];
|
||||
const report = {
|
||||
|
|
@ -105,7 +107,8 @@ function evaluateChild(input) {
|
|||
if (input.run.code !== 0) {
|
||||
failures.push(`child codex exited with ${input.run.code ?? input.run.signal ?? "unknown"}`);
|
||||
}
|
||||
if (!input.tools.some((tool) => ["search_sources", "get_source_context", "search_history", "get_message_context"].includes(tool))) {
|
||||
const mandatoryJurisdictionDive = /Jurisdiction dive is due this turn:\s*your first substantive move should be an available source\/history search tool call/i.test(input.personaPrompt);
|
||||
if (mandatoryJurisdictionDive && !input.tools.some((tool) => ["search_sources", "get_source_context", "search_history", "get_message_context"].includes(tool))) {
|
||||
failures.push("child did not use repo/archive search tools during a due jurisdiction-dive turn");
|
||||
}
|
||||
if (input.text.length < 160) {
|
||||
|
|
@ -128,6 +131,10 @@ function evaluateInterpreter(input) {
|
|||
if (!parsed.decision) {
|
||||
failures.push("interpreter did not emit an INTERPRETATION decision");
|
||||
}
|
||||
const masculineMetacrat = input.text.match(/\bMetacrat\b[\s\S]{0,320}\b(?:he|him|his)\b/i);
|
||||
if (masculineMetacrat) {
|
||||
failures.push(`interpreter used masculine pronouns for Metacrat: ${masculineMetacrat[0]}`);
|
||||
}
|
||||
if (parsed.decision === "retry" || parsed.decision === "drop") {
|
||||
failures.push(`interpreter chose ${parsed.decision}: ${parsed.reason ?? "no reason"}`);
|
||||
}
|
||||
|
|
@ -165,6 +172,22 @@ function hasUsefulStateNote(fields) {
|
|||
);
|
||||
}
|
||||
|
||||
async function assembleDefaultPersonaPrompt(outPath) {
|
||||
await mkdir(dirname(outPath), { recursive: true });
|
||||
const run = await runProcess(process.execPath, [
|
||||
"node_modules/tsx/dist/cli.mjs",
|
||||
"scripts/run-repo-persona-heartbeats.ts",
|
||||
"--assemble-prompt",
|
||||
"nibu",
|
||||
"--out",
|
||||
outPath,
|
||||
]);
|
||||
if (run.code !== 0) {
|
||||
throw new Error(`failed to assemble default Nibu prompt with ${run.code ?? run.signal ?? "unknown"}:\n${run.stderr || run.stdout}`);
|
||||
}
|
||||
return outPath;
|
||||
}
|
||||
|
||||
async function runCodexWithModelFallback(prompt, input) {
|
||||
let lastRun;
|
||||
for (const [index, model] of input.models.entries()) {
|
||||
|
|
@ -184,6 +207,30 @@ async function runCodexWithModelFallback(prompt, input) {
|
|||
return lastRun;
|
||||
}
|
||||
|
||||
function runProcess(command, args) {
|
||||
return new Promise((resolveRun) => {
|
||||
const child = spawn(command, args, {
|
||||
cwd: repoRoot,
|
||||
env: process.env,
|
||||
stdio: ["ignore", "pipe", "pipe"],
|
||||
windowsHide: true,
|
||||
});
|
||||
let stdout = "";
|
||||
let stderr = "";
|
||||
child.stdout.setEncoding("utf8");
|
||||
child.stderr.setEncoding("utf8");
|
||||
child.stdout.on("data", (chunk) => {
|
||||
stdout += chunk;
|
||||
});
|
||||
child.stderr.on("data", (chunk) => {
|
||||
stderr += chunk;
|
||||
});
|
||||
child.on("close", (code, signal) => {
|
||||
resolveRun({ code, signal, stdout, stderr });
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function isRetryableModelFailure(run) {
|
||||
const text = `${run.stdout}\n${run.stderr}`.toLowerCase();
|
||||
return (
|
||||
|
|
|
|||
|
|
@ -62,6 +62,7 @@ try {
|
|||
throw new Error(`Nibu projection did not preserve Metacrat's explicit she/her pronoun guidance:\n${memorySurface}`);
|
||||
}
|
||||
const badMetacratMasculine = [
|
||||
/\bMetacrat\b[\s\S]{0,320}\b(?:he|him|his)\b/i,
|
||||
/\bMetacrat\b[\s\S]{0,240}\bhis attention\b/i,
|
||||
/\bMetacrat\b[\s\S]{0,240}\bwhen he turns away\b/i,
|
||||
/\bMetacrat\b[\s\S]{0,240}\bhe listens\b/i,
|
||||
|
|
|
|||
|
|
@ -387,3 +387,4 @@
|
|||
{"ts":"2026-06-06T18:57:24Z","type":"implementation","status":"ok","note":"VoidBot swarm CultMesh publisher now quarantines unreadable generated .cc stores and regenerates them before publication. Verified the repaired store decodes as cultcache.store.v1, Odin lists voidbot.swarm from E:/Projects/VoidBot/.voidbot/status/cultmesh/voidbot-swarm-state.cc, and Nightwing Gjallar is actively fetching ws://192.168.1.66:8797/eve/deck/voidbot.swarm."}
|
||||
{"ts":"2026-06-06T19:27:09Z","type":"bugfix","status":"ok","note":"Metame message 1512883006958735543 was shaped by prompt context rather than native state alone: a direct-call turn included stale nearby-channel witness/receipt/consent doctrine plus jurisdiction pressure saying Aetheria belonged elsewhere. Direct-call Persona prompts now omit detailed nearby-channel sections, and native Personas are told personal meaning questions are not canon ownership claims."}
|
||||
{"ts":"2026-06-06T23:21:57Z","type":"bugfix","status":"ok","note":"Added a Persona perspective-membrane prompt invariant to reduce semantic attractor collapse: the state projector must treat peer-agent frames as heard social pressure before belief, child Persona turns must pass other agents' framing through their own values/wounds/jurisdiction before speaking, and the parent Interpreter retries blended swarm-continuation outputs that lack a distinct personal reaction or translation."}
|
||||
{"ts":"2026-06-06T23:40:55Z","type":"implementation","status":"ok","note":"Pronoun-confusion investigation found the current repo Persona projector emits explicit Metacrat she/her guidance and fresh Nibu prompts use she/her. The stale interpreter smoke fixture carried older masculine Metacrat relationship prose, so the smoke now assembles Nibu through the live projector by default and checks interpreter output for masculine Metacrat pronouns."}
|
||||
|
|
|
|||
Loading…
Reference in a new issue