Skip to content

Consolidate jabs-project-merge and jabs-features into jabs-cli (KLAUS-566) - #423

Merged
gbeane merged 3 commits into
mainfrom
cli-command-consolidation
Aug 7, 2026
Merged

Consolidate jabs-project-merge and jabs-features into jabs-cli (KLAUS-566)#423
gbeane merged 3 commits into
mainfrom
cli-command-consolidation

Conversation

@gbeane

@gbeane gbeane commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Jira: KLAUS-566

Consolidates two standalone scripts into jabs-cli. Each change is its own commit.

jabs-project-mergejabs-cli merge

The standalone script and its jabs-project-merge entry point are removed; the logic now lives in src/jabs/scripts/cli/merge_projects.py as a Click command. rich-argparse is dropped as a dependency since that script was its only consumer.

Behavior differences worth reviewing:

  • --merge-strategy is still required, but the old unreachable default="destination-wins" (and its misleading "(default: destination-wins)" help text) is gone.
  • Project validation now uses Project.is_valid_project_directory(), which checks for both jabs/ and jabs/project.json, instead of only jabs/. The same-project guard compares resolved paths, so ./proj vs proj is now caught.
  • Errors surface as Click's Error: ... on stderr (exit 1) rather than the previous rich-formatted ERROR: block.

jabs-featuresjabs-cli compute-features

jabs-cli compute-features already existed, and jabs-features already printed a deprecation warning — but it still carried a duplicate argparse parser and its own feature-computation implementation. It is now a thin shim: it keeps the legacy argument surface, warns on stderr, translates the options, and runs compute-features. The duplicated generate_feature_cache() is deleted. The jabs-features entry point stays installed.

The two option surfaces don't line up 1:1, so the shim translates:

  • --pose-version was required by the legacy script, so a verbatim passthrough would have broken every existing invocation. The shim accepts it, warns that it is ignored, and drops it — compute-features infers the version from the pose filename.
  • Legacy defaulted to pixel units with --use-cm-distances to opt in; compute-features defaults to cm-when-a-scale-exists with --use-pixel-distances to opt out. The shim forwards --use-pixel-distances when --use-cm-distances is absent, preserving the legacy default. One corner is not equivalent: legacy --use-cm-distances on a pose file with no pixel-to-cm scale forced cm settings anyway, where the new command falls back to pixel.
  • --window-size N-w N; --fps and --use-pose-hash pass through. Legacy --fps had no type=, so it forwarded a string into feature computation; the shim parses it as an int.

Docs

  • New jabs-cli merge and jabs-cli compute-features reference sections in the user guide, with the jabs-features section replaced by a deprecation note and a legacy→new option mapping table. The ## jabs-features heading is kept so existing anchors still resolve.
  • Both copies of the user guide (docs/user-guide/ and the in-app src/jabs/resources/docs/user_guide/) are updated and kept identical.
  • In-app user guide nav now points at jabs-cli > compute-features instead of the deprecated script.
  • CLAUDE.md and docs/development/development.md command lists updated; jabs-project-merge removed from the "future consolidation candidates" list in the development guide.

Testing

  • New tests/scripts/test_merge_projects_cli.py (6 tests) and tests/scripts/test_generate_features.py (7 tests).
  • Full root suite passes at both commits (884 at the first, 891 at the tip); ruff check and format clean.
  • Smoke tested jabs-features end to end against tests/data/sample_pose_est_v6.h5: per-frame and window_5 Parquet caches written for all 4 identities, and errors from the new command propagate with exit 1.

@gbeane gbeane changed the title Consolidate jabs-project-merge and jabs-features into jabs-cli Consolidate jabs-project-merge and jabs-features into jabs-cli (KLAUS-566) Aug 3, 2026
@gbeane
gbeane requested a review from Copilot August 3, 2026 16:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR consolidates legacy standalone CLI scripts into the unified jabs-cli entry point, moving project-merge functionality into a Click subcommand and turning jabs-features into a deprecation shim that forwards to jabs-cli compute-features. It updates user/developer documentation and adds test coverage for the new/changed CLI entry points.

Changes:

  • Added jabs-cli merge (Click command) and removed the standalone jabs-project-merge script + entry point.
  • Reworked jabs-features into a thin shim that warns, translates legacy args, and invokes jabs-cli compute-features.
  • Updated docs (both copies) and added new tests for merge + feature-shim behavior; removed rich-argparse dependency.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
uv.lock Removes rich-argparse from the resolved dependency set.
pyproject.toml Drops rich-argparse dependency and removes the jabs-project-merge console script entry point.
src/jabs/scripts/merge_projects.py Removes the legacy standalone merge script implementation.
src/jabs/scripts/cli/merge_projects.py Adds new Click-based jabs-cli merge subcommand.
src/jabs/scripts/cli/cli.py Registers the new merge command with the jabs-cli command group.
src/jabs/scripts/generate_features.py Converts jabs-features into a deprecation shim that forwards to compute-features.
tests/scripts/test_merge_projects_cli.py Adds tests for the new jabs-cli merge subcommand.
tests/scripts/test_generate_features.py Adds tests for legacy→new argument translation and shim behavior.
docs/user-guide/cli-tools.md Documents deprecation/mapping for jabs-features and adds sections for jabs-cli compute-features and jabs-cli merge.
src/jabs/resources/docs/user_guide/cli-tools.md Mirrors the user guide doc updates for the in-app documentation copy.
src/jabs/ui/dialogs/user_guide_dialog.py Updates in-app doc navigation to point to jabs-cli > compute-features.
docs/development/development.md Updates developer command lists and notes the completed consolidation of merge tooling.
CLAUDE.md Updates command list examples to prefer the consolidated jabs-cli subcommands.
ruff.toml Adds per-file docstring rule ignores needed for Click docstring formatting in merge_projects.py.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/scripts/test_merge_projects_cli.py
Comment thread src/jabs/ui/dialogs/user_guide_dialog.py
@gbeane gbeane self-assigned this Aug 3, 2026
@gbeane
gbeane requested review from bergsalex and keithshep August 3, 2026 16:30
@gbeane
gbeane merged commit ceeb054 into main Aug 7, 2026
5 checks passed
@gbeane
gbeane deleted the cli-command-consolidation branch August 7, 2026 00:23
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.

2 participants