Repository navigation
fix(cli): support equals-syntax and safe float validation for provider pricing flags - #5031
Adityakk9031 wants to merge 1 commit into
Conversation
|
Thanks for the pull request, @Adityakk9031. A maintainer will review it soon. Want to talk it through while it is in review? Come join us on our Discord server. For longer-form discussion there is also GitHub Discussions. A couple of things that speed up review: make sure the test suite passes on Python 3.10 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify reviewed this change.
No issues found by static checks — no coupling regressions or blocking issues in the code graph. That is not the same as safe to merge: see what was not checked.
Not checked: tests were not run; formal verification proved 0 of 1 changed function(s) (1 not verified).
Formal verification. PR-changed functions: 0/1 verified (0 proven, 0 may-equivalent, 0 distinguished) · 1 not verified (1 vacuous).
Not verified on this run: dispatch\_command (vacuous: never exercised).
Graphify review — findings
Fixes graphify provider add so --pricing-input and --pricing-output also accept the --flag=VALUE form, which was previously ignored. A non-numeric value now prints a clear error and exits 1 instead of crashing with a ValueError traceback. The parsing only rejects unparseable floats, so values like nan, inf and negatives still pass through into the stored pricing.
No blocking issues surfaced.
Analysis details — impact, health, verification
Impact & health
Graphify review
Impact — 481 functions depend on the 114 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
dispatch_command()— 7 callers, 146 callees
Verification — 481 functions in the blast radius were not formally verified this run (proofs are advisory here).
Gate & verification
graphify gate
PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 421 function(s) in the blast radius were not formally verified this run
Test selection
Test selection
45 of 526 test file(s) selected (9%) via static blast radius.
tests/test_affected_cli.py— impacttests/test_affected_seed_reference_forms.py— impacttests/test_agents_platform.py— impacttests/test_cli_export.py— impacttests/test_cloud_cta.py— impacttests/test_codebuddy.py— impacttests/test_compact_graph_json.py— impacttests/test_confidence_score_output.py— impacttests/test_dedup_shrink_refuses_force_write.py— impacttests/test_devin.py— impacttests/test_edge_also_seen.py— impacttests/test_explain_cli.py— impacttests/test_explain_same_file_tie.py— impacttests/test_extract_cli.py— impacttests/test_extract_cost_ledger.py— impacttests/test_global_add_tag_inference.py— impacttests/test_god_nodes_cli.py— impacttests/test_hollow_chunks_arm_shrink_guard.py— impacttests/test_hook_content_freshness.py— impacttests/test_hook_guard_token_match.py— impacttests/test_hook_nudge_wording.py— impacttests/test_hook_out_of_project_paths.py— impacttests/test_hook_strict.py— impacttests/test_hook_strict_grep.py— impacttests/test_incomplete_build_guard.py— impacttests/test_install.py— impacttests/test_install_references.py— impacttests/test_lookup_exit_codes.py— impacttests/test_merge_chunks_validation.py— impacttests/test_multigraph_diagnostics.py— impacttests/test_no_dedup_flag.py— impacttests/test_opencode_plugin_refresh.py— impacttests/test_partial_cache.py— impacttests/test_path_cli.py— impacttests/test_path_confidence.py— impacttests/test_path_type_member.py— impacttests/test_provider_registry.py— impact, changed-testtests/test_query_cli.py— impacttests/test_query_induced_edges.py— impacttests/test_query_seeds.py— impacttests/test_search_hook_scope.py— impacttests/test_skill_auto_refresh.py— impacttests/test_stale_prune.py— impacttests/test_truncation_full_answer.py— impacttests/test_unverified_semantic_shrink.py— impact
Selection is safe under the controlled-regression assumption; always-run tests + a periodic full run are the backstops. Advisory — it never changes the check verdict.
Formal verification
Could not verify: Could not verify dispatch\_command.
The verifier did not have enough to check dispatch\_command, so it is saying so rather than guessing. No false assurance is the whole point.
Guarantee: No guarantee either way, this is an honest abstention, not a pass.
Note: Reason: no capturable inputs from the test suite; property tier: not verifiable: all 40 sampled inputs raised on both versions — the function never executed, so 'no divergence' would be vacuous (mostly SystemExit — names the real obstacle, not a sampling gap)
· 1 more finding(s) on lines outside this diff (see the check run).
…w-up) The landed fix caught a non-numeric price but still accepted nan, inf and negative values, which parse as floats and then flow into cost estimation as NaN/inf/negative. Validate each --pricing-input/--pricing-output through _valid_price (finite and >= 0) with the same clean error + exit(1), and test that nan/inf/-inf/1e999/-5 are rejected. Co-Authored-By: Claude Opus 4.8 <[email protected]>
|
Landed on |
Summary
In
graphify/cli.pyundergraphify provider add:--base-url=,--default-model=, and--env-key=supported--flag=valsyntax, but--pricing-inputand--pricing-outputonly supported--pricing-input <val>and silently ignored--pricing-input=<val>.--pricing-inputor--pricing-outputraised an unhandledValueErrortraceback instead of an informative error message on stderr with exit code 1.Changes
graphify/cli.py(dispatch_command):--pricing-input=and--pricing-output=.try/except ValueErrorparsing with clean error messages printed tosys.stderrandsys.exit(1).tests/test_provider_registry.py:test_dispatch_command_provider_add_with_pricing_equals.test_dispatch_command_provider_add_invalid_pricing_float.Test Plan
pytest tests/test_provider_registry.py-> 10 passed.