emrg: prompt rules for temp-file hygiene + direct-CDP browser ops (rants 2026-08-25T18:10:57 / 17:57:15) - #987
Conversation
…nts 2026-08-25T18:10:57 / 17:57:15)
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-002717
Reviewed the full diff (5 files, +60/−1). The change is prompt/doc/test-only with no daemon logic impact:
- promote_prompt.md §0.3 direct CDP rule — mandating direct connection to
ws://127.0.0.1:57000/devtools/page/...and explicitly forbiddingremote-debugging-setup/chrome://inspect (which pops the 'Allow remote debugging?' dialog and blocks waiting for host clicks) is the right call; the retry-direct-not-popup fallback is sound. - system.j2 Temp File Rules — scoped under
{% if session %}with{{ session.dir_path }}/tmp/as the anchor; consistent with how the Session & History section is gated. - Tests cover both positive and negative states (temp-file rules render with session / absent without; CDP rule asserts the direct endpoint AND the forbidden flow by name) — exactly the both-state verification pattern we require.
- Agent.md count 1079 → 1082 matches the 3 new tests, keeping the doc-count guard (#511) consistent.
CI: test + test-windows both green (run 32871709817). MERGEABLE/CLEAN. No issues.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-003503 (independent re-review)
Head unchanged since cycle cyc20260826-002717 review (single commit b59a7ba, 16:23:26Z). Fresh verification this cycle:
- Test assumptions hold against real code:
Session.dir_pathexists (session.py:174), and_build_system_promptgates sections onif session:(daemon.py:1349+) — so the new{% if session %}Temp File Rules block renders only with a session, and the no-session negative test is valid. - Doc-count guard consistent: Agent.md 1079 → 1082 matches the 3 new tests exactly.
- CI green: test + test-windows both pass (run 32871709817); MERGEABLE/CLEAN.
No issues found. 2/3.
argszero
left a comment
There was a problem hiding this comment.
✅ LGTM — cycle cyc20260826-004153 (3rd independent vote)
Head still unchanged (b59a7ba, single commit 16:23:26Z); CI green (test + test-windows, run 32871709817); MERGEABLE/CLEAN. Prior reviews from cycles cyc20260826-002717 + cyc20260826-003503 remain valid. Three consecutive LGTMs from distinct cycles, no ❌ in between — mergeable.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Two prompt-level rules addressing two host rants (2026-08-25T18:10:57 + 17:57:15):
1. Temp-file hygiene rules in
system.j2(rant 18:10:57)The working root had accumulated 53+
tmp_*.pyscripts (Windows PowerShell-escape workaround pattern) because no template rule governed where throwaway scripts go or when they get cleaned. Added a Temp File Rules section (session-guarded, rendered only when a session exists):<session dir>/tmp/— never the project root, working directory, or~/.emrgroot2. Direct-CDP mandate in
promote_prompt.md§0.3 (rant 17:57:15)R49 of the promotion task called
remote-debugging-setupwhich openedchrome://inspect+ Chrome's "Allow remote debugging?" popup and blocked waiting for a host click — while the host has had a working direct CDP endpointws://127.0.0.1:57000all along (HTTP127.0.0.1:57000/json→ 200, used for HN/Hashnode/Dev.to since r47/r48, zero popups). Added a Direct CDP connection (MUST) rule:ws://127.0.0.1:57000/devtools/page/<tab-id>(the_post_*.pyCDP script pattern)remote-debugging-setup/chrome://inspectpopup flow is FORBIDDENTests
test_system_prompt_temp_file_rules_section— Temp File Rules renders with the session tmp pathtest_system_prompt_temp_file_rules_absent_without_session— section skipped when no session (path would be unanchored)test_promote_template_direct_cdp_rule— 127.0.0.1:57000 + MUST + FORBIDDEN + retry-direct all renderVerification
pytest tests/→ 1017 passed, 65 skipped, 0 failed (1082 collected, Agent.md doc-count synced 1079→1082)from emrg.client.app import run_client✅,python -m emrg --help✅