Sprezzatura (/sprezzatura, /sprez) — Adaptive Fault-Cluster QA Audit
Sprezzatura replaces noisy, generic 40-item code review checklists with isolated, high-curvature hostile world-state probes (like the classic Turkey Test), defended by a Blind Skeptical Verifier so only concrete, reachable defects reach the developer.
Core Invariants (Non-Negotiable):
- Strictly Read-Only by Default: Never modify target repository source files during an audit.
- Never Auto-File Issues: Present findings and drafts first; file GitHub issues or backlog items ONLY after explicit user confirmation of selected IDs and duplicate-fingerprint checks.
- 0 Findings (
CLEAN) Is a Valid, High-Scoring Outcome: Never invent speculative bugs to justify a run.- Never Confuse Silence With Completion: Always disclose completed vs. skipped vs. timed-out charters.
Invocation & Modes
/sprezzatura [path-or-scope] [--mode quick|standard|deep] [--repo] [--prove]
/sprez [path-or-scope] [--mode quick|standard|deep] [--repo] [--prove]
| Mode | Active Hunters | Verification Stage | When to Use |
|---|---|---|---|
quick | 0–1 | 1 Blind Verifier | Small diff or single targeted risk check |
standard (default) | Adaptive 0–3 | 1 Blind Verifier | Everyday PR/commit audit (target ≤5 contexts) |
deep | 0–5 | 1 Blind Verifier (prefer cross-model if available) + opt-in --prove | Milestone / pre-release audit (show budget notice if >3 hunters or --repo) |
Step-by-Step Procedure
Stage 1 — Hybrid Surface Profiler (Orchestrator)
Record {USER_LANGUAGE} (matching the user's request language).
- Run the deterministic stdlib fingerprinter (single command, zero external deps; use
python3on macOS/Linux ifpythonis unavailable):python "<skill_dir>/scripts/fingerprint.py" --repo "<repo_root>" --scope <auto|diff|merge-base|path|repo> [--path "<subpath>"] [--include-tests]- Test-file hygiene: Test files (
tests/,test_*.py,*_test.*,*.spec.*) are excluded from candidate cluster scoring by default (tests_excluded: true, withtest_file_countreported) so test harnesses do not drown out production signals; pass--include-tests(or target a test path directly via--path) when auditing tests. - Default Scope Cascade (
--scope auto):- Explicit
<path>if provided by user. - Working tree diff (staged + unstaged + untracked source files).
- Clean feature branch → diff against merge-base (
main/master). - Clean default branch with no diff → stop and ask the user to pick a target path or confirm
--repo(never silently spray 500 legacy files).
- Explicit
- Test-file hygiene: Test files (
- Establish Reachability & Adaptively Select Clusters (
0to mode max):- Inspect the JSON output (
detected_stacks,target_files,candidate_clusterswith concrete API/import/boundary evidence, andunmatched_clusters). - Select only genuinely reachable clusters (a small diff may earn
0or1hunter — do NOT pad to 3). - Cite concrete evidence from
fingerprint.pyfor every selected cluster. You may nominate at most 1 unlisted cluster only if you cite a specific entry point and a plausible broken product contract. - Bind each selected cluster to its exact target file slice and entry points (plus 1-hop callers/callees needed to judge reachability).
- Inspect the JSON output (
- Print a Compact Pre-Flight Lock (≤4 lines):
- Scope & revision (
git rev-parse --short HEADorworking-tree), detected stack(s), active clusters, and a 1-lineSkipped Clustersnote. - If
--repoordeepwith>3hunters was implicitly triggered, confirm cost/scope before fanning out.
- Scope & revision (
Stage 2 — Isolated Parallel Cluster Hunters (Read-Only)
Spawn 1 fresh, isolated read-only subagent per selected cluster in parallel using the Stage 2 template in prompt_templates.md:
- Antigravity (
agy):invoke_subagentwithTypeName: "research"(or"self"strictly instructed read-only),Model: "inherit". - Claude Code:
Agenttool (fresh context, read-only tools only). - Codex CLI: Isolated
codex exec -s read-onlyworkers; if the client lacks parallel isolation, run sequentially and explicitly disclose reduced independence in the final report.
Hunter Rules:
- Zero Cross-Talk: Hunters never see each other's findings or cards.
- Load Only One Card: Pass ONLY the assigned card (
references/clusters/<card>.md), the detected stack profile, and the assigned file slice. - Stack Applicability Gate: Hunters MUST honor the card's
Per-Stack Applicabilitysection (e.g., never flag locale-independent Pythonstr.lower()or JStoLowerCase()underlocale-casing). - Evidence Contract (Pre-Verifier Hard Filter): Every candidate finding MUST populate ALL required fields (
cluster,probe_id,file:line,symbol,origin: regression|pre-existing,trigger_input,expected_contract,actual_failure,traced_path,user_impact). Drop any candidate missing a field before Stage 3. - Hard Cap: Maximum
4findings per hunter,0floor. Problem-only (no unsolicited code patches or style nits). - UX Hygiene: While hunters run in parallel, do not stream partial analysis; wait until all complete or time out, and record any unfinished/timed-out hunter explicitly.
Stage 3 — Blind Skeptical Verifier (Fresh Clean Context)
If all hunters returned 0 valid candidates, skip Stage 3 and jump straight to Stage 4 (distinguishing clean completion from any timed-out hunter).
Otherwise, spawn 1 fresh clean-context Verifier subagent using the Stage 3 template in prompt_templates.md:
- Blind Input Rule: Strip all hunter prose, persuasion, confidence scores, and severity labels. Pass ONLY the normalized structured evidence records + target repo read access.
- Hostile Defense-Attorney Posture: For every candidate, the Verifier MUST re-read the cited
file:lineand upstream callers/callees/contracts and actively try to disprove it (DISPROVEDif guarded upstream, unreachable, wrong stack semantics, or governed by a different contract such as a wire spec requiring decimal dots). - Deduplicate & Rank: Merge findings sharing one root cause and one fix. Assign
CONFIRMED: Blocker | Major | Watch(max10findings per report). - Stable Fingerprints: Compute a deterministic 10-char fingerprint per confirmed finding via:
python "<skill_dir>/scripts/fingerprint.py" --hash "<cluster>" "<normalized_rel_path>" "<symbol>" "<probe_id>" - Prune Tally: Return a single count line (
N raw -> M confirmed, K pruned). Keep discarded hypotheses off the user's first screen.
Stage 3.5 — Opt-In Executable Proof (Verify / --prove)
Run ONLY when the user explicitly passes --prove (on Verifier-confirmed Blocker/Major findings, capped at N=5) OR invokes Verify <ID> on a specific finding after Stage 4:
- Heavy-Build Guard: If the target requires Unity Editor, native GUI, or external hardware, do NOT fake a partial harness — keep
STATIC-ONLYand state why. - Isolated Scratch Execution: Run in a disposable temp directory or detached
git worktreeoutside the target tree, with no network access and zero edits to lockfiles or target files. Clean up scratch space immediately after. - Real Entry-Point + Control Requirement: A probe earns
PROVENONLY if it fails through the actual product entry point at the audited revision AND a matching control input passes on the same entry point. Record OS/runtime/locale environment. - Status Tags:
PROVEN|STATIC-ONLY|REPRO-FAILED(unproven, not automatically false).
Stage 4 — First-Screen Report & Opt-In Action Loop
Deliver the report in {USER_LANGUAGE} following strict anti-slop ergonomics:
- First Screen (Top 3 Lines — Answer 3 Questions):
- What breaks for the user? (Count + headline impact, or explicit
0 findingsacrossX/Y completed charters+ any timed-out charter warning). - What evidence supports it? (
STATIC-ONLYvsPROVEN, revision, prune tallyN raw -> M confirmed). - What to do next? (Smallest concrete next step).
- What breaks for the user? (Count + headline impact, or explicit
- Confirmed Findings Table & Concise Cards (Problem-Only):
- For each confirmed finding (
F01..F10): ID, Fingerprint (sprezzatura:<fp>), Severity, Proof Tag, Origin (regressionvspre-existing),file:line, Trigger, Broken Contract, User Impact, and Smallest Next Check. - Keep raw hunter logs and rejected hypotheses out of the main output (only print if user asks).
- For each confirmed finding (
- Optional Local Export & Recheck Diff:
- If a prior
.sprezzatura/last_run.jsonexists for the same scope (only written when user opts in or invokes export/file), compare fingerprints and tag each itemNEW|STILL-PRESENT|RESOLVED|FLAPPING.
- If a prior
- Action Footer (Never Auto-Execute):
Offer three crisp follow-ups:
Verify F01— Run isolated scratch reproduction through the product entry point (PROVEN/REPRO-FAILED).File F01, F02— Preview exact issue text + destination (gh issue createorBACKLOG.md), rungh issue list --search "sprezzatura:<fp>"duplicate check, and create only after explicit confirmation.Recheck— Re-run the same cluster & trigger/control after a fix to confirmRESOLVED.
Validation Checklist (Before Delivering Report)
-
fingerprint.pyran cleanly and scope/skipped clusters were disclosed in ≤4 lines. - Every active hunter ran in an isolated read-only context with ONLY its assigned card and target slice (or sequential fallback was explicitly disclosed).
- Every hunter respected the card's
Per-Stack Applicabilitymatrix and problem-only rule. - Stage 3 Verifier ran blind (without hunter confidence/narrative) and actually re-read cited code + callers.
- Completed vs. unfinished/timed-out charters are explicitly separated on the first screen.
- Zero target files were modified and zero external issues were filed without explicit user confirmation.