Skip to content
Skills Library
Programming · Analysis

burrow

/burrow

Dig out hard stalls and correctness bugs in stateful servers built around serial owners (actors, event loops, per-connection tasks). Hunts six classes that green tests and health probes miss: one turn whose work grows with members × rows, work built then thrown away, lifecycle handoffs that drop state, fast paths blind to a data family, sequential round trips, and liveness reusing readiness. Also drives the fix: a read-only design pass before building, an attribution run before redesigning, bars written before measuring, work-count regressions, staged A/B runs, and review questions for shortcu

Repository
hogworks ↗
Licence
MIT
Last repository change
11.11.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 11.11.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

Dig out hard stalls and correctness bugs in stateful servers built around serial owners (actors, event loops, per-connection tasks). Hunts six classes that green tests and health probes miss: one turn whose work grows with members × rows, work built then thrown away, lifecycle handoffs that drop state, fast paths blind to a data family, sequential round trips, and liveness reusing readiness. Also drives the fix: a read-only design pass before building, an attribution run before redesigning, bars written before measuring, work-count regressions, staged A/B runs, and review questions for shortcu

Original author description

Dig out hard stalls and correctness bugs in stateful servers built around serial owners (actors, event loops, per-connection tasks). Hunts six classes that green tests and health probes miss: one turn whose work grows with members × rows, work built then thrown away, lifecycle handoffs that drop state, fast paths blind to a data family, sequential round trips, and liveness reusing readiness. Also drives the fix: a read-only design pass before building, an attribution run before redesigning, bars written before measuring, work-count regressions, staged A/B runs, and review questions for shortcu

How it works

  1. Available tools
  2. Ground rules
  3. Find the owners
  4. The six defect classes (hunt)
  5. Design pass (design)
  6. Attribute before redesigning
  7. Measurement
  8. Review questions that catch subtle bugs
  9. Output
  10. Prior art
Original SKILL.md headings · 111 lines, 1,984 words
SKILL.md preview
---
name: burrow
description: >-
  Dig out hard stalls and correctness bugs in stateful servers built around serial owners (actors, event loops, per-connection tasks). Hunts six classes that green tests and health probes miss: one turn whose work grows with members × rows, work built then thrown away, lifecycle handoffs that drop state, fast paths blind to a data family, sequential round trips, and liveness reusing readiness. Also drives the fix: a read-only design pass before building, an attribution run before redesigning, bars written before measuring, work-count regressions, staged A/B runs, and review questions for shortcuts. Use when the user invokes burrow, asks "why is this reload/turn so long", "find the stalls", "design a fix for this stall", "why didn't the perf fix help", or "review this shortcut", or wants a deep latency and correctness pass on a daemon, broker or game server. Any language. Read-only by default.
---

# Burrow: find the long turn and what it is really doing

A stateful server usually has one owner per piece of state: an actor, an event loop, a manager task. While that owner runs one unit of work, everything else that needs it waits: other clients' updates, queries, timers. Tests pass, health checks pass, and the server still stalls for seconds when one operation scales with the fleet.

The hard bugs here are rarely in one function. They are in a loop that calls a table-sized function per member, in a fallback path nobody measured, in a predicate that routes one data family into a path that never emits it. Burrow hunts those, and then makes sure the fix actually removes the work.

Arguments:
- **Mode:** `hunt` (default; read-only audit for the defect classes) or `design` (read-only design pass for one known problem, ending in a recommendation, bars and slices).
- **Scope:** paths, subsystems, or the operation that stalls (for example "config reload with 150 clients"). With no scope in `hunt`, start with **Find the owners**.

## Available tools

Use the host agent's file, search and shell tools. If profilers, metrics, the tracker or report-file writes are unavailable, say so and report only what you can verify. Never invent measurements or file:line evidence.

## Ground rules

- **Read-only.** Read from the default branch or a detached worktree in a scratch directory. No edits, no builds unless the user allows them; shared machines often run measurements.
- **Enumerate, then triage.** Grep every loop, writer and caller in the class, report the counts, and say which regions you classified by shape rather than read line by line.
- **Refute before reporting.** Find the guard, bound, cap, refusal or serialization that would make it impossible. Prove the input has a production emitter; a state only a test reaches is not a finding.
- **Check the premise.** Tickets and comments state limits, caps and code paths that drift. Verify each one you build on (config defaults, caps, which path a request actually takes).
- **Dedupe** against the tracker in every state, including closed ones.
- **No module splits for size, no new frameworks.** A fix removes or bounds work; it does not rearrange it.

