Repository navigation
Description
Summary
Follow-up to #5084 (fixed in 0.9.106 via #5116). The CLI flag --no-doc-demotion works, but the .graphifyrc key demote_docs=false (and the alias query_demote_docs) has no effect. graphify query reads the key from the loaded settings, but the rc parser never puts it there. The parser also drops unknown keys without a warning, so the user cannot see that the setting was ignored.
Version: graphifyy 0.9.112 (PyPI), Python 3.12, macOS.
Cause
graphify/cli.py (query, around L2286) reads the key from the parsed settings:
effective_demote_docs = (
demote_docs_flag
if demote_docs_flag is not None
else project_settings.get("demote_docs", project_settings.get("query_demote_docs", True))
)But graphify/rcfile.py load_graphifyrc() only stores viz_node_limit, query_budget, query_depth and language.*. Any other key is skipped without an error or a warning, so project_settings never contains demote_docs and the default (True) always wins.
Reproduction (minimal, 3 files)
mkdir repro && cd repro && mkdir docs
cat > docs/retry-policy.md <<'EOF'
# Retry policy
Payment retries use exponential backoff with jitter. The retry budget is three attempts.
## Backoff schedule
The first retry waits 200 ms, then 400 ms, then 800 ms.
EOF
cat > docs/idempotency.md <<'EOF'
# Idempotency keys
Every payment request carries an idempotency key so a retry never charges twice.
EOF
cat > client.py <<'EOF'
class PaymentClient:
def send(self, payload):
return self.retry(payload)
def retry(self, payload):
return payload
EOF
python -m graphify update .
Q='how does payment retry backoff work'
python -m graphify query "$Q" --budget 400 > default.txt
printf 'demote_docs=false\n' > .graphifyrc
python -m graphify query "$Q" --budget 400 > rc.txt
python -c "from graphify.rcfile import load_graphifyrc; from pathlib import Path; print(load_graphifyrc(Path('.')))"
rm .graphifyrc
python -m graphify query "$Q" --budget 400 --no-doc-demotion > flag.txt
cmp -s default.txt rc.txt && echo "default == rc" || echo "default != rc"
cmp -s default.txt flag.txt && echo "default == flag" || echo "default != flag"Actual
{} <- load_graphifyrc() with demote_docs=false
default == rc <- the rc key changes nothing
default != flag <- the CLI flag works
The start line shows the difference:
default / rc : Start: ['PaymentClient', 'Backoff schedule', 'Retry policy', '.retry()']
flag : Start: ['Backoff schedule', 'PaymentClient', 'Retry policy', '.retry()']
Expected
demote_docs=false in .graphifyrc gives the same result as --no-doc-demotion, as described in #5084 ("the demote_docs rc key"). Optionally, the parser warns about an unknown key instead of dropping it silently.
Impact
On a markdown-first corpus (the case in #5084), the flag is the only working switch. Every caller (agent instructions, scripts, hooks) has to add the flag to each query. A project-level default was the reason for having the rc key. We measured this on a ~35k-node mostly-markdown graph with 20 questions that each have a known answer page: default 8/20, .graphifyrc demote_docs=false 8/20, --no-doc-demotion 10/20 (same build, 2 runs each, no variance).
Suggested fix
In load_graphifyrc(), parse demote_docs / query_demote_docs as a boolean (true/false/1/0/yes/no) and store it in cfg. A unit test along these lines would cover it: load_graphifyrc on a file with demote_docs=false returns {"demote_docs": False}.
Activity
github-actions commentedon Nov 17, 2026
Thanks for opening this issue, @yeochul-jeon. A maintainer will take a look soon.
If you would like to discuss it in real time, come say hi on our Discord server. For longer-form questions and ideas there is also GitHub Discussions.
To help us triage, please make sure the report includes what you expected, what actually happened, and the steps (and a small sample) to reproduce it.
fix(rcfile): parse demote_docs and query_demote_docs from .graphifyrc