On one commit vs. post-commit checks: tests/browser/local_development.py runs git archive HEAD, then copies a hardcoded RUNTIME list of files over the result. So the test sees uncommitted work only for files someone remembered to list.
git stash create writes a commit object of the working tree (staged and unstaged) without moving HEAD or adding to the stash list; I checked. s=$(git stash create); git archive "${s:-HEAD}" tests what's about to be committed, the result goes into the one commit, and rule 4 can go. New files need a git add first, since untracked ones are left out.