Repository navigation
fix(cli): map an external project's paths to the cheap gate - #11
Merged
Merged
Conversation
Dogfooding on nova-survivors-gai found this: with `GAI_GAME` set, `next` matched `components/x.gd` only against the catch-all rule, so every script edit in a real project was sent to the full check. The table knew the `game/` prefix of the bundled starter game and nothing else. `next` now resolves a path against the project when the project is not the bundled one: a `.gd` gives `script` with a `res://` command, a file under `tests/` gives `check`, anything else gives `check`. The rule names are `<game>/**/*.gd` and `<game>/tests/**` so a reader can see which project they belong to. Measured on the real project: `check --script` for one script takes 7.9 s, which is the difference between a script gate and the 90-second full check. The same run recorded the rest of the dogfood: check ok with 15 autoloads, 35 scene tests, lint clean on 147 scripts, a 190.4 MiB Linux export that starts headless, `script.classes` answering with 94 classes, and locks plus the audit log working on a real scene.
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.
Why
The roadmap's dogfooding item exists to find exactly this: a gate that only works for the bundled starter game.
With
GAI_GAMEpointing at~/nova-survivors-gai,bin/gai next components/abilities/ability_base/ability_base.gdansweredcheck, notscript. The rule table knows thegame/prefix of the starter game, and a real project has no such prefix, so every script edit in a real project paid for the full check.What changed
nextresolves a path against the project when the project is not the bundled one:.gdgivesscript, and the command maps the path tores://relative to the project (res://components/ability.gd);tests/givescheck;check.Rule names read
<game>/**/*.gdand<game>/tests/**so it is visible which project they belong to.The dogfood run, in numbers
Against
~/nova-survivors-gai: 147 scripts, 15 autoloads, 94class_names.doctor: ok.check: ok.lint: 147 scripts, 0 problems.test --scene-dir res://tests: 35 scene tests pass in 145 s.export linux --output /tmp/...: 190.4 MiB, Steam runtime copied, and the binary starts headless with its save, settings, and Steam singleton loaded.script.classesreturns 94 classes from the import cache,script.classreturnsAbilityBasewith doc and methods,scene.treereturns the realMainMenu, a lock on/root/MainMenuallows the holder's write and refuses a guest with-32004, and the audit log shows role, ceiling, target, and outcome per mutating call.check --scriptfor one script on that project: 7.9 s.Verification
test_external_project_scripts_use_the_script_gate: withGAI_GAMEset, a project.gdgives gatescript, the command ischeck --script res://components/ability.gd --no-run, a.tscngivescheck, and a test.gdreports<game>/tests/**.test_next18 tests,test_build16,bin/gai checkgreen, pre-commit passes.