# Browser automation plans fail when selectors are treated as stable reality

Entry: `bt-004`  
Verdict: `REWORK`  
Observation date: `2026-05-28`  
Artifact type: `agent_workflow`

## Hard Summary

| Check | Result |
| --- | --- |
| Vulnerability class | schema_drift, route_risk, missing_adapter_policy, brittle_observation_layer |
| Failure point | The signal breaks when an agent treats page structure as a stable API contract. |
| Claimed or implied autonomy | A browser agent can keep operating by replaying selectors against the visible web. |
| Observed autonomy | Official browser automation guidance treats resilient locators and explicit test contracts as necessary because DOM structure can change. |

## Source

- https://playwright.dev/docs/locators

## Failure Map

- `schema_drift`: Any workflow that depends on long CSS or XPath chains has an unstable observation layer. The official Playwright guidance explicitly favors user-facing locators and test IDs because DOM structure can change.
- `route_risk`: A revenue or monitoring route built on brittle selectors can silently stop collecting, submitting, or validating work when the page re-renders or the DOM structure shifts.
- `missing_adapter_policy`: The plan needs a compliant maintenance path: detect schema drift, mark the route stale, update against official documentation or explicit contracts, and avoid repeated blind retries.
- `brittle_observation_layer`: If the agent cannot distinguish a site change from a temporary failure, it will spend budget in loops instead of producing a useful route verdict.

## Contract Field Findings

These are the intake fields that would need to be explicit before a router should accept the workflow as execution-ready.

- `known_dependencies`: The workflow depends on page structure, locator stability, and permission to automate.
- `account_or_access_requirements`: Login, captcha, rate-limit, account-review, and access-control signals must stop the route rather than trigger workaround behavior.
- `route_continuity`: The route needs a stale-route state and repair path when selectors fail.
- `evidence_available`: Official documentation supports the brittle-selector risk and the preferred repair path.

## Next Allowed Action

Replace structural selectors with user-facing locators or explicit test IDs where permission exists, add route-stale status, and require a single evidence snapshot before connector repair.

## Do Not Do

- Do not build paid operations on unversioned DOM paths without a stale-route fallback.
- Do not retry failed browser actions indefinitely.
- Do not treat captcha, anti-fraud, login, or access-control friction as an automation bug to work around.

## Publication Gates

- `public_source_check`: pass
- `no_confidential_data_check`: pass
- `public_surface_terminology_check`: pass
- `semantic_density_check`: pass
- `source_specific_evidence_check`: pass
- `sentinel_spot_check`: not_required_official_docs_source
