Complete platform management workflows
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
schema: spec-driven
|
||||
created: 2026-07-13
|
||||
@@ -0,0 +1,103 @@
|
||||
## Context
|
||||
|
||||
The platform already has control, job, log, and artifact channels, plus plugin-declared remote access capabilities for FTP, rsync, run-mediated files, SQL, logs, and RCON. The missing layer is operational delivery: operators need to generate a per-server run executable, download it for a selected OS/architecture, authenticate it with the server's current database-backed run key, update it after it is online, and let plugins declare how run finds and controls the actual game server.
|
||||
|
||||
The old SCUM stack has useful patterns: a run-side process controller, a separate client/robot manager for cases where server control requires a game client or custom automation, Git-based source updates, Go toolchain checks, FTP log polling, SQLite reads, and command forwarding. This design generalizes those patterns without making SCUM special in platform core.
|
||||
|
||||
## Goals / Non-Goals
|
||||
|
||||
**Goals:**
|
||||
|
||||
- Let server owners generate and download a server-scoped run package from the server list or server action menu.
|
||||
- Store one current run key and one current client-manager key per server/component in the database, encrypted at rest, with redacted secret references in APIs and logs.
|
||||
- Let online run endpoints self-update through a platform job that stages, verifies, swaps, and reports rollback-safe status.
|
||||
- Let plugins declare runtime profiles that explain how to find a server, start/stop it, check dependencies, install missing dependencies, collect live and historical logs, and expose files, FTP/rsync, SQL, and RCON.
|
||||
- Let plugins declare optional client-manager build profiles for cases like SCUM where a separate executable must be compiled from an open repository with a distinct authentication key.
|
||||
- Keep all browser and plugin operations platform-mediated and preserve channel isolation for control, jobs, logs, files, and artifacts.
|
||||
|
||||
**Non-Goals:**
|
||||
|
||||
- No billing, cloud host sales, server rental marketplace, or cloud-provider provisioning workflow.
|
||||
- No raw run keys, client-manager keys, FTP passwords, database DSNs, RCON passwords, direct sockets, or host paths in plugin pages or platform_web responses.
|
||||
- No arbitrary plugin shell scripts for dependency installation or build execution.
|
||||
- No requirement that every game use run; FTP-only, FTP+RCON, and custom-client modes remain valid when declared by the plugin.
|
||||
- No production package-signing infrastructure beyond local checksums/signature hooks in the first implementation.
|
||||
|
||||
## Decisions
|
||||
|
||||
### Decision 1: Distribution artifacts are secret-bearing platform records
|
||||
|
||||
Platform stores generated run and client-manager packages as artifacts with a distribution record containing kind, server instance, plugin ID, target OS/architecture, source revision, checksum, status, component kind, and key generation. The package config contains the current active key for that server/component because the remote executable must authenticate with it. API responses, logs, job payloads, plugin SDK payloads, and UI state expose only artifact IDs, key generation, and redacted secret refs.
|
||||
|
||||
Alternative considered: ship one global run binary and ask users to hand-edit config files. Rejected because it causes copy/paste key exposure, weak auditability, and poor operator experience.
|
||||
|
||||
### Decision 2: Run and client-manager credentials are separate singleton keys
|
||||
|
||||
Each server/component has exactly one active run key and, when needed, exactly one active client-manager key. Run and client-manager keys remain different secrets, but platform does not keep multiple simultaneously valid keys for the same component. Resetting a key replaces the encrypted database value, increments the key generation, invalidates every older run or client package for that component, and requires regenerating and redeploying the affected package.
|
||||
|
||||
Alternative considered: reuse the run key for plugin client managers. Rejected because client managers may have broader game-specific control surfaces and need independent reset, revocation, and audit.
|
||||
|
||||
Alternative considered: issue temporary enrollment tokens and exchange them for runtime keys. Rejected because the desired operator model is a single database-backed current key per server/component, with explicit reset when trust must be revoked.
|
||||
|
||||
### Decision 3: Plugins declare runtime profiles, not raw local paths
|
||||
|
||||
Plugins define runtime profiles with logical server discovery probes, lifecycle actions, dependency probes, dependency install plans, log sources, transport profiles, and optional client-manager profiles. Operators bind those logical keys to a server instance at setup time. Run resolves bindings locally and returns logical status, not raw host paths.
|
||||
|
||||
Alternative considered: hardcode Minecraft and SCUM discovery rules into platform. Rejected because the platform should remain a game server management core, while game-specific control knowledge belongs in plugins.
|
||||
|
||||
### Decision 4: Dependency install is typed and reviewable
|
||||
|
||||
Dependency checks are read-only probes such as command version, service existence, port availability, file presence under scoped roots, Steam app presence, Java version, Docker availability, or Windows package presence. Install plans are typed steps with approved package managers or verified downloads. Platform shows the plan and queues it only after operator approval.
|
||||
|
||||
Alternative considered: let plugins provide arbitrary install shell scripts. Rejected because it creates an unrestricted execution path and conflicts with run security rules.
|
||||
|
||||
### Decision 5: Client-manager builds are source-pinned build jobs
|
||||
|
||||
Plugin client-manager profiles declare a repository URL, branch/tag or pinned revision policy, supported targets, build system, config template keys, dependency hints, and produced artifact paths. Platform creates a build job in an isolated workspace or future build worker, redacts secrets from logs, writes generated config from secret refs, and publishes a downloadable artifact.
|
||||
|
||||
Alternative considered: require plugin authors to upload prebuilt binaries only. Rejected because SCUM-style managers need reproducible platform-side injection of per-server config and keys.
|
||||
|
||||
### Decision 6: Run owns local execution and transport adapters
|
||||
|
||||
Run is the multi-platform server launcher and transport agent. It starts/stops third-party programs through plugin lifecycle profiles, tails stdout/stderr and declared log files, transfers files through the artifact channel, and performs declared FTP/rsync, SQL, and RCON operations through scoped adapters. Long transfers must not block heartbeat, job ack/result, or log ingest.
|
||||
|
||||
Alternative considered: let platform_web or plugin pages connect directly to FTP/RCON/SQL. Rejected because that exposes credentials and bypasses platform authorization, audit, and channel isolation.
|
||||
|
||||
### Decision 7: Live and historical logs share durable sequence semantics
|
||||
|
||||
Run streams live process output and file tails through the log channel with source IDs and monotonically increasing sequences. Historical logs are fetched through backfill jobs that use checkpoints, file fingerprints, FTP polling cursors, or database cursors to avoid duplicates. Platform_web displays live tail and history through platform APIs only.
|
||||
|
||||
Alternative considered: return log bodies inside job results. Rejected because logs can be large and must not compete with control and job metadata.
|
||||
|
||||
### Decision 8: Self-update is staged and rollback-safe
|
||||
|
||||
When run is online and supports the update capability, platform queues an update job with an artifact ref and checksum. Run downloads via the artifact channel, verifies checksum/signature metadata, stages the new binary, drains or rejects new local work, swaps atomically where supported, restarts, and reports success or rollback failure. Offline endpoints keep the latest downloadable package for manual replacement.
|
||||
|
||||
Alternative considered: send a raw command to pull the latest repository. Rejected because it is platform-specific, hard to verify, and unsafe to audit.
|
||||
|
||||
## Risks / Trade-offs
|
||||
|
||||
- [Risk] Build jobs can execute untrusted repository code. Mitigation: require plugin-declared build profiles, pinned refs, isolated workspaces, bounded logs, and a later sandboxed build worker before public plugin builds.
|
||||
- [Risk] Self-update can leave a remote run offline. Mitigation: stage artifacts, verify checksums, retain previous binary, report last-known version, and keep manual download available.
|
||||
- [Risk] Dependency install plans differ across Windows, Linux, and macOS. Mitigation: model probes and install steps per target platform, and show unsupported targets before dispatch.
|
||||
- [Risk] Historical log backfill can duplicate records. Mitigation: persist per-source checkpoints with file fingerprints, offsets, sequence acknowledgements, and cursor metadata.
|
||||
- [Risk] Resetting a key immediately breaks deployed run or client-manager binaries. Mitigation: make reset confirmations explicit, mark old packages revoked, show that regeneration is required, and keep online update/manual download paths visible.
|
||||
- [Risk] Operators may expect plugin profiles to work without binding server-specific values. Mitigation: require server setup validation before showing actions that depend on missing bindings.
|
||||
|
||||
## Migration Plan
|
||||
|
||||
1. Extend plugin manifest schema and examples with runtime profiles, dependency probes, log sources, transport profiles, and client-manager build profiles.
|
||||
2. Add platform domain, model, DTO, validator, and service support for distribution records, encrypted database key storage, key reset, key generation checks, build jobs, dependency status, runtime bindings, and update jobs.
|
||||
3. Add run package config loading, registration authentication against the current database key generation, dependency probes, discovery probes, log source checkpoints, transport adapter envelopes, and self-update executor.
|
||||
4. Add platform_web server-list and server-detail action menus for generate/download/update run, generate/download client manager, dependency checks, live logs, and historical logs.
|
||||
5. Add tests and docs across plugins, platform, run, and platform_web; validate with OpenSpec, structure checks, backend tests, plugin validation, run tests, frontend tests, and browser walkthroughs for touched UI.
|
||||
|
||||
Rollback removes the new distribution/client-manager routes and UI actions, leaves existing run endpoints and plugin-declared remote access behavior intact, and preserves already-created artifacts as inert downloadable records until manually cleaned.
|
||||
|
||||
## Open Questions
|
||||
|
||||
- Which envelope-key source should protect the encrypted key columns stored in the platform database?
|
||||
- Should platform-side builds run in the platform process for the first version, or require a separate build worker from day one?
|
||||
- What default retention should apply to historical logs and generated binaries?
|
||||
- Which target packaging formats should be first-class first: zip/tar.gz only, or Windows service installer, systemd unit bundle, and launchd plist bundles?
|
||||
- Should plugin client-manager profiles support private repositories later, and if so how should source credentials be stored and audited?
|
||||
@@ -0,0 +1,30 @@
|
||||
## Why
|
||||
|
||||
Run is becoming the platform's cross-platform server launcher and transport agent, but operators still need a safe way to generate, download, authenticate, update, and observe per-server run binaries. Some games also need plugin-declared companion clients, such as SCUM-style client managers, that are built from plugin-provided source repositories with separate credentials and lifecycle from run.
|
||||
|
||||
## What Changes
|
||||
|
||||
- Add a platform-managed run distribution workflow from the server list or server actions menu: generate executor, choose target OS/architecture, write the current server/component authentication key into the generated package config, download the artifact, and store the single active encrypted key in the database.
|
||||
- Add run self-update orchestration: if an assigned run is already online, platform can enqueue an update command that instructs the remote run to pull or replace itself with the latest approved run build.
|
||||
- Add plugin-declared external controller/client-manager build profiles for games that cannot be controlled only through run, FTP, SQL, logs, and RCON.
|
||||
- Add separate database-backed active keys for run and plugin-declared client managers; resetting a server's run or client key invalidates every previous package and requires regenerating the corresponding run or client artifact.
|
||||
- Extend plugin manifests with server discovery, dependency checks, dependency install guidance, log source declarations, historical log retention hints, and transport wiring so run knows how to find and manage the target server without hardcoded game logic.
|
||||
- Add UI/API contracts for server action menu entries: generate run, download latest run package, push run update, generate plugin client manager, inspect dependency status, open live logs, and browse historical logs.
|
||||
|
||||
## Capabilities
|
||||
|
||||
### New Capabilities
|
||||
|
||||
- `run-distribution-and-client-managers`: Platform-managed run packaging, download, key provisioning, remote self-update, plugin-declared companion client builds, dependency checks, server discovery, and live/historical observability.
|
||||
|
||||
### Modified Capabilities
|
||||
|
||||
- None.
|
||||
|
||||
## Impact
|
||||
|
||||
- Affects `plugins/` manifest schema, SDK docs, SCUM and Minecraft example manifests, and validation tests.
|
||||
- Affects `platform/` domain, DTOs, encrypted secret references, build records, artifact records, run endpoint provisioning, job creation, audit events, and API routes.
|
||||
- Affects `run/` generated package config, updater job handling, dependency probes, server discovery adapters, live log tailing, historical log checkpoints, file/FTP/SQL/RCON transport adapters, and docs.
|
||||
- Affects `platform_web/` server list and server detail actions, live log views, historical log views, dependency status surfaces, and browser walkthrough coverage.
|
||||
- Does not add billing, host rental, cloud host sales, raw credential exposure, plugin-owned direct sockets, or unrelated SaaS marketplace workflows.
|
||||
+133
@@ -0,0 +1,133 @@
|
||||
## ADDED Requirements
|
||||
|
||||
### Requirement: Platform generates server-scoped run packages
|
||||
The platform SHALL let an authorized operator generate a run package for a selected server instance and target platform using the server's single current run key stored encrypted in the platform database.
|
||||
|
||||
#### Scenario: Operator generates run from server actions
|
||||
- **WHEN** an authorized operator selects generate executor for a server instance and chooses a supported OS/architecture
|
||||
- **THEN** platform MUST create or reuse the server's current encrypted run key, write that key into the generated package config, create a distribution record with key generation, build/download artifact, checksum metadata, and audit event, and MUST NOT return the raw key in the API response
|
||||
|
||||
#### Scenario: Operator downloads generated run package
|
||||
- **WHEN** an authorized operator downloads a generated run artifact
|
||||
- **THEN** platform MUST authorize access by server scope and return the secret-bearing package through artifact/download APIs without exposing raw host paths, direct sockets, or database credentials in package metadata
|
||||
|
||||
### Requirement: Run and client-manager keys are isolated singletons
|
||||
Run executors and plugin-declared client managers SHALL use different authentication secrets, and each server/component SHALL have exactly one current active key stored encrypted in the platform database.
|
||||
|
||||
#### Scenario: Client manager is generated after run
|
||||
- **WHEN** a plugin-declared client-manager package is generated for a server that already has a run package
|
||||
- **THEN** platform MUST create or reuse the server's current encrypted client-manager key and MUST NOT reuse, reveal through API metadata, or derive it from the run key
|
||||
|
||||
#### Scenario: Component key reset is requested
|
||||
- **WHEN** an operator resets a server's run key or client-manager key
|
||||
- **THEN** platform MUST replace the encrypted database key for that component, increment the key generation, revoke all packages generated with prior generations, and record an audit event identifying the component kind without logging raw key material
|
||||
|
||||
#### Scenario: Old package authenticates after reset
|
||||
- **WHEN** a run or client-manager package generated before the latest key reset attempts to authenticate
|
||||
- **THEN** platform MUST reject the old key and require the operator to regenerate and redeploy the corresponding run or client-manager package
|
||||
|
||||
### Requirement: Plugins declare runtime profiles
|
||||
Game plugins SHALL declare runtime profiles that describe how run or external transports can discover, control, observe, and connect to the game server using logical keys instead of raw credentials or host paths.
|
||||
|
||||
#### Scenario: Plugin declares server discovery and transports
|
||||
- **WHEN** a plugin manifest declares runtime profiles with discovery probes, lifecycle actions, dependency probes, log sources, FTP/rsync, SQL, RCON, or client-manager bindings
|
||||
- **THEN** plugin validation MUST accept only known profile fields and platform MUST preserve the declarations for server setup and action gating
|
||||
|
||||
#### Scenario: Plugin manifest includes unsafe runtime details
|
||||
- **WHEN** a plugin manifest embeds raw run keys, client-manager keys, FTP passwords, database DSNs, RCON passwords, absolute host paths, direct sockets, or arbitrary shell scripts in runtime profiles
|
||||
- **THEN** plugin validation and platform registration MUST reject the manifest before it becomes installable
|
||||
|
||||
### Requirement: Server runtime bindings resolve plugin profiles
|
||||
Server instances SHALL bind plugin-declared logical runtime keys to operator-provided local or remote settings before run-dependent actions are enabled.
|
||||
|
||||
#### Scenario: Run discovers an existing server
|
||||
- **WHEN** run registers for a server instance with complete runtime bindings and the plugin declares discovery probes
|
||||
- **THEN** run MUST evaluate the probes locally, report logical discovery status, version, and health, and MUST NOT return raw host paths or secret values to platform_web or plugin pages
|
||||
|
||||
#### Scenario: Required binding is missing
|
||||
- **WHEN** an operator opens server actions for a runtime profile that requires unbound install root, service name, FTP profile, SQL profile, RCON profile, or client-manager profile
|
||||
- **THEN** platform MUST mark dependent actions unavailable and explain the missing logical binding without exposing internal storage details
|
||||
|
||||
### Requirement: Plugins control third-party startup behavior
|
||||
Third-party game program startup and shutdown SHALL be driven by plugin-declared lifecycle profiles and server runtime bindings, not hardcoded platform game logic.
|
||||
|
||||
#### Scenario: Local process server starts through run
|
||||
- **WHEN** a plugin declares a local process lifecycle profile and the server runtime binding is complete
|
||||
- **THEN** run MUST start or stop the third-party program through the declared bounded action template and stream stdout/stderr through the log channel
|
||||
|
||||
#### Scenario: Hosted server has no local lifecycle control
|
||||
- **WHEN** a plugin declares an FTP-only, FTP+RCON, or custom-client runtime profile without local process lifecycle
|
||||
- **THEN** platform MUST hide or deny local start/stop actions and expose only the declared remote or client-manager actions
|
||||
|
||||
### Requirement: Dependency checks and installs are typed
|
||||
Run SHALL check dependencies through plugin-declared probes and SHALL install missing dependencies only through approved, typed, reviewable install plans.
|
||||
|
||||
#### Scenario: Dependency check reports missing runtime
|
||||
- **WHEN** run evaluates plugin-declared dependency probes and a required runtime, service, package, toolchain, Steam app, Java runtime, Docker runtime, or OS package is missing
|
||||
- **THEN** platform MUST show dependency status and a reviewable install plan if the plugin declares one for the target platform
|
||||
|
||||
#### Scenario: Dependency install is approved
|
||||
- **WHEN** an authorized operator approves a dependency install plan
|
||||
- **THEN** platform MUST queue a bounded run job using typed package/download steps, checksum or source metadata where provided, and must reject arbitrary shell snippets
|
||||
|
||||
### Requirement: Client-manager packages are plugin-declared builds
|
||||
The platform SHALL support plugin-declared client-manager build profiles for companion executables that require source checkout, configuration injection, and compilation before download.
|
||||
|
||||
#### Scenario: SCUM-style client manager is generated
|
||||
- **WHEN** a plugin declares a client-manager build profile with repository, revision policy, supported target platform, build system, config template, and output artifact paths
|
||||
- **THEN** platform MUST create a build job that checks out the approved source, injects redacted configuration from secret refs, produces a downloadable artifact, and redacts secrets from build logs
|
||||
|
||||
#### Scenario: Unsupported client-manager target is requested
|
||||
- **WHEN** an operator requests a client-manager build for an OS/architecture not declared by the plugin profile
|
||||
- **THEN** platform MUST reject the request before cloning source or creating a credential
|
||||
|
||||
### Requirement: Online run endpoints self-update through platform jobs
|
||||
The platform SHALL update online run endpoints by queuing a bounded self-update job that references an approved artifact and checksum instead of sending raw shell commands.
|
||||
|
||||
#### Scenario: Online run accepts update
|
||||
- **WHEN** an assigned run endpoint is online and supports self-update
|
||||
- **THEN** platform MUST queue an update job, and run MUST download the artifact, verify checksum or signature metadata, stage the replacement, report progress, and restart or swap only after verification succeeds
|
||||
|
||||
#### Scenario: Update verification fails
|
||||
- **WHEN** run cannot verify or stage the update artifact
|
||||
- **THEN** run MUST keep the current executable, report a bounded failure result, and preserve heartbeat or last-known status without leaking local paths or credentials
|
||||
|
||||
### Requirement: Run exposes multi-channel transport capabilities
|
||||
Run SHALL provide declared server operations through separate control, job, log, artifact/file, FTP/rsync, SQL, and RCON channels or adapters while preserving priority and bounded payload rules.
|
||||
|
||||
#### Scenario: Long file transfer is active
|
||||
- **WHEN** run is transferring a large file, FTP payload, rsync payload, or artifact chunk
|
||||
- **THEN** heartbeat, job ack/result, cancellation polling, and log ingest MUST continue independently without waiting for transfer completion
|
||||
|
||||
#### Scenario: Undeclared transport operation is requested
|
||||
- **WHEN** a plugin page or platform caller requests FTP, SQL, RCON, file, or process work not declared by the plugin runtime profile and run capabilities
|
||||
- **THEN** platform MUST deny the request before creating a job and MUST return only a safe error
|
||||
|
||||
### Requirement: Live and historical logs are platform-mediated
|
||||
Platform_web SHALL show live and historical server logs through platform APIs backed by run log ingest, log checkpoints, and plugin-declared log sources.
|
||||
|
||||
#### Scenario: Live log tail is opened
|
||||
- **WHEN** an operator opens live logs for a server with an online run endpoint
|
||||
- **THEN** platform_web MUST read from platform log APIs and display sequenced log entries from run without direct run sockets or raw file paths
|
||||
|
||||
#### Scenario: Historical log backfill is requested
|
||||
- **WHEN** an operator requests older logs for a declared process, file, FTP, SQL, or plugin-specific log source
|
||||
- **THEN** platform MUST queue or serve a backfill using per-source checkpoints, cursors, or file fingerprints and MUST avoid embedding large log bodies in job result payloads
|
||||
|
||||
### Requirement: Server action menu reflects declared availability
|
||||
The server list and server detail action menu SHALL show generate run, download run, push run update, generate client manager, dependency check, install dependency, live logs, and historical logs only when the current user and plugin/runtime state permit them.
|
||||
|
||||
#### Scenario: Actions are available
|
||||
- **WHEN** a server has a plugin with runtime profiles, complete bindings, and the current user has the required permissions
|
||||
- **THEN** platform_web MUST render the applicable actions using the existing game-operations console style and call platform APIs rather than plugin-owned direct endpoints
|
||||
|
||||
#### Scenario: Actions are unavailable
|
||||
- **WHEN** a server lacks a required plugin declaration, binding, online run status, build profile, or user permission
|
||||
- **THEN** platform_web MUST hide or disable the action with a safe reason and MUST NOT render raw credentials, host paths, direct sockets, or secret refs beyond redacted identifiers
|
||||
|
||||
### Requirement: Distribution and control events are audited
|
||||
The platform SHALL audit run generation, run download, credential reset, run update, dependency install, client-manager build, client-manager download, and transport operation requests.
|
||||
|
||||
#### Scenario: Sensitive operation completes
|
||||
- **WHEN** a sensitive distribution or control operation succeeds, fails, or is denied
|
||||
- **THEN** platform MUST record actor, server instance, plugin ID, component kind, operation, result, artifact ID or job ID where applicable, and redacted reason without raw secret material
|
||||
@@ -0,0 +1,70 @@
|
||||
## 1. Plugin Contracts
|
||||
|
||||
- [x] 1.1 Extend the game plugin manifest schema with runtime profiles for server discovery, lifecycle profiles, dependency probes, install plans, log sources, transport profiles, and client-manager build profiles.
|
||||
- [x] 1.2 Update plugin SDK types and bridge docs for runtime bindings, run distribution actions, dependency actions, live/historical log actions, and client-manager generation.
|
||||
- [x] 1.3 Update SCUM and Minecraft example manifests to declare realistic runtime profiles, dependency probes, log sources, and transport bindings.
|
||||
- [x] 1.4 Add plugin validation tests that accept safe runtime/client-manager profiles and reject raw keys, database DSNs, RCON passwords, direct sockets, raw host paths, and arbitrary shell snippets.
|
||||
|
||||
## 2. Platform Secret and Distribution Model
|
||||
|
||||
- [x] 2.1 Add platform domain, DTO, model, repository, and validator types for run distributions, client-manager distributions, runtime bindings, encrypted database keys, key generations, dependency status, build jobs, and update jobs.
|
||||
- [x] 2.2 Implement encrypted-at-rest database key storage for exactly one active run key and one active client-manager key per server/component.
|
||||
- [x] 2.3 Add key reset services and tests proving reset replaces the active encrypted key, increments generation, revokes old packages, and requires regenerating the affected run or client-manager artifact.
|
||||
- [x] 2.4 Add services and tests for generating server-scoped run packages, creating artifact records, writing the current run key into package config, storing key generation metadata, and authorizing downloads.
|
||||
- [x] 2.5 Add services and tests for client-manager build records, distinct current client-manager keys, source revision metadata, target-platform validation, and downloadable artifact publication.
|
||||
- [x] 2.6 Add audit events for generation, download, key reset, update, dependency install, build, and denied sensitive operations.
|
||||
|
||||
## 3. Platform APIs and Job Orchestration
|
||||
|
||||
- [x] 3.1 Add API routes and handlers for server action availability, generate/download run, reset run key, push run update, generate/download client manager, reset client-manager key, check dependencies, install dependencies, live logs, and historical logs.
|
||||
- [x] 3.2 Gate all routes by user permissions, server ownership, plugin declarations, runtime bindings, and run endpoint capability availability.
|
||||
- [x] 3.3 Add self-update job creation with artifact refs, checksums, idempotency keys, and denied-path tests for offline or unsupported run endpoints.
|
||||
- [x] 3.4 Add dependency-check and dependency-install job creation with typed install plans and rejection of arbitrary shell commands.
|
||||
- [x] 3.5 Add historical log backfill job creation with source IDs, checkpoints, bounded results, and artifact/log channel separation.
|
||||
|
||||
## 4. Run Bootstrap and Runtime Behavior
|
||||
|
||||
- [x] 4.1 Implement generated package config loading, current key generation authentication, server-scoped identity, old-package rejection after reset, and redacted local diagnostics.
|
||||
- [x] 4.2 Implement runtime profile resolution for local process, hosted FTP/RCON, FTP-only, SQL, file, and custom-client modes using server bindings.
|
||||
- [x] 4.3 Implement dependency probes and typed install plan execution for supported OS targets with safe progress and failure results.
|
||||
- [x] 4.4 Implement self-update executor with artifact download, checksum/signature verification hooks, staging, rollback, restart/swap behavior, and tests.
|
||||
- [x] 4.5 Implement live log tailing from process stdout/stderr and declared file sources with durable sequence checkpoints.
|
||||
- [x] 4.6 Implement historical log backfill cursors for declared file, FTP, SQL, and plugin-specific log sources without embedding large log bodies in job results.
|
||||
- [x] 4.7 Implement bounded adapter envelopes for FTP/rsync, SQL read, RCON command, and file transfer so long transfers do not block heartbeat or job metadata.
|
||||
|
||||
## 5. Build Pipeline
|
||||
|
||||
- [x] 5.1 Implement platform-side or build-worker source checkout for plugin-declared client-manager repositories with pinned revision metadata.
|
||||
- [x] 5.2 Implement target-platform validation, build dependency checks, redacted config injection, bounded build logs, checksum calculation, and artifact publication.
|
||||
- [x] 5.3 Add SCUM-style client-manager build tests covering supported targets, unsupported target denial, separate credential injection, and redacted logs.
|
||||
|
||||
## 6. platform_web Workflows
|
||||
|
||||
- [x] 6.1 Add server list and server detail action menu entries for generate run, download run, push run update, generate client manager, dependency check/install, live logs, and historical logs.
|
||||
- [x] 6.2 Add API client types, schemas, and tests for run distribution, client-manager distribution, dependency status, update jobs, and historical log backfill.
|
||||
- [x] 6.3 Add UI states for unavailable actions with safe reasons, redacted secret refs, run online/offline status, build status, update progress, dependency status, and log backfill status.
|
||||
- [x] 6.4 Preserve the existing platform_web game-operations console style and verify no raw keys, host paths, sockets, DSNs, RCON passwords, or direct run endpoints render in the UI.
|
||||
|
||||
## 7. Documentation and Verification
|
||||
|
||||
- [x] 7.1 Update platform, run, plugin, and platform_web docs for run generation, client-manager builds, runtime bindings, dependency profiles, live logs, historical logs, and self-update behavior.
|
||||
- [x] 7.2 Run plugin manifest validation, plugin SDK tests, platform tests, run tests, frontend tests, and `scripts/check-structure.sh`.
|
||||
- [x] 7.3 Run `openspec validate add-run-distribution-and-client-managers --strict`.
|
||||
- [x] 7.4 Complete a browser walkthrough for touched server-list and server-detail workflows before marking UI acceptance complete.
|
||||
- [x] 7.5 Record verification evidence in this task file before completion.
|
||||
|
||||
## Verification Evidence
|
||||
|
||||
- `cd plugins && npm run validate:manifest`: passed. First sandbox attempt failed with `listen EPERM` on the local `tsx` IPC pipe, then the same command passed with approved escalation.
|
||||
- `cd plugins && npm run typecheck`: passed.
|
||||
- `cd plugins && npm test`: passed, 1 file / 17 tests.
|
||||
- `cd run && go test ./...`: passed.
|
||||
- `cd platform && go test ./...`: passed.
|
||||
- `cd platform_web && npm run typecheck`: passed.
|
||||
- `cd platform_web && npm test`: passed, 13 files / 60 tests.
|
||||
- `cd platform_web && npm run build`: passed, Vite production build completed.
|
||||
- `scripts/check-structure.sh`: passed.
|
||||
- `openspec validate add-run-distribution-and-client-managers --strict`: passed. The CLI printed a PostHog network flush warning after validation, but exited successfully with `Change 'add-run-distribution-and-client-managers' is valid`.
|
||||
- `LOCAL_DEBUG_PLATFORM_PORT=18189 LOCAL_DEBUG_WEB_PORT=5183 LOCAL_DEBUG_ROOT=/private/tmp/browser-local-debug-acceptance scripts/browser-acceptance.sh`: passed.
|
||||
- Browser evidence file: `/private/tmp/browser-local-debug-acceptance/browser-acceptance/browser-acceptance-evidence.json`.
|
||||
- Browser walkthrough evidence covered 首页、服务器管理、服务器管理 / 运行操作菜单、插件市场、用户管理、AI 提供商管理、服务器详情、服务器详情 / 插件控制, plus desktop/mobile checks for black mecha and magical-girl themes.
|
||||
Reference in New Issue
Block a user