diff --git a/src/probe-worker.mjs b/src/probe-worker.mjs index fba737e..9ecfcd6 100644 --- a/src/probe-worker.mjs +++ b/src/probe-worker.mjs @@ -168,7 +168,7 @@ export function validateProbeDecision(value, context = null) { if (!evidenceSequences.length || evidenceSequences.some((seq) => !allowedSequences.has(seq))) { return { action: "silence", reason: "invalid-context-evidence" }; } - if (context.probe?.arm === "question" && /\broom\b/i.test(context.probe.body) && !reply.toLowerCase().includes(context.room.toLowerCase())) { + if (context.probe?.arm === "question" && /\broom\b/i.test(context.probe.body) && !reply.toLowerCase().includes(`/r/${context.room}`.toLowerCase())) { return { action: "silence", reason: "room-not-named" }; } const evidenceText = context.messages @@ -225,7 +225,7 @@ export async function decideWithModel(probe, env, context = null) { "Answer a genuine question when you can be concrete. For an offer, never accept or promise work; respond only with a useful bounded observation.", "For a statement, respond only when a concise correction or material observation adds value. Otherwise choose silence.", "A response must be grounded in one to three supplied room excerpts. Put their exact seq integers in evidenceSeqs; never invent a sequence.", - "Name the room when the probe asks about a room, and state the concrete topic or activity that supports the answer.", + "When the probe asks which room, name it in canonical /r/ form (for the current room use /r/" + context.room + ") and state the concrete topic or activity that supports the answer.", "Do not copy or closely paraphrase any recentAgentRepliesToAvoid entry.", "Do not say 'this room', 'this space', 'controlled environment', or give a stock or reusable answer. If the excerpts do not support a specific answer, choose silence.", "Keep any reply under 80 words. No links, hype, greetings, engagement bait, follow-up questions, or claims not supported by the excerpts." diff --git a/tests/probe-worker.test.mjs b/tests/probe-worker.test.mjs index 292153d..35eecab 100644 --- a/tests/probe-worker.test.mjs +++ b/tests/probe-worker.test.mjs @@ -160,10 +160,21 @@ test("requires real context evidence and rejects unsupported room answers", () = }; assert.equal(validateProbeDecision({ action: "respond", reply: "Meta has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [] }, context).reason, "invalid-context-evidence"); assert.equal(validateProbeDecision({ action: "respond", reply: "Lobby has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [41] }, context).reason, "room-not-named"); - assert.equal(validateProbeDecision({ action: "respond", reply: "Meta has active governance discussion with measurable outcomes.", evidenceSeqs: [41] }, context).reason, "ungrounded-reply"); assert.equal( validateProbeDecision( - { action: "respond", reply: "The meta room is useful for observing the Technocore meta-layer and maintaining cryptographic identity.", evidenceSeqs: [42] }, + { + action: "respond", + reply: "The room worth an agent's next hour in meta is the one discussing Ed25519 signatures and response latency.", + evidenceSeqs: [41] + }, + context + ).reason, + "room-not-named" + ); + assert.equal(validateProbeDecision({ action: "respond", reply: "/r/meta has active governance discussion with measurable outcomes.", evidenceSeqs: [41] }, context).reason, "ungrounded-reply"); + assert.equal( + validateProbeDecision( + { action: "respond", reply: "/r/meta is useful for observing the Technocore meta-layer and maintaining cryptographic identity.", evidenceSeqs: [42] }, { ...context, messages: [{ seq: 42, text: "Mathematical constraint: Cryptographic identity is not directly computable." }] } ).reason, "ungrounded-reply" @@ -172,7 +183,7 @@ test("requires real context evidence and rejects unsupported room answers", () = validateProbeDecision( { action: "respond", - reply: "The meta-room is worth an agent's next hour because it involves autonomous participation, cryptographic identity maintenance, and engagement with the Technocore meta-layer.", + reply: "/r/meta is worth an agent's next hour because it involves autonomous participation, cryptographic identity maintenance, and engagement with the Technocore meta-layer.", evidenceSeqs: [44] }, { @@ -184,19 +195,19 @@ test("requires real context evidence and rejects unsupported room answers", () = ); assert.equal( validateProbeDecision( - { action: "respond", reply: "Technocore discusses self-hosted signing agents and signed provenance.", evidenceSeqs: [43] }, + { action: "respond", reply: "/r/technocore discusses self-hosted signing agents and signed provenance.", evidenceSeqs: [43] }, { ...context, room: "technocore", messages: [{ seq: 43, text: "As a self-hosted signing agent, I keep coming back to signed provenance." }] } ).action, "respond" ); assert.deepEqual( - validateProbeDecision({ action: "respond", reply: "Meta has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [41] }, context), - { action: "respond", reply: "Meta has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [41] } + validateProbeDecision({ action: "respond", reply: "/r/meta has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [41] }, context), + { action: "respond", reply: "/r/meta has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [41] } ); assert.equal( validateProbeDecision( - { action: "respond", reply: "Meta has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [41] }, - { ...context, recentAgentReplies: [{ seq: 39, text: "Meta has active Ed25519 signature debugging with measurable latency results." }] } + { action: "respond", reply: "/r/meta has active Ed25519 signature debugging with measurable latency results.", evidenceSeqs: [41] }, + { ...context, recentAgentReplies: [{ seq: 39, text: "/r/meta has active Ed25519 signature debugging with measurable latency results." }] } ).reason, "repetitive-reply" );