7.6 KiB
7.6 KiB
1. Acceptance Harness and Command Shape
- 1.1 Add an automated browser acceptance harness in the existing platform_web test/tooling structure, keeping route assertions near frontend code and stack orchestration in repository scripts.
- 1.2 Add a repository command wrapper for running browser acceptance against the local debug stack, with configurable
LOCAL_DEBUG_PLATFORM_PORT,LOCAL_DEBUG_WEB_PORT, andLOCAL_DEBUG_ROOT. - 1.3 Ensure the command can self-start or explicitly reuse the documented local debug stack, and records the resolved platform URL, platform_web URL, log paths, and evidence directory.
- 1.4 Ensure self-started runs clean up with
scripts/local-debug-reset.shand only remove allowed local debug roots.
2. Local Debug Fixture Prerequisites
- 2.1 Reuse
scripts/local-debug-smoke.shor equivalent platform-owned setup before browser assertions sogame.example,server-local-debug, andrun-local-debugexist. - 2.2 Fail early when platform health, API login, plugin manifest validation, plugin registration, run heartbeat, server lifecycle fixture creation, or job/log/artifact/marketplace references are missing.
- 2.3 Preserve the existing browser/API boundary: platform_web must use
PLATFORM_API_PROXYandVITE_PLATFORM_API_BASE_URL=/api/v1, withVITE_ENABLE_LOCAL_AUTH_FALLBACK=false. - 2.4 Keep fixture commands harmless and bounded, with no Docker-only dependency, real game binaries, raw credentials, raw AI keys, direct sockets, or browser/plugin direct access to run.
3. Browser Route Assertions
- 3.1 Automate login at platform_web with
operator.local@example.test/operator-localand verify the session lands on an API-backed workspace. - 3.2 Verify 首页
#/homeincludes API-backed platform overview signals such as平台概览,数据已加载, game/plugin instance counts, and run node state. - 3.3 Verify 服务器管理
#/serversincludesLocal Debug Example Serverandserver-local-debug. - 3.4 Verify 插件市场
#/pluginsincludesgame.example, installed state, manifest reference metadata, lifecycle capabilities, platform-mediated permissions, and bridge actions. - 3.5 Verify 用户管理
#/usersincludes API-connected account data foroperator.local@example.test. - 3.6 Verify AI 提供商管理
#/aiProvidersincludes API-backed provider rows with redacted key references only.
4. Plugin and Server Operation Surface Assertions
- 4.1 Verify server detail
#/servers/server-local-debugincludesLocal Debug Example Server,game.example@0.1.0,run-local-debug, lifecycle controls, logs, config, plugin controls, AI assistant, and operation history entry points. - 4.2 Trigger or inspect a platform-mediated lifecycle operation and verify platform-owned job or operation-history evidence without requiring direct run access from browser or plugin pages.
- 4.3 Verify log and artifact entry points are represented by logical IDs, platform routes, log refs, artifact refs, or safe metadata only.
- 4.4 Record route-level assertion results in machine-readable evidence, including URL, required markers, and plugin/server operation proof.
5. Safety and Fallback Scanning
- 5.1 Add a shared fallback scanner that fails on local/demo/fallback workspace indicators on all accepted routes.
- 5.2 Add a shared visible-content forbidden-fragment scanner for
/Users/,/private/,unix://,tcp://,Bearer,sk-,password=,apiKeyRef,rawApiKey, run session tokens, direct run URLs, and plugin-owned transport details. - 5.3 Ensure scanner failures report the route, matched fragment class, and safe nearby evidence without printing raw credentials.
- 5.4 Confirm sensitive values remain hidden from browser-visible output while safe redacted references such as
secret://...orenv://...are allowed when expected.
6. Documentation and Verification
- 6.1 Document the browser acceptance command and expected evidence output in the appropriate local debug or frontend development documentation.
- 6.2 Run
LOCAL_DEBUG_PLATFORM_PORT=18189 LOCAL_DEBUG_WEB_PORT=5183 LOCAL_DEBUG_ROOT=/private/tmp/browser-local-debug-acceptance <browser-acceptance-command>and record the exact final command after implementation. - 6.3 Run
LOCAL_DEBUG_PLATFORM_PORT=18189 LOCAL_DEBUG_WEB_PORT=5183 LOCAL_DEBUG_ROOT=/private/tmp/browser-local-debug-acceptance scripts/local-debug-smoke.shor document why the acceptance command already ran the same smoke prerequisite. - 6.4 Run
cd platform_web && npm run typecheck && npm test && npm run buildand record evidence. - 6.5 Run relevant touched-root checks, including
cd plugins && npm run typecheck && npm run test && npm run validate:manifest,cd platform && GOCACHE=/private/tmp/browser-go-build-cache go test ./... -count=1, andcd run && GOCACHE=/private/tmp/browser-go-build-cache go test ./... -count=1when implementation touches those roots or local debug orchestration. - 6.6 Run
scripts/check-structure.shand record evidence. - 6.7 Run
openspec validate implement-browser-acceptance-suite --strictand record evidence. - 6.8 Update
openspec/changes/architecture-delivery-stream/delivery-plan.mdandopenspec/changes/architecture-delivery-stream/NEXT_CHANGE.mdafter implementation evidence exists, then stop without implementingpolish-platform-interaction-designunless explicitly asked.
Evidence
- Implemented
platform_web/acceptance/browser-acceptance.mjs,scripts/browser-acceptance.sh,platform_webpackage scriptacceptance:browser, and documentation indocs/local-debug-workspace.mdplusplatform_web/README.md. node --check platform_web/acceptance/browser-acceptance.mjspassed.bash -n scripts/browser-acceptance.shpassed.LOCAL_DEBUG_PLATFORM_PORT=18189 LOCAL_DEBUG_WEB_PORT=5183 LOCAL_DEBUG_ROOT=/private/tmp/browser-local-debug-acceptance scripts/browser-acceptance.shpassed after clearing a stale listener from an earlier interrupted run.- Browser acceptance evidence:
/private/tmp/browser-local-debug-acceptance/browser-acceptance/browser-acceptance-evidence.json, checked at2026-07-08T05:13:43.494Z. - Acceptance command ran
scripts/local-debug-smoke.shas a prerequisite and wrote seed evidence under/private/tmp/browser-local-debug-acceptance/smoke. - Browser routes verified: 首页, 服务器管理, 插件市场, 用户管理, AI 提供商管理, 服务器详情, and 服务器详情 / 插件控制.
- Operation proof verified platform API accepted
process.startforserver-local-debug, platform-owned jobs endpoint returnedserver-lifecycle:server-local-debug:start:e93f12eb71c03646, and browser operation history exposed platform task records without direct run access. cd platform_web && npm run typecheck && npm test && npm run buildpassed: 11 test files and 49 tests passed, Vite production build succeeded.cd plugins && npm run typecheck && npm run testpassed: 1 test file and 11 tests passed.cd plugins && npm run validate:manifestpassed after an escalated rerun because sandboxedtsxIPC failed withlisten EPERM.cd platform && GOCACHE=/private/tmp/browser-go-build-cache go test ./... -count=1passed.cd run && GOCACHE=/private/tmp/browser-go-build-cache go test ./... -count=1passed after an escalated rerun because sandboxedhttptestlocalhost binding failed withlisten tcp6 [::1]:0: bind: operation not permitted.scripts/check-structure.shpassed.openspec validate implement-browser-acceptance-suite --strictpassed. OpenSpec emitted PostHog DNS flush warnings after validation, but the command exited 0 and reportedChange 'implement-browser-acceptance-suite' is valid.