pkeppeler

deepcharter-conventions

Deep Charter's engineering conventions - code layout per feature, the M2 rules (attachments, versioning, PodEvents, mixins), test and evidence-scenario rules, the toolchain commands, and the merge gate. Load before writing, reviewing or simplifying code, tests, evidence scenarios or tools in this repo, and before merging a PR.

pkeppeler 0 Updated 17h ago

Resources

4
GitHub

Install

npx skillscat add pkeppeler/deepcharter/deepcharter-conventions

Install via the SkillsCat registry.

SKILL.md

Deep Charter conventions

Code lives under io.github.pkeppeler.deepcharter. Detail beyond this file:

  • tests.md: GameTest and client GameTest rules, stubs, helpers.
  • m2-rules.md: the M2 rules (attachments, versioning, PodEvents, mixins).
  • merging.md: tools/merge-queue.sh behaviour, cleanup and lock.
  • evidence.md: PR evidence scenarios, recording, before and after stills, diff-stills blind spots.

Agent Toolchain

  • Build, with the server GameTest and all gates: ./gradlew build
  • just check (./gradlew check, a subset of ./gradlew build); just audit (osv-scanner; needs it on PATH). audit.yml runs it weekly and on PRs touching dependency files; a lapsed ignoreUntil or a new advisory fails the weekly run.
  • Formatting: palantir-java-format via Spotless owns all Java formatting (4-space indent, 120 columns); spotlessCheck is part of check. Run just fmt (./gradlew spotlessApply) before handing work back. Spotless wraps a // comment past 120 columns mid-sentence and leaves the last word alone on a line; checkOrphanCommentGate (part of check, #1052) fails on it and names the line: reflow the comment to 120 columns. The Kotlin DSL files stay tab-indented and unformatted.
  • Fast test command (server GameTests): ./gradlew runGameTest
  • A change to gradle/*.kts, build.gradle.kts or settings.gradle.kts runs ./gradlew check -x runGameTest twice with the configuration cache on (no --no-configuration-cache: the first run stores the entry, the second reuses it), because CI uses it and a task action that captures a script-level val fails only there. The pre-push hook's compile step already runs with it on.
  • One server GameTest, or a prefix: tools/gametest.sh '<test_id or prefix*>'
  • Server suite in reverse name order (leak check): ./gradlew runGameTest -PgametestOrder=reverse
  • One server shard as CI runs it: ./gradlew runGameTest -PgametestShard=<i>/<BUILD_SHARDS> (weights in gradle/server-test-weights.txt; tests.md). It composes with -PgametestOrder=reverse.
  • One client test class: tools/gametest.sh --client <filter> or ./gradlew runClientGameTest -PclientTests=<filter>
  • Whole client suite (opens a window; the Mac runs at most two clients): ./gradlew runClientGameTest
  • Client tests and evidence scenarios in a cloud container (no display; the Mac rules above still apply): once per container apt-get install -y libegl1 libegl-mesa0, then SDL_VIDEO_DRIVER=offscreen LIBGL_ALWAYS_SOFTWARE=1 ALSOFT_DRIVERS=null ./gradlew runClientGameTest -x deleteGameTestRunDir -PclientTests=<Class>. -x deleteGameTestRunDir keeps the run dir and logs. For an evidence scenario, put the same three variables before tools/record-evidence.sh <scenario> (it sets DEEPCHARTER_EVIDENCE, without which a scenario does nothing, and builds the GIF with ffmpeg). No xvfb. Frame times mean nothing on the software renderer: assert behaviour, not speed. One client at a time, never alongside a server GameTest run (#1225).
  • Record PR evidence: tools/record-evidence.sh <scenario>
  • Compare stills: tools/diff-stills <before> <after> --out <dir> (--design-tour for the tour)
  • Python: run every tool, test and one-off script through tools/py <args>, never a bare python3: on this Mac that can be the system 3.9, and the tools need 3.10+. .python-version pins the version for the hook, CI and agents; tools/py needs uv on PATH and never downloads an interpreter (UV_PYTHON_DOWNLOADS=never), and its failure message says what to install (#710). A shell test stubs uv, not python3. A tool's #!/usr/bin/env python3 line stays: run the tool through tools/py, not as ./tool.
  • Every push goes through .githooks/pre-push (the SessionStart hook enables it); never --no-verify except in the cases pre-push-hook.md lists. What it runs, its budget and its failure messages are there.
  • Gates: tools/shellcheck.sh, tools/py -m unittest discover -s tools/tests -p 'test_*.py' (it includes test_docs.py: no docs/**/*.md file repeats a heading of the same level under the same parent headings, which catches a section pasted twice, and that no relative markdown link in README.md, docs/** or .claude/** points at a missing file, which catches a rename that left a link behind (skipped: URLs, which cover the pr-media links; pure anchors; and the never-committed original_flash_game/ and private/), and that the versions README.md and docs/PLAYING.md quote match the build (the failure says how to mark an intended other version); and test_unused_check.py, which fails the tree on an unused import, module-level name, function parameter, default no caller overrides, or parameter every caller passes the same literal in tools/**/*.py and tools/diff-stills), and tools/py tools/tests/gate_checks.py (the gate fixture checks; its name does not match test_*.py, so discover skips it). .githooks/pre-push runs them on push, except that a push whose range changes no Gradle input skips gate_checks.py and the Gradle checks (pre-push-hook.md); CI runs everything. In CI (Python and uv from .github/actions/setup-python-uv, the version from .python-version), the tool-tests-part <i> jobs run the unit tests, the shell tests, shellcheck and gate_checks.py in parallel (tools/ci-tool-tests.sh, tools/ci_tool_parts.py splits by tools/tests/ci-tool-test-weights.txt) and tool-tests is their aggregate; the build-checks job runs the rest of ./gradlew build, build-shard <i> jobs run the server GameTests from the compile job's output, and the build check is the aggregate of all three (merging.md). A change to any shell tool also runs every shell test, as CI's tool-tests job does: for t in tools/tests/*.test.sh; do bash "$t" || echo "FAILED $t"; done (it includes the repo-wide lints such as no-pipe-grep-q).
  • Dependency bump (a version in gradle/libs.versions.toml, a new Fabric API module): regenerate the locks and gradle/verification-metadata.xml with ./gradlew --write-locks --write-verification-metadata sha256 --warning-mode=summary --refresh-dependencies build, and commit gradle.lockfile, buildscript-gradle.lockfile, settings-gradle.lockfile and the metadata. --refresh-dependencies is needed so CI's empty Gradle home passes verification. A Renovate PR (renovate[bot], machine data) cannot regenerate the metadata, and the merge gate refuses its renovate/* branch: carry its commits to a replacement PR, run this command there, then the full pipeline (#757 did this for #728). Never hand-edit a checksum. Regenerating adds entries but never prunes old ones; leave stale entries (Gradle verifies only what it resolves), except one whose version the audit flags (it scans this file): prune that, and prove with a cold-cache build (empty GRADLE_USER_HOME) that nothing still resolves it. After regenerating, git diff gradle/verification-metadata.xml must remove no natives-linux or epoll entry; if one vanishes, restore it or regenerate in a Linux container (docker run --platform linux/amd64 eclipse-temurin:25-jdk, empty Gradle home). Keep the trusted-artifacts block (Loom's net.minecraft:minecraft-{merged,common,clientOnly}-* jars differ per machine). If CI on Linux fails with "not part of the dependency lock state" for a module, add it to dependencyLocking { ignoredDependencies } in build.gradle.kts (Minecraft's OS-specific libraries). A new Fabric API module also needs adding to the first [[PackageOverrides]] entry in osv-scanner.toml, or the license audit fails; a GeckoLib bump is a new audit (geckolib-audit.md) and updates geckolibSha512. Audit command: osv-scanner scan source --config=osv-scanner.toml --lockfile=gradle.lockfile --lockfile=buildscript-gradle.lockfile --lockfile=gradle/verification-metadata.xml --licenses=MIT,Apache-2.0,BSD-2-Clause,BSD-3-Clause,ISC,0BSD,BlueOak-1.0.0,CC0-1.0,Unlicense,EPL-1.0,EPL-2.0.
  • A workflow or action that uses setup-gradle makes its first Gradle call, the dependency-resolving one, through tools/ci-gradle-resolve.sh; tools/tests/ci-gradle-resolve-gate.test.sh fails a file that never names it or calls ./gradlew before it. The script retries a broken restored cache once (#830) and a repository that fails to answer (a plugin or module "not found", an HTTP 429 or 5xx, a timeout) with backoff (#1358); any other failure fails at once. The later Gradle calls in the job find the dependency classpaths resolved; Loom's natives, and whatever only runClientGameTest pulls, are not covered; Minecraft's asset objects have their own cache entry, which .github/actions/loom-assets restores and only cache-seed.yml saves, and a caller that names downloadAssets gets the same retries (#1703). On GitHub Actions only, the script first installs gradle/ci-central-mirror.init.gradle.kts into the runner's Gradle home, so every Gradle call in the job resolves Maven Central from Google's mirror of it (ADR 0101); local builds are untouched, and verification and the locks stay as they are.
  • Conflict markers (#490): tools/tests/conflict_markers.py fails on a <<<<<<<, ||||||| or >>>>>>> line at line start in any tracked text file, and on a bare ======= between such markers. The pre-push hook runs it first, and test_conflict_markers.py runs it in CI tool-tests. Its tests build markers from repeated characters, so there is no exclusion list; a fixture needing a marker does the same.
  • Comment length (#1222): tools/comment_length_gate.py fails a comment line (Javadoc, block, //, trailing too) that a branch adds to src/**/*.java over 120 columns; palantir never reflows comments. It reads git diff -U0 from the merge base with origin/main: untouched lines, code lines and a one-token comment (a URL, an @see or {@link} target) pass. CI runs it in tool-tests after merge-main, the pre-push hook with --fetch; a missing origin/main or merge base fails loudly. Temporary: #1223 rewraps the existing lines and makes it a whole-tree rule, which deletes the diff logic.
  • A tool that deletes or writes from external data (an index, lock or log) resolves each path and checks it lies under its root before any unlink or write, and a test plants the escape in the stored copy, not only in the new input.
  • Loot tables: tools/tests/test_loot_table_format.py (run by unittest discover) fails on a pre-26.3 conditions or functions key in any loot_table/**/*.json, because 26.3 ignores them silently; write condition (one object with type) and modifier. LootTableDropsTest rolls every shipped table.
  • Sound credits (CREDITS.md, tools/sounds/*.json): a source's credit and manifest license state only what the file's tag or its page says; an unstated licence is none stated.
  • After gradle wrapper regenerates gradlew (a Renovate wrapper update too), run tools/gradlew-registry-block.sh to re-add its #1120 block (the per-checkout daemon registry); tools/tests/gradle-worktree-isolation.test.sh goes red without it.
  • Keep Error Prone's --add-exports/--add-opens flags in org.gradle.jvmargs (gradle.properties): they make javac run in the daemon instead of a forked worker per worktree (#632).
  • Enum switches (#1217): name every constant, so a new enum member fails the build at each switch that forgot it. Error Prone's MissingCasesInEnumSwitch (no default) and UnnecessaryDefaultInEnumSwitch (every constant named, then a dead default) are ERROR, and checkEnumSwitchGate, part of check, fails a statement or expression switch over an enum whose default hides a constant, unless it carries // enum-default: <reason>. -PenumSwitchList lists every enum switch with a default; the limits are in tools/EnumSwitchGate.java.
  • Keybinds (#1556): checkKeybindGate, part of check, fails a new KeyMapping( in src/main or src/client whose id has no line in gradle/keybind-allowlist.txt (key.deepcharter.<id> <why no vanilla key or click fits>), a key.deepcharter.* lang key with no line, and a line no key uses. The reason is three words or more and not judged: read it, and reject one that does not say why a vanilla key or a click fails. The limits are in gradle/keybind-gate.gradle.kts; designing-mechanics says to prefer vanilla keys and clicks first. Two of the mod's keys never share a default key: HandbookControlsClientTest fails a clash unless the pair is in its SHARED_DEFAULTS with why the two never act in the same place (#1712); check every InputConstants.KEY_ default under src/client before you pick one.
  • Action bar (#1769): the vanilla action bar draws one centred, unwrapped line, so every line the mod sends there fits 316 GUI pixels (the 320-wide narrowest GUI less the backdrop) with its widest real arguments, cause and fix both kept. ActionBarFitClientTest measures each line in src/gametest/resources/action-bar-lines.txt with the game's font and lists every one over; tools/tests/test_action_bar_lines.py keeps that list equal to the sends in src/main and src/client (the overlay forms: sendOverlayMessage, ::sendOverlayMessage, setOverlayMessage, displayClientMessage(..., true), sendSystemMessage(..., true)): a literal translatable("<key>" counts, and a send whose line arrives through a variable, an enum or a built key carries // action-bar: <key or prefix.*>... naming every key that can reach it (not judged: check it). Shorten a line first; one that cannot keep its cause and fix in the bar goes to chat instead (sendSystemMessage(line), or (line, false)), as message.deepcharter.pod.not_crew does: a 32-letter charter name never fits.
  • Suppressions: before suppressing a deprecation or disabling an Error Prone check, look for a non-deprecated replacement, and give a reason that can be checked against the 26.3 jar. // colour-ok: <reason> (colour gate), // input-literal: <reason> (input literal gate: .button() or .key() compared with a number or char literal, or new MouseButtonInfo( or new KeyEvent( with a number or char literal first, in src/client/java and src/gametest/java; SDL numbers mouse buttons from 1, so use InputConstants.MOUSE_BUTTON_* and KEY_*; a line scan, so a switch or a number passed through a variable is not seen), // vanilla-ok: <reason> (vanilla sound gate, #1557: a reference in src/main or src/client Java to a sound on gradle/banned-vanilla-sounds.txt, such as SoundEvents.GENERIC_EXPLODE, Musics.* or a .explode( call, or a minecraft:music.*, minecraft:ambient.* or explosion sound id in a JSON file under src/main/resources (sounds.json, a dimension type, a biome), breaks the tone (#1293, #1296); use a DeepSound or make one in tools/sounds. Mark only a Java line that must keep the vanilla sound; a JSON id that must stay is listed with a reason in gradle/vanilla-sound-allowlist.txt (<path> <id> <reason>). Ban another sound by adding a line to the list; the limits are in gradle/vanilla-sound-gate.gradle.kts), // tick-wait: <reason> (tick-wait gate), // one-shot-ok: <reason> (one-shot gate: a throw after a poll's flag set that only forces one more poll, never a check that should fail the test; tests.md), // sync-load: <reason> (sync-load gate: a getChunk( or getChunkAt( in a src/gametest server test or its support, outside test/evidence, loads on the server thread and stalls every test in the batch; wait with FarChunks.whenBlocksLoaded or awaitEntityTicking, or mark a load that must happen in one tick or of a chunk that is already loaded; getChunk(..., false) does not load and needs none; tests.md), // force-ok: <reason> (force-chunk gate: a chunk forced or released outside FarChunks is missing from its count; only for a case with no GameTestHelper, such as a client test or an evidence scenario), // light-wait-ok: <reason> (light-wait gate: a block-light read in a server GameTest waits under FarChunks.Deadline, never inside thenWaitUntil or succeedWhen or in a method with no deadline; the marker is for a read that is not a wait, such as an assertion after a deadline-based wait), // arrived-ok: <reason> (arrived gate: a player's teleport and a later addFreshEntity or startRiding go in two server blocks of a client test, evidence class or test helper, with ClientWait.arrived between them; only for a teleport that leaves no chunk cold; tests.md), // await-ok: <reason> (await-then-expect gate: only for an assertion after Deadline.await that is meant to run, such as a throw that forces another poll after an await on a constant false), // await-ok: <reason> (await-then-expect gate: only for an assertion after Deadline.await that is meant to run, such as a throw that forces another poll after an await on a constant false), // world-clock: <reason> (world-clock gate), // hud-toggle: <reason> (HUD-toggle gate), // keep-clear-ok: <reason> (keep-clear gate: a src/client/java file that adds, attaches or replaces a HUD element with HudElementRegistry registers what it draws with HudKeepClear.register, one rect function shared by its draw and its keepClear, or marks why there is nothing to keep clear of; the step popup places itself by that list), // entity-query: <reason> (entity-query gate), // class-ok: <reason> (record-holder gate: a private or package-private static nested class that only holds final values set from its constructor must be a record; the marker goes on the class line or the contiguous // lines above it, for a class that relies on identity or must stay one), // light-settled-ok: <reason> (light-settled gate: a pod seat or move after a RoomCarver carve in one client method, where the carve cannot affect the rider; tests.md), // test-seam: <reason> (test-only gate: only for a deliberate, permanent seam), // const-param: <reason> (constant-parameter gate, checkConstantParams: a parameter every src/main and src/client caller passes the same literal or enum constant, src/gametest callers not counted; inline it and drop the parameter, or mark a deliberate seam with a reason of two or more words that is not a stock phrase; before dropping a parameter, read the method body: a parameter that shadowed a field or a constant changes the body's meaning once it is gone), // enum-default: <reason> (enum-switch gate: a default in a switch over an enum that leaves constants unnamed; only where the other constants really share one outcome or the default is the loud refusal of a member that cannot reach it, and the reason names why, not "the rest"), // fixed-pos: <reason> (fixed-position gate: a literal world Y in an evidence scenario, only where the place cannot come from an anchor, a carved room, the layer's geometry or the decay tuning), // level-height: <reason> (fixed-position gate: a raw level-height read in src/gametest that is about the level, not a layer; tests.md), // seats-pod: <reason> (light-settled gate: a helper in another class that seats or moves a pod; the gate counts Class.helper(...) as a seat and fails an unmarked one; tests.md), # unused-ok: <reason> (Python unused-code gate; a _-prefixed parameter is exempt), and a NOISE_FAMILIES entry in tools/diff-stills (blind spots in evidence.md). A marker may sit anywhere in a wrapped statement or the contiguous // lines above it (markedNear in gradle/literals.gradle.kts, markerFor in tools/TestOnlyGate.java). The gates do not judge the reason, except unused-ok, which rejects a one-word or stock reason: a speed bump, not a judge, so read every reason. Reject an empty or generic reason, and any new NOISE_FAMILIES prefix without measured noise behind it. A temporary gate exemption needs an open issue that deletes it; a code comment alone is not tracking.
  • A worldgen feature that places a vanilla block not named in its config exposes it to ObtainableItemsTest's derivation; the test fails on a deepcharter feature type it neither encodes nor knows.
  • Craftability (#1603): ObtainableItemsTest's walk also fails an item of ours with no source (a drop, a terminal sale or hand-out in codeSources(), or a recipe from what the world yields) unless UNOBTAINABLE names it with why, and fails an ingredient of a recipe of ours, a handbook step's target or the restore catalyst that the walk never reaches. A new item gets a source, a recipe or an entry in the same PR.
  • Feature map (#510): the game's graph lives in docs/feature-map/map.json; a gameplay PR updates it in the same PR (tools/py tools/feature_map.py validates it; the outputs are generated, never committed, ADR 0054) or says No map change: <reason> in its body, which tools/merge-pr.sh checks. Reviewers check the map was updated and its statuses are true. Rules, schema and publishing: the feature-map skill.
  • Merge: in batches (the rule is in .claude/CLAUDE.md); tools/merge-pr.sh --solo <reason> <n> (a batch of one: a PR push runs only the GameTest classes its change can affect, and landing needs the full suites a batch PR runs, ADR 0116); two or more PRs: tools/merge-batch.sh <n>...; one at a time: tools/merge-queue.sh <n>.... Read-only verdict, for reviewers: tools/merge-pr.sh --check <n> (not gh pr checks). Never gh pr merge or a raw PUT .../merge. The merge, handoff and SessionStart tools use REST (gh api repos/...) only, never gh pr, gh issue or GraphQL (the cloud proxy blocks it; tools/tests/no-gh-graphql.test.sh enforces it). A PR that changes gate code runs tools/gate-sweep.sh <pr> before cycle 2 and carries a Gate sweep (<sha>): body line the merge gate checks. A PR that changes a worldgen path (tools/cost-paths.txt) runs tools/cost-pair.sh at its last head and carries the Cost pair (<sha>): body line it prints, which the merge gate checks too (tests.md, ADR 0124). Detail in merging.md.
  • Integration branch: main. Squash merge.
  • Machine (16 GB, 8 cores): at most 5 Gradle-heavy agents (pre-push hooks were SIGKILLed at 5-6 of them). Never ./gradlew --stop (it kills every agent's daemon), pkill java broadly or start caffeinate (the user runs it); signal only processes you started, by PID; never touch ~/.cache/deepcharter/. Never force-push.
  • Agents running Gradle use $(git rev-parse --git-common-dir)/gradle-slot.lock (or DEEPCHARTER_GRADLE_LOCK) instead of any per-session lock path, so they share one slot with the pre-push hook: flock -o "${DEEPCHARTER_GRADLE_LOCK:-$(git rev-parse --git-common-dir)/gradle-slot.lock}" ./gradlew ... (skip flock where it is missing). Never push while holding the Gradle lock; the pre-push hook takes the same lock.
  • Blame: git config blame.ignoreRevsFile .git-blame-ignore-revs (once per clone; worktrees share it).
  • A rule stated in .claude/CLAUDE.md is not repeated here; point to it.
  • A migration's reason lives in one place, the lib header or the test that guards it, not in a comment in each caller.
  • Audit pages (docs/tooling/*-audit.md): state the method once and each condition once (the two #641 pages repeated them).
  • Vendored tools under tooling/: their dependencies change only with a new audit, so renovate.json ignores them; its ignorePaths replaces Renovate's :ignoreModulesAndTests list (it does not merge), so that list is restated beside tooling/**.
  • Git, for agents that edit (implementer, simplifier): work only in the worktree the brief names, never the main checkout. No agent, reviewers included, runs git checkout, switch or reset in the main checkout. Commit as you go (a WIP commit is fine). Push the branch (git push -u origin <branch>) after the first commit and again before you report; on the first push, open a draft PR whose body says Closes #<issue>. Never push main, merge, or run tools/mark-review-passed.sh: those are the orchestrator's. Why: nothing in flight may live only on this Mac, and a restart once left 26 uncommitted files on #482.
  • If Bash refuses a heredoc, loop, long chain or path containing git as unverifiable, run it from a script file in your own scratch subdirectory.
  • A brief that repeats runs until a target is met sets an iteration cap (for example 3 run pairs); at the cap, stop and report what is left.
  • Client slots: on macOS at most two game clients run at a time (DEEPCHARTER_CLIENT_SLOTS, default 2); a run that finds both taken waits. Details, and what to do after a Ctrl-C, in tests.md.
  • On macOS, client GameTests, tools/record-evidence.sh and tools/play.sh render with Vulkan (MoltenVK), so they run with the screen locked. DEEPCHARTER_GL=1 uses OpenGL instead (for example for Iris shaders).
  • Client tests are slow and open a window: run them only for the class you changed, plus every class that reads shared visuals you touched (tests.md). CI runs the full set when a PR changes game code (CLAUDE.md).

Code layout

Code is grouped by feature under io.github.pkeppeler.deepcharter. The features are layer pod scanner and the M2 set charter terminal colony ore handbook transmission wreck fuel market upgrade repair hangar sound surface creature suit continuity. The client mirrors each one under client/<feature>/ (colony has only a client mixin and its refusal screen, client/colony/). A feature has:

  • XInit.init(), called once from DeepCharter (XClientInit.init() from DeepCharterClient). It calls the init() of each part, so adding a part edits the feature, never the entrypoints.

  • XRegistry.register(): its entities, blocks, items and other registrations.

  • XTuning, when the feature has tunables: one record of them, read as XTuning.DEFAULT.thing(). A bound a formula needs on a tuning value (PodGlideTuning.catchUp > 1) is checked in the record's compact constructor.

  • Client art (colours, sizes, spacing, visual timings) is not a constant in Java. It is resource-pack data in assets/deepcharter/theme/<area>.json, read as CrtTuning.current().thing() and the like, and a pack restyles it on F3+T (skins.md, ADR 0032). ./gradlew checkColourGate, part of check, fails the build on a colour literal in src/client/java outside client/theme/; a line that must keep one ends with // colour-ok: <reason>.

  • Lang keys: one fragment per feature, src/lang/en_us/<feature>.json (outside the resources source set, so it stays out of the jar), merged and sorted into assets/deepcharter/lang/en_us.json at build time. That file is generated: never edit it. A key lives in exactly one fragment; a duplicate fails the build. An empty fragment is {}.

  • Commands, always added with FeatureCommands.register("<feature>", ...), which puts them under /deepcharter <feature>. charter and handbook have a XCommands stub; add one to any other feature that needs it.

  • Null safety: NullAway checks only @NullMarked packages (OnlyNullMarked, JSpecify mode, ERROR on every source set). Every package with Java sources needs a package-info.java with @NullMarked: checkNullMarkedGate (part of check; tools/tests/null_marked_gate_check.py tests it) fails the build on one without, naming the package. A new package gets the file in the PR that adds it. To bring a feature under it, add one to every package in its footprint, across src/main, src/client and src/gametest (gametest packages do not mirror <feature>), all in one PR:

    @NullMarked
    package io.github.pkeppeler.deepcharter.<feature>;
    
    import org.jspecify.annotations.NullMarked;

    Fix the findings with org.jspecify.annotations.Nullable, the one the dependency and options are wired for. @Shadow fields are excluded from NullAway (build.gradle.kts NullAway:ExcludedFieldAnnotations), and test.mixin now has some. @Unique fields are the open case: the first PR that adds one checks whether it needs an exclusion. A CrtScreen widget field that layout() assigns is @Nullable and read through Objects.requireNonNull(field, "<built by layout() in init()>"); prefer a local when nothing reads the widget later. A requireNonNull on a per-tick, per-frame or per-cell path takes the Supplier message overload, so the message is built only when it fails.
    Javadoc on a nullability annotation needs a non-obvious why. Pass a checked value as a parameter instead of re-reading a global and asserting. Make the null state unrepresentable instead of writing an accessor that only asserts.
    Marking package B makes B's signatures non-null for every marked caller, so a PR can pass its own CI and break main once another merges: before queueing a batch of NullAway PRs, run the integration compile on the merged tree. NullAway stops at the first source set with errors (main, then client, then gametest), so rebuild until the whole build is clean, and probe a zero-finding package with a temporary String s = null;.

A server-thread wait (Future.get) in a tick path takes one deadline for the whole operation, not one per item, and a timeout falls back to the safe path, not an exception that strands state. The light engine's futures are completed by the server thread itself, so never wait on one from it.

Do not spell out counts of enum members or registry entries in prose ("the seven ores"): they drift. Name them, or point at the code.

A value that only some enum constants have (a title, a colour, a sprite) goes on its own closed enum, not a @Nullable field with throwing switches for the rest (CockpitHud.Meter beside CockpitHud.Part, #1436).

A per-tick hook must not throw on a missing level: look it up with server.getLevel(...) and handle null.

A new part that needs its own init() and has no feature of its own gets a stub in its feature, wired into that feature's XInit already: pod/PodComponents (#65), pod/PodTowing (#76) and layer/LayerStructures (#79).

M2 rules

m2-rules.md applies to any change under src/main or src/client: attachments and versioning, PodEvents, Unreadable handling, mixins, sealing.