Skip to content

perf(ci): shard UI checks and reuse SDK compiler inputs - #134528

Merged
steipete merged 4 commits into
mainfrom
codex/ci-ui-declaration-critical-path-20260831
Sep 1, 2026
Merged

steipete merged 4 commits into
mainfrom
codex/ci-ui-declaration-critical-path-20260831

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

The standalone UI job and unnecessarily invalidated SDK declarations are two remaining CI bottlenecks. The latest successful native UI run spent 230.26s in Vitest and 289s in the job, before preflight and final-gate time. SDK declaration cache keys previously included every ordinary source/test/UI/workflow byte, even when neither compiler consumed it.

Current UI runs now use three native Vitest shards through the existing argument/execution owner. All four projects retain their isolation and cleanup policies, with three root Node workers per runner and the unchanged Chromium default. The aggregate job id remains checks-ui; lint runs once. Both frozen-target shapes retain their original singleton, unsharded commands. The first native run executed disjoint 285/284/284-file partitions covering all 853 files and 13,176 passed cases plus one skip, with exact baseline file/case identity and outcome equality. Jobs took 165/204/146 seconds; all UI work finished 246 seconds after workflow creation. Each retained its three-worker limit and closed its browser provider. This is a measured UI improvement, not a whole-workflow five-minute result.

The SDK writer records each successful compiler's actual TypeScript Program membership in its existing private stage. The shared content snapshot policy now serves both native build-info and SDK declarations, replacing broad SDK byte hashing while retaining inherited configuration, generator/package metadata, installed compiler identity and resolution-topology validation. Both successful group receipts and an input mutation check are required before publication. Cache hits restore the entire generation into fresh staging and validate every canonical entry and relative declaration edge through the existing publication/lock owner. Direct/watch builds do not read or overwrite ordinary repository metadata; disabled caching creates no receipt. Old cache records without membership miss normally. Filesystem reads use the same canonical parent that namespace discovery enumerated, preserving logical path identities across Windows junctions. The cache identity also retains the current plugin-selection environment contract from main and normalizes TypeScript’s forward-slash config paths before making them checkout-relative on Windows. There is no new cache writer, dependency, product option, runtime storage or schema change.

The full real repository writer passed locally: 321 canonical entries, 712 declaration files and 5,880,440 bytes. Cold wall was 44.78s with two serial compilers; unchanged warm wall was 2.43s, with zero compiler invocations. A byte-only edit to an existing unconsumed UI test still reused identical output in 2.54s. All output hashes, mtimes and stamp bytes matched. The actual 10,995-file membership contains no test or UI files. This is local macOS proof, not a native Linux/Windows speedup claim.

Validation: 154 SDK/cache/config/lifecycle cases and 32 selected workflow/shard/UI-config cases passed. Pre-fix regressions cover unrelated-byte recompilation, mutation after emission, direct-build metadata overwrite in the initial candidate, and singleton UI admission. The full changed gate passed core/UI/core-test/plugin/script types; its first root-test pass found a redundant optional-value assertion, which was removed. The affected three envelope cases and root-test types then passed, followed by the remaining canonical coercion/deprecation checks, complete lint and import-cycle check. Workflow actionlint, zizmor, generated Git-owner, composite-input and formatting checks passed. Final configured Codex review of the corrected diff is scoped-clean at P0. All three Testboxes passed on the initial head. Native CI exposed a Windows namespace read through a junction alias and an independent Doctor public-import child heap exhaustion; both are retained in the run below. The Windows owner correction passed 31 local SDK/boundary cases, and the merged plugin-selection checks passed. The same 256 MiB Doctor batch/deep/public reproduction passed locally; investigation is tracking plugin-doctor initialization memory without raising the heap limit. The second native run passed Doctor and all three Testboxes, then exposed the remaining Windows relocation identity defect and a stale Teams inline-code expected value inherited from the shared Markdown whitespace fix. Both are corrected: the existing local declaration lifecycle case passes, and 80 Teams/shared Markdown cases pass. Type-aware lint passed after the concurrently running fixture processes were joined; the earlier invocation correctly rejected a changing resolution topology. The final two-file correction is scoped-clean in configured Codex review at P0. Head 84981aa passed native CI33452235578 and all three Testboxes (ARM33452235529/build33452235555/check33452235543). Native CI completed with216 successful jobs and9 intentional skips in7m59s; Docker finished last. Windows rows passed in339s/369s; all11 real declaration cases passed, including warm relocation, direct metadata preservation, plugin-selection changes and all negative inputs. Linux built both SDK groups in27.2s/28.1s, with the complete writer taking58.2s. This remains cold Linux evidence, not a native full-repository warm speedup.

Pinned contract inspected directly: tsdown 0.22.14 calls build:done after compilation; rolldown-plugin-dts 0.28.2 exposes retained Programs through its public tsc-context export with the current serial/default context settings; TypeScript 6.0.3 supplies consumed source membership. Real compiler probes, complete-graph execution, relocation, private-QA separation, input-mutation rejection and nested process cleanup validate the boundary.

Tradeoffs and follow-ups: three UI rows duplicate setup and add two Blacksmith registrations on applicable non-frozen routes; hosted/frozen/skipped paths add none. The conservative burst envelope becomes 3,708 registrations against the live 10,000 bucket and 6,000 operating target. Script/config/generator and namespace changes still invalidate conservatively. A controlled store-layout probe added about 0.294s locally, but actual hosted-store transport/topology cost remains unproved. The existing namespace walker can follow ambient pnpm project links into unrelated checkouts; that shared-owner coupling is a named follow-up, and the proof did not traverse those projects. A fresh CI store and native warm consumer must be observed before claiming operational savings.

Judged delta: product runtime 0; CI/build tooling +279, tests/support +204, docs +12. About 250 existing snapshot lines moved into the shared owner. The added tooling implements successful compiler membership, its private-stage boundary and integration with the complete cached generation; the old broad SDK byte policy is removed. Changelog is unnecessary for CI/build/test infrastructure.

Initial native evidence: CI 33449014227 executed merge d802e9b97a24 (head 1dbf080 into main 6598e54). Linux ran both real SDK compiler groups in 26.9s and 28.6s, with the complete writer taking 58.1s; its protected seed did not contain this new generation. Windows reached the existing real declaration fixture and exposed the namespace defect before compilation. Its unchanged cold/warm/relocation/negative cases remain the regression proof for the corrected head. Native full-repository warm-cache speedup remains unclaimed. The final exact-head results above complete the current native proof.

Latest ClawSweeper rank-up response: the pinned dependency hook/export contract was directly inspected and exercised above. Live effective main rules require only openclaw/ci-gate, with non-strict status checking; they do not require the former literal checks-ui context. The compact failure was the stale Teams expected value described above, not a production formatter regression. Exact-head validation is CI 33452235578; it completed successfully at the reviewed head. The prior corrected run is CI 33450811446, with both failed-case logs retained. Compiler membership is rebuildable build-cache metadata, not OpenClaw runtime state; old records safely cold-miss without a runtime migration.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XL maintainer Maintainer-authored PR labels Aug 31, 2026
@steipete
steipete marked this pull request as ready for review August 31, 2026 23:03
@clawsweeper clawsweeper Bot added merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 7:38 PM ET / 23:38 UTC.

ClawSweeper review

What this changes

The branch splits Control UI CI tests into three Vitest shards and records compiler-consumed files so plugin SDK declaration caches avoid invalidation from unrelated source changes.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep open: this maintainer-authored CI/build-tooling change remains active and is not on current main. No concrete introduced defect was proven, but exact-head native CI and the dependency-backed cache contract remain incomplete review gates.

Priority: P2
Reviewed head: 2f7fb353dab082961eb181c9e7496f6b8873155f

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The implementation is coherently structured and has focused coverage, but pending exact-head CI and unverified dependency hooks leave merge confidence incomplete.
Proof confidence 🌊 off-meta tidepool Not applicable: This member-authored CI/build-tooling PR is exempt from the external-contributor proof gate; supplied local evidence is useful but does not replace pending exact-head native CI.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This member-authored CI/build-tooling PR is exempt from the external-contributor proof gate; supplied local evidence is useful but does not replace pending exact-head native CI.
Evidence reviewed 5 items Introduced workflow behavior: The matrix creates three non-frozen UI rows, retains the frozen singleton, runs lint only on shard one, and forwards Vitest shard arguments only for non-frozen targets.
Workflow regression coverage: The added test exercises current, frozen-current, and frozen-legacy envelopes, including names, runner selection, forwarded arguments, and the single lint invocation.
Cache publication boundary: The writer seals a cache record only after the joined declaration build and both compiler receipts; publication validates the staged declaration closure first.
Findings None None.
Security None None.

How this fits together

The CI workflow runs the Control UI test suite before the final CI gate. Separate build tooling stages and restores plugin SDK declarations, so its cache signature controls whether CI recompiles those declarations.

flowchart LR
A[CI preflight] --> B[Control UI shard matrix]
B --> C[Final CI gate]
D[SDK declaration writer] --> E[Compiler input receipts]
E --> F[Cache validation]
F --> G[Staged declaration publish]
G --> C
Loading

Before merge

  • Resolve merge risk (P1) - Exact-head native CI is still incomplete, with one failing compact lane whose log was not available in the supplied context.
  • Resolve merge risk (P1) - Cache validity depends on the pinned tsdown and rolldown-plugin-dts hook/export contract; that contract could not be directly inspected in this checkout.
  • Resolve merge risk (P1) - Non-frozen runs rename the visible UI checks to matrix-specific contexts, so branch protection should be confirmed not to require the former literal name.
  • Complete next step (P2) - This protected maintainer PR needs normal exact-head validation rather than an automated repair lane.
Agent review details

Security

None.

PR surface

Tests +204, Docs +12, Config +7, Other +269. Total +492 across 13 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 211 7 +204
Docs 2 21 9 +12
Config 1 11 4 +7
Generated 0 0 0 0
Other 7 551 282 +269
Total 13 794 302 +492

Review metrics

Metric Value Why it matters
Production versus test/support delta CI/build tooling +562/-286 (net +276); tests/support +211/-7 (net +204); docs +21/-9 (net +12) The branch adds substantial CI/cache infrastructure while leaving product runtime code unchanged, so exact-head operational validation is material.

Stored data model

Persistent data-model change detected: persistent cache schema: scripts/lib/compiler-input-snapshot.mts, persistent cache schema: scripts/lib/declaration-stage.mts, persistent cache schema: scripts/lib/tsdown-declaration-inputs.mts, persistent cache schema: scripts/write-plugin-sdk-entry-dts.ts, serialized state: scripts/lib/tsdown-declaration-inputs.mts, serialized state: scripts/write-plugin-sdk-entry-dts.ts, and 2 more. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Complete exact-head automation validation (recommended)
    Finish the native CI run, inspect the failing compact lane, and confirm required-status rules accept the matrix UI check contexts before merging.
Copy recommended automerge instruction
@clawsweeper automerge

Special instructions:
Wait for exact-head native CI completion, resolve any diff-caused failure, and confirm required status checks accept the checks-ui matrix contexts.

Technical review

Best possible solution:

Keep the shared staged-declaration owner and the bounded three-shard UI design, then complete exact-head native CI and verify the pinned compiler-hook contract and required status contexts.

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

Not applicable: this PR changes CI and build-tooling performance rather than reporting an end-user failure.

Is this the best way to solve the issue?

Unclear: the owner-boundary design and focused regression tests are coherent, but direct verification of the dependency contract and exact-head native behavior remains unavailable.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 43f76f312682.

Labels

Label justifications:

  • P2: This changes CI throughput and build-cache validity with bounded operational impact.
  • merge-risk: 🚨 automation: The branch changes CI matrix fan-out, visible check contexts, and declaration-cache restore decisions.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This member-authored CI/build-tooling PR is exempt from the external-contributor proof gate; supplied local evidence is useful but does not replace pending exact-head native CI.

Evidence

What I checked:

  • Introduced workflow behavior: The matrix creates three non-frozen UI rows, retains the frozen singleton, runs lint only on shard one, and forwards Vitest shard arguments only for non-frozen targets. (.github/workflows/ci.yml:2234, 2f7fb353dab0)
  • Workflow regression coverage: The added test exercises current, frozen-current, and frozen-legacy envelopes, including names, runner selection, forwarded arguments, and the single lint invocation. (test/scripts/ci-workflow-guards.test.ts:8953, 2f7fb353dab0)
  • Cache publication boundary: The writer seals a cache record only after the joined declaration build and both compiler receipts; publication validates the staged declaration closure first. (scripts/write-plugin-sdk-entry-dts.ts:146, 2f7fb353dab0)
  • Dependency contract signal and review gap: The new capture imports tsdown types and dynamically loads rolldown-plugin-dts's tsc-context; local node_modules lacks those packages and DNS prevented direct inspection of the pinned package contract. (scripts/lib/tsdown-declaration-inputs.mts:45, 2f7fb353dab0)
  • Current-main comparison: The fetched current main revision does not contain this sharding or compiler-snapshot implementation, so the PR is not obsolete or implemented on main. (scripts/write-plugin-sdk-entry-dts.ts:1, 43f76f312682)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Complete exact-head native CI and inspect the failed compact test lane.
  • Verify the pinned tsdown build hook and rolldown-plugin-dts tsc-context export from installed or upstream package source.
  • Confirm branch protection does not require the pre-matrix visible checks-ui context.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-31T23:12:37.561Z sha 1dbf080 :: needs maintainer review before merge. :: none

@openclaw-barnacle openclaw-barnacle Bot added the channel: msteams Channel integration: msteams label Aug 31, 2026
@steipete
steipete merged commit cc797c0 into main Sep 1, 2026
291 checks passed
@steipete
steipete deleted the codex/ci-ui-declaration-critical-path-20260831 branch September 1, 2026 00:00
@steipete

steipete commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 1, 2026
)

* perf(ci): shard UI checks and reuse SDK compiler inputs

* fix(build): resolve compiler namespace links from canonical parents

* fix(ci): normalize Windows compiler cache paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

channel: msteams Channel integration: msteams docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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