ReviewOS

home-lang/home

Bun parity: align console.log inspection formatting

#328
Closed chris opened this 10 days ago ·
10 days ago

Scope

Advance the contiguous Bun corpus boundary at js/web/console/console-log.test.ts (position 4092) by aligning Home's console value formatting with Bun.

Current failures

The file currently reports six failures. The captured console output differs in several observable areas, including:

  • primitive boxed strings ([String: "..."])
  • pending promises (Promise { <pending> })
  • Set versus Map iterator identity and iterator contents
  • empty and populated iterator rendering
  • related recursive/depth-limited inspection output

Acceptance criteria

  • js/web/console/console-log.test.ts passes without exclusions or fixture weakening.
  • Behavior is implemented in the shared console/inspect path, not as file-specific output substitution.
  • Focused permanent regressions cover the corrected value categories.
  • Failures from the console capture/compare path retain the originating test/source stack and useful structured context.
10 days ago

Implemented and pushed in 08b372f8b (fix(runtime): align JavaScriptCore type ABI).

Root cause: Home's Zig JSType table did not match the exact JavaScriptCore headers linked from the cached WebKit build. Raw cell tags were therefore silently reclassified (for example, Promise as Map and MapIterator as SetIterator). The fix:

  • aligns every affected JSType value with the linked JSC ABI, including streaming/sentinel and async-generator tags;
  • adds compile-time C++ static_assert ABI anchors so WebKit drift fails the build instead of corrupting inspection behavior;
  • restores Bun-identical formatting for symbols, boxed strings, pending promises, Map/Set iterators, long-array cutoffs, console groups, ArrayBuffer, and SharedArrayBuffer;
  • preserves source-bearing assertion diagnostics across absolute/relative corpus paths;
  • keeps dedicated URL/URLSearchParams inspection ahead of generic custom-inspect dispatch and fixes URL.canParse optional-base/non-special-scheme semantics exposed by the permanent regression queue.

Verification:

  • clean-cache zig build: pass;
  • exact Home CLI console reproduction matches reference Bun;
  • js/web/console/console-log.test.ts (4092): 4 passed, 0 failed, 0 unsupported;
  • js/web/console/console-recursive.test.ts (4093): 2 passed, 0 failed, 0 unsupported;
  • permanent HTTP/web tail queue: pass, including the existing 13-test URL matrix;
  • structured worker, BroadcastChannel, gRPC, SQL, JWT/utility regressions: pass.

The contiguous verified boundary is now through position 4093.

Sign in to comment on this issue.