S9SourceNine Labs / CMAPI Docs 1.0
CMAPI / Maintainers

Standalone runtime architecture

The responsibility audit and architecture that replaced BepInEx.

View source ↗
CMAPI 1.0.0Standalone runtimeWindows x64Tested with Planet Crafter 2.008

CMAPI standalone runtime audit (0.13.0)

This is the engineering record for CMAPI's pre-1.0 standalone runtime. It is not the deferred public documentation project.

Responsibility map

Responsibility CMAPI owner
Native process bootstrap Pinned UnityDoorstop 4 x64 proxy distributed inside the CMAPI package
Early managed validation and handoff CMAPI.Bootstrap
Assembly resolution Bootstrap resolves its private Cecil dependency; runtime resolves only CMAPI runtime libraries and each mod's private dependencies
Unity lifecycle entry Bootstrap injects one Planet Crafter-specific Application initialization call; RuntimeBehaviour owns update and shutdown
Runtime paths and configuration CMAPIPaths, ConfigManager, and the installer ownership receipt
Logging and catastrophic startup reports BootstrapLogger, RuntimeLogger, RuntimeStartupFailureReporter, and console IPC
Harmony/patch infrastructure None currently required by CMAPI core
Plugin/mod lifecycle ModLoader, CMAPI manifests, CMAPI.Mod, owner-scoped services, and cleanup hubs
Commands, gameplay APIs, updates, backups, menu CMAPI.Runtime only

Startup sequence

  1. winhttp.dll enters CMAPI.Bootstrap.dll through the packaged Doorstop configuration.
  2. Bootstrap validates the executable, game/runtime files, product version, and Assembly-CSharp identity, then installs its narrow lifecycle hook.
  3. At the validated Unity Application boundary, bootstrap loads only CMAPI.Runtime.dll and calls RuntimeEntrypoint.Start().
  4. A hidden persistent RuntimeBehaviour owns Unity update and shutdown.
  5. RuntimeHost starts logging, console IPC, compatibility inspection, services, commands, save safety, update checks, and the CMAPI mod loader.
  6. Ordinary mods load only from CMAPI/Mods and derive from CMAPI.Mod in CMAPI.API.dll.

The bootstrap contains no commands, mods, public gameplay services, menus, updates, or save logic. It is not a second runtime or a generic Unity loader.

Failure policy

Bootstrap does not rewrite game assemblies on disk. A wrong executable, missing/invalid managed directory, incompatible game module, missing runtime, or failed lifecycle handoff produces:

  • CMAPI/startup-failure.txt with game version, CMAPI version, compatibility, failure, and safe-stop confirmation;
  • a timestamped report under CMAPI/CrashReports;
  • a concise launcher error instead of an unexplained IPC timeout.

Unknown Assembly-CSharp MVIDs reach member-level capability inspection. Missing hooks disable only the affected surface when safe; core player, environment, or content incompatibility is explicit in gameinfo and health_check.

BepInEx cutoff

CMAPI has no BepInEx build, runtime, packaging, installer, or distribution dependency. The private comparison adapter and its scripts were removed in 0.13.0. No BepInEx assembly may be referenced by a CMAPI project or included in a source/release package.

CMAPI has never had a public release, so there is no public legacy migration contract. Setup does not inspect, disable, restore, or remove unrelated BepInEx files. An unowned root bootstrap is a conflict and fails closed. Existing receipt-owned standalone CMAPI installations remain eligible for update and repair.

Distributed third-party components

Component Purpose License obligation
UnityDoorstop 4 x64 Native Mono process/bootstrap entry LGPL-2.1; ship complete license and exact version/source provenance
Mono.Cecil 0.11.6 In-memory Planet Crafter-specific lifecycle hook MIT; ship license notice
Newtonsoft.Json 13.0.4 Runtime configuration, manifests, data, IPC, and feeds MIT; ship license notice
Microsoft .NET runtime Self-contained launcher and setup wizard MIT plus bundled third-party notices; ship exact publishing version

The release builder treats the native binary, full licenses, version provenance, package layout, checksums, and absence of game/development/legacy files as hard gates.

Intentional scope

CMAPI supports The Planet Crafter on Windows x64. It does not discover arbitrary Unity games, generic preload patchers, or a second plugin model. New bootstrap behavior must be justified by a concrete Planet Crafter requirement.