Skip to main content

tancat-ai/tancat

Paste a user story → get executable Playwright pytest tests with real DOM selectors.

Powered by local LLMs — no cloud API keys needed.

Metric Status
CI/CD Pipeline CI
Python Version Python 3.14+
License License
Code Quality Ruff

Demo

A short walkthrough video is planned. Until it is recorded, the Your first run page in the user docs specifies exactly what the video will show, and walks the same story end to end with real expected output.

How It Works

User story (natural language)
    ↓
Skeleton generation — LLM produces test structure with placeholders
    ↓
DOM scraping — real page structure captured, never injected into prompts
    ↓
Placeholder resolution — placeholders replaced with actual selectors
    ↓
Executable pytest file (sync format, ready to run)

Key Features

  • AI-Powered Generation — Natural language stories → pytest sync tests
  • Self-Learning RAG — the resolver improves with use: passing runs and self-healed locators teach a local, site-scoped store (no telemetry, no cloud)
  • Self-Healing — failed locators are reviewed and repaired automatically, then written back so the next generation resolves correctly
  • Local LLMs — Runs entirely offline via llama.cpp, Ollama, or LM Studio
  • Semantic Scraper — Three-layer extraction (BS4 + CDP accessibility tree + ARIA snapshot) captures computed accessible names, placeholder text, and container elements that CSS-only scrapers miss
  • Real Selectors — Scrapes actual DOM; no selector hallucination
  • Skeleton-First Pipeline — Two-phase generation eliminates bad selectors
  • Page Object Models — Optional POM output for scalable test suites
  • Streamlit UI — Primary interface for non-technical QA testers
  • CLI — Command-line mode for CI/CD integration
  • Evidence Tracking — Annotated screenshots, Gantt timelines, heat maps
  • Multi-Format Reports — Markdown, Jira, or standalone HTML

Quick Start

Prerequisites

  • Python 3.14+
  • uv (package manager)
  • A local LLM server — llama.cpp on :8080 (default), Ollama, or LM Studio

Install & Run

# 1. Install dependencies
uv sync
playwright install chromium

# 2. Configure (optional — prompts at runtime)
cp .env.example .env

# 3. Launch the UI
bash launch_ui.sh
# → http://localhost:8501

Or use the CLI:

bash launch_cli.sh

For the CLI, run bash launch_cli.sh. It starts an interactive menu; the Install page covers the launch options, and tancat --help prints the usage text.

Connect your LLM

Pick the provider in the Streamlit sidebar or the CLI "Configure LLM" menu. The supported providers are: Ollama, LM Studio, OpenAI-compatible (local), OpenAI (cloud), Azure OpenAI, OpenAI-compatible (cloud), and OpenRouter. Local providers need no key. Cloud providers need a key; the app stores it in memory for the session unless you save it encrypted.

Every provider is configured with base URL + model + key. For a generic endpoint the model is whatever the endpoint serves; for Azure OpenAI the "model" is your deployment name.

Azure OpenAI (first-class)

Azure is not a plain OpenAI-compatible endpoint: the deployment name is in the request path, api-version is a query parameter, and the key goes in the api-key header. The app builds:

POST https://<resource>.openai.azure.com/openai/deployments/<deployment>/chat/completions?api-version=2024-10-21
api-key: <AZURE_OPENAI_API_KEY>

