Current behavior
_command_stale (src/hflow/cli.py:268) prints stale episode URIs and always returns 0 (src/hflow/cli.py:318), regardless of how many episodes are behind the current pipeline version. That means hflow stale cannot gate a CI job or a pre-training checklist, while hflow doctor already exits 1 on findings.
Proposed change
Add an --exit-code flag (named after git diff --exit-code): when passed, exit 1 if any stale episode was printed. Keep the default at 0 so existing pipes keep working (docs/CATALOG.md documents piping the output into xargs hflow ingest).
Definition of done
hflow stale --exit-code ... exits 1 when at least one stale episode exists and 0 when none do.
- Without the flag, behavior is unchanged.
- Test with the existing catalog fixtures in
tests/test_catalog_curation.py.
Validation
uv run pytest -q
uv run ruff check --fix && uv run ruff format
uv run ty check
Current behavior
_command_stale(src/hflow/cli.py:268) prints stale episode URIs and always returns 0 (src/hflow/cli.py:318), regardless of how many episodes are behind the current pipeline version. That meanshflow stalecannot gate a CI job or a pre-training checklist, whilehflow doctoralready exits 1 on findings.Proposed change
Add an
--exit-codeflag (named aftergit diff --exit-code): when passed, exit 1 if any stale episode was printed. Keep the default at 0 so existing pipes keep working (docs/CATALOG.mddocuments piping the output intoxargs hflow ingest).Definition of done
hflow stale --exit-code ...exits 1 when at least one stale episode exists and 0 when none do.tests/test_catalog_curation.py.Validation
uv run pytest -q uv run ruff check --fix && uv run ruff format uv run ty check