You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(workers): deterministic closest-matching selector suggestions + DOM snippet in selector failures (Roadmap Phase 3) #65
Richer failure details: DOM snippet around the failed selector, closest-matching selectors (computed deterministically — text/role similarity, no LLM), first console error, failing network request.
Parts of this are now covered by the failure-synthesis track (#63): first console error → #60, failing network request → the stale-session analyzer shipped in failure-hints.ts + #55's prior-anomaly counts. This issue covers the two selector-specific pieces:
Task
When a failure is selector_not_found / selector_not_visible, enrich the failure's details (additive — the JSON contract's type strings and existing fields are frozen):
DOM snippet around the failed selector's expected location — e.g. the nearest matching ancestor/landmark region from the failure-time DOM, truncated. Gives the agent local context without opening the snapshot.
Closest-matching selectors, computed deterministically — candidates from the failure-time DOM ranked by text/role/attribute similarity to the failed selector (e.g. #username when the flow said #user-name). Explicitly no LLM — this is string/tree similarity, and it must work in strict mode with no AI key.
The type-step misclassification fix already puts the failed selector in details; this builds on that. The self-healing resolver (workers/src/ai/self-healing.ts) has related semantic-resolution logic worth reusing or extracting — the deterministic parts only.
Why it matters
ROADMAP.md calls the failure payload the moat: "a failure payload that reliably closes an agent's edit→verify loop is not [copyable]". A wrong-selector failure that names the right selector closes the loop in one iteration.
Acceptance criteria
selector_not_found/selector_not_visible failures carry a DOM-context snippet and up to N ranked candidate selectors in details
Fully deterministic; works in strict mode with no AI key
Additive fields only; existing contract unchanged; fix_hint mentions the top candidate when confidence is high
Standalone ts-node test with fixture DOM (near-miss id, role/text match, and no-reasonable-candidate ⇒ silent)
Activity
feat(workers): deterministic closest-selector suggestions + DOM snipp…
feat(workers): deterministic closest-selector suggestions + DOM snipp…
Triage batch: occluded-click classification (#88), selector suggestio…
benchmark: multi-agent v0.4.1 measurement + stale-session fixture fix (…
docs(readme): lead with proof, add 3-agent loop-closure benchmark tab…