test(cross): G6.6 跨网 e2e 红灯门禁 + 判定逻辑单测 - #24
Merged
Merged
Conversation
- feat(scripts): wan-egress.mjs 抽出出口判据(lookupEgress/isPrivateIp/judgeDifferentNetwork),wan-sync 改为复用 - feat(scripts): verify-mcp-cross.mjs 门禁——无环境退出码 1 并打印所需 env;环境齐备驱动 A memory_write / B memory_sync / 双端 memory_status,产出 mcp-cross-evidence.json 并以 judgeCrossEvidence 判定 - feat(scripts): mcp-cross-lib.mjs 纯函数(checkCrossEnv/judgeCrossEvidence/printCrossGuidance)便于单测 - test(cross): tests/wan/mcp-cross.test.mjs(13 例)覆盖缺 env、逐项不达标、出口判据、真实调用脚本无环境→退出码 1 - chore: package.json 增 verify:mcp:cross(不纳入 CI——无环境必红) G6.6 仍阻塞未勾选;本提交只落门禁,不产生跨网证据。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
目的
为 G6.6 跨网 e2e(喂 G3-E / D5) 落地红灯门禁:真实两机证据齐备后,一条命令自动判定是否达成。G6.6 本项仍阻塞未勾选,本 PR 只落门禁,不产生跨网证据。
变更
scripts/wan-egress.mjs:抽出公网出口判据(lookupEgress/isPrivateIp/judgeDifferentNetwork),wan-sync.mjs改为复用(单实现,无行为变化)。scripts/mcp-cross-lib.mjs:纯函数checkCrossEnv/judgeCrossEvidence/printCrossGuidance(可单测)。scripts/verify-mcp-cross.mjs(npm run verify:mcp:cross):memory_write唯一标记 → Bmemory_sync{peerId:A-deviceId,address}→ Bmemory_query命中 → 双端memory_status比较stateHash、pendingPeers→ 出口判据 → 写mcp-cross-evidence.json。markerFound/stateMatches/identityShared/differentPublicNetwork=true且pendingPeers=0。tests/wan/mcp-cross.test.mjs(13 例):缺 env、逐项不达标、出口判据、真实调用脚本无环境 → 退出码 1。package.json:verify:mcp:cross。不纳入 CI(CI 无环境必红),其判定逻辑由单测守护。所需 env(真实两机时)
必需
MEBULAR_WAN_PEER、MEBULAR_WAN_PEER_ID、MEBULAR_WAN_MCP_A、MEBULAR_WAN_MCP_A_TOKEN;可选MEBULAR_WAN_MCP_B(_TOKEN)、MEBULAR_WAN_RELAY、MEBULAR_WAN_PEER_EGRESS、MEBULAR_MCP_CROSS_OUT。执行清单见docs.design/g6.6-cross-network-blocker-2026-09-14.md。验证(E1)
npm run verify:mcp:cross退出码 1 并打印所需 env(实测)。tests/wan/mcp-cross.test.mjs13/13 通过。build、lint、npm run verify0–6、verify:wan:cross:selftest:isolated(E1 non-evidence)全绿。