Repository navigation
Conversation
Review at f02614bVerdict: Needs a maintainer decision on size, then fixes and a restack. This is layer 4 of the #75 split (+3,751/-311 in 27 files, on #214). Fixes before merge
Optional
Landing
Decision for the maintainer
This was a static review: no tests were run locally. CI at this head: all 9 checks pass, but on the stack's old base 8575a15. Posted by PR swarm: PR Swarm Lead |
045930f to
793a924
Compare
f02614b to
26b589c
Compare
26b589c to
4efe159
Compare
0f6aa92 to
a31351d
Compare
4efe159 to
00aa414
Compare
Articles and the other vault pages are written by agents and published on the project's site. check and render now read every published page as the site renders it and refuse raw HTML, links to anything but the site's pages and http, https or mailto addresses, attribute lists, fence braces that do more than name a language, and code fences left open where render puts its own markup. render replaces each page's frontmatter with a header of its own, since the theme prints metadata unescaped, keeps HTML comments inside code (as the statement an approval binds keeps them), writes the site's MathJax configuration with the commands that reach past a formula turned off, draws only the graphs it marks, copies only images, PDFs and plain text, and publishes from one captured snapshot. Part 4 of the split of #75.
d929bf7 to
5753d32
Compare
d00cb14 to
473a605
Compare
Rebuilt from 473a605 onto main after #213 and #214 merged, with the maintainer's decisions on the review at f02614b applied: - Trimmed: FormulaExtension and its math fence, and graph.snapshot are gone; main's link rewriting is kept, so moved links are not percent-encoded. - Nothing refuses: check warns about raw HTML, live character references, unsafe link schemes, attribute lists, fence braces and unclosed fences, and render publishes such a page, or such a statement in its box, as typed. Files outside the allowlist and non-UTF-8 pages are left out with a warning; an edited vault mathjax.js is replaced with one; a bad tex-macros.json entry is left out alone. Only files in the way of render's own still stop render, where main would fail half way. - check warns about a formula that defines notation or uses a command the site turns off, which the site's MathJax ignores. - Authored Mermaid keeps rendering, drawn strictly; render's own graphs keep their bp-graph marking and loose security for their links. - A statement main converts on its own before boxing it, because it holds a "<", is read that way, and a formula's text excuses the markup it spells, so r<n and $a<b>c$ are published as written. - Review fixes: HTML comments stay in code spans as well as code blocks; check reads source notes without asking git; a node --check test covers the generated mathjax.js.
Security review of 3e5f03e (all confirmed by running the code): - A title render writes itself (graph headings, the navigation, the landing page's and a generated chapter's metadata) is the plain text a reader sees with markup characters as numeric references, so a tag, code span or formula in an H1 reaches the theme as text. - check no longer fails with a KeyError on a hidden roadmap article, which capture skips and render never publishes. - An image, link or link definition naming a file the site leaves out keeps only its text, so mkdocs build --strict finds nothing missing. - A chapter shown as typed gets its summary and statements after the block, not inside it. - Comment stripping reads code spans across lines and skips a backtick a backslash escapes. Style review: - A flagged leaf's box shows its statement and notes as typed, without the page header. - The captured files are a plain dict; _sources_base keeps main's signature; the files in the way of render's own leave _Publication, and publication_issues returns one list; render and check share the rule for converting a statement alone; MATHJAX_SCRIPT joins the case-collision paths. - Wording, a duplicate test, blank lines, and the README fixed; the unrelated test_markdown assertion dropped.
Brings in #371 (blueprints reached through an unreadable link). Two resolutions: - render.py's markdown imports keep this layer's block and add main's blueprint_root and directory_path. - publication_issues takes the blueprint root from blueprint_root, as render_site and load_graph now do, so every node's path lies below it when the blueprint sits behind a link that cannot be read.
Review of #215 at 5e75131Verdict: fix before merge. The rebuild follows the 2026-10-17 decisions on scope, TeX notation and Mermaid, and the page check held up against a broad attack battery. But file and folder names still put script on the Pages origin with How it was checked:
What held: no bypass of the link-scheme check in authored links (upper case, entities, control characters, autolinks, reference definitions and image sources are all flagged); item 1's folder name reaches a Fix before merge
Questions for the maintainer
Should fix (fine as follow-ups)
Nits
Landing
Disclosure: I wrote #371 and the four layers above this PR (#216, #284, #217, #219); this head's merge of main used the conflict resolution I sent for #371. The maintainer asked me for this verdict. Reviewed by Claude Code (#75 stack session). |
A published blueprint page is written by agents and authors, not by the owners of the site's theme. Today an article can put a
<script>, ajavascript:link or an imitation status mark on the project's Pages origin, and #217 and #219 will put statement review on that site. This PR treats every published page as untrusted.It never breaks a repository.
checkwarns and keeps its exit code, andrenderstill publishes: a page with markup it cannot trust is shown as typed, and everything else is published as before.Maintainer decisions (2026-10-17)
These are answers to the review at #215 (comment).
FormulaExtensionand itsmathfence (the Pages build no longer installs autoform) and thegraph.snapshotthreading. The capture half had already gone with Publish blueprint sites transactionally #165.checksuggests moving the notation toblueprint/tex-macros.json.bp-graph), and every other diagram is drawn withsecurityLevel: "strict", which shows labels as text and runs no click.What it adds
Page check (
autoform_cli/publishable.py):publishable_articlereads each piece the site publishes (the page, and a leaf's statement and notes) with the site's own Markdown converter. It reports:http,httpsandmailtoaddresses;Each finding names its line.
As-typed publishing:
shown_as_typedescapes a flagged page, or a flagged statement's box, into one preformatted block under a note.renderpublishes that instead, andcheckadds "the site shows it as typed until these are fixed".TeX notation: formulas that define a command (
\newcommand,\def,\DeclareMathOperatorand so on) or use one the site turns off (\label, the mathtools tag forms) get one warning per article. The page is still published as written.Published text (
autoform_cli/markdown.py): render replaces a page's frontmatter with a header of its own, since the theme prints metadata unescaped. It drops complete HTML comments outside code, keeping those in code spans and code blocks.published_markdownandstatement_and_notesare what check reads and render publishes. When a statement holds a<, main's body protection converts it on its own before boxing it, and check reads it that way.Render (
autoform_cli/render.py):_publicationcomputes each page once, for bothcheckandrender.render, where main fails half way..txt,.csv,.json,.bib,.tex,.lean) and non-UTF-8 pages are left out with a warning.publication_issues(graph, blueprint)givescheckone list of warnings and reads source notes as pages without asking git. Files in the way of render's own output come from_in_the_way, which render checks before building anything.mkdocs build --strictfinds nothing missing.markdown.title_text: the plain text a reader sees, with markup characters as numeric references, since the theme prints navigation and metadata titles unescaped.MathJax (
autoform_cli/mathjax.py): render writesjavascripts/mathjax.json every build. It pins MathJax 3.2.2, theui/safefilter, and one TeX input with base, ams, noundefined, boldsymbol, mathtools and the project's macros. Commands that would let one formula change another are mapped to\notallowed.tex-macros.jsonentry is left out on its own, with a warning; valid entries are kept.mkdocs.ymlstill lists the bundle after the script, asautoform initwrites it.Mermaid (
autoform_cli/mermaid.py,render.py):CSS: a formula paints only inside its own block, and an as-typed block wraps.
README Validation and site sections; the setup skill notes
tex-macros.json.What changed in this revision
Size: +3,020/-294 in 28 files at 473a605; now +3,091/-278 in 18 files against main.
Rebuilt on main: 35a81f0 is the layer on main ec84968, and the merge commit 3e5f03e takes its tree over the old head, so the push is a fast-forward. Conflicts were resolved toward main's newer code:
_destinationpercent-encoding, which would also have double-encoded against Scale roadmap inventories and the full DAG explorer #90;_sources_basekeeps main's folder-prefix spellings;_render_environmentkeeps main's_protect_markdown_in_html.Merged main 400eb64 (Load a blueprint reached through a link that cannot be read #371) as 5e75131. render.py's markdown imports gain
blueprint_rootanddirectory_path, andpublication_issuestakesblueprint_root(blueprint), the rootload_graphandrender_sitenow use, so a blueprint behind an unreadable link checks cleanly.Refusals became warnings throughout, per the decisions above.
Review fixes:
node --checktest covers the generated script, and the README no longer cites a typesetting test;.bp-readbacknames are trimmed.Found in the rebuild: main now supports
r<nand$a<b>c$in statements. The check reads protected statements as render publishes them, and a formula's text excuses the markup it spells, so neither is flagged.Main tests adjusted:
test_checking_the_output_site_hashes_its_files_without_holding_themuses a.png, since.binis left out now;test_a_capture_during_a_render_skips_the_stage_being_writtenhooksPath.write_bytes, which render now writes the site with;bp-graphelement.Review of the rebuild (eebe543):
checkraised a KeyError on a hidden roadmap article;.svgleft dangling links that fail the strict build;_named_markup, whose messages are stable.Until the next layers land
_publication's file loop and a comment inmathjax.py; both apply as before. jackmccarthy-63 restacks Add read-back cards and the testimony validator #216 and up on this head.render.py,markdown.pyand their tests too; whichever lands second resolves the overlap.mermaid.relative_linkitself. This PR's_hrefencodes click links withquote(link, safe="/#"), so whichever lands second should add%tosafeto avoid encoding twice.blueprint/javascripts/mathjax.jsuntil its pinned autoform writes the script; render then replaces that unedited copy silently.Validation
Stack