Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Agent.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ Community needs voiced in HN agent-UI discussions map directly to EMRG's design:
pkill -f "emrg.server"; rm -f ~/.emrg/emrgd.token; python -m emrg
```

Python: `uv run pytest tests/ -v` (1127) — import check: `uv run python -c "from emrg.client.app import run_client"`
Python: `uv run pytest tests/ -v` (1128) — import check: `uv run python -c "from emrg.client.app import run_client"`
GUI: `cd emrg/gui && npm test` (95: 45 daemon_client + 20 conn-manager + 8 integration + 6 build-config + 7 gui-state + 3 preload-api + 4 boot-contract + 2 theme-guard) — syntax: `node --check main.js preload.js daemon_client.js`
Renderer: `cd emrg/gui/renderer && npm run typecheck && npm test` (445: 5 snapshot-store + 9 utils + 3 ErrorBoundary + 2 App smoke + 11 commands + 4 copywriting + 11 i18n + 11 markdown + 15 transcript + 7 TranscriptView + 15 history + 22 composer + 14 Composer + 12 sidebar + 17 Sidebar + 9 fileTree + 9 FileTree + 16 resultPanel + 8 ResultPanel + 29 workspaceView + 8 WorkspaceView + 10 dialog + 6 Dialog + 9 ConfirmDialog + 9 RenameDialog + 10 dialogLists + 3 HelpDialog + 9 MemoryDialog + 6 SkillsDialog + 9 openSession + 6 WelcomeDialog + 8 OpenSessionDialog + 7 NewSessionDialog + 7 rewind + 8 RewindDialog + 7 GithubDeviceDialog + 14 daemonBridge + 7 DaemonBridgeProvider + 24 Shell + 15 DialogHost + 19 SettingsPanel + 6 TaskFormDialog + 5 RantDialog + 4 vendorMarkdown) + `npm run build` → `renderer/dist/`
Renderer: `cd emrg/gui/renderer && npm run typecheck && npm test` (448: 5 snapshot-store + 9 utils + 3 ErrorBoundary + 2 App smoke + 11 commands + 4 copywriting + 11 i18n + 11 markdown + 15 transcript + 7 TranscriptView + 15 history + 22 composer + 14 Composer + 12 sidebar + 17 Sidebar + 9 fileTree + 9 FileTree + 16 resultPanel + 8 ResultPanel + 27 workspaceView + 10 WorkspaceView + 10 dialog + 6 Dialog + 9 ConfirmDialog + 9 RenameDialog + 10 dialogLists + 3 HelpDialog + 9 MemoryDialog + 6 SkillsDialog + 9 openSession + 6 WelcomeDialog + 8 OpenSessionDialog + 7 NewSessionDialog + 7 rewind + 8 RewindDialog + 7 GithubDeviceDialog + 15 daemonBridge + 7 DaemonBridgeProvider + 25 Shell + 15 DialogHost + 20 SettingsPanel + 6 TaskFormDialog + 5 RantDialog + 4 vendorMarkdown) + `npm run build` → `renderer/dist/`
CI: `uv run pytest` (ubuntu + **windows-2025 matrix** — Windows pytest 回归在 PR CI 即失败,v0.2.29 教训 #725) + GUI tests + **actionlint workflow lint** (`rhysd/actionlint@v1.7.12` gate, #444 — workflow 解析错误在 PR CI 即失败,如 `if:` secrets 上下文)
Re-trigger: `scripts/re-trigger-ci.sh [branch]` (workflow_dispatch, #527 — 替代空 commit 重触发:Actions outage 会整段丢弃 push 事件,dispatch 走 API 路径不受影响)
Git-over-https 兜底: `python scripts/sync-master-from-api.py [--repo owner/name] [--ref master]` — 受限网络下 github.com:443 不可达而 api.github.com 可达时,用 Git Data API 的 verification payload + signature 字节级重建上游 commit(含 web-flow GPG 签名 squash merge,reconstruct_commit 经 hermetic 测试验证 sha 一致)并推进本地 refs;内容对象缺失时 fail-loud 提示改用 git fetch(10+ 周期实证的恢复路径)
Expand Down
37 changes: 37 additions & 0 deletions tests/test_doc_counts.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,40 @@ def test_evolution_prompt_no_quick_ref_block() -> None:
"(rant 2026-08-17T14:22:21, #822)"
)



def _static_renderer_count() -> int:
"""Count renderer vitest cases statically (no node_modules needed).

Matches vitest's executed total exactly: for every renderer test file the
``^\\s*(it|test)(`` definition count equals the number of executed cases
(verified for all 44 files, R2254). Files are under
``emrg/gui/renderer/src`` with ``.test.ts`` / ``.test.tsx`` suffixes.
"""
base = REPO_ROOT / "emrg" / "gui" / "renderer" / "src"
total = 0
for f in sorted(base.rglob("*.test.ts")) + sorted(base.rglob("*.test.tsx")):
text = f.read_text(encoding="utf-8")
total += len(re.findall(r"^\s*(?:it|test)\(", text, re.M))
return total


def test_renderer_count_matches_docs() -> None:
"""Agent.md's Renderer headline must equal the real vitest count.

R2254 (#1049/#1050): renderer tests grew 445 -> 448 without Agent.md being
bumped. The GUI-breakdown guard only validates each "(N: ...)" line's
*internal* sum (parts sum to headline) — it cannot see reality, and the
pytest CI job has no node_modules to run vitest. The static definition
count equals vitest's executed total, so this guard runs everywhere
pytest does and turns the drift red immediately.
"""
renderer = [b for b in _gui_breakdowns() if "Renderer" in b[0]]
assert renderer, "Agent.md must document the Renderer test breakdown"
label, headline, parts = renderer[0]
static = _static_renderer_count()
assert headline == static, (
f"{label}: documents {headline} renderer tests but {static} are "
f"counted statically (vitest-equivalent). Sync Agent.md when "
"adding/removing renderer tests."
)
Loading