惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
WordPress大学
WordPress大学
Y
Y Combinator Blog
Google DeepMind News
Google DeepMind News
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News
V
Visual Studio Blog
Microsoft Azure Blog
Microsoft Azure Blog
MyScale Blog
MyScale Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
罗磊的独立博客
N
Netflix TechBlog - Medium
M
MIT News - Artificial intelligence
G
Google Developers Blog
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
小众软件
小众软件
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
S
SegmentFault 最新的问题
H
Help Net Security
量子位

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 fix(macOS): enable undo/redo in webchat composer text input (#34962) · openclaw/openclaw@00951dc Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(qa): sanitize evidence gallery metadata · openclaw/op...
vincentkoc · 2026-06-20 · via Recent Commits to openclaw:main

@@ -114,6 +114,20 @@ function sanitizeGalleryPreview(

114114

return value === null ? null : sanitizeGalleryText(value, params);

115115

}

116116117+

function sanitizeGalleryStringArray(

118+

values: Iterable<unknown>,

119+

params: {

120+

extraRoots?: readonly string[];

121+

repoRoot: string;

122+

},

123+

) {

124+

return readOrderedStringArray(

125+

Array.from(values)

126+

.filter((value): value is string => typeof value === "string")

127+

.map((value) => sanitizeGalleryText(value, params)),

128+

);

129+

}

130+117131

async function realpathIfExists(filePath: string): Promise<string | null> {

118132

return fs.realpath(filePath).catch(() => null);

119133

}

@@ -422,11 +436,11 @@ async function buildArtifactView(params: {

422436

? "Evidence artifact is not declared by this evidence summary."

423437

: "Evidence artifact not found.",

424438

href: null,

425-

kind: params.artifact.kind,

439+

kind: sanitizeGalleryText(params.artifact.kind, params),

426440

mediaKind,

427441

path: displayPath,

428442

preview: null,

429-

source: params.artifact.source,

443+

source: sanitizeGalleryText(params.artifact.source, params),

430444

};

431445

}

432446

const hrefArtifactPath =

@@ -437,7 +451,7 @@ async function buildArtifactView(params: {

437451

exists: true,

438452

error: null,

439453

href: artifactHref(params.hrefEvidencePath, hrefArtifactPath),

440-

kind: params.artifact.kind,

454+

kind: sanitizeGalleryText(params.artifact.kind, params),

441455

mediaKind,

442456

path: displayPath,

443457

preview: await readPreview(realFile, mediaKind)

@@ -453,7 +467,7 @@ async function buildArtifactView(params: {

453467

repoRoot: params.repoRoot,

454468

}),

455469

),

456-

source: params.artifact.source,

470+

source: sanitizeGalleryText(params.artifact.source, params),

457471

};

458472

}

459473

@@ -489,19 +503,26 @@ function readStringArray(values: Iterable<unknown>) {

489503

return readOrderedStringArray(values).toSorted();

490504

}

491505492-

