Files
lauren d7cde2b84e pstack: replace semicolons, em dashes, and connector colons in skill prose with periods or commas (#331)
Punctuation and single-word swaps only. No sentence added or deleted, no
restructuring, no new text.

- 65 markdown files under pstack/skills. 220 changed lines, every changed
  line pairs with one base line.
- 272 rewrites. 239 semicolons (224 became a period plus a capital, 15 became
  a comma). 29 connector colons (28 became a period, 1 became a comma).
  1 em dash before a list became a colon. 3 word swaps (`public surface` and
  `smaller surface area` to `API`, `echo the scaffolding` to `echo the
  structure`).
- Label colons, colons before a list or an example, template strings such as
  `file:line`, and the literal `TL;DR` stay.
- Heading, numbered-step, fenced-block, and line counts are unchanged in
  every file. No frontmatter, code span, or fenced block changes.
- o200k tokens of the pstack/skills markdown tree 87,747 before, 87,766
  after (+19), because a period plus a capital tokenizes one token longer
  than a semicolon in a few places.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
2026-09-07 17:00:12 -07:00

1.8 KiB

Trace forensics

You own the diagnosis from the artifact. Load it, shape it, narrow to the cause, attribute to source.

Distinct from Runtime forensics, which instruments the live process. Here the capture already exists. The artifact is a fixed dataset, read it, don't re-run it. Keep tooling generic so the playbook stays portable: a DevTools or trace parser for cpuprofile and .json.gz, a text editor for a spindump, your heap tooling for a heapsnapshot.

  1. Identify the format and load it with the right tool. Parse large artifacts in a subagent (the principle-guard-the-context-window skill) and keep the reduced finding in the main thread.
  2. Transform the raw artifact into a form you can query. Dump the trace or heap snapshot into sqlite, one row per sample, frame, or node. Reach the queryable shape before you read.
  3. Narrow to the cause. Query for the frames that hold the most time and walk the call tree to the hot path. For a leak, follow the retainer chain from the leaked object to a GC root. For a spindump, find the thread stuck on-CPU or blocked and its wait reason.
  4. Attribute to source. Map the hot frame to file, symbol, and line via the artifact's own symbols. A frame with no source mapping is not yet a diagnosis. Resolve the symbols, or say plainly the artifact does not carry them.
  5. Confirm against a paired capture when you have one. Diff a before and after artifact. Without one, mark the finding as the strongest hypothesis the artifact supports, not a confirmed cause.
  6. Hand back a cited diagnosis, no fix unless asked. Route to Bug fix or Perf issue once the cause is known. Throughput checkpoint stays one line: throughput checkpoint: n/a, read-only forensics.

Reply: the artifact and format, the reduced finding, the source location, the artifact paths, and whether a paired capture confirmed it.