CLI: make --changed-only non-git feedback unambiguous #36

Closed
opened 2026-05-12 08:04:29 +02:00 by codex · 0 comments
Collaborator

Source

Triaged from DeepSeek v4 Pro audit via #35.

Problem

--changed-only is a deprecated alias for --since HEAD~1. In a non-Git workspace, current behavior can surface both:

  • changed-only-deprecated
  • since-not-available-non-git

That is technically explainable but operator-hostile. The user asked for --changed-only; the actionable message should say that diff-scoped analysis cannot be applied outside Git and that full analysis was used. The deprecation notice can be secondary or omitted in that path.

Current references

  • src/pyfallow/cli.py around _apply_cli_config()
  • Existing tests currently lock the dual-warning behavior in tests/test_pyfallow.py
  • README says --changed-only remains deprecated and --since is preferred

Target behavior

For --changed-only inside a Git workspace:

  • Keep the deprecation path toward --since HEAD~1.

For --changed-only outside a Git workspace:

  • Emit one primary warning/error-like analysis warning explaining that changed-only analysis could not be applied and full analysis was used.
  • Avoid making the operator reconcile a deprecated-alias warning with a non-Git fallback warning.
  • Keep exit behavior compatible with existing analyze flow unless a stricter failure mode already applies.

Acceptance criteria

  • Add or update regression tests for non-Git --changed-only JSON output and stderr/debug behavior.
  • Tests assert the exact warning code policy so this UX does not drift again.
  • Existing --since behavior remains unchanged.
  • Existing Git-workspace --changed-only compatibility remains unchanged or is explicitly documented if changed.
  • README/docs remain honest about --changed-only being deprecated.

Out of scope

  • Removing --changed-only entirely.
  • Changing diff algorithm semantics.
  • Implementing new changed-only modes.
## Source Triaged from DeepSeek v4 Pro audit via #35. ## Problem `--changed-only` is a deprecated alias for `--since HEAD~1`. In a non-Git workspace, current behavior can surface both: - `changed-only-deprecated` - `since-not-available-non-git` That is technically explainable but operator-hostile. The user asked for `--changed-only`; the actionable message should say that diff-scoped analysis cannot be applied outside Git and that full analysis was used. The deprecation notice can be secondary or omitted in that path. ## Current references - `src/pyfallow/cli.py` around `_apply_cli_config()` - Existing tests currently lock the dual-warning behavior in `tests/test_pyfallow.py` - README says `--changed-only` remains deprecated and `--since` is preferred ## Target behavior For `--changed-only` inside a Git workspace: - Keep the deprecation path toward `--since HEAD~1`. For `--changed-only` outside a Git workspace: - Emit one primary warning/error-like analysis warning explaining that changed-only analysis could not be applied and full analysis was used. - Avoid making the operator reconcile a deprecated-alias warning with a non-Git fallback warning. - Keep exit behavior compatible with existing analyze flow unless a stricter failure mode already applies. ## Acceptance criteria - Add or update regression tests for non-Git `--changed-only` JSON output and stderr/debug behavior. - Tests assert the exact warning code policy so this UX does not drift again. - Existing `--since` behavior remains unchanged. - Existing Git-workspace `--changed-only` compatibility remains unchanged or is explicitly documented if changed. - README/docs remain honest about `--changed-only` being deprecated. ## Out of scope - Removing `--changed-only` entirely. - Changing diff algorithm semantics. - Implementing new changed-only modes.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pdurlej/fallow-py#36
No description provided.