Files
browser/openspec/changes/implement-scum-server-plugin/tasks.md
T
2026-07-11 14:56:10 +08:00

4.3 KiB

1. SCUM Plugin Assets

  • 1.1 Add plugins/examples/scum-server-plugin with SCUM manifest metadata, create-form schema, pages, and lifecycle action templates.
  • 1.2 Ensure plugin manifest validation accepts the SCUM plugin and still rejects unsafe transport/credential/path content.

2. Discovery and Multi-Instance Proof

  • 2.1 Update local debug smoke registration to register SCUM plugin metadata through platform APIs.
  • 2.2 Update local debug smoke creation proof to create two SCUM servers from the SCUM plugin and verify marketplace discovery.

3. Verification

  • 3.1 Run cd plugins && npm run typecheck && npm run test && npm run validate:manifest.
  • 3.2 Run scripts/check-structure.sh.
  • 3.3 Run openspec validate implement-scum-server-plugin --strict.
  • 3.4 Run focused platform/platform_web checks and a browser walkthrough if UI behavior changes beyond existing generic surfaces.

Evidence

  • Plugin validation:

    • cd plugins && npm run typecheck passed.
    • cd plugins && npm run test passed: tests/manifest-validation.test.ts passed 12 tests, including SCUM manifest validation.
    • Initial sandbox cd plugins && npm run validate:manifest failed because tsx could not create its local IPC pipe (EPERM); escalated rerun passed.
    • cd plugins && npm run validate:manifest validated both examples/dev-game-plugin/manifest.json and examples/scum-server-plugin/manifest.json.
  • SCUM plugin implementation:

    • Added plugins/examples/scum-server-plugin/manifest.json with game.scum, server type scum, SCUM-specific marketplace metadata, lifecycle actions, bridge actions, permissions, plugin pages, and AI purposes.
    • Added plugins/examples/scum-server-plugin/schemas/create-form.schema.json with SCUM server name, game port, query port, and max-player fields.
    • Added scoped lifecycle fixtures under plugins/examples/scum-server-plugin/actions/ for install/start/stop/restart/status using safe bounded command templates.
    • Updated plugins/package.json, plugins/tests/manifest-validation.test.ts, and scripts/check-structure.sh so SCUM plugin assets are part of default validation.
  • API/local debug proof:

    • Updated scripts/local-debug-smoke.sh to register game.scum through /api/v1/game-plugins/register-manifest.
    • Updated smoke proof to create scum-alpha and scum-beta through /api/v1/server-instances/workflows/create.
    • Initial smoke against 18080 failed because that port was already occupied by stale state. Isolated rerun on 18087 with LOCAL_DEBUG_ROOT=/private/tmp/browser-scum-local-debug-proof-2 passed.
    • Passing smoke evidence directory: /private/tmp/browser-scum-local-debug-proof-2/smoke.
    • Smoke verified /api/v1/plugin-marketplace/plugins?serverType=scum&keyword=scum contains game.scum, and both SCUM instances have separate lifecycle install job records.
  • Browser walkthrough:

    • Started an isolated browser verification stack on platform 127.0.0.1:18088 and frontend 127.0.0.1:5188.
    • Seeded the stack with LOCAL_DEBUG_SELF_START=false LOCAL_DEBUG_PLATFORM_PORT=18088 LOCAL_DEBUG_WEB_PORT=5188 LOCAL_DEBUG_ROOT=/private/tmp/browser-scum-browser-proof scripts/local-debug-smoke.sh; smoke passed.
    • Logged into http://127.0.0.1:5188/ as operator.local@example.test / operator-local; 首页 showed API-backed platform data and game.scum: 2 个实例.
    • 插件市场 showed SCUM Server, game.scum, status 已安装, server type scum, and capabilities process.install, process.start, process.stop; no local fallback or forbidden fragments were visible.
    • 服务器管理 showed SCUM Alpha (scum-alpha) and SCUM Beta (scum-beta) as separate server cards; no local fallback or forbidden fragments were visible.
    • Opened #/servers/scum-alpha, confirmed plugin binding game.scum@0.1.0, started the server via the visible 启动 control, confirmed the dialog, and observed SCUM Alpha change to 运行中 / 在线 with 停止 enabled.
  • Final gates:

    • bash -n scripts/local-debug-smoke.sh passed.
    • scripts/check-structure.sh passed with structure check passed.
    • openspec validate implement-scum-server-plugin --strict passed with Change 'implement-scum-server-plugin' is valid; PostHog telemetry flush reported ENOTFOUND edge.openspec.dev, which did not affect validation.