Rules for agents and developers working on Kinetra-Lab. All rules in Kinetra's AGENTS.md apply here: the development cycle, verification by impact, git, engineering rules, code and repository documentation, and skills. This file adds only what is specific to Lab. Explicit user instructions take precedence.
- Where to read what
- Scope
- Lab boundaries
- Verification in Lab
- Git with the engine submodule
- Documentation in Lab
- Functionality index
Project overview · Documentation index
The Kinetra pages live in the external/Kinetra submodule. If that directory is empty, run git submodule update --init --recursive first. Where a row names sections, read those and not the whole page. Search the roadmaps and the design indexes for the topic instead of reading them through.
| Task | Read |
|---|---|
| Every task | This file and Kinetra's AGENTS.md, without its Where to read what, Identity and scope and Functionality index, which route to and describe the engine |
| Start, plan, review or hand over a change | The feature skill, and the section of the workflow for the step you are at, which the skill links; your branch's design document, and an older one only as Kinetra's rule allows |
| Build or review a change, so known mistakes are not repeated | Lab's review lessons and Kinetra's |
| Write or review C++ or CMake | Conventions |
| Add tests | Test kinds, rules for tests and writing a doctest suite |
| Pick a verification level | Verification in Lab (verify skill); Kinetra's continuous integration only for a CI change |
Write /// comments |
Code comments |
| Write a README or another page | What goes where, the module or skill README template, and page layout |
| Draw a diagram | Diagrams |
| Understand Lab targets and session flow | System architecture |
| Work on one application | Its README and architecture page (see functionality index) |
| Know what is planned, or record an idea | The items a search for the topic finds in the roadmap (the only plan, in order of priority) and, for engine work, the Kinetra roadmap: grep -n -i '<key word>' docs/roadmap.md external/Kinetra/docs/roadmap.md; a whole roadmap only to choose or order items (roadmap skill) |
- Lab owns the runnable applications (Demo, Dotio, i4sim), the bundled launcher executable
kinetra, and their tests and media. - The engine stays in Kinetra. A mechanism that two applications need, or that has no game rules in it, is a candidate for Kinetra. Move it there with a Kinetra design document, and an ADR when it changes a boundary.
Each application follows the layer rule:
| Layer | Targets | May depend on |
|---|---|---|
| Logic: headless rules, state, window-free input mapping and debug-menu rows | kinetra_demo_logic, kinetra_dotio_logic, kinetra_i4sim_logic |
Kinetra::Simulation, and the headless Lab policy in kinetra_lab/input.h and kinetra_lab/debug.h |
| Presentation: session, panels, drawing | kinetra_demo_presentation, kinetra_dotio_presentation, kinetra_i4sim_presentation |
Its own logic, Kinetra::Runtime, shared Lab helpers, and Kinetra::Launcher for its menu widgets |
| Composition roots | kinetra, kinetra_demo, kinetra_dotio, kinetra_i4sim, kinetra_sessions, and the developer tool kinetra_capture |
Presentation libraries, Kinetra::Launcher; kinetra_capture also kinetra_sessions and zlib |
- Input mapping that needs no window belongs in the logic layer, where it is tested headless: Demo's
demo/input/mapping.hand i4sim'sFactoryController. So do the rows of a debug menu, askinetra::DebugEntryvalues: Demo'sDebugPanel, Dotio'sApplication::debug_entries()andFactoryController::menu(). Fromkinetra_lab, logic may include onlykinetra_lab/input.handkinetra_lab/debug.h, which use Kinetra's plain input, camera and menu types;kinetra_lab/settings.handkinetra_lab/session.hneed the runtime. - A presentation may link
Kinetra::Launcherto reuse its menu widgets, as i4sim does withLaunchMenufor its blueprint screen. It never depends on the bundled launcher inlauncher/. - Applications never include each other's headers. Shared Lab code is application-neutral: the Lab policy in labs/shared (target
kinetra_lab) and the test helpers in kinetra_lab/testing/test_support.h (targetkinetra_lab_testing). - Files follow the directory layout: every module has one
include/<name>/(demo,dotio,i4sim,kinetra_lab,launcher,capture) and onesrc/that mirrors it, presentation code inpresentation/, every header that is not an entry of its module in a topic folder (at least two files per topic), internal headers indetail/, test helpers intests/include/<name>/testing/. Include as"i4sim/simulation/simulation.h"; never../. - Logic must build and test with
-DKINETRA_LAB_BUILD_RUNTIME=OFF. - i4sim needs the header-only nlohmann JSON package (3.11+). Its blueprints live in
labs/i4sim/blueprints/; CMake copies them toi4sim-blueprints/next to every executable that opens them, and the application reads them from there. Treat blueprint files as a data format: changing their fields is a contract change.
Why: headless logic is what makes simulation behavior testable without a window, and the dependency direction keeps applications replaceable.
Use the levels from Kinetra testing:
At every level, run python3 external/Kinetra/tools/check_copies.py, with a --term for the old wording, each key word and the name of each part of every rule, procedure or term the change rewords (rule). It lists the CI jobs, CMake options, presets, flags and inline names the diff removes that a page in Lab or external/Kinetra still names; judge each hit (tools).
Then search each key word that the change moves, renames or makes stale on its own (a label, a key, a menu row, a flag) with git grep --recurse-submodules -n -i '<word>', which also covers external/Kinetra (plain git grep skips submodules), and read every hit. check_copies.py reads only Markdown and YAML and finds a phrase only in the word order given, so it misses code, CMake and script comments and sentences that word the same thing otherwise. Kinetra's copies rule and the verify and feature skills state the same step (rule, since Kinetra#80). Why: a review lesson from #147 (SCENARIOS moved, copies missed in smoke.cmake, i4sim's main.cpp and three README sentences), which came back in #148 (Space no longer starts a showcase scene, a copy missed in the media guide).
| Level | In Lab |
|---|---|
| Docs | python3 external/Kinetra/tools/check_docs.py. CI runs only this check for most docs-only pull requests (below) |
| Targeted | cmake --build --preset dev --target <targets> and ctest --preset dev -R '<regex>', using the table below (configure once with cmake --preset dev) |
| Full | Locally the targeted builds and tests of every changed area, from the table below; then the pull request's CI (format, docs, headless and ci on Ubuntu 24.04 LTS with the graphics and smoke tests on software OpenGL, plus native Windows). Verified only when CI passes. Run ci, headless, graphics or windows locally only to reproduce a CI failure (Kinetra testing) |
| Changed area | Targets | CTest regex |
|---|---|---|
labs/i4sim/ logic (simulation/, blueprint/, controller) |
kinetra_i4sim_tests kinetra_i4sim_golden_tests kinetra_i4sim_pressure_tests kinetra_i4sim_contact_tests kinetra_i4sim_controller_tests kinetra_i4sim kinetra_i4sim_motion_benchmark |
^kinetra_i4sim |
labs/demo/ logic (application, debug_panel, world/, input/) |
kinetra_demo_tests kinetra_demo_terrain_tests kinetra_demo_crowd_tests kinetra_demo_crowd_characterization_tests kinetra_demo_passing_tests |
^kinetra_demo(:|_terrain|_crowd|_passing) |
labs/dotio/ logic (everything outside presentation/) |
kinetra_dotio_tests |
^kinetra_dotio: |
labs/shared/ |
kinetra_lab_tests |
^kinetra_lab: |
launcher/include/launcher/applications.h, launcher/src/applications.cpp |
kinetra_menu_tests |
^kinetra_menu: |
tools/capture/ |
kinetra_capture_tests kinetra_capture; then, as quick feedback, the smoke test in the graphics preset (ctest --preset graphics -R kinetra_capture_smoke), which CI also runs |
^kinetra_capture |
Any presentation/ folder, launcher loop, main.cpp |
Full level. Locally, build the area's *_presentation_tests (or kinetra_runtime_tests) and its executable in the graphics preset; running them there with ctest --preset graphics -L graphics -R '<regex>' is optional quick feedback, CI runs them |
<suite>_graphics|kinetra_smoke:<name> |
external/Kinetra pointer or engine sources |
Full level, plus Kinetra's own checks; a pointer move whose Kinetra range is only Markdown, docs/, .agents/, .claude/, .codex/config.toml, .github/ or tools/ is the Docs level, and CI runs only the docs check for it, unless the range changes Kinetra's README.md or docs/media/, which kinetra_capture_tests reads |
|
tools/release/, .github/workflows/release.yml |
Docs level, plus the local cross build and package_windows.sh from the release tool; the workflow itself runs only after a merge on main or a tag |
|
Windows build (cmake/toolchains/, cmake/WindowsDependencies.cmake, Windows presets, #ifdef _WIN32 code) |
Full level; CI's windows job builds natively. Only a change to the WSL cross build itself (cmake/toolchains/, the windows preset) also needs cmake --workflow --preset windows from WSL, which CI does not run (Windows) |
The Demo, Dotio, i4sim and settings doctest suites register each case as <suite>:<case>. Use -R '^<suite>:' to select a suite, or -LE soak to skip the Demo crowd, long Dotio behavior and i4sim contact runs.
Docs-only pull requests. A pull request that changes only Markdown, docs/ or .agents/, or such files and a pointer whose Kinetra range holds only Markdown, docs/, .agents/, .claude/, .codex/config.toml, .github/ or tools/, which Lab's build does not read, is docs-only: the author records its checks and final review in the pull request description (workflow). It merges under Kinetra's merge rule. CI's changes job skips its build and tests and runs only the docs check, except when it touches one of three Lab paths that a test reads or the build copies: README.md and docs/media/ (kinetra_capture_tests), and labs/i4sim/blueprints/; or when its pointer's Kinetra range changes Kinetra's README.md or docs/media/, which kinetra_capture_tests reads too. Those build in full. The decision is tools/release/needs_build.sh, the one the release workflow uses.
The level is decided by the whole change; one Full-level file lifts everything. In the dev preset (Debug), the large-factory cases of kinetra_i4sim and the Demo crowd soak cases take minutes. For a quick targeted run, use the release preset.
Warnings. KINETRA_LAB_WARNINGS (on in dev and ci) reports the shared warning set for labs/ and launcher/. Engine warnings and warnings in designated warning-free Lab modules are errors in the Ubuntu linux and native windows jobs.
- Lab code had 119 warnings when this was introduced. New or changed Lab code must not add any.
- When a module becomes warning-free, add
kinetra_directory_warnings(${CMAKE_CURRENT_SOURCE_DIR}/labs/<module> RECURSE ${warning_free_mode})next to the others in the rootCMakeLists.txt, so CI keeps it that way; a literalAS_ERRORSwould ignoreKINETRA_LAB_WARNING_FREE_AS_ERRORS.
- Before starting work on a local branch, pull it first (
git pull --ff-only; the HTTPS fallback from the global Git rules when SSH is unavailable), in Lab and inexternal/Kinetra. A local branch can lag behind its remote, for examplemainafter a merged pull request or a feature branch after review commits. - Lab records one exact Kinetra commit. A change to
external/Kinetrais committed in Kinetra on its own branch, then the pointer is committed in Lab (git add external/Kinetra). - Never commit a pointer to a Kinetra commit that is not on a Kinetra branch. Push the Kinetra branch and open its pull request before pushing Lab.
- The Lab pull request links the Kinetra pull request. It states that Kinetra merges first, with a merge commit rather than a squash, so the pointer stays reachable.
- Lab
mainrecords a commit on Kinetramain. The order is: the Kinetra pull request merges; then the Lab pull request merges with its pointer at the Kinetra branch commit it was verified with; then a separate pointer-only pull request records the Kinetra merge commit, which Kinetra'slab-pointerworkflow opens and GitHub merges. Why: a pointer to the branch commit is reachable but not onmain, so the submodule onmainshows as modified in Lab until the pointer pull request merges. - A pointer-only pull request changes nothing but
external/Kinetra, to a commit on Kinetramain. Kinetra'slab-pointerworkflow opens it after each Kinetra merge, and hourly to catch up, and turns on auto-merge, so GitHub merges it once its CI passes; it waits while another Lab pull request changes the pointer (Kinetra rule, tool). An agent opens and merges one by hand only when the workflow failed. CI skips build and tests for it when Kinetra changed only Markdown,docs/,.agents/,.claude/,.codex/config.toml,.github/ortools/between the two pointers, an identical tree included, apart from Kinetra'sREADME.mdanddocs/media/, and runs only the docs check then; any other Kinetra change runs the full CI. A Lab pull request that only moves the pointer to a Kinetra branch commit, to verify an engine change whose one design document lives in Kinetra, is not pointer-only: CI warns Pointer not on Kinetra main and runs in full, and the author reviews and verifies Lab against the recorded engine commit, then merges after its Kinetra pull request. Never push the move to the Kinetra merge commit onto the Lab pull request that is open or reviewed: its CI would run again for one line. While the Kinetra pull request is in review and its branch moves, the Lab branch follows it with a pointer commit, as Kinetra's stack rules say. - The manual steps and commands are in External dependencies.
- Module READMEs:
launcher/README.md,labs/demo/README.md,labs/dotio/README.mdandlabs/i4sim/README.mdare the module READMEs. They follow the module template. - Thin sub-READMEs: a navigation-only README in an
include/,src/ortests/subdirectory is folded into its module README. - Architecture pages: the cross-application pages live in docs/.
- Design documents: Lab design documents go in docs/design/. A docs-only change needs none, and a change across Kinetra and Lab has one, in the repository with most of it (rule).
- Roadmap: application, tool and build work that is planned or only an idea goes in docs/roadmap.md; engine work in Kinetra's roadmap, with a linked item in each when it needs both. Format in the documentation guide.
- ADRs: Lab ADRs go in
docs/decisions/, created with its README when the first Lab ADR is written. - Media: a pull request that changes what a capture shows refreshes, in the same pull request, the captures that a media guide's table names for the change, and commits no other (Kinetra's rule): Lab's screenshots and clips in docs/media, and the shared-UI GIFs of Kinetra's README in external/Kinetra/docs/media, which a Kinetra change commits on its Kinetra branch.
tools/capture/capture_media.sh(capture tool) renders both; look at every refreshed file before committing it. The tour video is not in the repository:tools/capture/capture_tour.shrenders it into.docs/, which Git ignores, for an upload to YouTube, when the user asks for one, and refreshes the thumbnail indocs/media.
| Application | Implementation | Tests | Documentation |
|---|---|---|---|
| Bundled launcher | launcher/src, registrations | launcher/tests | launcher, launcher and overlays |
| Demo | labs/demo | labs/demo/tests | Demo |
| Dotio | labs/dotio | labs/dotio/tests | Dotio |
| i4sim | labs/i4sim | labs/i4sim/tests | i4sim, architecture |
| Shared Lab policy (settings rows, debug rows, input, pause, session base, debug layers under bodies) | labs/shared | shared tests; the overlay itself in Kinetra | launcher and overlays |
| Build | CMakeLists.txt, build.sh | ctest --test-dir build |
README |
| Windows release zip | tools/release, release.yml | the workflow's DLL import check | release tool |
| Media capture (screenshots and GIF clips) | tools/capture | capture tests | capture tool, media guide |