Repository navigation
Research site on Astro 7 + Alpine (CSP build): entity pages, backlinks, map, search, Markdown pages - #112
Merged
Conversation
…references both ways, a map, search, Markdown pages site/build.py is replaced by an Astro project in site/. src/lib/data.mjs reads the same files (config.toml), validates every claim against schemas/evidence-claim.v1.json with Ajv, and joins claims, papers, trials, models and other resources, options, roles and the system into one graph with typed references and backlinks. Each entity type has one layout (src/pages/<type>/[name].astro); every entity page lists what it links to and what links to it. A claim page starts with a "tested on" table (model by result); a model's page lists every claim tested with it and the result; a trial's page lists the outcomes it produced and on which models. map.html is a build-time layout of the graph as an SVG of links; search.html searches data/search.json. Markdown files in site/content become pages with the shared layout (front matter checked by a content collection; `refs:` link the page to entities, which link back). how.html is now content/how.md. Interactive parts (feed filters, search, theme, map highlighting) are Alpine components registered by name, run by @alpinejs/csp copied into the site at build time, so the content security policy stays without unsafe-eval or unsafe-inline (connect-src 'self' for the search index, form-action 'self' for the header's search box). The steering links and their body lines are unchanged (src/lib/steer.mjs). tests/test_site.py now runs the real build on the demo data and on a hostile fixture (escaping, javascript: links, several assessments, calibration, an invalid claim, a Markdown ref to a missing entity); it is skipped without `npm ci` in site/ unless MORPHOGEN_SITE_TESTS=1, which the workflow sets. The workflow installs Node by SHA-pinned setup-node and the locked packages with `npm ci --ignore-scripts`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KhsqyyPmp7iKCkTFcXs6sh
OpenReplicant
marked this pull request as ready for review
November 27, 2026 22:29
OpenReplicant
added a commit
that referenced
this pull request
Nov 27, 2026
Research site for any system: config file, morphogen site init/build, --base, Pages template (stacked on #112)
This branch was successfully deployed
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.
Stacked on #111 (branched from
origin/claude/site-assessments, which was still open). Its base isclaude/site-assessments; when #111 merges, retarget this tomainbefore that branch is deleted.The generator: Astro 7, with Alpine's CSP build
src/pages/<type>/[name].astrosrc/lib/data.mjs) feedinggetStaticPathspackage-lock.json, exact versions,npm ci --ignore-scriptsrequirements.lockset:htmlnever usedAstro wins on matching the owner's stack, Markdown pages with checked front matter, and components per entity type. Python plus Jinja would have been the smallest change; Hugo the fastest build, but weakest at the cross-references this is for.
Not Astro 4, the owner's website's version:
npm auditon the website reports a critical advisory set forastro <=7.4.4(reflected XSS through server islands, XSS through spread attribute names, a dev server file read, and more), and content collections loaded from outsidesrc/were experimental in 4. 7.4.11 (11 Nov) is the newest release more than two weeks old. The website may want the same upgrade.Alpine:
@alpinejs/csp3.17.5, copied fromnode_modulesintopublic/assets/vendor/on every build and dev start, with no CDN. Its components (theme,feed,search,graph) are registered withAlpine.datainassets/site.js. The content security policy is unchanged in spirit:script-src 'self',style-src 'self', nounsafe-evalorunsafe-inline. It addsconnect-src 'self'for the search index and changesform-actionfrom'none'to'self'for the header's search box. Without JavaScript, every page still works.What the site has now
papers/arxiv-2610.00346.html), trials (trials/e-04a.html, derived from claim sources and outcome trial ids), resources (each model, engine, GPU and dataset), options, roles, the system, and Markdown pages.watch.yaml), options, what has been tested, what is next in the queue, and every claim.map.html: a static SVG laid out at build time, with columns for models, papers and trials, claims, options and roles. Alpine highlights a node's neighbours and filters by kind.search.htmloverdata/search.json. Without JavaScript it lists everything by kind; the header's search box lands there. Also new:data/graph.json, with every node and edge, the calibration pairs and the Brier score..mdfile undersite/content/becomes a page. Its front matter istitle,kind(page, note or announcement),date,refs,nav,blocksanddraft.refs: [resource:inkling-2-mini-q4-k, trial:E-04a]puts a back-link on those pages, and a ref that does not resolve stops the build.how.htmlis nowcontent/how.md.content/notes/2026-11-27-inkling-and-the-27b-finding.md, as an example. It only restates the claim file's outcomes. Delete it if you'd rather not have it.src/lib/steer.mjs), queue, predictions and calibration, watching, light and dark themes, the CSP, escaping, anddata/claims.json.Tests
tests/test_site.pynow runs the real build. It is skipped withoutnpm ciinsite/, and fails instead whenMORPHOGEN_SITE_TESTS=1, which the workflow sets.javascript:links;research-action:values;status:line);npm testruns node unit tests forsafeUrl, theissueUrlround trip and slugs.Escaping note: Astro escapes
&and"inside quoted attributes but leaves<(it cannot open a tag there), so the escaping test strips attribute values before looking for markup.Workflow
actions/setup-node@949feb2…(v7.1.0, by SHA), Node 24.5.0,npm ci --ignore-scripts, tests, thennpm run build. Thepushtrigger stays commented out. Pages was not enabled and no settings were changed.Checked, and not checked
npm run devserves the pages.@img/sharp-libvips-*binaries (LGPL-3.0), pulled in by Astro's image service. They are build-time only, unused here, and nothing from them is shipped.Left out (cheaper later)
What the owner needs to do
mainafter Claim site: show every assessment for the system, not the first #111.pushand set Pages to "GitHub Actions".🤖 Generated with Claude Code
https://claude.ai/code/session_01KhsqyyPmp7iKCkTFcXs6sh