Metadata-Version: 2.4
Name: canvas-heal
Version: 0.2.0
Summary: Semantic intent-based self-healing test locators for QE and test automation
Project-URL: Homepage, https://github.com/mandavillivijay/CANVAS
Project-URL: Issues, https://github.com/mandavillivijay/CANVAS/issues
Author-email: mvijayfromvizag@gmail.com
License: MIT License
        
        Copyright (c) 2026 Vijay Mandavilli
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE
Keywords: locator,playwright,selenium,self-healing,semantic,test-automation,testing
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Testing
Requires-Python: >=3.11
Requires-Dist: beautifulsoup4>=4.12.2
Requires-Dist: numpy>=2.3.3
Requires-Dist: playwright>=1.55.0
Requires-Dist: sentence-transformers>=5.1.1
Provides-Extra: dev
Requires-Dist: pytest>=9.0.1; extra == 'dev'
Description-Content-Type: text/markdown

# CANVAS
Context-Aware Navigation and Visual Anchoring System for Selectors

An open source research prototype for semantic intent-based self-healing test locators,
built for the QE and test automation community.

## Why CANVAS

Existing self-healing tools use attribute-based matching — CSS selectors, XPath, element IDs,
class names. These break whenever a UI undergoes structural redesign, even when the element's
function is unchanged.

CANVAS takes a different approach: **semantic intent anchoring**. At record time it encodes
*what an element does* — its role, accessible label, workflow position, and surrounding context —
into a dense vector using a local sentence-transformers model. At runtime it embeds live DOM
candidates and finds the nearest semantic match, then gates the decision:

- **Auto-heal** if confidence is high enough
- **Request human confirmation** if confidence is in a grey zone
- **Fail explicitly** if no confident match exists

This means a "Submit Order" button that moves from a sidebar to a modal, or gets its ID changed
from `#btn-submit` to `#cta-primary`, can still be found — because its *intent* is preserved
even when its *address* is not.

## Status

All 4 phases complete. The core pipeline (descriptor, embedder, confidence-gated resolver)
is implemented and tested, and the adversarial test suite covering DOM restructuring,
attribute churn, semantic paraphrase, and false-positive detection is in place — all tests passing.

## Roadmap

| Phase | Name | Status |
|-------|------|--------|
| 1 | Semantic Element Descriptor | Complete |
| 2 | Intent Embedding | Complete |
| 3 | Confidence-Gated Resolver | Complete |
| 4 | Adversarial Testing | Complete |

## Structure

```
canvas/         — core source code
  descriptor.py — DOM element descriptor extraction
  embedder.py   — sentence-transformers embedding pipeline
  resolver.py   — confidence-gated semantic resolver + SQLite intent store
tests/          — unit tests and adversarial test scenarios
docs/           — technical documentation
```

## Quick Start

```bash
pip install -r requirements.txt
python -m playwright install chromium
python -m pytest tests/ -v
```

## Contributing

CANVAS is in early prototype stage. Community feedback, issues, and pull requests are
welcome once Phase 4 (adversarial testing) is complete. Watch the repo or open a discussion
if you want to get involved earlier.

## License

MIT — see [LICENSE](LICENSE)
