Skip to content

feat(godot): richer edge subkinds and verifyPlan for the static graph#99

Merged
sunerpy merged 4 commits into
mainfrom
feat/godot-edge-subkind-verifyplan
Jul 1, 2026
Merged

feat(godot): richer edge subkinds and verifyPlan for the static graph#99
sunerpy merged 4 commits into
mainfrom
feat/godot-edge-subkind-verifyplan

Conversation

@sunerpy

@sunerpy sunerpy commented Jul 1, 2026

Copy link
Copy Markdown
Owner

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).

  • verifyPlan loadResourcesaudit --impact --verify-plan now emits a loadResources bucket (from affected .tres/.res) alongside loadScripts/openScenes.
  • verifyPlan includes the changed file itself — a changed .gd/.tres/.tscn is 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::Autoloadproject.godot [autoload] → script edges now surface edgeSubkind: "autoload" (via a dedicated autoload_reference(); main-scene/plugin refs stay untagged).
  • ReferenceSubkind::GdscriptLoadPath — GDScript preload/load/extends "res://…" refs surface edgeSubkind: "gdscript_load_path"; a bare extends <ClassName> stays untagged.
  • resource_impact widened to Imports + Extends — so the GDScript preload/extends edges above actually appear in audit --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_subkind column). Golden reference/ byte-identical. push_ref signature untouched (subkind set via unresolved_references.last_mut() at the 3 GDScript sites).

Verification

  • make ci green (fmt + clippy -D warnings + test + guardrail); cargo test -p codegraph-bench green (golden oracle); git diff reference/ empty
  • New unit tests: loadResources for a changed .tres, changed-.gd self-seed, autoload subkind (+ negative: main-scene untagged), gdscript_load_path preload/extends (+ negative: bare extends untagged), Imports/Extends surfacing in resource_impact
  • Hands-on QA on a real Godot project: autoload → edgeSubkind:"autoload"; preload → 7 rows imports/gdscript_load_path; extends-path → 25 rows extends/gdscript_load_path; tres→tres → populated loadResources; changed .gd self-seeded into loadScripts; non-Godot Rust impact stays empty (no flood)
  • Plan reviewed by Metis + dual Momus + dual-oracle Final Wave — all APPROVE

sunerpy added 4 commits July 1, 2026 10:31
…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.
@sunerpy sunerpy merged commit 0c51ff3 into main Jul 1, 2026
4 checks passed
@sunerpy sunerpy deleted the feat/godot-edge-subkind-verifyplan branch July 1, 2026 04:23
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.

1 participant