harness: codex
prompt: zstack: users report the CSV export drops the last row
exit: 0  seconds: 21
zstack files read: SKILL.md, playbooks/debug.md, playbooks/bug-class-sweep.md, references/harness-capabilities.md, references/principles/reproduce-first.md, references/principles/fix-the-class.md, references/principles/evidence-before-the-word.md
---
Goal: reproduce the missing final CSV row, identify its cause, and verify that exports preserve every expected row.

Route: debug -> bug-class-sweep, shape: inline, principles: reproduce-first, fix-the-class, evidence-before-the-word

Inline for this dry run; no worker or worktree is needed.

Todo list, all pending:

1. Write the symptom as one line: observed, expected, where.
2. Reproduce it. Prefer a failing automated test; fall back to a script or a recorded manual sequence. If it cannot be reproduced, write down what you tried and why, and ask the user before going further.
3. Shrink the reproduction until every remaining step is needed to trigger it.
4. List at least two candidate causes and the observation that would tell them apart.
5. Run those observations (logging, a debugger, `git bisect run <repro>` when a known good commit exists) until one cause is left standing. Record the evidence that ruled out each other candidate.
6. Name the root cause in one sentence that explains every observed symptom. A cause that leaves a symptom unexplained is a partial cause; return to step 4.
7. Make sure the reproduction is captured as a test that fails on the current code.
8. Make the smallest change that fixes the root cause, in its own commit.
9. Record the checks at the fix commit on a clean tree: `<zstack dir>/scripts/zcheck.sh --name <check> -- <test command>` for the new test and the suite that covers the area. A check that ran zero tests failed.
10. Confirm the original symptom is gone the way it was first seen (same environment, same steps).
11. Chain into `bug-class-sweep` with the root cause as its input. When the bug is a true one-off (a typo, a single wrong constant), write `no class: <reason>` in the PR body instead.

Principles shaping the plan:

- `reproduce-first`: establish the failure before choosing a fix.
- `fix-the-class`: search for sibling defects once the cause is known.
- `evidence-before-the-word`: require recorded verification before claiming a fix.

Stopped after routing and planning. No files edited; no reproduction or tests run.
