Repository navigation
test: add reader visual DOM evidence - #1047
Conversation
Problem: #865 needs executable reader visual evidence that drives the daemon-served shell against synthetic data. Endpoint tests covered contracts, but there was no dedicated evidence lane for DOM structure, deep links, degraded state, or evidence envelopes. What changed: add tests/visual with synthetic daemon reader fixtures, browserless DOM/evidence assertions, private-path checks, search/detail/no-results/empty/degraded coverage, /c/{id} shell serving, stable message_type serialization, and updated visual-evidence documentation. Verification: pytest -q tests/visual; pytest -q tests/unit/daemon/test_web_reader.py; ruff format --check polylogue/daemon/http.py tests/visual; ruff check polylogue/daemon/http.py tests/visual; mypy tests/visual polylogue/daemon/http.py; devtools verify --quick; devtools verify --affected --skip-slow.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis PR launches Wave 2 of the reader visual DOM evidence test lane. It adds HTTP daemon support for conversation deeplinks ( ChangesWave 2 reader visual DOM evidence launch
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary Route the reader visual/DOM smoke lane through the verification-lab operator surface so agents and operators can invoke it as a named scenario instead of remembering the raw pytest path. Problem #1047 added fast reader DOM evidence, but the durable operator command was still `pytest -q tests/visual`. That left the lane outside `devtools lab-scenario list`, outside JSON report output, and easy to miss when following the MK3 execution plan. Solution - Add `reader-visual-smoke` to `devtools lab-scenario` discovery. - Dispatch `devtools lab-scenario run reader-visual-smoke` to `pytest -q tests/visual`. - Emit JSON and optional report-file output for the lane. - Cover scenario discovery and dispatch in devtools unit tests. - Document the operator-facing command in the visual evidence docs and execution log. Ref #865 Verification - `ruff format --check devtools/lab_scenario.py tests/unit/devtools/test_lab_list_subcommands.py tests/unit/devtools/test_lab_surface.py` -> 3 files already formatted - `ruff check devtools/lab_scenario.py tests/unit/devtools/test_lab_list_subcommands.py tests/unit/devtools/test_lab_surface.py` -> All checks passed - `mypy devtools/lab_scenario.py tests/unit/devtools/test_lab_list_subcommands.py tests/unit/devtools/test_lab_surface.py` -> Success - `pytest -q tests/unit/devtools/test_lab_list_subcommands.py tests/unit/devtools/test_lab_surface.py -k lab_scenario` -> 6 passed - `devtools lab-scenario run reader-visual-smoke --json` -> 4 passed - `devtools verify --quick` -> exit_code 0 - `devtools verify --affected --skip-slow` -> exit_code 0
Summary
Adds the first executable #865 visual-evidence lane for the daemon-served local reader. The new
tests/visualpackage boots the real daemon HTTP server against synthetic archives, checks browserless DOM structure and API state, writes evidence envelopes, and covers search/list, conversation/deeplink, query/no-results/facets, empty archive, degraded FTS, and privacy boundaries.Problem
The reader had endpoint contract tests, but #865 still lacked a dedicated visual/DOM evidence lane. That left
/c/{id}shell deep links, evidence-envelope shape, degraded FTS presentation, and private-path safety outside a visual-smoke-oriented test surface. Adding a full browser screenshot gate would require new browser packaging; the fast lane should work first without browser binaries so it can run reliably in the current devshell and standard pytest discovery.Solution
tests/visual/with synthetic archive seeding, daemon server fixtures, minimal DOM parsing, private-path checks, and evidence-manifest helpers.polylogue.local_reader.searchat/;polylogue.local_reader.conversationat/c/reader-c1plus detail/messages/raw APIs;/c/{id}so conversation deep links are directly verifiable.message_typeserialization to stable enum values instead ofMessageType.Xreprs.docs/visual-evidence.mdand the MK3 execution log with the new command, coverage, and remaining browser screenshot follow-up.Ref #865
Ref #848
Ref #859
Verification
pytest -q tests/visual→ 4 passedpytest -q tests/unit/daemon/test_web_reader.py→ 37 passedruff format --check polylogue/daemon/http.py tests/visual→ passruff check polylogue/daemon/http.py tests/visual→ passmypy tests/visual polylogue/daemon/http.py→ passdevtools verify --quick→ exit 0devtools verify --affected --skip-slow→ exit 0devtools verify --quick→ exit 0Follow-up
This PR deliberately does not add Playwright/Chromium screenshots. The new browserless lane records
browser_gate_followupin evidence envelopes so a later #865 slice can add the heavier screenshot gate without replacing the fast DOM/contract smoke.Summary by CodeRabbit
New Features
/c/{conversation-id}paths.Documentation