Skip to content

fix: remove unused json_output parameter from AST commands [skip-changelog] - #440

Open
EsromG wants to merge 1 commit into
geekatron:mainfrom
EsromG:fix/378-remove-unused-json-output
Open

EsromG wants to merge 1 commit into
geekatron:mainfrom
EsromG:fix/378-remove-unused-json-output

Conversation

@EsromG

@EsromG EsromG commented Nov 8, 2026

Copy link
Copy Markdown

Description

Removes the unused json_output parameter from ast_parse and ast_query, along with its forwarding through _handle_ast.

Both AST commands already produce JSON output regardless of the global --json flag, so the parameter is unnecessary. This change preserves existing CLI behavior and leaves the global flag available to other commands.

The implementation also updates two existing routing tests and adds three regression tests that guard against reintroducing the unused parameter.

Before the fix

  • All three new signature regression tests failed, confirming that json_output was present in ast_parse, ast_query, and _handle_ast.
  • ast parse and ast query produced identical stdout with and without --json.

After the fix

  • Three signature regression tests passed.
  • 171 targeted AST unit and integration tests passed.
  • make lint passed (Ruff and Pyright).
  • Ruff formatting checks passed.
  • CLI output comparisons passed: both commands continued producing byte-identical stdout with and without --json, and their output matched the original implementation.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Documentation update
  • Refactoring (code improvement without functional change)
  • Other (please describe):

Checklist

  • Tests pass locally
  • No credentials or sensitive information committed
  • Relevant documentation has been updated
  • Code has been self-reviewed

Related Issues

Fixes #378

Notes

Testing limitation: The full repository test suite did not pass locally. Before the fix, it reported 16,776 passed, 160 skipped, and three failures. During the pre-commit run, it reported 16,825 passed, 186 skipped, and six failures. Five of the latter involved local-only AI301 Markdown files; the remaining failure was a filesystem timeout while scanning a MacDroid-connected directory.

I used the repository's documented SKIP=pytest option for the commit. The other applicable pre-commit checks passed, and the targeted AST tests passed independently.

Pre-push security scan: The pip-audit hook reported CVE-2026-114613 in the locked development dependency msgpack 1.2.1, with version 1.2.3 listed as a fix. The dependency is pulled in through pip-audit and cachecontrol, not through the AST commands changed by this PR. I used SKIP=pip-audit to push the branch without modifying the project's dependency lockfile. This vulnerability remains unresolved and should be addressed separately.

AI assistance: I used Claude Code to investigate the affected CLI functions, draft a scoped implementation plan, add regression tests, and help implement the change. I reviewed the changes and verified them using pytest, Ruff, Pyright, and command-line output comparisons.

This branch has not been deployed

No deployments
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.

jerry ast parse/query: json_output param is dead code (--json is a no-op; output always JSON)

1 participant