Repository navigation
Description
Summary
detect() silently excludes any file whose name or full path contains token, secret, credential, passwd, password, or private_key — as a bare substring, with no word boundaries and no regard for file type.
In a markdown knowledge base this drops ordinary prose articles. Three files in my corpus had never been in the graph across many runs:
wiki/ai-token-economics.md <- a heavily-linked hub node
wiki/privacy-tokens.md
wiki/chain-of-hope-tokenomics.md
The exclusion is invisible in normal use: the paths land in skipped_sensitive, but the /graphify skill flow only reports a count ("mention file count skipped, not the file names"), so nothing tells you which files vanished or why. I only found it by diffing the manifest against ls wiki/.
Source
graphify/detect.py (v0.4.23):
_SENSITIVE_PATTERNS = [
...
re.compile(r'(credential|secret|passwd|password|token|private_key)', re.IGNORECASE), # L36
...
]
def _is_sensitive(path: Path) -> bool:
name = path.name
full = str(path)
return any(p.search(name) or p.search(full) for p in _SENSITIVE_PATTERNS)Because full = str(path) is also tested, one directory named e.g. secrets/ or password-reset/ silently removes an entire subtree from the corpus.
Reproduce
from pathlib import Path
from graphify.detect import _is_sensitive
_is_sensitive(Path("notes/ai-token-economics.md")) # True (expected False)
_is_sensitive(Path("docs/password-reset-design.md")) # True (expected False)
_is_sensitive(Path("research/tokenization.md")) # True (expected False)Second-order bug: --update then deletes the recovered nodes
This is the part that cost me the most time. If you work around the filter by force-including the files (so they appear in graphify-out/manifest.json), the next --update is destructive:
detect_incremental() still excludes them, so comparing against the manifest reports them as deleted_files, and the merge step runs G_existing.remove_nodes_from(...) — silently pruning ~70 nodes that had just been recovered. So the workaround makes the next incremental run worse than no workaround at all.
Suggested fix
Exempt markdown-family extensions from the broad keyword pattern only, keeping every strict pattern (.env, .pem, id_rsa, .netrc, aws_credentials, …) applying to all files:
_PROSE_EXTS = {".md", ".markdown", ".rst", ".org"}
_KEYWORD_PATTERN = re.compile(
r'(credential|secret|passwd|password|token|private_key)', re.IGNORECASE)
def _is_sensitive(path: Path) -> bool:
name, full = path.name, str(path)
is_prose = path.suffix.lower() in _PROSE_EXTS
for p in _SENSITIVE_PATTERNS:
if is_prose and p.pattern == _KEYWORD_PATTERN.pattern:
continue
if p.search(name) or p.search(full):
return True
return FalseReal secrets live in dotfiles, keys and configs — not in .md notes. I deliberately left .txt guarded, since token.txt / access_token.txt are plausible credential dumps.
Verified against my corpus: 98 -> 101 documents detected, skipped_sensitive empty, and all of .env / .env.local / *.pem / secrets.json / api_token.json / credentials.yaml / id_rsa / .netrc / aws_credentials / token.txt still correctly blocked.
Two smaller things that would have made this self-diagnosing:
- Match on the filename only, not the full path — or at least only the path segment(s) below the corpus root. A parent directory name shouldn't silently disqualify a subtree.
- Name the skipped files (behind a flag if you like). A bare count reads as "nothing important happened".
Happy to open a PR if the approach looks right.
Activity
fix(detect): stop the sensitive-file filter from dropping topic docs …
fix(skillgen): skill flow lists skipped-sensitive filenames, not just…
docs: changelog for #2106 (0.9.24)
fix(skillgen): commit rendered skill artifacts for the #2106 traceabi…
safishamsi commentedon Jul 22, 2026
Fixed in v0.9.24. The sensitive-file filter no longer silently drops topic docs or real source: service_account/aws_credentials moved to the boundary-checked keyword path (real source spared, downloaded key files still excluded), a prose-note carve-out was added, and missed secret dotfiles (.npmrc, .pypirc, .git-credentials, secring, case variants) are now caught.
graphify extractand the skill flow also name the skipped files instead of only a count. https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.24Merge upstream/v8 into v8-custom (0.9.24 -> 0.9.25)
psoholt commentedon Jul 23, 2026
Upgraded 0.4.23 → 0.9.25 and can confirm this is fixed. Thanks for the thorough rewrite — the three-stage split is a better fix than the extension-exemption I suggested.
Verified on my corpus (100+ markdown wiki articles):
ai-token-economics.md,privacy-tokens.md,chain-of-hope-tokenomics.mdnow detected;skipped_sensitiveis empty..env,.env.local,*.pem,secrets.json,api_token.json,credentials.yaml,id_rsa,.netrc,token.txt,access_token.txt— plus.npmrcand.git-credentials, which the old code let through.--updateproblem is gone too:detect_incrementalagainst a pre-upgrade manifest (relative paths) reported 0 deletions, so no nodes were pruned. The relative→absolute path change was handled transparently.Two notes for anyone else upgrading across this range:
detect()now returns absolute paths and gainedgitignore=True, and 0.9.x classifies some config/CI files (.mcp.json,.github/**) as corpus, so you may want to extend.graphifyignore. Both were easy to absorb — every function signature change was additive.Squashed commit of the following:
fix(detect): stop the sensitive-file filter from dropping topic docs …
fix(skillgen): skill flow lists skipped-sensitive filenames, not just…
docs: changelog for Graphify-Labs#2106 (0.9.24)
fix(skillgen): commit rendered skill artifacts for the Graphify-Labs#…
llm: enforce GRAPHIFY_NO_LLM in _call_llm and label_communities; judg…