Skip to content

feat(cli): deprecation-warn raw-JSON args + full flag-ops smoke coverage#736

Merged
DeusData merged 2 commits into
mainfrom
fix/deprecate-raw-json-cli
Jul 1, 2026
Merged

feat(cli): deprecation-warn raw-JSON args + full flag-ops smoke coverage#736
DeusData merged 2 commits into
mainfrom
fix/deprecate-raw-json-cli

Conversation

@DeusData

@DeusData DeusData commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Keeps raw-JSON CLI back-compat but deprecation-warns it (per request), and turns the smoke test into a full end-to-end guard for the new flag surface.

Deprecation warning (src/main.c, run_cli raw-JSON branch): cli <tool> '{...json...}' still works but prints to STDERR (stdout stays clean for piping):

warning: passing raw JSON to 'cli <tool>' is deprecated and will be removed in a
future release; use flags (run 'cli <tool> --help'), --args-file <path>, or piped stdin.

Only the raw-JSON path warns — flags / --args-file / stdin / empty don't.

Comprehensive CLI smoke coverage (scripts/smoke-test.sh) — now exercises the whole new input surface on the built binary:

  • Flag form for every tool (migrated from raw JSON, identical results verified): index_repository, search_graph (--name-pattern, --label), trace_path (--function-name --direction --depth), get_graph_schema, query_graph (all Cypher checks — flag form passes the query as one argv token, so the JSON-escaping dance is removed), get_architecture, search_code, delete_project.
  • Input-mode guards: integer flag (--limit/--depth), bare boolean (--exclude-entry-points), repeated array flag (--semantic-query send --semantic-query publish → JSON array), piped stdin, --args-file, and per-tool --help (RC 0 + shows a flag; unknown tool → RC≠0).
  • Deprecation guard: one raw-JSON call asserts the warning fires on stderr; the flag form asserts it does not.

Reproduce-first: reverting the warning fails the raw-JSON smoke assertion ("did not emit a deprecation warning"); restored → green. Full smoke-test.sh ALL PASSED; C unit suite 5735/0 (unchanged — only main.c + the smoke script changed).

Follow-up to the CLI-reliability series (#640/#680/#704/#719, + the available_projects truncation fix #735).

DeusData added 2 commits July 1, 2026 13:27
Raw JSON (cli <tool> '{...}') still works for back-compat, but now emits a
deprecation warning to STDERR (stdout stays clean JSON for piping) nudging
users to flags / --args-file / stdin. Only the raw-JSON path warns.

Also make scripts/smoke-test.sh exercise the whole new CLI input surface
end-to-end against the built binary: every tool call migrated from raw JSON to
FLAG form (index_repository / search_graph / trace_path / get_graph_schema /
query_graph incl. all Cypher checks / get_architecture / search_code /
delete_project -- flag form passes the query as one argv token, so the old
JSON-escaping dance is gone), plus dedicated guards for an integer flag
(--limit / --depth), a bare boolean (--exclude-entry-points), a repeated array
flag (--semantic-query -> JSON array), piped stdin, --args-file, and per-tool
--help (RC 0 + shows a flag; unknown tool -> RC!=0). One raw-JSON call is kept
as the deprecation guard (asserts the warning fires; the flag form asserts it
does not).

Reproduce-first: reverting the warning makes the raw-JSON smoke assertion fail
("did not emit a deprecation warning"); restored -> green. Full smoke ALL
PASSED; C unit suite 5735/0 (unchanged -- only main.c + the smoke script).

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
Companion to the raw-JSON deprecation warning committed on this branch (adds the
smoke coverage that was meant to land with it).

Migrate scripts/smoke-test.sh from raw-JSON `cli <tool> '{...}'` invocations to
FLAG form for every tool (index_repository / search_graph / trace_path /
get_graph_schema / query_graph incl. all Cypher checks / get_architecture /
search_code / delete_project), with identical results verified against a prior
run; flag form passes the Cypher query as one argv token, so the old
JSON-escaping helper is removed. Add dedicated guards for an integer flag
(--limit / --depth), a bare boolean (--exclude-entry-points), a repeated array
flag (--semantic-query -> JSON array), piped stdin, --args-file, and per-tool
--help (RC 0 + shows a flag; unknown tool -> RC!=0), plus the deprecation guard
(raw JSON warns on stderr; flag form does not). Non-CLI phases (incl. Phase 10
binary security) unchanged. Full smoke: ALL PASSED.

Signed-off-by: Martin Vogel <martin.vogel.tech@gmail.com>
@DeusData DeusData merged commit 67099fa into main Jul 1, 2026
15 checks passed
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.

1 participant