chore(justfile): self-heal codegen-vscode + add codegen-all recipe#212
Merged
hugocorreia90 merged 1 commit intomainfrom Apr 21, 2026
Merged
chore(justfile): self-heal codegen-vscode + add codegen-all recipe#212hugocorreia90 merged 1 commit intomainfrom
hugocorreia90 merged 1 commit intomainfrom
Conversation
Closes two silent-drift classes that hit three times in a single day (2026-04-21) during the Arc 1 wave 2 cascade: ## Fix 1 — codegen-vscode auto-installs deps Before: `just codegen-vscode` assumed `editors/vscode/node_modules` was already populated. When it wasn't (fresh worktree, CI runner, release PR checkout), the npx json2ts step failed with "could not determine executable to run" — but `codegen-rust` + `codegen-dagster` had already written their outputs, so half the pipeline had run. If the dev didn't notice the error scroll and committed anyway, the partial state landed on main and codegen-drift.yml fired on the next PR. Happened to me on PR #204, and to whoever ran codegen for the v1.12.0 release PR (#207 → #210 hotfix). After: the recipe checks for node_modules and runs `npm install` automatically. ~15s cost on a cold cache, skipped when deps are present. Same self-heal pattern codegen-dagster already uses via `uv run`. ## Fix 2 — new `codegen-all` recipe bundles regen-fixtures Before: `just codegen` regenerated schemas + bindings but not fixtures. Engine version bumps cascaded every fixture's `"version"` field out of sync (hit on PR #207 release). The muscle memory was "run codegen and you're done", which was wrong for anything touching output shapes or version strings. After: `just codegen-all` runs codegen + regen-fixtures together. Kept `codegen` as the fast dev loop (~30s) and `codegen-all` as the slower release loop (~1-2 min of extra fixture regen). Docstring on `codegen` now points at `codegen-all` for the cases where it's the right tool. ## Verification - [x] Deleted `editors/vscode/node_modules`, ran `just codegen` — self-heal kicked in, npm install ran, codegen completed cleanly, `git status` shows only `justfile` modified (idempotent against main). - [x] `just --list` shows both `codegen` and `codegen-all`. ## Not in scope (noted for follow-up if needed) - Upfront preflight check (Fix B from the discussion) — decided against, because the self-heal in Fix 1 makes it redundant. Both dagster (uv-managed) and vscode (npm-managed) codegen steps now recover from missing deps on their own. - Pre-commit hook additions — `.git-hooks/pre-commit` already runs codegen drift detection when schema files are staged; opt-in via `just install-hooks`. Making it default-on is a separate discussion about solo-project friction.
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 two silent-drift classes that hit three times in a single day during the Arc 1 wave 2 cascade (fixtures drift on release PR #207 → engine codegen drift on #210 hotfix → same pattern caught me on #204).
Fix 1 —
codegen-vscodeauto-installs depsBefore:
just codegen-vscodeassumededitors/vscode/node_moduleswas populated. When it wasn't (fresh worktree, CI runner, release PR checkout), thenpx json2tsstep failed with "could not determine executable to run" — butcodegen-rust+codegen-dagsterhad already written their outputs, so half the pipeline ran. If you didn't notice the error scroll and committed anyway, the partial state landed on main andcodegen-drift.ymlfired on the next PR.After: the recipe checks for
node_modulesand runsnpm install --silentautomatically. ~15s cold, skipped when deps are present. Mirrors the self-heal patterncodegen-dagsteralready has viauv run.Fix 2 — new
codegen-allrecipe bundles fixture regenBefore:
just codegenregenerated schemas + bindings but not dagster fixtures. Engine version bumps cascaded every fixture's"version"field out of sync (exactly what hit PR #207). Muscle memory was "run codegen and you're done" — wrong for anything that touches output shapes.After:
just codegen-all = codegen + regen-fixtures.codegenstays as the fast dev loop (~30s);codegen-allis the release-PR loop (adds ~1-2 min for fixture regen). Docstring oncodegennow points at the alternative.Verification
editors/vscode/node_modules, ranjust codegen— self-heal triggered, npm install ran, codegen completed;git statusshows onlyjustfilemodified (idempotent vs. main).just --listsurfaces bothcodegenandcodegen-all.Out of scope — logged for later if needed
.git-hooks/pre-commitalready runs codegen drift detection when schema files are staged; opt-in viajust install-hooks. Making it default is a separate friction conversation for a solo-project repo.