How suryadev41/selfheal works
Selfheal turns spreadsheet cases into Playwright browser checks, repairing selectors through configured/semantic locators, verified SQLite entries and (when enabled) OpenAI suggestions. Runs produce per-case results, screenshots and workbook history; an operations dashboard launches runs and presents results, cache activity and traces. Groups distinguish input/control, browser execution, healing, and observability. Relationships follow README statements and indexed imports; unsampled modules are represented only where their paths and subsystem are documented.
Main entry points: runner.py Suite runner · locator.py Locator resolver · langsmith.py LangSmith tracker · cli.py CLI commands
Components 22
Suite and configuration
- Test workbooks
suites - CLI commands
src/selfheal/cli.py - App configuration
src/selfheal/config.py - Suite parser
src/selfheal/suite_loader.py
Browser execution
- Suite runner
src/selfheal/runner.py - Browser step executor
src/selfheal/executor/browser.py - Generic step executor
src/selfheal/executor/generic.py
Locator recovery
- Locator resolver
src/selfheal/healing/locator.py - Verified locator cache
src/selfheal/healing/cache.py - OpenAI locator client
src/selfheal/llm/openai_client.py - Token cost estimator
src/selfheal/llm/openai_pricing.py
Run observability
- Healing event log
src/selfheal/telemetry/healing_log.py - LangSmith tracker
src/selfheal/telemetry/langsmith.py - Local telemetry store
src/selfheal/telemetry/local_store.py - Run history workbook
src/selfheal/telemetry/run_history.py
Operations dashboard
- Dashboard UI
src/selfheal/dashboard/app.py - Dashboard data access
src/selfheal/dashboard/data.py - Dashboard history views
src/selfheal/dashboard/history.py
Other components
- Operator
- Tested website
- LangSmith service
- OpenAI service
Connections 29
- Operator → CLI commands: runs commands
README.md - Operator → Dashboard UI: operates
README.md - Test workbooks → Suite parser: provides cases
README.md - CLI commands → App configuration: loads settings
src/selfheal/cli.py - CLI commands → Suite parser: parses suites
src/selfheal/cli.py - CLI commands → Suite runner: starts run
src/selfheal/cli.py - Suite runner → App configuration: loads settings
src/selfheal/runner.py - Suite runner → Browser step executor: executes cases
src/selfheal/runner.py - Browser step executor → Tested website: drives browser
README.md - Browser step executor → Generic step executor: uses step helpers
src/selfheal/executor/browser.py - Browser step executor → Locator resolver: resolves targets
src/selfheal/executor/browser.py - Locator resolver → Verified locator cache: reads and writes
src/selfheal/healing/locator.py - Locator resolver → OpenAI locator client: requests suggestions
src/selfheal/healing/locator.py - OpenAI locator client → OpenAI service: requests completion
src/selfheal/llm/openai_client.py - OpenAI locator client → Token cost estimator: estimates cost
src/selfheal/llm/openai_client.py - Locator resolver → Healing event log: records events
src/selfheal/healing/locator.py - Locator resolver → LangSmith tracker: configures tracking
src/selfheal/healing/locator.py - OpenAI locator client → LangSmith tracker: wraps client
src/selfheal/llm/openai_client.py - LangSmith tracker → LangSmith service: uploads traces
src/selfheal/telemetry/langsmith.py - Suite runner → LangSmith tracker: tracks cases
src/selfheal/runner.py - Suite runner → Run history workbook: records run summary
src/selfheal/runner.py - Suite runner → Local telemetry store: persists telemetry
- Dashboard UI → Dashboard data access: loads dashboard data
src/selfheal/dashboard/app.py - Dashboard UI → Dashboard history views: uses history views
src/selfheal/dashboard/app.py - Dashboard UI → Suite parser: reads suite details
src/selfheal/dashboard/app.py - Dashboard data access → App configuration: discovers profiles
src/selfheal/dashboard/data.py - Dashboard data access → LangSmith tracker: loads trace records
src/selfheal/dashboard/data.py - Dashboard data access → Verified locator cache: reads cache entries
- Dashboard history views → Run history workbook: formats run history