Skip to content

fix: keep standalone build identities reproducible - #183179

Merged
steipete merged 3 commits into
mainfrom
fix/standalone-reproducible-builds
Oct 25, 2026
Merged

steipete merged 3 commits into
mainfrom
fix/standalone-reproducible-builds

Conversation

@steipete

@steipete steipete commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repeated standalone builds of the same inputs changed executable bytes because build identities were random, AOT WASM registration imports included temporary absolute paths, and local checkout freshness timestamps entered retained-resource identity.

User Impact

Standalone builds now retain the same identity for identical prepared inputs across output directories, while compiled-code and native-resource changes invalidate it. Matched AOT/JIT support provenance and bundled-plugin change checks remain intact. No default runtime or release publication changes.

Why This Change Was Made

Derive the shared AOT/support identity from the unstamped module graph, retained resource bytes and modes, compiler, target and compilation options. Bundled-plugin fingerprints capture that identity once, preserving immutable-image invalidation. Relative WASM registration imports keep the staging root out of the graph while preserving content-addressed WASM invalidation.

Exclude the two local freshness stamps from the standalone resource plan. Their wall-clock times still serve local build admission, while portable commit provenance remains in build-info.json. Reproducible preparation sets the same OPENCLAW_BUILD_TIMESTAMP for each source build.

Evidence

All 57 selected support, sidecar, WASM and snapshot tests pass, as do scoped script/test lint, formatting, and the affected test-root-scripts TypeScript graph. Suite wall time was 351 seconds on the loaded host, 97% worker transformation; the extended freshness regression took 562ms. That regression failed on the preceding head with identical module hashes but different build IDs when local freshness timestamps differed; it now verifies equal identity/output bytes and omission of those stamps while retaining build information.

A native synthetic JS+WASM compile through the actual compilation owner reproduced unequal baseline executables, then byte-identical outputs after the fix in two independent directories. A 129-entry native control also matched across independent roots and reversed creation order. These are focused proofs; full-application reproducibility remains a separate P7 qualification step. Independent reviews of the implementation and both follow-ups reported no actionable P0–P2 findings.

Release-note context: fix unstable standalone build identities, exclude local freshness stamps, and remove temporary paths from AOT WASM registration.

@clawsweeper

clawsweeper Bot commented Oct 25, 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 25, 2026 03:07
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 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-25T03:57:04.505596Z 50d2373 New commits
ℹ️ 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: M labels Oct 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ef081d9c79

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/lib/bun-standalone-support.mjs Resolved
@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR derives standalone build identities from prepared inputs, removes temporary paths from WASM imports, and excludes volatile local freshness stamps.

Example: Two builds use identical prepared inputs but freshness stamps contain builtAt values 1000 and 1001.

  • Before: Random identities, temporary paths, and retained stamps make the builds differ.
  • After: Both builds derive the same identity while retaining portable build provenance.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The focused implementation is correct on inspection and the prior finding is fixed; native reductions support it, with full shipped-builder qualification remaining outside the supplied evidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored PR is outside the ordinary contributor proof gate; supplied native compiler reductions exercise the changed compilation owner, while committed regressions cover freshness exclusion, identity invalidation, WASM root independence, and captured plugin fingerprints.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Packagers cannot reliably compare independently produced standalone artifacts because equivalent inputs receive different embedded identities.
Reason: The maintainer-authored direction repairs a concrete packaging defect while preserving runtime defaults and the existing artifact contract.

Merge readiness

✅ Ready for maintainer review

Keep this PR open: it fixes a current build-identity defect, resolves the previous freshness-stamp finding, and introduces no actionable correctness or security findings.

Priority: P2
Reviewed head: 50d2373621c06a12b7c8c8476ac0f126f9e9137f

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence does not demonstrate independent full-application preparation through the shipped standalone builder; that qualification is explicitly deferred.
Agent review details

How this fits together

The standalone builder turns a prepared OpenClaw runtime and Bun compiler into an executable, resource sidecar, manifest, and optional matched JIT companion.

flowchart TD
  A[Prepared runtime] --> B[Module bundling]
  A --> C[Resource planner]
  B --> D[Deterministic identity]
  C --> D
  D --> E[Bun compilation]
  E --> F[Executable and companion]
  C --> G[Sidecar and manifest]
Loading

Technical review

Best possible solution:

Keep deterministic identity generation in the existing compilation owner and freshness-stamp exclusion in the existing resource planner.

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

