Files
browser/openspec/changes/implement-game-client-bridge-and-scum-operations/tasks.md
T
2026-07-20 16:42:33 +08:00

5.3 KiB

1. Platform Bridge Foundation

  • 1.1 Add Game Client Bridge domain types for commands, command states, claims, results, cancellations, snapshots, snapshot streams, retention metadata, and audit references.
  • 1.2 Add bridge DTOs and validation rules for queue, claim, ack/result, cancel, snapshot ingest, snapshot query, and safe browser projections.
  • 1.3 Add repository interfaces and in-memory or durable store implementations for bridge commands, snapshots, stream sequence tracking, and retention queries.
  • 1.4 Add service methods for command creation, idempotency reuse, claim leasing, fencing-token checks, terminal result handling, cancellation, expiry, and audit recording.
  • 1.5 Add component-session authorization checks so only current Client Manager sessions with game-client.bridge can claim commands or upload snapshots.

2. Platform API Surface

  • 2.1 Add operator-facing API routes for listing bridge declarations/status, queueing declared commands, cancelling commands, reading command results, and querying snapshots.
  • 2.2 Add companion-facing API routes for claiming command batches, acknowledging commands, posting results, uploading snapshots, and reporting bridge diagnostics.
  • 2.3 Ensure bridge routes expose only safe projections and never expose component keys, sessions, secret refs, host paths, DSNs, direct Run endpoints, sockets, or storage credentials.
  • 2.4 Add bridge retention and expiry reconciliation paths for old commands, old results, stale claims, and expired snapshots.

3. Plugin Manifest and SDK Contracts

  • 3.1 Extend plugin manifest schema and validation for game-client command catalogs, snapshot schemas, approval levels, permissions, retention policy, and page bridge contracts.
  • 3.2 Extend plugin SDK/API types so plugin pages can call Platform-mediated bridge actions without receiving raw executor or component secrets.
  • 3.3 Fix remote-access request input propagation needed by declared read-only database templates before enabling SCUM.db query operations.
  • 3.4 Add manifest/schema tests for rejected arbitrary SQL, arbitrary shell, raw paths, undeclared commands, unsafe capabilities, and missing approval metadata.

4. SCUM Plugin Operations

  • 4.1 Update the SCUM plugin manifest from local proof placeholders to real game.scum operation declarations for lifecycle, client manager, bridge commands, snapshots, logs, and pages.
  • 4.2 Align SCUM Client Manager packaging/config declarations with the real companion client bootstrap instead of nonexistent configs/client.template.json, config.json, and unsupported --config assumptions.
  • 4.3 Add typed SCUM snapshot schemas for online sessions, players, squads, vehicles, flags or territories, and companion health diagnostics.
  • 4.4 Add bounded SCUM command catalog entries for announcements, safe diagnostics, player lookup, reward/event flows, restart preparation, and maintenance actions with permissions and approval levels.
  • 4.5 Add read-only SCUM.db query template declarations with typed parameters and bounded result schemas.
  • 4.6 Add SCUM semantic log event declarations for chat, login, logout, kill, trade, mine, unlock, admin, and performance events.

5. Frontend Operations Surface

  • 5.1 Add Platform Web API client/types for bridge declarations, command status, command results, snapshot projections, approval state, and bridge diagnostics.
  • 5.2 Add SCUM operations page contracts and route wiring through the existing plugin page bridge model.
  • 5.3 Build the first SCUM operations UI for companion health, command queue/results, players/sessions, vehicles/squads/flags, semantic logs, and maintenance policy using safe Platform projections.
  • 5.4 Preserve the platform_web magical-girl crystal-moonlight operations-console style and avoid page-local fixed decorative effects outside MagicalParticleLayer.

6. Companion Client Integration

  • 6.1 Define the generated companion config shape used by Platform Client Manager registration and bridge APIs without exposing browser-visible raw secrets.
  • 6.2 Adapt the SCUM companion client integration path away from legacy shared-token /api/v1/scum-clients/* endpoints toward Platform component-session registration, heartbeat, command claim/result, and snapshot upload.
  • 6.3 Remove unconditional insecure TLS behavior from the companion integration path and add tests or checks for secure transport defaults.
  • 6.4 Add local smoke fixtures or documentation showing how a compatible scum_client package claims a command and uploads a typed snapshot.

7. Tests and Verification

  • 7.1 Add backend unit tests for bridge idempotency, claim leasing, fencing, cancellation, expiry, result recording, component-session authorization, safe projections, and snapshot sequence handling.
  • 7.2 Add plugin manifest validation tests for the SCUM operation declarations and unsafe legacy-pattern rejection.
  • 7.3 Add frontend tests for SCUM bridge API typing, disabled availability reasons, command approval states, and safe rendering without secrets.
  • 7.4 Run focused Go and frontend tests covering changed packages.
  • 7.5 Run openspec validate implement-game-client-bridge-and-scum-operations --strict.
  • 7.6 Run scripts/check-structure.sh.