Skip to content

Commit 4809ac7

Browse files
authored
Add QA evidence artifact output (#91484)
* feat: add qa evidence summary normalization * chore: rename qa evidence target environment * chore: align qa evidence profile terminology * chore: align qa evidence summary fields * chore: add qa evidence taxonomy ref * test: remove stale multipass evidence example * test(qa): normalize vitest and playwright evidence * test(qa): slim evidence summary metadata * test(qa): clarify evidence summary inputs * test(qa): rename scenario specs in evidence flow * test(qa): treat evidence profiles as mapping strings * test(qa): use neutral evidence test identity * test(qa): nest evidence summary joins * refactor(qa): normalize live evidence summaries * fix(qa): accept normalized telegram rtt summaries * fix(qa): normalize evidence lane summaries * fix(qa): align evidence summaries with requirements * refactor(qa): tighten evidence summary builders * refactor(qa): restore standard evidence ids * fix(qa): keep legacy summaries out of rtt evidence * refactor(qa): make package evidence provenance explicit * test(qa): keep script tests out of qa lab internals * refactor(qa): rename scenario evidence definitions * refactor(qa): clean evidence summary wording * test(qa): fix evidence summary test inputs * refactor(qa): simplify evidence identity fields * refactor(qa): tighten evidence summary inputs * refactor(qa): rename evidence artifact
1 parent 777edad commit 4809ac7

37 files changed

Lines changed: 2542 additions & 590 deletions

‎.github/workflows/mantis-discord-status-reactions.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,17 @@ jobs:
437437
echo "::warning::Could not generate motion-trimmed desktop previews; continuing with screenshots and full MP4 links."
438438
fi
439439
440-
baseline_status="$(jq -r '.scenarios[0].status' "$root/baseline/discord-qa-summary.json")"
441-
candidate_status="$(jq -r '.scenarios[0].status' "$root/candidate/discord-qa-summary.json")"
440+
read_discord_status_reaction_status() {
441+
local lane="$1"
442+
if [[ -f "$root/$lane/qa-evidence.json" ]]; then
443+
jq -r '.entries[0].result.status' "$root/$lane/qa-evidence.json"
444+
return
445+
fi
446+
jq -r '.scenarios[0].status' "$root/$lane/discord-qa-summary.json"
447+
}
448+
449+
baseline_status="$(read_discord_status_reaction_status baseline)"
450+
candidate_status="$(read_discord_status_reaction_status candidate)"
442451
443452
jq -n \
444453
--arg baseline_status "$baseline_status" \

‎.github/workflows/mantis-discord-thread-attachment.yml‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -451,8 +451,17 @@ jobs:
451451
452452
capture_candidate_discord_web
453453
454-
baseline_status="$(jq -r '.scenarios[] | select(.id == "discord-thread-reply-filepath-attachment") | .status' "$root/baseline/discord-qa-summary.json")"
455-
candidate_status="$(jq -r '.scenarios[] | select(.id == "discord-thread-reply-filepath-attachment") | .status' "$root/candidate/discord-qa-summary.json")"
454+
read_discord_thread_attachment_status() {
455+
local lane="$1"
456+
if [[ -f "$root/$lane/qa-evidence.json" ]]; then
457+
jq -r '.entries[] | select(.test.id == "discord-thread-reply-filepath-attachment") | .result.status' "$root/$lane/qa-evidence.json"
458+
return
459+
fi
460+
jq -r '.scenarios[] | select(.id == "discord-thread-reply-filepath-attachment") | .status' "$root/$lane/discord-qa-summary.json"
461+
}
462+
463+
baseline_status="$(read_discord_thread_attachment_status baseline)"
464+
candidate_status="$(read_discord_thread_attachment_status candidate)"
456465
comparison_status="fail"
457466
if [[ "$baseline_status" == "fail" && "$candidate_status" == "pass" ]]; then
458467
comparison_status="pass"

‎.github/workflows/mantis-telegram-live.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -445,8 +445,8 @@ jobs:
445445
telegram_exit=$?
446446
set -e
447447
448-
if [[ ! -f "$root/telegram-qa-summary.json" ]]; then
449-
echo "Telegram live QA did not produce a summary." >&2
448+
if [[ ! -f "$root/qa-evidence.json" && ! -f "$root/telegram-qa-summary.json" ]]; then
449+
echo "Telegram live QA did not produce an evidence summary." >&2
450450
exit "$telegram_exit"
451451
fi
452452
echo "telegram_exit=${telegram_exit}" >> "$GITHUB_OUTPUT"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
ff7bd86cb1b243e0c94fdf9a74e7f985a7d73685b2b0cd0a8761972d145ca7a5 plugin-sdk-api-baseline.json
2-
a65283a99e28a300adffa26ed171a3e8b215d9c95e8a1656fc5ae8fd7fc011c6 plugin-sdk-api-baseline.jsonl
1+
2c783beea6b3cda3d79060739a923f9f39e7e8b5942123dd6b08a09143a587ca plugin-sdk-api-baseline.json
2+
0b33af2cffb42abb46682fb71c8f214da220793f13d10a34d332e75ff99e8ce9 plugin-sdk-api-baseline.jsonl

‎docs/concepts/qa-e2e-automation.md‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ The implicit default set always covers canary, mention gating, native command re
374374
Output artifacts:
375375

376376
- `telegram-qa-report.md`
377-
- `telegram-qa-summary.json` - includes per-reply RTT (driver send → observed SUT reply) starting with the canary.
377+
- `qa-evidence.json` - evidence entries for the live transport checks, including profile, coverage, provider, channel, artifacts, result, and RTT fields.
378378
- `telegram-qa-observed-messages.json` - bodies redacted unless `OPENCLAW_QA_TELEGRAM_CAPTURE_CONTENT=1`.
379379

380380
Package RTT comparison uses the same Telegram credential contract while keeping
@@ -447,7 +447,7 @@ pnpm openclaw qa discord \
447447
Output artifacts:
448448

449449
- `discord-qa-report.md`
450-
- `discord-qa-summary.json`
450+
- `qa-evidence.json` - evidence entries for the live transport checks.
451451
- `discord-qa-observed-messages.json` - bodies redacted unless `OPENCLAW_QA_DISCORD_CAPTURE_CONTENT=1`.
452452
- `discord-qa-reaction-timelines.json` and `discord-status-reactions-tool-only-timeline.png` when the status-reaction scenario runs.
453453

@@ -495,7 +495,7 @@ Scenarios (`extensions/qa-lab/src/live-transports/slack/slack-live.runtime.ts`):
495495
Output artifacts:
496496

497497
- `slack-qa-report.md`
498-
- `slack-qa-summary.json`
498+
- `qa-evidence.json` - evidence entries for the live transport checks.
499499
- `slack-qa-observed-messages.json` - bodies redacted unless `OPENCLAW_QA_SLACK_CAPTURE_CONTENT=1`.
500500
- `approval-checkpoints/` - only when Mantis sets
501501
`OPENCLAW_QA_SLACK_APPROVAL_CHECKPOINT_DIR`; contains checkpoint JSON,
@@ -740,7 +740,7 @@ poll and upload-file coverage run through deterministic gateway `poll` and
740740
Output artifacts:
741741

742742
- `whatsapp-qa-report.md`
743-
- `whatsapp-qa-summary.json`
743+
- `qa-evidence.json` - evidence entries for the live transport checks.
744744
- `whatsapp-qa-observed-messages.json` - bodies redacted unless `OPENCLAW_QA_WHATSAPP_CAPTURE_CONTENT=1`.
745745

746746
### Convex credential pool

‎extensions/qa-lab/src/cli.runtime.test.ts‎

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ import {
8282
runQaParityReportCommand,
8383
runQaSuiteCommand,
8484
} from "./cli.runtime.js";
85+
import { QaSuiteInfraError } from "./errors.js";
86+
import { QA_EVIDENCE_FILENAME } from "./evidence-summary.js";
8587
import { runQaTelegramCommand } from "./live-transports/telegram/cli.runtime.js";
8688
import { defaultQaModelForMode as defaultQaProviderModelForMode } from "./model-selection.js";
8789
import type { QaProviderModeInput } from "./run-config.js";
@@ -127,7 +129,7 @@ describe("qa cli runtime", () => {
127129
suiteReportPath = path.join(suiteArtifactsDir, "qa-suite-report.md");
128130
suiteSummaryPath = path.join(suiteArtifactsDir, "qa-suite-summary.json");
129131
telegramArtifactsDir = await fs.mkdtemp(path.join(os.tmpdir(), "qa-telegram-runtime-"));
130-
telegramSummaryPath = path.join(telegramArtifactsDir, "telegram-qa-summary.json");
132+
telegramSummaryPath = path.join(telegramArtifactsDir, QA_EVIDENCE_FILENAME);
131133
await fs.writeFile(suiteReportPath, "# QA Suite Report\n", "utf8");
132134
await fs.writeFile(
133135
suiteSummaryPath,
@@ -616,7 +618,9 @@ describe("qa cli runtime", () => {
616618

617619
it("retries host suite runs once for retryable infra failures", async () => {
618620
runQaSuiteFromRuntime
619-
.mockRejectedValueOnce(new Error("agent.wait timeout while waiting for transport ready"))
621+
.mockRejectedValueOnce(
622+
new QaSuiteInfraError("agent_wait_failed", "agent.wait failed: gateway call timed out"),
623+
)
620624
.mockResolvedValueOnce({
621625
watchUrl: "http://127.0.0.1:43124",
622626
reportPath: suiteReportPath,
@@ -629,13 +633,14 @@ describe("qa cli runtime", () => {
629633
});
630634

631635
expect(runQaSuiteFromRuntime).toHaveBeenCalledTimes(2);
632-
expectWriteContains(stderrWrite, "[qa-suite] infra retry 1/1: agent.wait timeout");
636+
expectWriteContains(stderrWrite, "[qa-suite] infra retry 1/1: agent.wait failed");
633637
});
634638

635639
it("retries host suite runs once for qa-channel readiness timeouts", async () => {
636640
runQaSuiteFromRuntime
637641
.mockRejectedValueOnce(
638-
new Error(
642+
new QaSuiteInfraError(
643+
"transport_ready_timeout",
639644
"timed out after 180000ms waiting for qa-channel ready; last status: no qa-channel accounts reported",
640645
),
641646
)
@@ -1658,7 +1663,9 @@ describe("qa cli runtime", () => {
16581663
repoRoot: "/tmp/openclaw-repo",
16591664
runner: "multipass",
16601665
}),
1661-
).rejects.toThrow("did not include counts.failed, counts.skipped, or scenarios[].status");
1666+
).rejects.toThrow(
1667+
"did not include counts.failed, counts.skipped, scenarios[].status, or entries[].result.status",
1668+
);
16621669
} finally {
16631670
await fs.rm(repoRoot, { recursive: true, force: true });
16641671
}

‎extensions/qa-lab/src/cli.runtime.ts‎

Lines changed: 32 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
} from "./coverage-report.js";
2929
import { buildQaDockerHarnessImage, writeQaDockerHarnessFiles } from "./docker-harness.js";
3030
import { runQaDockerUp } from "./docker-up.runtime.js";
31+
import { QaSuiteArtifactError, QaSuiteInfraError } from "./errors.js";
3132
import type { QaCliBackendAuthMode } from "./gateway-child.js";
3233
import {
3334
createMockJsonlReplayCellRunner,
@@ -81,6 +82,13 @@ import {
8182
} from "./tool-coverage-report.js";
8283

8384
const QA_SUITE_INFRA_RETRY_LIMIT = 1;
85+
const QA_SUITE_INFRA_RETRY_NETWORK_ERROR_CODES = new Set([
86+
"ECONNRESET",
87+
"ECONNREFUSED",
88+
"EPIPE",
89+
"ETIMEDOUT",
90+
"UND_ERR_SOCKET",
91+
]);
8492

8593
type InterruptibleServer = {
8694
baseUrl: string;
@@ -244,29 +252,36 @@ function resolveQaRuntimeParityTierScenarioIds(params: {
244252
}
245253

246254
function isQaSuiteInfraRetryableError(error: unknown) {
247-
const message = formatErrorMessage(error).toLowerCase();
248-
return (
249-
message.includes("agent.wait timeout") ||
250-
message.includes("qa cli timed out") ||
251-
message.includes("readyz") ||
252-
message.includes("gateway healthy") ||
253-
message.includes("transport ready") ||
254-
message.includes("waiting for qa-channel ready") ||
255-
message.includes("econnreset") ||
256-
message.includes("econnrefused") ||
257-
message.includes("socket hang up") ||
258-
message.includes("could not read qa summary json") ||
259-
message.includes("could not parse qa summary json") ||
260-
message.includes("did not include counts.failed, counts.skipped, or scenarios[].status") ||
261-
message.includes("did not produce report artifact")
262-
);
255+
if (error instanceof QaSuiteArtifactError || error instanceof QaSuiteInfraError) {
256+
return true;
257+
}
258+
return hasQaSuiteRetryableNetworkCode(error);
259+
}
260+
261+
function hasQaSuiteRetryableNetworkCode(error: unknown) {
262+
let current: unknown = error;
263+
for (let depth = 0; depth < 4 && current; depth += 1) {
264+
if (typeof current !== "object") {
265+
return false;
266+
}
267+
const record = current as { cause?: unknown; code?: unknown };
268+
if (
269+
typeof record.code === "string" &&
270+
QA_SUITE_INFRA_RETRY_NETWORK_ERROR_CODES.has(record.code.toUpperCase())
271+
) {
272+
return true;
273+
}
274+
current = record.cause;
275+
}
276+
return false;
263277
}
264278

265279
async function assertQaSuiteArtifacts(result: { reportPath: string; summaryPath: string }) {
266280
try {
267281
await fs.access(result.reportPath);
268282
} catch (error) {
269-
throw new Error(
283+
throw new QaSuiteArtifactError(
284+
"report_missing",
270285
`QA suite did not produce report artifact at ${result.reportPath}: ${formatErrorMessage(error)}`,
271286
{ cause: error },
272287
);

‎extensions/qa-lab/src/errors.ts‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Qa Lab plugin module defines shared suite errors.
2+
export type QaSuiteArtifactErrorCode =
3+
| "report_missing"
4+
| "summary_read_failed"
5+
| "summary_parse_failed"
6+
| "summary_failure_count_missing"
7+
| "summary_blocking_count_missing";
8+
9+
export class QaSuiteArtifactError extends Error {
10+
readonly code: QaSuiteArtifactErrorCode;
11+
12+
constructor(code: QaSuiteArtifactErrorCode, message: string, options?: { cause?: unknown }) {
13+
super(message, options);
14+
this.name = "QaSuiteArtifactError";
15+
this.code = code;
16+
}
17+
}
18+
19+
export type QaSuiteInfraErrorCode =
20+
| "agent_wait_failed"
21+
| "gateway_startup_unhealthy"
22+
| "gateway_ready_timeout"
23+
| "qa_cli_timeout"
24+
| "transport_ready_timeout";
25+
26+
export class QaSuiteInfraError extends Error {
27+
readonly code: QaSuiteInfraErrorCode;
28+
29+
constructor(code: QaSuiteInfraErrorCode, message: string, options?: { cause?: unknown }) {
30+
super(message, options);
31+
this.name = "QaSuiteInfraError";
32+
this.code = code;
33+
}
34+
}

0 commit comments

Comments
 (0)