Run Python AST & Contrast Verification Suite
ink_run_python_testsRun Python-powered static analysis, contrast ratio calculations, and headless layout audits to obtain structured verification metrics.
Instructions
PURPOSE: Execute the external Python verification suite for deep AST static analysis, mathematical contrast matrix calculation, and headless layout audits.
BEHAVIOR: Spawns the local Python 3 ink_verifier engine in a sandboxed subprocess. Purely read-only; does not mutate source files or modify disk state unless 'capture' is specifically invoked. Requires Python 3.10+ installed in the environment PATH. Returns comprehensive structured test metrics.
USAGE GUIDELINES:
When to use: Use when running deep multi-pass Python AST analysis, mathematical APCA/WCAG contrast calculation, or comprehensive verification across an entire codebase.
When NOT to use: Do NOT use for fast in-memory CSS validation without Python (use ink_validate_design instead) or for standalone client-side security audits (use ink_audit_security instead).
Alternatives: Use ink_validate_design for fast TypeScript-native design verification; use ink_audit_security for native security scanning.
RETURNS: ResultEnvelope containing structured test outcomes from the Python verifier engine according to the invoked action ('contrast', 'security', 'visual', 'audit', 'full', 'bidi', 'inspect', or 'capture').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | Source code snippet to analyze with Python AST and regex engines (required when action is 'security', 'visual', 'audit', 'bidi', or 'full') | |
| action | No | Verification action: 'contrast' (WCAG/APCA matrix calculation), 'security' (Python AST sink linter), 'visual' (anti-slop rule engine), 'audit' (combined static analysis), 'full' (all static + dynamic checks), 'bidi' (RTL/LTR logical property AST analysis), 'inspect' (reverse-engineer URL design), 'capture' (headless browser multi-viewport snapshots) | full |
| target | No | Website URL or local HTML file path (required when action is 'inspect' or 'capture') | |
| backgroundHex | No | Background surface color in 6-digit hex (used when action is 'contrast') | |
| foregroundHex | No | Foreground text color in 6-digit hex (used when action is 'contrast') |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Domain-specific typed payload returned by the tool | |
| status | Yes | Execution outcome status | |
| summary | Yes | Concise, human-readable executive summary of the tool outcome | |
| evidence | No | Audit trail, source references, and generated artifact locations | |
| warnings | Yes | Operational cautions, craft advice, or non-blocking warnings | |
| nextActions | No | Actionable sequential recommendations or subsequent tool suggestions |