Set these in .env (or inject them from your platform's secret store):

LLM_PROVIDER=azure-openai
AZURE_OPENAI_ENDPOINT=https://my-resource.openai.azure.com
AZURE_OPENAI_DEPLOYMENT=my-gpt4o-deployment
AZURE_OPENAI_API_KEY=...
# AZURE_OPENAI_API_VERSION=2024-10-21   # optional; this is the default

AWS Bedrock (via the Bedrock Access Gateway)

Do not point TanCat at bedrock-runtime directly. AWS ships the Bedrock Access Gateway, an OpenAI-compatible API in front of Bedrock. Use the generic compatible provider --- no adapter needed:

LLM_PROVIDER=openai-compatible
OPENAI_COMPATIBLE_BASE_URL=https://<api-id>.execute-api.<region>.amazonaws.com/api/v1
OPENAI_COMPATIBLE_API_KEY=<bedrock-gateway-api-key>
OPENAI_COMPATIBLE_MODEL=anthropic.claude-3-5-sonnet-20241022-v2:0

The base URL shape is the API Gateway invoke URL with a trailing /api/v1 (add the stage if you deployed one): https://<api-id>.execute-api.<region>.amazonaws.com/<stage>/api/v1. The gateway speaks /chat/completions with Authorization: Bearer, which is exactly what the compatible provider sends.

Any other gateway

The same compatible path covers LiteLLM, Portkey, Azure API Management, self-hosted vLLM/SGLang/TGI, Together, Groq, and DeepSeek: set the provider to OpenAI-compatible, paste the gateway's /v1 base URL and key, and name the model. See .env.example for the full list of variables.

Architecture

Phase 1: SKELETON GENERATION (LLM)
────────────────────────────────────
streamlit_app.py / cli/main.py
        │
        ▼
  orchestrator.py ──┐
        │            │
   ┌────┼────┬──────┴──────────────┐
   ▼    ▼     ▼                    ▼
 spec  test  scraper              LLM
 analyzer generator (scraper)    client
          │                        │
          ▼                        ▼
      skeleton with           prompt_utils.py
      placeholders ←───────── prompt template

Phase 2: PLACEHOLDER RESOLUTION (DOM Data)
────────────────────────────────────────────
        │
        ▼
placeholder_orchestrator.py (coordinates per-page resolution)
   │            │              │
   ▼            ▼              ▼
journey_    stateful_    semantic_
scraper     scraper      candidate_ranker
                            │
                            ▼
                placeholder_resolver
                (semantic_matcher + intent_matcher)
                            │
                            ▼
                locator_builder → code_postprocessor

Phase 3: PERSISTENCE + REPORTING
─────────────────────────────────
        │
        ▼
  pipeline_writer.py ──→ generated_tests/
        │
   evidence_tracker.py → .evidence.json sidecars
        │
   report_builder ←──┐
        │            │
        ▼            ▼
  failure_reporter  evidence_loader
        │
        ▼
  report_formatters → markdown / jira / html

For a full module map and dependency graph, see ARCHITECTURE.md.

  • Interactive call-flow diagram: generated locally with graphify update . (not committed to the repo).

Documentation

Doc Purpose
docs/user/ User documentation - install, configure your LLM, first run, guides, licensing
ARCHITECTURE.md System architecture, data flows, dependency graph
PROJECT_KNOWLEDGE.md Decisions, gotchas, recurring bugs
DEMO_GUIDE.md Step-by-step demo for stakeholders
BACKLOG.md Feature backlog and bug tracker
AGENTS.md AI coding agent conventions
CONTEXT.md Single-page project context

For Contributors

See CONTRIBUTING.md and AGENTS.md.

Pre-commit checklist: smoke.py (offline import/resolver check) → ruff → mypy → pytest.

License

Business Source License 1.1 (source-available) — see LICENSE.

The source is free to read, modify and use, including production use for any internal purpose. Two limits apply until each version's Change Date (four years after its first public release): you may not offer TanCat as a competing product or service, and the licence is not OSI open source until it converts to the Apache License, Version 2.0 on that date.

Metadata

Release files for tancat 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tancat 0.1.1
File Size Uploaded Provenance Actions
tancat-0.1.1.tar.gz 34.1 MB With provenance Details for tancat-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for tancat 0.1.1
File Interpreter ABI Platform Actions
tancat-0.1.1-py3-none-any.whl Python 3 none any Details for tancat-0.1.1-py3-none-any.whl

Total release size: 63.2 MB

Release files / tancat-0.1.1.tar.gz

Download URL tancat-0.1.1.tar.gz
Size 34.1 MB
Tags Source
SHA-256 checksum
How to use checksums
d9593cff13a389a40fa34bd254583946b1e9fdc333f61a1651be19a3694259f7
BLAKE2b-256 checksum
How to use checksums
677668ebac4922b9f5a239aa56d9ec45d238dbdeaf46b70f8935e9607b55a84a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Release files / tancat-0.1.1-py3-none-any.whl

Download URL tancat-0.1.1-py3-none-any.whl
Size 29.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
61269eb22ed6aaf3d62f37516821655ea70bfd6b6f4c314ca872c6aaa1fd0b32
BLAKE2b-256 checksum
How to use checksums
25c2f09cb9b88b7a5c6c2d1ea0d5567eb61545cc10137815f1b943ac74441c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

Security for tancat 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for tancat-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 28, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page