fix(cli): code-tags --dry-run help text and capped_wide total label

--dry-run's help text now describes what it computes (the merged
item→codes mapping) instead of a stale "report per-collection item/tag
counts". The CLI's total line now prints capped_wide= for the
per-item --max-codes-per-item cap count (the stats dict key stays
skipped_wide); docs regenerated via docs/scripts/extract_cli.py.
This commit is contained in:
kert
2026-09-10 00:56:48 -04:00
parent 8e7d3637f7
commit 1c542ae708
3 changed files with 9 additions and 5 deletions

View File

@@ -33,8 +33,9 @@ Usage: stack bib code-tags [OPTIONS]
│ [default: all] │ │ [default: all] │
│ --anchors-only Rules only, straight from fr_anchors │ │ --anchors-only Rules only, straight from fr_anchors │
│ text — skip pgvector entirely. │ │ text — skip pgvector entirely. │
│ --dry-run Report per-collection item/tag counts; │ │ --dry-run Compute the merged item→codes mapping │
│ write nothing. │ │ and report what would be tagged; write │
│ nothing. │
│ --max-codes-per-item INTEGER Items with more distinct codes get │ │ --max-codes-per-item INTEGER Items with more distinct codes get │
│ family: tags only (+ hand-family │ │ family: tags only (+ hand-family │
│ codes). │ │ codes). │

View File

@@ -925,7 +925,10 @@ def code_tags(
help="Rules only, straight from fr_anchors text — skip pgvector entirely.", help="Rules only, straight from fr_anchors text — skip pgvector entirely.",
), ),
dry_run: bool = typer.Option( dry_run: bool = typer.Option(
False, "--dry-run", help="Report per-collection item/tag counts; write nothing." False,
"--dry-run",
help="Compute the merged item→codes mapping and report what would "
"be tagged; write nothing.",
), ),
max_codes_per_item: int = typer.Option( max_codes_per_item: int = typer.Option(
200, 200,
@@ -1025,5 +1028,5 @@ def code_tags(
prefix = "would-" if dry_run else "" prefix = "would-" if dry_run else ""
typer.echo( typer.echo(
f"total: {prefix}items={stats['items']} {prefix}tags_added={stats['tags_added']} " f"total: {prefix}items={stats['items']} {prefix}tags_added={stats['tags_added']} "
f"skipped_wide={stats['skipped_wide']}" f"capped_wide={stats['skipped_wide']}"
) )

View File

@@ -439,7 +439,7 @@ class TestCodeTags:
assert result.exit_code == 0, result.output assert result.exit_code == 0, result.output
assert "comments: skipped (--anchors-only)" in result.output assert "comments: skipped (--anchors-only)" in result.output
assert "total: items=0 tags_added=0 skipped_wide=0" in result.output assert "total: items=0 tags_added=0 capped_wide=0" in result.output
mc_anchors.assert_not_called() mc_anchors.assert_not_called()
mc_chunks.assert_not_called() mc_chunks.assert_not_called()
mc_apply.assert_not_called() mc_apply.assert_not_called()