Skip to content
All projects

Research · Sep 2026

eSource Study Builder

A browser agent that builds clinical-study specifications into unfamiliar eSource platforms without hardcoded selectors or screen order.

The problem

Clinical study builders differ in vocabulary, markup, navigation, and save behavior. A brittle automation tied to labels, element IDs, or one platform’s screen order fails as soon as the same study is entered somewhere else.

What I built

I built a Chrome extension that discovers controls by semantic role and meaning, maps field types with confidence and a runner-up, plans dependencies, escalates ambiguous decisions to a human, reads changes back, verifies persistence by leaving and reopening the builder, and reconciles reruns instead of duplicating work.

No platform-specific selectors

The same extension ran on two mock platforms whose labels, layouts, markup, and navigation were intentionally different. Controls are found by semantic role and nearby meaning, while the model is used sparingly to map each platform’s field-type vocabulary. That mapping happens once and is cached instead of spending a model call on every field.

The build order is a correctness constraint

Fields must exist before another field can reference them, values can be discarded when a type changes, and visibility rules arrive in sponsor order rather than dependency order. The planner topologically orders the work, applies visibility rules in a second pass, and escalates cycles or dangling references instead of guessing.

Verifying the editor is not verifying persistence

An early run built a complete form in the working editor while the saved study still contained zero fields. The final verifier leaves the builder, reopens it, and checks the rendered study again. That round trip catches a false success that screenshots or in-dialog read-back cannot.

Outcome

  • Verified without code changes on two different mock eSource platforms
  • Built and read-back verified 4/4 visits, 28/28 forms, and 195/195 fields
  • Verified 42/42 coded-value sets, 59/59 ranges and units, and 13/13 visibility rules
  • Completed about 240 high-level steps in roughly two minutes with about two model calls per platform

Stack

JavaScriptChrome MV3Browser automationAccessibility semanticsHuman-in-the-loop AIEvaluation

Data flow

Specification in, verified and traceable eSource build out

  1. 1

    Study specification

    Visits, forms, fields, coded values, ranges, units, and visibility rules

  2. 2

    Semantic perception

    Discovers controls by role, nearby meaning, and current screen state rather than selectors

  3. 3

    Type mapper

    Maps platform vocabulary once, with confidence and a visible runner-up

  4. 4

    Dependency planner

    Orders visits, forms, fields, values, ranges, and second-pass visibility rules

  5. 5

    Human gate

    Groups uncertain decisions by consequence and shows the evidence behind each choice

  6. 6

    Round-trip verifier

    Leaves the editor, returns, and confirms the saved study survived

  7. 7

    Reconciler

    Reads current state before creating anything so interrupted reruns remain idempotent

JavaScriptChrome MV3Browser automationAccessibility semanticsHuman-in-the-loop AIEvaluation

This diagram is generated from portfolio.ts. Edit the `architecture` field to change it.

Want the deeper version of this?

I am happy to walk through the tradeoffs, the failure modes, and what I would do differently.

Email me