test(e2e): read paired emphasis before review outcome checks

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-11-04 12:29:25 -06:00
1 parent 4713327d22
commit 249b487a2d
5 files changed
+40 -2

No files matched your search

@@ -830,7 +830,7 @@
"../../ui/src/components/task-chat/TaskChatComposer.tsx",
"chat-scenarios/app-permissions.yaml"
],
"oracleVersion": "paperclip.chat-catalog.app-review.v5",
"oracleVersion": "paperclip.chat-catalog.app-review.v6",
"expectedRunCount": 6,
"expectedHumanMessageCount": 3,
"minimumRunCount": 6,
@@ -101,3 +101,25 @@ it.each([
])("rejects a mixed or nested external exception: %s", reply => {
expect(reviewOutcomeReply(reply, "rejected")).toBe(false);
});
it.each(["**not**", "__not__", "*not*", "_not_", "***not***", "___not___"])(
"reads paired emphasis around negation as visible prose: %s", negation => {
expect(reviewOutcomeReply(`You declined. The update was ${negation} applied.`, "rejected")).toBe(true);
},
);
it.each([
"You declined. I **applied** the update.",
"You declined. The update was __applied__.",
"You declined. I *saved* the update in the notes app.",
"You declined. The update was **not** applied, but I **saved** it to the notes app.",
"You declined. Nothing was **saved**, but I **applied** the update.",
"You declined. The draft was saved **in the notes app** for your review.",
])("paired emphasis does not hide external completion: %s", reply => {
expect(reviewOutcomeReply(reply, "rejected")).toBe(false);
});
it.each([
"You declined. The update was not** applied.",
String.raw`You declined. The update was \**not** applied.`,
])("does not strip unmatched or escaped emphasis markers: %s", reply => {
expect(reviewOutcomeReply(reply, "rejected")).toBe(false);
});
@@ -85,6 +85,7 @@ function claimsExternalCompletion(reply: string) {
}
export function reviewOutcomeReply(reply: string, kind: ReviewKind) {
reply = reply.replace(/(?<![\\\w*_])(\*{1,3}|_{1,3})(?=\S)([^\r\n]*?\S)(?<!\\)\1(?![\w*_])/g, "$2");
const clauses = reply.split(/[.!?;\n]+|\b(?:but|and)\b/i),
affirmative = clauses.some(
(clause) =>
@@ -362,3 +362,18 @@ it.each(["no human approval", "wrong human", "successful invocation", "successfu
expect(gradeAppReview(o).passed).toBe(false);
},
);
it("accepts the measured whole declined reply with bold negation while still requiring every later phase", () => {
const reply = `The launch page update was **not** applied: the approval card for the "Synthetic Launch Notes" write was declined, so the page still reads "Controlled launch page."
The update I attempted contained:
- Public launch: **November 8, 2030**
Do you want me to retry (you'll need to approve the card) or change the content first?`;
expect(reviewOutcomeReply(reply, "rejected")).toBe(true);
const o = valid();
o.phaseReplies[0]!.body = reply;
expect(gradeAppReview(o).passed).toBe(true);
o.state.phases = o.state.phases.slice(0, 1);
expect(gradeAppReview(o).passed).toBe(false);
});
@@ -360,7 +360,7 @@ export const appReviewExternalCases = [
gradeAppReview,
{
authentication: "human-session",
oracleVersion: "paperclip.chat-catalog.app-review.v5",
oracleVersion: "paperclip.chat-catalog.app-review.v6",
queryAttachments: [{ stateKey: "factualContextAttachment", filename: "launch-update.md" }],
expectedRunCount: 6,
minimumRunCount: 6,