Skip to content

refactor(schema): deslop duplicated schema types - #164286

Merged
steipete merged 8 commits into
mainfrom
deslop/x02-schema-type-duplication-20261002
Oct 3, 2026
Merged

steipete merged 8 commits into
mainfrom
deslop/x02-schema-type-duplication-20261002

Conversation

@steipete

@steipete steipete commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Runtime schemas, parsers, protocol records, and handwritten TypeScript declarations repeated the same shapes, creating multiple definitions to maintain for each contract.

User Impact

No user-visible behavior change. Config keys, persisted records, protocol shapes, model-facing schemas, and validation behavior stay the same. The combined x02 and held x09 batch removes 1,106 net production lines across 178 files, excluding tests, fixtures, docs, and generated artifacts.

Why This Change Was Made

  • Derive mirrored provider, CLI, node, transcript, and plugin types from their canonical parser, schema, or owner. Retain distinct authoring contracts where defaults or public declarations require them.
  • Reuse protocol contracts for cron, Talk, presence, Gateway responses, device pairing, worker environments, and approvals; derive database row projections from their generated owners.
  • Consolidate channel group and thread-binding contracts through the existing SDK facade while preserving core/plugin isolation.
  • Preserve strict optional-property semantics, readonly collections, correlated unions, caller-owned generic payloads, and existing tool-policy/OAuth metadata contracts. One internal type-only mapper handles schema inference's optional-undefined widening.

This includes the held x09 stack ending in b5f69e60675 (e3c9784d24b, 2b0c170036f, and b5f69e60675). Integration keeps main's canonical binding/query owners and removed exports/imports.

SDK approval: Peter approved on 2026-10-03 exactly one additional public export for ChannelThreadBindingsSchema. Main's ceiling moved from 3642 to 3643, so this batch sets 3644. No other SDK budget increases.

Evidence

  • Final independent review found no actionable P0–P2 findings. Core, UI, extension, and extension-test typechecks pass. Both import-cycle checks report zero cycles.
  • The SDK surface check passes with exactly 3,644 public exports. Earlier canonical SDK comparison found no removed exports/subpaths and one added shared schema export.
  • Emitted-declaration consumers pass 69 strict parity assertions with exactOptionalPropertyTypes, preservation cases, and an identity-mapper negative control that reproduces the widening regression. Earlier coverage compared 449 exported types plus channel-specific contracts.
  • Shared thread-binding validation passed three exact schema-byte comparisons and 224 full-root parse/error comparisons. All 19 audit/Web Push schema exports remained JSON-byte-identical.
  • Earlier focused proof passed 594 tests across 36 files, then 1,350 tests across 77 files with one existing Windows-only skip. The previous plugin contract run passed 1,132 tests across 48 files. The integrated candidate passed 380 focused tests across 14 files and 10 routed suites (2,306.78 seconds, predominantly cold transformation).

The integrated plugin-contract run passed 1,131 of 1,132 tests across 48 files (564.19 seconds). Its one failure was the unchanged dependency scanner treating extensions/codex/native-session-binding.test-api.ts as runtime code because it imports Vitest. Main already fixes this in 3afb9bd07bc; the pushed-head hosted merge-ref run will verify that fix together with this batch. No scanner exception or dependency was added by this PR.

Canonical asset generation refreshed the Workboard content-addressed manifest, and the committed whole-repository asset check passes byte-for-byte. Both refreshed cycle checks report zero on the final candidate 1e015527d66a86892996c355e4581cbd60764fa8.

The original hosted run failed on this PR's wrapper inventory, Workboard asset hash, and SDK ceiling. This update includes the inventory repair, canonical asset regeneration, and approved ceiling; these are not claimed as inherited failures. The macOS-only worktree provisioning test previously timed out at its unchanged 120-second limit; hosted CI on this exact head is the gate, per Peter's direction. Final local lint preparation also hit its unchanged 300,000 ms SDK declaration-build timeout before lint ran; it is not claimed as a lint pass. The completed compiler checks and strict emitted-declaration proof remain separate evidence, and hosted CI must validate lint/build on the published candidate. No timeout or assertion was weakened.

