技能调试
- 作者仓库星标 263
- 作者仓库 audio-plugin-coder
- 领域
- 人工智能
- 作者声明的智能体
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 88 / 100 · 启发式扫描,不代表运行安全
- 运行环境证据
- 未执行;当前没有隔离运行测试证据
- 作者 / 版本 / 许可证
- @Noizefield · 未声明许可证
- 上下文用量评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部接口密钥
- 不需要
- 兼容的系统
- macOS · Linux · Windows
- 运行环境要求
- Node.js · Python
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 命令执行
- 网络行为
- 仅限本地
- 安装命令数
- 无(仅作为资料)
需要注意: 未声明工具权限范围;实际权限由运行环境决定。
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "LLM Autonomous Debug",
"program": "${workspaceFolder}/index.js",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"stopOnEntry": true,
"outputCapture": "std",
"env": {
"NODE_ENV": "development"
}
}
]
}
第 1 步:工作空间勘察
枚举工作区根 识别: 主要语言 入口点(例如 `main.py`、`index.js`、`app.ts`、`Program.cs`) 现有测试套件
第2步:静态代码分析
对于每个执行路径: 解析 AST(或等效项) 识别: 未处理的异常 不安全的强制转换
第 3 步:断点放置启发法
自动在以下位置插入断点: 程序入口点 所有捕获和未捕获的异常块 函数边界: 复杂条件
第4步:生成VS代码:调试配置
创建或更新:
第5步:进入调试模式
调用 VS Code:命令:`Debug: Start Debugging` 确认调试器连接 验证所有断点是否已注册 如果调试器连接失败,则停止并报告配置错误。
第 6 步:运行时观察
当执行暂停或运行时: 捕获:调用堆栈 变量状态 堆/闭包值(如果可用)
第 8 步:传回 LLM
传输结构化有效负载,其中包含: 工作区映射 断点列表 `launch.json` 执行时间线
第 9 步:迭代调试循环
如果根本原因不确定: 调整断点 重新启动调试会话 缩小范围 重复直到有证据解释失败
## Purpose
This document defines a **self-directed debugging workflow** for a Large Language Model (LLM) operating inside or alongside **Visual Studio Code: (VS Code:)**. The goal is for the LLM to:
1. Inspect a codebase without human intervention
2. Identify likely failure points
3. Insert breakpoints programmatically
4. Generate a valid VS Code: `launch.json` debugging configuration
5. Enter VS Code: debug mode
6. Capture runtime errors, logs, and stack traces
7. Filter noise while preserving full raw error telemetry
8. Transmit all collected diagnostic data back to the LLM for analysis
This workflow assumes the LLM has:
- Read access to the workspace
- Write access to configuration files
- The ability to invoke VS Code: commands (directly or via an agent/tooling layer)
---
## High-Level Debugging Strategy
The LLM must operate as a **deterministic debugger**, not a conversational assistant.
Core principles:
- Prefer evidence over speculation
- Favor runtime inspection over static guesses
- Never suppress errors at source
- Always preserve original error output
---
## Step 1: Workspace Reconnaissance
1. Enumerate the workspace root
2. Identify:
- Primary language(s)
- Entry points (e.g. `main.py`, `index.js`, `app.ts`, `Program.cs`)
- Existing test suites
- Existing `.vscode` configuration
3. Detect build systems and runtimes:
- Node.js, Python, Java, .NET, Go, etc.
Output a **workspace map** internally before proceeding.
---
## Step 2: Static Code Analysis
For each execution path:
1. Parse the AST (or equivalent)
2. Identify:
- Unhandled exceptions
- Unsafe casts
- Null/undefined dereferences
- Infinite loops
- Race conditions (async / threading)
- External I/O boundaries (filesystem, network, DB)
Mark all **high-risk lines**.
---
## Step 3: Breakpoint Placement Heuristics
Automatically insert breakpoints at:
- Program entry point
- All caught and uncaught exception blocks
- Function boundaries with:
- Complex conditionals
- State mutation
- External side effects
- Before and after async boundaries
- Any line referenced in stack traces from prior runs
### Breakpoint Rules
- Prefer conditional breakpoints when possible
- Avoid breakpoints inside tight loops unless gated
- Label each breakpoint with intent (comment or metadata)
---
## Step 4: Generate VS Code: Debug Configuration
Create or update:
```
.vscode/launch.json
```
### Requirements
- Use the correct debugger type for the detected runtime
- Ensure `stopOnEntry` is enabled
- Enable verbose logging
- Capture stdout and stderr
- Do NOT suppress framework-level warnings
### Example (Node.js)
```json
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "LLM Autonomous Debug",
"program": "${workspaceFolder}/index.js",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"stopOnEntry": true,
"outputCapture": "std",
"env": {
"NODE_ENV": "development"
}
}
]
}
```
Adapt as required for other languages.
---
## Step 5: Enter Debug Mode
1. Invoke VS Code: command:
- `Debug: Start Debugging`
2. Confirm debugger attachment
3. Verify all breakpoints are registered
If debugger fails to attach, halt and report configuration errors.
---
## Step 6: Runtime Observation
While execution is paused or running:
Capture:
- Call stacks
- Variable states
- Heap/closure values (where available)
- Thread or async task states
On error or crash, collect:
- Full stack trace
- Error type
- Error message
- Source location
- Runtime version
- OS and architecture
---
## Step 7: Error Telemetry Handling
### DO NOT discard information
The LLM must:
1. Capture **raw error output verbatim**
2. Separately derive:
- A cleaned summary
- A probable root cause
- A confidence score
### Noise Handling
- Framework warnings
- Deprecation notices
- Transitive dependency logs
These must be **tagged as low-signal**, not removed.
---
## Step 8: Transmission Back to the LLM
Transmit a structured payload containing:
- Workspace map
- Breakpoint list
- `launch.json`
- Execution timeline
- Raw stderr/stdout
- Stack traces
- Memory snapshots (if available)
### Suggested Format
```json
{
"environment": {},
"breakpoints": [],
"errors": [],
"rawLogs": "",
"analysisHints": []
}
```
---
## Step 9: Iterative Debugging Loop
If the root cause is not definitive:
1. Adjust breakpoints
2. Restart debug session
3. Narrow scope
4. Repeat until failure is explained by evidence
Never apply fixes without isolating the cause.
---
## Termination Criteria
Stop only when:
- The error is fully reproducible
- The root cause is identified
- The exact line(s) responsible are known
At that point, transition from **debugging mode** to **remediation mode**.
---
## Final Note
This document defines behavior, not intent.
The LLM must act as a debugger first, a theorist second, and a code generator last.
章节与文件索引
按说明文件中的顺序排列。
目的
高级调试策略
第 1 步:工作空间勘察
第2步:静态代码分析
第 3 步:断点放置启发法
文件/命令 -> launch.json · main.py · index.js · app.ts · Program.cs · .vscode · stopOnEntry · Debug: Start Debugging
内容校验值 -> 89ac5b55bd27
当前原文的自动摘译,尚未人工审校。
目的
本文档定义了在 Visual Studio Code 内部或与 Visual Studio Code 一起运行的大型语言模型 (LLM) 的自引导调试工作流程:(VS Code:)。 LLM 的目标是: 在无需人工干预的情况下检查代码库 识别可能的故障点 以编程方式插入断点 生成有效的 VS Code:
launch.json调试配置高级调试策略
法学硕士必须充当确定性调试器,而不是对话助理。核心原则: 优先考虑证据而不是猜测 优先考虑运行时检查而不是静态猜测 从不从源头抑制错误