@@ -50,6 +50,29 @@ function formatNumber(value, locale) {
5050 } ) . format ( number ( value ) ) ;
5151}
5252
53+ function reviewedSessionPopulation ( summary , language ) {
54+ // Usage efficiency is a separate all-eligible activity census. The visible
55+ // reviewed-Session metric follows the evidence selection used by findings.
56+ const selection = summary ?. evidenceBoundary ?. manifest ?. selection
57+ ?? summary ?. atAGlance ?. coverage ?. selection ;
58+ const hasCounts = selection
59+ && Object . hasOwn ( selection , "analyzedCount" )
60+ && Object . hasOwn ( selection , "eligibleCount" ) ;
61+ const analyzed = Number ( selection ?. analyzedCount ) ;
62+ const eligible = Number ( selection ?. eligibleCount ) ;
63+ const available = hasCounts
64+ && Number . isInteger ( analyzed )
65+ && analyzed >= 0
66+ && Number . isInteger ( eligible )
67+ && eligible >= 0 ;
68+ return {
69+ value : available
70+ ? `${ formatNumber ( analyzed , language ) } / ${ formatNumber ( eligible , language ) } `
71+ : "N/A" ,
72+ confidence : available ? selection . confidence ?? "" : "" ,
73+ } ;
74+ }
75+
5376function copy ( language , en , zh ) {
5477 return language === "zh-CN" ? zh : en ;
5578}
@@ -541,14 +564,14 @@ function renderCustomize(summary, language) {
541564function renderEvidence ( summary , language ) {
542565 const boundary = summary ?. evidenceBoundary ?? { } ;
543566 const coverage = boundary ?. episodeCoverage ?? summary ?. atAGlance ?. coverage ?? { } ;
544- const selection = boundary ?. manifest ?. selection ?? coverage ?. selection ?? { } ;
567+ const population = reviewedSessionPopulation ( summary , language ) ;
545568 const learning = summary ?. learningCapture ?? { } ;
546569 const facts = [
547570 [ copy ( language , "Evidence mode" , "证据模式" ) , summary ?. evidenceMode ?? "—" ] ,
548571 [ copy ( language , "Task episodes" , "任务 Episode" ) , coverage . episodeCount ?? 0 ] ,
549572 [ copy ( language , "Edited episodes" , "含编辑 Episode" ) , coverage . editedEpisodeCount ?? 0 ] ,
550- [ copy ( language , "Sampling" , "抽样" ) , ` ${ selection . analyzedCount ?? 0 } / ${ selection . eligibleCount ?? 0 } ` ] ,
551- [ copy ( language , "Confidence" , "可信度" ) , selection . confidence ?? "—" ] ,
573+ [ copy ( language , "Sampling" , "抽样" ) , population . value ] ,
574+ [ copy ( language , "Confidence" , "可信度" ) , population . confidence || "—" ] ,
552575 [ copy ( language , "Learning state" , "学习状态" ) , learning . state ?? "—" ] ,
553576 ] ;
554577 const gaps = textLines ( boundary . sourceGaps ) ;
@@ -570,10 +593,7 @@ function renderHtmlBody(reportData) {
570593 const high = findings . filter ( ( row ) => [ "Critical" , "High" ] . includes ( row . severity ) ) . length ;
571594 const medium = findings . filter ( ( row ) => row . severity === "Medium" ) . length ;
572595 const overview = summary . overview ?? summary . strengths ?. [ 0 ] ?? copy ( language , "Reviewed Harness evidence is ready for inspection." , "已复核的 Harness 证据可供检查。" ) ;
573- const coverage = summary . atAGlance ?. coverage ?? { } ;
574- const selection = summary . usageEfficiency ?. selection ?? coverage . selection ?? { } ;
575- const analyzed = selection . analyzedSessionCount ?? selection . analyzedCount ?? 0 ;
576- const eligible = selection . eligibleSessionCount ?? selection . eligibleCount ?? summary . usageActivity ?. sessions ?. total ?? 0 ;
596+ const population = reviewedSessionPopulation ( summary , language ) ;
577597 const hasUsage = summary . usageActivity !== undefined || summary . usageEfficiency !== undefined ;
578598 const effectiveness = loopEffectiveness ( dimensions ) ;
579599 const progress = repairProgress ( findings ) ;
@@ -590,7 +610,7 @@ function renderHtmlBody(reportData) {
590610 <div class="metrics">
591611 ${ metric ( evidenceScoreLabel ( summary , language ) , `${ effectiveness } / 100` , copy ( language , "Changes after later task outcomes" , "等待后续任务结果后更新" ) , language ) }
592612 ${ metric ( copy ( language , "Asset Health / Repair Progress" , "资产健康 / 修复进度" ) , `${ progress . score } / 100` , copy ( language , `${ progress . verified } verified · ${ progress . partial } partial · ${ progress . pending } pending` , `${ progress . verified } 项已验证 · ${ progress . partial } 项部分完成 · ${ progress . pending } 项待处理` ) , language ) }
593- ${ metric ( copy ( language , "Sessions analyzed" , "会话样本" ) , ` ${ formatNumber ( analyzed , language ) } / ${ formatNumber ( eligible , language ) } ` , selection . confidence ?? "" , language ) }
613+ ${ metric ( copy ( language , "Sessions analyzed" , "会话样本" ) , population . value , population . confidence , language ) }
594614 ${ metric ( copy ( language , "Findings" , "待处理 Finding" ) , findings . length , `${ high } High · ${ medium } Medium` , language ) }
595615 </div>
596616 ${ section ( "fluency" , copy ( language , "01 · Readiness" , "01 · 就绪度" ) , copy ( language , "Five-dimension fluency" , "五维流畅度" ) , renderDimensionGrid ( summary , language ) , copy ( language , "Scores and states come from the reviewed source." , "分数与状态来自已复核 source。" ) , language ) }
0 commit comments