Skip to content

chore(justfile): self-heal codegen-vscode + add codegen-all recipe#212

Merged
hugocorreia90 merged 1 commit intomainfrom
chore/codegen-hygiene-selfheal
Apr 21, 2026
Merged

chore(justfile): self-heal codegen-vscode + add codegen-all recipe#212
hugocorreia90 merged 1 commit intomainfrom
chore/codegen-hygiene-selfheal

Conversation

@hugocorreia90
Copy link
Copy Markdown
Contributor

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-vscode auto-installs deps

Before: just codegen-vscode assumed editors/vscode/node_modules was 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 ran. If you didn't notice the error scroll and committed anyway, the partial state landed on main and codegen-drift.yml fired on the next PR.

After: the recipe checks for node_modules and runs npm install --silent automatically. ~15s cold, skipped when deps are present. Mirrors the self-heal pattern codegen-dagster already has via uv run.

Fix 2 — new codegen-all recipe bundles fixture regen

Before: just codegen regenerated 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. codegen stays as the fast dev loop (~30s); codegen-all is the release-PR loop (adds ~1-2 min for fixture regen). Docstring on codegen now points at the alternative.

Verification

  • Deleted editors/vscode/node_modules, ran just codegen — self-heal triggered, npm install ran, codegen completed; git status shows only justfile modified (idempotent vs. main).
  • just --list surfaces both codegen and codegen-all.

Out of scope — logged for later if needed

  • Upfront preflight check. Decided against — with self-heal in place, both dagster (uv-managed) and vscode (npm-managed) codegen steps now recover from missing deps on their own, so there's nothing to preflight.
  • Default-on pre-commit hook. .git-hooks/pre-commit already runs codegen drift detection when schema files are staged; opt-in via just install-hooks. Making it default is a separate friction conversation for a solo-project repo.

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.
@hugocorreia90 hugocorreia90 merged commit dec5667 into main Apr 21, 2026
8 checks passed
@hugocorreia90 hugocorreia90 deleted the chore/codegen-hygiene-selfheal branch April 21, 2026 19:17
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