Repository navigation
Description
Context
We're using graphify to index YAML contracts from a data pipeline (business entities with stable IDs like BP_001, FC_002, cross-references, and evidence citations back to source transcripts). Determinism is a hard requirement: the same input must always produce the same graph, with no re-labeling of entities between runs.
While integrating graphify for this, we hit two limitations:
- Structured data files (YAML/JSON) are forced through LLM extraction
code_exts (in the file-classification logic used during update/build) only covers programming-language source files:
{'.py','.ts','.js','.go','.rs','.java','.cpp','.c','.rb','.swift','.kt','.cs','.scala','.php','.cc','.cxx','.hpp','.h','.kts','.lua','.toc','.f','.F','.f90','.F90','.f95','.F95','.f03','.F03','.f08','.F08'}
Any .yaml/.yml/.json file falls outside this list and gets classified as document, which routes it through semantic (LLM-based) extraction rather than structural parsing — even when the file already contains explicit, stable identifiers and cross-references (i.e., no entity extraction/inference is actually needed).
Problem this causes: LLM-based extraction over the same structured file can label the same entity differently across runs, breaking determinism for use cases where the source is already structured data, not prose to be interpreted.
Request: Support a deterministic/structural extraction path for structured data files — either by:
extending code_exts to include .yaml/.yml/.json and adding a structural parser for them (key-based entity/relationship extraction, similar to how code files are parsed for symbols), or exposing the existing internal build_from_json/build_merge construction API as a documented, first-class CLI entry point, so callers who already have structured data (and want to skip extraction entirely) have a supported path instead of reaching into internal Python functions.
We worked around this today by calling build_from_json/to_json directly from a custom script, bypassing extraction — which works, but relies on undocumented internals rather than a public contract.
- to_json shrink-guard has no override for intentional shrinkage
graphify.export.to_json refuses to write a graph if it has fewer nodes than the existing file on disk (tracked as issue Prevent partial-chunk overwrite in --update: pre-build node-count assertion + build_merge() helper #479). This guard is reasonable as a default (catches accidental partial extraction), but there's no explicit way to say "this shrinkage is intentional, write anyway" — the only workaround is manually deleting/backing up the old graph.json before running.
Request: Add an explicit override, e.g. to_json(..., allow_shrink=True) or a --force/--allow-shrink CLI flag, so callers with a legitimate reduction (entities removed upstream, corrected data, etc.) can proceed without bypassing the guard by deleting state out-of-band.
Activity
wrightbuilt commentedon Aug 3, 2026
Second reporter for part 2, from a different angle than yours — CI rather than a library caller.
We run graphify as a post-merge job on protected
mainin several repos: clean checkout, pinned version, AST-only (no API key, so extraction is deterministic and free), regenerate, commitgraphify-out/back. Two repos wedged on the shrink guard within three days of each other, both from an ordinary.graphifyignoreedit:archive/to.graphifyignore, moved five docs under itdocs/superpowers/andCHANGELOG.md40+ consecutive failed runs on the first with zero successes, until we pushed a
--forceregeneration directly tomainthrough the branch-protection bypass. The second had no bypass available and abandoned the exclusion instead.The argument I would add to your part 2: on a CI path the guard has no true positives available to it. Its stated premise is "you may be missing chunk files from a previous session" — a stateful local condition. A job that checks out clean, installs a pinned graphify, and extracts from scratch cannot be in that state, so there it can only produce false positives.
What makes it a wedge rather than an annoyance is that recovery is out of reach from inside the repo: the graph is a protected-branch artifact, so a corrected graph cannot land through a pull request, and a graph-only push does not retrigger the job. The only exit is a privileged direct push — break-glass, for a foreseeable configuration change.
One correction to part 2 worth having on the record:
graphify update --forcedoes exist and does resolve it — that is what we used. But--forceonupdateis overloaded: it also disables the incremental gate and skips semantic-cache reads (#1894). A caller who only wants "accept this shrink" has to take the full re-scan as well. Your--allow-shrinkframing separates those two meanings, which is the part I would most like to see.One datum in favour of a narrower gate rather than a blanket override: the codebase already computes the distinction. A source gone from disk folds into the deleted set and passes the accounting check, while a source that still exists but left the corpus is tracked separately and reported as
so at the point the write is refused, graphify already knows which nodes it is dropping and why. Whether that set is reachable from the refusing path is your call, but the information needed to gate this narrowly appears to exist already.
Happy to supply full run logs, or to test a patch against either corpus.
rywjin-hub commentedon Oct 13, 2026
Second reporter for part 1, from the skill side: a corpus whose relationships already exist as typed nodes and edges (seed data files, curriculum JSON, lesson documents), so neither AST nor semantic extraction fits.
What worked on graphifyy 0.9.73 is the same workaround described above: a small deterministic exporter that writes the extraction JSON directly, every edge
confidence: "EXTRACTED"withconfidence_score: 1.0, thenbuild_from_json, clustering, the report andgraphify export html. The exporter wrote 843 nodes and 1,038 edges, anddiagnose_extractionreported 0 dangling and 0 collapsed edges.What a documented entry point, or a skill section for it, would need to say, since none of it is written for a caller who supplies its own extraction:
[a-z0-9_](stated today only in the Step 3 subagent prompt,tools/skillgen/fragments/references/shared/extraction-spec.md);graph.json(found by trial);generate()needs a detection dict, and a minimal synthetic one works (found by trial);directed=Truetobuild_from_jsonanddiagnose_extractionwhen edge direction carries meaning, such as prerequisite to dependent (graphify extractexportsgraph.jsonwithdirected: falseeven though the link data carries subject→object direction; no CLI opt-in for a directed build #3495 notes thatgraphify extractwritesdirected: falseeven for directional links).A short "bring your own extraction" section in the skill (
tools/skillgen/fragments/core/core.md, plus theaider.mdanddevin.mdmonolith fragments) that skips Steps 2 and 3 and starts at Step 4 with a minimal detection dict would cover the documentation half of this request with no new API.test(yaml): add structural extraction coverage and update document te…
fix(detect/extract): structurally extract .yaml/.yml config files (#2214
test(yaml): add structural extraction coverage and update document te…
safishamsi commentedon Oct 23, 2026
Fixed in 0.9.95 by #4706. Thanks @dchavezf for the report. Live on PyPI: https://pypi.org/project/graphifyy/0.9.95/
chore: [HIMMEL-7394] sync to upstream 0.9.95 and carry the himmel del…
fix(llm): keep .yaml/.yml out of the splittable-document set (#5078 f…