Skip to content

/wbDebug — Exhaustive Simulation () ​

/wbDebug is the diagnostician. Its job is root-cause analysis, not patch attempts. It reads a stack trace, a failing test, or a description of unwanted behavior, and produces a theory of what's broken and why — citing evidence at every step. It does not fix. It hands the diagnosis to /wbWork (or to the user) with enough context that the fix can be made deliberately.

Read this if you want to know why /wbDebug has no flags, what counts as a usable diagnosis, and where the boundary sits between "diagnose" and "fix."


1. Role & target ​

AspectBehavior
RoleThe Diagnostician — root cause + evidence chain.
TargetA failing test name, a stack trace, an error message, a user-described symptom, or a file the user suspects.
Cell scopeNone. Output is a diagnosis report, not a plan mutation.
Side effects allowedReading code, reading test output, reading logs, running read-only diagnostic commands (grep, file inspection).
Side effects forbiddenEditing source code, applying fixes, mutating plan cells, running anything that changes state.

The "no patch attempts" rule is the design center. A diagnostic that says "I think it's broken here, and I fixed it" loses both the theory (because the user can't follow the reasoning) and the fix (because the fix is now bundled with potentially-wrong reasoning). /wbDebug separates the two: a diagnosis you can read and verify, then /wbWork --id="<row>" to actually fix it.


2. Argument resolution matrix ​

/wbDebug is intentionally forgiving on input format because real debug starts from messy evidence. It accepts whatever the user has.

FormExampleWhat /wbDebug does
Stack trace (multi-line)Pasted JS/Python/Vue trace in argumentParses frames, identifies the deepest user-code frame, follows from there.
Error message stringCommand: /wbDebug "Cannot read property 'map' of undefined"Searches workspace for code paths that could produce this error; ranks by likelihood.
Failing test nameCommand: /wbDebug "WBCodeSlot.spec.js > renders empty slot"Reads the test, reads the code under test, walks the assertion that fails.
Symptom descriptionCommand: /wbDebug "WBDataViewer apiResponse_ stale on route change"Maps symptom to candidate code areas using both source and memory.
Suspect fileCommand: /wbDebug core2/packages/wb-core/src/WBC.jsTreats the file as the locus; looks for issues consistent with the user's framing.
Bug report URL(e.g., a GitHub issue number)Refuses if the URL isn't local. /wbDebug does not fetch external resources.

The forgiving input is paired with a strict output contract: every diagnosis names a specific file/line/symbol, a specific cause, and an evidence chain. Vague inputs are fine; vague outputs are not.


3. Flag matrix ​

/wbDebug has no flags (per the canonical the agent flag map). This is deliberate. Debugging that needs flags to refine its output usually wants /wbAudit --profile="<x>" instead — a flag-driven adversarial scan, not a diagnostic. /wbDebug's output shape is fixed: theory + evidence + recommended next step.

What you might wantWhat to use instead
"Just fix it for me"/wbDebug to diagnose, then /wbWork --id="<row>" to fix.
"Scan many files for similar issues"/wbAudit --profile="correctness".
"Diagnose and add a row to the plan"/wbDebug (read the diagnosis), then /wbPlan --task="bugfix" "<diagnosis summary>".
"Find all failing tests"/wbTest --profile="all". /wbDebug is for one failure at a time.

The single-failure-at-a-time rule is the second design center. Debugging a batch of failures together produces shallower diagnoses than debugging them individually — the agent's attention dilutes. The convention is: run /wbTest to enumerate failures, then /wbDebug per failure.


4. Pipelines (the agent-native scenarios) ​

📋/wbDebug Exhaustive Simulation
The WBDataViewer apiResponse_ stale-cache symptom/wbDebug "WBDataViewer apiResponse_ stale on route change"
> /wbDebug "WBDataViewer apiResponse_ stale on route change"
[DIAGNOSE] Symptom: data viewer shows previous project's response
after navigation.
[CONTEXT] Reading project_wbdataviewer_apiResponse.md (memory)...
[CONTEXT] Reading core2/packages/wb-dataviewer/src/App.vue...
[CONTEXT] Reading core2/packages/wb-dataviewer/src/WBDataViewer.vue...
## Theory
The `apiResponse_` ref is component-scoped and has no invalidation
hook. When the route changes the `project` prop, the watcher reads
the existing `apiResponse_` cache and writes it back without
re-fetching. The cache key is implicit (component instance lifetime),
which means: same component instance → same cached response, regardless
of which project is active.
## Evidence chain
1. core2/packages/wb-dataviewer/src/WBDataViewer.vue:34
`const apiResponse_ = ref(null)` — instance-scoped ref, declared
at component setup time.
2. core2/packages/wb-dataviewer/src/WBDataViewer.vue:51
`watch(() => props.project, async (newProject) => {
if (apiResponse_.value) return apiResponse_.value
apiResponse_.value = await fetchProject(newProject)
})`
The early-return on `apiResponse_.value` is the bug. The cache is
never invalidated when `props.project` changes; it only fills once.
3. Memory note `project_wbdataviewer_apiResponse.md` describes
apiResponse_ as cache-on-mount. The early-return logic violates
that intent: it caches on first *write*, not on mount.
## Why this happens
The watcher was likely written to "avoid re-fetching the same project,"
but the implementation conflates "same project" with "have a value at
all." A correct check would be `if (apiResponse_.cachedFor === newProject)`
— a key match — not a presence check.
## Recommended next step
Add a row to the plan:
> Title: WBDataViewer apiResponse_ — replace presence check with
> project-key match
> Verify: navigate between two projects, confirm second project's
> response renders without manual refresh.
> Files: core2/packages/wb-dataviewer/src/WBDataViewer.vue:51
This is a 5-line fix, but the **memory note** should also be updated
to record the key-match invariant. Do not fix without updating memory.
[NO MUTATION] Diagnosis only. Run /wbWork after the row is added.
⚠️ Note: A real symptom that surfaces in this workspace: the project changes via the route, but the data viewer keeps showing the previous project's response. The memory note `project_wbdataviewer_apiResponse.md` *describes* the cache pattern but doesn't say what's wrong. The user runs `/wbDebug` to find out:

💠 Pipeline The WBDataViewer apiResponse_ stale-cache symptom ​

A real symptom that surfaces in this workspace: the project changes via the route, but the data viewer keeps showing the previous project's response. The memory note project_wbdataviewer_apiResponse.md describes the cache pattern but doesn't say what's wrong. The user runs /wbDebug to find out:

💠 Pipeline Stack trace from a failing build ​

A vite build fails with an obscure trace. The user pastes it:

💠 Pipeline A test failure with no obvious cause ​

A unit test fails intermittently. The user pastes the test name:


5. Edge cases & refusals ​

TriggerWhat /wbDebug does
No symptom/target providedHalt. ❌ Provide a stack trace, error message, test name, or symptom description.
User asks /wbDebug to fix the bugRefuse politely. /wbDebug produces diagnoses; fixes are /wbWork's job.
Symptom matches no code or test in the workspaceHonest "could not localize." Suggests checking dependencies or build artifacts.
Multiple plausible causesRank by evidence strength; present the top theory plus 1-2 alternatives.
Memory contradicts the user's framing (e.g., "X is broken" but memory says "X was deliberately removed")Surface the contradiction. Ask whether the user wants to revive X or accept that it's gone.
External URL givenRefuse. /wbDebug does not fetch. Paste the relevant content into the argument.
Stack trace from a dependency (no user code in the trace)Diagnose the call site in user code, not the dependency. Note that the upstream may be broken but is out of scope.

The unifying rule: /wbDebug produces theories, not patches. Every diagnosis is a hypothesis the user can verify against the cited evidence. When the agent is uncertain, it says so; when memory contradicts the framing, it surfaces that contradiction. The diagnosis is a handoff document, not a finished work item.