# Hybrid automation — Playwright driver + PageAgent advisor # Render: d2 --theme 0 hybrid-automation.d2 ../svg/hybrid-automation.svg title: |md # Hybrid automation — Playwright drives, PageAgent advises (C4-adjacent) | {near: top-center} direction: down user: {label: "Job seeker\n[Person]"; shape: person} engine: { label: "AutomationEngine\n[per-ATS, e.g. WorkdayAutomationEngine]" style.fill: "#33608f" style.font-color: "#ffffff" } driver: { label: "Playwright driver loop\nnavigation · FrameLocator (cross-origin iframes)\ndeterministic selector-chain fills · never-submit guard" style.fill: "#2b6e58" style.font-color: "#ffffff" } confidence: { label: "Confidence check\non each field fill" shape: diamond style.fill: "#e8e4dc" } advisor: { label: "IPageAdvisor\n[seam / interface]" style.fill: "#a05c2b" style.font-color: "#ffffff" } pageagent: { label: "PageAgent + Claude\n[in-page, reads DOM]\nranks best-match options for\nambiguous fields / novel custom questions" style.fill: "#7aa7d4" style.font-color: "#ffffff" } rank: { label: "Engine ranks\nadvisor's hint vs threshold" shape: diamond style.fill: "#e8e4dc" } pause: { label: "AwaitingJudgement\npause for user" style.fill: "#dba064" style.font-color: "#ffffff" } submit: { label: "Review & submit\n[ALWAYS user-gated]" style.fill: "#8a2b2b" style.font-color: "#ffffff" } engine -> driver: "Drives" driver -> confidence: "Field filled\nwith what confidence?" confidence -> driver: "High confidence:\ncontinue deterministic fill" {style.stroke-dash: 3} confidence -> advisor: "Uncertain:\nconsult" advisor -> pageagent: "Delegates ambiguous\nfield/question" pageagent -> advisor: "Returns ranked hint\n+ confidence" advisor -> rank: "Hands hint back\nto engine" rank -> driver: "Above threshold:\nengine fills via Playwright" {style.stroke-dash: 3} rank -> pause: "Below threshold:\nstill pauses" pause -> user: "Presents ranked\noptions" user -> pause: "Picks / confirms" pause -> driver: "Resume fill" driver -> submit: "All fields resolved" submit -> user: "Waits for\nexplicit approval" note: { label: "Token cost is bounded: PageAgent/Claude is called\nonly on ambiguity, not on every field." shape: text near: bottom-center style.font-color: "#2b6e58" }