fix(qa): 周报正文移除中英文质量统计口径说明
build / build (push) Successful in 1m13s

仅删除周报说明段及模板占位,保留自然月规则、指标数值和来源审计。
历史已保存周报不因模板变更自动改写,保留中英文各六节。
验证:移除说明断言先红后绿,自然月指标/来源及历史证据保留测试通过,完整门禁与原生备份恢复通过。
This commit is contained in:
姚章浩
2026-10-25 17:15:35 +08:00
parent 0f89c82625
commit 226d47a72d
4 changed files with 13 additions and 10 deletions
+6
View File
@@ -76,6 +76,12 @@
> `0.1.12`),由 `scripts/version.py` 从 git **算出来**;开发交付的独立说明写入本文件“开发快照”章节,并打 `snapshot/vX.Y.Z` 注释标签 ⇒ 每次开发交付均可追溯,
> 但"发布版本"仍然只能由人定(CI 不会自动升版本、不会打 tag)。
## 开发快照 snapshot/v0.1.61 - 2026-10-25
### Changed
- 周报中英文正文移除质量统计月份、时间范围及分母规则说明,保留覆盖率、正确率及原自然月计算口径与来源审计。
## 开发快照 snapshot/v0.1.60 - 2026-10-25
### Added
@@ -91,7 +91,7 @@ func TestMasterCalendarMonthsResetAndCrossingWeekReadsPreviousMonth(t *testing.T
t.Fatal("missing October monthly point")
}
prefill, e := s.PrefillWeeklyDraft(ctx, "2026-W40", WeeklyDraftPrefillRequest{BaseRevision: 0, Nonce: "fixture_monthly_prefill_0001"}, "fixture-admin", time.Now())
if e != nil || !strings.Contains(prefill.Draft.Markdown, "质量统计月:2026-09") || !strings.Contains(prefill.Draft.Markdown, "Coverage Rate: 66.67%") || !strings.Contains(prefill.Draft.Markdown, "Accuracy Rate: 100.00%") {
if e != nil || strings.Contains(prefill.Draft.Markdown, "质量统计月:") || strings.Contains(prefill.Draft.Markdown, "Quality month (Beijing):") || !strings.Contains(prefill.Draft.Markdown, "Coverage Rate: 66.67%") || !strings.Contains(prefill.Draft.Markdown, "Accuracy Rate: 100.00%") {
t.Fatal("new prefill did not use the same September rates", e)
}
var before string
-8
View File
@@ -90,7 +90,6 @@ func renderWeeklyTemplate(week string, data Dashboard, now time.Time) (string, j
qualitySourceWeekKey = p.Week
}
}
qualityPeriodEN, qualityPeriodZH := "", ""
if data.QualityPeriod != nil || data.MonthlyQuality != nil {
period, rates := data.QualityPeriod, data.MonthlyQuality
if period == nil || rates == nil || period.Source != dashboardMonthlySource || period.PolicyVersion != dashboardMonthlyPolicy || rates.Records < 0 {
@@ -102,8 +101,6 @@ func renderWeeklyTemplate(week string, data Dashboard, now time.Time) (string, j
}
coverage, accuracy = rates.Coverage.Percent, rates.Correctness.Percent
qualitySource, qualitySourceWeekKey = dashboardMonthlySource, ""
qualityPeriodEN = fmt.Sprintf("Quality month (Beijing): %s; [%s, %s). Each rate is yes / (yes + no); pending and other unresolved values are excluded.", period.Month, period.Start.In(dashboardLocation).Format(time.RFC3339), period.CutoffAt.In(dashboardLocation).Format(time.RFC3339))
qualityPeriodZH = fmt.Sprintf("质量统计月:%s(北京时间);范围 [%s, %s)。分别按是÷(是+否)计算,待确认等不计分母;跨月周按周一所在月。", period.Month, period.Start.In(dashboardLocation).Format(time.RFC3339), period.CutoffAt.In(dashboardLocation).Format(time.RFC3339))
}
if !validWeeklyValue(coverage, true) || !validWeeklyValue(accuracy, true) {
return "", nil, dobotaiops.ErrInvalidQuery
@@ -118,7 +115,6 @@ func renderWeeklyTemplate(week string, data Dashboard, now time.Time) (string, j
"{{YEAR}}", week[:4], "{{WEEK}}", week[6:],
"{{TOTAL_QUESTIONS}}", fmt.Sprint(data.TotalIssues), "{{NEW_THIS_WEEK}}", fmt.Sprint(data.NewThisWeek),
"{{COVERAGE_RATE}}", weeklyPercent(coverage), "{{ACCURACY_RATE}}", weeklyPercent(accuracy),
"{{QUALITY_PERIOD_EN}}", qualityPeriodEN, "{{QUALITY_PERIOD_ZH}}", qualityPeriodZH,
"{{MONTH_EN}}", month.Format("January 2006"), "{{MONTH_ZH}}", fmt.Sprintf("%d年%d月", month.Year(), month.Month()),
"{{AVERAGE_USAGE_RANKING_EN}}", weeklyRegionRanking(data.Regions, false, true), "{{AVERAGE_USAGE_RANKING_ZH}}", weeklyRegionRanking(data.Regions, false, false),
"{{USAGE_COVERAGE_RANKING_EN}}", weeklyRegionRanking(data.Regions, true, true), "{{USAGE_COVERAGE_RANKING_ZH}}", weeklyRegionRanking(data.Regions, true, false),
@@ -143,8 +139,6 @@ Coverage Rate: {{COVERAGE_RATE}}
Accuracy Rate: {{ACCURACY_RATE}}
{{QUALITY_PERIOD_EN}}
## 3. {{MONTH_EN}} Regional Average Usage Ranking
{{AVERAGE_USAGE_RANKING_EN}}
@@ -175,8 +169,6 @@ Accuracy Rate: {{ACCURACY_RATE}}
正确率:{{ACCURACY_RATE}}
{{QUALITY_PERIOD_ZH}}
## 三、{{MONTH_ZH}}区域人均使用次数排名
{{AVERAGE_USAGE_RANKING_ZH}}
+6 -1
View File
@@ -21,9 +21,14 @@ func TestWeeklyTemplateCalendarMonthOverridesOnlyNewPrefillNotHistoricalEvidence
}
var meta map[string]any
_ = json.Unmarshal(seed, &meta)
if !strings.Contains(md, "Coverage Rate: 66.67%") || !strings.Contains(md, "Accuracy Rate: 50.00%") || !strings.Contains(md, "质量统计月:2026-09") || meta["quality_source"] != dashboardMonthlySource {
if !strings.Contains(md, "Coverage Rate: 66.67%") || !strings.Contains(md, "Accuracy Rate: 50.00%") || meta["quality_source"] != dashboardMonthlySource {
t.Fatal("new weekly prefill still uses historical/week quality instead of the selected calendar month", md)
}
for _, removed := range []string{"Quality month (Beijing):", "质量统计月:", "Each rate is yes /", "跨月周按周一所在月", "{{QUALITY_PERIOD_"} {
if strings.Contains(md, removed) {
t.Fatalf("weekly report still contains the removed quality-period note: %s", removed)
}
}
if data.ReportedWeeks[0].CoveragePercent != 57.23 {
t.Fatal("historical reported evidence changed")
}