























@@ -10,6 +10,7 @@ import {
1010QA_EVIDENCE_FILENAME,
1111QA_EVIDENCE_SUMMARY_KIND,
1212QA_EVIDENCE_SUMMARY_SCHEMA_VERSION,
13+resolveQaEvidenceEnvironment,
1314validateQaEvidenceSummaryJson,
1415type QaEvidenceStatus,
1516type QaEvidenceSummaryEntry,
@@ -174,15 +175,15 @@ function sanitizeArtifactText(
174175175176function buildExecution(params: {
176177artifacts: MatrixCell["artifacts"];
178+repoRoot: string;
177179source: string;
178180}): QaEvidenceSummaryEntry["execution"] {
179181return {
180182runner: "ux-matrix-script-producer",
181-environment: {
182-ref: process.env.OPENCLAW_QA_REF?.trim() || process.env.GITHUB_SHA?.trim() || null,
183-os: process.platform,
184-nodeVersion: process.version,
185-},
183+environment: resolveQaEvidenceEnvironment({
184+env: process.env,
185+repoRoot: params.repoRoot,
186+}),
186187provider: {
187188id: "ux-matrix",
188189live: false,
@@ -202,7 +203,7 @@ function buildExecution(params: {
202203};
203204}
204205205-function buildEvidenceEntry(cell: MatrixCell): QaEvidenceSummaryEntry {
206+function buildEvidenceEntry(cell: MatrixCell, repoRoot: string): QaEvidenceSummaryEntry {
206207const source = `ux-matrix:${cell.surface}:${cell.stage}`;
207208return {
208209test: {
@@ -221,6 +222,7 @@ function buildEvidenceEntry(cell: MatrixCell): QaEvidenceSummaryEntry {
221222],
222223execution: buildExecution({
223224artifacts: cell.artifacts,
225+ repoRoot,
224226 source,
225227}),
226228result: {
@@ -243,13 +245,14 @@ function buildEvidenceEntry(cell: MatrixCell): QaEvidenceSummaryEntry {
243245function buildEvidenceSummary(params: {
244246cells: readonly MatrixCell[];
245247generatedAt: string;
248+repoRoot: string;
246249}): QaEvidenceSummaryJson {
247250return validateQaEvidenceSummaryJson({
248251kind: QA_EVIDENCE_SUMMARY_KIND,
249252schemaVersion: QA_EVIDENCE_SUMMARY_SCHEMA_VERSION,
250253generatedAt: params.generatedAt,
251254evidenceMode: "full",
252-entries: params.cells.map(buildEvidenceEntry),
255+entries: params.cells.map((cell) => buildEvidenceEntry(cell, params.repoRoot)),
253256});
254257}
255258@@ -693,6 +696,7 @@ export async function runUxMatrixEvidenceProducer(options: ProducerOptions) {
693696const previewEvidence = buildEvidenceSummary({
694697cells: initialCells,
695698generatedAt: new Date().toISOString(),
699+repoRoot: options.repoRoot,
696700});
697701const screenshotLog = await fs.readFile(path.join(screenshotCellDir, "logs.txt"), "utf8");
698702await writeProducerArtifactFixtureHtml({
@@ -753,7 +757,11 @@ export async function runUxMatrixEvidenceProducer(options: ProducerOptions) {
753757 ...initialCells,
754758];
755759756-const evidence = buildEvidenceSummary({ cells, generatedAt: new Date().toISOString() });
760+const evidence = buildEvidenceSummary({
761+ cells,
762+generatedAt: new Date().toISOString(),
763+repoRoot: options.repoRoot,
764+});
757765await writeProducerArtifactFixtureHtml({
758766artifactBase: options.artifactBase,
759767 evidence,
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。