feat(godot): resolve UID-form autoloads and unify resource impact queries#161
Merged
Conversation
…ries Fixes the five findings from the Godot team's 0.36.0 feedback report. - UID-form autoloads now register their reference. A `project.godot` `[autoload]` entry declared as `Name="*uid://..."` resolves to its backing script through the `<script>.gd.uid` sidecar and to its scene through the `.tscn` `uid=` header, so `impact`/`audit`/`affected` on the script surface the `project.godot` registration and `Autoload.method()` calls bind for sidecar-backed script autoloads (scene-header autoloads are registration only). A uid present in both maps resolves to the sidecar script. The `.gd.uid` sidecar itself stays unindexed. - `impact` now agrees with `affected` and `audit --impact` on Godot resources. It no longer requires the resource to be a file node, and both `impact` and `affected` share one reverse-dependency fan-out over the unresolved-subkind, loader-import-name, and a new project.godot-scoped main-scene lane. So the `main_scene` UID target and statically `load()`-ed scenes are reported by all three commands, not just `audit`. - Lookup commands (`node`, `query`, `callers`, `callees`, `impact`) gain `--strict`, which exits non-zero when nothing is found; the default exit code is unchanged. The not-found signal is structured (a `notFound` flag on the tool result), so a matched symbol whose source text happens to contain a not-found phrase still exits zero, and a missing file is correctly flagged. - `affected --filter` documents that its value is a glob used to classify affectedTests and does not filter affectedFiles. UID-map inputs (`.gd.uid`, `.tscn` headers) are read at extraction time, so a fresh `index`/`index --force` is authoritative; keeping an incremental `sync` in step with sidecar/header edits is a shared limitation with the existing main_scene UID mapping and is tracked as a follow-up (documented in docs/godot.md). Golden `.schema` and every non-Godot fixture are byte-identical; only the godot fixture is extended and regenerated.
Codecov Report❌ Patch coverage is @@ Coverage Diff @@
## main #161 +/- ##
==========================================
+ Coverage 95.25% 95.27% +0.02%
==========================================
Files 124 124
Lines 60786 61140 +354
==========================================
+ Hits 57900 58250 +350
- Misses 2886 2890 +4
🚀 New features to boost your workflow:
|
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
Fixes the five findings (P1–P5) from the Godot team's 0.36.0 feedback report (Feishu liaison doc rev 52), verified STILL-BROKEN on v0.39.0 against the real WorldFlipper project.
[autoload] Name="*uid://..."now resolves to its backing script via the<script>.gd.uidsidecar (script autoload, full F1Autoload.method()binding) and to its scene via the.tscnuid=header (scene autoload, registration-only). Dual UID map, sidecar-wins on collision, unknown-uid → no edge. The.gd.uidsidecar stays unindexed. Golden bump (godot fixture only).impactnow agrees withaffected/audit. Dropped theNodeKind::Filegate on Godot resources; bothimpactandaffectedshare one reverse-dependency fan-out (unresolved-subkind lane + loader import-name lane + newproject.godot-scoped main-scene lane). So themain_sceneUID target and staticallyload()-ed scenes are reported by all three commands. Query-side, golden-neutral.--strict.node/query/callers/callees/impactgain--strict(exit non-zero when nothing found; default exit code unchanged). Uses a structurednotFoundflag on the tool result — a matched symbol whose source text contains a not-found phrase still exits 0, and a missing file is correctly flagged. Golden-neutral.affected --filterhelp. Documents it's a glob classifying affectedTests, not a filter on affectedFiles.Scope note
UID-map inputs are read at extraction time → a fresh
index/index --forceis authoritative. Keeping incrementalsyncin step with.gd.uid/.tscn-header edits is a pre-existing shared limitation with the shipped main_scene UID mapping; tracked as a follow-up (docs/godot.md).Verification
make cigreen (fmt + clippy + test + guardrail); equivalence 26/26 + schema_parity 11/11..schema+ every non-Godot fixture byte-identical; only the godot fixture extended + regenerated (audited: new.gd/.tscnrecords, NO.gd.uidrecord, Autoload UNRESOLVED refs, one F1 resolvedcallsedge).impact/audit effect_manager.gd→project.godot:20;impact+affected main_menu.tscn→project.godot;impact <loaded .tscn>→ loader;node <missing> --strict→ exit 1, found → exit 0.--strictsubstring-matching blocker → structurednotFound).Fixes the Godot liaison doc rev 52 (P1–P5).