docs: finalize unified startup configuration acceptance

This commit is contained in:
2026-09-05 23:31:39 +08:00
parent af059b40e9
commit 41fcd65464
2 changed files with 15 additions and 15 deletions
@@ -26,19 +26,19 @@
**Interfaces:** export StartupConfig and STARTUP_CONFIG from profiles.ts. ResolveRuntimeConfigOptions replaces mode with optional startupConfig: Readonly<StartupConfig>; production default is the exported constant, test configuration is explicit. RuntimeConfig retains mode/isDebugger/identity/servers/remoteConfig/rawConfig and exposes validated startupConfig for local consumers to validate against the same source. No independent profile selector. runtime-mode.ts may export RuntimeMode and a pure reader but contains no environment or URL defaults.
- [ ] Write RED tests in framework-tests/config/{profiles,runtime-mode,runtime-config,local-startup,bootstrap}.test.ts and local-platform-login/host.test.ts. For example, inject `{...STARTUP_CONFIG,mode:'release',useLocalServer:true}`, search `?mode=debug&profile=prod`, fake fetch `{visitor_server_tcp:'visitor:1'}`; assert one fetch and local servers with mode release. Repeat mode debug/release and useLocalServer true/false, using valid remote game/player candidates when false. Assert the default no-query local host starts, and conflicting/duplicate mode/profile parameters do not select another configuration.
- [ ] Run focused RED from cocoscreator_projects: `node --import tsx --test --test-concurrency=1 framework-tests/config/profiles.test.ts framework-tests/config/runtime-mode.test.ts framework-tests/config/runtime-config.test.ts framework-tests/config/local-startup.test.ts framework-tests/config/bootstrap.test.ts framework-tests/local-platform-login/host.test.ts`. Repeat identical command require_escalated on known sandbox ENOMEM.
- [ ] Implement source and validation: explicit mode enum, boolean useLocalServer, valid http(s) gameserver, valid loopback localServers. Freeze the source/array. Reject malformed values; no consumer defaults. Remove URL/environment mode selection and PROFILES selector. Preserve resolveGameServer original injection decoding.
- [ ] Integrate runtime: `const startupConfig = ...options.startupConfig or STARTUP_CONFIG` through one validated source function; resolve identity/injected remote URL, await fetch, create memory view, choose `startupConfig.useLocalServer ? startupConfig.localServers : parseUrlServers(remoteConfig)`. Preserve errors. Derive mode/isDebugger from startupConfig.
- [ ] Integrate diagnostic and facade: remove scalar mode in component; local-startup checks code source debug/local and loopback and accepts empty search. Ignore mode/profile query while retaining identity/gameconfig diagnostic restrictions. Use the same source snapshot in forged-context checks. Keep internal profile local namespace for account storage. Bootstrap uses same runtime; old LoginFlow stops after config error rather than assigning fallback identity/server, and forwards real location.search. Do not rewire the old UI or login contract.
- [ ] Update affected test literals via existing fixtures as appropriate; replace obsolete mode/profile expectations with new contract without weakening lifecycle/source tests. Add behavior tests for malformed local addresses and gameserver, remote failure, local diagnostic refusal of release/remote settings, and native injection compatibility.
- [ ] GREEN focused suite; explicit full suite: `$testPaths = @(rg --files framework-tests -g '*.test.ts' | Sort-Object); node --import tsx --test --test-concurrency=1 @testPaths`; architecture: `node --test framework-tests/architecture/import-boundaries.test.mjs framework-tests/architecture/presentation-boundaries.test.mjs`; type: `node node_modules/typescript/bin/tsc -p tsconfig.framework.json --noEmit`; boundaries: `node scripts/check-import-boundaries.mjs`.
- [ ] Self-review and exact task-only commit. Report RED/GREEN commands/results and file list in task-1-report.md; no full remote data/logged secrets.
- [ ] Independent task spec/quality review, fix loop with targeted regressions, then scoped re-review.
- [x] Write RED tests in framework-tests/config/{profiles,runtime-mode,runtime-config,local-startup,bootstrap}.test.ts and local-platform-login/host.test.ts. For example, inject `{...STARTUP_CONFIG,mode:'release',useLocalServer:true}`, search `?mode=debug&profile=prod`, fake fetch `{visitor_server_tcp:'visitor:1'}`; assert one fetch and local servers with mode release. Repeat mode debug/release and useLocalServer true/false, using valid remote game/player candidates when false. Assert the default no-query local host starts, and conflicting/duplicate mode/profile parameters do not select another configuration.
- [x] Run focused RED from cocoscreator_projects: `node --import tsx --test --test-concurrency=1 framework-tests/config/profiles.test.ts framework-tests/config/runtime-mode.test.ts framework-tests/config/runtime-config.test.ts framework-tests/config/local-startup.test.ts framework-tests/config/bootstrap.test.ts framework-tests/local-platform-login/host.test.ts`. Repeat identical command require_escalated on known sandbox ENOMEM.
- [x] Implement source and validation: explicit mode enum, boolean useLocalServer, valid http(s) gameserver, valid loopback localServers. Freeze the source/array. Reject malformed values; no consumer defaults. Remove URL/environment mode selection and PROFILES selector. Preserve resolveGameServer original injection decoding.
- [x] Integrate runtime: `const startupConfig = ...options.startupConfig or STARTUP_CONFIG` through one validated source function; resolve identity/injected remote URL, await fetch, create memory view, choose `startupConfig.useLocalServer ? startupConfig.localServers : parseUrlServers(remoteConfig)`. Preserve errors. Derive mode/isDebugger from startupConfig.
- [x] Integrate diagnostic and facade: remove scalar mode in component; local-startup checks code source debug/local and loopback and accepts empty search. Ignore mode/profile query while retaining identity/gameconfig diagnostic restrictions. Use the same source snapshot in forged-context checks. Keep internal profile local namespace for account storage. Bootstrap uses same runtime; old LoginFlow stops after config error rather than assigning fallback identity/server, and forwards real location.search. Do not rewire the old UI or login contract.
- [x] Update affected test literals via existing fixtures as appropriate; replace obsolete mode/profile expectations with new contract without weakening lifecycle/source tests. Add behavior tests for malformed local addresses and gameserver, remote failure, local diagnostic refusal of release/remote settings, and native injection compatibility.
- [x] GREEN focused suite; explicit full suite: `$testPaths = @(rg --files framework-tests -g '*.test.ts' | Sort-Object); node --import tsx --test --test-concurrency=1 @testPaths`; architecture: `node --test framework-tests/architecture/import-boundaries.test.mjs framework-tests/architecture/presentation-boundaries.test.mjs`; type: `node node_modules/typescript/bin/tsc -p tsconfig.framework.json --noEmit`; boundaries: `node scripts/check-import-boundaries.mjs`.
- [x] Self-review and exact task-only commit. Report RED/GREEN commands/results and file list in task-1-report.md; no full remote data/logged secrets.
- [x] Independent task spec/quality review, fix loop with targeted regressions, then scoped re-review.
### Task 2: Real browser and documentation acceptance (controller)
- [ ] MCP verify actual main checkout Creator project and current dirty state; refresh only modified existing TS resources.
- [ ] Open actual LocalPlatformLogin preview without query parameters, verify remote config source, local target, login ready and no failure; stop afterward. Configuration-only browser calls may verify the other source selections without creating production sockets.
- [ ] Update docs/guides/配置与调试指南.md to remove obsolete URL profile/remote-bypass/aggregate-test instructions. Write docs/superpowers/reports/2026-09-05-unified-startup-config-acceptance.md with exact results, final current configuration location, publishing instructions and source limitation. Keep prior completed reports as history.
- [ ] Whole-change independent review; verify original dirty hashes/status unchanged; mark plan progress and commit exact documents. No merge/push.
- [x] MCP verify actual main checkout Creator project and current dirty state; refresh only modified existing TS resources.
- [x] Open actual LocalPlatformLogin preview without query parameters, verify remote config source, local target, login ready and no failure; stop afterward. Configuration-only browser calls may verify the other source selections without creating production sockets.
- [x] Update docs/guides/配置与调试指南.md to remove obsolete URL profile/remote-bypass/aggregate-test instructions. Write docs/superpowers/reports/2026-09-05-unified-startup-config-acceptance.md with exact results, final current configuration location, publishing instructions and source limitation. Keep prior completed reports as history.
- [x] Whole-change independent review; verify original dirty hashes/status unchanged; mark plan progress and commit exact documents. No merge/push.