fix(data): corpus --limit 改每段独立预算+pdf五类循环补门控 [nas]
CI/CD / test (push) Successful in 24s
CI/CD / nas-deploy (push) Successful in 0s
CI/CD / nas-verify (push) Successful in 8s

NAS 真实冒烟(--limit 2)假死 12min 事故根因(x2):
①预算共享: ann 段吃光 limit 后 news/fulltext 即刻 break(假死其一);
②pdf 五类查询循环完全无门控无计数 → 全池 6168 股 @1.3s 扫描 ~2.2h,
   周日窗口 0 公告 0 日志=假死其二(docker stop 收尸, log 停在 lane start)
修: Ctx.stage_units+reset_stage()+budget_exhausted() 八段入口重置;
五类循环计数即耗预算;回归测试钉死(fivecat 调用数=预算数,非全池)
连带修正 smoke 语义=文档承诺的「每段最多 N unit」;52+269 全绿
This commit is contained in:
2026-09-06 23:40:53 +08:00
parent 1c3a61eb12
commit 89da5f71e0
2 changed files with 54 additions and 6 deletions
@@ -458,6 +458,25 @@ def test_daily_limit_smoke_writes_but_no_markers(root, monkeypatch):
assert not any((root / "state" / "markers").rglob("*.done"))
def test_daily_limit_is_per_stage_and_bounds_pdf_fivecat(root, monkeypatch):
"""回归(2026-09-06 NAS 冒烟假死 12min): ①--limit 预算按段独立,不被首段
吃光;②pdf 五类查询循环必须有门控——曾漏门控致全池 6168 股扫描。"""
_wire_daily(monkeypatch, root)
orig = cd.fetch_cninfo_announcements
calls = {"ann": 0, "fivecat": 0}
def counting(client, code, org, start, end, category=""):
calls["fivecat" if category else "ann"] += 1
return orig(client, code, org, start, end, category)
monkeypatch.setattr(cd, "fetch_cninfo_announcements", counting)
cd.run_lane("daily", limit=1)
assert calls["ann"] == 1 # ann 段 1 发
assert calls["fivecat"] == 1 # pdf 段独立预算 1 发,而非全池
news_calls = cd.fetch_news_recent.call_count
assert news_calls == 1 # news 段独立预算未被 ann 挤占
def test_daily_express_title_routes_to_pdf(root, monkeypatch):
"""标题含「业绩快报」→ 进当日 PDF 待下清单(无服务端码,客户端谓词)。"""
todo = cd.collect_pdf_candidates(