refactor(scum): use runtime capability probes

This commit is contained in:
npc0-hue
2026-07-29 18:34:16 +08:00
parent 03339fb3e8
commit d7465bfd32
26 changed files with 530 additions and 533 deletions
@@ -1,30 +1,23 @@
## Why
The five recent SCUM deliveries implemented most SCUM-specific domain services and React panels in `platform/` and `platform_web/`, leaving the SCUM plugin as a manifest and schema declaration. This makes the plugin non-portable, hard-codes SCUM into the platform host, and does not provide a real server-side adapter that can collect events or execute approved game operations.
SCUM plugin behavior must survive server updates without treating a game, UE4SS,
database, build, or revision string as a feature kill switch. The prior plan
incorrectly used static compatibility gates.
## What Changes
- Move SCUM-specific feature ownership for configuration, local game-player intelligence, controlled player state changes, gifts, and map trajectories into the SCUM plugin package and its Companion runtime.
- Introduce a long-running, platform-authorized SCUM Companion adapter that receives only typed commands, emits only declared semantic events, and reports typed, idempotent results.
- Add one explicitly enabled, version-bound `vehicle.spawn` operation. It accepts only plugin-catalogued vehicle codes and can generate only the fixed `#spawnvehicle <vehicleCode>` template through a Companion-local, platform-authorized transport port; it is not a raw-RCON interface.
- **BREAKING** Replace platform-owned SCUM panels and SCUM-specific API/domain endpoints with a plugin-page module mounted by the generic platform plugin host.
- **BREAKING** Replace platform-owned SCUM projections and persistence with plugin-scoped local data accessed through generic platform isolation, audit, job, and storage primitives.
- Preserve the existing platform responsibilities for authorization, server/tenant isolation, review and approval, durable job delivery, audit records, retention enforcement, and generic page hosting.
- Treat current platform-side implementations as transitional control-plane behavior; do not claim an operation is available until the Companion has a verified executor or event producer.
- Move all SCUM feature authority to the plugin and its Companion, with generic
platform authorization, isolation, audit, queue, storage, and Run channels.
- Replace build/version/revision gates with runtime schema and capability probes.
- Let Run provide bounded SCUM stdout/stderr records, typed database reads, and
fixed administration operations only through platform-authorized channels.
- Require field allowlists, pre-read/safe-window/write-confirmation flows, and
`succeeded`/`failed`/`unknown` results for mutating adapters.
- Preserve fixed-template `vehicle.spawn`; its private `#spawnvehicle
<vehicleCode>` audit text never enters a result or page payload.
## Capabilities
## Non-Goals
### New Capabilities
- `scum-plugin-feature-ownership`: Defines the required ownership boundary between the generic platform and the SCUM plugin, including plugin-page mounting and migration of the five SCUM feature areas.
- `scum-companion-runtime-adapter`: Defines the safe, typed Companion command/event adapter needed for real SCUM operation execution and semantic event collection.
### Modified Capabilities
- None. The prior SCUM requirements currently exist only in completed change artifacts, not in the repository's canonical `openspec/specs/` tree; this change establishes their replacement canonical contract.
## Impact
- Affected roots: `plugins/examples/scum-server-plugin/`, `plugins/sdk/`, `platform/`, and `platform_web/`.
- The SCUM Companion becomes the only place that translates approved typed operations into SCUM/RCON/legitimate-extension work and translates server signals into semantic events.
- Existing SCUM-specific platform APIs, models, services, and hard-coded frontend panels will require a staged migration with compatibility checks; unrelated platform and plugin behavior remains out of scope.
No arbitrary RCON, SQL, shell, socket, path, DSN, credential, raw database
row, OCR, screenshot, keyboard/mouse injection, or desktop automation is
introduced. No SCUM import or `game.scum` branch is added to `platform_web`.