Repository navigation
fix(rcfile): parse demote_docs and query_demote_docs from .graphifyrc - #5299
debojyoti10CC wants to merge 1 commit into
Conversation
load_graphifyrc() dropped both keys, so graphify query always used the default (demote docs) and only --no-doc-demotion worked. Parse them as booleans (true/false, 1/0, yes/no, on/off) and raise a line-numbered ValueError on anything else, like the other recognized keys. Document the setting in the README. Fixes Graphify-Labs#5290 Co-Authored-By: Claude <noreply@anthropic.com>
|
Thanks for the pull request, @debojyoti10CC. 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.11 and 3.13, and that the change keeps extraction deterministic. |
There was a problem hiding this comment.
Graphify code review 
Review completed · bdea373d2723
Tip
Merge confidence: 5/5 · Looks safe to merge · 🟠 High impact
No issues reported
The .graphifyrc parser now converts demote_docs and query_demote_docs values into booleans.
Full summary
The .graphifyrc parser now converts demote_docs and query_demote_docs values into booleans. The query command uses these project defaults unless a command-line option overrides them.
What this review covered
- We didn't review 1 file that isn't source code, such as docs, config, images, or generated or third-party code.
- 2 of 2 changed files inspected. This is scope, not a correctness guarantee.
Code graph and static checks · 5234 functions depend on this change
Impact & health
Impact — 5234 functions depend on the 108 functions this change touches.
Health — this change adds coupling hotspots:
- worse:
load_graphifyrc()— 17 callers, 3 callees - worse:
Repo— 4 callers, 4 callees
Formal checks — 5234 functions this change can affect weren't formally checked in this review. Formal checks are informational only.
Gate & verification
✅ PASS — objectively clean (no health regressions, tests not run — proofs not run this pass (advisory)). Grounded, not self-assessed.
Advisory (not blocking):
- verification_scope: 2256 function(s) in the blast radius were not formally verified this run
Test selection
593 of 593 test file(s) selected (100%) via static blast radius.
Escalated to a full run for safety (
noncode-change,uncovered-code) — the selection is not trustworthy on its own (see below). CI should run the whole suite.
tests/pi.test.ts— full-run-safetytests/test_4874_jvm_resolution.py— impact, full-run-safetytests/test_4909_reference_binding_scale.py— impact, full-run-safetytests/test_4978_reconcile_cost.py— impact, full-run-safetytests/test_4992_ts_import_types.py— impact, full-run-safetytests/test_5072_splittable_under_cap_retry.py— full-run-safetytests/test_affected_cli.py— full-run-safetytests/test_affected_defines.py— full-run-safetytests/test_affected_member_seed.py— full-run-safetytests/test_affected_overrides.py— full-run-safetytests/test_affected_path_file_node.py— full-run-safetytests/test_affected_seed_reference_forms.py— full-run-safetytests/test_agents_platform.py— full-run-safetytests/test_alias_folding.py— impact, full-run-safetytests/test_analyze.py— impact, full-run-safetytests/test_anthropic_custom_endpoint.py— full-run-safetytests/test_antigravity_install.py— full-run-safetytests/test_apm_fallback_version.py— full-run-safetytests/test_architecture_doc.py— full-run-safetytests/test_astro_extraction.py— impact, full-run-safetytests/test_astro_import_ids.py— full-run-safetytests/test_atomic_canvas_export.py— full-run-safetytests/test_atomic_version_stamp.py— full-run-safetytests/test_atomic_writes.py— impact, full-run-safetytests/test_backend_env_isolation.py— full-run-safetytests/test_backend_extras.py— full-run-safetytests/test_backend_opt_in.py— full-run-safetytests/test_benchmark.py— full-run-safetytests/test_benchmark_raw_graph.py— full-run-safetytests/test_benchmark_real_query.py— full-run-safetytests/test_binary_media_words.py— impact, full-run-safetytests/test_blade_extractor.py— full-run-safetytests/test_build.py— impact, full-run-safetytests/test_build_located_semantic_identity.py— impact, full-run-safetytests/test_build_merge_dedup_scope.py— impact, full-run-safetytests/test_build_merge_ghost_fold_4955.py— impact, full-run-safetytests/test_build_merge_hyperedges_and_prune.py— impact, full-run-safetytests/test_build_merge_shrink_guard.py— impact, full-run-safetytests/test_builtin_global_type_refs.py— full-run-safetytests/test_c_include_resolution.py— impact, full-run-safetytests/test_cache.py— full-run-safetytests/test_cache_long_paths.py— full-run-safetytests/test_cache_stale_import_target.py— full-run-safetytests/test_cache_windows_case_4925.py— full-run-safetytests/test_callflow_html.py— full-run-safetytests/test_cargo_introspect.py— full-run-safetytests/test_cargo_missing_manifest.py— full-run-safetytests/test_carried_hyperedge_remap.py— impact, full-run-safetytests/test_case_only_decl_ids_4904.py— full-run-safetytests/test_case_sensitive_resolution.py— full-run-safety- … and 543 more
⚠️ non-code file(s) changed (README.md) → running the full suite for safety (a code graph can't see config/fixture/data deps)
⚠️ changed code file(s) with no mapped test (README.md) — a coverage gap or a missing link — running the full suite rather than only the selected tests
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.
Every flagged function
load_graphifyrc()ingraphify/rcfile.py:122· 17 callers, 3 callees: 17 callers depend on it (afferent coupling)Repointests/test_hooks_rewrite.py:20· 4 callers, 4 callees: high coupling complexity (Ca·Ce = 16)
What does this PR do?
demote_docs=false(and thequery_demote_docsalias) in.graphifyrcwas silently ignored.cli.pyreads both keys from the loaded project settings, butload_graphifyrc()never stored them, sographify queryalways fell back to the default (docs demoted) and only--no-doc-demotionworked. Before the change,load_graphifyrcreturned{}for a file containingdemote_docs=false.The fix parses both keys as booleans (
true/false,1/0,yes/no,on/off, case-insensitive) inrcfile.py. Anything else raises the same line-numberedValueErroras the other recognized keys; the query command already turns that into a stderr warning. I also added a short README paragraph next to the other query defaults. I left the unknown-key warning suggested in the issue out of this PR to keep it to one concern.Fixes #5290
Type of change
Verification & Invariants
Invariant: every
.graphifyrckey thatcli.pyreads from project settings is produced byload_graphifyrc().rcfile.pychange)How was this tested?
Graphify-specific checklist
Co-Authored-By: Claude <noreply@anthropic.com>