Skip to content

ci: add just recipes, CI gates, PR-title check and the agent standards - #1

Merged
thesprockee merged 4 commits into
mainfrom
chore/standards
Oct 28, 2026
Merged

thesprockee merged 4 commits into
mainfrom
chore/standards

Conversation

@thesprockee

@thesprockee thesprockee commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Brings the standards that fit a small plugin repo over from nevr-runtime's AGENTS.md, justfile and workflows (work item 2 of the plugin-signing design, §7). The release step (release.yml) is deliberately not touched here; it is its own PR.

What changes

  • just recipes: build, test, check, lint, fmt, fmt-check, verify (the full gate = lint + check + test), clean. verify is the one the design's §7 marked "no" for the template; included because the order asked for it, and defined as exactly what CI runs.
  • CI gates (build.yml): format (clang-format), lint (shellcheck, Python compile), build with -Werror (new ECHO_MOD_WERROR option, on in tools/ci-build.sh), Wine smoke test, release check, tests. The release check now runs this repo's own tools/check_mod.py instead of curl-ing the template's main (that URL also still points at the pre-rename repo name). Actions pinned by commit SHA.
  • pr-title-check.yml + tools/check_pr_title.py: PR titles must be Conventional Commits headers (copied from nevr-runtime).
  • .clang-format: nevr-runtime's, with IndentWidth: 4 (what .editorconfig and the code use) and IncludeBlocks: Preserve (the Windows headers need windows.h first; a regroup broke game.cpp). Formatting the sources is its own commit (32c08cf), 62 insertions / 33 deletions across 7 files, no behaviour change. include/ (the nEVR ABI header) is untouched.
  • AGENTS.md: new sections: Commits and PR titles, Credit (trailer + NOTICE), Platforms (Quest parity: not applicable, PC-only), Taking someone else's patch (reconstruct first), Prefer a hook to a byte patch, Before you push; the Commands and layout tables updated.

Not here, on purpose: release.yml (still curls and uses @v4; the release-step PR replaces it), the NEVR-PLUGIN-BUILD stamp, README (next PR), VERSIONINFO.

Failing-first test

tests/test_check_pr_title.py was written before tools/check_pr_title.py existed:

$ python3 -I tests/test_check_pr_title.py
ModuleNotFoundError: No module named 'check_pr_title'
exit=1

After adding the checker (same file the tests import):

$ python3 -I tests/test_check_pr_title.py -v
test_bad_title_exits_one_and_says_why ... ok
test_no_title_fails_loudly ... ok
test_ok_exits_zero ... ok
test_accepts_conventional_headers ... ok
test_refuses_the_rest ... ok
Ran 5 tests in 0.159s
OK

Commands run, on this PR's tip (43dddf8)

just verify, exit 0. The recipes it ran, with the relevant output:

