Rust workspace (resolver 2, edition 2021, rust-version 1.95). Scene-tree game engine (not ECS): Rust core + embedded Python 3.12 + eframe/egui editor. target/, scene _cache/ are gitignored — never commit them. assets.pite.toml is committed.
cargo fmt --all -- --check
npx markdownlint-cli2
cargo build --workspace --locked
cargo test --workspace --locked
PITE_LSP_SMOKE=1 cargo test -p pite-editor --lib live_pyright_smoke # needs pyright==1.1.411, gated off by default
PITE_BUNDLE_SMOKE=1 cargo test -p pite-export --lib # real CPython download; CI-only, slow
bash scripts/check-examples.sh- Single crate:
cargo test -p <crate>(e.g.-p pite-scene). Focused check:cargo run -p pite -- check --path <dir>;--strictpromotes warnings,--jsongives machine report. - Build needs CPython 3.12 dev headers + ALSA headers or it fails to link:
libasound2-dev pkg-configon Debian/Ubuntu, plusexport PYO3_PYTHON=$(which python3.12)andLD_LIBRARY_PATHpointing at itsLIBDIR. - WSL without Wayland:
WINIT_UNIX_BACKEND=x11 cargo run -p pite -- edit. pitedogfood flow:new→cd <project>→edit→check→run. Export viapite export linux|windows|macos; offline export needs--no-bundle-python(+PITE_PYTHON/--skip-python-check). Export ships the player found via--binary, else apite-playersibling ofpite(with automatic download fallback to toolchain cache if missing) — from a source checkout build both:cargo build --release -p pite -p pite-player.
pite (the pite binary, in crates/pite-cli/) → pite-runtime (window, main loop, hot reload) → pite-core (node tree, handles, lifecycle) + pite-scene (TOML load/validate/cache) + pite-script (embedded pite module) + pite-physics (pure-Rust rapier2d 2D physics subsystem) + pite-render (Renderer2D wgpu seam) + pite-assets (Importer trait, asset registry) + pite-audio (WAV/OGG/MP3/FLAC, silent-simulation fallback) + pite-project (pite.toml, res://, templates) + pite-export (binary + resolved content) + pite-player (lean run-only binary — the runtime without the editor) + pite-editor (egui panels, LSP client). Docs in docs/ are authoritative per topic: scene-format, scripting-api, assets, editor, manifest, export, lsp.
- Scenes:
.ptscnTOML is source of truth; binary_cache/<stem>.<hash>.binbeside it is derived. Node ids are human strings, never UUIDs. Unknownpropswarn and survive saves (forward compat) — don't "clean" them. Saves are byte-stable (sorted prop keys);[[instance]]entries stay as entries with edits recorded as"node.prop"overrides, never inlined. - Assets: all refs are
res://project-relative strings; absolute paths are forbidden.assets.pite.tomltracks content hashes and is committed to git. After renaming/moving an asset outside the editor, runpite check --reimport-assets(rewrites refs by content hash);checkwithout--reimport-assetsnever writes. Orphan-asset warnings only consider scenes transitively reachable frommain_scene. - Deps: exports drop
site-packages; third-party imports die in an export unless vendored (pite vendor add pkg==ver→ projectvendor/, pinned in[vendor]).pite checkwarns per offending import; non-vendored sibling modules need[export] includeto ship. - Scripts: one file = one class inheriting
pite.*,snake_case. Missing_ready/_processis a no-op, never an error. Cross-node calls go throughget_node("../Name"); a miss raisesKeyError. Signals are typed (pite.signal(int));Button.pressedandTimer.timeout(fires eachwait_timeseconds, looping; non-positive never fires) are engine-owned — justconnect, don't declare. - Logging:
tracingeverywhere — neverprintln!/log::in engine code. - Visuals:
DESIGN.md+assets/palette.jsonare the single source of truth (teal#0b9387, dark-only editor incrates/pite-editor/src/theme.rs). Don't invent hexes. - LSP: pinned pyright server; live test is env-gated (
PITE_LSP_SMOKE=1), don't run it unconditionally.
- Conventional commits (
feat:/fix:/docs:/chore:), one focused change per commit/PR; never commit secrets,target/, or local paths. - Git hooks (
pre-commit) check formatting, Markdown, and commit subjects; install them withpre-commit installand run everything withpre-commit run --all-files. - New Rust files start with
// SPDX-License-Identifier: MIT OR Apache-2.0(Python:# …);examples/game scripts stay header-free. - Pinned values bump in multi-file lockstep (13 internal path-dep pins, scene
FORMAT_VERSION/CACHE_VERSION, the pyright pin incrates/pite-editor/src/lsp.rs+ docs + CI,python_bundle.rspins) — checklist indocs/developer/maintenance.md. - Keep
docs/changelog.md(## Unreleased) and affecteddocs/pages updated whenever a change is user-facing or alters documented behavior.
All agents operating in this repository must uphold the unbroken link chain and project standards:
- Code of Conduct:
CODE_OF_CONDUCT.md - Security Policy and Invariants:
SECURITY.md - Accessibility Statement:
ACCESSIBILITY.md - Contributor Guidelines:
CONTRIBUTING.md