Skip to content

refactor(test): share SDK export fixture JSON writes - #189799

Merged
vincentkoc merged 1 commit into
mainfrom
refactor/test-sdk-export-json-owner-next100-20261101
Nov 1, 2026
Merged

vincentkoc merged 1 commit into
mainfrom
refactor/test-sdk-export-json-owner-next100-20261101

Conversation

@vincentkoc

@vincentkoc vincentkoc commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

The SDK export registration tests duplicated the canonical pretty-JSON writer at ten call sites. Use the existing writeJsonFile helper for those fixture writes.

Owner: test/helpers/temp-repo.ts retains recursive parent creation, two-space formatting, the final newline, and a void return. Real CLI drift/repair/idempotence, npm packing, private Unicode entry names, stale facade rejection, and generated export assertions stay in place.

Validation: complete owner passes 4 tests under Node and Bun; original owner passes 4 under Node. Temporary original/candidate probes pass on both runtimes for serialized values and final newline, overwrite modes, void returns, and blocked-parent errors. Removing the shared writer's final newline produces one expected failure. Relevant test types, targeted lint, formatting, and git diff --check pass.

LOC after formatting: tooling/production 0; tests/support 0. This consolidates ownership; no subprocess, elapsed-time, billed-minute, or native Windows saving is claimed.

Independent source review: scoped clean, confidence 0.99. Required hosted and native landing gates remain authoritative.

@clawsweeper

clawsweeper Bot commented Oct 31, 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.

@vincentkoc vincentkoc self-assigned this Oct 31, 2026
@vincentkoc
vincentkoc marked this pull request as ready for review October 31, 2026 21:56
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 31, 2026
@clawsweeper

clawsweeper Bot commented Oct 31, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces the SDK export tests’ local JSON writer with the existing shared writeJsonFile helper.

Example: Create a fixture containing packages/plugin-sdk/package.json with {"exports":{}}.

  • Before: The local writer creates parent directories and writes two-space JSON with a final newline.
  • After: The shared helper creates the same directories and writes identical bytes.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused, correct consolidation with equivalent serialization and preserved behavioral coverage.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored test-only refactor changes fixture setup; the body reports Node and Bun suite passes and equivalence probes, while exact-head CI is green. No target code was executed during this read-only review.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: The maintainer-authored direction removes duplicate fixture serialization without introducing another abstraction or changing product behavior.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: the maintainer-authored refactor consolidates equivalent fixture writes without weakening coverage, and no actionable defect was found.

Priority: P3
Reviewed head: 22c64f8b64c3a1ab528a4a4ffbcaf3deaefeb2dc

Before merge

None.

Findings

None.

Agent review details

How this fits together

The test fixture supplies synthetic SDK inventories and manifests to the export synchronization CLI, then checks generated exports, declaration aliases, package contents, and idempotence.

flowchart LR
A[Synthetic SDK inventory] --> B[Shared JSON writer]
B --> C[Temporary repository]
C --> D[SDK synchronization CLI]
D --> E[Generated manifests and aliases]
E --> F[Registration and packing assertions]
Loading

Technical review

Best possible solution:

Use the existing shared writer while retaining the registration CLI and package-boundary assertions.

Do we have a high-confidence way to reproduce the issue?

There is no reported runtime bug; source inspection confirms the duplicated writer and equivalent shared implementation.

Is this the best way to solve the issue?

This is the smallest complete consolidation: reuse the existing owner, remove the duplicate implementation, and preserve every assertion.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 603106d1a96a.

Provenance checked

  • SDK registration fixture serialization keeps the original intent (7ed11a4: Exercise the registration CLI against isolated fixtures to catch stale private declaration aliases.)
  • Consolidated fixture inputs and retained scenarios keeps the original intent (bd5268d: Reduce redundant test setup while preserving distinct registration and package-boundary contracts.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned change preserves test contracts: The introduced diff removes the local writer, imports the existing helper, and migrates all ten calls; the four test scenarios and their assertions remain intact. (test/scripts/sync-plugin-sdk-exports.test.ts:8, 22c64f8b64c3)
  • Equivalent existing owner: writeJsonFile recursively creates parents, serializes with two-space indentation and a final newline, and returns void; its explicit UTF-8 encoding matches the removed writer’s default. (test/helpers/temp-repo.ts:27, 603106d1a96a)
  • Original registration boundary: fix(plugin-sdk): registration leaves private declaration aliases stale #132311 introduced the registration suite to catch stale private declaration aliases; this PR preserves that purpose and its later fixture consolidation. (test/scripts/sync-plugin-sdk-exports.test.ts:57, 7ed11a40543f)
  • Current main and exact-head gates: Fetched main retains the local writer. GitHub reports this PR cleanly mergeable, with successful CI, dependency-review, and security-sensitive-review status gates for the reviewed head. (22c64f8b64c3)
  • Policy and history limits: Read the complete root and test guidance, the shared-helper guidance, and simplification steps 1–3; no maintainer-notes directory exists. The shared helper’s introduction remains unknown because scoped history and blame encounter an unavailable historical blob; its current implementation is fully readable. (AGENTS.md:1, 22c64f8b64c3)

Likely related people:

  • Peter Steinberger: Raw commit bd5268d adds test/scripts/sync-plugin-sdk-exports.test.ts:90 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: bd5268d9f120; files: test/scripts/sync-plugin-sdk-exports.test.ts)

PR surface

Tests 0. Total 0 across 1 file. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 15 15 0
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 15 15 0

Labels

Label changes:

  • add P3: This is a behavior-preserving test maintenance change with no production runtime impact.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a behavior-preserving test maintenance change with no production runtime impact.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 31, 2026, 6:11 PM ET / 22:11 UTC.

@vincentkoc
vincentkoc merged commit 87c491f into main Nov 1, 2026
144 checks passed
@vincentkoc
vincentkoc deleted the refactor/test-sdk-export-json-owner-next100-20261101 branch November 1, 2026 00:29
@vincentkoc

Copy link
Copy Markdown
Member Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Nov 1, 2026
…ed-backup-search-exports-20261101

* commit 'cde4bfe4f10ce470ded7264c68d9a72ae03594cc':
  fix(ci): keep backup and chat search internals private (#189894)
  fix(codex): recover unused native threads without dropping history (#189900)
  fix(oc-path): use last duplicate JSON key to match runtime parsing (#189855)
  perf(test): parse the Mantis resolver workflow once (#189801)
  fix(agents): revert default hard context admission (#189891)
  refactor(test): use canonical tracked temp paths (#189800)
  chore(ui): refresh control ui locales (#189898)
  improve: show gateway commit and build time on About
  refactor(test): share SDK export fixture JSON writes (#189799)
  fix: restore Files navigation from unavailable previews (#189879)
  refactor(test): share raw ratchet fixture writes (#189798)
  fix(ai): honor Model Studio compatible-mode output limits (#189870)
  fix: hold queued messages through inline edits (#189869)
  perf(test): reuse the baseline fixture Node resolver (#189790)
  test(qa): correlate handoff replies by run identity (#189885)
  fix(ui): normalize canonical Unicode in local search comparisons (#189874)
  fix(ui): explain unsupported browsers without module scripts (#189883)

# Conflicts:
#	ui/src/pages/chat/components/chat-search-highlight.browser.test.ts
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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