Skip to content

fix: report row stats for multi-table --table too - #62

Merged
yusukebe merged 1 commit into
mainfrom
fix/multi-table-rowstats
Aug 4, 2026
Merged

fix: report row stats for multi-table --table too#62
yusukebe merged 1 commit into
mainfrom
fix/multi-table-rowstats

Conversation

@yusukebe

@yusukebe yusukebe commented Aug 4, 2026

Copy link
Copy Markdown
Owner

Summary

  • emit the N rows extracted completeness note in the multi-table --table branch, aggregated: ax: note: 2 tables, 200 rows extracted, no empty fields
  • count a row as empty only for fields its own table actually has (key union, per-row membership), so tables with different headers don't pollute each other's empty counts
  • --where reporting now aggregates beforeWhere across tables as well

Why

Closes #61. rowStats() was only called when exactly one table matched; with two or more, stderr went completely silent — while the agent context explicitly teaches "treat that note as the completeness check — no extra verification probes needed". A guarantee that silently stops applying is the worst kind of gap. Reproduced with the issue's fixture and with table.wikitable on the Wikipedia GDP page (2 tables, cache-note only).

The multi-table output shape ([{headers, rows}, …]) is unchanged — only the stats survive it now.

Tests

One new CLI test covering: single-table note unchanged (no tables, prefix), aggregated multi-table counts, per-table empty-field attribution, and --where across tables. bun test: 159 pass in test/, tsc --noEmit and oxfmt --check clean.

🤖 Generated with Claude Code

The 'N rows extracted' completeness note is a documented guarantee agents
rely on instead of verifying, but the multi-table branch skipped rowStats
entirely — stderr went completely silent. Aggregate across tables
('2 tables, 200 rows extracted'), counting a row as empty only for fields
its own table has.

Closes #61

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@yusukebe
yusukebe merged commit bf31581 into main Aug 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--table stops reporting "N rows extracted" when the selector matches more than one table

1 participant