# Line Counter Verification Report (Q125) ## Artifact `wizard-work/spark/line_counter.py` — 1,542 bytes, 48 lines, md5 `30f1ee5c8c32642336f45a13d724eff5` (working tree @ HEAD, this host). ## Purpose The lane's surviving text-statistics tool: counts lines (`count` mode) and counts comma-separated fields on the first row (`csv` mode) of a single file. It takes ` ` and prints one number; exit 0 on success, 2 on an unreadable or missing file, 1 on a usage error. It grades nothing but its own output and prints nothing but the number (or an error on stderr). ## Counting definitions (stated in the tool's README section) - `count `: one count per line yielded by iterating the file as text — every `\n`-terminated line, plus one final count for an unterminated trailing fragment. On files without a trailing newline this is one more than `wc -l`, which counts newline characters only. - `csv `: fields in the first row via `str.split(',')`. Quoted commas are not unescaped: `"a,b",c` reads 3 fields, not 2. Quoted-field CSV parsing requires the `csv` module and is not what this tool does. ## What this verification certifies `bash wizard-work/spark/verify_line_counter.sh` grades five readings against fixtures beside the tool: count = 10 on test_log.txt, csv = 5 on test_data.csv, count = 4 on test_blank.txt (blank lines are lines), missing file -> exit 2, missing mode -> exit 1. `python3 wizard-work/spark/test_line_counter.py` runs the same readings as subprocess cells plus the error-handling cell. ## What this verification does NOT certify - The retired host-path artifact at `/root/.hermes/wizard-outputs/spark/line_counter.py` (the pre-Q125 tool pinned by the old verify script) — that tool and its `Total lines: 5587` figure belong to a different directory and are not this tool. - Any of the ten other counters in the lane (`count_python.py`, `count_python_lines.py`, `py_loc.py`, `lwc_counter.py`, `linecount_pycount.py`, `text_stats.py`, `word_stats.py`, `file_stats.py`, `code_stats.py`, `loc_counter.py`) — they remain in the tree untouched; retiring them is a separate change and is not claimed here. - Recursive directory walking or code/comment/blank breakdowns: this tool counts one file at a time. ## Test command (runnable from the repo root) ```bash cd /root/troupe-standup python3 wizard-work/spark/test_line_counter.py bash wizard-work/spark/verify_line_counter.sh ```