feat: remove capability execution status markers
This commit is contained in:
1 parent
e956ec9055
commit
d22468e29f
16 files changed
+25
-73
No files matched your search
@@ -18,7 +18,7 @@ export function readBundle() {
|
||||
return { manifest, groups: manifest.groups.map(entry => ({ entry, flow: JSON.parse(fs.readFileSync(path.join(bundleRoot, entry.file), "utf8")) })) };
|
||||
}
|
||||
|
||||
// 静态清单供离线校验;真实运行前再与 Electron 返回的 implemented 清单逐项比较。
|
||||
// 静态清单供离线校验;真实运行前再与运行时注册清单逐项比较。
|
||||
export function staticCatalog() {
|
||||
const registered = new Set();
|
||||
const directory = path.join(projectRoot, "src/main/capabilities");
|
||||
@@ -35,7 +35,7 @@ export function staticCatalog() {
|
||||
visit(source);
|
||||
}
|
||||
const catalog = JSON.parse(fs.readFileSync(path.join(projectRoot, "resources/catalog.json"), "utf8"));
|
||||
for (const c of catalog.components) c.implemented = containers.has(c.id) || registered.has(c.id) || registered.has(c.functionName);
|
||||
for (const c of catalog.components) c.registered = containers.has(c.id) || registered.has(c.id) || registered.has(c.functionName);
|
||||
return catalog;
|
||||
}
|
||||
|
||||
@@ -47,9 +47,9 @@ export async function validator() {
|
||||
|
||||
export async function verifyBundle(catalog = staticCatalog()) {
|
||||
const { manifest, groups } = readBundle();
|
||||
const expected = catalog.components.filter(c => c.group === "app" && c.implemented).map(c => c.id).sort();
|
||||
const expected = catalog.components.filter(c => c.group === "app" && c.registered).map(c => c.id).sort();
|
||||
const actual = groups.flatMap(g => g.entry.components).sort();
|
||||
if (groups.length !== 13 || actual.length !== 50 || new Set(actual).size !== 50 || JSON.stringify(actual) !== JSON.stringify(expected)) throw new Error("流程包与当前 50 项可执行清单不一致,请重新生成并核对覆盖范围。");
|
||||
if (groups.length !== 13 || actual.length !== 50 || new Set(actual).size !== 50 || JSON.stringify(actual) !== JSON.stringify(expected)) throw new Error("流程包与当前 50 项验收清单不一致,请重新生成并核对覆盖范围。");
|
||||
const validateFlow = await validator();
|
||||
const validation = {};
|
||||
for (const { flow, entry } of groups) {
|
||||
@@ -323,7 +323,7 @@ export function makeReport(evidence) {
|
||||
const counts = Object.fromEntries(priority.map(s => [s, rows.filter(r => r.status === s).length]));
|
||||
const escape = value => String(value ?? "无执行记录").replace(/\|/g, "\\|").replace(/[\r\n]+/g, " ").slice(0, 1200);
|
||||
const recordedAt = evidence.generatedAt ? new Intl.DateTimeFormat("zh-CN", { timeZone: "Asia/Shanghai", dateStyle: "medium", timeStyle: "medium", hour12: false }).format(new Date(evidence.generatedAt)) + "(北京时间)" : "未执行";
|
||||
const lines = ["# 应用与系统组件测试报告", "", `记录时间:${recordedAt}。覆盖 50 项可执行组件,13 组任务。`, "",
|
||||
const lines = ["# 应用与系统组件测试报告", "", `记录时间:${recordedAt}。覆盖 50 项验收组件,13 组任务。`, "",
|
||||
`按组件统计:通过 ${counts.PASS},失败 ${counts.FAIL},阻塞 ${counts.BLOCKED},待人工确认 ${counts.MANUAL},未运行 ${counts.UNRUN}。`, "",
|
||||
"状态依据是断言、前置校验和人工证据,节点执行成功不直接代表功能通过。未执行手动系统操作。", "",
|
||||
"| 组 | 组件 ID | 名称 | 状态 |", "|---|---|---|---|"];
|
||||
|
||||
Reference in new issue
Block a user