Commit 1201c827 by liimin

1

1 parent 7eb91810
......@@ -87,3 +87,5 @@ apps/web/ai-workspace/.ai-direct/
# 临时调试脚本
scripts/_run-*.mjs
apps/web/ai-previews/
{
"generator": "scripts/ai-direct-apply-output.mjs",
"generatedAt": "2026-06-05T10:34:33.913Z",
"generatedAt": "2026-06-08T03:41:53.670Z",
"model": "qwen3.7-max",
"provider": "openai-compatible",
"files": [
......@@ -105,8 +105,8 @@
{
"path": "apps/web/ai-previews/testpage-preview/src/views/tt/index.vue",
"language": "vue",
"purpose": "广联二手车首页 - 包含导航栏、搜索、拍卖入口、品牌、筛选标签、车辆列表和底部TabBar",
"coAuthor": "@ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-05T09:45:21.619Z",
"purpose": "广联二手车首页 - 包含导航栏、搜索、热搜品牌、吸顶Tab和车辆卡片列表",
"coAuthor": "@ai-co-author venus-ai-direct | openai-compatible/qwen3.7-max | 2026-06-08T03:39:06.097Z",
"action": "created"
},
{
......
......@@ -17,6 +17,15 @@ const routes = [
title: "Home",
},
}
,
{
path: "/tt",
name: "tt",
component: () => import("@/views/tt/index.vue"),
meta: {
title: "tt",
},
},
];
export function createRouter(): Router {
......
......@@ -39,6 +39,9 @@ if (selected.length === 0) {
const summary = [];
for (const config of selected) {
const weight = typeof config.weight === "number" ? config.weight : 0;
let dimensionPassed = true;
for (const metric of Array.isArray(config.metrics) ? config.metrics : []) {
if (!shouldRunTier(metric.tier || config.tier || "fast", tier)) {
continue;
......@@ -51,17 +54,24 @@ for (const config of selected) {
stdio: "inherit",
});
const passed = status.status === 0;
if (!passed) dimensionPassed = false;
summary.push({
dimension: config.dimension,
id: metric.id,
status: status.status === 0 ? "passed" : "failed",
weight,
status: passed ? "passed" : "failed",
});
if (status.status !== 0) {
printSummary(summary);
process.exit(status.status ?? 1);
}
}
// 记录维度级别的汇总(用于加权计算)
summary.push({
dimension: config.dimension,
id: "_dimension",
weight,
status: dimensionPassed ? "passed" : "failed",
});
}
printSummary(summary);
......@@ -93,8 +103,37 @@ function shouldRunTier(metricTier, currentTier) {
}
function printSummary(items) {
console.log("[fitness] Summary");
for (const item of items) {
console.log(`- ${item.dimension}/${item.id}: ${item.status}`);
const metrics = items.filter((item) => item.id !== "_dimension");
const dimensions = items.filter((item) => item.id === "_dimension");
console.log("\n[fitness] ── Metric Results ──");
for (const item of metrics) {
const icon = item.status === "passed" ? "✓" : "✗";
console.log(` ${icon} ${item.dimension}/${item.id}: ${item.status}`);
}
// 加权评分
console.log("\n[fitness] ── Weighted Score ──");
let totalWeight = 0;
let weightedScore = 0;
let failedDimensions = 0;
for (const dim of dimensions) {
const weight = dim.weight || 0;
const score = dim.status === "passed" ? 1 : 0;
totalWeight += weight;
weightedScore += weight * score;
const icon = dim.status === "passed" ? "✓" : "✗";
const pct = (score * 100).toFixed(0);
console.log(` ${icon} ${dim.dimension} (weight=${weight}): ${pct}%`);
if (score === 0) failedDimensions++;
}
const overallPct = totalWeight > 0 ? ((weightedScore / totalWeight) * 100).toFixed(1) : "0.0";
console.log(`\n[fitness] Overall: ${overallPct}% (${failedDimensions}/${dimensions.length} dimension(s) failed)`);
if (failedDimensions > 0) {
process.exit(1);
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!