Skip to content

Commit 1d3b5cb

Browse files
nihilistauclaude
andcommitted
docs: make browser testing + telemetry a governed process
Added browser testing and telemetry requirements to CLAUDE.md and copilot-instructions.md. MANDATORY for all agents: run scripts/browser_test.py before committing any UI change. Read telemetry logs to diagnose issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent c03d561 commit 1d3b5cb

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

.github/copilot-instructions.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,21 @@ python scripts/smart_test.py --smoke # standalone script, same engine
206206
python scripts/smart_test.py --list # dry-run: show what would run
207207
```
208208

209+
## Browser Testing & Telemetry (v1.43.0)
210+
211+
**MANDATORY**: After ANY change to JS, CSS, HTML, or Jinja2 templates, run:
212+
```powershell
213+
python scripts/browser_test.py # Full Playwright test (39+ checks)
214+
python scripts/browser_test.py --report # Read telemetry without testing
215+
```
216+
217+
Never commit UI changes without a passing browser test. The test suite clicks every HUD panel, popup, overlay, keyboard shortcut, and district card in a real headless browser.
218+
219+
**Telemetry**: `cosysim-telemetry.js` auto-captures clicks, errors, hotkeys, network failures on every scene page. Events POST to `/api/telemetry` and persist to `data/structured_logs.jsonl` via StructuredLogger. Check telemetry when diagnosing issues:
220+
```powershell
221+
python -c "import json; [print(json.loads(l).get('msg','')[:100]) for l in open('data/structured_logs.jsonl') if 'browser' in l]"
222+
```
223+
209224
## Code Versioning & Comment Standards (v1.42.1)
210225

211226
All code files created or significantly modified MUST include versioning metadata and structured comments. This is a **standing rule** for all agents (Copilot, Claude Code, local LLM agents).

CLAUDE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ Always use `get_config().get("dot.path", default)`. Never hardcode values.
146146
- **File naming**: `test_{module_name}.py``test_{behavior}()`
147147
- **Seeded characters**: lola, viktor, aria, frankie, mira are always present in DB fixtures.
148148
- Ignore `tests/test_agent_loop.py` and `tests/live_wire_test.py` (require live services).
149+
- **Browser testing**: After ANY JS/CSS/HTML change, run `python scripts/browser_test.py` (Playwright). Never commit UI changes without a passing browser test. Read telemetry: `python scripts/browser_test.py --report`
150+
- **Telemetry**: `cosysim-telemetry.js` captures all browser clicks, errors, hotkeys → `POST /api/telemetry``data/structured_logs.jsonl`. Always check telemetry after user reports issues.
149151

150152
## Frontend
151153

0 commit comments

Comments
 (0)