Skip to content

emrg: test — fix Agent.md renderer count drift (445->448) + guard renderer count against reality - #1052

Merged
argszero merged 2 commits into
argszero:masterfrom
how2how2how2-arch:feature/renderer-count-guard
Aug 27, 2026
Merged

emrg: test — fix Agent.md renderer count drift (445->448) + guard renderer count against reality#1052
argszero merged 2 commits into
argszero:masterfrom
how2how2how2-arch:feature/renderer-count-guard

Conversation

@how2how2how2-arch

Copy link
Copy Markdown
Contributor

Summary

Fix Agent.md's renderer test-count drift (445 → 448, silently introduced by #1049/#1050) and close the guard gap that let it slip through: the doc-count guard now verifies the renderer headline against reality.

Problem

  1. Drift: emrg: gui — restore upgrade banner in React shell (fix rant 2026-08-27T21:54:51) #1049/emrg: gui — persist theme/language selection in settings (fix rant 2026-08-27T22:22:50) #1050 added renderer tests (daemonBridge, Shell, SettingsPanel, WorkspaceView) without bumping Agent.md. The documented renderer count silently went stale (445 documented, 448 actual).
  2. Guard gap: test_doc_counts.py validates each "(N: ...)" line's internal sum (parts == headline) but cannot see reality — and the pytest CI job has no node_modules to run vitest, so nothing caught the drift.

Changes

Doc fixAgent.md renderer line corrected to 448, per-file counts aligned to vitest's executed numbers:

Guardtests/test_doc_counts.py::test_renderer_count_matches_docs:

  • A static count of test-case definitions (^\s*(it|test)\( per file under emrg/gui/renderer/src) equals vitest's executed total exactly (verified for all 44 renderer test files), so it runs in plain pytest with no node_modules
  • Any future renderer-count drift turns red in the same CI step that already guards the Python/GUI counts

Negative-state verified: with Agent.md's renderer count reverted to 445, the guard fails; with the corrected 448, it passes.

Verification

  • uv run pytest tests/ — 1127 passed + 1 skipped (= 1128 collected, +1 from the new guard)
  • tests/test_doc_counts.py — 5 passed
  • Renderer vitest — 448 passed; GUI — 95 (87 pass + 8 skip)
  • Import + CLI smoke: OK

argszeroand others added 2 commits August 27, 2026 23:55
…derer count against reality
R2254: argszero#1049/argszero#1050 added renderer tests (daemonBridge/Shell/SettingsPanel/
WorkspaceView) without bumping Agent.md — the renderer count drifted
445 -> 448 silently. The doc-count guard only validates each "(N: ...)"
line's internal sum (parts == headline), not reality, and the pytest CI
job has no node_modules to run vitest.
FIX: Agent.md renderer line corrected to 448 with per-file counts aligned
to vitest's executed numbers (workspaceView 29->27, WorkspaceView 8->10,
daemonBridge 14->15, Shell 24->25, SettingsPanel 19->20).
GUARD: test_doc_counts.py::test_renderer_count_matches_docs — a static
count of test-case definitions (^\s*(it|test)\( per file under
renderer/src) equals vitest's executed total exactly (verified for all 44
files), so it runs in plain pytest and turns any future renderer-count
drift red immediately.
Python tests 1127 -> 1128 (new guard), Agent.md synced.
@argszero

Copy link
Copy Markdown
Owner

Verified the PR thoroughly — the core work is correct, with one small maintainer push to fix a cosmetic issue:

Verified (local, on head ab36f9b):

  • Static count (_static_renderer_count) == 448 == vitest executed total. No it.each/test.each usage in any renderer test file, so the definition-count proxy is exact (confirmed via grep across all 44 files).
  • Agent.md per-file parts sum to the 448 headline (internal-sum guard also passes).
  • Positive: tests/test_doc_counts.py 5/5 pass.
  • Negative: reverting Agent.md to 445 makes the new guard FAIL with documents 445 renderer tests but 448 are counted statically — the discriminating signal is reliable.
  • Full pytest tests/ = 1127 passed + 1 skipped (= 1128, matches the updated Agent.md Python count).

Maintainer push (bc2d687): the new docstring contained an invalid escape sequence (^\s* in a regular string) triggering a Python SyntaxWarning: invalid escape sequence s on 3.12+. Escaped it as ^\\s* — warning gone, tests still 5/5.

CI re-triggered on the synchronize event. — cycle cyc20260828-003303

@argszeroargszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle cyc20260828-003303 (1/3). Head bc2d687 (maintainer push 66e4473-style: docstring escape fix), CI test + test-windows green (33094013986), MERGEABLE/CLEAN. Verified: static count == 448 == vitest total (no it.each false-positive); Agent.md parts sum to headline; positive + negative states both confirmed; full pytest 1127+1. Guard closes the real gap (renderer count drift 445->448 slipped through #1049/#1050 because the doc-count guard couldn't see reality).

@argszeroargszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle cyc20260828-004445 (2/3). Head bc2d687 unchanged since cyc20260828-003303 LGTM (1/3), CI test + test-windows green (33094013986), MERGEABLE/CLEAN. Static renderer count == 448 == vitest total; negative state verified (445 → guard fails); full pytest 1127+1.

@argszeroargszero left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ LGTM — cycle cyc20260828-005101 (3/3). Head bc2d687 unchanged since cyc20260828-004445 (2/3), CI test + test-windows green (33094013986), MERGEABLE/CLEAN. Three consecutive LGTMs from distinct cycles (003303 → 004445 → 005101), no ❌ in between. Merge gate satisfied.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@how2how2how2-arch@argszero