Skip to content

fix(push): validate the whole plan before the first write - #107

Merged
devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/1795218722-push-preflight
Nov 21, 2026
Merged

devin-ai-integration[bot] merged 3 commits into
mainfrom
devin/1795218722-push-preflight

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Push wasn't atomic: during the NHS test push (#99/#100 on #94), a 400 on resource 2 of 6 left the org half-applied. Validator errors only warned unless --strict, so a payload the validators already knew was bad still went out after earlier POSTs.

Push now runs a preflight on the write plan before any remote mutation (orphan deletes included):

plan = selected resources + local deps push would auto-apply (computePushPlan, no API calls)
blocking = error findings on plan resources
         + unresolved-credential findings on plan resources
         + (--strict) error findings anywhere
if blocking: print them, "Nothing was written to the remote API.", exit 1
  • Errors in files outside the plan still only warn, so a scoped push isn't blocked by an unrelated bad file. --strict keeps its old meaning (block on any error).
  • --dry-run runs the same gate, so a dry run predicts the real run.
  • Nothing before the gate writes to the API (bootstrap/state checks are reads only).
  • What this doesn't cover: a 400 the offline validators can't predict can still leave partial writes. Each new rejection case needs its own validator (like feat(validate): catch undefined squad variables and Liquid transfer numbers #99's transfer-number-liquid, which this gate now makes blocking).

Docs: README, docs/guides/commands.md and AGENTS.md (what to do when a push stops at the preflight). Replaces #101.

Tests: tests/push-preflight.test.ts, using a local HTTP stub. It covers a full push with a later invalid resource (exit 1, zero POST/PATCH/DELETE), a scoped push with an unrelated invalid file (proceeds), dry-run, unresolved credentials, --strict, and an auto-applied dependency with an error. npm run build is clean, npm test gives 591 pass / 0 fail, and biome is clean.

dhruva-vapi and others added 2 commits November 20, 2026 23:54
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

I'll fix CI failures and address comments from users with write access that start with 'Devin'.

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

Devin Review

🟢 Devin Review found nothing to fix · View findings

@devin-ai-integration
devin-ai-integration Bot merged commit 311fb97 into main Nov 21, 2026
5 checks passed
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