Skip to content

Commit 98256b1

Browse files
committed
fix(mantis): suppress auto no-proof comments
1 parent 8c2a390 commit 98256b1

3 files changed

Lines changed: 33 additions & 27 deletions

File tree

‎.github/codex/prompts/mantis-telegram-desktop-proof.md‎

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ Hard limits:
1818
- Do not force GIFs for internal-only, workflow-only, test-only, docs-only, or
1919
otherwise non-visual PRs. A no-visual-proof manifest is a successful workflow
2020
outcome when GIFs would be misleading, but it is not proof that the PR passed.
21+
- Do not skip Telegram-visible PRs just because the proof needs a specific
22+
message, mock response, media attachment, command, button, reaction, stop
23+
timing, approval prompt, or progress/final delivery sequence. First write a
24+
concrete proof plan and try the standard harness path.
2125
- Keep public-facing manifest summaries short and user-domain. Do not mention
2226
harness internals, mock-provider limits, secret/trust boundaries, local paths,
2327
transcript seeding, or workflow implementation details in the summary.
@@ -42,7 +46,15 @@ Required workflow:
4246
2. Inspect the PR with `gh pr view "$MANTIS_PR_NUMBER"` and
4347
`gh pr diff "$MANTIS_PR_NUMBER"`.
4448
3. Decide whether the PR has a visibly reproducible Telegram Desktop
45-
before/after. If it does not, write
49+
before/after. Treat these as visible until proven otherwise: message text
50+
formatting/content, progress drafts, native drafts, final delivery, media or
51+
document delivery, inline buttons, approval prompts, stop/abort behavior,
52+
reactions/status indicators, guest/inline responses, TTS/voice/audio
53+
delivery, and routing changes whose result is visible in the chat. For those
54+
PRs, define the exact Telegram stimulus and expected main/PR visual delta
55+
before deciding to skip.
56+
57+
If the PR does not have a Telegram-visible before/after, write
4658
`${MANTIS_OUTPUT_DIR}/mantis-evidence.json` with `comparison.pass: true`, no
4759
artifacts, and a summary that starts with
4860
`Mantis did not generate before/after GIFs because`. Include a short
@@ -78,8 +90,9 @@ than Telegram-visible behavior`. Use this manifest shape and do not create
7890
```
7991

8092
If the PR appears visual but proof is blocked by Telegram Desktop session
81-
state, authorization, credentials, Crabbox, or another capture-infrastructure
82-
issue, do not describe it as a no-visual PR. Write a manifest with
93+
state, authorization, credentials, Crabbox, missing Telegram client support,
94+
unavailable media/provider setup, or another capture-infrastructure issue,
95+
do not describe it as a no-visual PR. Write a manifest with
8396
`comparison.pass: false`, skipped lanes, no artifacts, and a summary that
8497
starts with `Mantis could not capture Telegram Desktop proof because`. The
8598
publisher will keep that out of PR comments so the failure stays in the

‎scripts/mantis/publish-pr-evidence.mjs‎

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -316,37 +316,27 @@ function hasVisibleProofArtifacts(manifest) {
316316
);
317317
}
318318

319-
function isSkippedNoVisualProof(manifest) {
320-
const comparison = manifest.comparison ?? {};
321-
return (
322-
!hasVisibleProofArtifacts(manifest) &&
323-
comparison.baseline?.status === "skipped" &&
324-
comparison.candidate?.status === "skipped"
325-
);
319+
function isTelegramDesktopProof(manifest) {
320+
return manifest.id === "telegram-desktop-proof" || manifest.scenario === "telegram-desktop-proof";
326321
}
327322

328323
function publicSummary(manifest) {
329-
if (isSkippedNoVisualProof(manifest)) {
330-
return "Mantis did not generate before/after GIFs because this PR does not have a clean Telegram-visible before/after proof in the standard Mantis run.";
331-
}
332324
return manifest.summary ?? "Mantis captured QA evidence for this scenario.";
333325
}
334326

335327
function overallStatus(manifest) {
336-
if (isSkippedNoVisualProof(manifest)) {
337-
return "skipped";
338-
}
339328
const pass = manifest.comparison?.pass;
340329
return typeof pass === "boolean" ? String(pass) : "";
341330
}
342331

343-
export function shouldPublishPrComment(manifest) {
344-
if (!isSkippedNoVisualProof(manifest)) {
332+
export function shouldPublishPrComment(manifest, { requestSource } = {}) {
333+
if (!isTelegramDesktopProof(manifest) || hasVisibleProofArtifacts(manifest)) {
345334
return true;
346335
}
347-
return !/(authorization[- ]?error|credential infrastructure|logged[- ]out|login screen|welcome screen|bad telegram session)/iu.test(
348-
manifest.summary ?? "",
349-
);
336+
if (requestSource === "pull_request_target") {
337+
return false;
338+
}
339+
return manifest.comparison?.pass === true;
350340
}
351341

352342
export function renderEvidenceComment({
@@ -593,7 +583,7 @@ export async function publishEvidence(rawArgs = process.argv.slice(2)) {
593583
runUrl: args.run_url,
594584
treeUrl: published.treeUrl,
595585
});
596-
if (!shouldPublishPrComment(manifest)) {
586+
if (!shouldPublishPrComment(manifest, { requestSource: args.request_source })) {
597587
console.log("Skipped Mantis QA evidence PR comment because the run did not capture proof.");
598588
return;
599589
}

‎test/scripts/mantis-publish-pr-evidence.test.ts‎

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,13 @@ describe("scripts/mantis/publish-pr-evidence", () => {
277277
"mantis-evidence.json",
278278
]);
279279
expect(body).toContain(
280-
"Summary: Mantis did not generate before/after GIFs because this PR does not have a clean Telegram-visible before/after proof in the standard Mantis run.",
280+
"Summary: Mantis did not generate before/after GIFs because this PR changes CI wiring only.",
281281
);
282-
expect(body).toContain("- Overall: `skipped`");
282+
expect(body).toContain("- Overall: `true`");
283283
expect(body).not.toContain("<table");
284284
expect(body).not.toContain("<img ");
285+
expect(shouldPublishPrComment(manifest, { requestSource: "issue_comment" })).toBe(true);
286+
expect(shouldPublishPrComment(manifest, { requestSource: "pull_request_target" })).toBe(false);
285287
});
286288

287289
it("does not publish PR comments for Telegram capture infrastructure failures", () => {
@@ -323,10 +325,11 @@ describe("scripts/mantis/publish-pr-evidence", () => {
323325
});
324326

325327
expect(body).toContain(
326-
"Summary: Mantis did not generate before/after GIFs because this PR does not have a clean Telegram-visible before/after proof in the standard Mantis run.",
328+
"Summary: Mantis could not capture Telegram Desktop proof because native Telegram Desktop opened to the logged-out welcome screen.",
327329
);
328-
expect(body).toContain("- Overall: `skipped`");
329-
expect(shouldPublishPrComment(manifest)).toBe(false);
330+
expect(body).toContain("- Overall: `false`");
331+
expect(shouldPublishPrComment(manifest, { requestSource: "issue_comment" })).toBe(false);
332+
expect(shouldPublishPrComment(manifest, { requestSource: "pull_request_target" })).toBe(false);
330333
});
331334

332335
it("rejects artifact paths that escape the manifest directory", () => {

0 commit comments

Comments
 (0)