debug
暂无简介
- License 许可
- MIT
- 最近更新
- 2026-11-08
- Stars
- ★ 3
- Forks
- 1
02 资源文件 2
- 参考文档references/cause-record.md518 B
- 参考文档references/loop-ladder.md826 B
03 SKILL.md 正文
Debugging to the root cause
A fix without a confirmed cause is a patch (D048). Every step ends on a check.
Triggers
- RU: «баг», «не работает», «почему падает», «CI красный»
- EN: "bug", "it's broken", "why does it fail", "CI is red"
0. Check the plug
Right branch, deployed version, environment, data, config. Read the module's failures (F) and
pitfalls in the knowledge base (bedrock kb backlinks <module>).
Done when: each is confirmed or the mismatch is the answer.
1. The report
Expected (from its source: spec or decision), actual, how to reproduce.
Done when: the three are written in ~/projects-days/<project>/<date>/<block>/debug.md.
2. A red loop before any theory
One command that goes red on this exact bug, picked from references/loop-ladder.md.
Tighten it: fast, sharp (it asserts the exact symptom), deterministic. A flaky bug first
raises its reproduction rate. bedrock log debug-start --block <id>.
No loop possible: stop, list what was tried, one ask to the owner.
Done when: the loop command is in debug.md and it fails for the right reason.
3. Reproduce exactly and minimise
This bug, not a nearby one; strip it until every element is load-bearing.
Done when: the minimal case is in debug.md.
4. Hypotheses
3–5 ranked, falsifiable: "if X, then changing Y turns the loop green". Earlier failed fixes
enter as hypotheses with what they showed. Send them to the owner as information, not a gate.
Done when: the list is in debug.md.
5. Experiments
One variable at a time: debugger or REPL first, then targeted logs tagged [DEBUG-<id>].
Never log everything and grep. Performance: a baseline, then bisect. The experiment log
records every hypothesis with its result (negative ones count) and every environment change.
bedrock log debug-loop --block <id> --detail "<hypothesis> → <result>".
Done when: one hypothesis is confirmed by the loop.
6. The cause record
Five lines in debug.md, shaped as in references/cause-record.md: symptom, seen (all n
occurrences, "explains k/n", and k<n is not yet the cause), rule broken, elsewhere, change.
bedrock log debug-cause --block <id> --ref <path of debug.md>.
Done when: the record explains n/n. An implementer brief points Cause: at it.
7. Regression test and fix
- The test sits at a correct seam and is red for the right reason; no seam is an architecture finding, not a reason for a shallow test.
- Fix in the shared place, for every caller; never change config or fixtures to go green.
- Done only when the original scenario no longer reproduces, the loop is green on all n
occurrences, and the full suite passes (
bedrock cmd test). Done when: all three hold.
8. Clean up
No [DEBUG- left (git grep -n '\[DEBUG-' is empty); harnesses kept in the block folder;
the commit states the confirmed cause. bedrock log debug-done --block <id>.
Done when: the grep is empty and the debug-done line exists.
9. Learn
A failure note (F) in the base with the kb skill; "Elsewhere" becomes backlog tasks; a
recurring pattern becomes a rule or a check.
Done when: the note exists and bedrock kb validate is clean.
Fuses
- Two failed fixes on one symptom: start this flow from step 0.
- The same command with the same error three times: stop and re-hypothesise.
- Hypotheses exhausted: a fresh view, the
escalationagent, or a fresh session with a handoff. The agent's brief comes fromtemplates/briefs/brief.md: the task, what was tried and why it failed go into Task and Known.
04 同仓库更多 Skills
writing
Write or rewrite skills, agent definitions, briefs and rule files by the D013 rules, then check them. Use for "напиши скилл", "поправь агента", "write a skill", "edit this brief".
triage
Bug triage — reproduce each report on the current version, group duplicates, set priority, decide fix, defer or decline. Use for "разбери баги", "что с репортами QA", "triage", "new bug reports".
start
Start a project with bedrock — a new one by interview, or an existing one by onboarding; writes the base, AGENTS.md, workspace settings and verified commands. Use for "новый проект", "подключи проект", "start a project".
review
Review gate for a finished block — deterministic checks, code review, plan-compliance review, silent fixes, rounds until clean. Use for "проверь", "ревью", "review this", before any PR.
retro
Weekly retro — read the week's logs, agents, reviews and failures, find what repeats, tune the system, plan a realistic next week. Use for "ретро", "итоги недели", "retro", "how did the week go".
night
Autonomous work until morning — a pre-sleep check, the allowed list, auto-continue with fuses, a watchdog, a morning report. Use for "автономно до утра", "поработай ночью", "work overnight".