Repository navigation
fix(browser): isolate script URLs with empty query or fragment - #2074
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
3 tasks done
2 of 3 tasks
Owner
|
@1052326311, thanks for catching that |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Keep script URLs ending in an empty
?or#in isolated export layouts.URL.searchandURL.hashreturn""for both absent and explicitly empty components, so these variants currently receive a canonicalurl-pathlayout even though the exporter explicitly excludes query/fragment identities from that layout.Problem and expected behavior
A capture containing only
https://fixture.test/query.js?currently exports it underorigins/<origin-hash>/query.js. This can make the captured variant appear to be the canonical local target for./query.js. Empty components remain part of serialized URL identity and should follow the same isolation policy as nonempty query/fragment variants. Found in the export planner; no separate issue exists.Change and scope
Detect component delimiters in the parsed URL's serialized
href, which preserves empty components. Keep the original reported URL, source bytes, origin handling, and collision policy. Add empty?,#, and?#cases to the existing planner matrix and verify persisted export output through the real filesystem publication service.Contract and boundary impact
candidatePathinwebScriptExportPlan.layout: isolated; schemas unchanged.Evidence and regression coverage
The filesystem regression reads a saved capture, publishes scripts, reads back bytes and manifest, and verifies an ordinary URL remains
url-pathwhile separate empty-query and empty-fragment URLs areisolated. The regression fails against the original owner (url-pathreceived instead ofisolated). Existing source/capture/provenance tests continue to pass.Validation performed
Node 24.18.0 / npm 11.16.0, macOS arm64:
npm run test:focused -- src/domain/webScriptExportPlan.test.ts tests/boundary/filesystem/webScriptExport.test.ts— 45 passed.npm run check— passed.npm run docs:check— passed after integrating upstream's translation-link correction.git diff --check— passed.Compatibility, safety, and release
No schema, package, migration, or authority changes. Export paths for the affected URL variants intentionally change to the existing isolated layout. No live browser, separate CLI/MCP transport, or full suite run; this change consumes already-retained captures and is verified at the filesystem export boundary.
Review checklist
AI-assisted with Codex.