## Find the owners

List the serial owners: actor run loops, `select!`/event-loop dispatch, per-connection tasks, the config/reload path, startup and shutdown. For each, list the message kinds or operations it handles and what operators or peers can trigger in bulk (reload, peer flap, mass reconnect, refresh, policy change). Rank by how many other clients wait while one unit runs.

## The six defect classes (`hunt`)

**1. One turn that grows with members × rows, or with table size.**
- A loop over members/peers/tenants that calls a table-sized function each time: snapshot, capture, full resync, feed build, key-set build.
- A sweep of a whole table on every event (garbage collection of an intern table per batch, a full rebuild per update).
- A scan where a keyed lookup exists: filtering every row to find one key's candidates; probing every peer's table per key.
- **Fallback paths.** The fast path is often paced or shared; the fallback it hands off to often runs the whole cohort synchronously in one turn. Always ask what the fallback costs at fleet size.
- **A readiness checkpoint is not a fix.** Answering health probes at checkpoints inside a long unit keeps the probe green while every other client still waits for the whole unit. Bound or remove the work.

Hunt: for each loop over a collection, write the cost of one iteration at realistic scale (for example 150 clients × 37,000 rows, and at 1M rows) and multiply. Grep for `.values()`/`.iter()` inside per-key code, `collect` of whole tables into sets, and per-event calls to anything named sweep, gc, rebuild, resync, snapshot.

**2. Work built and then thrown away.**
- Building a full payload for a target whose commit is then refused (a full writer, a cap, a closed channel).
- Building more than you send: chunkers that build N entries, find the message too large, halve, and rebuild.
Hunt: anything expensive built before an admission or refusal check. Count units built vs units used; a ratio above 1 on a hot path is a finding.

**3. Lifecycle handoffs that drop state.** Abort, replacement, park, shutdown, reconnect.
- Messages held by a task that is aborted; registration or retained state lost across a replacement connection; a closed socket the state machine never learns about; a parked task that stops reading its command channel; obligations (markers, acknowledgements) held by several independent sources instead of one owner.
Hunt: every `abort`, drop, replace and park path: what was in flight, who owns it afterwards, and does the state machine hear about it. Use the `forage` skill's `state` lens for the implicit-state-machine half.

**4. Fast-path qualifiers blind to a data family.**
- A shared or batched path qualified by properties of one family (for example "unicast-only group key") admits members that also carry private state in another family. The path emits only the first family, so the second keeps stale exports or never withdraws.
- Deliberate exclusions push a family onto a slower path; that is the fallback cost of class 1.
Hunt: for each fast path, list what the qualifier checks and what the path emits. Every family the path does not emit must be checked absent by the qualifier. Write the mixed-family test: it is usually short and it is usually red.

**5. Sequential round trips.** N commands with a reply wait each where one command would do, or N awaits on independent targets in one loop. Use the `forage` skill's `awaits` lens.

**6. Liveness that reuses readiness.** A watchdog or liveness probe that waits on the readiness answer turns a slow-but-alive owner into a restart. A prompt "I am stalled" reply proves the owner is alive; keep the two signals separate and export the stall as its own metric.

Classify each candidate: **A** reachable defect (scenario, numbers, the test that turns red), **B** improvement needing measurement, **C** checked and fine (one line why).

## Design pass (`design`)

For one known problem, deliver a read-only design before anyone builds. Sections:
1. **Trace end to end** with file:line, for every variant or arm (for example the production path and the experimental one). Name the request variant actually taken; fast paths often fall back silently.
2. **How the sibling solves it.** Another family, protocol or subsystem usually already paces or shares the same operation. Describe its state across turns, unit of work, atomicity and rollback, ordering with concurrent input, deadlines.
3. **Why the gap exists.** A recorded decision (design record, comment) or just not done. List the invariants that make the problem harder here.
4. **Options with one recommendation.** For each: unit of work per turn and its bound, new state (prefer the least), every writer that must maintain it, behaviour on failure, flap and rollback, reply semantics (logical commit vs delivery), memory. Include "reduce the work" and "accept and document" as options.
5. **What must not regress**: name the existing tests and oracles, the new regression (prefer a work count), and the failure cases to test.
6. **Measurement and draft bars** (below).
7. **Slices**: each independently mergeable and measurable; say which slice first helps production.

