Skip to content

fix: make standalone path metadata reproducible - #183570

Merged
steipete merged 1 commit into
mainfrom
fix/standalone-graph-relocation
Oct 25, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/standalone-graph-relocation

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Independent standalone builds can retain different temporary directory names and serialize native routing metadata in a different order. This changes the module graph and executable even when source, compiler, and packaged resources are identical.

User Impact

Standalone builds resolve free CommonJS __dirname and __filename references below the relocated runtime. Local bindings and property names keep their existing behavior. Native package lookup keeps longest-prefix precedence while producing stable metadata bytes.

Why This Change Was Made

Two independent full graph captures narrowed the remaining differences to IMAP's bundled logging code and the native routing table. The logging code's free __dirname was filled by Bun with the staging directory. Equal-length package owners and file mappings retained asynchronous discovery order.

The fix uses the existing module relocation and lexical-binding owners, adds a tie-break to owner ordering, and sorts only serialized file mappings. The returned resource inventory keeps its existing order. It does not enable or publish an AOT artifact.

Evidence

  • CommonJS relocation regression fails on the base and passes with the fix, including local binding and property/method-name controls.
  • The actual Bun split-bundle fixture fails on the base with a build-directory path; after the fix, two independent directories produce identical module bytes and execute with relocated paths.
  • Reversed native graph discovery produces identical routing bytes and retains both resource sets.
  • Focused Node tests, the separate Bun fixture, targeted lint, tooling test typecheck, and independent review are recorded in the maintainer review evidence.

Full application executable reproducibility remains a separate qualification run; these focused regressions do not claim it.

@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.

@steipete
steipete marked this pull request as ready for review October 25, 2026 11:51
@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-25T11:53:31.458302Z 0b2b4eb 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: S labels Oct 25, 2026
@steipete
steipete enabled auto-merge (squash) October 25, 2026 11:56
@steipete
steipete merged commit 3e579ec into main Oct 25, 2026
172 of 174 checks passed
@steipete
steipete deleted the fix/standalone-graph-relocation branch October 25, 2026 12:00
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

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 scripts Repository scripts size: S

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant