Symptom
scripts/prepare-templates.ts creates a tpl-* branch, then seeds it. If create succeeds and a later step fails (awaitConnectionString, resolveBranchDsn, or seedTemplate), the next deploy/run sees the branch name in listBranches() and logs it as up-to-date, skipping recreate/re-seed.
Learners who fork that template get an empty or broken sandbox for that lesson.
Red loop (logic already exercised)
- Create template name not in
existing → createBranch succeeds → add name to Xata.
- Seed (or DSN) throws → script exits non-zero.
- Re-run:
existing.has(name) → skip with (up-to-date).
Where
scripts/prepare-templates.ts (~lines 219–237) — existence check only; no “seeded successfully” marker / delete-on-failure
Suggested direction
On failure after create: delete the branch (or mark incomplete). On success-only: treat as up-to-date. Alternatively re-seed / verify seed before skipping.
Notes
Diagnosed with /diagnosing-bugs. Deploy impact if template prep fails mid-lesson after the branch already exists.
Symptom
scripts/prepare-templates.tscreates atpl-*branch, then seeds it. If create succeeds and a later step fails (awaitConnectionString,resolveBranchDsn, orseedTemplate), the next deploy/run sees the branch name inlistBranches()and logs it as up-to-date, skipping recreate/re-seed.Learners who fork that template get an empty or broken sandbox for that lesson.
Red loop (logic already exercised)
existing→ createBranch succeeds → add name to Xata.existing.has(name)→ skip with(up-to-date).Where
scripts/prepare-templates.ts(~lines 219–237) — existence check only; no “seeded successfully” marker / delete-on-failureSuggested direction
On failure after create: delete the branch (or mark incomplete). On success-only: treat as up-to-date. Alternatively re-seed / verify seed before skipping.
Notes
Diagnosed with
/diagnosing-bugs. Deploy impact if template prep fails mid-lesson after the branch already exists.