Files
Jyotisha/tests/test_bug_history_workflow.py
T
Jesse_Chen e8d201dd9a
Independent Staging Quality Gate / validate (push) Successful in 13m15s
Independent Staging Quality Gate / publish (push) Successful in 10m9s
perf(chat): isolate the composer, split heavy chunks, fix dead tokens
Second batch from the staging UX audit (BUG-248..253).

- css: expose the 32 palette tokens through @theme. Seven utilities
  including text-ink, text-danger and text-warning compiled to no CSS
  at all, so 30 call sites had been silently inert (BUG-248)
- chat: move the composer into its own component behind a draft store,
  so a keystroke no longer re-renders a 2723-line component, and
  persist the draft across reloads (BUG-249)
- chat: load gsap, react-markdown and thinking-orbs on demand. First
  Load JS for / drops 549.5 kB to 476.3 kB gzipped (BUG-250)
- chat: route the five in-app destinations through router.push, and
  keep the five auth redirects and the bootstrap retry as hard loads
  on purpose (BUG-251)
- a11y: announce reply completion, and move the live region out of the
  aria-busy subtree that was likely suppressing even the start
  announcement (BUG-252)
- docs: give the 27 collided bug ids unique numbers and repair their
  inbound references; require search rather than a full read of a
  3690-line file (BUG-253)

Verified: tsc, eslint, next build, and 1592 assertions across the 199
non-database test files.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-17 14:16:05 +08:00

26 lines
900 B
Python

from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
AGENTS = ROOT / "AGENTS.md"
BUG_HISTORY = ROOT / "docs" / "BUG_HISTORY.md"
def test_bug_history_exists_with_required_entry_contract() -> None:
text = BUG_HISTORY.read_text(encoding="utf-8")
assert "## 使用流程" in text
assert "## 新记录模板" in text
for field in ("用户现象", "触发条件", "根因", "修复", "验证", "防复发", "复发自"):
assert field in text
def test_agents_requires_read_before_and_update_after_bug_work() -> None:
text = AGENTS.read_text(encoding="utf-8")
assert "docs/BUG_HISTORY.md" in text
assert "开始诊断前必须用报错原文、接口路径、状态码、模块名和用户操作强制检索" in text
assert "检索不是可选步骤" in text
assert "必须在同一变更中更新" in text
assert "严禁写入" in text