@dsmm/dsmm 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +103 -0
- package/README.md +70 -2
- package/agent-presets/dsmm-builder/agent.cordis.yml +210 -0
- package/agent-presets/dsmm-builder/preset.yml +3 -0
- package/agent-presets/dsmm-clarifier/agent.cordis.yml +34 -0
- package/agent-presets/dsmm-clarifier/preset.yml +3 -0
- package/agent-presets/dsmm-code-search/agent.cordis.yml +34 -0
- package/agent-presets/dsmm-code-search/preset.yml +3 -0
- package/agent-presets/dsmm-creative/agent.cordis.yml +31 -0
- package/agent-presets/dsmm-creative/preset.yml +3 -0
- package/agent-presets/dsmm-doc-search/agent.cordis.yml +34 -0
- package/agent-presets/dsmm-doc-search/preset.yml +3 -0
- package/agent-presets/dsmm-media-reader/agent.cordis.yml +34 -0
- package/agent-presets/dsmm-media-reader/preset.yml +3 -0
- package/agent-presets/dsmm-oracle/agent.cordis.yml +31 -0
- package/agent-presets/dsmm-oracle/preset.yml +3 -0
- package/agent-presets/dsmm-oracle-2nd/agent.cordis.yml +31 -0
- package/agent-presets/dsmm-oracle-2nd/preset.yml +3 -0
- package/agent-presets/dsmm-orchestrator/agent.cordis.yml +215 -0
- package/agent-presets/dsmm-orchestrator/preset.yml +3 -0
- package/agent-presets/dsmm-plan-critic/agent.cordis.yml +33 -0
- package/agent-presets/dsmm-plan-critic/preset.yml +3 -0
- package/agent-presets/dsmm-planner/agent.cordis.yml +33 -0
- package/agent-presets/dsmm-planner/preset.yml +3 -0
- package/agent-presets/dsmm-reviewer/agent.cordis.yml +33 -0
- package/agent-presets/dsmm-reviewer/preset.yml +3 -0
- package/cordis.patch.yml +8 -0
- package/docs/agent-presets.md +19 -0
- package/docs/compatibility.md +49 -0
- package/docs/design.md +237 -0
- package/docs/lsp.md +40 -0
- package/docs/migration-from-ocmm.md +54 -0
- package/docs/model-routing.md +61 -0
- package/docs/releasing.md +52 -0
- package/docs/research/deepseek-v4-pro.md +74 -0
- package/docs/research/oh-dsh.md +96 -0
- package/docs/roadmap.md +207 -0
- package/docs/runtime-recovery.md +75 -0
- package/docs/safety-guards.md +55 -0
- package/docs/settings-status.md +55 -0
- package/docs/skill-sync.md +20 -0
- package/lib/commands.d.ts +13 -0
- package/lib/commands.js +55 -0
- package/lib/dsh-events.d.ts +21 -0
- package/lib/dsh-events.js +2 -0
- package/lib/dsh-types.d.ts +312 -0
- package/lib/dsh-types.js +2 -0
- package/lib/guards.d.ts +10 -0
- package/lib/guards.js +252 -0
- package/lib/index.d.ts +33 -0
- package/lib/index.js +58 -0
- package/lib/lsp.d.ts +30 -0
- package/lib/lsp.js +154 -0
- package/lib/mode.d.ts +6 -0
- package/lib/mode.js +62 -0
- package/lib/model-family.d.ts +6 -0
- package/lib/model-family.js +49 -0
- package/lib/model-routing.d.ts +11 -0
- package/lib/model-routing.js +128 -0
- package/lib/plan-validation.d.ts +3 -0
- package/lib/plan-validation.js +119 -0
- package/lib/preset-materializer.d.ts +36 -0
- package/lib/preset-materializer.js +258 -0
- package/lib/preset-registry.d.ts +5 -0
- package/lib/preset-registry.js +126 -0
- package/lib/preset-skills.d.ts +12 -0
- package/lib/preset-skills.js +28 -0
- package/lib/prompts.d.ts +13 -0
- package/lib/prompts.js +82 -0
- package/lib/recovery-policy.d.ts +25 -0
- package/lib/recovery-policy.js +252 -0
- package/lib/role-providers.d.ts +13 -0
- package/lib/role-providers.js +61 -0
- package/lib/role-routing.d.ts +15 -0
- package/lib/role-routing.js +144 -0
- package/lib/role-subagents.d.ts +6 -0
- package/lib/role-subagents.js +54 -0
- package/lib/roles.d.ts +29 -0
- package/lib/roles.js +241 -0
- package/lib/runtime-recovery.d.ts +5 -0
- package/lib/runtime-recovery.js +168 -0
- package/lib/session-scope.d.ts +9 -0
- package/lib/session-scope.js +40 -0
- package/lib/settings.d.ts +123 -0
- package/lib/settings.js +447 -0
- package/lib/shell-command.d.ts +18 -0
- package/lib/shell-command.js +492 -0
- package/lib/skills.d.ts +18 -0
- package/lib/skills.js +64 -0
- package/lib/state.d.ts +13 -0
- package/lib/state.js +64 -0
- package/lib/status.d.ts +55 -0
- package/lib/status.js +193 -0
- package/package.json +129 -4
- package/patches/agent-presets-root.example.cordis.patch.yml +14 -0
- package/patches/ocmm-lsp-mcp.example.cordis.patch.yml +15 -0
- package/prompts/deepseek-flash.md +11 -0
- package/prompts/deepseek-v4-pro.md +14 -0
- package/prompts/deepwork.md +32 -0
- package/skills/brainstorming/SKILL.md +15 -0
- package/skills/debugging/SKILL.md +12 -0
- package/skills/debugging/references/logging.md +91 -0
- package/skills/debugging/references/methodology/00-setup.md +108 -0
- package/skills/debugging/references/methodology/02-investigate.md +67 -0
- package/skills/debugging/references/methodology/03-flaky-triage.md +69 -0
- package/skills/debugging/references/methodology/04-hard-reasoning-escalation.md +83 -0
- package/skills/debugging/references/methodology/05-escalate.md +69 -0
- package/skills/debugging/references/methodology/06-fix.md +123 -0
- package/skills/debugging/references/methodology/08-qa.md +94 -0
- package/skills/debugging/references/methodology/09-cleanup.md +164 -0
- package/skills/debugging/references/methodology/partial-runtime-evidence.md +217 -0
- package/skills/debugging/references/runtimes/bundled-js-binary.md +415 -0
- package/skills/debugging/references/runtimes/go.md +252 -0
- package/skills/debugging/references/runtimes/native-binary.md +484 -0
- package/skills/debugging/references/runtimes/node.md +260 -0
- package/skills/debugging/references/runtimes/python.md +248 -0
- package/skills/debugging/references/runtimes/rust.md +234 -0
- package/skills/debugging/references/scripts/dap.mjs +533 -0
- package/skills/debugging/references/tools/dap.md +89 -0
- package/skills/debugging/references/tools/ghidra.md +212 -0
- package/skills/debugging/references/tools/playwright-cli.md +316 -0
- package/skills/debugging/references/tools/pwndbg.md +263 -0
- package/skills/debugging/references/tools/pwntools.md +265 -0
- package/skills/dispatching-parallel-agents/SKILL.md +14 -0
- package/skills/receiving-code-review/SKILL.md +13 -0
- package/skills/remove-ai-slops/SKILL.md +14 -0
- package/skills/requesting-code-review/SKILL.md +10 -0
- package/skills/subagent-driven-development/SKILL.md +13 -0
- package/skills/writing-plans/SKILL.md +14 -0
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Phase 0 + 1 — Environment Assessment & Journal Setup
|
|
2
|
+
|
|
3
|
+
Before a debugger touches anything, you need a map of what's running and a ledger of what you'll touch. Skipping either phase is how debug sessions turn into "why is my repo dirty a week later" sessions.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Phase 0 — Environment Assessment
|
|
8
|
+
|
|
9
|
+
Map the ground truth before you attach. Attaching the wrong way wastes the first hour.
|
|
10
|
+
|
|
11
|
+
### 1. Identify the runtime
|
|
12
|
+
|
|
13
|
+
Read the actual manifest file, don't guess from extensions:
|
|
14
|
+
|
|
15
|
+
- Python → `pyproject.toml`, `requirements*.txt`, `setup.py`, `uv.lock`, `.python-version`
|
|
16
|
+
- Node → `package.json` (check `scripts`, check `engines`, check `type: module`)
|
|
17
|
+
- Rust → `Cargo.toml`, `rust-toolchain*`
|
|
18
|
+
- Go → `go.mod`, `go.sum`
|
|
19
|
+
- Native / mixed → `Makefile`, `CMakeLists.txt`, the binary itself (`file <path>`)
|
|
20
|
+
|
|
21
|
+
### 2. Load the matching runtime reference
|
|
22
|
+
|
|
23
|
+
The moment you know the runtime, open `references/runtimes/<runtime>.md`. The commands in this phase (and every phase after) are runtime-specific. The shape of the answers is the same; the commands are not.
|
|
24
|
+
|
|
25
|
+
### 3. Gather observable environment state
|
|
26
|
+
|
|
27
|
+
The shape of the answers you need (commands in the runtime reference):
|
|
28
|
+
|
|
29
|
+
| Question | Why it matters |
|
|
30
|
+
|---|---|
|
|
31
|
+
| What binary/interpreter/runtime actually launches the process? | Determines debugger flag plumbing. Wrappers (`tsx`, `poetry run`, `cargo run`, `bun`, supervisor scripts) change how flags propagate. |
|
|
32
|
+
| Is there already a debug-relevant port in use, or another instance of the service running? | Either attach to it or kill it deliberately — never silently compete. |
|
|
33
|
+
| Are symbols / source maps / debug info present and correct? | This determines whether breakpoints land on the right lines. Compiled-but-not-debug builds, stripped binaries, and incomplete source maps all silently misplace breakpoints. |
|
|
34
|
+
| Does the code path require env vars, config files, or auth tokens to reach the bug? | Missing env often produces early-return paths that masquerade as the bug itself. |
|
|
35
|
+
| Is there an existing failing test or known repro? | Prefer amplifying an existing repro over inventing one. |
|
|
36
|
+
| Are watchers (file watchers, hot reloaders, supervisors) going to restart the process mid-session? | If yes, turn them off before attaching. Restarts drop inspector connections and invalidate breakpoints. |
|
|
37
|
+
|
|
38
|
+
### 4. Gate check
|
|
39
|
+
|
|
40
|
+
If any answer is "I'm not sure", you are not ready for Phase 1. Investigate until certain. Guessing here cascades into false-positive hypotheses in Phase 2.
|
|
41
|
+
|
|
42
|
+
---
|
|
43
|
+
|
|
44
|
+
## Phase 1 — Journal Setup
|
|
45
|
+
|
|
46
|
+
Open **one** journal file at the project root: `.debug-journal.md`. Single source of truth for every artifact this skill creates. The contract with the user that you can undo everything.
|
|
47
|
+
|
|
48
|
+
### Exclude from git (don't pollute the committed ignore list)
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
grep -qx '.debug-journal.md' .git/info/exclude || echo '.debug-journal.md' >> .git/info/exclude
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
`.git/info/exclude` is per-clone and not committed — perfect for local-session artifacts.
|
|
55
|
+
|
|
56
|
+
### Journal template
|
|
57
|
+
|
|
58
|
+
```markdown
|
|
59
|
+
# Debug Journal — <short bug name>
|
|
60
|
+
Started: <ISO timestamp>
|
|
61
|
+
Goal: <one-sentence user request>
|
|
62
|
+
|
|
63
|
+
## Environment snapshot (Phase 0)
|
|
64
|
+
- Runtime: <language + version + launcher>
|
|
65
|
+
- Entry: <command that starts the process>
|
|
66
|
+
- Ports / sockets: <app=..., debugger=..., etc>
|
|
67
|
+
- Git HEAD: <sha>, working tree clean? <yes/no>
|
|
68
|
+
- References read: <list the files from references/ you loaded — proves you did the gate>
|
|
69
|
+
|
|
70
|
+
## Hypotheses
|
|
71
|
+
1. [STATUS] <hypothesis> — distinguishing evidence: <what would confirm/refute> — if true, fix is: <two words>
|
|
72
|
+
2. ...
|
|
73
|
+
|
|
74
|
+
## Failed hypothesis round counter
|
|
75
|
+
- Round 1: <result>
|
|
76
|
+
- Round 2: <result>
|
|
77
|
+
<!-- At 2 consecutive evidence-backed failures, the task qualifies for one hard-reasoning escalation (see 04-hard-reasoning-escalation.md). -->
|
|
78
|
+
|
|
79
|
+
## Artifacts to revert
|
|
80
|
+
<!-- Every temp edit, tmux session, fixture, env override, saved debugger session goes here
|
|
81
|
+
BEFORE it is created. The rule is journal-then-modify. -->
|
|
82
|
+
- [ ] `src/foo.py` — added `breakpoint()` on 2 lines. Revert: `git checkout src/foo.py`
|
|
83
|
+
- [ ] tmux session `debug-server`. Kill: `tmux kill-session -t debug-server`
|
|
84
|
+
- [ ] `/tmp/debug-payload.json`. Remove: `rm /tmp/debug-payload.json`
|
|
85
|
+
- [ ] env var in current shell: `FOO_BASE_URL=...`. Unset when done.
|
|
86
|
+
- [ ] GDB session save: `~/ghidra-projects/scratch.gzf`. Remove if not promoting.
|
|
87
|
+
|
|
88
|
+
## Findings
|
|
89
|
+
<!-- Append observed values here with timestamp. Verbatim only, no paraphrasing. -->
|
|
90
|
+
|
|
91
|
+
## Hard-Reasoning Escalation (if invoked)
|
|
92
|
+
<!-- Record why the difficulty threshold was met and the resulting hypothesis set. -->
|
|
93
|
+
|
|
94
|
+
## Final fix
|
|
95
|
+
<!-- File paths + test path. Filled during Phase 7. -->
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### The journal-then-modify rule
|
|
99
|
+
|
|
100
|
+
Before any modification to the repo, shell, or system state, append to "Artifacts to revert" first. This one discipline is what prevents debug sessions from becoming git cleanup sessions.
|
|
101
|
+
|
|
102
|
+
If you catch yourself about to run a command that creates a file, opens a port, or modifies source — stop, journal the intended artifact with its revert command, then run the command. Not the other way around.
|
|
103
|
+
|
|
104
|
+
### Why a single journal (not scattered TODO comments)
|
|
105
|
+
|
|
106
|
+
- One `git checkout`, one `rm`, one `tmux kill-session` list — simple Phase 9 walk.
|
|
107
|
+
- Survives interruptions. If you get pulled away mid-session, the next agent (or you later) can continue or revert without guessing.
|
|
108
|
+
- Prevents the most common failure: leaving `console.log`/`print()`/`dbg!` scattered across the tree.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# Phase 2 + 3 — Hypothesis Formation & Parallel Investigation
|
|
2
|
+
|
|
3
|
+
One hypothesis is a hunch. Three hypotheses is a decision. Investigation is how you turn the decision into runtime evidence.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Phase 2 — Hypothesis Formation (Minimum Three)
|
|
8
|
+
|
|
9
|
+
### Why three, not one
|
|
10
|
+
|
|
11
|
+
A single hypothesis creates confirmation bias: you'll read runtime state looking for evidence that confirms it and unconsciously discount contradictions. Three hypotheses force you to design queries that *distinguish* between them, which is the only way runtime evidence becomes decisive.
|
|
12
|
+
|
|
13
|
+
### Generate across orthogonal axes
|
|
14
|
+
|
|
15
|
+
If your three hypotheses are all variations of "the handler has a bug", you don't actually have three hypotheses. Span the space:
|
|
16
|
+
|
|
17
|
+
| Axis | Example framing |
|
|
18
|
+
|---|---|
|
|
19
|
+
| **User-code logic** | "The handler early-returns because condition X is unexpectedly true" |
|
|
20
|
+
| **Library/SDK behavior** | "The third-party client swallows the error and returns a stub" |
|
|
21
|
+
| **Environment/config** | "The env var is read at module-load time before it gets populated, so it's empty" |
|
|
22
|
+
| **Async/timing** | "The promise rejects (or goroutine panics) after the response is already sent" |
|
|
23
|
+
| **Silent side-effect** | "An earlier turn mutated shared state that the current turn inherits" |
|
|
24
|
+
| **Observability gap** | "The error is raised but suppressed before logging; it only exists as an unawaited rejection / ignored signal" |
|
|
25
|
+
| **Binary-level** (when applicable) | "The function we think is running is actually jumped over by a patched thunk / a different version loaded" |
|
|
26
|
+
| **Build-vs-runtime** | "The code we're reading is not the code that's running — stale build, wrong symlink, cached wheel, or dist/ ahead of src/" |
|
|
27
|
+
|
|
28
|
+
### For each hypothesis, write in the journal
|
|
29
|
+
|
|
30
|
+
1. **Claim** — one sentence.
|
|
31
|
+
2. **Distinguishing evidence** — the exact value or state that confirms or refutes it, AND where to read it (file:line, log source, breakpoint location, memory address).
|
|
32
|
+
3. **If true, the fix is** — two words. Forces you to think through fix cost before committing to the hunt.
|
|
33
|
+
|
|
34
|
+
### Collapse rule
|
|
35
|
+
|
|
36
|
+
If two hypotheses have identical distinguishing evidence, they aren't actually different — collapse them and find a real alternative. If you can't come up with a third distinct hypothesis, you don't understand the system well enough yet. Go read a little more code before investigating.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## Phase 3 — Investigate Distinct Evidence
|
|
41
|
+
|
|
42
|
+
Use available DSH role-specific tools only when parallel evidence collection is genuinely independent and within current permission and depth limits. Otherwise investigate sequentially. Assign one hypothesis and its falsifying observation per investigation. Never assume OpenCode team APIs or an automatically writable agent.
|
|
43
|
+
|
|
44
|
+
## Evidence capture discipline (both paths)
|
|
45
|
+
|
|
46
|
+
For every piece of runtime state captured, record in the journal:
|
|
47
|
+
|
|
48
|
+
```markdown
|
|
49
|
+
### <ISO timestamp> — <what you looked at>
|
|
50
|
+
- Source: <file:line | log source | curl command | breakpoint address>
|
|
51
|
+
- Value: `<verbatim>`
|
|
52
|
+
- Interpretation: <one line — why this matters>
|
|
53
|
+
- Refutes/Confirms: H<n>
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Verbatim values only. No paraphrasing.**
|
|
57
|
+
|
|
58
|
+
- `messages.length=0` is evidence.
|
|
59
|
+
- "messages seemed empty" is not evidence — it's a memory of an observation, and memory of observations is where debug sessions go to die.
|
|
60
|
+
|
|
61
|
+
If you find yourself about to paraphrase, stop, go back, and copy the raw value.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Round completion
|
|
66
|
+
|
|
67
|
+
A "round" is complete when every hypothesis has either confirming or refuting evidence — or when you have exhausted the evidence sources available without a decisive result. If the round ends inconclusively, that counts as a failed round for the counter in the journal. See `04-hard-reasoning-escalation.md` for what to do at 2 consecutive failed rounds.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Flaky-test triage
|
|
2
|
+
|
|
3
|
+
Use this reference when a test is intermittent, passes in isolation, changes its failing neighbor, depends on execution order, or fails only in CI. Treat the symptom as shared-state evidence until a controlled experiment proves otherwise.
|
|
4
|
+
|
|
5
|
+
## Safety boundary
|
|
6
|
+
|
|
7
|
+
- Start with an unchanged rerun. Do not install tools, terminate another user's process, overwrite user configuration, or use a shared temp root.
|
|
8
|
+
- Journal every command, run-owned artifact, and cleanup action. Clean only artifacts that this run owns.
|
|
9
|
+
- Retry wrappers, arbitrary sleeps, quarantine, deletion, and assertion weakening are not fixes. They hide evidence and must not be used to claim resolution.
|
|
10
|
+
- Keep test commands and environment changes scoped to the affected test or suite. Do not turn a flaky-test investigation into a full-suite mutation.
|
|
11
|
+
|
|
12
|
+
## Three-run signature
|
|
13
|
+
|
|
14
|
+
Before forming root-cause hypotheses, record the command, exit code, failing test, duration, seed, worker count, temp root, environment differences, and the first causal error rather than a later cascade. A missing field is evidence to collect, not a reason to fill it in from memory.
|
|
15
|
+
|
|
16
|
+
1. **Unchanged rerun** — run the original command without retries, new sleeps, altered worker counts, or other changes. Record whether the same failure recurs and preserve the first causal error.
|
|
17
|
+
2. **Isolated case** — run the exact failing test alone with the same relevant seed, workers, environment, and run-owned temp root where possible. Passing in isolation is a classification clue, not a green result.
|
|
18
|
+
3. **Quiet affected scope** — run the smallest affected file, package, or suite in a unique root with unrelated watchers and concurrent local work excluded. Compare its command, duration, worker count, and environment to the failure.
|
|
19
|
+
|
|
20
|
+
If order dependence is plausible, use an optional **Seeded shuffle** only after the three runs. Record its seed, then rerun the same seed first; do not keep sampling fresh seeds until one produces the desired result.
|
|
21
|
+
|
|
22
|
+
| Classification | Controlled toggle or evidence to seek |
|
|
23
|
+
|---|---|
|
|
24
|
+
| Product race or async timing | Hold scheduling and resource ownership steady; verify that awaited completion, timers, or teardown change the outcome. |
|
|
25
|
+
| Order or fixture leakage | Run the predecessor and target together, reverse or reset their shared fixture, then compare against the isolated target. |
|
|
26
|
+
| Environment contention | Namespace the temp root, port, database, cache, container, or lock and compare the run-owned environment. |
|
|
27
|
+
| Resource-limit pressure | Record workers, durations, memory or file-handle signals, and constrained versus unconstrained affected-scope behavior. |
|
|
28
|
+
|
|
29
|
+
Keep multiple hypotheses open until a controlled toggle distinguishes them. An unreproduced failure is unresolved evidence, not fixed.
|
|
30
|
+
|
|
31
|
+
## Paired isolation examples
|
|
32
|
+
|
|
33
|
+
Use the example for the active shell. These are paired alternatives, not instructions to switch shells.
|
|
34
|
+
|
|
35
|
+
**Bash — unique run root and optional listener inspection**
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
run_root="$(mktemp -d "${TMPDIR:-/tmp}/ocmm-flaky.XXXXXX")"
|
|
39
|
+
TEST_TMPDIR="$run_root" pnpm test -- --test-name-pattern "affected test"
|
|
40
|
+
|
|
41
|
+
# Inspect only when ss is already installed; do not install an inspector.
|
|
42
|
+
if command -v ss >/dev/null 2>&1; then
|
|
43
|
+
ss -ltnp
|
|
44
|
+
fi
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**PowerShell — unique run root and optional listener inspection**
|
|
48
|
+
|
|
49
|
+
```powershell
|
|
50
|
+
$runRoot = Join-Path "$env:LOCALAPPDATA\Temp\dsmm-debug" "flaky-$([guid]::NewGuid().ToString('N'))"
|
|
51
|
+
New-Item -ItemType Directory -Path $runRoot | Out-Null
|
|
52
|
+
$env:TEST_TMPDIR = $runRoot
|
|
53
|
+
pnpm test -- --test-name-pattern "affected test"
|
|
54
|
+
|
|
55
|
+
Get-NetTCPConnection -LocalPort 3000
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
Do not install a port inspector and never kill a port owner. If a listener is relevant, record it and namespace the port for the run instead. Journal cleanup and remove only the unique root created by the current investigation.
|
|
59
|
+
|
|
60
|
+
## Cause-oriented repair
|
|
61
|
+
|
|
62
|
+
- Namespace run-owned temp roots, ports, databases, containers, caches, and locks so concurrent tests cannot collide.
|
|
63
|
+
- Restore globals and fake clocks during teardown. Await and close only resources created by the current run.
|
|
64
|
+
- Use per-test fixtures or explicit reset boundaries instead of relying on suite order or process lifetime.
|
|
65
|
+
- Add a failing-first deterministic regression that exercises the confirmed causal sequence, then make the minimal cause-oriented repair.
|
|
66
|
+
|
|
67
|
+
After two failed evidence rounds, the local workflow permits one `hard-reasoning` escalation only when the root cause is genuinely difficult. Reviewer and Oracle profiles are not debugging agents and must not be used for this triage.
|
|
68
|
+
|
|
69
|
+
If the evidence remains unresolved, return a classification receipt: the three-run signature, observed shared-state checks, remaining hypotheses, controlled toggles attempted, run-owned artifacts cleaned, and the explicit statement that no fix is claimed.
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
# Phase 4 — Hard-Reasoning Escalation
|
|
2
|
+
|
|
3
|
+
At 2 consecutive failed hypothesis rounds, stop investigating and reframe. Two evidence-backed failures establish that this is a genuinely difficult debugging problem; only at this threshold may `hard-reasoning` be used. Ordinary and first-attempt debugging must stay with direct runtime investigation, `code-search`, or `research`.
|
|
4
|
+
|
|
5
|
+
Reviewer and Oracle profiles are not debugging consultants. They are reserved for implementation acceptance and focused code-quality verification.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## When to invoke
|
|
10
|
+
|
|
11
|
+
| Situation | Invoke? |
|
|
12
|
+
|---|---|
|
|
13
|
+
| 1 round failed, you have new distinguishing evidence | No — run one more round with a refined hypothesis set |
|
|
14
|
+
| 2 rounds failed, hypotheses now feel like variations of each other | **Yes — invoke one hard-reasoning consultation** |
|
|
15
|
+
| 2 rounds failed, no new evidence angles left to try | **Yes — invoke one hard-reasoning consultation** |
|
|
16
|
+
| You've been investigating >2 hours with multiple evidence-backed failures | **Yes — invoke one hard-reasoning consultation** |
|
|
17
|
+
| 1 round failed but the user is watching and wants speed | No — the task has not crossed the difficulty threshold |
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## One bounded consultation with orthogonal framings
|
|
22
|
+
|
|
23
|
+
Use one `hard-reasoning` agent to examine three distinct bug-cause categories:
|
|
24
|
+
|
|
25
|
+
- **A (obvious-but-missed)** — embarrassingly simple causes the investigator walked past.
|
|
26
|
+
- **B (system-boundary)** — causes living at integration seams, not in the code being read.
|
|
27
|
+
- **C (invariant-violation)** — assumptions load-bearing to current hypotheses that may themselves be false.
|
|
28
|
+
|
|
29
|
+
Do not fan out multiple decision agents. Add `code-search` or `research` only when a named evidence gap requires a bounded lookup.
|
|
30
|
+
|
|
31
|
+
---
|
|
32
|
+
|
|
33
|
+
## Prompt
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
task(description="Reframe root-cause investigation", subagent_type="hard-reasoning",
|
|
37
|
+
prompt="""
|
|
38
|
+
GOAL: Reframe this genuinely difficult root-cause investigation after two failed evidence rounds.
|
|
39
|
+
STOP WHEN: You provide one ranked next hypothesis set and decisive runtime queries; do not propose a fix without confirming evidence.
|
|
40
|
+
EVIDENCE: <bug description, failed hypotheses, and verbatim observations with file:line/log references>
|
|
41
|
+
|
|
42
|
+
Analyze all three frames separately:
|
|
43
|
+
A. OBVIOUS-BUT-MISSED — wrong process/file/build, stale cache, typo, off-by-one, or harness mismatch.
|
|
44
|
+
B. SYSTEM-BOUNDARY — SDK, middleware, transport, ABI, version, load-order, or build/runtime configuration contract.
|
|
45
|
+
C. INVARIANT-VIOLATION — load-bearing assumptions that may be false.
|
|
46
|
+
|
|
47
|
+
Return: three ranked candidate causes, the frame supporting each, and the smallest runtime query that confirms or refutes each. This is decision support only; do not edit files or dispatch other agents.
|
|
48
|
+
""")
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Synthesize into the next evidence round
|
|
54
|
+
|
|
55
|
+
Treat the response as hypotheses, not proof. Pull the ranked candidates and falsification queries into a new hypothesis set, then resolve them with runtime evidence.
|
|
56
|
+
|
|
57
|
+
Minimum 3, same rules as Phase 2. Aim to have hypotheses drawn from the agreement scan (likely cause) AND from the disagreement scan (so one round's evidence resolves the disagreement).
|
|
58
|
+
|
|
59
|
+
Record in the journal:
|
|
60
|
+
|
|
61
|
+
```markdown
|
|
62
|
+
## Hard-Reasoning Escalation — Round <N>
|
|
63
|
+
- Invoked at: <ISO timestamp>
|
|
64
|
+
- Reason escalation was permitted: <two failed evidence rounds or equivalent strict difficulty evidence>
|
|
65
|
+
- Ranked candidates: <one line each>
|
|
66
|
+
- Decisive runtime queries: <one line each>
|
|
67
|
+
|
|
68
|
+
### New hypothesis set
|
|
69
|
+
1. <hypothesis> — evidence to gather: <one-liner>
|
|
70
|
+
2. ...
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Reset the counter
|
|
74
|
+
|
|
75
|
+
Reset the "consecutive failed rounds" counter to 0. Return to Phase 3 (parallel investigation) with the new set.
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## If another 2 rounds fail after escalation
|
|
80
|
+
|
|
81
|
+
You are genuinely stuck. This is the escalation threshold.
|
|
82
|
+
|
|
83
|
+
Escalate to the user (see `05-escalate.md`) with the full trace: every hypothesis tried, every piece of evidence captured, and the hard-reasoning reframing. Do not guess a fix.
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# Phase 5 — User Decision Escalation
|
|
2
|
+
|
|
3
|
+
Escalation is for genuine ambiguity, not for skipping investigation. Most "should I ask the user" moments are really "I don't want to do one more query" moments, and those are wrong.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Ask the user ONLY when
|
|
8
|
+
|
|
9
|
+
- **Evidence exhausted**, contradictions remain, and further investigation would require a decision with policy implications (e.g. "patch the third-party SDK vs wrap it vs change architecture").
|
|
10
|
+
- The bug has **multiple valid fixes with different scope/risk tradeoffs** and the user's preference drives the choice.
|
|
11
|
+
- A proposed fix would **change observable product behavior** for the end user (not just fix the internal bug).
|
|
12
|
+
- You've used the bounded hard-reasoning escalation and another 2 evidence rounds failed.
|
|
13
|
+
|
|
14
|
+
## Do NOT ask when
|
|
15
|
+
|
|
16
|
+
- The task met the strict difficulty threshold but you have not used the bounded hard-reasoning escalation yet.
|
|
17
|
+
- The question can be answered by one more runtime query.
|
|
18
|
+
- You're asking for permission to do the obvious thing.
|
|
19
|
+
- You're asking because you're tired.
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
## Escalation format (paste into the reply)
|
|
24
|
+
|
|
25
|
+
Keep it short. Evidence-dense. One decision, not a status update.
|
|
26
|
+
|
|
27
|
+
```markdown
|
|
28
|
+
## Decision needed
|
|
29
|
+
|
|
30
|
+
**What we know** (verbatim evidence, not paraphrase):
|
|
31
|
+
- <fact 1 with file:line or address>
|
|
32
|
+
- <fact 2 with source>
|
|
33
|
+
- <what the evidence rules IN>
|
|
34
|
+
- <what the evidence rules OUT>
|
|
35
|
+
|
|
36
|
+
**What the decision is** (one sentence):
|
|
37
|
+
<the fork in the road>
|
|
38
|
+
|
|
39
|
+
**Options**:
|
|
40
|
+
|
|
41
|
+
| # | Fix | Scope | Risk | Effort |
|
|
42
|
+
|---|-----|-------|------|--------|
|
|
43
|
+
| A | <short label> | <files touched / layers> | <regressions possible> | <rough> |
|
|
44
|
+
| B | ... | ... | ... | ... |
|
|
45
|
+
| C | ... | ... | ... | ... |
|
|
46
|
+
|
|
47
|
+
**Recommendation**: <A/B/C> because <one-sentence reason>.
|
|
48
|
+
|
|
49
|
+
Which direction do you want?
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Anti-patterns in escalation
|
|
55
|
+
|
|
56
|
+
- **Asking without evidence.** "What do you want me to do?" is not an escalation, it's abandonment. Every escalation includes the evidence the user needs to decide.
|
|
57
|
+
- **Two questions in one.** One decision per escalation. Multi-part questions lead to partial answers and re-escalation.
|
|
58
|
+
- **Escalating before Phase 4.** If the task met the strict difficulty threshold, use the bounded hard-reasoning escalation before asking the user to choose.
|
|
59
|
+
- **Presenting options you don't actually have.** If option C requires a library the user doesn't use, don't list it. The options are only things you can actually do today.
|
|
60
|
+
- **Hiding a recommendation.** The user hired you to think — always end with a recommendation, even if you're low-confidence. Say so explicitly: "Recommendation (low confidence): B, because X. If you have context about Y that I don't, it might change to A."
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## What happens after the user responds
|
|
65
|
+
|
|
66
|
+
- **User picks an option**: return to Phase 6 (root cause confirmation) with the chosen direction. The user's choice is not itself confirmation — you still need runtime evidence that the cause you're fixing is the cause in play.
|
|
67
|
+
- **User proposes a different option you hadn't considered**: treat it as new information. Update hypotheses. May trigger another Phase 3 round.
|
|
68
|
+
- **User gives more context that resolves the disagreement**: skip to Phase 6.
|
|
69
|
+
- **User is also unsure**: that's a signal you need more evidence, not more opinions. Run one more targeted query before asking again.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Phase 6 + 7 — Root Cause Confirmation & Reproduction-Locked Fix
|
|
2
|
+
|
|
3
|
+
A cause is not "confirmed" until you can toggle the bug by toggling the cause. Every other level of evidence is correlation, and correlation-driven fixes ship bugs.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Phase 6 — Root Cause Confirmation
|
|
8
|
+
|
|
9
|
+
You are allowed to call the cause "confirmed" only when ALL THREE of these hold:
|
|
10
|
+
|
|
11
|
+
### 1. Captured runtime value matches the hypothesis exactly
|
|
12
|
+
|
|
13
|
+
Not "the value looks consistent with" — the value is exactly the value the hypothesis predicted. If your hypothesis was "baseUrl is api.anthropic.com despite ANTHROPIC_BASE_URL being set to a proxy", the captured value is literally `"https://api.anthropic.com"` in the debugger at the moment of the HTTP call.
|
|
14
|
+
|
|
15
|
+
### 2. Reproducible
|
|
16
|
+
|
|
17
|
+
Running the repro a second time yields the same observation. Flaky repros mean you haven't isolated the cause; you've isolated a symptom that sometimes appears when the cause does. Keep investigating.
|
|
18
|
+
|
|
19
|
+
### 3. Toggle proof (the one most skipped)
|
|
20
|
+
|
|
21
|
+
**Changing the value** (via debugger assignment, env override, or a speculative one-line patch) **makes the bug disappear — and reverting brings the bug back**.
|
|
22
|
+
|
|
23
|
+
If you can't toggle the bug by toggling the suspected cause, what you have is a correlation, not a mechanism. A correlation is a strong hypothesis, not a confirmed cause.
|
|
24
|
+
|
|
25
|
+
Examples of a valid toggle proof:
|
|
26
|
+
|
|
27
|
+
| Suspected cause | Toggle |
|
|
28
|
+
|---|---|
|
|
29
|
+
| Env var overrides library default, and the override is wrong | Unset the env var → bug goes away. Reset it → bug comes back. |
|
|
30
|
+
| Async task is not awaited | Add `await` → bug goes away. Remove `await` → bug comes back. |
|
|
31
|
+
| Third-party SDK uses hardcoded URL | Monkey-patch SDK to use env URL → bug goes away. Unpatch → bug comes back. |
|
|
32
|
+
| Race condition on shared state | Add a mutex → bug goes away under load. Remove mutex → bug comes back under load. |
|
|
33
|
+
|
|
34
|
+
If you can't construct a toggle proof, you haven't confirmed the cause. Run one more round.
|
|
35
|
+
|
|
36
|
+
### Update the journal
|
|
37
|
+
|
|
38
|
+
```markdown
|
|
39
|
+
## Root cause (confirmed <ISO timestamp>)
|
|
40
|
+
- Mechanism: <one paragraph, causal not correlational — the chain from cause to observable symptom>
|
|
41
|
+
- Evidence: <file:line of captured value | path to saved repro | address + register state>
|
|
42
|
+
- Toggle proof: "With <change X>, repro produces <good>. Reverting <change X>, repro produces <bad>."
|
|
43
|
+
- Fix scope: <files and approximate line count>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The "mechanism" field is the acid test. If you can't write the causal chain from cause to observable symptom as one paragraph, you don't yet understand the bug well enough to fix it.
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Phase 7 — Reproduction-Locked Fix
|
|
51
|
+
|
|
52
|
+
Red reproduction, green same case, refactor. No shortcuts.
|
|
53
|
+
|
|
54
|
+
### 1. Red — the reproduction as a test
|
|
55
|
+
|
|
56
|
+
Capture a case that fails *specifically because of this bug*. Where the repository keeps tests for this behavior, keep that case as a regression test; otherwise capture a before-fix run and its failure output. Requirements:
|
|
57
|
+
|
|
58
|
+
- **For a test, its name reads like a bug report.** `test_refinement_turn_returns_empty_content_when_anthropic_returns_401` is good. `test_bug_fix` is not.
|
|
59
|
+
- **Failure output clearly shows what the bug looks like.** If someone reads only the failure output, they understand what's broken.
|
|
60
|
+
- **Minimum infrastructure.** Don't spin up the whole server if a smaller reproducible run captures the mechanism.
|
|
61
|
+
|
|
62
|
+
Run the test or scenario. Confirm it fails before the fix. Paste the failure output into the journal:
|
|
63
|
+
|
|
64
|
+
```markdown
|
|
65
|
+
### Red phase (<ISO timestamp>)
|
|
66
|
+
Reproduction: <test path>::<name> or <scenario and inputs>
|
|
67
|
+
Command: <exact invocation>
|
|
68
|
+
Output:
|
|
69
|
+
```
|
|
70
|
+
<verbatim failure output>
|
|
71
|
+
```
|
|
72
|
+
Confirms: the bug is reproducible in the test harness or captured runtime scenario.
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 2. Green — minimum change
|
|
76
|
+
|
|
77
|
+
Make the same case pass with the **smallest change that fully fixes the observed mechanism**.
|
|
78
|
+
|
|
79
|
+
If the diff is larger than ~30 lines and you aren't refactoring, something is wrong — either you're fixing more than the bug, or the root cause was deeper than you confirmed. Back to Phase 6.
|
|
80
|
+
|
|
81
|
+
Signs you're over-fixing:
|
|
82
|
+
- Adding "just in case" null checks or try/except around other code
|
|
83
|
+
- Refactoring adjacent functions because "while I'm here"
|
|
84
|
+
- Adding new configuration options the bug didn't require
|
|
85
|
+
- Introducing new abstractions to "make this cleaner"
|
|
86
|
+
|
|
87
|
+
Resist all of these. Fix the bug. Note the surrounding issues for follow-up. Move on.
|
|
88
|
+
|
|
89
|
+
### 3. Refactor — ONLY AFTER GREEN
|
|
90
|
+
|
|
91
|
+
Only cleanup directly related to the fix. Do not re-architect.
|
|
92
|
+
|
|
93
|
+
If the code around the fix is rough, note it in the journal as a follow-up for the user; do not expand scope here. Refactoring during a bugfix is how one-line fixes turn into hundred-line diffs nobody can review.
|
|
94
|
+
|
|
95
|
+
### 4. Regression — full suite green
|
|
96
|
+
|
|
97
|
+
Run the full test suite for the affected package when present (not just the targeted test, if any). Existing tests must still pass.
|
|
98
|
+
|
|
99
|
+
If they don't, your "fix" broke something else. Back to Phase 6 with the new failure as evidence — usually it means the mechanism you thought you fixed was load-bearing for some other code path you didn't know about, and the "broken" test is actually pointing at a better understanding of the system.
|
|
100
|
+
|
|
101
|
+
### 5. Close the observability gap
|
|
102
|
+
|
|
103
|
+
If diagnosis burned extra rounds *because state was invisible* — no log line told you which branch ran, what the value was, whether the fallback engaged — that invisibility is a defect adjacent to the bug, and this is the one moment where adding a log line is NOT "just in case": this session is the evidence that the line earns its place. Ship the fix WITH that line, written to the standard of `references/logging.md` — level chosen by consumer, placed at the decision point, data in fields not interpolation, through the project's designated logger. If the project deliberately does not log, respect that and skip this step.
|
|
104
|
+
|
|
105
|
+
This does not soften the artifact rule: every temporary `print` / `dbg!` / `console.log` planted *during* diagnosis stays journaled and gets scrubbed in Phase 9. The triage is the consumer test — a line whose ongoing consumer you can name is part of the fix; a line that only served today's session is an artifact.
|
|
106
|
+
|
|
107
|
+
### Update the journal
|
|
108
|
+
|
|
109
|
+
```markdown
|
|
110
|
+
### Green phase (<ISO timestamp>)
|
|
111
|
+
Fix: <file:line> — <two-line description of the change>
|
|
112
|
+
Reproduction: <test path>::<name> or <scenario> now passes
|
|
113
|
+
Output: <verbatim passing output for the same case>
|
|
114
|
+
Full suite: <N tests, <M failures — should be 0> (or <none exists>)
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## The red-green discipline summary
|
|
120
|
+
|
|
121
|
+
No captured failure → no proof the fix addresses the reported bug. Only proof it doesn't break tests that already existed. Keep the reproduction as a test where the repository keeps tests for this behavior; otherwise the captured before/after run is the proof.
|
|
122
|
+
|
|
123
|
+
Where tests are kept, a test written *after* the fix might still pass with the fix reverted. If that's the case, the test doesn't lock the bug — it locks something else. Always verify the same case fails without the fix and passes with it, whether test or captured run. The journal should show both outputs.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# Phase 8 — Manual QA by Actually Using It
|
|
2
|
+
|
|
3
|
+
Tests cover cases you thought of. Real usage covers the ones you didn't.
|
|
4
|
+
|
|
5
|
+
The single fastest way to ship a broken fix is to stop at "tests pass". Manual QA means interacting with the running system the way the user does, then comparing observed behavior to the original bug report.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## Product-type playbook
|
|
10
|
+
|
|
11
|
+
Pick the row that matches the product. Do what it says. Do not substitute.
|
|
12
|
+
|
|
13
|
+
| Product type | QA means… |
|
|
14
|
+
|---|---|
|
|
15
|
+
| **CLI tool** | Open `tmux`, run the actual command end-to-end, capture output. Paste the session transcript into the journal. Include exit code, stdout, stderr, side-effect check (files created/modified). |
|
|
16
|
+
| **HTTP API** | Start the real server, hit endpoints with `curl` or `httpie`, inspect response status + body + headers. Hit the specific endpoint that reproduced the bug. If there's auth, use real auth. |
|
|
17
|
+
| **Browser-served web app** | **Drive a real browser via Playwright CLI.** See [tools/playwright-cli.md](../tools/playwright-cli.md). Navigate the exact page/flow that reproduced the bug. Capture screenshot + DOM + network evidence. **Do not substitute with curl** — browsers have state (cookies, localStorage, service workers, client-side JS, viewport-dependent CSS) that curl does not have. |
|
|
18
|
+
| **Agent / LLM pipeline** | Run the same user prompt that originally failed. Capture the full turn — tool calls, messages, usage counters. **Confirm non-zero usage** (zero usage = still failing silently, see silent-failure check below). |
|
|
19
|
+
| **Background worker / job queue** | Trigger the job through the normal entry point (API call, cron tick, message publish), tail the worker logs, observe completion state in the queue or DB. Don't just call the worker function directly — the trigger path matters. |
|
|
20
|
+
| **MCP server** | Invoke the tool via its actual client (Claude Desktop, Cursor, etc. if available) or `mcp-cli`, not just the HTTP probe endpoint. The MCP handshake itself is sometimes where bugs live. |
|
|
21
|
+
| **Native binary** | Re-run the exact command that crashed / misbehaved. If the input was a file, use the same file. If the bug was exploitable, confirm the exploit repro via pwntools (see [tools/pwntools.md](../tools/pwntools.md)). Capture exit code, signal if any, core dump if generated. |
|
|
22
|
+
| **Bundled-app binary** (Bun SEA, Node SEA, Electron, etc.) | Re-run the exact command. If the operation requires paid quota / blocked network, capture the **app's debug log** (`APP_DEBUG=1 APP_LOG_LEVEL=debug APP_LOG_FILE=/tmp/trace.log`) which usually emits the assembled request before sending. See [methodology/partial-runtime-evidence.md](partial-runtime-evidence.md) for combining partial signals into a defensible verification. |
|
|
23
|
+
| **Long-running daemon** | Start fresh, let it run for the amount of time the bug originally took to manifest (not less), capture resource usage (memory, fd, cpu) throughout. Short-running QA misses resource leaks and cumulative state bugs. |
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Journal format
|
|
28
|
+
|
|
29
|
+
Every QA run goes in the journal under "Findings":
|
|
30
|
+
|
|
31
|
+
```markdown
|
|
32
|
+
### Manual QA — <product type> (<ISO timestamp>)
|
|
33
|
+
- Scenario: <one line describing what you did>
|
|
34
|
+
- Command: `<exact invocation>`
|
|
35
|
+
- Observed output:
|
|
36
|
+
```
|
|
37
|
+
<verbatim output, trimmed to relevant section>
|
|
38
|
+
```
|
|
39
|
+
- Expected output: <what correct behavior looks like>
|
|
40
|
+
- Fix verified: yes / no / partial — <details>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If any QA step shows **partial or regressed behavior**, this is not "mostly done" — it's incomplete. Return to Phase 6.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## The silent-failure check (always run)
|
|
48
|
+
|
|
49
|
+
Regardless of product type, audit the fix against these silent-failure patterns. If the original bug was a silent failure, the same pattern may exist in adjacent code that you haven't tested yet.
|
|
50
|
+
|
|
51
|
+
### Universal silent-failure signals
|
|
52
|
+
|
|
53
|
+
- HTTP 2xx with empty or default body
|
|
54
|
+
- Response `ok: true` but a sub-field contains an error token (e.g. `stopReason: "error"`, `status: "failed"`)
|
|
55
|
+
- `usage.totalTokens === 0` on an LLM response
|
|
56
|
+
- Process exit code 0 but stderr contains an exception traceback
|
|
57
|
+
- Panic recovered and logged but ignored
|
|
58
|
+
- Goroutine / task / promise rejection with no top-level handler
|
|
59
|
+
- `try { ... } catch { /* swallowed */ }` or `except: pass`
|
|
60
|
+
- Success response shape but semantic field indicates failure (e.g. `error: null` actually being `error: "..."` with falsy check)
|
|
61
|
+
- Write returned success but read-back shows stale data
|
|
62
|
+
- Job marked complete but side-effect did not happen
|
|
63
|
+
- Cache hit path returned stale data and no refresh was triggered
|
|
64
|
+
|
|
65
|
+
### Language-specific silent-failure signals
|
|
66
|
+
|
|
67
|
+
Check the runtime reference for additional patterns:
|
|
68
|
+
|
|
69
|
+
- [runtimes/python.md](../runtimes/python.md) — asyncio task exceptions, bare `except`, `logging.exception` that goes nowhere
|
|
70
|
+
- [runtimes/node.md](../runtimes/node.md) — unhandled promise rejections, `void` on async, swallowed `.catch(() => {})`
|
|
71
|
+
- [runtimes/rust.md](../runtimes/rust.md) — `.unwrap_or_default()`, `let _ = result`, error variants discarded
|
|
72
|
+
- [runtimes/go.md](../runtimes/go.md) — `if err != nil { return err }` that never reaches user output, recovered panics, buffered channels that block silently
|
|
73
|
+
- [runtimes/native-binary.md](../runtimes/native-binary.md) — ignored return codes from libc, missing `perror`, `alarm()` / signal masks
|
|
74
|
+
- [runtimes/bundled-js-binary.md](../runtimes/bundled-js-binary.md) — `process.env.X` baked at build time, dead code from tree-shaking failures, worker sub-bundles diverging from main bundle
|
|
75
|
+
|
|
76
|
+
### What to do when you find another silent-failure spot
|
|
77
|
+
|
|
78
|
+
Don't fix it. This is out of scope for the current bug.
|
|
79
|
+
|
|
80
|
+
Note it in the journal under a "Follow-ups" section with:
|
|
81
|
+
- File:line
|
|
82
|
+
- Pattern matched
|
|
83
|
+
- Proposed fix sketch (one line)
|
|
84
|
+
- Risk level (what happens if left unfixed)
|
|
85
|
+
|
|
86
|
+
Surface these to the user in the final message under "Next steps I didn't take".
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
## The "fix verified" bar
|
|
91
|
+
|
|
92
|
+
"Fix verified" means: the exact original failing scenario, re-run, now produces the correct output. Not a similar scenario. Not a unit test of the fix. The original scenario.
|
|
93
|
+
|
|
94
|
+
If you can't re-run the original scenario (e.g. it required a specific data state that's gone), construct the closest equivalent and document the difference in the journal. Escalate to the user if the equivalent is materially different.
|