Most engineers already paste stack traces into AI. The difference between amateurs and professionals is what they demand back: not "the fix", but ranked hypotheses, each with a disconfirming test.
Tier: Foundation · Workflow area: Debugging
A single confident answer to a stack trace is often plausible and wrong; a ranked differential diagnosis with cheap ways to falsify each candidate turns the model into a genuinely fast debugging partner instead of a confident guesser.
Skip it for errors whose message literally tells you the fix (missing import, obvious typo) — read before you paste.
Assemble context before prompting. A trace alone invites guessing. Gather: trace, the code of the frame where it raised plus its caller, one config fact ("runs in 4 gunicorn workers"), and recency ("started after yesterday's deploy of #482").
Demand the differential. The prompt shape that changes everything:
Production error, Python/FastAPI, started after deploy #482 (diff summary
below). Full trace, the two relevant functions, and surrounding logs
attached.
psycopg.OperationalError: connection pool exhausted [trace...]
[code of get_report() and its caller...]
[logs: 12:01:03 pool size 20/20 ... 12:01:04 ERROR ...]
Do NOT jump to a fix. Give me:
1. The 3-5 most likely root causes, ranked, with a probability guess.
2. For EACH: the specific evidence in what I pasted that supports or
undercuts it.
3. For EACH: the cheapest disconfirming test - a command, log query, or
code probe that would rule it out in under 5 minutes.
4. What additional single piece of evidence would most change the ranking.
Run the disconfirming tests, cheapest first. This is the human half. For "leaked connections in the new report endpoint": grep the diff for connection usage outside the context manager. For "pool too small for new traffic": check request-rate dashboards. Kill hypotheses; report results back:
Test results: (1) confirmed - get_report() acquires a connection in a
branch that returns early without releasing when format=csv. Hypothesis 2
ruled out - traffic flat. Now: minimal fix, and a regression test that
fails on the current code.
Fix with a failing test first. Even at Foundation tier, insist the fix comes with a test that reproduces the failure (early-return with format=csv leaks) and passes after. (Deep version: pb-11.)
Bank the diagnosis. Paste the confirmed root cause + fix into the ticket/postmortem in two sentences. Future-you searching "pool exhausted" will find it.
The assessable skill here is the shape of the demand — ranked hypotheses, per-hypothesis evidence, per-hypothesis disconfirming test — not knowledge of any specific error.
Stack traces and logs are among the leakiest artifacts in engineering: they carry customer identifiers, internal hostnames, query fragments, sometimes tokens. Before any hosted tool: replace customer values (user 8841 / rohit@... → user_A), internal hosts (db-prod-3.corp → DB_HOST), and cut auth headers entirely. Under DPDP-style rules, log lines with personal data must not leave approved systems. Client work: use the sanctioned enterprise assistant, or run the identical differential prompt on a local model — mid-size local models are respectable at ranked diagnosis when you provide rich context, and the disconfirming tests are yours to run either way.