A Replay URL Needs More Than the Original Path
Why host, port, query, and fragment handling matter when resources move to loopback.
Scope: Engineering or methodology note based on a September 17, 2026 snapshot. Source-level behavior is not a public availability or universal compatibility claim. Any scenarios are illustrative, not customer outcomes.
Moving captured resources onto a local replay origin is not a matter of replacing every URL with its path. Different hosts can serve the same path, non-default ports can matter, and query or fragment information can affect the application.
Kalu’s replay projection uses an explicit public-resource mapping. It preserves the relevant URL components within its supported policy rather than relying on a broad string replacement.
Preserve the identity that distinguishes resources
Imagine a synthetic page loading /asset.js from two different origins. A path-only mapping would make them collide. A non-default port adds another distinction that cannot be discarded merely because the hostname matches.
The current mapping encodes the external host in the replay path and includes a non-default port when necessary. Path, query, and fragment are preserved under the supported transformation. Inputs that are malformed, credentialed, or otherwise outside the mapping rules do not gain a guessed replacement.
A formatted URL is not a listening server
The source also distinguishes a pure URL formatter from the actual bound replay handle. When the operating system chooses an ephemeral port, a formatter using the requested port value does not know the final listening address.
The browser and fetch operations need the bound handle’s URL. This small distinction prevents a convenient helper from becoming false evidence that the server is listening where the application will navigate.
Projection remains a closed policy
Portable replay rewriting supports declared HTML, XHTML, and CSS carriers. Unsupported carriers, ambiguous filesystem mappings, and query collisions remain refusal cases. The engine should not expand its rewrite authority simply because another URL-shaped string appears in a file.
This article describes bounded source-level projection behavior, not a claim that every web URL carrier or application framework is supported. A valid mapping also does not prove that every required resource was captured.
For recovery, URL identity is part of the dependency graph the application actually experiences. A local replay can be convenient and still preserve that identity carefully. The alternative is a page that appears to work because distinct resources were accidentally collapsed into one.