2.0 KiB
2.0 KiB
Prompt Boundaries
- Positive prompt (正向提示词): Realtime server logs and the management terminal must use one platform-owned push stream per open view, with bounded history replay and no periodic
/log-streams/querypolling. - Directional prompt (方向提示词): Work inside
platform/,platform_web/, andrun/, preserve durable Run log ingest, plugin-declared log-source ownership, platform session authorization, existing UI controls, and Nginx proxying; verify with focused Go/frontend tests plus structure checks. - Boundary prompt (任务边界): Do not add browser-to-Run sockets, raw credentials, host paths, plugin-owned auth keys, billing/cloud workflows, or game-specific SCUM paths/commands to platform/run code.
1. Platform SSE Contract
- 1.1 Add safe log event DTOs and a server-scoped SSE route.
- 1.2 Publish newly accepted log batch entries to non-blocking server-instance subscribers.
- 1.3 Replay bounded recent history on stream open while keeping cursor query available for explicit history.
2. Frontend Realtime Logs
- 2.1 Add EventSource client support for server log events.
- 2.2 Replace live log drawer and management terminal
/log-streams/queryintervals with SSE. - 2.3 Replace server detail log polling with SSE history replay and live append.
3. Proxy And Verification
- 3.1 Disable Nginx buffering for the log events route.
- 3.2 Add focused backend/frontend tests for SSE behavior and no terminal polling.
- 3.3 Run final verification: platform Go tests, platform_web tests/typecheck,
scripts/check-structure.sh, and strict OpenSpec validation.
4. Run Process Log Capture
- 4.1 Capture supervised process stdout/stderr through Run-owned durable capture files instead of game-specific log inspection.
- 4.2 Resume managed process log tailing after Run restart using the persisted process journal and capture offsets.
- 4.3 Keep plugin-declared log source keys optional for runtime readiness; explicit file backfill still uses the requested plugin source.