Ask the design pass to flag adjacent suspected defects it passes on the way; probe each with a failing test before filing.

## Attribute before redesigning

When a fix does not move the number enough, do not redesign from the code. Run one untimed, instrumented build: span timers around each phase of the long unit, counts of members and rows, logged once per unit. Fit `turn ≈ a + b × members` (or rows). The first fix often removed a small share; the attribution finds where the rest is (work built for refused targets, per-entry accounting that can be done in bulk). Keep the instrumentation out of the change.

## Measurement

- **Write the bars before measuring**, on the ticket or in the PR: which cells gate, the threshold, and which are report-only. Do not add gated cells after seeing numbers.
- **Gate on blocked work, not probe latency:** the longest uninterrupted unit of the owner, and the wait of an unrelated client's update through the stall (a primary-lane probe). A green health probe says only that a checkpoint was reached.
- **Check the instrument's window.** A phase-scoped scrape can miss the longest turn entirely if it happens in an earlier phase. Record the whole-run maximum too.
- **Prefer work counts in regression tests** (checkpoints, sweeps, entries built, candidate reads, round trips): deterministic, and a failure names the number. Pin "flat from 8 to 32 members" rather than a time.
- **Parent-relative and staged.** Compare against the same-source parent built separately (verify the binaries differ). Run the gating stage first and stop if it fails; then A/A, ABBA, one confirmation for cost cells. Keep failed and invalid runs.
- **Measurement traps.**
  - Small microbenchmarks (about 100 ns to a few µs) can move 10% with function start alignment on identical code. Before calling a small cell regressed, build both sides with fixed function alignment (LLVM: `-align-all-functions=6`) and compare the timed functions' disassembly. A relink control must shift functions by a non-multiple of 64, or it shows nothing.
  - A different build profile (unstripped, profiling, debug-assertions) inlines and lays out differently; never time it as a stand-in.
  - An oracle whose reference reads the same storage it checks cannot catch a storage bug.

## Review questions that catch subtle bugs

Ask these of every shortcut, skip or shared-work change:
- Is the skip predicate a **subset** of the slow path's own refusal condition, evaluated with the same functions? Ask for an old-vs-new **side-effect table** (receipts, credit entries, metrics, dirty marks, checkpoints, timers) and check each row.
- Does every documented accounting statement ("a refused member holds nothing") hold on **every** refusal branch: each cap, allocation failure, and the final seal step?
- A shortcut that trusts a cached result (the stored best was the minimum) needs **every writer that mutates its inputs in place**, enumerated by grep.
- Ties: `min_by`/`max_by` keep the first, so iteration order decides ties. State which side wins and pin it.
- Shared work vs separate work can change accounting (numbering, representation, transient peaks); bound the difference and document it.
- Ask the reviewer for mutation probes in a throwaway worktree: drop the guard, swap the order, build partial state. Each must turn a test red.

## Output

- `hunt`: a report (scratch file or chat) with the commit audited, enumeration counts, a candidate table, an A/B section per finding with file:line, scenario, numbers and the red test, C one-liners, and a coverage caveat.
- `design`: the seven sections above, with "not verified" wherever the code did not settle it.
- Both: a one-paragraph pattern note on what the findings share. File no tickets from the audit itself; the person running it verifies each A by reading the key lines.

## Prior art

A two-day run on a BGP daemon (rustbgpd, 2026-11) used this method:
- An EVPN group pass held the routing actor for 1.6–1.9 s. A shared table walk cut it only 36%; attribution showed 70% of the turn was complete feeds built for members whose commit a full writer then refused, and 29% per-entry accounting. Removing both brought it to 30–39 ms.
- Best-path selection re-read every stored path per update; bounding it took one UPDATE from 24–42 ms to under 0.2 ms. The small microbench "regressions" that followed were function alignment, confirmed by aligned builds and a 16-byte shifted parent.
- A design pass for an 8–12 s reload turn found that every EVPN peer took the synchronous fallback, and on the way flagged a batched path that never re-exported EVPN for peers also carrying IPv4. Two tests confirmed it.

Versions

The database has no other skills named burrow.

Database snapshot: 13.11.2026 · package version 3bc762f847b4 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

No similar skills in the database.

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.