Title: lab-ops-hub: container validator appends the empty-query marker after the fragment — path?#frag returns as path#frag?, differing from the Worker · Issue #654 · developing-today/code · GitHub
Open Graph Title: lab-ops-hub: container validator appends the empty-query marker after the fragment — path?#frag returns as path#frag?, differing from the Worker · Issue #654 · developing-today/code
X Title: lab-ops-hub: container validator appends the empty-query marker after the fragment — path?#frag returns as path#frag?, differing from the Worker · Issue #654 · developing-today/code
Description: Finding PR #648 (#648, commit 7bd77d0937, merged as 93065f0d) added _empty_query_fragment_markers to preserve the empty ? / # markers WHATWG keeps (#639), but it re-attaches the markers as a suffix after geturl() at every rebuild site. W...
Open Graph Description: Finding PR #648 (#648, commit 7bd77d0937, merged as 93065f0d) added _empty_query_fragment_markers to preserve the empty ? / # markers WHATWG keeps (#639), but it re-attaches the markers as a suffix...
X Description: Finding PR #648 (#648, commit 7bd77d0937, merged as 93065f0d) added _empty_query_fragment_markers to preserve the empty ? / # markers WHATWG keeps (#639), but it re-attaches the markers as a suffix...
Opengraph URL: https://github.com/developing-today/code/issues/654
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"lab-ops-hub: container validator appends the empty-query marker after the fragment — path?#frag returns as path#frag?, differing from the Worker","articleBody":"## Finding\n\nPR #648 (https://github.com/developing-today/code/pull/648, commit `7bd77d0937`, merged as `93065f0d`) added `_empty_query_fragment_markers` to preserve the empty `?` / `#` markers WHATWG keeps (#639), but it re-attaches the markers as a **suffix after `geturl()`** at every rebuild site. When the query is empty and the fragment is non-empty, the `?` therefore lands *after* the fragment instead of before the `#`:\n\n| Input | Container returns (current `main`) | Worker / WHATWG `URL` returns |\n|---|---|---|\n| `http://example.com/path?#frag` | `http://example.com/path#frag?` | `http://example.com/path?#frag` |\n| `http://example.com?#frag` | `http://example.com/#frag?` | `http://example.com/?#frag` |\n| `http://example.com/a?#b?c` | `http://example.com/a#b?c?` | `http://example.com/a?#b?c` |\n| `http://%65xample.com/path?#frag` | `http://example.com/path#frag?` | `http://example.com/path?#frag` |\n| `http://8%2e8%2e8%2e8/path?#frag` | `http://8.8.8.8/path#frag?` | `http://8.8.8.8/path?#frag` |\n\nVerified on current `main` by running `validate_crawl_url` from `pkgs/lab-ops-hub/container/app.py` (extracted fresh via `gh api ...?ref=main`) against the table above, cross-checked against Node's WHATWG `URL` serializer (the Worker's reference). The percent-decoded-host and canonical-IP rebuilds are affected too, because all three rebuild sites share the suffix pattern.\n\n## Evidence\n\n- `pkgs/lab-ops-hub/container/app.py:784-798` — `_empty_query_fragment_markers()` returns the markers as an unordered suffix string (`\"?\"` computed from the pre-`#` spelling, `\"#\"` if the fragment is empty).\n- `pkgs/lab-ops-hub/container/app.py:860` — `_normalize_validated_url`: `...geturl() + _empty_query_fragment_markers(url)`.\n- `pkgs/lab-ops-hub/container/app.py:937` — `_url_with_encoded_components`: same `geturl() + markers` suffix.\n- `pkgs/lab-ops-hub/container/app.py:737-741` — `_url_with_host`: same suffix on all three return arms.\n- `geturl()` rebuilds a non-empty fragment as `#frag` at the end of the string, so a suffixed `?` is parsed back as fragment data, not as the query marker.\n- PR #648's test battery covered `path?#` (both markers empty — suffix order happens to be correct), `path?x#` (non-empty query), and `#frag?notquery` (`?` as fragment data), but not the empty-query + non-empty-fragment combination. Its 43,200-spelling differential evidently did not include that tail either.\n- PR #653 (open, fixes #651) stacks on this code and does not touch the marker logic, so it carries the same defect.\n\n## Why it matters\n\nThis is exactly the class of divergence #639 set out to eliminate: the two crawlers record different URLs for the same accepted target. Worse than a dropped marker, the returned URL is a *different* URL — the fragment is corrupted (`frag?` instead of `frag`) and the present-but-empty query becomes absent — so anything keying on the recorded URL (dedup, redirect handling, downstream fetch of the recorded form) sees a different target than the one that was judged and that the Worker records.\n\n## Acceptance criteria\n\n- `validate_crawl_url` returns the WHATWG form for empty-query + non-empty-fragment spellings, e.g. `http://example.com/path?#frag` → `http://example.com/path?#frag`, including through the percent-decoded-host and canonical-IP rebuild paths.\n- The empty-fragment marker case stays correct (`path?#`, `path#`, `path?x#` unchanged) and a `?` inside the fragment stays data (`#frag?notquery` unchanged).\n- New regression tests pin the `?#\u003cnon-empty fragment>` combination in the Python suite (and the TS suite if the Worker pin is extended); the differential probe set includes empty-query × non-empty-fragment tails.\n- Existing Python / TS validator suites still pass; no verdict (accept/refuse) changes.\n","author":{"url":"https://github.com/dezren39","@type":"Person","name":"dezren39"},"datePublished":"2026-10-23T06:21:07Z","url":"https://github.com/developing-today/code/issues/654"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:83b28a41-9afa-eaa2-20f2-fb7163a61fd3 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A694:17B76C:A9F360:DC43B7:6B0638CB |
| html-safe-nonce | 801791b9476462d922d9d03e931606ca7fd087643815ff6ae086e70b7fa209d6 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBNjk0OjE3Qjc2QzpBOUYzNjA6REM0M0I3OjZCMDYzOENCIiwidmlzaXRvcl9pZCI6IjgxNzEyODg0NDYyMzM4ODQ4NzUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2e2b926a2e52e826df99a152e6414bfc7661eb6cb25d73a0e5efad91e47b6d61 |
| hovercard-subject-tag | issue:5992998646 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/developing-today/code/654/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c99500d791fd71d4da78185a093bf4403f41e85f86a6aff1fc8ecd2240f4ac85/developing-today/code/issues/654 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c99500d791fd71d4da78185a093bf4403f41e85f86a6aff1fc8ecd2240f4ac85/developing-today/code/issues/654 |
| og:image:alt | Finding PR #648 (#648, commit 7bd77d0937, merged as 93065f0d) added _empty_query_fragment_markers to preserve the empty ? / # markers WHATWG keeps (#639), but it re-attaches the markers as a suffix... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dezren39 |
| hostname | github.com |
| expected-hostname | github.com |
| None | dcf72c457c022486d23c3cbb0dd21aba537a87611ca9ddabd1799cf2eaa9b297 |
| turbo-cache-control | no-preview |
| go-import | github.com/developing-today/code git https://github.com/developing-today/code.git |
| octolytics-dimension-user_id | 26439447 |
| octolytics-dimension-user_login | developing-today |
| octolytics-dimension-repository_id | 627308783 |
| octolytics-dimension-repository_nwo | developing-today/code |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 627308783 |
| octolytics-dimension-repository_network_root_nwo | developing-today/code |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 0f38f5735226749ec5e08a8649dce4cb2613d9ad |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width