Repository navigation
refactor: consolidate coercion ownership - #122692
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs maintainer review before merge. Reviewed August 12, 2026, 12:17 PM ET / 16:17 UTC. ClawSweeper reviewWhat this changesThe PR consolidates remaining coercion imports into normalization-core and Plugin SDK boundaries, including Control UI call sites and public export metadata. Merge readinessKeep open: current main supports the consolidation direction, but the active branch still needs exact-head package and Plugin SDK compatibility validation before landing. Priority: P2 Review scores
Verification
How this fits togetherNormalization helpers convert untyped values for core, plugins, scripts, and the Control UI. Package exports and Plugin SDK metadata determine which helpers downstream consumers can safely import. flowchart LR
A[Untyped input values] --> B[Normalization helpers]
B --> C[Core and scripts]
B --> D[Plugin SDK exports]
B --> E[Control UI]
D --> F[Plugins and consumers]
C --> G[Contract checks]
Before merge
Agent review detailsSecurityNone. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Complete exact-head package-export and Plugin SDK contract validation, then merge only if generated artifacts preserve existing imports while exposing the intended new subpaths. Do we have a high-confidence way to reproduce the issue? Not applicable: this is an internal ownership and packaging refactor, not a reported runtime defect. Is this the best way to solve the issue? Unclear until the exact branch and generated artifacts are available; current-main source supports the consolidation and identifies a real package-subpath gap. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against f29d581ab824. LabelsLabel changes:
Label justifications:
EvidenceAcceptance criteria:
What I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
b99a4cf to
82708b8
Compare
|
Land-ready proof for exact head
Latest ClawSweeper review is on this exact head with no findings. Its exact-head package/SDK validation and Codex-contract items are satisfied above; its |
|
Merged via squash.
|
* refactor: consolidate coercion ownership * test: align shard check with weighted planning * chore: refresh plugin SDK API baseline
Related: #121366
What Problem This Solves
OpenClaw still had hundreds of local coercion wrappers, rename-only facades, and duplicate ownership inventories after the earlier consolidation rounds. That made primitive normalization policy easy to drift across core, the Control UI, scripts, packages, and bundled plugins.
Why This Change Was Made
This round deletes obsolete internal facades and duplicate tooling concepts, routes callers to normalization-core or the narrow Plugin SDK boundary, adds the missing JSON-coercion package subpath and agent-ID ownership coverage, and consolidates exact provider, script, and error policies without broadening their accepted inputs. Dependency-free, serialized, security-sensitive, provider-specific, and shipped compatibility contracts remain local. The extension boundary now has three strict-zero modes and coercion declarations have one exact owner each.
User Impact
No user-visible behavior change is expected. Maintainers get one smaller, enforceable normalization architecture with fewer duplicate policy points; plugin authors retain the same supported public contracts.
Evidence
c2ea14c6de74717d115543d85a480d054eef721f/b99a4cfac65aca803a7e58f73bf0b82cfa415830onto exactorigin/main28a5889e9bd0b96727e6de872feb0698498b19c6as0548effc0a4014a791afd985e1dabf8c39654371/a155268c917afb54f361ddf91e000c7217e9fcb1. All 16 conflicts were generateddocs/.generated/plugin-sdk-api-baseline/*.jsonfiles; the rebase kept current-main copies, thenpnpm plugin-sdk:api:genregenerated the canonical output. The resulting 16 one-line hash refreshes are isolated in82708b8c98044ce4e981026e78c8cb2e7c3948c3, which is the pushed head.82708b8c98044ce4e981026e78c8cb2e7c3948c3: TruffleHog clean; one complete pass; zero findings; confidence 0.98.origin/main28a5889e9bd0b96727e6de872feb0698498b19c6: TruffleHog clean; two complete bounded passes; zero P0-P2 findings; confidence 0.87.src-outside-plugin-sdk,relative-outside-package,normalization-core-bypass), 95 tests across four Vitest shards, andgit diff --check.tbx_01kzv8870ctneprp1kynx0m84x. It passed all ratchets, formatting, package-lock checks, doctor contracts, SDK API/export/surface checks, deprecated API checks, plugin boundaries, dead exports, database/media/sidecar guards, all tsgo lanes, zero-warning oxlint for core/plugins/scripts, and zero runtime import cycles.test/scripts/build-identity.test.tsentered the tooling inventory. The planner contract is greedy LPT runtime weighting, so four nonempty deterministic stripes need complete, non-overlapping coverage and measured heavy-group separation—not equal file counts.node scripts/run-vitest.mjs test/scripts/ci-node-test-plan.test.ts test/scripts/build-identity.test.ts test/scripts/ci-changed-node-test-plan.test.ts. Targeted oxlint andgit diff --checkalso passed.origin/main: secret scan clean; two bounded passes; zero P0-P2 findings; final confidence 0.94.src-outside-plugin-sdk,relative-outside-package,normalization-core-bypass), Plugin SDK API/export/surface checks, and 49 tests across four Vitest shards covering normalization-core package exports, live provider-catalog primitives, build identity, coercion declaration ownership, and extension import boundaries.+896/-1313(net-417), tooling/docs+353/-715(net-362), tests/QA+363/-605(net-242), total+1612/-2633(net-1021).279b93242cfef379e65da97e87e44b83c5934fd7and local tagrust-v0.147.0(3ed6f04f6bf8b7c46299d1cb1ff99c74ce21a51d). The checked contracts were JSON-RPC error envelopes, typed turn errors, themodel/listrequest/response dialect and raw model metadata, andmcpServerStatus/listtool maps. The codex-app-server protocol preflight could not use the sibling checkout version; the pinned localrust-v0.147.0tag was inspected directly instead.AI-assisted; the maintainer understands and reviewed the change.