Contents
PR Summary
What problems was I solving
This PR introduces the first end-to-end field-agent website validation demo. It moves field-agent page-context generation out of page-analytics-service and into webpage-context-service, adds a durable lifecycle for generating per-page validation/highlight scripts, and exposes a management UI status query so the team can observe progress.
What user-facing changes did I ship
For configured customer sites, the field-agent visitor-analytics module now injects a /t/:tenantId/va/page.js validation script that draws an overlay on components and action targets detected on the public page. The management console gains a fieldAgentExtractionStatus query to poll generation progress (pending/running/completed/failed). These changes are limited to the field-agent demo flow and do not alter existing analytics behavior.
How I implemented it
The implementation adds a new field_agent_extractions table and repository, deterministic DOM canonicalisation via Stagehand over a Kernel browser (using a newly exposed CDP session in browser-runtime), Effect-based app orchestration, and a Temporal workflow that validates the URL, observes the page, persists a component snapshot and canonical targets, and uploads a generated overlay script. The field-agent-gateway-service adds the /va/page.js redirect endpoint; web-service serves uploaded scripts from the file service; and management-gateway-service exposes the status query.
Description for the changelog
Adds the field-agent website validation demo by moving page-context generation into webpage-context-service, introducing a persisted extraction lifecycle, deterministic DOM-based canonicalisation, a Stagehand-driven browser adapter, and a generated validation overlay script served via the field-agent gateway. Also adds a management GraphQL extraction-status query and a local demo script for end-to-end testing.