Skip to content

fix: bare plural "tokens" in a prose file is no longer treated as a secret - #3529

Closed
HARSHAVARDHAN-RAJU5 wants to merge 1 commit into
Graphify-Labs:v8from
HARSHAVARDHAN-RAJU5:fix/3527-plural-tokens-prose
Closed

HARSHAVARDHAN-RAJU5 wants to merge 1 commit into
Graphify-Labs:v8from
HARSHAVARDHAN-RAJU5:fix/3527-plural-tokens-prose

Conversation

@HARSHAVARDHAN-RAJU5

Copy link
Copy Markdown
Contributor

Summary

Fixes #3527. detect._is_sensitive was silently dropping design-token
files from the graph because "tokens" matched a generic credential
keyword.

  • The .dart/.ts cases from the original report (shell_tokens.dart,
    tokens.ts, hard-tokens.ts) are already covered by the existing
    graphable-source exemption in this version, so those pass today
    without changes.
  • The remaining gap: a bare prose file named TOKENS.md was still
    dropped, because the bare-keyword rule didn't distinguish plural
    "tokens" (a design-token reference doc) from singular "token" or
    other keywords' bare plurals (secrets.md, passwords.md), which
    correctly stay excluded.

_is_prose_note in graphify/detect.py now special-cases bare plural
"tokens" for prose extensions (.md, .rst, .org, .adoc, .tex)
as a topic word rather than a credential dump. Non-prose extensions
(tokens.txt, tokens.json) are unaffected and still excluded.

Testing

  • Added 7 regression tests in tests/test_detect.py covering the
    plural-prose exemption, the still-excluded cases (singular, other
    keywords' plurals, non-prose extensions), and the original .dart/
    .ts repro.
  • uv run pytest tests/test_detect.py — 258 passed, 11 skipped, no
    regressions.

Files changed

  • graphify/detect.py — new _BARE_PLURAL_TOKENS pattern, updated
    _is_prose_note
  • tests/test_detect.py — regression tests
  • CHANGELOG.md — unreleased entry

…ecret

TOKENS.md / tokens.md read as design-token reference docs, not credential
dumps, unlike singular "token.md" or another keyword's bare plural
("secrets.md"), which still exclude. The .dart/.ts design-token source
files from the original report are already covered by the existing
graphable-source exemption; this closes the remaining prose-note gap.

Fixes Graphify-Labs#3527

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01A6anVY9hgp5ph5qLXRmc2p

@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 reviewed this change.

Looks safe to merge — no coupling regressions and no blocking issues, checked against the code graph (not a self-assessment).

Formal verification. No changes could be formally verified in this run.


Graphify review — findings

Exempts prose notes whose stem is the bare plural tokens (e.g. TOKENS.md, tokens.rst) from the generic-keyword secret drop in _is_prose_note, treating them as design-token reference docs. Keeps singular token.md and other keywords' plurals (secrets.md, passwords.md) excluded, and scopes the exemption to prose extensions only so tokens.txt and tokens.json still read as secret stores.

No blocking issues surfaced. 3 lower-confidence candidates did not survive cross-model review.

Analysis details — impact, health, verification

Impact & health

Graphify review

Impact — 2625 functions depend on the 736 functions this change touches.

Health — this change adds coupling hotspots:

  • new: extract() — 589 callers, 44 callees
  • new: _rebuild_code() — 116 callers, 51 callees
  • new: detect() — 112 callers, 15 callees
  • new: _extract_generic() — 18 callers, 26 callees
  • new: save_manifest() — 40 callers, 11 callees
  • new: extract_files_direct() — 17 callers, 20 callees
  • new: extract_js() — 85 callers, 4 callees
  • new: extract_xaml() — 19 callers, 17 callees
  • …and 44 more — each is listed as a finding

Verification — 2625 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: 1176 function(s) in the blast radius were not formally verified this run

Test selection

Test selection

275 of 275 test file(s) selected (100%) via static blast radius.

Escalated to a full run for safety — the selection is not trustworthy on its own (see below). CI should run the whole suite.

  • tests/test_affected_cli.py — full-run-safety
  • tests/test_affected_member_seed.py — full-run-safety
  • tests/test_agents_platform.py — full-run-safety
  • tests/test_analyze.py — 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_benchmark.py — full-run-safety
  • tests/test_benchmark_raw_graph.py — full-run-safety
  • tests/test_build.py — impact, full-run-safety
  • tests/test_build_merge_dedup_scope.py — full-run-safety
  • tests/test_build_merge_hyperedges_and_prune.py — full-run-safety
  • tests/test_build_merge_shrink_guard.py — full-run-safety
  • tests/test_builtin_global_type_refs.py — full-run-safety
  • tests/test_cache.py — full-run-safety
  • tests/test_callflow_html.py — full-run-safety
  • tests/test_cargo_introspect.py — full-run-safety
  • tests/test_carried_hyperedge_remap.py — full-run-safety
  • tests/test_case_sensitive_resolution.py — full-run-safety
  • tests/test_charmap_encoding.py — impact, full-run-safety
  • tests/test_chunking.py — impact, full-run-safety
  • tests/test_cjs_module_extension.py — impact, full-run-safety
  • tests/test_claude_cli_backend.py — impact, full-run-safety
  • tests/test_claude_md.py — full-run-safety
  • tests/test_cli_broken_pipe.py — full-run-safety
  • tests/test_cli_export.py — full-run-safety
  • tests/test_cli_help.py — full-run-safety
  • tests/test_cluster.py — full-run-safety
  • tests/test_codebuddy.py — full-run-safety
  • tests/test_community_hub_labels.py — full-run-safety
  • tests/test_community_labels_skill.py — full-run-safety
  • tests/test_confidence.py — full-run-safety
  • tests/test_corrupt_graph_json.py — full-run-safety
  • tests/test_cpp_nested_and_cli.py — impact, full-run-safety
  • tests/test_cpp_objc_cross_file_calls.py — full-run-safety
  • tests/test_cpp_preprocess.py — full-run-safety
  • tests/test_cross_extension_reexport_self_cycle.py — full-run-safety
  • tests/test_cross_language_call_resolution.py — full-run-safety
  • tests/test_cross_repo_member_calls.py — full-run-safety
  • tests/test_cross_repo_shared_types.py — full-run-safety
  • tests/test_csharp_call_site_generic_args.py — full-run-safety
  • tests/test_csharp_enum_members.py — full-run-safety
  • … and 225 more

non-code file(s) changed (CHANGELOG.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 (CHANGELOG.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.

Formal verification

Could not verify: Could not verify \_is\_prose\_note.

The verifier did not have enough to check \_is\_prose\_note, 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: parameter `path` is annotated `Path` — outside the synthesizable primitive/collection set

· 52 more finding(s) on lines outside this diff (see the check run).

safishamsi added a commit that referenced this pull request Sep 15, 2026
…nto released sections

These belong in the next release and will be re-added at the bump with correct
credit (@HARSHAVARDHAN-RAJU5 for #3529) and wording.
@safishamsi

Copy link
Copy Markdown
Member

Shipped in v0.9.62 (now on PyPI: uv tool install graphifyy==0.9.62). Your commits were cherry-picked with authorship preserved, so this shows up under your GitHub contributions. Thanks @HARSHAVARDHAN-RAJU5!

@safishamsi safishamsi closed this Sep 15, 2026
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.

detect._is_sensitive silently drops every design-token source file (*_tokens.dart, tokens.ts, TOKENS.md)

2 participants