Remote proof was attempted on Blacksmith Testbox tbx_01m41etrqrzbkdsx0fb7rc11r0 (run); source preparation stalled before validation. The lease is stopped. Direct AWS refused allocation at the shared lease limit. Validation uses the authorized sequential low-priority local fallback; no remote test pass is claimed.

The resumed hosted run 37157050744 passed build artifacts, production/test typechecks, extension package boundaries, baseline ratchets, and macOS Node checks. It exposed this PR's empty-object type lint error; the correction uses Pick/Required, passes canonical core lint and fresh strict declaration parity, and received clean independent review. No lint suppression was added. The run also had Copilot/Google Meet fixture failures matching the current unrelated x08 run, and a Swift audio-level assertion whose inheritance is unproven. The corrective exact-head run passed the lint and Swift gates without weakening checks.

Final exact-head CI and inherited failures

Current-head landing evidence for 1e015527d66a86892996c355e4581cbd60764fa8.

CI run 37158937049 completed with 124 successful jobs. Production/test types, lint, generated assets, package boundaries, macOS Node, Swift packages, Android, and security checks passed. The only failures are the following two inherited fixture failures and their aggregate CI gate:

  • Extension bundle 7-1: 11 failures in extensions/copilot/src/tool-bridge.test.ts. Direct-tool fixtures receive the default Tool Search controls; examples are expected web_fetch to be defined and tool_search being selected instead of the fixture tool. Main enables Tool Search by default, while these unchanged fixtures assume direct tools. The quarantine case fails at tool lookup before its boundary assertion.
  • Extension bundle 1-1: 38 failures in extensions/google-meet/index.test.ts. Durable transcript cleanup hits GatewayLockNamespaceError for a fresh owner in a different PID namespace, followed by Previous meeting fixture cleanup did not complete. The ownership guard continues to reject access; the lock classifier, durable finalization owner, and cleanup helper are unchanged.

Both exact failure sets also occur in current, unrelated x08 PR #164269 at head c38fb0486d541cac90fa705c59d379223b97aff0, run 37143843649 / job 111263822740. The failure owners are unchanged by either branch. Google Meet schema consolidation and x08 URL helpers are in the broader import graph; the matched failure is in the unchanged ownership/cleanup path. All current-head security-sensitive review and Security High boundary checks are successful.

The previous head's empty-object lint error was corrected and is green here. Its Swift audio-level assertion passed on this head without changing Swift code or weakening assertions; no exception is applied to Swift. The inherited fixture defects remain with the main CI coordinator.

Per Peter's explicit 2026-10-03 direction, use the inherited non-security failure exception for a squash merge pinned to the API head above. The merged delta is -1,106 production lines. The squash message and PR body retain Peter's approval for exactly one SDK export: main 3643 -> candidate 3644 for ChannelThreadBindingsSchema, with no other budget increase.

@clawsweeper

clawsweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: 1e015527d66a86892996c355e4581cbd60764fa8
  • Maintainer: @steipete
  • Repository role: admin

These security sensitive changes were made:

  • src/agents/auth-profiles/credential-schema.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/auth-profiles/types.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/embedded-agent-runner/run/auth-controller.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/agents/provider-secret-egress.ts: Controls credential persistence, secret resolution, or redaction. Check storage permissions, credential scope, and exposure in logs or responses.
  • src/infra/device-auth-store.kernel.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/infra/device-pairing.types.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.
  • src/infra/exec-approval-policy-snapshot.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-approvals-core.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/infra/exec-approvals.types.ts: Controls sandbox containment or tool execution authority. Check filesystem and network isolation, approval scope, and command allowlists.
  • src/security/install-policy-response.ts: Controls product security checks or trust decisions. Check whether the change weakens detection, protection, or remediation.

Carefully review these changes before merging.

Keep schema-derived public types compatible with strict optional-property
consumers. Preserve existing tool-policy, OAuth metadata, caller payload,
readonly, and index-signature contracts while removing mirrored shapes.

