Repository navigation
fix(plugin-sdk): stabilize tuple-derived API baseline ordering - #119635
Conversation
|
Codex review: needs real behavior proof before merge. Reviewed August 5, 2026, 10:04 AM ET / 14:04 UTC. ClawSweeper reviewWhat this changesThe branch preserves declared tuple order when rendering string- and numeric-literal unions for Plugin SDK API-baseline hashes. Merge readinessKeep this maintainer-labeled PR open. Current main still has the traversal-dependent alias renderer; the branch adds a narrow, guarded normalization with focused regressions and no identified functional defect. Priority: P3 Review scores
Verification
How this fits togetherThe Plugin SDK baseline generator reads public TypeScript declarations and serializes them into hashes that guard plugin API compatibility. This change affects only deterministic baseline rendering, not runtime plugin behavior or exported SDK surfaces. flowchart LR
A[Public SDK declarations] --> B[TypeScript checker]
B --> C[Baseline generator]
C --> D[Tuple literal ordering]
D --> E[API baseline hashes]
E --> F[Contract check]
Before merge
Agent review detailsSecurityNone. PR surfaceSource +6, Tests +56. Total +62 across 2 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Merge the generator-level normalization once the in-progress exact-head checks finish green, retaining the existing fallback for non-literal and non-tuple aliases. Do we have a high-confidence way to reproduce the issue? Yes: the checked-in fixture creates separate TypeScript programs, prewarms an unrelated literal, and shows the direct tuple-derived alias path that the formatter stabilizes. Is this the best way to solve the issue? Yes: applying the ordering rule in the baseline generator is the narrowest canonical owner boundary; a compiler-wide ordering option would broaden output changes beyond the affected literal tuple aliases. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 03a9e022ed83. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* origin/main: (130 commits) refactor(qa): consolidate scenario runtime helpers (openclaw#119623) fix(telegram): bind Mini App auth to dashboard launches refactor(agent-core): unify session projection and compaction summaries (openclaw#119639) fix(codex): allow natural reactions in the current conversation (openclaw#119649) refactor(providers): deduplicate bundled model catalogs (openclaw#119627) fix(ui): observe the active service worker after asset refresh (openclaw#119622) fix(agents): strip echoed base64 image payloads so photo-heavy turns no longer hit the per-turn output cap (openclaw#119488) improve: make state-heavy test suites faster (openclaw#119617) perf(agents): add concurrency benchmark (openclaw#119569) fix(browser): visibly report failed pairing and tab-sharing actions (openclaw#119526) refactor(lobster): consolidate embedded workflow execution (openclaw#119630) fix(plugin-sdk): stabilize tuple-derived API baseline ordering (openclaw#119635) docs(skills): make full-authority maintainer runs unattended (openclaw#119629) fix(managed-child): honor process groups that vanish before cleanup (openclaw#119614) fix(ci): stop label-driven automation churn (openclaw#119610) fix(media): keep the ttl sweep out of the managed outgoing tree (openclaw#119127) fix(claws): remove owner-qualified skills (openclaw#119606) fix(clawrouter): show stable error for malformed usage responses (openclaw#119580) fix(gateway): claim malformed plugin icon routes (openclaw#119559) fix(telegram): preserve truthful empty-content delivery (openclaw#88810) ...
What Problem This Solves
Resolves a problem where maintainers making behavior-neutral plugin refactors can encounter false Plugin SDK API contract drift even though the public SDK has not changed. TypeScript 6.0.3 orders resolved union members by compiler-assigned type IDs, so discovering an unrelated literal earlier can change the printed order and hash of a tuple-derived public type.
Why This Change Was Made
Normalize numeric-indexed constant-tuple aliases at their API-baseline generator owner by printing string and numeric literal union members in declared tuple order. Preserve duplicate reduction, verify every constituent still matches the resolved union, and leave non-tuple or non-literal types on the existing checker path. TypeScript's hidden global
stableTypeOrderingoption is unsuitable because it changes established union spelling across the entire program and would require protected baseline churn. Simplifying the existing symbol-kind dispatch and declaration comparators keeps the generator at its existing 700-line limit, with only six net new production lines.User Impact
Plugin authors and operators see no runtime, protocol, or public SDK API changes. Maintainers can refactor unrelated code without a spurious SDK contract failure caused solely by TypeScript traversal order. All 149 existing protected API baseline hashes and all 4,831 public SDK exports remain unchanged; no generated baseline, native relay, protocol, or public declaration was edited.
Evidence
pnpm test src/plugin-sdk/api-baseline.test.ts: 8/8 passed, including deterministic string and numeric literal prewarming regressions and duplicate tuple coverage.pnpm plugin-sdk:api:check: all 149 existingdocs/.generated/plugin-sdk-api-baseline.sha256entrypoint hashes unchanged.pnpm plugin-sdk:surface:check: unchanged 149 public entrypoints and 4,831 public exports, with zero forbidden subpaths.pnpm check:changed: passed all core/core-test/plugin/plugin-test typechecks, dead-export and architecture guards, core lint, and lint across 8,213 plugin files.gpt-5.6-sol/xhighautoreview: clean, confidence 0.99.