feat(session-async): add /api/score/session_async with incremental session report aggregation
- New POST /api/score/session_async endpoint: same session_id calls append to one shared report
- New GET /api/score/sessions/{session_id}: returns call_count, metric_means, all job records
- New GET /api/score/session/jobs/{job_id}: individual call status
- SessionScoreJobManager: deterministic run_id from session_id, per-session mutex for CSV append, advisor regenerated on every call
- SessionScoreRequest (extends ScoreRequest + session_id), SessionScoreJobResponse, SessionStatus models added
- 24 new tests, all passing
chore(weighted-score): comment out 综合加权得分 display and computation
- report.js: hide 综合加权得分 card in report detail page
- score_jobs.js: hide 综合 chip in async job list
- report_builder.py: overall_ws=None (computation disabled)
- summary.py: weighted_score summary line disabled
- evaluator.py: weighted_score/sample_weight columns no longer written to scores.csv
- score.py /api/score: weighted_score always returns null
- score_job_manager.py + session_score_manager.py: weighted=None
- Updated 3 tests to match new behaviour (6 pre-existing failures unchanged)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -128,17 +128,17 @@ const Report = {
|
||||
wrap.appendChild(card);
|
||||
});
|
||||
|
||||
// 综合加权得分卡片
|
||||
const wsValue = (report && report.weighted_score_mean !== undefined) ? report.weighted_score_mean : null;
|
||||
const wsCard = document.createElement("div");
|
||||
wsCard.className = "metric-card weighted-score-card";
|
||||
const wsCls = App.scoreClass(wsValue);
|
||||
const wsText = wsValue === null || wsValue === undefined ? "n/a" : wsValue.toFixed(2);
|
||||
wsCard.innerHTML = `
|
||||
<div class="metric-value ${wsCls}">${wsText}</div>
|
||||
<div class="metric-name">综合加权得分</div>
|
||||
`;
|
||||
wrap.appendChild(wsCard);
|
||||
// 综合加权得分卡片(已暂时隐藏)
|
||||
// const wsValue = (report && report.weighted_score_mean !== undefined) ? report.weighted_score_mean : null;
|
||||
// const wsCard = document.createElement("div");
|
||||
// wsCard.className = "metric-card weighted-score-card";
|
||||
// const wsCls = App.scoreClass(wsValue);
|
||||
// const wsText = wsValue === null || wsValue === undefined ? "n/a" : wsValue.toFixed(2);
|
||||
// wsCard.innerHTML = `
|
||||
// <div class="metric-value ${wsCls}">${wsText}</div>
|
||||
// <div class="metric-name">综合加权得分</div>
|
||||
// `;
|
||||
// wrap.appendChild(wsCard);
|
||||
},
|
||||
|
||||
// ② 分数分布直方图(可切换指标)。
|
||||
|
||||
@@ -55,10 +55,11 @@ const ScoreJobs = {
|
||||
return `<span class="metric-chip" title="${App.escape(k)}">${App.escape(App.shortMetric(k))} <b class="${cls}">${text}</b></span>`;
|
||||
})
|
||||
.join(" ");
|
||||
if (job.weighted_score !== null && job.weighted_score !== undefined) {
|
||||
const cls = App.scoreClass(job.weighted_score);
|
||||
scoreHtml += ` <span class="metric-chip">综合 <b class="${cls}">${Number(job.weighted_score).toFixed(3)}</b></span>`;
|
||||
}
|
||||
// 综合加权得分(已暂时隐藏)
|
||||
// if (job.weighted_score !== null && job.weighted_score !== undefined) {
|
||||
// const cls = App.scoreClass(job.weighted_score);
|
||||
// scoreHtml += ` <span class="metric-chip">综合 <b class="${cls}">${Number(job.weighted_score).toFixed(3)}</b></span>`;
|
||||
// }
|
||||
} else if (job.status === "failed") {
|
||||
scoreHtml = `<span style="color:var(--bad);font-size:12px">${App.escape((job.error || "").slice(0, 80))}</span>`;
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user