Skip to content

fix(rcfile): parse demote_docs and query_demote_docs from .graphifyrc - #5299

Open
debojyoti10CC wants to merge 1 commit into
Graphify-Labs:v8from
debojyoti10CC:fix/rcfile-demote-docs
Open

debojyoti10CC wants to merge 1 commit into
Graphify-Labs:v8from
debojyoti10CC:fix/rcfile-demote-docs

Conversation

@debojyoti10CC

Copy link
Copy Markdown

What does this PR do?

demote_docs=false (and the query_demote_docs alias) in .graphifyrc was silently ignored. cli.py reads both keys from the loaded project settings, but load_graphifyrc() never stored them, so graphify query always fell back to the default (docs demoted) and only --no-doc-demotion worked. Before the change, load_graphifyrc returned {} for a file containing demote_docs=false.

The fix parses both keys as booleans (true/false, 1/0, yes/no, on/off, case-insensitive) in rcfile.py. Anything else raises the same line-numbered ValueError as 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

  • Bug fix

Verification & Invariants

Invariant: every .graphifyrc key that cli.py reads from project settings is produced by load_graphifyrc().

  • Read CONTRIBUTING.md
  • Reproduced the issue and identified the invariant
  • Smallest fix necessary
  • Regression test added (the 8 new tests fail without the rcfile.py change)
  • Description matches the final implementation
  • Limitations documented: unknown keys are still ignored without a warning

How was this tested?

uv run pytest tests/test_language_overrides.py tests/test_query_cli.py tests/test_cli_help.py -q
150 passed, 2 skipped
uv run ruff check graphify tests
All checks passed!
(without the rcfile.py change: tests/test_language_overrides.py -> 8 failed, 69 passed)

Graphify-specific checklist

  • No skill source fragments touched, so no skillgen bless needed
  • Extraction is unaffected
  • No shell/Python interpolation added
  • No keys or local graph data included
  • AI authorship disclosed: Claude helped write this change, and the commit carries Co-Authored-By: Claude <noreply@anthropic.com>

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>
@github-actions

Copy link
Copy Markdown

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.

@graphify-labs graphify-labs Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Graphify code review View in Graphify

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-safety
  • tests/test_4874_jvm_resolution.py — impact, full-run-safety
  • tests/test_4909_reference_binding_scale.py — impact, full-run-safety
  • tests/test_4978_reconcile_cost.py — impact, full-run-safety
  • tests/test_4992_ts_import_types.py — impact, full-run-safety
  • tests/test_5072_splittable_under_cap_retry.py — full-run-safety
  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_defines.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_affected_overrides.py — full-run-safety
  • tests/test_affected_path_file_node.py — full-run-safety
  • tests/test_affected_seed_reference_forms.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_alias_folding.py — impact, full-run-safety
  • tests/test_analyze.py — impact, full-run-safety
  • tests/test_anthropic_custom_endpoint.py — full-run-safety
  • tests/test_antigravity_install.py — full-run-safety
  • tests/test_apm_fallback_version.py — full-run-safety
  • tests/test_architecture_doc.py — full-run-safety
  • tests/test_astro_extraction.py — impact, full-run-safety
  • tests/test_astro_import_ids.py — full-run-safety
  • tests/test_atomic_canvas_export.py — full-run-safety
  • tests/test_atomic_version_stamp.py — full-run-safety
  • tests/test_atomic_writes.py — impact, full-run-safety
  • tests/test_backend_env_isolation.py — full-run-safety
  • tests/test_backend_extras.py — full-run-safety
  • tests/test_backend_opt_in.py — full-run-safety
  • tests/test_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_benchmark_real_query.py — full-run-safety
  • tests/test_binary_media_words.py — impact, full-run-safety
  • tests/test_blade_extractor.py — full-run-safety
  • tests/test_build.py — impact, full-run-safety
  • tests/test_build_located_semantic_identity.py — impact, full-run-safety
  • tests/test_build_merge_dedup_scope.py — impact, full-run-safety
  • tests/test_build_merge_ghost_fold_4955.py — impact, full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — impact, full-run-safety
  • tests/test_build_merge_shrink_guard.py — impact, full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_c_include_resolution.py — impact, full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_cache_long_paths.py — full-run-safety
  • tests/test_cache_stale_import_target.py — full-run-safety
  • tests/test_cache_windows_case_4925.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_cargo_missing_manifest.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — impact, full-run-safety
  • tests/test_case_only_decl_ids_4904.py — full-run-safety
  • tests/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() in graphify/rcfile.py:122 · 17 callers, 3 callees: 17 callers depend on it (afferent coupling)
  • Repo in tests/test_hooks_rewrite.py:20 · 4 callers, 4 callees: high coupling complexity (Ca·Ce = 16)

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.

[Bug]: .graphifyrc demote_docs is silently ignored — rc parser drops the key, only --no-doc-demotion works (follow-up to #5084)

1 participant