feat(export): record extractor backend/model in graph.json (#2077)#2140
Open
HerenderKumar wants to merge 1 commit into
Open
feat(export): record extractor backend/model in graph.json (#2077)#2140HerenderKumar wants to merge 1 commit into
HerenderKumar wants to merge 1 commit into
Conversation
…raphify-Labs#2077) graph.json carried no record of which backend or model produced it, so model-vs-model comparisons were unverifiable after the fact and identical node/edge counts across runs were indistinguishable — a benchmark had to be discarded over exactly this. `to_json` now stamps a top-level `extractor` block alongside `built_at_commit` with backend, model, graphify_version and mode, threaded from the extract command's `--backend`/`--model`/`--mode`. The block is only written when there is extractor identity to record, so plain AST runs keep the existing schema. A re-write that supplies no new provenance (community labeling via `cluster-only`, watch) carries forward the block already on disk so the subsequent labeling pass the tool prompts for doesn't strip attribution.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2077
Right now graph.json doesn't record which backend or model produced it. If you run a few models over the same corpus, the graphs can come out indistinguishable, and afterwards there's no reliable way to tell which model made which graph.
This stamps a small
extractorblock into graph.json (right next tobuilt_at_commit), filled from the extract command's--backend/--model/--mode:Two things worth calling out:
cluster-onlyright after extract, and that step rewrites the file.Checked it end-to-end:
grep gemma4 graph.jsonnow finds the model, and it's still there after acluster-onlyrelabel.Tests: three new cases in
tests/test_export.py— records provenance, leaves the schema alone when there's no identity, and carries the block forward on relabel. Export + related suites pass (176 passed).