---
name: feedback_verify_committed_state_before_push
description: For webhook-builds-from-main deploys, verify the COMMITTED state builds (not just the working tree); git-add bad-pathspec aborts the whole stage
metadata:
  type: feedback
---

When a deploy pipeline builds from `origin/main` (e.g. GuruRMM's `build-dashboard.sh` does
`git reset --hard origin/main` then build), the SERVER builds the COMMITTED content — so a local
`tsc`/`vite build` passing against your **working tree** can MASK an incomplete commit and you push a
broken main.

**Why:** A `git add <dir> <deleted-file>` with a stale/deleted pathspec **aborts the entire add**
("fatal: pathspec ... did not match"), silently staging nothing — so the commit captured only an
earlier `git rm`, not the new files. Working-tree build still passed; the committed build failed on
the server. (GuruRMM Phase-2 omnibox, 2026-06-05: main pushed importing a deleted CommandPalette.)

**How to apply:**
- Stage with the DIRECTORY (`git add dashboard/src/components/omnibox`), not the deleted file path.
- Before pushing a merge that a webhook will build: verify the **committed** state, e.g.
  `git stash -u && (cd dashboard && npx tsc -b && npx vite build) ; git stash pop` — or check
  `git show HEAD:<file>` / `git ls-files <dir>` to confirm the intended files are actually in the commit.
- A failed beta build does NOT deploy (marker not written), so beta stays on the last good version —
  but main is left broken for others until fixed. See [[reference_gururmm]].
