Skip to content

Replace cmd2 REPL tests with prompt-toolkit coverage#83

Merged
sodejm merged 1 commit into
mainfrom
codex/remove-cmd2-tests-and-add-prompt-toolkit-coverage
Jul 22, 2026
Merged

Replace cmd2 REPL tests with prompt-toolkit coverage#83
sodejm merged 1 commit into
mainfrom
codex/remove-cmd2-tests-and-add-prompt-toolkit-coverage

Conversation

@sodejm

@sodejm sodejm commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Motivation

  • Remove tests that depended on the removed cmd2 legacy console and provide equivalent coverage against the prompt-toolkit/Rich REPL surface.
  • Ensure the CLI preserves the one-shot behavior and the established modules list --json schema when invoked from the interactive REPL.
  • Reject the legacy --legacy-console flag with a stable error so callers are directed to the prompt-toolkit REPL.

Description

  • Replace the --legacy-console code path in main() with a stable rejection that emits AncestryError("LEGACY_CONSOLE_UNAVAILABLE", ...) and returns exit code 2, preventing the old cmd2 console from being started (file: src/ancestryllm/cli.py).
  • Normalize REPL invocations in parse_repl_invocation so a trailing --json supplied in the REPL is moved to the global position before parsing, preserving the one-shot parser contract and JSON output semantics (file: src/ancestryllm/console/parser.py).
  • Remove the cmd2-dependent test module tests/modular/test_console_security.py and expand tests/modular/test_repl_shell.py to cover prompt-toolkit behavior for: secure history and secret handling, no-argument REPL startup, rejection of --legacy-console, preservation of one-shot command dispatch, and modules list --json schema preservation (file: tests/modular/test_repl_shell.py).
  • Minor formatting/linting adjustments applied to the updated test file to satisfy repository style checks.

Testing

  • Ran environment setup with make setup and linting with make lint, both completed successfully.
  • Executed the focused test set with pytest for the modified REPL/history/parser specs using the venv Python, specifically tests/modular/test_repl_shell.py, tests/modular/test_repl_history.py, tests/modular/test_repl_router.py, and tests/modular/test_command_specs.py, and those tests passed (39 passed).
  • Ran make typecheck which reported no issues.
  • Ran the full test suite (make test) in this environment and observed unrelated failures due to sqlite3.Connection.enable_load_extension being unavailable on the platform Python (affecting existing RootsMagic tests), not caused by these changes.

Codex Task

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@sodejm
sodejm force-pushed the codex/remove-cmd2-tests-and-add-prompt-toolkit-coverage branch from 2a2b2ca to fb6def7 Compare July 22, 2026 01:34
@sodejm
sodejm merged commit 1968ed3 into main Jul 22, 2026
5 checks passed
@sodejm
sodejm deleted the codex/remove-cmd2-tests-and-add-prompt-toolkit-coverage branch July 22, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant