Cross-Platform Rules
This page is for contributors writing code, scripts, or tests in Patchwork.
Standing Rules (AGENTS.md)
Section titled “Standing Rules (AGENTS.md)”- No Docker: Everything runs natively on Windows 10/11 and Linux (Ubuntu 22.04/24.04, Debian 12; x64 & arm64).
- All scripts are Node.js: Write all tooling in
.mjsor.ts. Do not add.sh,.bat, or.ps1scripts. Keeppackage.jsonscripts shell-agnostic (cross-env,scripts/run-chain.mjs). - Single platform helper: Only
scripts/lib/platform.mjsandsrc/lib/platform.tsmay readprocess.platformorprocess.arch. - Path & process safety: Always use Node
pathAPIs,os.tmpdir(),shell: falseonspawn/execFileSync, andsanitizeFilename()for user-facing or exported filenames. - LF line endings: Keep LF (
\n) across code, generated configs, and SQL per.gitattributesand.editorconfig. - Testing & CI: Run tests against
patchwork_testand a temporary MinIO data directory. CI (.github/workflows/ci.ymland.github/workflows/docs.yml) verifies bothubuntu-latestandwindows-latest.
Expected Result
Section titled “Expected Result”Every script, build, and test suite runs identically on Windows PowerShell and Linux bash.