Repository navigation
Conversation
…ute URLs policyengine.org proxies /us/snap-payment-error-simulator to this app and redirects /paper/ to /paper, so the wrappers load from a URL with no trailing slash. Their relative URLs then resolved one level too high: the iframe, the PDF and standalone links, the stylesheets, the logos and the home link all pointed outside the paper directory or outside the app, and 404ed (live check, 2026-11-27). Every same-site URL in /paper and /paper-migrations now starts with /us/snap-payment-error-simulator/, which vercel.json routes on both policyengine.org and the Vercel deployment. tests/test_wrapper_urls.py resolves each href and src on the front page and both wrappers from every address they are served at, maps the path through vercel.json, and requires a file under app/public. It fails on the previous wrappers. The two wrapper tests now parse the HTML, so a data-src or commented-out iframe no longer passes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
policyengine.org proxies
/us/snap-payment-error-simulatorto this app and 308-redirects/paper/to/paper. The wrappers therefore load from a URL with no trailing slash, and their relative URLs resolve one level too high. On policyengine.org (live check, 2026-11-27):web/index.html?v=r11-20261024resolves to/us/snap-payment-error-simulator/web/index.html: 404;../tokens.css,../app.cssand both logos resolve to/us/...: 404;/us/snap-payment-error-simulator/web/index.pdf: 404;../) resolves to/us/, which redirects to policyengine.org's own/ushome page rather than the simulator./paper-migrationshas the same pattern. Its companion-paper link (../paper/) also lands outside the app, at/us/paper/.Changes
Both wrappers. Every same-site URL now starts with
/us/snap-payment-error-simulator/: the favicon, stylesheets, logos, iframe, standalone and PDF links, the home link and the companion-paper link. The existingvercel.jsonrewrites route these paths on policyengine.org and on the Vercel deployment, sovercel.jsonis unchanged. Every target path returns 200 on both hosts today (see Evidence).tests/test_wrapper_urls.py(new). It parses the front page and both wrappers, honoring<base>. It resolves eachhrefandsrcthe way a browser does, from every address the page is served at:It maps the resulting path through
vercel.json: a static file first, then the first matching rewrite, on segment boundaries. It requires a file underapp/public. It also checks that each wrapper's iframe serves that wrapper's ownweb/index.htmlwith a cache key, and that wrapper URLs carry the base path.tests/test_paper_embed.pyandtests/test_migrations_wrapper.py. Both parse the HTML instead of matching a regex. Adata-srciframe or a commented-out iframe now fails. The migrations test derives the expected URL fromREVISIONand the qmd date, so Migrations paper revision 4: cite Wu and Meyer, describe the pooled test accurately #104 only needs to changeREVISION.Evidence
/us/tokens.css404,/us/snap-payment-error-simulator/web/index.html404, andsnap-qc-sim.vercel.app/web/index.html404. The new targets return 200 on both hosts.srcchanged todata-srcon the iframe;tokens.cssback to../;web/;web/.pytest tests/test_wrapper_urls.py tests/test_paper_embed.py tests/test_migrations_wrapper.py tests/test_retired_claims.py: 47 passed.ruff checkpassed at CI scope.Not fixed here
site_libs/...(/paper) andindex_files/libs/...(/paper-migrations). Neither directory has ever been committed underweb/. Every committed render of either manuscript references them: 14 of/papersince 2026-08-10, and 3 of/paper-migrations./paper-migrationswrapper's copy describes the main paper. That covers its meta description,og:description,og:url(pointing to/paper/) and the header paragraph. It is a content fix for a separate PR.Deploy
Merging deploys nothing: the site deploys by hand from
app/public(d3189 is Max's deploy decision). This PR should merge before that deploy, and #104 and #105 merge main afterwards.🤖 Generated with Claude Code