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

推荐订阅源

M
MIT News - Artificial intelligence
罗磊的独立博客
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
Last Week in AI
Last Week in AI
S
SegmentFault 最新的问题
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
美团技术团队
人人都是产品经理
人人都是产品经理
WordPress大学
WordPress大学
The Cloudflare Blog
IT之家
IT之家
雷峰网
雷峰网
小众软件
小众软件
博客园 - 叶小钗
博客园 - 聂微东
爱范儿
爱范儿
博客园 - 司徒正美
博客园 - 三生石上(FineUI控件)
V
Visual Studio Blog
博客园 - 【当耐特】
V
V2EX
博客园_首页
T
Tailwind CSS Blog

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
QA: track scenario coverage intent · openclaw/openclaw@3a...
gumadeiras · 2026-04-18 · via Recent Commits to openclaw:main

@@ -0,0 +1,192 @@

1+

import type { QaSeedScenarioWithSource } from "./scenario-catalog.js";

2+3+

export type QaCoverageScenarioSummary = {

4+

id: string;

5+

title: string;

6+

sourcePath: string;

7+

theme: string;

8+

surfaces: string[];

9+

risk: string;

10+

};

11+12+

export type QaCoverageIntent = "primary" | "secondary";

13+14+

export type QaCoverageScenarioReference = QaCoverageScenarioSummary & {

15+

intent: QaCoverageIntent;

16+

};

17+18+

export type QaCoverageFeatureSummary = {

19+

id: string;

20+

scenarios: QaCoverageScenarioReference[];

21+

};

22+23+

export type QaCoverageInventory = {

24+

scenarioCount: number;

25+

coverageIdCount: number;

26+

primaryCoverageIdCount: number;

27+

secondaryCoverageIdCount: number;

28+

features: QaCoverageFeatureSummary[];

29+

overlappingCoverage: QaCoverageFeatureSummary[];

30+

missingCoverage: QaCoverageScenarioSummary[];

31+

byTheme: Record<string, QaCoverageFeatureSummary[]>;

32+

bySurface: Record<string, QaCoverageFeatureSummary[]>;

33+

};

34+35+

function scenarioTheme(sourcePath: string) {

36+

const parts = sourcePath.split("/");

37+

return parts[2] ?? "unknown";

38+

}

39+40+

function scenarioSurfaces(scenario: QaSeedScenarioWithSource) {

41+

return scenario.surfaces && scenario.surfaces.length > 0 ? scenario.surfaces : [scenario.surface];

42+

}

43+44+

function scenarioRisk(scenario: QaSeedScenarioWithSource) {

45+

return scenario.risk ?? scenario.riskLevel ?? "unassigned";

46+

}

47+48+

function summarizeScenario(scenario: QaSeedScenarioWithSource): QaCoverageScenarioSummary {

49+

return {

50+

id: scenario.id,

51+

title: scenario.title,

52+

sourcePath: scenario.sourcePath,

53+

theme: scenarioTheme(scenario.sourcePath),

54+

surfaces: scenarioSurfaces(scenario),

55+

risk: scenarioRisk(scenario),

56+

};

57+

}

58+59+

function sortFeatures(features: readonly QaCoverageFeatureSummary[]) {

60+

return features.toSorted((left, right) => left.id.localeCompare(right.id));

61+

}

62+63+

