Agent system / Web QA / Working sample

Site Doctor

It doesn't generate websites. It tries to break them.

An agent loop that audits the demo sites on this portfolio. It fetches the real page, tests navigation, forms, accessibility and mobile layout, traces the money flow end to end, forms hypotheses, verifies candidate fixes in a sandbox, and reports only what it measured. No language model runs on this page; the section at the bottom explains exactly what does.

Point it at a patient

Two demo sites from this portfolio are the sanctioned targets. Site Doctor fetches the page over the same origin at run time; nothing is pre-recorded.

Target site

Goals are preconfigured for this demo. A production run would take the goal as input.

Break the site first (optional)

Sabotage is applied to a sandboxed copy; the real demo pages are untouched. Site Doctor is not told what you broke. The same tools that audit the clean page have to find the faults.

idle

The loop, live

Left: every tool call and every planner decision as they happen. Right: the sandboxed copy under audit at 375 pixels, with the element under test outlined.

>_ activity 0 tool calls

Pick a target and hit RUN. Every line that appears here is a real tool call against the fetched page.

sandbox · no page loaded 375px

Sandboxed copy. The real demo pages are untouched.

How this works, honestly

No language model runs in this demo. The planner is a deterministic policy engine: a plain JavaScript function, nextAction(state), that inspects the run state and returns the next tool call. It drives the same loop shape a model-driven planner would drive: read the state, choose a tool, gather evidence, update, verify, stop.

Measurements come from tools, never from generated text. Every number in the report, from a contrast ratio to a pixel of horizontal overflow, is read off the fetched page or the rendered sandbox at run time. If a tool cannot measure something, that lands in the uncertainties list instead of the findings.

The sandbox is isolated. The audited page runs as a copy inside a sandboxed frame with an in-memory storage shim, so audit runs never touch the state the real demo pages keep in your browser. Dashed outlines in the preview are Site Doctor's inspection markers; green outlines are candidate fixes it patched in to verify.

Production versions of this architecture put a model in the planner seat. That is the seat the policy function occupies here. The tools, the evidence discipline, the verification step and the stopping rules stay exactly the same; static hosting is why this page ships with the deterministic planner, and the audit is real either way.

The whole thing is one HTML file. Read the source, or just view-source this page.

The loop

  1. 01Discover. Fetch the page, parse it, inventory links, forms, headings, controls.
  2. 02Goal. Map the business goal to concrete controls on the page.
  3. 03Test. Navigation, forms, accessibility, 375px layout, asset weight, and the goal flow end to end.
  4. 04Hypotheses. Findings raise testable claims; nothing ships as fact yet.
  5. 05Verify. Patch the sandbox, re-run the failing measurement, keep the before/after numbers.
  6. 06Report. Score severity against business impact, prioritize, state what remains unknown.
crawlSitetestNavigationinspectFormscheckAccessibilitysimulateViewporttraceUserFlowmeasureAssetsprobeBehaviorverifyCandidateFixscoreFinding