Correct two gate commands that pass without running

npx vitest run bypasses the pretest hook that stages plugin frontends, so
plugin specs were never collected - it reported 28 spec files where npm test
reports 30. A plugin frontend spec could pass CI unread. Bare bash resolves to
WSL on Windows dev boxes and fails to find /bin/bash, which redirected to a log
reads as a clean style run with no findings.

Both are the same failure shape: a command that reports success without having
done the work.

Also records that a multi-line here-string passed to git commit -m silently
no-ops, reporting success without creating the commit.
This commit is contained in:
benjamin.baker
2026-09-09 06:37:26 -04:00
parent fd18099199
commit f02e344101

View File

@@ -1,4 +1,4 @@
# Copilot instructions for shopdb-flask
, # Copilot instructions for shopdb-flask
Follow these when suggesting code. They are enforced by a naming/style hook and
by CI (`.github/workflows/ci.yml`) - suggestions that break them fail the build.
@@ -7,11 +7,12 @@ by CI (`.github/workflows/ci.yml`) - suggestions that break them fail the build.
## General Guidelines
- Finish the in-flight task before starting new workstreams.
- When asked to "take notes" on a future idea, capture it in the notes file only - do not implement it, and do not expand on it at length in replies.
- Use a temp file for multi-line git commit messages instead of heredoc syntax: `git commit -F <file>`. When committing in PowerShell, never pass multi-line commit messages inline (no here-strings like @'...'@ or multiple -m flags). PowerShell mangles them and git errors with "did not match any file(s) known to git". Instead, write the commit message to a temp file in the WORKSPACE ROOT (e.g. `commitmsg.tmp`), run `git commit -F commitmsg.tmp`, then delete the file. Do NOT place the temp file inside .git/ - git prunes stray files there and the file disappears before commit runs.
- Use a temp file for multi-line git commit messages instead of heredoc syntax: `git commit -F <file>`. When committing in PowerShell, always write the message to a temp file in the WORKSPACE ROOT (e.g. `commitmsg.tmp`), run `git commit -F commitmsg.tmp`, then delete the file. Passing a multi-line here-string to `git commit -m` silently no-ops: it reports success but does not create the commit. Always verify with `git log` after committing. Do NOT place the temp file inside .git/ - git prunes stray files there and the file disappears before commit runs.
- Avoid using `powershell.exe -File` for launching scripts, as it fails if the script file is missing or quarantined.
- Long-running commands (pytest suites, npm builds, container rolls) must be redirected to a log file under `devnotes/` (e.g. `devnotes/_pytest.log`) and launched non-blocking; never run as a blocking foreground command. Do not poll or tail the output; the user watches the file and will say when it is done.
- Before taking any action that modifies code or files, warn the user first if a test run or build may be in progress, so discussion about the project can continue without altering files underneath a running test.
- Always invoke shell scripts with the explicit Git Bash path: `& "C:\Program Files\Git\bin\bash.exe" scripts/<script>.sh` to avoid issues with WSL resolving bare `bash` in PowerShell.
- Do not present findings as narrow multiple-choice questions when the user is catching up on context; lay out the decision and its evidence in prose instead.
## Installer Logic
- The endpoint agent installer shipped to endpoints is generated by `_install_script()` in `plugins/endpoints/api/siteagent.py`, NOT `agent/installer/install-shopdbagent.ps1`. Any installer logic change must be made in `siteagent.py`, followed by rolling the containers.
@@ -98,9 +99,15 @@ Run the three gates (CI runs the same):
```
python -m pytest tests/ -q
cd frontend && npx vitest run && npm run build && cd ..
bash scripts/check-naming-and-style.sh
cd frontend && npm test && npm run build && cd ..
& "C:\Program Files\Git\bin\bash.exe" scripts/check-naming-and-style.sh
```
`npm test`, NOT `npx vitest run`: the `pretest` hook runs `stage-frontend.mjs`,
so bare vitest never stages plugin frontends and silently skips their specs.
Call the style script through the explicit Git Bash path - bare `bash` resolves
to WSL on Windows dev boxes, fails to find `/bin/bash`, and reads as a clean
run with no findings.
Commits: short present-tense subject, body says WHY. No AI/tool attribution in
commit messages, code comments, or docs.