Skip to main content

Autonomous QA prototype with OpenClaw-backed execution and local fallbacks

Project description

Shan Claw: Autonomous QA Prototype

This project is a practical Python prototype inspired by the article: "From Test Automation to Autonomous QA: Are We Finally Closing the Feedback Gap?"

It demonstrates what can be implemented quickly in VS Code + Python:

  • Requirement parsing from PRDs/user stories
  • Coverage gap detection against existing tests
  • Just-in-time test generation templates
  • Flaky test self-heal suggestions for selector failures
  • Failure RCA assistance based on logs and diffs
  • Dependency guardrails with optional VirusTotal checks
  • OpenClaw-backed execution mode (local or remote)

Quick Start

  1. Create and activate a virtual environment.
  2. Install dependencies:
pip install -r requirements.txt
  1. Run the autonomous QA flow with sample data:
python -m shan_claw.cli run \
  --requirements examples/requirements.txt \
  --tests examples/existing_tests.txt \
  --logs examples/failure.log \
  --diff examples/code.diff \
  --deps examples/dependencies.txt
  1. Run the same flow through OpenClaw provider:
python -m shan_claw.cli run \
  --llm-provider openclaw \
  --openclaw-mode local \
  --requirements examples/requirements.txt \
  --tests examples/existing_tests.txt \
  --logs examples/failure.log \
  --diff examples/code.diff \
  --deps examples/dependencies.txt
  1. Use OpenClaw remote mode (cloud relay):
set OPENCLAW_API_KEY=your_api_key_here
python -m shan_claw.cli run \
  --llm-provider openclaw \
  --openclaw-mode remote \
  --openclaw-agent-id your_agent_id \
  --requirements examples/requirements.txt \
  --tests examples/existing_tests.txt \
  --logs examples/failure.log \
  --diff examples/code.diff \
  --deps examples/dependencies.txt
  1. Output is written to output/report.json and generated tests under generated_tests/.

  2. Generate an on-demand regression environment blueprint:

python -m shan_claw.cli provision --service payment-v2 --out-dir output/env

This creates a Docker Compose file and seed data JSON for fast test environment setup.

Article-to-Code Map

The article describes OpenClaw as the engine for collapsing the QA feedback loop. In this repository, that vision is implemented through an OpenClaw-backed provider path plus deterministic local fallbacks.

Article claim What is implemented here Code paths
Requirement Analysis -> Intelligent Parsing Requirements are parsed from text artifacts, normalized, tagged, and compared against existing tests. In OpenClaw mode, the same step is delegated to an OpenClaw agent and parsed back into structured requirement objects. shan_claw/coverage.py, shan_claw/openclaw_provider.py, examples/requirements.txt, examples/existing_tests.txt
Test Creation -> Just-in-Time Generation Coverage gaps produce generated Playwright test files. In local mode, generation uses a deterministic template. In OpenClaw mode, the provider asks OpenClaw for test code first and falls back to the template if needed. shan_claw/testgen.py, shan_claw/openclaw_provider.py, generated_tests/test_as-a-customer-i-can-complete-payment-with-a-saved-card.spec.ts, generated_tests/test_as-an-admin-i-can-search-orders-by-status.spec.ts
Flaky Tests -> Self-Healing Loops Failure logs are scanned for brittle selector patterns and converted into healing actions. In OpenClaw mode, the provider can ask the agent for healing recommendations before using local heuristics. shan_claw/self_heal.py, shan_claw/openclaw_provider.py, examples/failure.log
Environment Setup -> On-Demand Infrastructure A regression environment blueprint can be generated from the CLI, producing a Docker Compose definition and seed data for a target service such as payment-v2. shan_claw/infra.py, shan_claw/cli.py, output/env/docker-compose.yml, output/env/seed-data.json
Failures -> Assisted RCA + Fixes Logs and diffs are correlated into likely causes, supporting evidence, and suggested fixes. In OpenClaw mode, the RCA step can be delegated to the agent and normalized back into the same result structure. shan_claw/rca.py, shan_claw/openclaw_provider.py, examples/failure.log, examples/code.diff, output/report.json
Security -> Real-time Supply Chain Guardrails Dependencies are parsed, hashed, checked against a blocklist, and optionally queried against VirusTotal. Blocked packages can be annotated with OpenClaw-suggested safer alternatives. shan_claw/security.py, shan_claw/openclaw_provider.py, examples/dependencies.txt
From automation scripts to autonomous feedback systems The pipeline is orchestrated as a single workflow with provider selection. The same CLI can run in local mode or through OpenClaw, which makes the repo a concrete bridge from scripted automation toward agent-backed QA feedback. shan_claw/core.py, shan_claw/cli.py, shan_claw/openclaw_provider.py
Collapsing the feedback loop The run command links requirement ingestion, coverage analysis, test generation, healing, RCA, and dependency screening into one pass that produces a machine-readable report. shan_claw/cli.py, shan_claw/core.py, output/report.json

OpenClaw's role in this repository

  • shan_claw/openclaw_provider.py is the main integration layer.
  • shan_claw/core.py selects between local and openclaw providers.
  • shan_claw/cli.py exposes --provider openclaw, --openclaw-mode local, and --openclaw-mode remote.
  • In remote mode, the provider uses OPENCLAW_API_KEY or CMDOP_API_KEY plus an optional agent ID.

What is fully implemented vs. scaffolded

  • Fully implemented: provider selection, OpenClaw package integration, local OpenClaw execution path, deterministic fallbacks, generated reports, regression environment blueprint generation, and dependency checks with optional VirusTotal lookups.
  • Scaffolded for real enterprise rollout: direct PRD system ingestion, real DOM re-scan and auto-rewrite of selectors in browser sessions, automatic patch application back into application code, and production-grade policy/governance workflows.

Notes

  • VirusTotal checks require VIRUSTOTAL_API_KEY in your environment.
  • OpenClaw package is installed from PyPI and uses CMDOP under the hood.
  • If OpenClaw is unavailable or returns non-JSON output, this project falls back to local deterministic logic.
  • The framework is intentionally lightweight and extensible for enterprise adaptation.

Traceability Links

Architecture and design references:

Operational runbooks and scripts:

Release and publishing governance:

Core implementation references:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

shan_claw-0.4.1.tar.gz (33.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shan_claw-0.4.1-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file shan_claw-0.4.1.tar.gz.

File metadata

  • Download URL: shan_claw-0.4.1.tar.gz
  • Upload date:
  • Size: 33.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shan_claw-0.4.1.tar.gz
Algorithm Hash digest
SHA256 98f7b0f0be5162072a0b170c63b932ed188f6e8d536abe668cb737fdb629dae9
MD5 e0ee0745b97acadfe68665da229dc391
BLAKE2b-256 2350ad53a5c5faee4ba2661b798ee4432942e9fce83eceab135e21739794260b

See more details on using hashes here.

File details

Details for the file shan_claw-0.4.1-py3-none-any.whl.

File metadata

  • Download URL: shan_claw-0.4.1-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for shan_claw-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7e5d65fc6ec31c9e46d1580ff97ac937d7e73cc708f0c7af9c06896184b630a6
MD5 0e6fa1a732006e2989939063530747b0
BLAKE2b-256 817cc2d09a18dfaa1d120a09a540dc7b3082a54688711fbe8ae2b29f416a15ca

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page