export function buildQaCoverageInventory(

64+

scenarios: readonly QaSeedScenarioWithSource[],

65+

): QaCoverageInventory {

66+

const byCoverageId = new Map<string, QaCoverageFeatureSummary>();

67+

const primaryCoverageIds = new Set<string>();

68+

const secondaryCoverageIds = new Set<string>();

69+

const missingCoverage: QaCoverageScenarioSummary[] = [];

70+71+

const addCoverage = (

72+

scenario: QaSeedScenarioWithSource,

73+

coverageIds: readonly string[] | undefined,

74+

intent: QaCoverageIntent,

75+

) => {

76+

const summary = summarizeScenario(scenario);

77+

for (const coverageId of coverageIds ?? []) {

78+

const feature = byCoverageId.get(coverageId) ?? {

79+

id: coverageId,

80+

scenarios: [],

81+

};

82+

feature.scenarios.push({ ...summary, intent });

83+

byCoverageId.set(coverageId, feature);

84+

if (intent === "primary") {

85+

primaryCoverageIds.add(coverageId);

86+

} else {

87+

secondaryCoverageIds.add(coverageId);

88+

}

89+

}

90+

};

91+92+

for (const scenario of scenarios) {

93+

if (!scenario.coverage) {

94+

missingCoverage.push(summarizeScenario(scenario));

95+

continue;

96+

}

97+

addCoverage(scenario, scenario.coverage.primary, "primary");

98+

addCoverage(scenario, scenario.coverage.secondary, "secondary");

99+

}

100+101+

const features = sortFeatures([...byCoverageId.values()]);

102+

const overlappingCoverage = features.filter((feature) => feature.scenarios.length > 1);

103+

const byTheme: Record<string, QaCoverageFeatureSummary[]> = {};

104+

const bySurface: Record<string, QaCoverageFeatureSummary[]> = {};

105+106+

for (const feature of features) {

107+

const themes = new Set(feature.scenarios.map((scenario) => scenario.theme));

108+

for (const theme of themes) {

109+

byTheme[theme] ??= [];

110+

byTheme[theme].push({

111+

...feature,

112+

scenarios: feature.scenarios.filter((scenario) => scenario.theme === theme),

113+

});

114+

}

115+

const surfaces = new Set(feature.scenarios.flatMap((scenario) => scenario.surfaces));

116+

for (const surface of surfaces) {

117+

bySurface[surface] ??= [];

118+

bySurface[surface].push({

119+

...feature,

120+

scenarios: feature.scenarios.filter((scenario) => scenario.surfaces.includes(surface)),

121+

});

122+

}

123+

}

124+125+

return {

126+

scenarioCount: scenarios.length,

127+

coverageIdCount: features.length,

128+

primaryCoverageIdCount: primaryCoverageIds.size,

129+

secondaryCoverageIdCount: secondaryCoverageIds.size,

130+

features,

131+

overlappingCoverage,

132+

missingCoverage,

133+

byTheme,

134+

bySurface,

135+

};

136+

}

137+138+

function pushFeatureLines(lines: string[], features: readonly QaCoverageFeatureSummary[]) {

139+

for (const feature of sortFeatures(features)) {

140+

const scenarios = feature.scenarios

141+

.map((scenario) => `${scenario.intent}: ${scenario.id} (${scenario.sourcePath})`)

142+

.join(", ");

143+

lines.push(`- ${feature.id}: ${scenarios}`);

144+

}

145+

}

146+147+

export function renderQaCoverageMarkdownReport(inventory: QaCoverageInventory): string {

148+

const lines: string[] = [

149+

"# QA Coverage Inventory",

150+

"",

151+

`- Scenarios: ${inventory.scenarioCount}`,

152+

`- Coverage IDs: ${inventory.coverageIdCount}`,

153+

`- Primary coverage IDs: ${inventory.primaryCoverageIdCount}`,

154+

`- Secondary coverage IDs: ${inventory.secondaryCoverageIdCount}`,

155+

`- Overlapping coverage IDs: ${inventory.overlappingCoverage.length}`,

156+

`- Missing coverage metadata: ${inventory.missingCoverage.length}`,

157+

"",

158+

"## By Theme",

159+

"",

160+

];

161+162+

for (const theme of Object.keys(inventory.byTheme).toSorted()) {

163+

lines.push(`### ${theme}`, "");

164+

pushFeatureLines(lines, inventory.byTheme[theme] ?? []);

165+

lines.push("");

166+

}

167+168+

lines.push("## By Surface", "");

169+

for (const surface of Object.keys(inventory.bySurface).toSorted()) {

170+

lines.push(`### ${surface}`, "");

171+

pushFeatureLines(lines, inventory.bySurface[surface] ?? []);

172+

lines.push("");

173+

}

174+175+

if (inventory.overlappingCoverage.length > 0) {

176+

lines.push("## Overlap", "");

177+

pushFeatureLines(lines, inventory.overlappingCoverage);

178+

lines.push("");

179+

}

180+181+

if (inventory.missingCoverage.length > 0) {

182+

lines.push("## Missing Metadata", "");

183+

for (const scenario of inventory.missingCoverage.toSorted((left, right) =>

184+

left.id.localeCompare(right.id),

185+

)) {

186+

lines.push(`- ${scenario.id}: ${scenario.sourcePath}`);

187+

}

188+

lines.push("");

189+

}

190+191+

return `${lines.join("\n").trimEnd()}\n`;

192+

}