Peter approved on 2026-10-03 exactly one additional SDK export for
ChannelThreadBindingsSchema. Fresh main's ceiling is 3643; this change sets
3644. No other SDK budget increases.
@steipete
steipete force-pushed the deslop/x02-schema-type-duplication-20261002 branch from 8418ea7 to 79ac6d8 Compare October 3, 2026 22:01
@openclaw-barnacle openclaw-barnacle Bot added channel: mattermost Channel integration: mattermost scripts Repository scripts channel: feishu Channel integration: feishu extensions: codex plugin: team-reports and removed extensions: agentsapi labels Oct 3, 2026
@steipete
steipete disabled auto-merge October 3, 2026 22:06
@steipete
steipete enabled auto-merge (squash) October 3, 2026 22:07
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 3, 2026
@steipete

steipete commented Oct 3, 2026

Copy link
Copy Markdown
Contributor Author

Current-head landing evidence for 1e015527d66a86892996c355e4581cbd60764fa8.

CI run 37158937049 completed with 124 successful jobs. Production/test types, lint, generated assets, package boundaries, macOS Node, Swift packages, Android, and security checks passed. The only failures are the following two inherited fixture failures and their aggregate CI gate:

  • Extension bundle 7-1: 11 failures in extensions/copilot/src/tool-bridge.test.ts. Direct-tool fixtures receive the default Tool Search controls; examples are expected web_fetch to be defined and tool_search being selected instead of the fixture tool. Main enables Tool Search by default, while these unchanged fixtures assume direct tools. The quarantine case fails at tool lookup before its boundary assertion.
  • Extension bundle 1-1: 38 failures in extensions/google-meet/index.test.ts. Durable transcript cleanup hits GatewayLockNamespaceError for a fresh owner in a different PID namespace, followed by Previous meeting fixture cleanup did not complete. The ownership guard continues to reject access; the lock classifier, durable finalization owner, and cleanup helper are unchanged.

Both exact failure sets also occur in current, unrelated x08 PR #164269 at head c38fb0486d541cac90fa705c59d379223b97aff0, run 37143843649 / job 111263822740. The failure owners are unchanged by either branch. Google Meet schema consolidation and x08 URL helpers are in the broader import graph; the matched failure is in the unchanged ownership/cleanup path. All current-head security-sensitive review and Security High boundary checks are successful.

The previous head's empty-object lint error was corrected and is green here. Its Swift audio-level assertion passed on this head without changing Swift code or weakening assertions; no exception is applied to Swift. The inherited fixture defects remain with the main CI coordinator.

Per Peter's explicit 2026-10-03 direction, use the inherited non-security failure exception for a squash merge pinned to the API head above. The merged delta is -1,106 production lines. The squash message and PR body retain Peter's approval for exactly one SDK export: main 3643 -> candidate 3644 for ChannelThreadBindingsSchema, with no other budget increase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: discord Channel integration: discord channel: feishu Channel integration: feishu channel: line Channel integration: line channel: mattermost Channel integration: mattermost channel: msteams Channel integration: msteams channel: raft Channel integration: Raft channel: synology-chat channel: telegram Channel integration: telegram channel: zalo Channel integration: zalo cli CLI command changes commands Command implementations extensions: browser extensions: codex extensions: crabbox extensions: deepgram extensions: deepinfra extensions: elevenlabs extensions: fish-audio Extension: fish-audio extensions: google extensions: gradium extensions: inworld Extension: inworld extensions: memory-core Extension: memory-core extensions: memory-lancedb Extension: memory-lancedb extensions: microsoft extensions: minimax extensions: mistral extensions: onepassword 1Password plugin extensions: openai extensions: openrouter extensions: openshell extensions: tts-local-cli extensions: volcengine extensions: vydra extensions: xai extensions: xiaomi gateway Gateway runtime merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. plugin: azure-speech Azure Speech plugin plugin: beam Beam session sharing plugin plugin: facetime FaceTime plugin plugin: geolocation Geolocation plugin (IP to coarse city) plugin: linux-node plugin: logbook Logbook automatic work journal plugin plugin: onnx plugin: team-reports rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. scripts Repository scripts security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant