Repository navigation
Sync main into next: payload validation and MCP test stability - #167
Conversation
…ntract structure `pnpm contracts:generate` now also emits Core's payload table (packages/core/src/uam/generated/operation-payload-schema.ts) from the same contract snapshot MCP validates with, without MCP transport limits. The operation shape gate checks every snapshot payload field by field against it: JS types, required and undeclared fields, finite numbers, fixed-length arrays, Uint8Array, circular references and discriminated unions. Issues name the exact field path and keep the owning domain's code (invalid_display_node_payload, invalid_component_payload, ...); an unknown payload kind keeps unsupported_display_node_kind / unsupported_resource_kind and an undeclared setDisplayNodeProps field keeps unsupported_display_node_field. New messages describe only the schema and path, never caller values. Object-valued pageController, controllerOverrides and selectionController on list and tree nodes now fail at preflight instead of passing through to apply. Container guards and normalization probes that the gate makes unreachable are removed; #161's non-empty id checks, literal selector rules and selectedIndex integer check stay. Refs #156 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pinned-fixture settings tests copied, opened, saved and reread whole real projects (507 and 754 files) to check settings sidecars, taking 16-23 s and tripping AVA's 10 s inactivity timeout on Windows. Copy only the project file and settings directory instead. Every MCP client in the file also recompiled all advertised output schemas on listTools, about a second of synchronous CPU each, so results of concurrent tests bunched up far apart. Share compiled validators per worker; clients still validate tool output against the advertised schemas. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…st-timing test: keep MCP settings round-trip tests inside AVA's inactivity window
…-c2640f feat: validate transaction snapshot payloads against the generated contract structure
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f9f1556b0c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| case 'any': | ||
| return true; |
There was a problem hiding this comment.
Reject uncloneable values hidden by any nodes
When addResource or addPackage contains a generic asset whose metadata: Record<string, unknown> holds an uncloneable value such as a function, this branch accepts that value as structurally valid. Because this commit also removes the normalization guards, the subsequent structuredClone(resource.metadata) throws, so validateTransactionSupport escapes instead of returning an invalid_resource_payload/invalid_package_payload diagnostic and apply paths surface an execution_failure. Validate any nodes as cloneable JSON-compatible values or retain the normalization exception guard.
AGENTS.md reference: packages/core/AGENTS.md:L7-L7
Useful? React with 👍 / 👎.
Summary / 变更说明
同步 main 的 #163、#165 到 next:Core 按正式契约逐字段验证事务快照;MCP 设置回提测试只复制固定 fixture 的工程文件和 settings,并复用同 schema 的输出校验器,避免重复编译导致无进展超时。
Contract impact / 契约影响
Documentation / 文档联动
Verification / 验证证据
pnpm contracts:generate:41 operations / 17 methods,通过。pnpm check:ci:通过,43 项仓库测试、700 项 AVA、11/11 reference、真实 Chromium 消费者、五包安装验证、API/文档构建。文档仅有非失败的 chunk-size 提示。