Skip to content

fix(watch): widen semantic-doc gate to the doc-shaped file_type subset (#1954)#1957

Closed
alphanury wants to merge 1 commit into
Graphify-Labs:v8from
alphanury:fix/1954-semantic-doc-gate
Closed

fix(watch): widen semantic-doc gate to the doc-shaped file_type subset (#1954)#1957
alphanury wants to merge 1 commit into
Graphify-Labs:v8from
alphanury:fix/1954-semantic-doc-gate

Conversation

@alphanury

Copy link
Copy Markdown
Contributor

Fixes #1954.

The #1915 semantic-doc gate in _rebuild_code (graphify/watch.py) recognized a doc as semantic-backed only when it had a node with file_type == "document". A doc whose LLM layer is made of concept/rationale nodes — the extraction spec's preferred shape — failed the check, so every rebuild AST-quick-scanned it again and re-minted heading nodes alongside the semantic ones: the same double-representation #1915 fixed, just for the other (and recommended) node shape.

Change

  • The gate now accepts the full doc-shaped subset of the canonical six-value file_type enum: {"document", "concept", "rationale", "paper"} (i.e. everything except code and image) — the issue's own minimal suggested fix.
  • Both downstream consumers (incremental path and full-rebuild path) key off the single semantic_doc_files set the gate produces, so they stay in lockstep; nothing else in the rebuild flow changes.
  • The pre-Full graphify update silently evicts LLM semantic edges from re-extracted Markdown/doc sources (edge eviction is provenance-blind) #1865 legacy-graph safeguard is preserved: the markdown extractor's add_node() always defaults file_type to "document", so legacy AST doc nodes can never carry concept/rationale/paper and the widened set does not increase the legacy misread risk. (Verified against graphify/validate.py's VALID_FILE_TYPES and every add_node call site in the markdown extractor.)

Tests

🤖 Generated with Claude Code

@safishamsi

Copy link
Copy Markdown
Collaborator

Landed on v8 (ships in 0.9.18), cherry-picked to preserve your authorship. Thanks @alphanury — the #1915 semantic-doc gate only recognized a doc via a file_type=="document" node, so a doc represented purely as concept/rationale nodes was still AST-quick-scanned and got duplicate heading nodes on every rebuild. The gate now covers the doc-shaped subset (document/concept/rationale/paper) while still excluding code/image and AST-origin nodes; previously-bloated graphs self-heal on the next rebuild.

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.

#1915 follow-up: semantic-doc gate only accepts file_type=="document", so docs whose LLM layer is concept/rationale are still AST-quick-scanned

2 participants