clang-format --dry-run --Werror src/*.cpp src/*.h tests/smoke_host.c
shellcheck tools/*.sh
python3 -I -m py_compile tools/*.py tests/*.py
tools/ci-build.sh
[2/2] Linking CXX shared library ExampleMod.dll
[host log] smoke level 1: ExampleMod 0.1.0
[host log] smoke level 1: not echovr.exe 631547 (PE timestamp 0x00000000, wants 0x6452DFF6): not loaded
ok: loads, refuses this build cleanly with v6 and v5 contexts, unloads (2 host log lines)
ok
python3 tools/package.py --dll "build/mingw/ExampleMod.dll" --out build/dist
python3 tools/check_mod.py --published build/dist --tag "v0.1.0"
ok
python3 tests/test_check_pr_title.py      Ran 5 tests ... OK
python3 tests/test_check_mod.py           Ran 8 tests ... OK

Also the MinHook build with warnings as errors: cmake -S . -B build/mh -G Ninja -DCMAKE_TOOLCHAIN_FILE=cmake/mingw-toolchain.cmake -DECHO_MOD_MINHOOK=ON -DECHO_MOD_WERROR=ON && cmake --build build/mh -> [14/14] Linking CXX shared library ExampleMod.dll.

Not run: the GitHub workflows themselves (they run on this PR; their results are the checks below), and the game itself.

Notes for the reviewer

  • Quest: not applicable (PC-only template).
  • If you'd rather keep the live "current rules" fetch in the build check, say so; I dropped it because it ran unpinned code from the network (and from a renamed repo) in CI.
  • No issue was opened for this unit (the order didn't name one); say if you want one.

Co-Authored-By: Andrew Bates a@sprock.io

Update 2026-10-28: main moved, brought up to date by merge

Main moved to b53afe8 (PR #5, plugin API 7 and the asset example) and this branch conflicted in AGENTS.md and CMakeLists.txt. Merged origin/main into it (merge commit 6450530, a plain fast-forward push, no force-push). Both conflicts were additive:

  • AGENTS.md: kept the just recipes and added main's asset-example build command to the "without just" paragraph.
  • CMakeLists.txt: ECHO_MOD_WERROR and ECHO_MOD_ASSET_EXAMPLE sit side by side.

Two further changes the merge needed:

  • The format gate (justfile, build.yml) now also covers examples/assets/*.cpp, and asset_example.cpp is formatted. include/ stays out of the gate: plugin_assets.h is a copy of nevr-runtime's and must not be hand-edited (clang-format --dry-run flags it).
  • Found by building the example with the new flag: -DECHO_MOD_ASSET_EXAMPLE=ON -DECHO_MOD_WERROR=ON failed with include/plugin_assets.h:38:27: error: cast between incompatible function types from 'FARPROC' ... [-Werror=cast-function-type] (also :40). The default gate never builds the example. The example's CMake block now sets -Wno-error=cast-function-type for that one file; the two warnings still print. After the change: build exit=0, Linking CXX shared library ExampleMod.dll.

Commands run on 6450530:

just verify                      exit 0
  clang-format --dry-run --Werror src/*.cpp src/*.h tests/smoke_host.c examples/assets/*.cpp
  ok: loads, refuses this build cleanly with v6 and v5 contexts, unloads (2 host log lines)
  python3 tests/test_check_pr_title.py   Ran 5 tests ... OK
  python3 tests/test_check_mod.py        Ran 9 tests ... OK

CI on 6450530: build (push and PR) pass, PR-title check pass, CodeQL (actions, c-cpp, python) pass.

Co-Authored-By: Andrew Bates a@sprock.io

Taken from nevr-runtime's .clang-format with IndentWidth 4, which is what .editorconfig
and the existing code use, so the diff is only the 43 spots that drifted. include/ is
the nEVR ABI header and stays untouched.

Co-Authored-By: Andrew Bates <a@sprock.io>
- justfile: build, test, check, lint, fmt, verify (the full gate), clean.
- build.yml: format, lint, -Werror build, Wine smoke test, release check with this repo's own
  check_mod.py (no curl of code from the network), tests. Actions pinned by commit SHA.
- pr-title-check.yml + tools/check_pr_title.py: PR titles are Conventional Commits headers.
- CMake: ECHO_MOD_WERROR, on in tools/ci-build.sh and so in CI.
- AGENTS.md: commits and PR titles, credit trailer, platform parity, reconstruct before taking a
  patch, prefer hooks to byte patches, before you push.

Standards taken from nevr-runtime's AGENTS.md and workflows; release.yml is left for the
release-step PR.

Co-Authored-By: Andrew Bates <a@sprock.io>
nevr-runtime's file is a full dump from clang-format 23; CI's Ubuntu 24.04 has 18, which
rejects AlignCaseArrows. The Google-based file with the four differences from it formats the
sources identically.

Co-Authored-By: Andrew Bates <a@sprock.io>
main moved to b53afe8 (plugin API 7 and the asset example). Both conflicts were
additive: AGENTS.md keeps the just recipes and main's asset-example build command,
CMakeLists.txt keeps ECHO_MOD_WERROR next to ECHO_MOD_ASSET_EXAMPLE.

- format gate (justfile, build.yml) now covers examples/assets/*.cpp; include/ stays
  out because those headers are copies of nevr-runtime's and are never hand-edited
- asset_example.cpp formatted
- the asset example builds under -DECHO_MOD_WERROR=ON: plugin_assets.h's
  GetProcAddress casts trip -Wcast-function-type, so that one warning stays a
  warning for that file

Co-Authored-By: Andrew Bates <a@sprock.io>
@thesprockee
thesprockee merged commit 3905d6e into main Oct 28, 2026
8 checks passed
@thesprockee
thesprockee deleted the chore/standards branch October 28, 2026 14:51
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