function readMatrixDimensionIds(value: unknown, fallback: readonly string[]): string[] {

493-

if (!Array.isArray(value)) {

494-

return readOrderedStringArray(fallback);

506+

function readMatrixDimensionIds(params: {

507+

extraRoots: readonly string[];

508+

fallback: readonly string[];

509+

repoRoot: string;

510+

value: unknown;

511+

}): string[] {

512+

if (!Array.isArray(params.value)) {

513+

return sanitizeGalleryStringArray(params.fallback, params);

495514

}

496-

const ids = readOrderedStringArray(

497-

value.map((entry) => {

515+

const ids = sanitizeGalleryStringArray(

516+

params.value.map((entry) => {

498517

if (typeof entry === "string") {

499518

return entry;

500519

}

501520

return readString(readRecord(entry)?.id);

502521

}),

522+

params,

503523

);

504-

for (const fallbackId of fallback) {

524+

for (const rawFallbackId of params.fallback) {

525+

const fallbackId = sanitizeGalleryText(rawFallbackId, params);

505526

if (!ids.includes(fallbackId)) {

506527

ids.push(fallbackId);

507528

}

@@ -549,35 +570,41 @@ function readMatrixCells(params: {

549570

: [];

550571

const entriesByCell = buildUxMatrixEvidenceEntryIndex(params.summaryEntries);

551572

return rawCells.flatMap((cell): QaEvidenceMatrixCellView[] => {

552-

const surface = readString(cell.surface);

553-

const stage = readString(cell.stage);

554-

const status = readString(cell.status) ?? "proof-gap";

555-

if (!surface || !stage) {

573+

const rawSurface = readString(cell.surface);

574+

const rawStage = readString(cell.stage);

575+

const rawStatus = readString(cell.status) ?? "proof-gap";

576+

if (!rawSurface || !rawStage) {

556577

return [];

557578

}

558579

const entry =

559-

status === "proof-gap" ? null : (entriesByCell.get(`${surface}:${stage}`) ?? null);

580+

rawStatus === "proof-gap" ? null : (entriesByCell.get(`${rawSurface}:${rawStage}`) ?? null);

560581

const artifacts = entry?.execution?.artifacts ?? [];

561582

const runner = readRecord(cell.runner);

583+

const sanitizeCellString = (value: string) =>

584+

sanitizeGalleryText(value, {

585+

extraRoots: params.extraRoots,

586+

repoRoot: params.repoRoot,

587+

});

562588

const readRunnerString = (value: unknown) => {

563589

const text = readString(value);

564-

return text

565-

? sanitizeGalleryText(text, {

566-

extraRoots: params.extraRoots,

567-

repoRoot: params.repoRoot,

568-

})

569-

: null;

590+

return text ? sanitizeCellString(text) : null;

570591

};

571592

return [

572593

{

573-

artifactKinds: readStringArray(artifacts.map((artifact) => artifact.kind)),

594+

artifactKinds: readStringArray(

595+

artifacts.map((artifact) => sanitizeCellString(artifact.kind)),

596+

),

574597

artifactPaths: artifacts.map((artifact) =>

575598

displayGalleryPath(artifact.path, {

576599

extraRoots: params.extraRoots,

577600

repoRoot: params.repoRoot,

578601

}),

579602

),

580-

coverageIds: readStringArray(Array.isArray(cell.coverageIds) ? cell.coverageIds : []),

603+

coverageIds: readStringArray(

604+

(Array.isArray(cell.coverageIds) ? cell.coverageIds : []).map((coverageId) =>

605+

typeof coverageId === "string" ? sanitizeCellString(coverageId) : coverageId,

606+

),

607+

),

581608

runner: runner

582609

? {

583610

availability: readRunnerString(runner.availability),

@@ -586,11 +613,11 @@ function readMatrixCells(params: {

586613

workflow: readRunnerString(runner.workflow),

587614

}

588615

: null,

589-

stage,

590-

status,

591-

surface,

592-

testId: entry?.test.id ?? null,

593-

title: entry?.test.title ?? null,

616+

stage: sanitizeCellString(rawStage),

617+

status: sanitizeCellString(rawStatus),

618+

surface: sanitizeCellString(rawSurface),

619+

testId: entry?.test.id ? sanitizeCellString(entry.test.id) : null,

620+

title: entry?.test.title ? sanitizeCellString(entry.test.title) : null,

594621

},

595622

];

596623

});

@@ -670,6 +697,9 @@ async function buildProducerContext(params: {

670697

const manifest = await readJsonIfExists(manifestPath, allowedRoots);

671698

const matrix = await readJsonIfExists(matrixPath, allowedRoots);

672699

const releaseLedger = await readJsonIfExists(releaseLedgerPath, allowedRoots);

700+

const run = readRecord(manifest?.run);

701+

const runId = readString(run?.runId);

702+

const runStatus = readString(run?.status);

673703

const producerFiles = Object.fromEntries(

674704

await Promise.all(

675705

UX_MATRIX_PRODUCER_FILES.map(async (file) => [

@@ -702,23 +732,27 @@ async function buildProducerContext(params: {

702732

manifest && producerFiles.manifest

703733

? {

704734

...producerFiles.manifest,

705-

runId: readString(readRecord(manifest.run)?.runId),

706-

runStatus: readString(readRecord(manifest.run)?.status),

735+

runId: runId ? sanitizeGalleryText(runId, params) : null,

736+

runStatus: runStatus ? sanitizeGalleryText(runStatus, params) : null,

707737

}

708738

: null,

709739

matrix: matrix

710740

? {

711741

cells: matrixCells,

712742

counts: readCountRecord(matrix.counts),

713743

path: toRepoRelativePath(repoRoot, matrixPath),

714-

stages: readMatrixDimensionIds(

715-

matrix.stages,

716-

matrixCells.map((cell) => cell.stage),

717-

),

718-

surfaces: readMatrixDimensionIds(

719-

matrix.surfaces,

720-

matrixCells.map((cell) => cell.surface),

721-

),

744+

stages: readMatrixDimensionIds({

745+

extraRoots: params.extraRoots,

746+

fallback: matrixCells.map((cell) => cell.stage),

747+

repoRoot,

748+

value: matrix.stages,

749+

}),

750+

surfaces: readMatrixDimensionIds({

751+

extraRoots: params.extraRoots,

752+

fallback: matrixCells.map((cell) => cell.surface),

753+

repoRoot,

754+

value: matrix.surfaces,

755+

}),

722756

}

723757

: null,

724758

preflight: {

@@ -788,6 +822,11 @@ export async function buildQaEvidenceGalleryModel(params: {

788822

const entries = await Promise.all(

789823

summary.entries.map(async (entry): Promise<QaEvidenceGalleryEntryView> => {

790824

counts[entry.result.status] += 1;

825+

const sanitizeEntryText = (value: string) =>

826+

sanitizeGalleryText(value, {

827+

extraRoots: [requestedRepoRoot],

828+

repoRoot,

829+

});

791830

return {

792831

artifacts: await Promise.all(

793832

(entry.execution?.artifacts ?? []).map((artifact) =>

@@ -803,23 +842,23 @@ export async function buildQaEvidenceGalleryModel(params: {

803842

),

804843

),

805844

),

806-

coverage: entry.coverage,

845+

coverage: entry.coverage.map((coverage) => ({

846+

id: sanitizeEntryText(coverage.id),

847+

role: sanitizeEntryText(coverage.role),

848+

})),

807849

failureReason: entry.result.failure?.reason

808-

? sanitizeGalleryText(entry.result.failure.reason, {

809-

extraRoots: [requestedRepoRoot],

810-

repoRoot,

811-

})

850+

? sanitizeEntryText(entry.result.failure.reason)

812851

: null,

813-

id: entry.test.id,

814-

kind: entry.test.kind,

852+

id: sanitizeEntryText(entry.test.id),

853+

kind: sanitizeEntryText(entry.test.kind),

815854

sourcePath: entry.test.source?.path

816855

? displayGalleryPath(entry.test.source.path, {

817856

extraRoots: [requestedRepoRoot],

818857

repoRoot,

819858

})

820859

: null,

821860

status: entry.result.status,

822-

title: entry.test.title,

861+

title: sanitizeEntryText(entry.test.title),

823862

};

824863

}),

825864

);

@@ -829,7 +868,9 @@ export async function buildQaEvidenceGalleryModel(params: {

829868

evidenceMode: summary.evidenceMode,

830869

evidencePath: hrefEvidencePath,

831870

generatedAt: summary.generatedAt,

832-

profile: summary.profile ?? null,

871+

profile: summary.profile

872+

? sanitizeGalleryText(summary.profile, { extraRoots: [requestedRepoRoot], repoRoot })

873+

: null,

833874

producerContext: await buildProducerContext({

834875

evidencePath,

835876

extraRoots: [requestedRepoRoot],