Site Generation
How the project curator builds, post-processes, and verifies the navigable HTML website from the drug discovery program's artifact hierarchy. This skill covers when to trigger a build, how to invoke the CLI, what the build produces, how to apply post-build fixes for known rendering gaps, and how to verify the output. It complements artifact-conventions (which governs the source artifacts) and program-state-management (which governs the Layer 2 documents that feed the site).
When to Build
Trigger oase site build whenever the source material has changed in a way that should be reflected on the site:
- A new work order has been accepted
- Program state documents have been updated
- A new gate document has been written
- The executive summary has been updated
- New findings have been added
How to Build
Basic Build
oase site build
By default, raw/ artifacts are copied into _site/raw/ so the built site is self-contained. Viewer ?file= URLs resolve within the site directory. To disable bundling and revert to the previous layout where viewers reference raw/ outside the site tree, pass --no-bundle-raw:
oase site build --no-bundle-raw
With Retrospectives (Scion Environments)
When running inside a Scion-managed environment, retrospectives live on the shared volume. Pass them explicitly so the build can include them:
oase site build --retrospectives-dir /scion-volumes/scratchpad/projects/<program>/retrospectives/
Output
- Output directory:
_site/(default, configurable via--output-dir) _site/raw/contains a filtered copy of the project'sraw/data artifacts (excludes hidden files,__pycache__,.pyc,.DS_Store). Omitted when--no-bundle-rawis passed.- Atomic build: writes to a temp directory, then moves into place
- Records build in
publish-state.json - Appends a
site.publishedevent to the event log
Content Preparation
The CLI renders content — it does not generate it. The agent must prepare and maintain the source material before building.
Executive Summary
- Write or update
executive/program-summary.mdbefore building. - The landing page shows a truncated excerpt with a "Read more" link.
Program State
- Maintain the four documents in
program-state/(active-series.md,liability-tracker.md,decision-log.md,open-questions.md). - The CLI renders each as a separate page with markdown-to-HTML conversion.
Findings Organization
- Organize findings by discipline subdirectory:
findings/<discipline>/. - The sidebar groups findings by discipline automatically.
- The CLI renders markdown to HTML.
Math in Markdown
The build supports LaTeX math rendering via the mistune math plugin and vendored KaTeX.
Supported delimiters:
- Inline math:
$...$or\(...\) - Display math:
$$...$$or\[...\]
Usage:
- Standard LaTeX math commands work:
\text{},\times,\approx, subscripts, superscripts, Greek letters, fractions. - Example:
$K_i \approx 5.6\ \text{nM}$renders as formatted math. - Use inline math for values in running text (potency, IC₅₀). Use display blocks for complex equations.
Avoid:
- Do not use HTML entities or Unicode workarounds for math that LaTeX handles natively.
- Do not wrap math in code fences or backtick spans — those prevent rendering.
- Do not mix delimiter styles within the same expression.
Build interaction:
- The mistune math plugin tokenises math spans during markdown-to-HTML conversion.
- KaTeX auto-render processes the output HTML client-side.
- KaTeX CSS, JS, and fonts are vendored alongside the site (same mechanism as viewers), so relocatable archives and offline copies render math without network access.
Page Types
The build produces the following page types:
| Page Type | Source | Template | Notes |
|---|---|---|---|
| Landing page | All collected data | index.html | Executive excerpt, WO table, finding/artifact links |
| Finding | findings/**/*.md via accepted WOs | finding.html | Rendered markdown, viewer links |
| Artifact class | raw/<class>/ via accepted WOs | artifact.html | File listing with viewer links |
| Work order | Accepted WOs from controlstore | workorder.html | Full WO metadata, linked findings/artifacts |
| Program state | program-state/*.md | program_state.html | Rendered markdown |
| Gate document | gates/stage*/*.md | gate.html | Stage metadata, rendered markdown |
| Executive summary | executive/program-summary.md | executive.html | Rendered markdown |
| Retrospectives | --retrospectives-dir | retrospectives.html | Rendered markdown, only if flag provided |
Viewer Catalog
Because raw/ is bundled into _site/ by default, viewer ?file= URLs resolve within the site directory (../raw/...). This means viewers work correctly in exported archives and on static file hosts without path patching. When --no-bundle-raw is used, viewer URLs revert to the previous external-path layout (../../raw/...).
The site includes 13 auto-wired specialized HTML viewers for scientific data files, plus one additional viewer not yet wired to a file extension. Viewers are standalone HTML files that load data via ?file= query parameters. Viewers listed below are wired automatically by file extension via the VIEWER_MAP in site.py — the agent does not need to configure viewer wiring. One additional viewer (contacts-viewer.html) is included in the site but not yet wired to a file extension.
Native HTML Viewers (no CDN dependencies)
| Viewer | File Pattern | What It Shows |
|---|---|---|
| pockets-viewer.html | .pockets.json | Binding pocket properties table |
| constraint-viewer.html | .gnomad-constraint.json | Genetic constraint metrics card |
| tournament-viewer.html | .tournament.json | Hypothesis ranking table |
| brics-viewer.html | .brics.json | BRICS decomposition display |
highlight.js Viewers (CDN: cdn.jsdelivr.net)
| Viewer | File Pattern | What It Shows |
|---|---|---|
| json-viewer.html | .json (fallback) | Syntax-highlighted JSON |
3Dmol.js Viewers (CDN: cdn.jsdelivr.net)
| Viewer | File Pattern | What It Shows |
|---|---|---|
| structure-viewer.html | .cif | 3D molecular structure (cartoon) |
| sdf-viewer.html | .3d.sdf | 3D molecule (stick model) |
| docking-viewer.html | .receptor.pdbqt + .poses.pdbqt | Receptor-ligand overlay |
Plotly.js Viewers (CDN: cdn.jsdelivr.net)
| Viewer | File Pattern | What It Shows |
|---|---|---|
| pae-viewer.html | .pae.json | Predicted Aligned Error heatmap |
| plddt-viewer.html | .afdb.json | pLDDT confidence chart |
| expression-viewer.html | .tissue.json | Tissue expression bar chart |
| contacts-viewer.html | .contacts.json (not yet in VIEWER_MAP) | Contact heatmap |
| admet-viewer.html | .predict.json | ADMET prediction chart |
| docking-scores-viewer.html | .docking_result.json | Docking score comparison |
CDN constraint: All external scripts load from cdn.jsdelivr.net only.
Post-Build Processing
After oase site build completes and before verification, run a post-build orchestrator to fix known rendering gaps in the build output. Every fix script must be idempotent — safe to re-run after every build without accumulating changes.
Why This Phase Exists
The build tool renders markdown to HTML deterministically but does not handle every rendering pattern. Several gaps recur across programs:
| Gap | Symptom | Fix Category |
|---|---|---|
| Pipe-delimited tables | Raw \| text instead of <table> elements | Structural HTML |
| Duplicate H1 | Template injects an H1; markdown # Title adds a second | Structural HTML |
| Shared scroll context | Sidebar and main content scroll together | CSS/styling |
| .md link paths | Internal links retain .md extension instead of .html | Link resolution |
| Plain-text references | Evidence/artifact references not rendered as clickable links | Link resolution |
| No theme system | Single hardcoded visual style with no user control over appearance | CSS/styling |
Execution Model
- Run
postbuild.py(the orchestrator) against_site/. - The orchestrator discovers and runs fix scripts in dependency order.
- Each script applies a detection guard — checks whether the fix has already been applied before modifying any file.
- Recommended execution order:
- Structural HTML fixes (tables, duplicate headings)
- CSS/styling fixes (scroll context, layout)
- Link resolution (
.md→.html, artifact links) - Cosmetic passes (whitespace, formatting)
- Scan/report (summary of remaining issues)
Invoking Post-Build Processing
oase site build
python3 postbuild.py _site/
# then verify and serve