From 5d90891b387c3cafded59c607663fb79cbcfc6eb Mon Sep 17 00:00:00 2001 From: Joywayer Date: Sat, 5 Sep 2026 21:32:16 +0800 Subject: [PATCH] docs: finalize remote configuration acceptance --- .../plans/2026-09-05-remote-config-memory.md | 24 +++++++++---------- ...6-09-05-remote-config-memory-acceptance.md | 3 ++- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/docs/superpowers/plans/2026-09-05-remote-config-memory.md b/docs/superpowers/plans/2026-09-05-remote-config-memory.md index b3ae160..e0bbc13 100644 --- a/docs/superpowers/plans/2026-09-05-remote-config-memory.md +++ b/docs/superpowers/plans/2026-09-05-remote-config-memory.md @@ -30,18 +30,18 @@ **Interfaces:** Remote config view exposes readonly raw root and getValue(name: string): unknown; export a creator in remote-config.ts taking unknown root and ChannelIdentity. RuntimeConfig exposes the view as remoteConfig and keeps rawConfig as the same raw reference, source always remote and gameserver non-null. parseUrlServers receives the view and resolves game_server_tcp/player_server_tcp. Profiles retain unique servers for local override and all have remote gameserver. -- [ ] Write failing tests first. Use the actual legacy get_paravalue extracted from 12_Logic.js in a node:vm sandbox as differential oracle; fixtures contain synthetic identities only. Assert values across all five scopes, false/0/empty values, object replacement, missing levels and first duplicate. Example: `assert.deepEqual(view.getValue('hall_config'), legacy(wrapper, 'hall_config'))`. -- [ ] Add startup behavior assertions: for debug local fake fetcher increment calls then return `{player_server_tcp:'remote.example:3088'}`; expect calls=1, source=remote, local servers, raw config retained. release with profile=local must still fetch and use remote candidates. Failed fetch or parse must leave local-host socket calls at zero. No persistence operation is added. -- [ ] Run exact focused tests from cocoscreator_projects: `node --import tsx --test --test-concurrency=1 framework-tests/config/remote-config.test.ts framework-tests/config/runtime-config.test.ts framework-tests/config/profiles.test.ts framework-tests/config/local-startup.test.ts`. Record expected assertion failures before production edits. If tsx ENOMEM occurs, repeat identical command with require_escalated. -- [ ] Implement the smallest integrated change. Loop scopes using first identity equality, update inherited value only if truthy, stop when scope is absent. Validate the JSON root and present hierarchy shape; normalize only the chosen server candidates. Runtime always awaits fetch and builds one memory view, then selects explicit local servers or calls parseUrlServers(view) for remote profiles. Local does not require unused remote TCP fields. Preserve host cancellation guards and stop semantics. Test real-source-shaped `{visitor_server_tcp:'visitor.example:3088'}`: debug local succeeds only after fetch/parse; release fails for missing game/player TCP, never selects visitor. -- [ ] Update dependent tests/fixtures asserting the superseded direct contract; retain all unrelated assertions and add no runtime fallback. All test RuntimeConfig literals must supply the new view via a central test helper where appropriate. -- [ ] Run focused tests then full explicitly enumerated TS suite: `$testPaths = @(rg --files framework-tests -g '*.test.ts' | Sort-Object); node --import tsx --test --test-concurrency=1 @testPaths`. Run `node node_modules/typescript/bin/tsc -p tsconfig.framework.json --noEmit` and `node scripts/check-import-boundaries.mjs`. Discover and explicitly name the two platform architecture tests; do not invoke aggregate generators. -- [ ] Self-review, stage exact task files, commit. Report RED/GREEN commands, counts, changed files, and concerns in task-1-report.md. Do not touch root controller docs or existing dirty resources. -- [ ] Controller dispatches independent spec/quality reviewer; repair findings with failing regressions first, then scoped re-review. +- [x] Write failing tests first. Use the actual legacy get_paravalue extracted from 12_Logic.js in a node:vm sandbox as differential oracle; fixtures contain synthetic identities only. Assert values across all five scopes, false/0/empty values, object replacement, missing levels and first duplicate. Example: `assert.deepEqual(view.getValue('hall_config'), legacy(wrapper, 'hall_config'))`. +- [x] Add startup behavior assertions: for debug local fake fetcher increment calls then return `{player_server_tcp:'remote.example:3088'}`; expect calls=1, source=remote, local servers, raw config retained. release with profile=local must still fetch and use remote candidates. Failed fetch or parse must leave local-host socket calls at zero. No persistence operation is added. +- [x] Run exact focused tests from cocoscreator_projects: `node --import tsx --test --test-concurrency=1 framework-tests/config/remote-config.test.ts framework-tests/config/runtime-config.test.ts framework-tests/config/profiles.test.ts framework-tests/config/local-startup.test.ts`. Record expected assertion failures before production edits. If tsx ENOMEM occurs, repeat identical command with require_escalated. +- [x] Implement the smallest integrated change. Loop scopes using first identity equality, update inherited value only if truthy, stop when scope is absent. Validate the JSON root and present hierarchy shape; normalize only the chosen server candidates. Runtime always awaits fetch and builds one memory view, then selects explicit local servers or calls parseUrlServers(view) for remote profiles. Local does not require unused remote TCP fields. Preserve host cancellation guards and stop semantics. Test real-source-shaped `{visitor_server_tcp:'visitor.example:3088'}`: debug local succeeds only after fetch/parse; release fails for missing game/player TCP, never selects visitor. +- [x] Update dependent tests/fixtures asserting the superseded direct contract; retain all unrelated assertions and add no runtime fallback. All test RuntimeConfig literals must supply the new view via a central test helper where appropriate. +- [x] Run focused tests then full explicitly enumerated TS suite: `$testPaths = @(rg --files framework-tests -g '*.test.ts' | Sort-Object); node --import tsx --test --test-concurrency=1 @testPaths`. Run `node node_modules/typescript/bin/tsc -p tsconfig.framework.json --noEmit` and `node scripts/check-import-boundaries.mjs`. Discover and explicitly name the two platform architecture tests; do not invoke aggregate generators. +- [x] Self-review, stage exact task files, commit. Report RED/GREEN commands, counts, changed files, and concerns in task-1-report.md. Do not touch root controller docs or existing dirty resources. +- [x] Controller dispatches independent spec/quality reviewer; repair findings with failing regressions first, then scoped re-review. ### Task 2: Documentation and real-boundary acceptance (controller) -- [ ] Correct docs/protocol/01-传输层与架构.md remote-entry description to active get_config/getConfig_Succ, local wrapper and scoped server selection. Preserve unrelated protocol text. -- [ ] Read the live remote response through the production parser and current identity without storing response body or printing sensitive values. Record fetch/parse outcome and selected hierarchy depth only. -- [ ] Verify actual Cocos preview via funplay MCP, without asset mutations. Observe actual remote request and resolved local target; stop runtime after observation. If browser fetch fails, document status and exact origin/request facts before deciding a fix; do not disable security or proxy silently. -- [ ] Hash-check initial dirty files unchanged. Write a concise acceptance report with separate pure tests, live HTTP and real Creator evidence. Perform whole-change review before declaring completion. +- [x] Correct docs/protocol/01-传输层与架构.md remote-entry description to active get_config/getConfig_Succ, local wrapper and scoped server selection. Preserve unrelated protocol text. +- [x] Read the live remote response through the production parser and current identity without storing response body or printing sensitive values. Record fetch/parse outcome and selected hierarchy depth only. +- [x] Verify actual Cocos preview via funplay MCP, without asset mutations. Observe actual remote request and resolved local target; stop runtime after observation. If browser fetch fails, document status and exact origin/request facts before deciding a fix; do not disable security or proxy silently. +- [x] Hash-check initial dirty files unchanged. Write a concise acceptance report with separate pure tests, live HTTP and real Creator evidence. Perform whole-change review before declaring completion. diff --git a/docs/superpowers/reports/2026-09-05-remote-config-memory-acceptance.md b/docs/superpowers/reports/2026-09-05-remote-config-memory-acceptance.md index 8e856a1..30cbdb3 100644 --- a/docs/superpowers/reports/2026-09-05-remote-config-memory-acceptance.md +++ b/docs/superpowers/reports/2026-09-05-remote-config-memory-acceptance.md @@ -21,6 +21,7 @@ debug、release 均读取远程 JSON,按原工程身份层级读取参数, - `fp_5524451aad3e7ff5`:从 Creator import map 导入实际编译的 runtime-config 与 HttpConfigFetcher,在真实 Chromium 中调用两种模式,底层仍使用真实 fetch。debug/local 请求一次,HTTP 200,source=remote,唯一目标为本地;rawConfig===remoteConfig.raw,getValue 可用,游客服务器字段存在;前后 localStorage 内容未变化。 - 同一调用中 release 也请求一次、HTTP 200;之后因 game_server_tcp/player_server_tcp 缺失明确报错,未创建生产 WebSocket,localStorage 未变化。说明读取和内存解析入口实际执行,不能称 release 正式启动已通过。 - `fp_a0676df82b7d83ae`:停止实际本地预览后 ready=false、stopped=true、pendingCount=0。 +- `fp_115a6f611fcebfc0`:地址校验修复后再次刷新编译并重开实际预览,source=remote、ready=true、page=login;从 Creator 编译模块调用解析器确认空 `#` 片段抛出 ConfigParseError。停止后 stopped=true、pendingCount=0。 ## 当前配置来源限制 @@ -34,4 +35,4 @@ debug、release 均读取远程 JSON,按原工程身份层级读取参数, - TDD 包含原函数差分对照、local 必须等待读取、读取失败/停止期间零连接、正式地址缺失、不泄露远程配置到诊断等。保留既有错误路径测试的预期 boom 日志。 - 原有 50 个未跟踪文件 SHA256 全部不变,两项历史 meta 删除仍保留,共 52 项原有改动未处理。没有新资源文件,没有 worktree,没有合并或推送。 - 独立审查发现 URL 片段会通过 URL 解析却被 WebSocket 构造器拒绝;`58c974e` 已在配置入口拒绝字面 `#`(包含空片段),保留合法 `%23`。该修复 RED 为 5/6,GREEN 为 6/6;仅修改解析器及对应测试,未重复无关全量测试。 -- 最终复审正在进行,结论补充于审查完成后。 +- 独立规格/质量审查在片段修复后通过;最终整体复审覆盖 `556c47a..d79bed0`,无新增可操作缺陷。release 来源限制准确保留,未误报正式启动成功。