Skip to content
Back to skills

Qa 11x Systematic Debugging

ASecurity

Root-cause debugging and regression isolation sub-skill for Standard 11X. Use before applying any bug fix, test repair, flaky-test patch, Docker CrashLoop recovery, or BREAKER-42 circuit-breaker remediation.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 29, 2026
developmentpythonrustgojavaphpshellbashsqlreactvue

Works with

  • cli
  • api
  • mcp

Security analysis

A100/100

Scanned December 3, 2026

npx -y skills add tecno-consultores/qa-11x --skill qa-11x-systematic-debugging --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Qa 11x Systematic Debugging?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Qa 11x Systematic Debugging
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tecno-consultores-qa-11x-systematic-debugging/badge)](https://www.skillsdirectory.com/skills/tecno-consultores-qa-11x-systematic-debugging)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: qa-11x-systematic-debugging
description: >-
  Root-cause debugging and regression isolation sub-skill for Standard 11X. Use before applying any bug fix,
  test repair, flaky-test patch, Docker CrashLoop recovery, or BREAKER-42 circuit-breaker remediation.
---

# QA 11X Systematic Debugging (`qa-11x-systematic-debugging`)

> **OUTPUT LANGUAGE & DYNAMIC MIRRORING:** Respond in **user's prompt language** (unless `AGENTS.md` fixes it); docs/commits match `README.md`/`CHANGELOG.md` (Spec 19; `.agents/**` English).

Deterministic 4-phase root-cause troubleshooting protocol under Standard 11X (`qa-11x-architect`), enforcing **Rule Zero** ephemeral reproduction, AST knowledge graph tracing (`graphify-ast-navigator`), single-hypothesis experimentation with a 3-strike circuit breaker, and unmocked **RED-to-GREEN** regression locking.

---

## 1. The Iron Law of 11X Debugging

**ZERO SPECULATIVE CODE PATCHES WITHOUT PRIOR DETERMINISTIC ROOT-CAUSE ISOLATION.**

Modifying production code, tests, or configuration before reproducing the failure in Docker and tracing its exact fault boundary amplifies blast radius and creates silent QA escapes.

### Strictly Forbidden Debugging Anti-Patterns
1. **Shotgun Debugging:** Applying multiple unverified edits across files hoping one sticks.
2. **Swallowed Exceptions:** Wrapping failures in `try/except: pass`, bare `catch {}`, or fallback returns that mask real contract violations.
3. **Timing Bandaids:** Inserting arbitrary `sleep()` / `waitForTimeout()` calls instead of fixing deterministic synchronization, readiness probes, or state machines.
4. **Weakening Contracts:** Adding `# type: ignore`, `@ts-expect-error`, `as any`, lowering `--cov-fail-under=95`, relaxing assertions, or switching failing checks to hardcoded `'PASSED'`/`true`.
5. **Masking Persistence or Cross-Module Faults with Mocks:** Replacing failing SQL queries, migrations, `AsyncSession` transactions, or cross-module HTTP/store flows with mocks instead of fixing the underlying contract.

---

## 2. Phase 1 — Root Cause Investigation & Reproduction (Docker Rule Zero + AST)

Execute every step sequentially before proposing any fix:

1. **Ingest the Structured Failure Envelope (`Fail-Verbose`):**
   - Inspect `.agents/.cache/qa-11x-last-failure.json` (generated exclusively by `certify_task_completion.sh`, or structured JSON returned by `certify_11x_gate`) and stderr diagnostic excerpts to extract exact gate number, failing command, exit code, and sanitized stack trace.
2. **Reproduce Deterministically Inside Ephemeral Docker (`Rule Zero`):**
   - **NEVER** run tests, compilers, or linters on the host OS. Before launching new containers after a timeout, slowdown, or hang, inspect `docker ps -a --filter status=restarting` and active background subagents/tasks; stop any workspace CrashLoop (`docker update --restart=no <id> && docker rm -fv <id>`) first and never launch parallel `docker run` retries (`QA-DOCKER-LOOP-01`). Reproduce the exact failure sequentially inside `sinfallas/*` containers (`Makefile` targets or `run_ephemeral_qa`) with identical flags (`--import-mode=importlib`, `COVERAGE_FILE=/tmp/.coverage`, `mypy --strict --cache-dir=/tmp/mypy`, `HOME=/tmp`).
3. **Trace Impact with Graphify AST First (Before `grep` / `read_file`):**
   - Ensure `graphify-out/graph.json` exists (if missing, build it via `./scripts/actualizar-grafos-graphify.sh`).
   - Run `inspect_blast_radius.py` in ephemeral Docker (`docker run --rm --network none -u "$(id -u):$(id -g)" -e HOME=/tmp -v "$(pwd):/app:ro" -w /app sinfallas/base-python-uv:3.15 python3 .agents/scripts/inspect_blast_radius.py "<failing_symbol>"`, or MCP `inspect_ast_blast_radius`) and inspect `graphify-out/GRAPH_REPORT.md` to obtain exact declaring `file:line`, incoming callers (`⬅️`), and outgoing dependencies (`➡️`).
   - Read only targeted 40–80 line windows around the fault and its direct callers/callees.
4. **Backward Data-Flow Trace Across the 5 Classic 11X Failure Vectors:**
   - **(a) Post-Commit RLS Context Loss & `MissingGreenlet` (`QA-PG17-RLS`):** Did `await db.commit()` expire `SET LOCAL app.current_tenant_id` before a subsequent query or `write_audit_log()`? Verify `session.sync_session.info` + `@event.listens_for(AsyncSession.sync_session_class, "after_begin")` and explicit `await db.refresh()` or pre-commit primitive capture.
   - **(b) `JSON`/`JSONB` Serialization Escapes over `Decimal` / `UUID`:** Did `MockDbSession` omit strict `json.dumps()` validation without `default=str` while production `asyncpg` rejected `Decimal` (`Numeric(p, s)`), `UUID`, or `datetime`?
   - **(c) 3-Phase Temporal Lifecycle Boundaries:** Verify entity transitions across **Phase 1 Pending** ($t < t_0$, e.g. `t < starts_at`), **Phase 2 Active** ($t_0 \le t \le t_1$), and **Phase 3 Expired/Reverted** ($t > t_1$ or cancelled) — including Safe Mode rollbacks, pre-auth `TTL <= 300s`, and Step-Up leases.
   - **(d) Dual CLI/MCP `stdio` Interactive `TTY` Hangs (`QA-CLI-TTY-01`):** Does a dual CLI/MCP binary block forever waiting on `stdin` EOF instead of checking `isTTY`/`isatty()`, printing help, and exiting `0` within `<= 5s` when `--stdio` is absent?
   - **(e) Non-Root Container Bind-Mount `os error 13` (`Permission denied`):** Check host UID/GID alignment (`-u "$(id -u):$(id -g)"`), `COVERAGE_FILE=/tmp/.coverage`, `UV_CACHE_DIR=/tmp/uv-cache`, `HOME=/tmp`, `pnpm_config_store_dir=/pnpm/store`, and `pnpm-store-init` volume permissions (`chmod -R a+rwX /pnpm`).

---

## 3. Phase 2 — Differential & Contract Pattern Analysis

Before writing a hypothesis, compare the broken path against working invariants in the repository:

1. **Blueprint & Sibling Route Contrast:** Compare the failing implementation against canonical reference patterns across all 15 blueprint stacks (`python/`, `fastapi/`, `node-backend/`, `vue3/`, `react-frontend/`, `php/`, `bash-scripts/`, `ai-evals/`, `mobile-appium/`, `vibe-rescue/`, `dotnet/`, `java/`, `go/`, `flutter/`, `rust/`) or `qa-11x-devsecops-hardener` (`references/stig_rls_vault.md`).
2. **Recent Change Isolation (`git` Diff & Archeology):**
   - Run `git status -s`, `git diff`, or `git log -S "<symbol>" -p -n 3` to pinpoint the exact commit or schema drift that introduced the regression.
3. **Deterministic Contract & Parity Validators (Ephemeral Container Execution):**
   Run the relevant repository governance validators in Docker (`docker run --rm --network none -u "$(id -u):$(id -g)" -e HOME=/tmp -v "$(pwd):/app:ro" -w /app sinfallas/base-python-uv:3.15 python3 .agents/scripts/<validator>.py`) to surface silent structural drift:
   - `verify_alembic_orm_parity.py` — detects ORM vs. Alembic migration drift and `revision > 32` chars.
   - `verify_no_orphan_api_endpoints.py` — detects mismatched or orphan frontend/backend API routes (`404`/`405`).
   - `verify_topological_health.py` — detects circular dependencies and cross-layer AST violations.
   - `verify_zero_orphan_vue_components.py` — verifies every UI view/component owns an active unit test.
   - `verify_json_no_duplicate_keys.py` — catches silent shadowed i18n or config keys.

---

## 4. Phase 3 — Single-Hypothesis Scientific Testing & 3-Strike Escalation

Follow strict scientific isolation — never bundle multiple guesses into one edit:

1. **Formulate Exactly One Falsifiable Hypothesis:**
   > *"Failure `X` occurs at `file:line` because condition `Y` violates invariant `Z`; changing/logging `Y` will produce observed output `W`."*
2. **Minimum Diagnostic Probe:**
   - Apply the smallest reversible diagnostic assertion or targeted test run inside the ephemeral container to confirm or falsify the hypothesis.
   - **If falsified:** Revert the tentative edit immediately (`git checkout -- <file>`) before testing the next hypothesis. Never stack unverified patches.
3. **Mandatory Circuit Breaker — 3-Strike Architectural Escalation (`BREAKER-42`):**
   - Track consecutive failed hypotheses (`Strike 1 -> Strike 2 -> Strike 3`). This invariant is deterministically enforced by `.agents/scripts/track_findings_state.py` (integrated into `certify_task_completion.sh`) and `recordQaStageFindingsState` (`run_ephemeral_qa` in `mcp-server/src/tools/ephemeral-runner.ts`), persisting line-shift-invariant finding fingerprints per `{branch}:{merge_base_sha}` in `.agents/.cache/certify_state.json`.
   - **HARD STOP AT STRIKE 3 OR `A -> B -> A` OSCILLATION (`exit 42` / `BREAKER-42`):** If **3 consecutive hypotheses fail** (`consecutive_streak >= 3`) or a finding oscillates (`oscillations >= 1`), execution aborts with **`exit 42` (`[BREAKER-42]`)** — **STOP editing code immediately**. Do NOT attempt a 4th speculative patch, and NEVER run `--reset-state` without explicit human operator authorization.
   - Escalate an architectural diagnosis packet containing:
     1. Exact Docker reproduction command and fail-verbose excerpt (`.agents/.cache/qa-11x-last-failure.json` from `certify_task_completion.sh` or gate JSON).
     2. Summary of the 3 refuted hypotheses and their observed outputs.
     3. AST blast-radius graph (`inspect_blast_radius.py` callers/callees) and suspected contract/architecture mismatch (e.g., cross-module state ownership, RLS session lifecycle, or missing spec invariant) for planning/operator review.

---

## 5. Phase 4 — RED-to-GREEN Regression Lock & QA-Escape Post-Mortem

Once the single root cause is proven:

1. **RED First (Unmocked Regression Test):**
   - Write or extend the failing regression test **before** applying the production fix.
   - Enforce **Anti-Mock Blindness & Anti-Silo Rules**: verify Module A mutation -> Module B `GET`/store propagation against the real DB/KeyDB engine without intermediate mocks, assert `write_audit_log` arguments and human-readable identities (zero raw UUID v4 strings), cover trimodal states (Virgin / Nominal / Degraded) or 3 clock phases when applicable, and include proportional Karate Labs `.feature` scenarios (injecting dynamic `Idempotency-Key` UUIDs) on `FULL_11X` API/UI flows.
   - Run the targeted test in Docker via `run_ephemeral_qa(stage="unit", expect_red=true)` (exempt from `BREAKER-42`; blocks `[TDD-TAUTOLOGY]` if `0` tests fail; stamps `red_verified` bound to `head_sha` + tree SHA-256 in `.agents/.qa-evidence.json`) and confirm **RED** for the exact isolated root cause.
2. **Surgical GREEN Fix:**
   - Apply the minimal root-cause fix respecting `CC <= 5` (Grade A), `SonarJS <= 15` (PHP cognitive `<= 9`), strict static typing (`mypy --strict`, `vue-tsc --noEmit`, ESLint `--max-warnings 0`, PHPStan max, ShellCheck/shfmt), `>= 95%` branch/line coverage, and `MSI >= 80%`.
   - Re-run the failing test and full stack QA suite in `sinfallas/*` containers until **100% GREEN** with zero warnings or skipped assertions.
3. **AST Refresh, 10/10 Certification & QA-Escape Post-Mortem:**
   - Refresh AST graphs incrementally: `./scripts/actualizar-grafos-graphify.sh`.
   - Sync documentation/`CHANGELOG.md` and `.agents/ACTIVE_TASK.md` (`<= 40` lines), run `make sync-governance` and `make certify` (`10/10` gates; optionally enforce cryptographic `RED -> GREEN` verification with `certify_11x_gate(require_red_green_evidence=true)`, `qa-11x certify --require-red-green-evidence`, or `"requireRedGreenEvidence": true` in `.qa-11x.json`), and stop at a local `git commit` (`QA-GIT-GATE-01` — no `git push`).
   - **QA-Escape Learning Loop:** Whenever the bug escaped prior tests into UAT or production, proactively emit `💡 Oportunidad de Mejora Detectada para el Estándar QA 11X` explaining which blind spot failed and invoke `propose_skill_evolution_pr` (or update `.agents/` + `docs/` + `security-auditor.ts` in this blueprint repository) so the escape class can never recur.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.