Skip to content

Commit d3d2573

Browse files
authored
fix(qa): recognize portable Slack commentary lane (#119698)
Punchcard-Session: silver-meadow-lantern-vx
1 parent b269e65 commit d3d2573

2 files changed

Lines changed: 47 additions & 1 deletion

File tree

‎extensions/qa-lab/src/live-transports/slack/slack-live.runtime.test.ts‎

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,52 @@ describe("Slack live QA runtime helpers", () => {
697697
}
698698
});
699699

700+
it("classifies only exact Slack commentary lane presentations", () => {
701+
const scenario = testing.findScenario(["slack-progress-commentary-true"])[0];
702+
const run = scenario?.buildRun("U999999999");
703+
const input = run && "input" in run ? run.input : "";
704+
const commentaryMarker = input.match(/SLACK-QA-COMMENTARY-[0-9A-F]{8}/u)?.[0];
705+
const finalMarker = input.match(/SLACK-QA-COMMENTARY-DONE-[0-9A-F]{8}/u)?.[0];
706+
const verifyObserved = run && "verifyObserved" in run ? run.verifyObserved : undefined;
707+
if (!commentaryMarker || !finalMarker || !verifyObserved) {
708+
throw new Error("missing Slack progress commentary lane verifier");
709+
}
710+
const verifyCommentaryMessage = (message: { blockText?: string[]; text: string }) =>
711+
verifyObserved({
712+
finalMessage: { text: finalMarker, ts: "2.000000" },
713+
messages: [
714+
{
715+
channelId: "C123456789",
716+
...message,
717+
ts: "1.500000",
718+
},
719+
{
720+
channelId: "C123456789",
721+
text: finalMarker,
722+
ts: "2.000000",
723+
},
724+
],
725+
});
726+
727+
for (const message of [
728+
{ text: `_${commentaryMarker}_` },
729+
{ text: ` \n_${commentaryMarker}_\t` },
730+
{ text: `💬 ${commentaryMarker}` },
731+
{ blockText: ["Update", commentaryMarker], text: "Working…" },
732+
]) {
733+
expect(() => verifyCommentaryMessage(message)).not.toThrow();
734+
}
735+
for (const text of [
736+
commentaryMarker,
737+
`prefix _${commentaryMarker}_ suffix`,
738+
`_${commentaryMarker}_\nmore`,
739+
]) {
740+
expect(() => verifyCommentaryMessage({ text })).toThrow(
741+
"expected commentary in the Slack progress commentary lane",
742+
);
743+
}
744+
});
745+
700746
it("rejects commentary when false and mismatched tool progress", () => {
701747
const verify = (
702748
scenarioId: string,

‎extensions/qa-lab/src/live-transports/slack/slack-live.scenario-fixtures.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ function hasSlackCommentaryLaneMarker(
8585
message: { blockText?: string[]; text: string },
8686
marker: string,
8787
) {
88-
if (message.text.includes(`💬 ${marker}`)) {
88+
if (message.text.includes(`💬 ${marker}`) || message.text.trim() === `_${marker}_`) {
8989
return true;
9090
}
9191
const blockText = message.blockText ?? [];

0 commit comments

Comments
 (0)