feat(godot): richer edge subkinds and verifyPlan for the static graph#99
Merged
Conversation
…le itself audit --impact --verify-plan now emits a loadResources bucket (from affected .tres/.res files) alongside loadScripts/openScenes, and seeds the changed file itself into the correct bucket (.gd -> loadScripts, .tres/.res -> loadResources, .tscn -> openScenes) so changing a script that only scenes reference still lists the script, and changing a resource yields a load list even with no affected rows. Sorted+deduped; text output and the --verify-plan help updated. reasons already carried target+edgeSubkind (unchanged).
…ence subkind Add ReferenceSubkind::Autoload and tag the project.godot [autoload] -> script reference via a dedicated autoload_reference() (emit_autoload only), so audit --impact surfaces edgeSubkind: "autoload" for autoload edges. main-scene and enabled-plugin refs keep the shared untagged reference() helper. The autoload ref crosses a language-family boundary (GodotProject vs GDScript) so it stays unresolved and resource_impact reads reference_subkind directly — tagging the RefView is the correct+sufficient layer. Existing TEXT column, no migration.
…cript-load-path subkind
Tag the GDScript resource-path references with ReferenceSubkind::GdscriptLoadPath
so audit --impact surfaces edgeSubkind: "gdscript_load_path":
- preload(...)/load("res://...") Imports refs (always a resource path) are
tagged unconditionally;
- extends refs are tagged ONLY when the target is a "res://..." string path
(target.kind() == "string"); a bare extends <ClassName> (a supertype) stays
untagged.
Set via self.unresolved_references.last_mut() right after the existing push_ref
calls at the 3 GDScript sites, so push_ref's signature and its other 29 callers
are untouched. EdgeKind unchanged (preload->Imports, extends->Extends).
resource_impact's resolved-edge scan only matched References|Instantiates, so a GDScript preload (Imports) or extends-path (Extends) edge — even when correctly carrying edgeSubkind: gdscript_load_path — never appeared in audit --impact. Widen the filter to also include Imports|Extends so those resource-dependency edges surface with their edgeKind + edgeSubkind. The widening only fires for edges targeting a file node, so non-Godot projects (Rust mod/use, TS import that resolve to symbol nodes) are unaffected — verified an unrelated Rust project's impact stays empty.
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.
Summary
Closes the remaining static-graph output gaps from the WorldFlipper (0.20.1) feedback. Most of that feedback already shipped in 0.22.0; this PR completes the rest — purely static-graph output enrichment (no Godot runtime, no business semantics).
loadResources—audit --impact --verify-plannow emits aloadResourcesbucket (from affected.tres/.res) alongsideloadScripts/openScenes..gd/.tres/.tscnis seeded into the correct bucket, so changing a script only referenced by scenes still lists the script, and changing a resource yields a load list even with no affected rows.ReferenceSubkind::Autoload—project.godot[autoload]→ script edges now surfaceedgeSubkind: "autoload"(via a dedicatedautoload_reference(); main-scene/plugin refs stay untagged).ReferenceSubkind::GdscriptLoadPath— GDScriptpreload/load/extends "res://…"refs surfaceedgeSubkind: "gdscript_load_path"; a bareextends <ClassName>stays untagged.resource_impactwidened to Imports + Extends — so the GDScript preload/extends edges above actually appear inaudit --impact(previously the scan only matched References|Instantiates). Only fires for edges targeting a file node, so non-Godot projects (Rust/TS symbol-targeting imports) are unaffected.Scope / invariants
Static-graph output + CLI only. No Godot runtime / ResourceLoader / business-DSL semantics. No new dependency, no version bump, no schema migration (Autoload is a new value in the existing TEXT
reference_subkindcolumn). Goldenreference/byte-identical.push_refsignature untouched (subkind set viaunresolved_references.last_mut()at the 3 GDScript sites).Verification
make cigreen (fmt + clippy -D warnings + test + guardrail);cargo test -p codegraph-benchgreen (golden oracle);git diff reference/empty.tres, changed-.gdself-seed, autoload subkind (+ negative: main-scene untagged), gdscript_load_path preload/extends (+ negative: bareextendsuntagged), Imports/Extends surfacing in resource_impactedgeSubkind:"autoload"; preload → 7 rowsimports/gdscript_load_path; extends-path → 25 rowsextends/gdscript_load_path; tres→tres → populatedloadResources; changed.gdself-seeded intoloadScripts; non-Godot Rust impact stays empty (no flood)