Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/probe-worker.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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/<room> 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."
Expand Down
27 changes: 19 additions & 8 deletions tests/probe-worker.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]
},
{
Expand All @@ -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"
);
Expand Down
Loading