LEVEL 5 · FRONTIER

Browser Agent

A form-run receipt that checks the requested values before trusting the success banner. Replace Driver with an adapter that implements observe, act and capture. Run cli.ts --live only after serving the authored fixture and setting BROWSE_BIN.

4 stages~8 hoursTypeScript, Pythoncore
Turn DOM state into constrained actionsStop on completion, stalling or budgetVerify screenshot pixels in PythonDrive the real fixture and score the run
YOU END UP WITH

A form-run receipt that checks the requested values before trusting the success banner.

USEFUL FOR
  • Replace Driver with an adapter that implements observe, act and capture. Run cli.ts --live only after serving the authored fixture and setting BROWSE_BIN.
LEARN FIRST
  • Node 22.18+, Python 3, DOM labels, async functions, subprocess arguments and byte arrays. Live Chromium additionally requires an installed gstack browse executable.
PROJECT OUTLINE

Browser Agent in 4 stages

A form-run receipt that checks the requested values before trusting the success banner.

  1. Turn DOM state into constrained actions

    Read labels, values, disabled states and stable ids from a small form. Validate unique ids and field types. Choose one action at a time: fill the name, fill email, then click the uniquely identified Save request button. Page prose is never interpreted as instructions. Missing fields, ambiguous labels, dangerous buttons and unexpected origins cause an explicit blocked result.

    starter · ~2 hours · TypeScript

    parseObservationchoose
  2. Stop on completion, stalling or budget

    Observe after every action. Stop if the state repeats, if policy blocks an action, or if the step budget is consumed. Completion requires the DOM success flag and a separate screenshot check. Trace every selected action before execution. The fixture backend is explicitly a simulator; it supplies deterministic observations to test the loop and does not claim browser coverage.

    core · ~2 hours · TypeScript

    runAgentFixtureDriver
  3. Verify screenshot pixels in Python

    Read the PNG signature, chunk lengths and CRCs, then decompress a bounded image payload. Reverse PNG row filters and count green success pixels. Combine this visual signal with the DOM flag; neither alone is sufficient. This is a narrow pixel-state detector for the authored fixture, not OCR or general vision. Corrupt, oversized, interlaced and unsupported color formats fail explicitly.

    core · ~2 hours · TypeScript

    inspectPNG
  4. Drive the real fixture and score the run

    Serve fixture.html over loopback and navigate to it with gstack browse. GstackDriver reads DOM observations, fills labels, clicks the observed button and captures a real screenshot. Commands use argument arrays instead of a shell. Run the same bounded policy with --live and compare its trace with the fixture backend. Keep completion scores separate for simulated and real-browser runs.

    core · ~2 hours · TypeScript

    GstackDriverscoreRuns

All projects · Course catalog · Source on GitHub