anonymousnomad/covert-coder/aid-dap-real-debugpy-fixture
Claude Code and agent skill by anonymousnomad/covert-coder
- community
Checking that the SKILL.md file is still in the repository.
Wire in a REAL debugpy fixture for the AIDE DAP test batteries. The tests/arch/dap-contract.test.ts and daemon/test-dap-fixture.mjs read fixtures/debuggee/fizz_engine.py — this skill encodes the VERIFIED recipe (9/9 arch pass plus daemon orphan-check pass) so the next agent can reproduce the green path. Use whenever a DAP fixture test fails, when adding a real-DAP test, when wiring debugpy into the AIDE arch build, or when the DAP release-engineering gate needs to be verified.
Install
npx vskill@latest install anonymousnomad/covert-coder/aid-dap-real-debugpy-fixtureSKILL.md
The same SKILL.md was published earlier as anonymousnomad/covert-coder/aid-dap-real-debugpy-fixture.
DAP Real Debugpy Fixture — VERIFIED Wire-In Recipe
Status: VERIFIED GREEN (2026-09-03)
tests/arch/dap-contract.test.ts — 9/9 tests pass in 8.5s with the fixture described below. The real debugpy round-trip (real debugpy adapter round trip on the fizz_engine fixture) passes in 3.0s against debugpy 1.8.21 on Windows.
What this skill is
The AIDE arch build has a real-DAP test at tests/arch/dap-contract.test.ts:326 and a daemon-level fixture test at daemon/test-dap-fixture.mjs that read a Python debuggee from fixtures/debuggee/fizz_engine.py and run it through debugpy. The fixture was missing. This skill encodes the exact verified content of that fixture, the failure modes that cost cycles, the PID marker required for the daemon orphan check, and the wire-in path so both tests stay green.
Primary sources (verified 2026-09-03):
- DAP spec:
https://microsoft.github.io/debug-adapter-protocol/specification - DAP overview:
https://microsoft.github.io/debug-adapter-protocol/overview - debugpy README:
https://github.com/microsoft/debugpy - debugpy quirks: verified via direct probe of debugpy 1.8.21 on this machine (see
aide-arch-protocolsfield notes)
The exact file the test needs (VERIFIED)
Path: E:\aide-sovereign-workbench\fixtures\debuggee\fizz_engine.py
The test at line 348 reads:
The test resolves the breakpoint lines from markers (line 351-355):
`lineOf` uses `.includes()` (SUBSTRING match) and `findIndex` returns the FIRST match. This is the root cause of 3 of the 5 failure modes below — the docstring, the list-of-dicts, and the comprehension all matched BEFORE the intended code line.
The VERIFIED fixture content (copy verbatim, 9/9 pass)
Why this exact content passes 9/9 (line-by-line against the test)
- Line 7
def main():— entry point.frame[0]?.name === 'main'(test line 370) ✓ - Line 11
total = sum(values)— contains the markertotal = sum(test line 353), is a simple assignment with no comprehension on the same line (critical fornextto reportreason: 'step'not'breakpoint'per debugpy quirk #5 below), is inside `main()` (so the frame ismainnot a helper). ✓ - Line 13
print(report)— contains the markerprint(report)(test line 354), is insidemain(). ✓ - The PID marker is written before the first breakpoint —
daemon/test-dap-fixture.mjsreadsfixtures/debuggee/debuggee.pidafter disconnect and verifies that PID is no longer alive. ✓ - No docstring with the markers (critical — the docstring caused failure mode #1 below).
- `items` is a flat list of strings (critical — list-of-dicts caused failure mode #2 below).
- `items[2]` is `'Fizz'` (0-based, 3rd item) — test asserts
vars3.some(v => v.name === '02' && v.value === "'Fizz'")(line 385). ✓ - Digit-only sum = 1+2+4+7+8+11+10 = 43 — test asserts
total?.value === '43'(line 404). ✓ - Standalone run:
py -3.10 -E <path>→ stdout:{'total': 43, 'count': 12}and writes a siblingdebuggee.pid. Exit 0. ✓
The 5 failure modes I hit (and how to fix each)
| # | Error message | Root cause | Fix | |
|---|---|---|---|---|
| 1 | '<module>' !== 'main' (test line 370) | Docstring at lines 5-6 contained the literal text total = sum and print(report). lineOf matched the docstring FIRST (line 5/6) not the code (line 22/24). debugpy stopped at the docstring (module level) not inside main(). | Remove the docstring OR rewrite it to not contain the markers. The verified fixture has NO docstring. | |
| 2 | 'items[2] = Fizz' at depth 3 (test line 385) | items was a list of dicts: [{"name":"1","score":4}, ...]. items[2] was {"name":"Fizz","score":5} — a DICT, not the string 'Fizz'. The test expects a flat list of strings. | Change items to a flat list of strings where index 2 is 'Fizz'. | |
| 3 | 'breakpoint' !== 'step' (test line 390) | total = sum(int(x) for x in engine['items'] if x.isdigit()) had a generator expression on the same line as the breakpoint. Per debugpy quirk: when a next lands in a comprehension frame on the same physical line as a breakpoint, the stopped reason is breakpoint not step. | Split the comprehension into a separate line: values = [int(x) for x in engine['items'] if x.isdigit()] then total = sum(values). The breakpoint on total = sum(values) is now a simple assignment. | |
| 4 | 'compute_total' !== 'main' (test line 370) | I moved total = sum(values) into a helper function compute_total(). debugpy stopped inside the helper, so the frame was compute_total not main. | Keep total = sum(values) inside main(), not a helper. The test expects frame[0]?.name === 'main'. | |
| 5 | 'Channel was closed before the response' (debugpy stderr) | My direct probe killed the child process's stdin before debugpy could respond. NOT a fixture bug — a probe-script bug. | When probing debugpy manually, give it 5-10 seconds to respond before killing. | |
| 6 | pid file check failed: ENOENT (daemon test line 206) | The daemon-level battery launches the repository fixture directly and requires a PID marker to verify the debuggee was reaped; the original arch-only recipe did not write one. | Keep the Path(__file__).with_name('debuggee.pid').write_text(...) line before the first breakpoint. Do not weaken or remove the orphan assertion. |
The DAP lifecycle the DapManager must enforce (port from aide-arch-protocols)
Bugs to expect (verified, ported from aide-arch-protocols)
- launch→setBreakpoints→configurationDone order is law. debugpy defers launch response until configurationDone, so awaiting launch first deadlocks (60s timeout). And setBreakpoints BEFORE launch rejects with "Server is not available".
- launch `type` must be `'python'` (adapter's language), not a client id. debugpy rejects unknown types immediately.
- dict keys arrive quoted:
'items','02'. Strip^'|'$when matching. Plain locals (engine,total) are unquoted. - Event waiting needs index watermarks:
stoppedrepeats (breakpoint → step → breakpoint). Useevents.slice(watermark).find(...), neverevents.find(...). - Adapter children hold the temp workspace as cwd →
rmdirfails EBUSY. Alwaysmanager.stopAll()before cleanup; retry rmdir on EBUSY with backoff. - Optional contract fields must be OMITTED, not
undefined(message: undefinedbreaksdeepStrictEqual). - Surface adapter error `message`, not just
error— debugpy's "Server is not available" lives inmessage. - Test fixture adapters (fake-dap-*.mjs): parse raw byte buffers, never
readline. Use Buffer accumulator + Content-Length slicing. - Test fixture adapters: write whole frames in one
write(). Overlapping setTimeout writes splice one message's bytes into another. - `next` on a comprehension line reports `breakpoint` not `step` (verified in this session — failure mode #3 above).
- The daemon-level fixture battery requires a PID marker so it can verify the debuggee is dead after disconnect. Write it before the first breakpoint and remove it during test cleanup.
Dependencies
- debugpy importable in the configured Python. On win32:
py -3.10 -E -c "import debugpy"(test usesresolvePythonwhich probes this first). If absent:t.skip('debugpy is not importable...')— the test is designed to skip, not fail, when debugpy is missing. - The configured Python:
AIDE_PYTHONenv var (if set), elsepy -3.10 -E. The skillaid-venv-careand the failurefailure-pythonpath-hijackdocument venv traps — do NOT use a venv with a brokenhome=pointing at the extracted embed zip. - Adapter command line:
{python} -m debugpy.adapter. Thedebugpy.adaptermodule is the DAP-server entry;debugpy.listen()is the client-side (different mode). - AIDE arch `DapManager` (at
node/src/services/dap.ts): providesstart/initialize/launch/setBreakpoints/configure/stack/scopes/variables/step/continue/disconnect/adapterStatus. ReusesJsonRpcDecoderfor framing. No new code needed in DapManager — the fixture is the missing piece.
How to wire it in (the steps)
- Create the directory and file (one Write call, per the credo):
``bash New-Item -ItemType Directory -Path "E:\aide-sovereign-workbench\fixtures\debuggee" -Force ` Write E:\aide-sovereign-workbench\fixtures\debuggee\fizz_engine.py with the VERIFIED content above (4-space indent, LF line endings, #!/usr/bin/env python3` shebang, NO docstring, PID marker before the first breakpoint).
- Verify the fixture locally by running it with Python:
``bash py -3.10 -E "E:\aide-sovereign-workbench\fixtures\debuggee\fizz_engine.py" ` Expected stdout: {'total': 43, 'count': 12} and a sibling debuggee.pid`. Exit code 0. If the output or marker is wrong, the fixture is wrong — fix the fixture, not the test.
- Verify debugpy is importable in the test's Python:
``bash py -3.10 -E -c "import debugpy; print(debugpy.__version__)" ` If this fails, the test will skip (not fail). To get a real pass, install debugpy: py -3.10 -m pip install debugpy`.
- Run the test solo (per the credo, one thing at a time):
``bash cd E:\aide-sovereign-workbench node --experimental-strip-types --no-warnings \ --import "file:///E:/aide-sovereign-workbench/scripts/http-close-shim.mjs" \ --test --test-timeout=240000 --test-concurrency=1 \ tests/arch/dap-contract.test.ts ` Expected: 9 tests pass, 0 fail, 0 skip. The real debugpy adapter round trip` test passes in ~3s.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/packs/aid-dap-real-debugpy-fixture/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Grok Build (Cursor)
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/anonymousnomad/covert-coder/aid-dap-real-debugpy-fixture)