Current-main source establishes random build identities and temporary absolute WASM imports; the maintainer additionally reports unequal baseline native outputs and a regression failing before the freshness-stamp repair.

Is this the best way to solve the issue?

The change addresses the nondeterministic inputs through existing owners, preserves matched-companion provenance, and captures the executing image identity without adding a competing state owner.

AGENTS.md: found and applied where relevant.

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

Provenance checked

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The merge-base-to-head diff contains the deterministic identity, captured image fingerprint, relative WASM import, resource omission, documentation, and regression changes. (50d2373621c0)
  • Previous finding resolved: The resource planner excludes .buildstamp and .runtime-postbuildstamp while retaining build-info.json; the extended regression varies both local timestamps and checks identity, output equality, and pruning. (scripts/lib/bun-standalone-sidecar.mjs:68, 50d2373621c0)
  • Identity ownership and initialization: Compilation hashes the unstamped graph, resource bytes and modes, compiler, target, and options; the generated bootstrap initializes build information before the artifact adapter captures its identity. (scripts/lib/bun-standalone-support.mjs:196, 50d2373621c0)
  • Current main still needs the change: Fetched main still generates a random UUID and inserts an absolute WASM registration path. (scripts/build-bun-standalone.mjs:105, bfcaa1b2cd1c)
  • Focused native evidence: The maintainer reports native compilation through the actual owner producing matching JS/WASM executable hashes across independent roots, plus a matching 129-entry ordering control; fix: keep standalone build identities reproducible #183179 (comment) explicitly distinguishes these reductions from full-application qualification. (50d2373621c0)
  • Existing manifest compatibility: The manifest reader accepts any nonblank build ID; changing UUID generation to a SHA-256 string preserves its existing shape and requires no persisted user-state migration. (cli-invocation.mjs:46, 50d2373621c0)

Likely related people:

  • Peter Steinberger: Raw commit 44c7171 adds scripts/lib/bun-standalone-support.mjs:173 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 44c71714097f; files: scripts/lib/bun-standalone-support.mjs)

PR surface

Tests +161, Docs +8, Other +34. Total +203 across 8 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 171 10 +161
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 5 57 23 +34
Total 8 236 33 +203

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Nondeterministic standalone artifacts affect packaging reproducibility and provenance without establishing an urgent runtime failure.
  • 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.

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-25T03:30:04.522Z sha ee1d24e :: needs changes before merge. :: [P2] Correct the reproducible-preparation instructions

Reviewed October 25, 2026, 12:04 AM ET / 04:04 UTC (Revision 2).

@steipete

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

Fixed the local freshness-stamp finding in 50d2373621c06a12b7c8c8476ac0f126f9e9137f. The resource owner omits only .buildstamp and .runtime-postbuildstamp; build-info.json retains portable commit provenance. The extended existing compilation regression failed on the previous head with equal module hashes but differing IDs, then passed after the repair. All 57 selected support/sidecar/WASM/snapshot tests, scoped lint, affected types and formatting pass; independent review of the follow-up is clean. The PR body is current and the fixed inline thread is resolved.

Inspectable native reduction results: the qualified compiler's SHA256 is d9e1bbfd8e298c8d51bd1c5fe7a106827119355bff2b88528aa69cf823202c95. Two actual-owner JS/WASM candidate executables in independent roots both hash to b07fca64b1e492ce0f4a7fd44b2bb765486839adc2f340f54d48cc500090da33; the preceding baseline owner produced unequal outputs. A separate 129-entry native module-order/root control produced d6abf213b871f1a7f599b2c5b9600819fb18d06748f390ae7a0d14e9b5363829 twice. These are synthetic native compiler/owner proofs, not independent full application preparation or full OpenClaw reproducibility.

Fresh exact-head CI is https://github.com/openclaw/openclaw/actions/runs/40159985885; it is still in progress at this update. Full latest-main application comparison remains a separate qualification step pending the producer lane.

@clawsweeper

clawsweeper Bot commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 25, 2026
@steipete
steipete merged commit cacc271 into main Oct 25, 2026
113 of 115 checks passed
@steipete
steipete deleted the fix/standalone-reproducible-builds branch October 25, 2026 04:06
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
* fix: keep standalone build identities reproducible

* test: satisfy standalone regression type and lint checks

* fix: omit local freshness stamps from standalone resources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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: M status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant