Repository navigation
Conversation
www.policyengine.org/macro will proxy to this project. Through that proxy a root path such as /models resolves on policyengine.org, where it is the website's namespace and a 404, so every link, image, stylesheet, object, font and fetch has to name /macro/models instead. - site_paths.py: BASE_PATH, mount() (href, src, <object data>, CSS url(), fetch) and a check/--write CLI over served files. - site_nav.render and every generator mount their output, so each --check gate compares mounted pages; site_contract.py and the tests compare mounted strings. - vercel.json: rewrites serve the tree under /macro; each redirect and each path-scoped header rule gets a /macro twin, since Vercel matches both on the requested path before the rewrite. - tests/conftest.py models the rewrite; tests/test_site_paths.py pins mount() and the vercel.json twins. - CI: site-provenance.yml and data/refresh.py run python3 site_paths.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The output of `python3 site_paths.py --write` and `python3 site_nav.py --write`, nothing else: 2,910 root paths in 76 files (71 pages, style.css, connect.css and the vendored font and MathJax stylesheets). After a rebase, rerun those two commands instead of resolving these hunks by hand. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
policyengine.org serves only pages that carry PolicyEngine's own header, and an app zone renders it itself: the website's app-zone-shell-audit fails a zone whose top 140 px lack the PolicyEngine wordmark or any of Research, Model, API and Donate. site_nav.pe_shell() puts that bar above the Macro header on every page, with absolute www.policyengine.org links. On phones under 420 px the Python link drops so the four required labels fit. style.css v52. CONTRIBUTING.md documents the base path, the vercel.json twins and the bar; CHANGELOG.md records the change and the URLs that move once the route is live. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…ew pages Review round 1 on #295 found three gaps in site_paths.py: - A CSS prefix selector such as `.chip[href^="/connect"]` stayed as written while the links it tests became /macro/connect, so 12 chips on the pe, olg and pe-microsim pages lost their icons. mount() now treats `^=` like `=`; `$=` and `*=` still match as written. models/model-pages.css v25. - `"/" + slug` became `"/macro" + slug`, which yields /macromodels. A quoted root followed by `+` now becomes `"/macro/"`. - served_files() read only git's index, so the gate never saw a page a generator had just created. It now lists untracked files that are not ignored as well. Also: forecasts/make_us_baseline.py mounts its block like every other page writer; a test pins each vercel.json header twin directly after its original, since Vercel's cascade depends on that order; CONTRIBUTING and CHANGELOG say which shapes the gate can see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review round 1 on #295, continued: - The bar clipped "Donate" at 360 px and at 421-439 px: its links scrolled sideways behind a hidden scrollbar, and Python dropped only below 420 px while five links need about 440 px. The links now wrap, so nothing is ever clipped (at 320 px Donate moves to a second row), Python drops below 460 px, and spacing tightens below 400 px. Measured in a browser with Inter at 320 to 1440 px: the four required labels sit in the top 44 px from 360 px up and in the top 60 px at 320 px. - site_nav.HEADER's bar group could run past the bar's own </nav> to a later one, deleting a banner placed between the bar and the Macro header, or stamp a second bar. The group now stops at the bar's own </nav>, and render() refuses a page that would end up with two bars. - tests/test_site_shell.py holds every page to the website audit's rule: one bar directly above the Macro header, the PolicyEngine wordmark, and Research, Model, API and Donate, none hidden on phones. Nothing in this repository checked the bar before. - tools/prerender_math.py hashed the MathJax stylesheet before mounting its font paths, so the ?v= on six pages no longer matched the served file; it now hashes the mounted file. connect.css v21. - Docs: the site_paths.py docstring counts (3,146 paths at 1592fab), and CONTRIBUTING no longer claims BASE_PATH is the one place the prefix lives: the pages and the vercel.json twins carry it too. The site_nav comment and CHANGELOG note that the footer does not yet carry PolicyEngine's footer links, the other half of the website's shell rule, which its audit does not check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An independent review of 54ff184 found these gaps: - An unquoted `url( /macro )` mounted twice, because `_already_mounted` didn't treat whitespace as the end of a path. Whitespace now ends one. - `test_every_redirect_has_a_twin_under_the_base_path` passed a leftover `/macro/...` redirect whose original had gone. New tests fail on such a redirect, and on a `/macro` header rule that doesn't follow its original. - The CHANGELOG said `tests/test_site_shell.py` holds pages to the audit's rule. It checks the bar's markup, not the drawn layout the audit measures. The site_paths docstring now lists `data-href` among the shapes the check can't see. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Acts on the second independent review of ac14d3c. - Footer. policyengine.org's shell rule asks every page it serves for PolicyEngine's footer links as well as its header. The footer gains one muted row with the links policyengine.org's own footer carries: About us, Donate, Developer tools, Privacy policy, and Terms and conditions (site_nav.PE_FOOTER_LINKS, style.css v53, all 71 pages restamped). tests/test_site_shell.py checks the row on every page, and its docstring now says it checks markup, not layout. - Whitespace. ac14d3c let whitespace end any path, so a quoted `href="/macro archive"` counted as mounted and passed the gate. Only an unquoted CSS url() ends its path at whitespace now. - Website-held paths. policyengine.org runs its own /:countryId/... redirects and icon rewrites before it proxies /macro, so /macro/blog, /macro/methodology and five other first segments, and /macro/<dir>/favicon.svg and its kin, never reach this project. A new test fails on a page, file or redirect there; none sits there today. CONTRIBUTING and CHANGELOG say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Acts on an in-session adversarial check of ac5f929. - site_paths. ac5f929 stopped whitespace from ending a quoted path, but a browser drops tabs and newlines from a URL and trims its ends, so `href="/macro "` and `href="/macro\n/models"` were double-mounted, while `href="/macro)x"` still counted as mounted. mount() now reads a quoted value to its closing quote, as the URL parser does, and an unquoted url() to whitespace or `)`. A quoted value may also start with spaces before its slash. No served file changes. - Footer row. 11px fell below DESIGN.md's 12px floor, and white at .7 gave 3.3:1 against the light gradient's lighter end. It is now 12px at .94 (4.6:1). The test now requires exactly policyengine.org's five footer links, in order, on the bar's country, and ignores a row hidden in a comment. - CHANGELOG lists every kind of link still naming the Vercel host. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An in-session check of 9fb5155 compared site_paths with Node's WHATWG URL parser and found three gaps, none on the site today: - "/\t/cdn.example.org" and "/\cdn.example.org" are protocol-relative once the parser drops the tab and reads the backslash as a slash. They were mounted, which would have broken an external link. - In "/\t" + slug the browser trims the joined string, not the literal, so the tab sits inside the path. The literal now keeps its trailing whitespace and mounts to "/macro/\t" + slug, not "/macro\t" + slug. - The leading trim now covers every control character but NUL, which HTML and CSS read as U+FFFD. Attribute names and CSS url() now match in any case, as HTML and CSS read them, and a backslash after /macro counts as mounted. The docstring and CONTRIBUTING name what the gate still can't see: an @import without url(), dot segments and "/macro" + slug. The footer test now fails on any extra anchor in the row, and STYLE_VERSION moves to 54 so a preview cached at v53 can't show the old row styling. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Round 3 of the independent review found that the last two commits let
paths through that the gate used to catch: CSS and JavaScript escapes
(url("/\61.svg"), fetch("/\x64ata/...")), because 010f064 read a
backslash in the source as a URL slash before the language decoded it,
and an unquoted url() with U+00A0, because 9fb5155 let any Unicode
space end it.
Those commits imitated how browsers decode a path. Every root path on
the site is spelled in ASCII letters, digits and -._/, so site_paths now
reads only those (and ~). It flags any other spelling, a dot segment or
"/macro" + slug, and mount() and --write leave it for a person to
respell. No page changes.
The footer test compares the row's markup with the exact five links, so
an extra link fails however it is written; an upper-case <A HREF> passed
before. The reserved-path test matches the website's rules as written
(methodology/appendix is free) and looks at rewrites that already carry
the base path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The table of pull-request workflows named site_nav.py and site_contract.py but not the gate this branch adds between them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The last matcher stopped reading at any quote or at ${, to allow for a
script string around the path, and looked no further. So
href="/macro/a'/../../models" passed, and a browser reads the rest and
resolves it to /models.
All 3,221 root paths on the site, and every one in the open pull
requests' trees, run to their own closing quote or parenthesis. The gate
now reads to it and flags a path that a script string or a template
breaks off ('<a href="/' + slug + '">'). mount() and --write leave such
a path for a person to respell. No page changes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
mount() leaves a path that is not spelled plainly for the gate to flag. url() returned such a path unmounted, with nothing to flag it, so it now raises. Every caller passes a plain path. The docstring says that the plain spelling covers a path up to its ? or #. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fourth independent review, of 087f999, found four P1s, a P2 and a P3 in the path gate and its tests. None occurs in the site, and no page changes: mount() writes every file here, on main and in every open PR as it did before. - A root that a script may extend: list what may follow its closing quote, instead of what extends it. A plain /* */ comment no longer counts as an extension; U+FEFF, "[", "?.", "<!--" and "${" now do. - mount() edits nothing inside the value of another shape it reads, so it never edits a value it refuses. The check still reads every path, nested or not. - A value that holds a backslash or "${" anywhere fails, since either may hide the quote that closes it, and mount() edits nothing after it. - url() refuses a path that holds a double quote or another root path. - The footer test reads the footer's own markup strictly, from its start tag to the row, so a commented-out nav fails. It says what it does not read. - The reserved-path test compares a file at its own name too. - CONTRIBUTING: ten generator checks, not nine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Agent-written for Max, by Claude Code for Max Ghenis. Max hasn't read it. @vahid-ahmadi, this PR is ready for your review at Round 4's findings. An independent review of
Your five questions are in the description under What I need from Vahid. Please start with the first, path or subdomain. Each of the last three review rounds found something new in the path check, and a subdomain would not need that check. It would need a DNS record and a Vercel domain, which only you or Max can add. The website's side, PolicyEngine/policyengine-app-v2#1616, waits for this PR to merge and deploy, and for #296 (GA4). |
PolicyEngine Macro has no policyengine.org address yet, so every link to it names the project's Vercel host. This PR lets www.policyengine.org serve the site at
/macro, the way it serves other tools as app zones. The companion website PR adds the route: PolicyEngine/policyengine-app-v2#1616.What changes
site_paths.py(new) moves every root path in served files under/macro. It handleshref,src,data,actionandposterattributes in any case, CSS selectors on them ([href="/pe"],[href^="/connect"]), CSSurl()andfetch().//hostlinks, fragments and relative paths alone. It turns"/" + sluginto"/macro/" + slug.-._/up to their?or#, if any, which HTML, CSS, JavaScript and the URL parser all read the same way. The check fails on a path whose part before?or#holds anything but those characters and~, or a.or..segment; on a value that holds a backslash or${anywhere; and on a"/macro"that a script may extend, which is any one not followed by a character on a short list. It reads a path to its own closing quote or parenthesis, so it also fails on one that a script string or a template breaks off ('<a href="/' + slug + '">').mount()and--writeleave such a path for a person to respell, edit nothing inside the value of another path they read, and edit nothing after a path whose end they can't tell. Sohref="/macro archive",href="/macro ",url("/\61.svg")andhref="/\host"all fail.srcset, awindow.location = "/...", a CSS@importwithouturl(), adata-hrefthat a script turns into a link, a leading slash that is itself escaped or encoded, and a string a script assembles. A path inside some other string (data-href="/x?u=url(/a)") is rewritten as if it stood alone. The docstring lists them, and it and CONTRIBUTING say to write those with the prefix.data/refresh.pylists it.--writefixes files in place, andmount()is idempotent.site_paths.mount()on what they splice into a page, so each--checkgate compares mounted output with mounted pages.site_nav.render()mounts every page it stamps.vercel.jsonadds two rewrites (/macroto/,/macro/:path*to/:path*). It also gives each of the 81 redirects and each of the 10 path-scoped header rules (CORS on/data/*, the cache rules) a/macrotwin./macro/paperswould miss the root/papersrule.tests/test_site_paths.pyfails if a rule loses its twin, if a twin outlives its original, or if a header twin leaves the place right after its original, which Vercel's header cascade depends on.app-zone-shell-auditfails any zone whose top 140 px lack the wordmark and the Research, Model, API and Donate labels. The links wrap rather than scroll, so none is ever clipped. Python drops below 460 px.tests/test_site_shell.pychecks every page's markup: one bar, directly above the header, with the wordmark and the four labels, none hidden on phones; and the footer row, whose markup must equal policyengine.org's five links in its order on the bar's country. The test compares the row's markup as a whole, so any other link in it fails, however it is written. From the footer's start tag to the row, only plain text, links,divs,spans, images and simple SVG icons may stand, and they must nest, so nothing there can hide the row or end the nav before it. The test doesn't parse the page: above the footer it looks only for a comment or an element of six kinds that was opened and not closed. It doesn't check layout. A CSS change that hides the bar or pushes it below 140 px would pass it, and only the website's audit, which measures the drawn page, would catch that.style.cssmoves to v54./macro, and those written/:countryId/...match/macro/...as well:/macro/blog308s to/macro/research.blog,blog/<slug>,claude-plugin,methodologyandpolicybench;cliff-watch,state-legislative-trackerandmodel, each with everything below it; and/macro/<dir>/<icon>for eight icon names such asfavicon.svg. So/macro/methodologyis taken and/macro/methodology/appendixis free.tests/test_site_paths.pykeeps it so and lists the rules. It compares a file both at its own name and with a leadingmacro/taken off, since such a file would answer at both. It compares a rule of this project's whose source is itself a pattern as written, so a person has to compare those. Today's only pattern is the/macro/:path*rewrite, which serves the site./data/*API, the MCP server anddata/fetch.pykeep working unchanged.Commits
1592fab4adds the tooling, wires the generators, and adds the tests, thevercel.jsonrules and the CI step.784eba03holds only generated output: 3,146 paths on 2,910 lines in 76 files. Runningpython3 site_paths.py --writeandpython3 site_nav.py --writeon commit 1 reproduces it exactly (checked: zero-line diff).a1f81a95adds the PolicyEngine bar and documents the base path in CONTRIBUTING and CHANGELOG.d206710eand54ff184efix what an adversarial review of commits 1 to 3 found:models/model-pages.cssv25);"/" + slug, which became/macromodels;site_navregex that could delete a banner placed under the bar;connect.cssv21);ac14d3ceacts on the first independent review, of54ff184e. New tests catch a/macroredirect or header twin whose original has gone, and an unquotedurl( /macro )no longer mounts twice.ac5f9293acts on the second, ofac14d3ce. It adds the PolicyEngine footer row and restamps all 71 pages. It stops whitespace from ending a quoted path, sohref="/macro archive"no longer passes the gate. It adds the test for paths policyengine.org keeps.9fb51556acts on an in-session check of commit 6.site_pathsnow applies the URL parser's whitespace rules, sohref="/macro "isn't mounted twice andhref="/macro)x"is caught. The footer row moves to 12 px and AA contrast, and its test checks the exact links and their order. The CHANGELOG lists every kind of link that still names the Vercel host.010f0641acts on an in-session check of commit 7. (Commits 9 and 11 replace the path rules of commits 7 and 8.)site_pathsnow reads a//hostlink with a tab or backslash after its first slash as protocol-relative, keeps the trailing spaces of a literal a script extends, trims every leading control character but NUL, and reads attribute andurl()names in any case. The footer test also counts the row's<aanchors, andstyle.cssmoves to v54, so a preview cached at v53 can't show the old row.e160bab8acts on the third independent review, of010f0641. That review found that commits 7 and 8, by imitating how browsers decode a path, had let through escaped CSS and JavaScript URLs (url("/\61.svg"),fetch("/\x64ata/...")) and an unquotedurl()with a U+00A0.site_pathsnow fails on anything not spelled plainly. The footer test compares the whole row, because an upper-case<A HREF>had passed it. The reserved-path test matches the website's rules as written and reads rewrites that already carry/macro. No page changes.3b2b590anamessite_paths.pyin CONTRIBUTING's list of CI gates.fae88bf1closes a hole I found in commit 9 while rereading it. Its matcher stopped at any quote or${, sohref="/macro/a'/../../models"passed, and a browser resolves that to/models.site_pathsnow reads to the path's own closing quote. No page changes.087f9997makessite_paths.url()raise on a path it can't mount, which it used to return unmounted.eb03dce5answers round 4's findings on commits 9 to 12 (see Round 4's findings). No page changes.Commits 1 and 3 to 13 need reading; commit 2 needs only the rerun.
What I need from Vahid
The approach. This PR serves the site at
policyengine.org/macro. The alternative is a subdomain,macro.policyengine.org. It needs no link changes, but it needs a DNS record and a Vercel domain that only Max or you can add. Switching to it later means taking/macroout of every page and stylesheet, not only reverting commit 2: commit 3's bar names/macro/assets/policyengine-white.png, and commit 4 mounts CSS selectors instyle.cssandmodels/model-pages.css. Thevercel.jsonrewrites and twins go too. SettingBASE_PATH = ""alone only stopsmount().The double wordmark. The bar's PolicyEngine wordmark sits directly above the Macro header's own PolicyEngine mark. Should the site keep both, or should the header drop its mark?
The footer row. Your compact footer (16 Nov) carried Macro links only. Because the website's shell rule requires PolicyEngine's footer links on every page it serves, this PR adds them as one row under yours (
site_nav.PE_FOOTER_LINKS). On a wide screen it takes the footer from one 60 px line to 114 px. Keep it as it is, or restyle it?Which country the bar and footer link to. policyengine.org has no country-neutral
/research(it 404s). Both therefore link to/us/..., as the ai-beliefs zone does, though most Macro models are UK. Should they be/uk/...?Merge order with your open PRs. I tried each of them against this branch at
eb03dce5.vahid/r6-site) change pages that commit 2 also rewrites. They conflict on 2, 8, 10 and 22 pages respectively.CHANGELOG.md, integration files or a CI workflow, and none changes generated output. (Adapters: forward obr #90 labels, label the DEFINE parameter mismatch, deprecate recommend_model's horizon #289 editscapabilities.py, whicheconomy/topics.pyreads, buttopics.py --checkstill passes with it merged.) They conflict only inCHANGELOG.md.CHANGELOG.md.I suggest merging yours first. This branch then rebases. Take main's side of each conflicted page, merge
CHANGELOG.mdby hand, and rerunpython3 site_paths.py --write,python3 site_nav.py --write,python3 tools/model_hero.pyandpython3 tools/prerender_math.py.ac5f9293, before commits 7 to 13. I merged Model pages: correct figures and labels against the pinned model artifacts (SVAR, FRB/US, HANK, DEFINE-UK, compare) #286 and Refresh official data vintages #294 into main, rebased this branch onto the result taking main's side of every conflicted page, reran the four commands and committed. All 20 gates passed (pytest 3,918 passed, 95 skipped). The 33 pages your PRs change or add (9 of them new) came out mounted, with the bar and the footer row. Apart from the prefix, the shell and the version stamps, every page matched merged main exactly.CHANGELOG.mdmerge.Links that change once the route is live
The website's repository guidance moves these in a follow-up, after the website merges and deploys the route ("Order matters" in
docs/engineering/skills/repository-guidance.md). Before then, they would send readers to a 404.The tracked files name
policyengine-macro.vercel.app327 times on 326 lines in 90 files. One is the CHANGELOG entry that says these links haven't moved yet. The other 326:<link rel="canonical">(71) that names the Vercel host. So do theog:urlon 56 pages and theog:imageon 58, the 71 pages less the 13 release-note pages.og:urland 12og:image:economy/topics.py(SITE, the 11 topic pages, all three tags),models/compare/build.py(ORIGIN, canonical andog:imageon 1 page) andnotes/generate_release_notes.py(a literal on line 210, the canonicals of 12 digests).og:urland 46og:imagetags, written by hand.sitemap.xml(71) androbots.txt(1).economy/topics.pywrites the topic entries, andnotes/generate_release_notes.pywrites the release-note entries from a literal on line 367.papers/*pages andreports/define-uk-replicationeach show a citation and a BibTeXurlthat name the Vercel host, written by hand.papers/boe-svar(three),papers/obr-macroandpapers/pe-microsim, and four BibTeX entries inpapers/define-uk/references.bibandpapers/pe-microsim/references.bib. The built PDFs of boe-svar, obr-macro and pe-microsim print the host, so they need a rebuild.BASE = "https://policyengine-macro.vercel.app/data"on/economy, written bydata/build_page.py(SITE), and on the two rates topic pages, written byeconomy/topics.py(SITE). The data API keeps working on the Vercel host, so whether these move is a choice.README.md(14 on 13 lines). Line 9, its first link, names the host twice. So do the model links on lines 94 to 109 and the data links on lines 268 and 275.URL:lines indata/calendar.ics, whichdata/build_page.py'sSITEconstant writes, move.HOSTconstant writes. Leave those alone: calendar apps treat a changed UID as a new event, so every subscriber would see each event twice.SITEandHOSTindata/build_page.py,SITEineconomy/topics.py,ORIGINinmodels/compare/build.py, the two literals innotes/generate_release_notes.py), plusCITATION.cff(url),integration/pyproject.toml(Homepage) and the User-Agent indata/fetch.py.HOSTstays, for the UIDs.https://www.policyengine.org/macro. The guide's static-site form maps/(.*)to the same path on policyengine.org, which would send this host's old root links, such as/economy, to website 404s./to/macroand/(.*)to/macro/$1, behind a/macro/(.*)rule that keeps its path. This is the guide's "Hosts that serve paths unlike the website's" case./data/*alone. Outside clients call that API on the Vercel host by absolute URL, and a redirect without CORS headers breaks a browser's cross-origin call.base-uri 'self'(vercel.json). The website's direct-host audit won't read a page whose CSP setsbase-uri(unreadableHeadersin.github/scripts/audit-zone-direct-hosts.mjs), and it probes every zone's host whether or not the list names it. So once the host's 308 deploys, the audit would report/macro's canonical check as unreachable and never show that the route qualifies for the list. Settle that, by dropping the directive or by asking the website maintainers, before adding the redirect.Open, not in this PR
/macrogets Vercel's plain-textNOT_FOUNDonce the route is live, where policyengine.org shows an HTML page today. A root404.htmlwith the shell would fix it.og:imagetags nameassets/og-image.png, which shows the populace.dev card ("A nation is millions of households"), not Macro. This PR doesn't touch it, but every link to policyengine.org/macro shared on social media would show that card.Verification
eb03dce5, all in CI on Python 3.13: the 15 generator--checkgates,site_nav.py,site_contract.py,site_paths.py, the forecasts unittest suite andpytest tests(3,781 passed, 87 skipped). I haven't run them locally since010f0641, where all passed (pytest 3,513 passed, 86 skipped).ac5f9293. Since then the pages have changed only in theirstyle.css?v=stamp, andvercel.jsonnot at all. A local emulator of thisvercel.jsonsat behind a proxy that, like policyengine.org, serves only/macroand answers 404 elsewhere./macroreached all 71 pages (77 URLs, counting six search links on/macro/models) and 439 other files. It found no path outside/macroand no response other than 200./macro/..., and/macro/data/MANIFEST.jsoncarried CORS./macro.fetchand the paper PDFs loaded from/macro./macro/pechips show their code and layers icons again.vercel.jsonsemantics and the website route, and the diff and both PR texts. Four lenses ran, plus a skeptic for each finding. It found no P0. Commit 4 fixes every confirmed P1 and P2 but the footer, which commit 6 now adds.54ff184e. It found no code defect at P0 or P1. It asked for corrections to this text (the calendar count, what the shell test checks, what a subdomain switch undoes, the CSP'sbase-uri, a deep-path check before the website PR merges) and found small gaps in the tests. Commit 5 and this text fix them.ac14d3ce. It confirmed the round-1 fixes and reproduced the emulator crawl, the regeneration of commit 2 and the conflict counts. It raised three P1s: the missing footer links, a link inventory that left out theog:imagetags and the citations, and an overstated rebase claim. Its P2s were the whitespace rule, the paths policyengine.org keeps, and GA4. Commits 6 to 8 and this text answer all but GA4, which Decide on GA4 tracking before policyengine.org/macro goes live #296 tracks, and round 3 closed the three P1s./macro, and what the crawl counted. It missed the defects round 3 found.site_pathswith Node's URL parser on 181,000 likely and 757,000 random inputs. An earlier version of this text said it left only three classes of divergence. That was wrong: it also set aside 42,974 inputs in shapes outside the supported list, and dropped 64,074 rows with a NUL byte without checking what browsers do with them. Commit 9 removes the rules it tested.010f0641. It closed round 2's three P1s and raised three more: the two path defects and the false footer claim that commit 9 fixes. Its P2 was the reserved-path test, which commit 9 also fixes.ac14d3ce,ac5f9293,9fb51556,010f0641,e160bab8or087f9997flagged. A first draft of commit 13, never pushed, passed 2,583 that087f9997flagged, which is why it changed./macroor/, then up to three of 41 pieces of JavaScript, comment or markup. The check passes 224,560 of the 706,440/macrotexts, andmount()prefixes all 706,440/texts. Node ran those 931,000 as a script, as a handler in HTML and in SVG, as ajavascript:URL, and as code inside a string and inside a template. They gave a value in 539,288 runs. 599 of the values are not root paths before or aftermount(); every other one stays under/macro. With up to two pieces the same script finds 7,436 wrong values at087f9997and none here.//hostlinks, and the other 36,445 all stay under/macro. The rest don't resolve to a URL: 8,596 are tokens CSS drops, 13,240 are invalid URLs (such as//:), and 15,034 don't evaluate to a string as JavaScript.087f9997failed, and fails 3,766 that it passed.mount()doesn't fix, andmount()writes every file as it did at010f0641.site_nav.renderreproduces all 71 pages, from the committed text and from text with the prefixes taken out.//comment hide an extension where ajavascript:URL or an SVG attribute drops its newline, still edited a path after an escaped quote, and passed a page that the version at087f9997failed, because its footer test used Python's HTML parser. Commit 13 fixes each by refusing more. Nobody has checked commit 13 itself but me.087f9997: REQUEST_CHANGES. It closed all four round 3 findings and raised four new P1s, a P2 and a P3 in the same gate and tests, listed under Round 4's findings. By our review rules nobody opens a round 5.Round 4's findings
Commit 13 answers all six. No reviewer has read it, so the four P1s stay open until one says they are closed. Round 4 was the last independent round our rules allow, so that reviewer is Vahid. None of the six occurs in this tree.
fetch("/" /* comment */)becamefetch("/macro/" /* comment */), and a mountedfetch("/macro" /* comment */)was flagged. A literal U+FEFF before+hid the extension. Answer:_ALONEinsite_paths.pylists what may follow the closing quote of a root that stands alone, and everything else counts as an extension. A/* */comment of plain words is on the list; a//comment, U+FEFF,[,?.,<!--and${are not. Check:test_only_listed_characters_may_follow_a_base_path_that_stands_aloneandtest_only_a_comment_of_plain_words_counts_as_space.site_paths.url()returned a path that holds a double quote, such as/macro"/../models, which a browser resolves to/models. Answer: it refuses a double quote. Check:test_url_mounts_a_plain_path_and_refuses_any_other.mount()edited a path inside a refused value.<a href='/url(/a)'>became<a href='/url(/macro/a)'>. Answer: it edits nothing inside the value of another shape it reads, and nothing after a root path whose value holds a backslash or${or is never closed. The check still reads every path. Check:test_mount_edits_nothing_inside_any_value_it_readsandtest_a_path_spelled_any_other_way_fails_the_check_and_is_not_rewritten.test_any_other_footer_row_fails.macro/from a file's own name. Answer: it compares both names. Check:test_a_file_at_a_claimed_path_is_found_in_a_directory_named_like_the_base_path.What commit 13 gives up, for a reviewer to weigh: a root path with a backslash or
${in its query, and one inside another value, now fail the check and need a person to respell them;--writestops at the first value whose end it can't tell; and the footer test fails if the footer gains any element but text, links,div,span,imgand simple SVG icons above its row. The site has none of these today.Each of the last three rounds found something new in this gate. The subdomain in question 1 would need no gate.
Before merging: check the preview
The routing evidence above comes from a local emulator of Vercel's rules. Merging moves every internal link on the live Vercel host to
/macro/..., so a difference between the emulator and real Vercel would break the current site, not just the new route. Someone with a Vercel login should open this PR's preview deployment and check:/macro/modelsanswers 200 and shows the PolicyEngine bar and footer row./modelsstill answers 200 (the host keeps serving its root)./macro/papersanswers 308 withLocation: /macro/models#evidence./macro/models/answers 308 to/macro/models./macro/data/MANIFEST.jsoncarriesAccess-Control-Allow-Origin: *./macro/vendor/fonts/inter-latin.woff2answers 200 with the year-longimmutablecache.On merge
integration/tests/test_site_contract.py, so merging it triggersdeploy-mcp.yml, which redeploys the unchanged MCP server to Modal./macroitself. Before the website PR merges, check a few deep paths on the production host too:/macro/papersanswers 308 to/macro/models#evidence,/macro/modelsanswers 200, and/macro/data/MANIFEST.jsoncarriesAccess-Control-Allow-Origin: *.🤖 Generated with Claude Code