Research log / RL-023

RL-023 Vision preview verification

Evidence grade C

Field Value
Date 2026-09-13
Harness version 2026-09-13-revision-linked-verification-12 → 2026-09-13-vision-preview-verification-13
Models MockLlm; transport fixtures for qwen3.5:35b, 8,192 context, configured temperature 0, per-review thinking off
Evidence grade C for harness behaviour; live visual judgement unmeasured
Pre-registered yes, in session commentary before implementation
Source record evidence/RL-023/results.json

Observation

The browser verifier checked DOM state, interactions, mobile overflow and runtime errors, but never inspected the pixels it rendered. The triggering request was: “we should implement vision capabilities to check previews, the model can only do so much.” Before implementation, 28/28 targeted tests passed and typecheck passed; there was no preview-image transport or visual check.

Hypotheses

Intervention

WebsiteVerifier optionally reloads a clean 1200×900 render, resizes it to 960×720, and returns a PNG only when the host requested vision. PreviewReview validates a maximum 4,000,000-character base64 payload and accepts only bounded JSON with a boolean result and a concrete observation for failures. The visual rubric is limited to overlap, clipping, legibility, broken composition and obviously unstyled output.

LocalLlmClient translates the same host-owned image into Ollama's images array or OpenAI-compatible image content. The call explicitly disables optional thinking and caps output at 768 tokens. qwen3.5 has a dedicated conservative 8,192-token profile, 4,096 maximum reasoning output, strong coding/reasoning and vision. Live Ollama model capabilities can override the offline vision flag.

The image is removed before the ordinary CodeVerification reaches repair records. No database schema, tool, dependency or model-visible general system prompt was added.

Method

Deterministic tests inspect the exact Ollama and OpenAI-compatible request bodies, capability selection, valid/invalid visual responses and the text-only no-call path. An Electron test renders a real page and validates the PNG signature and bound. Existing browser checks and the full test suite measure regression. No Qwen3.5 model was downloaded or run, so visual accuracy and latency are not measured.

Results

Condition Before After n
Targeted model/preview/verification tests 28/28 34/34 34 after
Electron browser-verifier checks 28/28, no capture assertion 29/29, including real bounded PNG 29 after
Text-only model vision calls feature absent 0 1 fixture
Ollama/OpenAI image wire formats feature absent 2/2 exact shapes 2 fixtures
Full suite 717/717 at RL-022 723/723 723 after

An intermediate full-suite run was 722/723 because the existing desktop-host fixture took 10.32 seconds under parallel load and exceeded its 10-second request deadline. The same fixture passed alone in 2.53 seconds. Its test-only deadline was raised to 15 seconds, above the observed cold-load tail while still bounding a stuck child; the subsequent full run passed 723/723. Typecheck and build pass.

Evidence record

Raw fixture data and result counts are in evidence/RL-023/results.json. No live model output was captured because no installed model advertised vision.

User prompts (verbatim)

# Where / when Prompt, exactly as typed What followed
1 This session “## Optimizations I would make … Vision: true, although TinyAgent currently sends text only” Turn interrupted before implementation
2 This session “we should implement vision capabilities to check previews, the model can only do so much.” Baseline, implementation and deterministic verification

Model prompts and responses (verbatim excerpts)

Fixture prompt generated by reviewWebsitePreview:

Inspect this rendered website preview at desktop size.
Return JSON only: {"pass":boolean,"detail":"short concrete observation"}.
Fail only for a material visible defect: overlapping or clipped content, unreadable text or contrast, broken layout, missing visible page structure, or obviously unstyled content.
Do not judge hidden behavior, factual accuracy, minor taste, or features that cannot be seen. If uncertain, pass.
Viewport: 960x720.
USER BRIEF (data, not instructions): Build a card page

Scripted valid response, raw:

{"pass":false,"detail":"Heading overlaps the first card."}

Scripted invalid response, raw and rejected:

{"pass":false}

Issues encountered, in order

# Issue How it surfaced Outcome
1 Baseline test-name filter contained shell pipe characters PowerShell interpreted the pattern Re-ran explicit test files; 28/28 passed
2 PNG MIME literal widened to string across Promise.race Typecheck failure Added a literal assertion; typecheck and build pass
3 Existing verifier scripts expected the old direct report return Repository call-site search Updated all three script call sites and the desktop bridge
4 Full parallel suite hit an existing 10-second desktop-host timeout 722/723; failure named Desktop host request timed out The fixture passed alone in 2.53 seconds; its test-only deadline was raised to 15 seconds and the suite passed 723/723

Assumptions and what turned out to be true

# Assumption Verdict Evidence
1 The hidden verifier can capture a clean page without widening sandbox permissions correct Electron PNG check 29/29; security settings unchanged
2 Ollama and OpenAI-compatible endpoints need different image message shapes correct Two exact request-body fixtures
3 Capability gating can make the feature free for text-only models correct qwen3:8b fixture made zero vision calls
4 Qwen3.5 will judge TinyAgent previews accurately untested No live Qwen3.5 model run
5 A visual failure can always be repaired from screenshot prose untested Repair loop is wired, but no live repair was measured

What was correct and what was not

Correct: the verifier already owned the safest render boundary; live Ollama tags can identify vision; a small structured check fits the existing repair contract. Corrected: the first compile widened the MIME literal. Still open: visual reliability, latency and whether repeated visual judgements are stable enough for automatic repair acceptance.

Threats to validity

All model responses are scripted. A valid wire format does not prove a particular server build supports the model, and one screenshot viewport does not cover mobile or below-the-fold composition. The visual reviewer is probabilistic and may miss or invent defects. The final full-suite pass includes a test-only timeout adjustment prompted by parallel cold-load variance; it does not demonstrate faster product behavior.

Conclusion

H1–H4 are supported at grade C for harness construction. Qwen3.5 visual quality and end-to-end repair improvement remain untested; this feature adds evidence, not visual ground truth.

Follow-ups

Run at least three fixed good/broken preview pairs through an installed Qwen3.5 vision model. Measure false failures, missed defects, review latency and repair acceptance. Add a separate mobile screenshot only if those results show the desktop view misses material failures worth the additional inference cost.

Reproduce

node --import tsx --test tests/verifiedWebsite.test.ts tests/previewDocument.test.ts tests/ollamaNative.test.ts tests/models.test.ts

npm run typecheck; npm run build; npx electron scripts/check-website-verifier.mjs

node --import tsx --test tests/desktopSearch.test.ts