|
- import fs from 'node:fs';
- import path from 'node:path';
- import {manifest,videos,selectNarrationRelease} from '../../unreal_tran_web/src/features/virtual-training-scripts/narration-release.js';
- const dir=path.resolve('reports/bridge-narration-junhao-20260921');
- const progress=JSON.parse(fs.readFileSync(path.join(dir,'generation.json'),'utf8'));
- const quality=JSON.parse(fs.readFileSync(path.join(dir,'quality.json'),'utf8'));
- const old=selectNarrationRelease('previous');
- const esc=s=>String(s??'').replaceAll('&','&').replaceAll('<','<').replaceAll('>','>').replaceAll('"','"');
- const link=url=>'../../../unreal_tran_web/public'+url;
- const cards=manifest.scripts.flatMap(p=>p.steps.map(c=>{
- const v=videos.scripts.find(s=>s.id===p.id).steps.find(s=>s.stepCode===c.stepCode);
- const before=old.videos.scripts.find(s=>s.id===p.id).steps.find(s=>s.stepCode===c.stepCode);
- const q=quality.find(s=>s.key===`${p.code}-step-${String(c.number).padStart(2,'0')}`);
- return `<article data-code="${p.code}"><h2>${p.code} · 第${c.number}步<br>${esc(c.expectedTitle)}</h2><p>${esc(c.text)}</p><video controls preload="none" src="${link(v.url)}"></video><p><a href="${link(c.url)}">Junhao 语音</a> · <a href="${link(before.url)}">旧版视频对比</a> · ${v.duration.toFixed(2)}秒</p><details><summary>查看机器转写辅助记录</summary><p>${esc(q.asrText)}</p><small>专业词语可能识别错误;此记录不能代替试听或口型验收。音轨比对偏移 ${q.audioLagMs}ms。</small></details></article>`;
- })).join('');
- const duration=progress.clips.reduce((n,c)=>n+c.videoDuration,0);
- fs.writeFileSync(path.join(dir,'index.html'),`<!doctype html><html lang="zh-CN"><meta charset="utf-8"><meta name="viewport" content="width=device-width"><title>005~008 · Junhao 新讲解</title><style>body{margin:28px auto;max-width:1200px;padding:0 22px;background:#eff5f3;color:#173e36;font:16px/1.7 system-ui,"Microsoft YaHei",sans-serif}h1{font-size:27px}main{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:20px}article,.summary{background:white;border:1px solid #cbdfd8;border-radius:12px;padding:20px}h2{font-size:17px}video{width:100%;aspect-ratio:3/4;background:#eee;border-radius:8px}a{color:#00816b}small{color:#58776d}nav{position:sticky;top:0;padding:15px 0;background:#eff5f3}select{font:inherit;padding:6px 12px}[hidden]{display:none}@media(max-width:850px){main{grid-template-columns:1fr}}</style><h1>005~008 · 新版步骤讲解</h1><div class="summary"><b>教员1 v2 · MOSS · Junhao · 1.0倍速 · 3:4</b><p>39段视频,共${duration.toFixed(2)}秒。对应39份新语音,复核提示音同样使用Junhao。旧版80个媒体文件全部保留。</p><p>本地任务已切换新版静态引用。音轨、编码和时长检查通过;发音、自然度和视觉口型仍需人工试听确认。</p><p><a href="交付说明.md">文件位置与回退方法</a> · <a href="../bridge-model-acceptance-20260921/index.html">四套模型逐步验收</a></p></div><nav><select id="filter"><option value="">全部流程</option>${manifest.scripts.map(p=>`<option value="${p.code}">${p.code} · ${esc(p.title)}</option>`).join('')}</select></nav><main>${cards}</main><script>filter.onchange=()=>document.querySelectorAll('article').forEach(a=>a.hidden=filter.value&&a.dataset.code!==filter.value);document.addEventListener('play',e=>document.querySelectorAll('video,audio').forEach(a=>{if(a!==e.target)a.pause()}),true)</script></html>`);
- const notes=`# Junhao 讲解资源交付(2026-09-21)
-
- - 默认配置来源:数字车间所绑定的“${progress.profile.agent}”,配置版本${progress.profile.agentDataVersion};默认音色MOSS · Junhao,语速1.0,教员1 v2。
- - 39段操作步骤视频(480×640、25fps、H.264/AAC),39份配套WAV;两个平衡阀复核步骤共享1份Junhao提示音。
- - 当前静态目录:\`unreal_tran_web/public/legacy/virtual-training/narration-revisions/junhao-v2-20260921/\`。
- - 文件以任务号和步骤命名,例如\`TASK-VIRTUAL-005-step-01.mp4\`和同名WAV。
- - 新版引用:\`src/features/virtual-training-scripts/narration-release.js\`。新的两个清单文件记录准确标题、说明、讲解词、时长、SHA-256。
- - 原清单和80个旧媒体文件保持原字节;\`previous-media.json\`记录旧文件摘要。4段初版重做前的音视频也保留在本报告目录。
-
- ## 回退
-
- 在前端环境配置中设置\`VITE_BRIDGE_NARRATION_RELEASE=previous\`,开发环境重启Vite;部署环境重新构建前端。切回新版设为\`junhao-v2-20260921\`。两代音视频都在项目中,无需重新生成或改数据库。
-
- ## 实施范围
-
- 只切换005~008四个静态脚本的操作步骤讲解。背景/讲解导入页与普通训练编排任务不改,005独立新模型编排验证入口116保留原资产。任务模型、步骤、评分和成绩记录不改。没有发布测试环境,也没有提交或推送Git。
-
- ## 验证
-
- - 39段全部通过解码、分辨率、帧率、音轨、时长及源音频比对;音轨偏移${Math.min(...quality.map(q=>q.audioLagMs))}~${Math.max(...quality.map(q=>q.audioLagMs))}ms,不是视觉口型误差测量。
- - CPU ASR辅助转写记录见\`quality.json\`。专业名词/序号会误识别,${quality.filter(q=>q.needsTranscriptReview).length}段标为人工复核;不能把机器转写相似度当作最终发音评分。
- - 四任务本地浏览器播放/切换语音/视频错误回退/加载门控见\`playback.json\`;局域网结果见\`lan-playback.json\`。
- - 19项模型与讲解合同测试、正式路由检查、生产构建通过。
- - 模型验收见相邻报告,39步95项配置动作通过;原正式005另验证5步6项通过。内容上仍有23步简化、5步待确认和2步关键内容缺失。
-
- 技术检查不代替自然度与视觉口型的人工验收,请使用本目录index.html逐段试听对比。
- `;
- fs.writeFileSync(path.join(dir,'交付说明.md'),notes);
- console.log('Review page and rollback documentation ready.');
|