@@ -60,25 +60,37 @@ export function renderHtmlReport(
6060 const S : string [ ] = [ ]
6161
6262 // ===== 评分 Hero =====
63+ // 诚实原则:静态扫描下多数控制项不可验证,不展示"优秀/A"式合规结论,
64+ // 改以「风险发现数」为主指标,得分仅作"可观测项"的次要参考。
65+ const findingsN = scan . findings . length
66+ const gradeLabel = report . staticScan ? t ( '可观测项' , 'observable' ) : t ( g . zh , g . en )
67+ const verdict = report . staticScan
68+ ? ( findingsN === 0
69+ ? { txt : t ( '未发现可观测风险' , 'No observable risks' ) , c : '#16a34a' , ic : '🟢' }
70+ : { txt : t ( `发现 ${ findingsN } 项风险` , `${ findingsN } risk(s) found` ) , c : '#dc2626' , ic : '🔴' } )
71+ : { txt : t ( g . zh , g . en ) , c : g . color , ic : '' }
72+
6373 S . push ( `
6474 <section class="hero">
6575 <div class="gauge" style="--p:${ report . score } ;--c:${ g . color } ">
6676 <div class="gauge-in">
6777 <div class="gscore">${ report . score } <small>/100</small></div>
68- <div class="ggrade" style="color:${ g . color } ">${ esc ( report . grade ) } · ${ t ( g . zh , g . en ) } </div>
78+ <div class="ggrade" style="color:${ g . color } ">${ esc ( report . grade ) } · ${ esc ( gradeLabel ) } </div>
6979 </div>
7080 </div>
7181 <div class="hero-side">
82+ <div class="verdict" style="--vc:${ verdict . c } ">${ verdict . ic } ${ esc ( verdict . txt ) } </div>
7283 <div class="stat-row">
7384 ${ stat ( 'pass' , '🟢' , t ( '合规' , 'Pass' ) , report . passed ) }
7485 ${ stat ( 'warn' , '🟡' , t ( '部分' , 'Partial' ) , report . warned ) }
7586 ${ stat ( 'fail' , '🔴' , t ( '不合规' , 'Fail' ) , report . failed ) }
76- ${ stat ( 'manual' , '⚪' , t ( '待确认 ' , 'Review' ) , report . manual ) }
87+ ${ stat ( 'manual' , '⚪' , t ( '待核验 ' , 'Review' ) , report . manual ) }
7788 </div>
7889 ${ report . projectPenalty ? `<div class="penalty">⚠ ${ t ( '含项目实测风险扣分' , 'Includes project-scan penalty' ) } <b>−${ report . projectPenalty } </b></div>` : '' }
79- <p class="hero-note">${ t (
80- '得分基于本次可静态观测的项目风险。⚪ 待确认项需把 ShellWard 部署为运行时防护或人工核验。' ,
81- 'Score reflects statically-observable project risk. ⚪ items need runtime deployment or manual review.' ) } </p>
90+ <p class="hero-note">${ report . staticScan
91+ ? t ( `⚠ 本次为静态扫描:已检查 ${ report . filesScanned ?? scan . filesScanned } 个文件,仅评估可观测风险。<b>${ report . manual } 项合规控制项未验证</b>(需部署 ShellWard 运行时或人工核验)——本报告不构成完整合规结论,得分仅供参考。` ,
92+ `⚠ Static scan: checked ${ report . filesScanned ?? scan . filesScanned } files for observable risk only. <b>${ report . manual } controls unverified</b> — not a complete compliance verdict.` )
93+ : t ( '得分基于已部署运行时的合规评估。' , 'Score based on deployed-runtime assessment.' ) } </p>
8294 </div>
8395 </section>` )
8496
@@ -263,6 +275,7 @@ section,.reg{padding:0 36px}
263275.gscore small{font-size:15px;font-weight:500;color:var(--faint)}
264276.ggrade{font-size:14px;font-weight:700;margin-top:6px}
265277.hero-side{flex:1;min-width:0}
278+ .verdict{font-size:17px;font-weight:800;color:var(--vc);margin:0 0 12px}
266279.stat-row{display:grid;grid-template-columns:repeat(4,1fr);gap:10px}
267280.stat{background:#fff;border:1px solid var(--line);border-radius:10px;padding:10px 12px;text-align:center}
268281.stat .sn{font-size:22px;font-weight:800;line-height:1}
0 commit comments