F2-4: 全量批量回归 harness + 报告 + Notification import 修复

- 新增 tools/s3_rewriter/run_batch_regression.py:1,322 条(FULL_AUTO 507 + NO_S3 815)
  全量批量回归 harness;并发 6,写路径安全排除,失败自动归因分桶
- rewrite.py F2-4 修复:新增 _NOTIF_IMPORT_RE,在 _apply_dynamic_button 和
  rewrite_script 末尾统一剥离 com.vaadin.ui.Notification import,下次重跑改写器自动生效
- 磁盘产物 patch:17 条 FULL_AUTO groovy 批量剥离 Notification import
- 结果 JSON:batch_regression_20260612_024512.json(0.46MB)
- 报告:docs/P1/F2-4批量回归报告.md

回归结论:FULL_AUTO 90.7%(459/506),闭包动词专项 3/4 通过,
e2e 50 基线 46/50(4 条均在已知缺口桶,无新增回归),真缺口 42 条

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
2026-06-12 02:47:23 +08:00
parent 5f0b2d2c7b
commit b453dde65f
21 changed files with 18397 additions and 71 deletions

View File

@@ -441,6 +441,11 @@ _LISTENER_IMPORT_RE = re.compile(
r'ui\.Button\.ClickListener);\s*\n?',
re.MULTILINE,
)
# F2-4 修复: Notification_show 规则改写后 Notification/Type import 不再需要
_NOTIF_IMPORT_RE = re.compile(
r'^[ \t]*import\s+com\.vaadin\.ui\.Notification(?:\.\w+)?;\s*\n?',
re.MULTILINE,
)
# 匹配: [final] Button VAR = new Button("文案") 或 [def/final] Button VAR = new Button("文案")
_BTN_DECL_RE = re.compile(
@@ -685,6 +690,8 @@ def _rewrite_dynamic_buttons(text: str) -> Tuple[str, int]:
r'^[ \t]*import\s+com\.vaadin\.ui\.Button(?:\.\w+)?;\s*\n?',
'', working, flags=re.MULTILINE
)
# F2-4 修复: 同步清理 Notification import(Notification_show 规则改写后无需 vaadin 类)
working = _NOTIF_IMPORT_RE.sub('', working)
return working, count
@@ -1103,7 +1110,12 @@ def rewrite_script(source: str) -> Tuple[str, List[RewriteDetail], str]:
count=opt_count,
))
# ── 5.9 分类 ──────────────────────────────────────────────
# ── 5.9 全局 Vaadin import 清理 ──────────────────────────
# F2-4: Notification_show / dynamic_button 等规则改写后,vaadin Notification
# import 已无用;在分类前统一剥离,避免引擎编译失败。
working = _NOTIF_IMPORT_RE.sub('', working)
# ── 5.10 分类 ──────────────────────────────────────────────
if not _has_s3(working):
label = "FULL_AUTO"
else: