Skip to content

fix: immutable update preparation fails without SDK declarations - #175087

Merged
steipete merged 1 commit into
mainfrom
upd/upd-l1664
Oct 17, 2026
Merged

steipete merged 1 commit into
mainfrom
upd/upd-l1664

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Fixes #175051.

What Problem This Solves

Fixes immutable update preparation failing because the candidate build omits Plugin SDK declarations required by the installed generation verifier.

User Impact

Default update builds include the public SDK artifacts needed to verify and seal a generation. Explicit runtime-only build profiles and overrides remain available. The full declaration build costs additional build time, as it does for an ordinary full build; no configuration or migration is required.

Why This Change Was Made

The update marker implicitly selected a runtime-only build even though package.json exports SDK declaration files. Those files ship in the published npm package and are checked by the existing full-build SDK consumer gate. Removing that implicit opt-out keeps the candidate producer aligned with the existing artifact inventory and manifest-driven verifier. Changing only the candidate verifier would leave already-installed updaters failing before activation.

The generation fixture now includes the real types/default export shape and checks rejection when its declaration is absent. The legacy shell fixture keeps declaration-cache inspection synthetic alongside its already-synthetic compiler, while retaining real transaction and restart ownership checks. No new artifact list or production path is introduced. Production: +0/-2 lines; tests: +19/-4; docs: +3/-2. Thanks @potterdigital for the precise report.

Evidence

  • The changed updater-default case fails against unchanged production code: declaration compiler phases, declaration publication, and the SDK export check are absent. After the fix, all 59 build-owner tests pass (19.5s test time, 52.9s wall time).
  • All focused and consumer suites pass: 253 tests total, with four existing Windows-only skips. This includes all 12 immutable-generation tests, 28 published legacy-shell cases, 14 source-update transaction tests, and 40 source-runner tests. The legacy success cases first exposed the fixture's real cache lookup; they pass after making that lookup synthetic alongside the compiler.
  • A real local OPENCLAW_UPDATE_IN_PROGRESS=1 node --import ./scripts/tsx.mjs scripts/build-all.mts build, with no declaration override, passes in 4m 56.7s. Its SDK gate verifies all 155 public subpaths. The published [email protected] tarball independently contains both dist/plugin-sdk/core.js and core.d.ts.
  • Script, infra-test, and tooling-test typechecks; targeted oxlint; formatting; git diff --check; and Madge (zero cycles) pass. Independent P0–P2 review reports no actionable findings. Full check:changed was not run because its SQLite inventory stalls on this host; the scoped checks above follow the provided local gate budget, and PR CI remains the broad proof.
  • The pre-existing declaration-cache integration test takes 56.8s on this host; the file takes 74.8s of test time. It executes real declaration builds and cache restoration; no timeout, retry, skip, or assertion was changed.

Live Linux proof used a disposable Testbox run, isolated HOME/state, a free loopback port, and a task-owned systemd Gateway. The update-marked build passed in 3m 39.3s; its generation sealed and verified with declarations present. The real CLI returned adopted, then already-current with no warnings. The Gateway and lease were stopped after proof.

The commands below used the scratch installation, its pinned external Node executable, its own service/account, and fresh state/config paths:

OPENCLAW_UPDATE_IN_PROGRESS=1 node --import ./scripts/tsx.mjs scripts/build-all.mts
sudo env HOME="$HOME" OPENCLAW_STATE_DIR="$live_state" OPENCLAW_CONFIG_PATH="$config" \
  "$runtime" "$release/dist/index.js" update adopt-immutable \
  --root "$install_root" --service "$unit" --account "$account" \
  --state-dir "$live_state" --config "$config" --runtime "$runtime" \
  --previous-updater-stopped --json
sudo env HOME="$HOME" OPENCLAW_STATE_DIR="$live_state" OPENCLAW_CONFIG_PATH="$config" \
  "$runtime" "$release/dist/index.js" update --sha "$sha" --no-restart --json

Initial provisioning attempts were rejected for copied-file ownership, an inaccessible service-account state path, and this CI host's writable /opt. Only the disposable fixture was corrected: normalize its ownership, use the lease's nonroot runner account with fresh private state, and place the installation/runtime under protected /usr/lib parents. The verifier and directory-protection checks stayed unchanged. This proves build → seal → adopt and the already-current CLI path; a published-updater-to-new-SHA preparation is not claimed.

Keep update-marked full builds aligned with the package export contract required by installed immutable generation verifiers. Fixes #175051.
@clawsweeper

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

@steipete
steipete marked this pull request as ready for review October 17, 2026 04:15
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-17T04:18:05.634578Z 0d41626 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation scripts Repository scripts size: XS labels Oct 17, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 17, 2026
@clawsweeper

clawsweeper Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR restores SDK declaration generation for default update builds while preserving explicit runtime-only choices.

Example: An immutable installation on 2026.10.4 prepares a different official main SHA.

  • Before: The update-marked build omits core.d.ts, and generation verification fails with ENOENT.
  • After: The default build produces the SDK declarations required by the existing verifier.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused repair is source-supported and has useful real-build evidence, but the required installed-updater preparation scenario remains unproven.
Proof confidence 🦐 gold shrimp (3/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: An adopted immutable installation cannot prepare a new generation because its candidate lacks SDK declarations required by the installed updater.
Reason: The maintainer-authored direction repairs a documented update contract with a smaller production implementation and explicitly accepts the declaration-build cost.

Merge readiness

✅ Ready for maintainer review

This PR repairs a confirmed build/verifier mismatch that remains on current main; no discrete introduced correctness or security defect was found.

Priority: P2
Reviewed head: 0d416260d93a67af733792781b50486ed5d213ec

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The required published-2026.10.4-updater-to-different-candidate preparation run, with existing settings and data intact, is not supplied.
Agent review details

How this fits together

The source-build orchestrator turns candidate source into runtime and SDK artifacts, which the installed immutable updater verifies before sealing and recording a prepared generation.

flowchart LR
  A[Installed updater] --> B[Candidate source]
  B --> C[Default full build]
  C --> D[Runtime and SDK declarations]
  D --> E[Installed generation verifier]
  E --> F[Sealed prepared generation]
Loading

Technical review

Best possible solution:

Produce the SDK artifacts promised by package exports without weakening installed immutable verification or adding another artifact inventory.

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

Current-main build selection, package exports, and generation verification establish the failure chain, corroborated by the affected-release report; this read-only review ran no reproduction.

Is this the best way to solve the issue?

The producer-side repair satisfies already-installed verifiers, preserves explicit runtime-only builds, and avoids a competing verification contract.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Update-marked build selection changes intended behavior with a stated reason (b029a95: Skip expensive declarations to avoid measured dev-update timeouts; this PR explains why installed immutable verification now requires declaration-complete default builds.)
  • Immutable-generation fixture and documentation keeps the original intent (99babf2: Prepare and verify sealed generations without disturbing the serving installation; the fixture now represents the real package's declaration export.)
  • Legacy source-build fixture keeps the original intent (d09ffd2: Exercise real source-update transaction and restart ownership with synthetic compiler responses; synthetic cache inspection remains within that existing fixture boundary.)

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Raw commit b029a95 adds scripts/build-all.mts:560 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: b029a959dbf7; files: scripts/build-all.mts)
  • Vincent Koc: Raw commit 4e1447e adds scripts/build-all.mts:86 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 4e1447e18665; files: scripts/build-all.mts)

PR surface

Tests +15, Docs +1, Other -2. Total +14 across 5 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 19 4 +15
Docs 1 3 2 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 1 0 2 -2
Total 5 22 8 +14

Labels

Label changes:

  • add P2: Immutable preparation is blocked on an explicitly adopted installation layout, while the current Gateway continues serving.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp 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:

  • P2: Immutable preparation is blocked on an explicitly adopted installation layout, while the current Gateway continues serving.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Provide the published-updater-to-different-candidate preparation evidence described above.

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 17, 2026, 12:32 AM ET / 04:32 UTC.

@steipete
steipete merged commit 3c2e9e5 into main Oct 17, 2026
206 of 209 checks passed
@steipete
steipete deleted the upd/upd-l1664 branch October 17, 2026 04:39
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 18, 2026
…dates (openclaw#175087)

Immutable update preparation always failed: the updater marks its candidate build with OPENCLAW_UPDATE_IN_PROGRESS, build-all then defaulted to a runtime-only build without .d.ts files, and immutable generation verification requires dist/plugin-sdk/*.d.ts like packaged releases ship. The build no longer implicitly skips declarations for update-marked builds; explicit runtime-only builds stay available. Production net -2 LOC. Linux live proof: an update-marked build sealed the generation (adopted, then already-current) with SDK declaration verification passing.

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

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. scripts Repository scripts 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.

[Bug]: Immutable update preparation always fails: candidate build skips .d.ts while verifyPluginSdkExports requires dist/plugin-sdk/core.d.ts

1 participant