Stop interpreter prose leaking into face speech

This commit is contained in:
Meta Vens 2026-05-26 12:34:46 +01:00
commit f1ed70867a
8 changed files with 15 additions and 52 deletions

View file

@ -676,16 +676,6 @@ function parseRepoFaceParentInterpretation(
attempt: 1 | 2,
): RepoFaceParentInterpretation {
const block = parseInterpretationBlock(interpretationText);
if (Object.keys(block).length === 0) {
const speechFallback = repoFaceInterpreterPlainSpeechFallback(interpretationText);
if (speechFallback) {
return {
decision: "route",
reasons: ["parent interpreter returned compact plain speech; wrapped it as SAY current_room"],
routedOutput: speechFallback,
};
}
}
const decision = block.decision?.trim().toLowerCase();
const parsedDecision =
decision === "route" || decision === "retry" || decision === "drop"
@ -706,35 +696,6 @@ function parseRepoFaceParentInterpretation(
};
}
function repoFaceInterpreterPlainSpeechFallback(interpretationText: string): string | undefined {
const content = interpretationText.trim();
if (!content || content.length > 500) {
return undefined;
}
if (content.includes("\n\n") || parseRepoFaceActionBlocks(content).length > 0) {
return undefined;
}
if (/^(private thought|what should stick|work\/proposal|article draft|state note|interpretation)\s*:/i.test(content)) {
return undefined;
}
if (/\b(nothing public|would say nothing|stay private|hold silence|no public action|not worth routing)\b/i.test(content)) {
return undefined;
}
if (/\S(?:\.\.\.|…)$/.test(content)) {
return undefined;
}
return [
"SAY",
"identity: current_face_id",
"channel: current_room",
"reply_to:",
"content:",
` ${content}`,
"END",
].join("\n");
}
function collectForbiddenRepoFaceChildTools(artifacts: ProviderArtifact[]): string[] {
const forbidden = new Set<string>();
for (const artifact of artifacts) {
@ -1211,7 +1172,7 @@ async function postRepoIdentityIntent(job: JobRecord, intent: RepoIdentityPostIn
`Repo identity ${identity.id} SAY content is too long for one Discord message (${content.length} characters).`,
);
}
if (/\S(?:\.\.\.|…)$/.test(content)) {
if (/\S(?:\.\.\.|\u2026)$/.test(content)) {
throw new Error(`Repo identity ${identity.id} SAY content appears mechanically truncated.`);
}
const contentFile = await writeBifrostPayloadFile(job, `${identity.id}-discord-post.md`, content);