ReviewOS

stacks/bunpress

fix(search): make index record order deterministic across filesystems

#85
Closed chrisbbreuer opened this 26 days ago · 0 comments
26 days ago

Parent consumer issue: zig-utils/zig-js#631

BunPress 0.2.6 builds every page deterministically, but buildSearchIndex appends records directly in Bun.Glob.scan() enumeration order. That order differs between macOS and Linux filesystems.

Observed in zig-js CI: the complete output manifest matched except for search-index.json; both files were exactly 254,740 bytes, while macOS produced SHA-256 0aee1a5d9372b0661aa78ed1bdfaaf4f0de6871d418f780de8e619ac91ec9dbc and Linux produced 2e6f9162eb9d1f50da4a4b2574ad22a53e79d1d8d6b5475a7a728a002ffd204c.

Acceptance:

  • collect the complete unique included path inventory before reading documents;
  • sort normalized relative paths with a locale-independent ordering;
  • preserve section order within each document and configured locale fallback behavior;
  • add a regression test for stable page ordering;
  • reproduce the same manifest hash from clean macOS and Linux builds.

Sign in to comment on this issue.