Measure first
The benchmark records its result before correctness checks begin. The primary metric stays clean.
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6440e25e..e4e03738 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,15 +6,28 @@ on: push: branches-ignore: [main] +permissions: + contents: read + jobs: test: + timeout-minutes: 10 runs-on: ubuntu-latest steps: - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 with: node-version: 22.22.2 cache: pnpm + cache-dependency-path: | + pnpm-lock.yaml + site/pnpm-lock.yaml - run: pnpm install --frozen-lockfile - run: pnpm test + - run: pnpm --dir site install --frozen-lockfile --ignore-scripts + - run: pnpm --dir site build + - run: test -f site/build/index.html -a -f site/build/configuration.html -a -f site/build/recordings/casts.js + - run: test -z "$(git ls-files site/build docs)" diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 00000000..16bbad4e --- /dev/null +++ b/.github/workflows/pages.yml @@ -0,0 +1,52 @@ +name: Deploy landing page + +on: + push: + branches: [main] + paths: + - site/** + - .github/workflows/pages.yml + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: pages + cancel-in-progress: false + +jobs: + build: + timeout-minutes: 10 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 + with: + persist-credentials: false + - uses: pnpm/action-setup@fc06bc1257f339d1d5d8b3a19a8cae5388b55320 # v4.4.0 + - uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version: 22.22.2 + cache: pnpm + cache-dependency-path: site/pnpm-lock.yaml + - run: pnpm --dir site install --frozen-lockfile --ignore-scripts + - run: pnpm --dir site build + - uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0 + - uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1 + with: + path: site/build + + deploy: + needs: build + timeout-minutes: 10 + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5 diff --git a/.gitignore b/.gitignore index 5b7621b7..e610ff2d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ node_modules/ # AI-generated image artefacts (should not be committed) gpt-image-*.png nano-banana-*.png + +# Generated site output +/site/build/ diff --git a/README.md b/README.md index 4130fd6b..a809b936 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ # pi-autoresearch ### Autonomous experiment loop for pi -**[Install](#install)** · **[Usage](#usage)** · **[How it works](#how-it-works)** +**[Website](https://davebcn87.github.io/pi-autoresearch/)** · **[Documentation](https://davebcn87.github.io/pi-autoresearch/configuration.html)** · **[Install](#install)** · **[Usage](#usage)** · **[How it works](#how-it-works)** @@ -358,6 +358,14 @@ Drop executable scripts in `.auto/hooks/` to run code at iteration boundaries. H 1. **Install pi** — follow the instructions at [pi.dev](https://pi.dev/) 2. **An API key** for your preferred LLM provider (configured in pi) +## Security and trust + +Pi packages run with your full user permissions. Review this repository before installing it, and run autoresearch in a dedicated branch or worktree with a clean working tree. + +Autoresearch intentionally edits files, creates and reverts commits, and executes the commands in `.auto/measure.sh`, `.auto/checks.sh`, and `.auto/hooks/`. Treat those files as executable code: review them before each session, keep credentials and sensitive files out of scope, and use a sandbox or restricted environment for untrusted projects. + +For reproducible installs, pin a version you have reviewed, for example `pi install npm:pi-autoresearch@1.7.0`. Published npm releases include provenance attestations. + ## Controlling costs Autoresearch loops run autonomously and can burn through tokens. Two ways to cap spend: diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.md new file mode 100644 index 00000000..3d1401c0 --- /dev/null +++ b/THIRD_PARTY_NOTICES.md @@ -0,0 +1,17 @@ +# Third-party notices + +## Published performance results + +The landing page cites performance results published in [“Autoresearch isn't just for training models”](https://shopify.engineering/autoresearch). “Shopify” and “Polaris” are used only to identify that public source. Shopify and Polaris names and marks remain the property of their respective owners. This project is not an official Shopify product. + +## Public quotations + +Short excerpts from public posts on X are reproduced with author attribution and links to the originals. Copyright in those posts remains with their respective authors. Official embeds are loaded only after visitor consent and are isolated in sandboxed, cross-origin frames. + +## Asciinema Player + +The deployed landing page includes Asciinema Player under the Apache License 2.0. Its license is copied to `site/build/vendor/asciinema-player.LICENSE` during the site build. The generated `site/build/` directory is ignored by Git. + +## pi + +pi-autoresearch is a community extension for pi. References to pi identify compatibility and do not transfer ownership of the pi name or project. diff --git a/site/ASSETS.md b/site/ASSETS.md new file mode 100644 index 00000000..e3c1fd8c --- /dev/null +++ b/site/ASSETS.md @@ -0,0 +1,7 @@ +# Landing-page asset provenance + +- `og-image.webp` is project-original artwork created for the pi-autoresearch landing page. It contains no third-party logo. +- `social-preview.png` is a project-original composition built from illustrative pi-autoresearch terminal data. The abbreviated commit identifiers and benchmark values are demo data, not identifiers from a private repository. +- `result-share-card.png` is a project-original visualization of the publicly reported Polaris result in [Shopify Engineering's Autoresearch case study](https://shopify.engineering/autoresearch). + +Original visual elements are distributed under this repository's MIT license. Shopify and Polaris are referenced descriptively; their names and marks remain the property of their respective owners. diff --git a/site/README.md b/site/README.md new file mode 100644 index 00000000..4ff06ae5 --- /dev/null +++ b/site/README.md @@ -0,0 +1,23 @@ +# Landing page + +The landing-page source lives entirely under `site/`: + +- `public/` contains static files copied as-is. +- `content/` contains Markdown rendered during the build. +- `templates/` contains generated-page templates. +- `scripts/` contains build-time generators. + +Build the deployable site with: + +```bash +pnpm --dir site install --frozen-lockfile --ignore-scripts +pnpm --dir site build +``` + +Output is written to `site/build/`. That directory is disposable, ignored by Git, and deployed by `.github/workflows/pages.yml`. + +Preview it locally with: + +```bash +python3 -m http.server 4173 --directory site/build +``` diff --git a/site/build.mjs b/site/build.mjs new file mode 100644 index 00000000..422181ca --- /dev/null +++ b/site/build.mjs @@ -0,0 +1,120 @@ +import {cpSync, copyFileSync, mkdirSync, readFileSync, rmSync, writeFileSync} from 'node:fs'; +import {resolve} from 'node:path'; +import MarkdownIt from 'markdown-it'; +import markdownItAnchor from 'markdown-it-anchor'; + +const siteDirectory = import.meta.dirname; +const buildDirectory = resolve(siteDirectory, 'build'); +const contentDirectory = resolve(siteDirectory, 'content'); +const publicDirectory = resolve(siteDirectory, 'public'); +const vendorDirectory = resolve(buildDirectory, 'vendor'); +const playerDirectory = resolve(siteDirectory, 'node_modules/asciinema-player/dist/bundle'); + +prepareBuildDirectory(); +copyPublicFiles(); +await import('./scripts/generate-casts.mjs'); +buildConfigurationPage(); +copyPlayerAssets(); + +function prepareBuildDirectory() { + rmSync(buildDirectory, {recursive: true, force: true}); + mkdirSync(buildDirectory, {recursive: true}); +} + +function copyPublicFiles() { + cpSync(publicDirectory, buildDirectory, {recursive: true}); +} + +function buildConfigurationPage() { + const source = readFileSync(resolve(contentDirectory, 'configuration.md'), 'utf8'); + const {title, intro, body} = parseDocument(source); + const markdown = createMarkdownRenderer(); + const headings = sectionHeadings(markdown.parse(body, {})); + const renderedContent = wrapSections(markdown.render(body)); + const template = readFileSync(resolve(siteDirectory, 'templates/configuration.html'), 'utf8'); + const output = template + .replaceAll('{{title}}', escapeHtml(title)) + .replace('{{intro}}', markdown.renderInline(intro)) + .replace('{{toc}}', renderTableOfContents(headings)) + .replace('{{content}}', renderedContent); + writeFileSync(resolve(buildDirectory, 'configuration.html'), output); +} + +function parseDocument(source) { + const lines = source.trim().split('\n'); + const title = lines.shift()?.replace(/^#\s+/, '') ?? 'Configuration'; + while (lines[0]?.trim() === '') lines.shift(); + const firstSection = lines.findIndex((line) => line.startsWith('## ')); + const intro = lines.slice(0, firstSection).join('\n').trim(); + const body = lines.slice(firstSection).join('\n'); + return {title, intro, body}; +} + +function createMarkdownRenderer() { + return new MarkdownIt({html: false, linkify: true, typographer: true}) + .use(markdownItAnchor, {slugify: sectionId}); +} + +function sectionHeadings(tokens) { + const headings = []; + tokens.forEach((token, index) => { + if (token.type !== 'heading_open' || token.tag !== 'h2') return; + headings.push({id: token.attrGet('id'), text: tokens[index + 1].content}); + }); + return headings; +} + +function sectionId(title) { + const knownIds = { + 'Session configuration': 'config-file', + 'Session files': 'session-files', + 'Runtime options': 'runtime', + 'Safety and trust': 'safety', + 'Keyboard shortcuts (opt-in)': 'shortcuts', + 'Hooks': 'hooks', + 'Session controls': 'commands', + 'Intentionally fixed behavior': 'fixed', + 'Start with the defaults': 'start', + }; + return knownIds[title] ?? title.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/(^-|-$)/g, ''); +} + +function wrapSections(content) { + let sectionCount = 0; + const wrapped = content.replace(/
', '')
+ .replaceAll('
', '')
+ .replaceAll('', '');
+}
+
+function renderTableOfContents(headings) {
+ return headings
+ .filter(({id}) => id !== 'start')
+ .map(({id, text}) => `${escapeHtml(text)}`)
+ .join('\n');
+}
+
+function copyPlayerAssets() {
+ mkdirSync(vendorDirectory, {recursive: true});
+ copyFileSync(resolve(playerDirectory, 'asciinema-player.min.js'), resolve(vendorDirectory, 'asciinema-player.min.js'));
+ copyFileSync(resolve(playerDirectory, 'asciinema-player.css'), resolve(vendorDirectory, 'asciinema-player.css'));
+ copyFileSync(resolve(siteDirectory, 'node_modules/asciinema-player/LICENSE'), resolve(vendorDirectory, 'asciinema-player.LICENSE'));
+}
+
+function escapeHtml(value) {
+ return value
+ .replaceAll('&', '&')
+ .replaceAll('<', '<')
+ .replaceAll('>', '>')
+ .replaceAll('"', '"');
+}
diff --git a/site/content/configuration.md b/site/content/configuration.md
new file mode 100644
index 00000000..ce39fef1
--- /dev/null
+++ b/site/content/configuration.md
@@ -0,0 +1,145 @@
+# Configuration
+
+pi-autoresearch has deliberately few knobs. Configure where and how a session runs; keep the experiment protocol consistent.
+
+## Session configuration
+
+The optional `.auto/config.json` file lives under the Pi session directory. Paths resolve from the directory where Pi was started.
+
+```json
+{
+ "workingDir": "../project",
+ "maxIterations": 30
+}
+```
+
+| Setting | Type | Behavior |
+| --- | --- | --- |
+| `workingDir` | string | Runs file operations, Git, hooks, and experiments in another existing directory. Relative paths resolve from the Pi session directory. |
+| `maxIterations` | number | Stops the active segment after this many logged experiments. Start a new segment to continue. |
+
+> **Important:** The config file remains in the session directory even when `workingDir` points elsewhere.
+
+## Session files
+
+The create skill writes the two required files. Add ideas, checks, and hooks only when the session needs them.
+
+| File | Status | Purpose |
+| --- | --- | --- |
+| `.auto/prompt.md` | Generated | Objective, metric, scope, constraints, tried ideas, dead ends, and useful findings. This is the handoff across context resets. |
+| `.auto/measure.sh` | Generated | Runs the benchmark and prints one or more `METRIC name=number` lines. |
+| `.auto/log.jsonl` | Managed | Append-only session history. Do not hand-edit it while a session is running. |
+| `.auto/ideas.md` | Optional | A backlog for promising optimizations that are too complex or distracting to pursue immediately. Resuming agents prune tried ideas and experiment with what remains. |
+| `.auto/checks.sh` | Optional | Tests, type checks, or lint that run after a passing benchmark. A failure blocks the keep without changing the measured metric. |
+| `.auto/hooks/before.sh` | Optional | Receives session JSON before the next iteration. Stdout becomes a steer message for the agent. |
+| `.auto/hooks/after.sh` | Optional | Receives the completed run and session snapshot. Useful for journals, notifications, or tagging. |
+
+## Runtime options
+
+Timeouts belong to the `run_experiment` call, not `config.json`.
+
+```js
+run_experiment({
+ command: "pnpm test --run",
+ timeout_seconds: 600,
+ checks_timeout_seconds: 300
+})
+```
+
+- **`command`** — The benchmark command. Required.
+- **`timeout_seconds`** — Benchmark timeout. Defaults to 600 seconds.
+- **`checks_timeout_seconds`** — Separate timeout for `.auto/checks.sh`. Defaults to 300 seconds.
+
+## Safety and trust
+
+Pi packages run with your full user permissions. Review this repository before installing it, and run autoresearch in a dedicated branch or worktree with a clean working tree.
+
+Autoresearch edits files, creates and reverts commits, and executes `.auto/measure.sh`, `.auto/checks.sh`, and scripts under `.auto/hooks/`. Review those files before each session, keep credentials and sensitive files out of scope, and use a sandbox or restricted environment for untrusted projects.
+
+For reproducible installs, pin a version you have reviewed, for example:
+
+```bash
+pi install npm:pi-autoresearch@1.7.0
+```
+
+Published npm releases include provenance attestations. Provider-side spending limits and `maxIterations` can bound the cost of an unattended session.
+
+## Keyboard shortcuts (opt-in)
+
+No shortcuts are bound by default. Every action is available through an `/autoresearch` subcommand, avoiding conflicts with pi's built-in keymap.
+
+To opt in, create `/extensions/pi-autoresearch.json`. The agent directory is normally `~/.pi/agent`, or `PI_CODING_AGENT_DIR` when set.
+
+```json
+{
+ "shortcuts": {
+ "fullscreenDashboard": "ctrl+shift+y",
+ "export": "alt+shift+e",
+ "off": null
+ }
+}
+```
+
+Omitted or `null` settings remain unbound. `fullscreenDashboard` runs `/autoresearch dashboard`, `export` runs `/autoresearch export`, and `off` runs `/autoresearch off`. Verify that each chord is free in the installed pi keymap and your `/keybindings.json`; extension shortcuts win conflicts.
+
+## Hooks
+
+Executable scripts under `.auto/hooks/` can observe or influence iteration boundaries without adding hook logic to the research prompt.
+
+`before.sh` → **Experiment: edit, measure, log** → `after.sh` → **next iteration**
+
+### Lifecycle
+
+- **`.auto/hooks/before.sh`** runs on fresh activation, then again after each logged experiment. Use it to fetch research, rotate ideas, or prepare context for the next attempt.
+- **`.auto/hooks/after.sh`** runs after `log_experiment`. Use it to persist learnings, tag wins, or send local notifications.
+
+### Contract
+
+- **Input:** A single JSON object on stdin containing the event, working directory, run data, and session snapshot.
+- **Output:** Stdout becomes a steer message for the agent. Empty stdout is silent. Output is capped at 8 KB.
+- **Failure:** A non-zero exit or execution longer than 30 seconds produces an error steer instead of stopping the extension.
+- **History:** Every hook execution appends a `type: "hook"` entry to `.auto/log.jsonl`.
+- **Reverts:** The entire `.auto/` directory, including hooks, survives discarded experiments.
+
+### Minimal after hook
+
+```bash
+#!/usr/bin/env bash
+set -euo pipefail
+
+run="$(jq -r '.run_entry.run' <&0)"
+printf 'Run %s logged. Review the result before repeating.\n' "$run"
+```
+
+Make hook files executable before starting the session:
+
+```bash
+chmod +x .auto/hooks/before.sh .auto/hooks/after.sh
+```
+
+> **Fixed boundary:** Hook names, the 30-second timeout, and the 8 KB stdout limit are not configurable. The agent has no dedicated hook field; scripts mine the same descriptions and `asi.*` signals the loop already records.
+
+## Session controls
+
+- **`/autoresearch `** — Start a new session or resume an existing one with additional context.
+- **`/autoresearch off`** — Stop auto-resume while preserving the session history.
+- **`/autoresearch clear`** — Delete the log and reset runtime state for a clean start.
+- **`/autoresearch export`** — Open the live browser dashboard and export a shareable result image.
+- **`/autoresearch dashboard`** — Open the fullscreen, scrollable dashboard in the terminal.
+
+## Intentionally fixed behavior
+
+These constraints keep results comparable and sessions recoverable.
+
+- **Primary metric decides.** Keep or discard follows the configured primary metric. Secondary metrics are monitoring signals, not a weighted score.
+- **Confidence is advisory.** The Median Absolute Deviation estimator and 1× / 2× guidance thresholds are fixed. Confidence never auto-discards a run.
+- **State lives under `.auto/`.** The folder name and JSONL record format are part of the extension contract. Legacy files are read only for compatibility.
+- **Hooks have a fixed boundary.** Only `before.sh` and `after.sh` are recognized. They receive JSON on stdin and return steer text on stdout.
+- **Safety guards remain internal.** Auto-resume turn and consecutive-failure guards are not tuning knobs.
+- **Dashboard presentation is not themed per session.** Browser and terminal dashboards follow the extension UI rather than session-level style configuration.
+
+## Start with the defaults
+
+Add configuration only when the experiment requires a different boundary.
+
+[Back to pi-autoresearch →](index.html)
diff --git a/site/package.json b/site/package.json
new file mode 100644
index 00000000..2762922f
--- /dev/null
+++ b/site/package.json
@@ -0,0 +1,15 @@
+{
+ "name": "pi-autoresearch-site",
+ "private": true,
+ "version": "1.0.0",
+ "type": "module",
+ "packageManager": "pnpm@10.28.2",
+ "scripts": {
+ "build": "node build.mjs"
+ },
+ "dependencies": {
+ "asciinema-player": "3.17.0",
+ "markdown-it": "15.0.0",
+ "markdown-it-anchor": "9.2.0"
+ }
+}
diff --git a/site/pnpm-lock.yaml b/site/pnpm-lock.yaml
new file mode 100644
index 00000000..6e0baae8
--- /dev/null
+++ b/site/pnpm-lock.yaml
@@ -0,0 +1,184 @@
+lockfileVersion: '9.0'
+
+settings:
+ autoInstallPeers: true
+ excludeLinksFromLockfile: false
+
+importers:
+
+ .:
+ dependencies:
+ asciinema-player:
+ specifier: 3.17.0
+ version: 3.17.0
+ markdown-it:
+ specifier: 15.0.0
+ version: 15.0.0
+ markdown-it-anchor:
+ specifier: 9.2.0
+ version: 9.2.0(@types/markdown-it@14.2.0)(markdown-it@15.0.0)
+
+packages:
+
+ '@babel/runtime@7.29.7':
+ resolution: {integrity: sha512-Nq8OhGWiZIZGV6hLHoyAKLLcJihP/xFeBMGJoUrxTX2psI8dCifzLhZISFb+VWS3wFMRDmCGw5R+dOySCqPLhw==, tarball: https://registry.npmjs.org/@babel/runtime/-/runtime-7.29.7.tgz}
+ engines: {node: '>=6.9.0'}
+
+ '@solid-primitives/refs@1.1.4':
+ resolution: {integrity: sha512-bLjwIs6ZPu8NQnuw04sU3Zc8qKSpbc0umUU/O4SHf6oWOdO4+dHY8vb1T7C4b/Tg103+9WGr6sEE0+NFlbaB/A==, tarball: https://registry.npmjs.org/@solid-primitives/refs/-/refs-1.1.4.tgz}
+ peerDependencies:
+ solid-js: ^1.6.12
+
+ '@solid-primitives/transition-group@1.1.2':
+ resolution: {integrity: sha512-gnHS0OmcdjeoHN9n7Khu8KNrOlRc8a2weETDt2YT6o1zeW/XtUC6Db3Q9pkMU/9cCKdEmN4b0a/41MKAHRhzWA==, tarball: https://registry.npmjs.org/@solid-primitives/transition-group/-/transition-group-1.1.2.tgz}
+ peerDependencies:
+ solid-js: ^1.6.12
+
+ '@solid-primitives/utils@6.4.1':
+ resolution: {integrity: sha512-ISSB5QX1qP2ynrheIpYwc4oKR5Ny4siNuUyf1qZniy+Il+p/PtDB0QK1Dnle8noiHpwRD3gpPdubOC3qI/Zamg==, tarball: https://registry.npmjs.org/@solid-primitives/utils/-/utils-6.4.1.tgz}
+ peerDependencies:
+ solid-js: ^1.6.12
+
+ '@types/linkify-it@5.0.0':
+ resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==, tarball: https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz}
+
+ '@types/markdown-it@14.2.0':
+ resolution: {integrity: sha512-NoQ2yGlLWj4wpxMs+TYmRKk3thDrQ97agr7sFqfLsAlvoS8SNQuTrlObhFqG9iugdTtgOE9jpJ6FNM4ZGsa5xQ==, tarball: https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.2.0.tgz}
+
+ '@types/mdurl@2.0.0':
+ resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==, tarball: https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz}
+
+ argparse@3.0.0:
+ resolution: {integrity: sha512-BOp5NMrHqKxmq/OLr+clzzrRxgOKSLkcjmkWuChp7Irqwn4s74WjOBPIgWfA/HMcBnVkZ5XEuf9uUqzlpfCQ6A==, tarball: https://registry.npmjs.org/argparse/-/argparse-3.0.0.tgz}
+
+ asciinema-player@3.17.0:
+ resolution: {integrity: sha512-JbjNJmA2TLIeYNaOEja+kVSzXadKoqpIzVVmfBGNj2DmdtE/vExBCnkE8NYEcpaQcDvUYg8Ltt0urT80frACmw==, tarball: https://registry.npmjs.org/asciinema-player/-/asciinema-player-3.17.0.tgz}
+
+ csstype@3.2.3:
+ resolution: {integrity: sha512-z1HGKcYy2xA8AGQfwrn0PAy+PB7X/GSj3UVJW9qKyn43xWa+gl5nXmU4qqLMRzWVLFC8KusUX8T/0kCiOYpAIQ==, tarball: https://registry.npmjs.org/csstype/-/csstype-3.2.3.tgz}
+
+ entities@8.0.0:
+ resolution: {integrity: sha512-zwfzJecQ/Uej6tusMqwAqU/6KL2XaB2VZ2Jg54Je6ahNBGNH6Ek6g3jjNCF0fG9EWQKGZNddNjU5F1ZQn/sBnA==, tarball: https://registry.npmjs.org/entities/-/entities-8.0.0.tgz}
+ engines: {node: '>=20.19.0'}
+
+ linkify-it@6.1.0:
+ resolution: {integrity: sha512-wJ/TwpSDTLepCrQoYWYIExIKg5Zchex2Nn5yk2mFnB+6PtdkHtyLx742md9csRjjOnGkKIS/RrbY7l8D6gT9Vw==, tarball: https://registry.npmjs.org/linkify-it/-/linkify-it-6.1.0.tgz}
+
+ markdown-it-anchor@9.2.0:
+ resolution: {integrity: sha512-sa2ErMQ6kKOA4l31gLGYliFQrMKkqSO0ZJgGhDHKijPf0pNFM9vghjAh3gn26pS4JDRs7Iwa9S36gxm3vgZTzg==, tarball: https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-9.2.0.tgz}
+ peerDependencies:
+ '@types/markdown-it': '*'
+ markdown-it: '*'
+
+ markdown-it@15.0.0:
+ resolution: {integrity: sha512-Lf8ajvVNdRpzSNB4VegxNy7gjs8gU35l4b4+ET49LrQC5PKYwLZ72u60LeJ9gv3qiaesuYjJWCyVeQmv/QWKQw==, tarball: https://registry.npmjs.org/markdown-it/-/markdown-it-15.0.0.tgz}
+ hasBin: true
+
+ mdurl@2.1.0:
+ resolution: {integrity: sha512-1+HBaOx0zi/dQWht8rNv9MYf9qqpqL/kxI0hXImU6Y547zM6Sni8BQibt7ifgMcYtQg41ao3Ivd6cnSM86inpg==, tarball: https://registry.npmjs.org/mdurl/-/mdurl-2.1.0.tgz}
+
+ punycode.js@2.3.1:
+ resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==, tarball: https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz}
+ engines: {node: '>=6'}
+
+ seroval-plugins@1.5.6:
+ resolution: {integrity: sha512-HXuLAX2pu/UByPpaeo/TaMfvMIi+1QqIoPJYCcAtU8QkVNwgR6MPlGuCQTErV1JwraaMbYaWVIBX7mppzGLATQ==, tarball: https://registry.npmjs.org/seroval-plugins/-/seroval-plugins-1.5.6.tgz}
+ engines: {node: '>=10'}
+ peerDependencies:
+ seroval: ^1.0
+
+ seroval@1.5.6:
+ resolution: {integrity: sha512-rVQVWjjSvlINzaQPZH5JFqsqEsIWdTxY3iJZCnTL/5gQbXIRooVZKI60tVCkOVfzcRPejboxO2t0P89dg5mQaA==, tarball: https://registry.npmjs.org/seroval/-/seroval-1.5.6.tgz}
+ engines: {node: '>=10'}
+
+ solid-js@1.9.15:
+ resolution: {integrity: sha512-EeiY2xfpZJqPLjXspVEKjAII4yv8NyG//NxZ3IpOFHdUNnnTyL0uJOeS9LWGvA7cFCz5y94cjFwYlmw5Luncsg==, tarball: https://registry.npmjs.org/solid-js/-/solid-js-1.9.15.tgz}
+
+ solid-transition-group@0.2.3:
+ resolution: {integrity: sha512-iB72c9N5Kz9ykRqIXl0lQohOau4t0dhel9kjwFvx81UZJbVwaChMuBuyhiZmK24b8aKEK0w3uFM96ZxzcyZGdg==, tarball: https://registry.npmjs.org/solid-transition-group/-/solid-transition-group-0.2.3.tgz}
+ engines: {node: '>=18.0.0', pnpm: '>=8.6.0'}
+ peerDependencies:
+ solid-js: ^1.6.12
+
+ uc.micro@3.0.0:
+ resolution: {integrity: sha512-U3PppEkleoTnIfi8BozMx3yju3qc/L6SwqWo2Sw+54PX+PX0q9I+r1Um5HCmqD7n9VDX5/v3vQH/AjA6deDdtw==, tarball: https://registry.npmjs.org/uc.micro/-/uc.micro-3.0.0.tgz}
+
+snapshots:
+
+ '@babel/runtime@7.29.7': {}
+
+ '@solid-primitives/refs@1.1.4(solid-js@1.9.15)':
+ dependencies:
+ '@solid-primitives/utils': 6.4.1(solid-js@1.9.15)
+ solid-js: 1.9.15
+
+ '@solid-primitives/transition-group@1.1.2(solid-js@1.9.15)':
+ dependencies:
+ solid-js: 1.9.15
+
+ '@solid-primitives/utils@6.4.1(solid-js@1.9.15)':
+ dependencies:
+ solid-js: 1.9.15
+
+ '@types/linkify-it@5.0.0': {}
+
+ '@types/markdown-it@14.2.0':
+ dependencies:
+ '@types/linkify-it': 5.0.0
+ '@types/mdurl': 2.0.0
+
+ '@types/mdurl@2.0.0': {}
+
+ argparse@3.0.0: {}
+
+ asciinema-player@3.17.0:
+ dependencies:
+ '@babel/runtime': 7.29.7
+ solid-js: 1.9.15
+ solid-transition-group: 0.2.3(solid-js@1.9.15)
+
+ csstype@3.2.3: {}
+
+ entities@8.0.0: {}
+
+ linkify-it@6.1.0:
+ dependencies:
+ uc.micro: 3.0.0
+
+ markdown-it-anchor@9.2.0(@types/markdown-it@14.2.0)(markdown-it@15.0.0):
+ dependencies:
+ '@types/markdown-it': 14.2.0
+ markdown-it: 15.0.0
+
+ markdown-it@15.0.0:
+ dependencies:
+ argparse: 3.0.0
+ entities: 8.0.0
+ linkify-it: 6.1.0
+ mdurl: 2.1.0
+ punycode.js: 2.3.1
+ uc.micro: 3.0.0
+
+ mdurl@2.1.0: {}
+
+ punycode.js@2.3.1: {}
+
+ seroval-plugins@1.5.6(seroval@1.5.6):
+ dependencies:
+ seroval: 1.5.6
+
+ seroval@1.5.6: {}
+
+ solid-js@1.9.15:
+ dependencies:
+ csstype: 3.2.3
+ seroval: 1.5.6
+ seroval-plugins: 1.5.6(seroval@1.5.6)
+
+ solid-transition-group@0.2.3(solid-js@1.9.15):
+ dependencies:
+ '@solid-primitives/refs': 1.1.4(solid-js@1.9.15)
+ '@solid-primitives/transition-group': 1.1.2(solid-js@1.9.15)
+ solid-js: 1.9.15
+
+ uc.micro@3.0.0: {}
diff --git a/site/public/.nojekyll b/site/public/.nojekyll
new file mode 100644
index 00000000..e69de29b
diff --git a/site/public/assets/og-image.webp b/site/public/assets/og-image.webp
new file mode 100644
index 00000000..2902acb2
Binary files /dev/null and b/site/public/assets/og-image.webp differ
diff --git a/site/public/assets/result-share-card.png b/site/public/assets/result-share-card.png
new file mode 100644
index 00000000..cb17ba17
Binary files /dev/null and b/site/public/assets/result-share-card.png differ
diff --git a/site/public/assets/social-preview.png b/site/public/assets/social-preview.png
new file mode 100644
index 00000000..bb4e4606
Binary files /dev/null and b/site/public/assets/social-preview.png differ
diff --git a/site/public/index.html b/site/public/index.html
new file mode 100644
index 00000000..a1177cf0
--- /dev/null
+++ b/site/public/index.html
@@ -0,0 +1,557 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ pi-autoresearch — Autonomous experiment loop for pi
+
+
+ Skip to content
+
+
+
+
+
+ pi-autoresearch
+
+
+
+
+
+
+
+
+ Autonomous optimization for pi
+
+ Give pi a metric.
+ Let it run.
+
+ It tests ideas, measures every result, keeps improvements, and reverts the rest.
+
+ pi install npm:pi-autoresearch
+
+
+ Runs with your user permissions. Review the source and use a dedicated branch or worktree. Security guidance →
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ How it works
+ One goal. Many measured attempts.
+ Give pi a metric and a boundary. It explores one hypothesis at a time, keeps evidence, and lets the benchmark decide.
+
+
+ Start with a measurable goal
+
+
+ /autoresearch optimize unit test runtime, monitor correctness
+
+
+ Agents get clever. Benchmarks remain unimpressed. Only measured improvements survive.
+
+
+
+
+
+ Session running
+ Unit test runtime
+
+ Run 06
+
+
+ Baseline12.84s
+
+ Best1.28s
+ −90.0%
+
+
+ RunHypothesisMetricDecision
+ 01Establish baseline12.84sbaseline
+ 02Isolate worker pool9.62skeep
+ 03Surely 12 threads is faster10.19srevert
+ 04Stop rebuilding every test file4.08skeep
+ 05Transform only the files that need it1.28skeep
+ 06Remove one more suspiciously expensive thingmeasuring running
+
+ Next hypothesis is queued from what the last run learned..auto/log.jsonl
+
+
+
+
+
+
+ Correctness first
+ Faster is only a win if the code still works.
+ Add a checks file once. Every promising experiment must pass it before the change can survive.
+
+
+
+
+
+ #!/bin/bash
+set -euo pipefail
+
+pnpm test --run
+pnpm typecheck
+pnpm lint
+
+
+
+ 01Measure first
The benchmark records its result before correctness checks begin. The primary metric stays clean.
+ 02Checks have veto power
A failed test, type check, or lint blocks the keep and reverts the experiment.
+ 03Keep the evidence
The dashboard distinguishes regressions, crashes, and check failures so the next attempt can learn from them.
+
+
+
+
+
+
+
+
+ Durable by design
+ Agents forget. The experiment doesn't.
+ Every decision is written to the project. Restarts, context resets, and auto-compaction do not erase the work.
+ A fresh agent reads the session files and continues from evidence—not a fragile memory of the conversation.
+
+
+
+
+
+
+ .auto/prompt.md
+
+ The objective, constraints, scope, tried ideas, dead ends, and key wins. The handoff for the next agent.
+
+
+
+
+
+ .auto/ideas.md
+
+
+ - Reuse transformed modules
+ - Try isolated worker pools
+ - Profile setup-file reloads
+
+ Promising ideas wait here instead of disappearing with the context window.
+
+
+
+
+
+ .auto/log.jsonl
+
+ An append-only record of every metric, commit, decision, description, and confidence score.
+
+
+
+
+
+ .auto/hooks/
+
+ before.shexperimentafter.sh
+ Fetch research before a run; persist learnings or notify afterward.
+ Read the hook contract →
+
+
+
+
+
+
+
+
+ Evidence, not optimism
+ A faster number isn't always a win. Know when it is probably noise.
+ After three runs, pi-autoresearch compares the best improvement with the session's noise floor using Median Absolute Deviation.
+
+
+
+
+ Best improvement confidence
+ 2.7×
+ Likely real
+
+
+
+ 2.0× and above
+ Likely real
+
+
+ 1.0–2.0×
+ Above noise, but marginal
+
+
+ Below 1.0×
+ Within the noise floor
+
+
+
+ Confidence is advisory. It encourages re-runs when a result is uncertain; it never discards work for you.
+
+
+
+
+
+
+ Browser dashboard
+ Watch the numbers move. Share the evidence.
+ /autoresearch export opens a live dashboard with the full experiment history. This example uses results from the Shopify Engineering case study.
+
+
+
+
+
+ Autoresearch results
+
+
+
+
+
+
+
+
+
+
+ Baseline → Best
+ 19.1s → ≈6.69s
+
+
+ Improvement
+ 65% faster
+
+
+ Runs
+ 12
+
+
+ Kept
+ 9 / 12
+
+
+
+
+
+ Normalized build runtime
+ −65%
+
+
+
+
+
+
+ RunStatusRuntime indexΔ baselineExperiment
+
+
+ 01keep100—Full VRT build baseline
+ 02keep91−9%Skip declaration emit for Storybook
+ 03discard94−6%Increase transform workers
+ 04keep82−18%Compile Storybook from source
+ 05keep76−24%Limit TypeScript transform scope
+ 06discard79−21%Disable source maps globally
+ 07keep67−33%Transform matched files only
+ 08keep59−41%Reuse resolved configuration
+ 09discard62−38%Cache all module resolution
+ 10keep48−52%Skip redundant IIFE bundle
+ 11keep41−59%Narrow component entry points
+ 12keep35−65%Transform only 105 matched files
+
+
+
+
+
+
+
+
+ Shopify Engineering case study
+ Autoresearch isn't just for training models
+ Read the story ↗
+
+
+
+
+
+
+
+
+
+ Domain agnostic
+ If you can measure it, the loop can improve it.
+ The extension provides the experiment infrastructure. Skills bring the knowledge of what to try.
+
+
+
+
+ Example optimization domains, metrics, and commands
+
+
+ Target
+ Metric
+ Example command
+
+
+
+
+ Test speed
+ Seconds ↓
+ pnpm test
+
+
+ Bundle size
+ Kilobytes ↓
+ pnpm build && du -sb dist
+
+
+ LLM training
+ Validation loss ↓
+ uv run train.py
+
+
+ Build speed
+ Seconds ↓
+ pnpm build
+
+
+ Lighthouse
+ Performance ↑
+ lighthouse http://localhost:3000
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ A clean ending
+ Experiments are messy. Your review shouldn't be.
+ /skill:autoresearch-finalize groups compatible wins and creates independent branches from the merge-base.
+ Each branch is focused, reviewable, and carries its measured improvement in the commit history.
+
+
+
+
+
+
+
+ Stay close or walk away
+ Watch the loop at the level you need.
+
+
+
+
+
+
+ Live widget
+ Every result stays visible above the pi editor while you work.
+
+
+
+
+
+ Fullscreen dashboard
+ Open a scrollable terminal view with /autoresearch dashboard. Optional shortcuts are opt-in.
+
+
+
+
+
+ Browser export
+ Open a live chart and shareable results view with /autoresearch export.
+
+
+
+
+
+
+
+
+
+ Extension points
+ The core stays small. Hooks make the loop yours.
+ Optional scripts run before or after each iteration without coupling custom behavior to the agent.
+
+
+ Fetch external research
+ Keep a learnings journal
+ Send native notifications
+ Detect idea thrashing
+ Rotate hypotheses
+ Tag meaningful wins
+
+
+
+
+
+
+ Start with one metric
+ Try an idea. Measure it.
Keep only what works.
+
+ pi install npm:pi-autoresearch
+
+
+
+ View on GitHub
+ View on npm
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/site/public/robots.txt b/site/public/robots.txt
new file mode 100644
index 00000000..5104534b
--- /dev/null
+++ b/site/public/robots.txt
@@ -0,0 +1,4 @@
+User-agent: *
+Allow: /
+
+Sitemap: https://davebcn87.github.io/pi-autoresearch/sitemap.xml
diff --git a/site/public/script.js b/site/public/script.js
new file mode 100644
index 00000000..eae08fdd
--- /dev/null
+++ b/site/public/script.js
@@ -0,0 +1,466 @@
+const reducedMotion = window.matchMedia('(prefers-reduced-motion: reduce)');
+const motionDisabled = reducedMotion.matches || new URLSearchParams(location.search).has('static');
+
+const publishedResults = {
+ polaris: {
+ subtitle: 'Polaris visual regression build',
+ baselineValue: 19.1,
+ unit: 's',
+ cards: [
+ ['Baseline → Best', '19.1s → ≈6.69s'],
+ ['Improvement', '65% faster'],
+ ['Runs', '12'],
+ ['Kept', '9 / 12'],
+ ],
+ chartLabel: 'Normalized build runtime',
+ chartChange: '−65%',
+ values: [100, 91, 94, 82, 76, 79, 67, 59, 62, 48, 41, 35],
+ statuses: ['keep', 'keep', 'discard', 'keep', 'keep', 'discard', 'keep', 'keep', 'discard', 'keep', 'keep', 'keep'],
+ descriptions: ['Full VRT build baseline', 'Skip declaration emit for Storybook', 'Increase transform workers', 'Compile Storybook from source', 'Limit TypeScript transform scope', 'Disable source maps globally', 'Transform matched files only', 'Reuse resolved configuration', 'Cache all module resolution', 'Skip redundant IIFE bundle', 'Narrow component entry points', 'Transform only 105 matched files'],
+ },
+ liquid: {
+ subtitle: 'Shopify Liquid parse and render',
+ baselineValue: 100,
+ unit: '',
+ cards: [
+ ['Baseline → Best', '100 → 47'],
+ ['Improvement', '53% faster'],
+ ['Runs', '12'],
+ ['Kept', '8 / 12'],
+ ],
+ chartLabel: 'Normalized combined parse + render time',
+ chartChange: '−53%',
+ values: [100, 93, 88, 91, 79, 73, 76, 67, 60, 55, 49, 47],
+ statuses: ['keep', 'keep', 'keep', 'discard', 'keep', 'keep', 'discard', 'keep', 'keep', 'keep', 'keep', 'keep'],
+ descriptions: ['Liquid baseline', 'Inline common parse branch', 'Reuse render buffers', 'Cache every parsed token', 'Avoid temporary arrays', 'Fast path simple variables', 'Pool all string objects', 'Reuse parser cursor', 'Lazy inspection metadata', 'Reduce node allocations', 'Compact render context', 'Final combined parse + render'],
+ },
+};
+
+initializePage();
+
+function initializePage() {
+ initializeMotion();
+ initializeCopyButtons();
+ initializeGitHubStars();
+ initializeCastPlayers();
+ initializeResultsDashboard();
+ initializeTweetEmbeds();
+}
+
+function initializeMotion() {
+ if (motionDisabled) return;
+
+ document.body.classList.add('motion-ready');
+ const revealTargets = document.querySelectorAll([
+ '.chapter .section-heading',
+ '.experiment-journal',
+ '.journal-row',
+ '.prompt-example',
+ '.file-card',
+ '.confidence-layout',
+ '.browser-dashboard',
+ '.share-showcase-copy',
+ '.social-post',
+ '.tweet-grid',
+ '.metric-table',
+ '.code-window',
+ '.guardrail-list article',
+ '.finalize-demo',
+ '.monitor-list article',
+ '.hooks-list span',
+ ].join(','));
+
+ revealTargets.forEach((target) => target.classList.add('reveal'));
+ const observer = new IntersectionObserver(revealVisibleTarget, {
+ rootMargin: '0px 0px -8% 0px',
+ threshold: 0.08,
+ });
+ revealTargets.forEach((target) => observer.observe(target));
+}
+
+function revealVisibleTarget(entries, observer) {
+ entries.forEach((entry) => {
+ if (!entry.isIntersecting) return;
+ entry.target.classList.add('is-visible');
+ observer.unobserve(entry.target);
+ });
+}
+
+function initializeCopyButtons() {
+ document.querySelectorAll('[data-copy]').forEach((button) => {
+ button.addEventListener('click', () => copyCommand(button));
+ });
+}
+
+async function copyCommand(button) {
+ const command = button.dataset.copy;
+ if (!command) return;
+
+ await writeToClipboard(command);
+ showCopiedState(button);
+}
+
+async function writeToClipboard(text) {
+ if (navigator.clipboard && window.isSecureContext) {
+ await navigator.clipboard.writeText(text);
+ return;
+ }
+
+ const input = document.createElement('textarea');
+ input.value = text;
+ input.style.position = 'fixed';
+ input.style.opacity = '0';
+ document.body.appendChild(input);
+ input.select();
+ document.execCommand('copy');
+ input.remove();
+}
+
+function showCopiedState(button) {
+ const label = button.querySelector('span');
+ button.classList.add('copied');
+ button.setAttribute('aria-label', 'Install command copied');
+ if (label) label.textContent = 'Copied';
+
+ window.setTimeout(() => restoreCopyState(button, label), 1800);
+}
+
+function restoreCopyState(button, label) {
+ button.classList.remove('copied');
+ button.setAttribute('aria-label', 'Copy install command');
+ if (label) label.textContent = 'Copy';
+}
+
+function initializeGitHubStars() {
+ fetch('https://api.github.com/repos/davebcn87/pi-autoresearch', {
+ headers: {Accept: 'application/vnd.github+json'},
+ credentials: 'omit',
+ referrerPolicy: 'no-referrer',
+ })
+ .then((response) => response.ok ? response.json() : null)
+ .then(updateGitHubStars)
+ .catch(() => undefined);
+}
+
+function updateGitHubStars(repository) {
+ const stars = repository?.stargazers_count;
+ if (!Number.isSafeInteger(stars) || stars < 0) return;
+
+ const formattedStars = new Intl.NumberFormat('en-US').format(stars);
+ document.querySelectorAll('[data-github-stars]').forEach((element) => {
+ element.textContent = formattedStars;
+ });
+ const starLink = document.querySelector('.github-star');
+ starLink?.setAttribute('aria-label', `Star pi-autoresearch on GitHub. ${formattedStars} stars.`);
+}
+
+function initializeCastPlayers() {
+ if (!window.AsciinemaPlayer) return;
+ document.querySelectorAll('[data-cast-player]').forEach(mountCastPlayer);
+}
+
+function mountCastPlayer(mount) {
+ const castPath = selectCastFor(mount);
+ const player = window.AsciinemaPlayer.create(embeddedCastSource(castPath), mount, {
+ autoPlay: !motionDisabled,
+ controls: false,
+ fit: 'width',
+ idleTimeLimit: 1.5,
+ loop: !motionDisabled,
+ poster: 'npt:10',
+ speed: 1,
+ terminalFontFamily: 'IBM Plex Mono, SFMono-Regular, Menlo, monospace',
+ terminalLineHeight: 1.45,
+ });
+
+ mount.dataset.userPaused = String(motionDisabled);
+ wireCastInteraction(mount, player);
+ if (!motionDisabled) pauseCastWhenOffscreen(mount, player);
+}
+
+function selectCastFor(mount) {
+ if (window.innerWidth <= 640 && mount.dataset.mobileCast) {
+ return mount.dataset.mobileCast;
+ }
+ return mount.dataset.desktopCast;
+}
+
+function wireCastInteraction(mount, player) {
+ updateCastInteraction(mount, !motionDisabled);
+ mount.addEventListener('click', () => toggleCastPlayback(mount, player));
+ mount.addEventListener('keydown', (event) => handleCastKeydown(event, mount, player));
+ player.addEventListener('play', () => updateCastInteraction(mount, true));
+ player.addEventListener('pause', () => updateCastInteraction(mount, false));
+ player.addEventListener('ended', () => updateCastInteraction(mount, false));
+}
+
+function handleCastKeydown(event, mount, player) {
+ if (event.key !== 'Enter' && event.key !== ' ') return;
+ event.preventDefault();
+ toggleCastPlayback(mount, player);
+}
+
+function toggleCastPlayback(mount, player) {
+ const isPlaying = mount.dataset.playing === 'true';
+ mount.dataset.userPaused = String(isPlaying);
+ if (isPlaying) {
+ player.pause();
+ return;
+ }
+ player.play();
+}
+
+function updateCastInteraction(mount, isPlaying) {
+ mount.dataset.playing = String(isPlaying);
+ mount.setAttribute('aria-pressed', String(isPlaying));
+ mount.setAttribute(
+ 'aria-label',
+ `${isPlaying ? 'Playing' : 'Paused'} interactive terminal recording. Press Space or Enter to ${isPlaying ? 'pause' : 'play'}.`,
+ );
+}
+
+function embeddedCastSource(path) {
+ const cast = window.autoresearchCasts?.[path];
+ if (!cast) return path;
+ return URL.createObjectURL(new Blob([cast], {type: 'text/plain'}));
+}
+
+function pauseCastWhenOffscreen(mount, player) {
+ const observer = new IntersectionObserver(([entry]) => {
+ if (!entry.isIntersecting) {
+ player.pause();
+ return;
+ }
+ if (mount.dataset.userPaused === 'false') player.play();
+ }, {threshold: 0.2});
+ observer.observe(mount);
+}
+
+function initializeTweetEmbeds() {
+ const section = document.querySelector('[data-tweet-section]');
+ const button = section?.querySelector('[data-load-tweets]');
+ if (!section || !button) return;
+ window.addEventListener('message', resizeSandboxedTweetEmbed);
+ button.addEventListener('click', () => loadSandboxedTweetEmbeds(section, button));
+}
+
+function loadSandboxedTweetEmbeds(section, button) {
+ const quotes = section.querySelectorAll('[data-tweet-id]');
+ quotes.forEach(replaceQuoteWithSandboxedEmbed);
+ button.remove();
+}
+
+function replaceQuoteWithSandboxedEmbed(quote) {
+ const tweetId = quote.dataset.tweetId;
+ if (!/^\d+$/.test(tweetId ?? '')) return;
+
+ const embed = document.createElement('iframe');
+ const source = new URL('https://platform.twitter.com/embed/Tweet.html');
+ source.search = new URLSearchParams({id: tweetId, theme: 'dark', dnt: 'true'});
+ embed.className = 'tweet-embed';
+ embed.dataset.tweetId = tweetId;
+ embed.src = source;
+ embed.title = `X post by ${quote.dataset.tweetAuthor ?? 'the quoted author'}`;
+ embed.loading = 'lazy';
+ embed.referrerPolicy = 'no-referrer';
+ embed.setAttribute('sandbox', 'allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox');
+ quote.replaceWith(embed);
+}
+
+function resizeSandboxedTweetEmbed(event) {
+ if (event.origin !== 'https://platform.twitter.com') return;
+ const message = event.data?.['twttr.embed'];
+ if (message?.method !== 'twttr.private.resize') return;
+
+ const resize = message.params?.[0];
+ const tweetId = resize?.data?.tweet_id;
+ const height = resize?.height;
+ if (!/^\d+$/.test(tweetId ?? '') || !isSafeEmbedHeight(height)) return;
+
+ const embed = document.querySelector(`iframe.tweet-embed[data-tweet-id="${tweetId}"]`);
+ if (!embed || embed.contentWindow !== event.source) return;
+ embed.style.height = `${Math.ceil(height)}px`;
+}
+
+function isSafeEmbedHeight(height) {
+ return Number.isFinite(height) && height >= 200 && height <= 2000;
+}
+
+function initializeResultsDashboard() {
+ const dashboard = document.querySelector('[data-results-dashboard]');
+ if (!dashboard) return;
+
+ const requestedResult = new URLSearchParams(location.search).get('result');
+ const resultName = requestedResult && Object.hasOwn(publishedResults, requestedResult)
+ ? requestedResult
+ : 'polaris';
+ const initialTab = dashboard.querySelector(`[data-dashboard-tab="${resultName}"]`);
+ dashboard.querySelectorAll('[data-dashboard-tab]').forEach((tab) => {
+ tab.addEventListener('click', () => selectPublishedResult(dashboard, tab, true));
+ });
+ selectPublishedResult(dashboard, initialTab, false);
+ if (!motionDisabled) observeDashboardPlayback(dashboard);
+}
+
+function observeDashboardPlayback(dashboard) {
+ const observer = new IntersectionObserver(([entry]) => {
+ if (!entry.isIntersecting || dashboard.dataset.played === 'true') return;
+ dashboard.dataset.played = 'true';
+ playDashboard(dashboard);
+ observer.disconnect();
+ }, {threshold: 0.2});
+ observer.observe(dashboard);
+}
+
+function selectPublishedResult(dashboard, selectedTab, shouldPlay) {
+ if (!selectedTab) return;
+ const resultName = selectedTab.dataset.dashboardTab;
+ const result = publishedResults[resultName];
+ if (!result) return;
+
+ window.clearInterval(Number(dashboard.dataset.playbackTimer));
+ dashboard.dataset.result = resultName;
+ updateDashboardTabs(dashboard, selectedTab);
+ renderDashboardState(dashboard, result, result.values.length);
+ if (shouldPlay && !motionDisabled) playDashboard(dashboard);
+}
+
+function playDashboard(dashboard) {
+ const result = publishedResults[dashboard.dataset.result];
+ if (!result) return;
+ let visibleRuns = 1;
+ dashboard.classList.add('is-live', 'is-resetting');
+ renderDashboardState(dashboard, result, visibleRuns);
+ setDashboardPlaybackState(dashboard, visibleRuns, false);
+ void dashboard.offsetWidth;
+ dashboard.classList.remove('is-resetting');
+
+ const timer = window.setInterval(() => {
+ visibleRuns += 1;
+ renderDashboardState(dashboard, result, visibleRuns);
+ const isComplete = visibleRuns >= result.values.length;
+ setDashboardPlaybackState(dashboard, visibleRuns, isComplete);
+ if (isComplete) window.clearInterval(timer);
+ }, 360);
+ dashboard.dataset.playbackTimer = String(timer);
+}
+
+function setDashboardPlaybackState(dashboard, visibleRuns, isComplete) {
+ dashboard.classList.toggle('is-live', !isComplete);
+ setText(dashboard, '[data-dashboard-state]', isComplete ? `Complete · ${visibleRuns} experiments` : `Running · experiment ${String(visibleRuns).padStart(2, '0')}`);
+ if (isComplete) setText(dashboard, '[data-dashboard-announcement]', `Autoresearch complete. ${visibleRuns} experiments logged.`);
+}
+
+function updateDashboardTabs(dashboard, selectedTab) {
+ dashboard.querySelectorAll('[data-dashboard-tab]').forEach((tab) => {
+ const isSelected = tab === selectedTab;
+ tab.classList.toggle('is-active', isSelected);
+ tab.setAttribute('aria-selected', String(isSelected));
+ });
+}
+
+function renderDashboardState(dashboard, result, visibleRuns) {
+ const currentValues = result.values.slice(0, visibleRuns);
+ const kept = result.statuses.slice(0, visibleRuns).filter((status) => status === 'keep').length;
+ const bestIndex = Math.min(...currentValues);
+ setText(dashboard, '[data-dashboard-subtitle]', result.subtitle);
+ setText(dashboard, '[data-chart-label]', result.chartLabel);
+ setText(dashboard, '[data-chart-change]', `−${100 - bestIndex}%`);
+ setText(dashboard, '[data-card-label="0"]', 'Baseline → Best');
+ setText(dashboard, '[data-card-value="0"]', formatDashboardRange(result, bestIndex));
+ setText(dashboard, '[data-card-label="1"]', 'Improvement');
+ setText(dashboard, '[data-card-value="1"]', `${100 - bestIndex}% faster`);
+ setText(dashboard, '[data-card-label="2"]', 'Runs');
+ setText(dashboard, '[data-card-value="2"]', String(visibleRuns));
+ setText(dashboard, '[data-card-label="3"]', 'Kept');
+ setText(dashboard, '[data-card-value="3"]', `${kept} / ${visibleRuns}`);
+ renderDashboardRuns(dashboard, result, visibleRuns);
+ updateDashboardChart(dashboard, result, visibleRuns);
+ animateDashboardMetrics(dashboard);
+}
+
+function animateDashboardMetrics(dashboard) {
+ if (motionDisabled || dashboard.classList.contains('is-resetting')) return;
+ dashboard.querySelectorAll('.dashboard-cards strong').forEach((value) => {
+ value.animate(
+ [{opacity: 0.55, transform: 'translateY(3px)'}, {opacity: 1, transform: 'translateY(0)'}],
+ {duration: 260, easing: 'ease-out'},
+ );
+ });
+}
+
+function formatDashboardRange(result, bestIndex) {
+ if (!result.unit) return `100 → ${bestIndex}`;
+ const bestValue = result.baselineValue * bestIndex / 100;
+ return `${result.baselineValue.toFixed(1)}${result.unit} → ${bestValue.toFixed(2)}${result.unit}`;
+}
+
+function renderDashboardRuns(dashboard, result, visibleRuns) {
+ const rows = dashboard.querySelector('[data-dashboard-run-rows]');
+ if (!rows) return;
+ rows.replaceChildren(...result.values.slice(0, visibleRuns).map((value, index) => dashboardRunRow(result, value, index)));
+}
+
+function dashboardRunRow(result, value, index) {
+ const row = document.createElement('div');
+ const status = result.statuses[index];
+ const delta = index === 0 ? '—' : `−${100 - value}%`;
+ row.className = `dashboard-result-row${index === result.values.length - 1 ? ' best-run' : ''}`;
+ row.append(
+ dashboardCell('strong', String(index + 1).padStart(2, '0')),
+ dashboardCell('span', status, `run-status ${status}`),
+ dashboardCell('span', String(value)),
+ dashboardCell('span', delta, status === 'keep' && index > 0 ? 'dashboard-good' : ''),
+ dashboardCell('span', result.descriptions[index]),
+ );
+ return row;
+}
+
+function dashboardCell(tagName, text, className = '') {
+ const cell = document.createElement(tagName);
+ cell.className = className;
+ cell.textContent = text;
+ return cell;
+}
+
+function updateDashboardChart(dashboard, result, visibleRuns) {
+ const points = chartPointsFor(result.values, result.values.length);
+ const linePath = points.map(([x, y], index) => `${index ? 'L' : 'M'}${x} ${y}`).join(' ');
+ const areaPath = `${linePath} L770 215 L40 215 Z`;
+ const progress = (visibleRuns - 1) / (result.values.length - 1);
+ dashboard.querySelector('[data-dashboard-line]').setAttribute('d', linePath);
+ dashboard.querySelector('[data-dashboard-area]').setAttribute('d', areaPath);
+ dashboard.querySelector('[data-dashboard-series]').style.clipPath = `inset(0 ${100 - progress * 100}% 0 0)`;
+ renderChartPoints(dashboard, points, result.statuses, result.values, visibleRuns);
+}
+
+function chartPointsFor(values, totalRuns) {
+ const step = 730 / (totalRuns - 1);
+ return values.map((value, index) => [40 + index * step, 215 - value * 1.8]);
+}
+
+function renderChartPoints(dashboard, points, statuses, values, visibleRuns) {
+ const group = dashboard.querySelector('[data-dashboard-points]');
+ if (!group) return;
+ const visibleValues = values.slice(0, visibleRuns);
+ const bestValue = Math.min(...visibleValues.filter((_, index) => statuses[index] === 'keep'));
+ if (group.children.length !== points.length) {
+ group.replaceChildren(...points.map(() => document.createElementNS('http://www.w3.org/2000/svg', 'circle')));
+ }
+ [...group.children].forEach((circle, index) => {
+ const [x, y] = points[index];
+ const isVisible = index < visibleRuns;
+ const isBest = isVisible && statuses[index] === 'keep' && values[index] === bestValue;
+ circle.setAttribute('cx', String(x));
+ circle.setAttribute('cy', String(y));
+ circle.setAttribute('r', isBest ? '6' : '4');
+ circle.classList.toggle('discard-point', statuses[index] === 'discard');
+ circle.classList.toggle('best-point', isBest);
+ circle.style.opacity = isVisible ? '1' : '0';
+ });
+}
+
+function setText(scope, selector, value) {
+ const element = scope.querySelector(selector);
+ if (element) element.textContent = value;
+}
diff --git a/site/public/sitemap.xml b/site/public/sitemap.xml
new file mode 100644
index 00000000..87266947
--- /dev/null
+++ b/site/public/sitemap.xml
@@ -0,0 +1,9 @@
+
+
+
+ https://davebcn87.github.io/pi-autoresearch/
+
+
+ https://davebcn87.github.io/pi-autoresearch/configuration.html
+
+
diff --git a/site/public/styles.css b/site/public/styles.css
new file mode 100644
index 00000000..d1e93d76
--- /dev/null
+++ b/site/public/styles.css
@@ -0,0 +1,2835 @@
+:root {
+ --canvas: #070a08;
+ --ink: #eafff1;
+ --secondary: rgb(226 255 237 / 68%);
+ --tertiary: rgb(216 255 230 / 58%);
+ --border: rgb(113 255 159 / 18%);
+ --strong-border: rgb(113 255 159 / 30%);
+ --tint: rgb(113 255 159 / 5%);
+ --hover: rgb(113 255 159 / 9%);
+ --dark: #040605;
+ --dark-secondary: rgb(226 255 237 / 62%);
+ --dark-tertiary: rgb(216 255 230 / 54%);
+ --dark-border: rgb(113 255 159 / 20%);
+ --green: #71ff9f;
+ --yellow: #ffd166;
+ --red: #ff6b7a;
+ --radius: 10px;
+ --shell: 1200px;
+ --text-measure: 65ch;
+ --font: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
+ --mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
+}
+
+* {
+ box-sizing: border-box;
+}
+
+html {
+ scroll-behavior: smooth;
+ scroll-padding-top: 84px;
+}
+
+body {
+ margin: 0;
+ background: var(--canvas);
+ color: var(--ink);
+ font-family: var(--font);
+ font-size: 16px;
+ line-height: 1.55;
+ color-scheme: dark;
+ text-rendering: optimizeLegibility;
+ -webkit-font-smoothing: antialiased;
+}
+
+img,
+svg {
+ display: block;
+}
+
+img {
+ max-width: 100%;
+}
+
+a {
+ color: inherit;
+ text-underline-offset: 3px;
+ text-decoration-thickness: 1px;
+}
+
+button,
+input,
+textarea,
+select {
+ font: inherit;
+}
+
+button {
+ color: inherit;
+}
+
+code,
+pre {
+ font-family: var(--mono);
+}
+
+::selection {
+ background: rgb(0 0 0 / 14%);
+}
+
+.visually-hidden {
+ position: absolute;
+ width: 1px;
+ height: 1px;
+ overflow: hidden;
+ clip: rect(0 0 0 0);
+ white-space: nowrap;
+ clip-path: inset(50%);
+}
+
+.skip-link {
+ position: fixed;
+ z-index: 100;
+ top: 12px;
+ left: 12px;
+ padding: 10px 14px;
+ border-radius: 6px;
+ background: var(--ink);
+ color: #fff;
+ transform: translateY(-150%);
+}
+
+.skip-link:focus {
+ transform: none;
+}
+
+.shell {
+ width: min(calc(100% - 80px), var(--shell));
+ margin-inline: auto;
+}
+
+.site-header {
+ position: sticky;
+ z-index: 20;
+ top: 0;
+ background: rgb(7 10 8 / 90%);
+ border-bottom: 1px solid var(--border);
+ backdrop-filter: blur(18px);
+}
+
+.header-inner {
+ min-height: 68px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 32px;
+}
+
+.wordmark {
+ display: inline-flex;
+ align-items: center;
+ gap: 10px;
+ font-size: 15px;
+ color: #dffff0;
+ font-weight: 600;
+ text-decoration: none;
+ letter-spacing: -0.015em;
+}
+
+.wordmark-logo {
+ width: 32px;
+ height: 32px;
+ border-radius: 7px;
+ object-fit: cover;
+}
+
+.nav {
+ display: flex;
+ align-items: center;
+ gap: 28px;
+ color: var(--secondary);
+ font-size: 14px;
+ font-weight: 500;
+}
+
+.nav a {
+ text-decoration: none;
+}
+
+.nav a:hover {
+ color: var(--ink);
+}
+
+.nav-github {
+ min-height: 44px;
+ display: inline-flex;
+ align-items: center;
+ padding: 7px 14px;
+ border: 1px solid var(--strong-border);
+ border-radius: 7px;
+ background: var(--tint);
+ color: var(--ink);
+}
+
+.hero {
+ min-height: calc(100svh - 68px);
+ padding-top: 80px;
+ padding-bottom: 96px;
+ display: grid;
+ grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
+ align-items: center;
+ gap: clamp(48px, 6vw, 84px);
+}
+
+.hero-copy {
+ max-width: 500px;
+}
+
+.eyebrow {
+ margin: 0 0 22px;
+ color: #71ff9f;
+ font-family: var(--mono);
+ font-size: 14px;
+ font-weight: 500;
+ letter-spacing: -0.02em;
+}
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ overflow-wrap: normal;
+ word-break: normal;
+ hyphens: none;
+ text-wrap: balance;
+}
+
+p {
+ text-wrap: pretty;
+}
+
+h1,
+h2 {
+ margin: 0;
+ font-weight: 500;
+ letter-spacing: -0.045em;
+}
+
+h1 {
+ max-width: 560px;
+ font-size: clamp(3.35rem, 5vw, 4.8rem);
+ line-height: 0.99;
+}
+
+.hero h1 span {
+ display: block;
+}
+
+h1 span {
+ color: #71ff9f;
+}
+
+h2 span,
+.closing h2 span {
+ color: rgb(113 255 159 / 58%);
+}
+
+.hero-intro {
+ max-width: 680px;
+ margin: 36px 0 0;
+ color: var(--secondary);
+ font-size: clamp(1.1rem, 1.6vw, 1.3rem);
+ line-height: 1.55;
+}
+
+.install {
+ width: min(100%, 510px);
+ min-height: 58px;
+ margin-top: 40px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 20px;
+ padding: 8px 8px 8px 18px;
+ border: 1px solid var(--strong-border);
+ border-radius: 9px;
+ background: #0d120f;
+}
+
+.install code {
+ overflow: hidden;
+ font-size: 14px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.install code span {
+ margin-right: 7px;
+ color: var(--tertiary);
+}
+
+.copy-button {
+ min-width: 90px;
+ min-height: 44px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ padding: 0 13px;
+ border: 0;
+ border-radius: 6px;
+ background: #71ff9f;
+ color: #041008;
+ cursor: pointer;
+ font-size: 13px;
+ font-weight: 500;
+ transition: background 140ms ease, transform 120ms ease;
+}
+
+.copy-button svg {
+ width: 15px;
+ fill: none;
+ stroke: currentColor;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 1.7;
+}
+
+.copy-button:hover {
+ background: #9affba;
+}
+
+.copy-button:active {
+ transform: scale(0.97);
+}
+
+.copy-button.copied {
+ background: #67e8ff;
+ color: #031014;
+}
+
+button:focus-visible,
+a:focus-visible,
+.terminal-player:focus-visible {
+ outline: 2px solid #67e8ff;
+ outline-offset: 3px;
+}
+
+.install-safety {
+ max-width: 68ch;
+ margin: 14px 0 0;
+ color: var(--tertiary);
+ font-size: 12px;
+ line-height: 1.55;
+}
+
+.install-safety strong {
+ color: var(--secondary);
+ font-weight: 500;
+}
+
+.hero-meta {
+ margin-top: 14px;
+ display: flex;
+ align-items: center;
+ gap: 16px;
+}
+
+.github-star {
+ min-height: 44px;
+ display: inline-flex;
+ align-items: center;
+ gap: 8px;
+ padding: 0 12px;
+ border: 1px solid var(--strong-border);
+ border-radius: 7px;
+ background: var(--tint);
+ font-size: 12px;
+ font-weight: 500;
+ text-decoration: none;
+}
+
+.github-star svg {
+ width: 16px;
+ fill: none;
+ stroke: currentColor;
+ stroke-linejoin: round;
+ stroke-width: 1.6;
+}
+
+.github-star strong {
+ margin-left: 3px;
+ padding-left: 10px;
+ border-left: 1px solid var(--border);
+ font-family: var(--mono);
+ font-size: 11px;
+ font-weight: 500;
+}
+
+.github-star:hover {
+ background: var(--hover);
+}
+
+.hero-note {
+ margin: 0;
+ color: var(--tertiary);
+ font-size: 12px;
+}
+
+.product-frame {
+ margin: 68px 0 0;
+}
+
+.hero .product-frame {
+ margin: 0;
+}
+
+.terminal-figure {
+ position: relative;
+}
+
+.terminal-player-frame {
+ position: relative;
+ overflow: hidden;
+ border: 1px solid rgb(0 0 0 / 14%);
+ border-radius: 12px;
+ background: #282c34;
+ box-shadow:
+ 0 28px 72px rgb(8 72 43 / 22%),
+ 0 8px 28px rgb(4 44 25 / 18%);
+}
+
+.terminal-chrome {
+ min-height: 42px;
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ align-items: center;
+ padding: 0 14px;
+ border-bottom: 1px solid rgb(255 255 255 / 8%);
+ background: #21252b;
+ color: rgb(255 255 255 / 52%);
+ font-family: var(--mono);
+ font-size: 11px;
+}
+
+.terminal-lights {
+ display: flex;
+ gap: 7px;
+}
+
+.terminal-lights i {
+ width: 9px;
+ height: 9px;
+ border-radius: 50%;
+ background: #e06c75;
+}
+
+.terminal-lights i:nth-child(2) { background: #e5c07b; }
+.terminal-lights i:nth-child(3) { background: #98c379; }
+
+.terminal-shell {
+ justify-self: end;
+ color: rgb(255 255 255 / 32%);
+}
+
+.terminal-player {
+ background: #282c34;
+ cursor: pointer;
+}
+
+.terminal-player .ap-wrapper {
+ background: #282c34;
+ font-family: var(--mono);
+}
+
+.terminal-player .ap-player {
+ max-width: none;
+}
+
+.terminal-player .ap-overlay-start {
+ pointer-events: none;
+}
+
+.terminal-player .ap-overlay-start .ap-play-button {
+ display: none;
+}
+
+.terminal-player .ap-terminal {
+ padding: 18px;
+}
+
+.chapter {
+ padding-block: 128px;
+}
+
+.chapter-tint {
+ background: var(--tint);
+}
+
+.section-heading {
+ max-width: 770px;
+}
+
+.section-heading h2,
+.closing h2 {
+ font-size: clamp(2.6rem, 5vw, 4.7rem);
+ line-height: 1.06;
+}
+
+.section-heading > p:not(.eyebrow) {
+ max-width: var(--text-measure);
+ margin: 30px 0 0;
+ color: var(--secondary);
+ font-size: 18px;
+}
+
+.section-heading .detail {
+ margin-top: 20px !important;
+ color: var(--tertiary) !important;
+ font-size: 15px !important;
+}
+
+.process-journal-layout {
+ display: grid;
+ grid-template-columns: minmax(0, 0.78fr) minmax(560px, 1.22fr);
+ align-items: center;
+ gap: clamp(64px, 8vw, 120px);
+}
+
+.process-story .section-heading h2 {
+ font-size: clamp(2.8rem, 4.2vw, 4.2rem);
+}
+
+.process-prompt {
+ margin-top: 42px;
+}
+
+.process-prompt > p {
+ margin: 0 0 12px;
+ color: var(--tertiary);
+ font-size: 12px;
+ font-weight: 500;
+}
+
+.process-story .prompt-example {
+ margin: 0;
+}
+
+.process-assurance {
+ max-width: 48ch;
+ margin: 20px 0 0;
+ color: var(--tertiary);
+ font-size: 13px;
+}
+
+.experiment-journal {
+ margin: 0;
+ overflow: hidden;
+ border: 1px solid var(--border);
+ border-radius: 12px;
+ background: #0c110e;
+}
+
+.journal-header {
+ min-height: 86px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 24px;
+ padding: 18px 22px;
+ border-bottom: 1px solid var(--border);
+}
+
+.journal-header h3 {
+ margin: 6px 0 0;
+ font-size: 17px;
+ font-weight: 500;
+}
+
+.journal-live {
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ color: var(--tertiary);
+ font-size: 11px;
+}
+
+.journal-live i,
+.journal-running i {
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ background: #71ff9f;
+}
+
+.journal-run-count {
+ color: var(--tertiary);
+ font-family: var(--mono);
+ font-size: 12px;
+}
+
+.journal-progress {
+ min-height: 116px;
+ display: grid;
+ grid-template-columns: auto 24px auto 1fr;
+ align-items: center;
+ gap: 16px;
+ padding: 22px;
+ border-bottom: 1px solid var(--border);
+}
+
+.journal-progress span:not(.journal-progress-arrow) {
+ font-family: var(--mono);
+ font-size: 24px;
+}
+
+.journal-progress small {
+ display: block;
+ margin-bottom: 5px;
+ color: var(--tertiary);
+ font-family: var(--font);
+ font-size: 10px;
+}
+
+.journal-progress-arrow {
+ color: var(--tertiary);
+}
+
+.journal-progress strong {
+ justify-self: end;
+ color: #71ff9f;
+ font-family: var(--mono);
+ font-size: 20px;
+ font-weight: 500;
+}
+
+.journal-row {
+ min-height: 52px;
+ display: grid;
+ grid-template-columns: 42px minmax(180px, 1fr) 80px 72px;
+ align-items: center;
+ gap: 12px;
+ padding: 0 22px;
+ border-bottom: 1px solid var(--border);
+ color: var(--secondary);
+ font-size: 12px;
+}
+
+.journal-labels {
+ min-height: 38px;
+ color: var(--tertiary);
+ font-size: 10px;
+}
+
+.journal-row > :first-child,
+.journal-row > :nth-child(3) {
+ font-family: var(--mono);
+}
+
+.journal-row:not(.journal-labels) > :nth-child(2) {
+ color: var(--ink);
+ font-size: 15px;
+ font-weight: 500;
+ letter-spacing: -0.015em;
+}
+
+.journal-row strong {
+ font-family: var(--mono);
+ font-size: 11px;
+ font-weight: 500;
+}
+
+.journal-neutral { color: var(--tertiary); }
+.journal-keep { color: #71ff9f; }
+.journal-revert { color: #ffd166; }
+
+.journal-running {
+ background: var(--tint);
+}
+
+.journal-running strong {
+ display: flex;
+ align-items: center;
+ gap: 6px;
+ color: var(--secondary);
+}
+
+.journal-running i,
+.journal-live i {
+ animation: journal-pulse 1.4s ease-in-out infinite;
+}
+
+.experiment-journal figcaption {
+ min-height: 58px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 20px;
+ padding: 14px 22px;
+ color: var(--tertiary);
+ font-size: 11px;
+}
+
+.experiment-journal figcaption code {
+ color: var(--secondary);
+ font-size: 10px;
+}
+
+@keyframes journal-pulse {
+ 0%, 100% { opacity: 0.35; }
+ 50% { opacity: 1; }
+}
+
+.monitor-list h3 {
+ margin: 30px 0 0;
+ font-size: 19px;
+ font-weight: 500;
+ letter-spacing: -0.02em;
+}
+
+.monitor-list p {
+ margin: 10px 0 0;
+ color: var(--secondary);
+ font-size: 14px;
+}
+
+.prompt-example {
+ min-height: 72px;
+ display: flex;
+ align-items: center;
+ gap: 16px;
+ margin-top: 20px;
+ padding: 18px 22px;
+ border: 1px solid var(--strong-border);
+ border-radius: var(--radius);
+ background: #030504;
+ color: #fff;
+}
+
+.prompt-example code {
+ overflow: hidden;
+ color: rgb(255 255 255 / 82%);
+ font-size: 14px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.prompt-mark {
+ flex: 0 0 auto;
+ color: rgb(255 255 255 / 46%);
+ font-family: var(--mono);
+ font-size: 22px;
+}
+
+.split {
+ display: grid;
+ grid-template-columns: minmax(0, 0.85fr) minmax(440px, 1fr);
+ align-items: start;
+ gap: clamp(70px, 10vw, 150px);
+}
+
+.split-memory {
+ grid-template-columns: minmax(300px, 0.62fr) minmax(0, 1.38fr);
+ gap: clamp(56px, 7vw, 96px);
+}
+
+.split-memory .section-heading h2 {
+ font-size: clamp(2.5rem, 3.6vw, 3.35rem);
+}
+
+.sticky-copy {
+ position: sticky;
+ top: 120px;
+}
+
+.file-stack {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 16px;
+}
+
+.file-card {
+ min-height: 250px;
+ display: flex;
+ flex-direction: column;
+ padding: 24px;
+ border: 1px solid var(--border);
+ border-radius: var(--radius);
+ background: #0c110e;
+}
+
+.file-card header {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ font-weight: 500;
+}
+
+.file-card header svg {
+ width: 20px;
+ fill: none;
+ stroke: currentColor;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 1.5;
+}
+
+.file-card p {
+ margin: auto 0 0;
+ color: var(--secondary);
+ font-size: 14px;
+}
+
+.file-preview {
+ margin: 28px 0 24px;
+ padding: 0;
+ list-style: none;
+}
+
+.file-preview li {
+ padding: 7px 0;
+ border-bottom: 1px solid var(--border);
+ color: var(--secondary);
+ font-family: var(--mono);
+ font-size: 11px;
+}
+
+.file-preview li::before {
+ margin-right: 8px;
+ color: var(--tertiary);
+ content: "–";
+}
+
+.hook-preview {
+ margin: 30px 0 24px;
+ display: grid;
+ grid-template-columns: 1fr auto 1fr;
+ align-items: center;
+ gap: 8px;
+ color: var(--secondary);
+ font-size: 10px;
+ text-align: center;
+}
+
+.hook-preview code {
+ padding: 8px 6px;
+ border: 1px solid var(--border);
+ border-radius: 6px;
+ background: var(--tint);
+ font-size: 10px;
+}
+
+.hook-preview span::before,
+.hook-preview span::after {
+ color: var(--tertiary);
+ content: "→";
+}
+
+.hook-preview span::before { margin-right: 5px; }
+.hook-preview span::after { margin-left: 5px; }
+
+.hooks-file > a {
+ margin-top: 14px;
+ color: var(--secondary);
+ font-size: 12px;
+ font-weight: 500;
+}
+
+.chapter-dark {
+ background: var(--dark);
+ color: #fff;
+}
+
+.section-heading-light h2 span,
+.closing h2 span {
+ color: var(--dark-secondary);
+}
+
+.section-heading-light .eyebrow {
+ color: var(--dark-secondary);
+}
+
+.section-heading-light > p:not(.eyebrow) {
+ color: var(--dark-secondary);
+}
+
+.confidence-layout {
+ margin-top: 76px;
+ display: grid;
+ grid-template-columns: 0.8fr 1.2fr;
+ gap: 1px;
+ border: 1px solid var(--dark-border);
+ border-radius: 12px;
+ background: var(--dark-border);
+ overflow: hidden;
+}
+
+.confidence-score,
+.confidence-scale {
+ background: var(--dark);
+}
+
+.confidence-score {
+ min-height: 340px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding: 36px;
+}
+
+.confidence-label {
+ color: var(--dark-secondary);
+ font-size: 14px;
+}
+
+.confidence-score strong {
+ font-family: var(--mono);
+ font-size: clamp(4.5rem, 10vw, 8rem);
+ font-weight: 400;
+ letter-spacing: -0.08em;
+ line-height: 1;
+}
+
+.confidence-result {
+ display: flex;
+ align-items: center;
+ gap: 9px;
+ font-size: 14px;
+}
+
+.confidence-result i {
+ width: 8px;
+ height: 8px;
+ border-radius: 50%;
+ background: var(--green);
+}
+
+.confidence-scale {
+ padding: 18px 36px;
+}
+
+.scale-row {
+ min-height: 101px;
+ display: grid;
+ grid-template-columns: minmax(160px, 0.8fr) 1fr;
+ align-items: center;
+ gap: 24px;
+ border-bottom: 1px solid var(--dark-border);
+}
+
+.scale-row:last-child {
+ border: 0;
+}
+
+.scale-row span {
+ display: flex;
+ align-items: center;
+ gap: 10px;
+ color: var(--dark-secondary);
+ font-family: var(--mono);
+ font-size: 13px;
+}
+
+.scale-row strong {
+ font-size: 15px;
+ font-weight: 500;
+}
+
+.status-dot {
+ width: 8px;
+ height: 8px;
+ flex: 0 0 auto;
+ border-radius: 50%;
+}
+
+.status-good {
+ background: var(--green);
+}
+
+.status-warn {
+ background: var(--yellow);
+}
+
+.status-bad {
+ background: var(--red);
+}
+
+.dark-note {
+ max-width: 690px;
+ margin: 24px 0 0;
+ color: var(--dark-tertiary);
+ font-size: 13px;
+}
+
+.browser-dashboard-section {
+ background: var(--canvas);
+}
+
+.browser-dashboard-section .section-heading code {
+ font-size: 0.82em;
+}
+
+.browser-dashboard {
+ margin-top: 72px;
+ padding: 30px;
+ border-radius: 12px;
+ background: #0d1117;
+ color: #f0f3f6;
+}
+
+.dashboard-header {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 32px;
+}
+
+.dashboard-header h3 {
+ margin: 0;
+ font-size: 21px;
+ font-weight: 500;
+ letter-spacing: -0.025em;
+}
+
+.dashboard-header p {
+ margin: 0;
+ color: rgb(255 255 255 / 52%);
+ font-size: 13px;
+}
+
+.dashboard-session-meta {
+ margin-top: 7px;
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.dashboard-live {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ color: rgb(255 255 255 / 42%);
+ font-size: 10px;
+}
+
+.dashboard-live i {
+ width: 6px;
+ height: 6px;
+ border-radius: 50%;
+ background: #56d47f;
+}
+
+.browser-dashboard.is-live .dashboard-live i {
+ animation: journal-pulse 900ms ease-in-out infinite;
+}
+
+.dashboard-tabs {
+ display: flex;
+ gap: 4px;
+ padding: 4px;
+ border: 1px solid rgb(255 255 255 / 10%);
+ border-radius: 9px;
+ background: rgb(255 255 255 / 5%);
+}
+
+.dashboard-tab {
+ min-height: 38px;
+ padding: 0 14px;
+ border: 0;
+ border-radius: 6px;
+ background: transparent;
+ color: rgb(255 255 255 / 56%);
+ cursor: pointer;
+ font-size: 12px;
+ font-weight: 500;
+}
+
+.dashboard-tab:hover {
+ color: #fff;
+}
+
+.dashboard-tab.is-active {
+ background: #f0f3f6;
+ color: #0d1117;
+}
+
+.dashboard-cards {
+ margin-top: 28px;
+ display: grid;
+ grid-template-columns: repeat(4, 1fr);
+ gap: 10px;
+}
+
+.dashboard-cards article {
+ min-height: 126px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding: 18px;
+ border: 1px solid rgb(255 255 255 / 10%);
+ border-radius: 9px;
+ background: #161b22;
+}
+
+.dashboard-cards span {
+ color: rgb(255 255 255 / 48%);
+ font-size: 11px;
+}
+
+.dashboard-cards strong {
+ font-family: var(--mono);
+ font-size: clamp(1.25rem, 2.2vw, 2rem);
+ font-weight: 500;
+ letter-spacing: -0.045em;
+}
+
+.dashboard-cards article:first-child strong {
+ font-size: clamp(1rem, 1.5vw, 1.4rem);
+}
+
+.dashboard-good {
+ color: #56d47f !important;
+}
+
+.dashboard-chart {
+ margin-top: 12px;
+ padding: 22px 22px 10px;
+ border: 1px solid rgb(255 255 255 / 10%);
+ border-radius: 9px;
+ background: #161b22;
+}
+
+.chart-labels {
+ display: flex;
+ justify-content: space-between;
+ gap: 24px;
+ color: rgb(255 255 255 / 52%);
+ font-size: 12px;
+}
+
+.chart-labels span:last-child {
+ color: #56d47f;
+ font-family: var(--mono);
+ font-weight: 500;
+}
+
+.dashboard-chart svg {
+ width: 100%;
+ height: auto;
+ margin-top: 8px;
+ overflow: visible;
+}
+
+.chart-grid path {
+ fill: none;
+ stroke: rgb(255 255 255 / 7%);
+ stroke-width: 1;
+}
+
+.chart-series {
+ clip-path: inset(0 0 0 0);
+ transition: clip-path 340ms ease-in-out;
+}
+
+.chart-area {
+ fill: rgb(86 212 127 / 6%);
+ stroke: none;
+ opacity: 1;
+ transition: d 360ms ease-in-out, opacity 320ms ease;
+}
+
+.browser-dashboard.is-live .chart-area {
+ opacity: 0;
+}
+
+.chart-line {
+ fill: none;
+ stroke: #7caeff;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 3;
+ vector-effect: non-scaling-stroke;
+ transition: d 360ms ease-in-out;
+}
+
+.chart-points circle {
+ fill: #161b22;
+ stroke: #7caeff;
+ stroke-width: 3;
+ transform-box: fill-box;
+ transform-origin: center;
+ transition: cx 360ms ease-in-out, cy 360ms ease-in-out, opacity 220ms ease, r 220ms ease;
+}
+
+.chart-points .discard-point {
+ fill: #161b22;
+ stroke: #e3b341;
+}
+
+.chart-points .best-point {
+ fill: #56d47f;
+ stroke: #0d1117;
+ stroke-width: 4;
+}
+
+.chart-axis text {
+ fill: rgb(255 255 255 / 38%);
+ font-family: var(--mono);
+ font-size: 11px;
+}
+
+.browser-dashboard.is-resetting .chart-series,
+.browser-dashboard.is-resetting .chart-line,
+.browser-dashboard.is-resetting .chart-points circle,
+.browser-dashboard.is-resetting .chart-area {
+ transition: none;
+}
+
+.dashboard-results-table {
+ height: 620px;
+ margin-top: 12px;
+ border: 1px solid rgb(255 255 255 / 10%);
+ border-radius: 9px;
+ overflow: hidden;
+}
+
+.dashboard-result-row {
+ min-width: 720px;
+ min-height: 48px;
+ display: grid;
+ grid-template-columns: 50px 90px 120px 110px minmax(240px, 1fr);
+ align-items: center;
+ gap: 16px;
+ padding: 0 18px;
+ border-top: 1px solid rgb(255 255 255 / 8%);
+ color: rgb(255 255 255 / 62%);
+ font-family: var(--mono);
+ font-size: 12px;
+}
+
+.dashboard-result-row:last-child:not(.dashboard-result-header) {
+ animation: dashboard-row-in 240ms ease-out both;
+}
+
+@keyframes dashboard-row-in {
+ from { opacity: 0; transform: translateY(5px); }
+ to { opacity: 1; transform: none; }
+}
+
+.dashboard-result-row strong {
+ color: #f0f3f6;
+ font-weight: 500;
+}
+
+.run-status.keep {
+ color: #56d47f;
+}
+
+.run-status.discard {
+ color: #e3b341;
+}
+
+.best-run {
+ background: rgb(86 212 127 / 6%);
+}
+
+.dashboard-result-header {
+ position: sticky;
+ z-index: 2;
+ top: 0;
+ min-height: 38px;
+ border-top: 0;
+ background: rgb(0 0 0 / 16%);
+ color: rgb(255 255 255 / 42%);
+ font-family: var(--font);
+ font-size: 10px;
+}
+
+.dashboard-source {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 24px;
+ margin-top: 20px;
+ color: rgb(255 255 255 / 42%);
+ font-size: 11px;
+}
+
+.dashboard-source a {
+ color: rgb(255 255 255 / 62%);
+}
+
+.dashboard-source a:hover {
+ color: #fff;
+}
+
+.share-showcase {
+ margin-top: 104px;
+ display: grid;
+ grid-template-columns: minmax(240px, 0.65fr) minmax(520px, 1.35fr);
+ align-items: center;
+ gap: clamp(56px, 8vw, 112px);
+}
+
+.share-showcase > * {
+ min-width: 0;
+}
+
+.share-showcase-copy h3 {
+ margin: 0;
+ overflow-wrap: normal;
+ font-size: clamp(2.2rem, 4vw, 3.7rem);
+ font-weight: 500;
+ letter-spacing: -0.045em;
+ line-height: 1.06;
+}
+
+.share-showcase-copy h3 span {
+ color: var(--secondary);
+}
+
+.share-showcase-copy > p:not(.eyebrow) {
+ margin: 24px 0 0;
+ color: var(--secondary);
+}
+
+.share-showcase-copy > code {
+ display: block;
+ margin-top: 24px;
+ color: var(--tertiary);
+ font-size: 12px;
+}
+
+.social-post {
+ position: relative;
+ padding: 26px;
+ border: 1px solid var(--strong-border);
+ border-radius: 14px;
+ background: #0c110e;
+}
+
+.social-post-label {
+ position: absolute;
+ top: 26px;
+ right: 26px;
+ color: var(--secondary);
+ font-size: 11px;
+}
+
+.social-post header {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+}
+
+.social-post header img {
+ width: 42px;
+ height: 42px;
+ border-radius: 50%;
+ object-fit: cover;
+}
+
+.social-post header div {
+ display: grid;
+}
+
+.social-post header strong {
+ font-size: 14px;
+ font-weight: 600;
+}
+
+.social-post header div span {
+ color: var(--tertiary);
+ font-size: 12px;
+}
+
+.social-post-more {
+ display: none;
+}
+
+.social-post > p {
+ max-width: 56ch;
+ margin: 20px 0;
+ font-size: 16px;
+ line-height: 1.5;
+}
+
+.social-post-media {
+ width: 100%;
+ height: auto;
+ display: block;
+ aspect-ratio: 1200 / 630;
+ border: 1px solid var(--strong-border);
+ border-radius: 10px;
+ object-fit: contain;
+}
+
+.social-post footer {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ max-width: 420px;
+ margin-top: 18px;
+ color: var(--tertiary);
+}
+
+.social-post footer svg {
+ width: 18px;
+ fill: none;
+ stroke: currentColor;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 1.5;
+}
+
+.case-study-link {
+ margin-top: 38px;
+ display: grid;
+ grid-template-columns: 0.8fr 1.7fr auto;
+ align-items: center;
+ gap: 28px;
+ padding: 26px 0;
+ border-top: 1px solid var(--strong-border);
+ border-bottom: 1px solid var(--strong-border);
+ text-decoration: none;
+}
+
+.case-study-link > span {
+ color: var(--tertiary);
+ font-size: 12px;
+}
+
+.case-study-link > span:last-child {
+ color: var(--ink);
+ text-align: right;
+}
+
+.case-study-link strong {
+ font-size: 17px;
+ font-weight: 500;
+ letter-spacing: -0.02em;
+}
+
+.case-study-link:hover strong {
+ text-decoration: underline;
+ text-underline-offset: 4px;
+}
+
+.tweet-grid {
+ margin-top: 72px;
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ align-items: start;
+ gap: 24px;
+}
+
+.tweet-grid blockquote.twitter-tweet {
+ width: 100% !important;
+ min-height: 260px;
+ margin: 0 !important;
+ padding: 30px;
+ border: 1px solid var(--border);
+ border-radius: 10px;
+ background: #0c110e;
+}
+
+.tweet-grid blockquote.twitter-tweet p {
+ margin: 0;
+ color: var(--ink);
+ font-size: 18px;
+ line-height: 1.55;
+}
+
+.tweet-grid blockquote.twitter-tweet footer {
+ margin-top: 34px;
+ color: var(--tertiary);
+ font-size: 13px;
+}
+
+.tweet-grid iframe {
+ width: 100% !important;
+ height: 520px;
+ max-width: none !important;
+ margin: 0 !important;
+ border: 0 !important;
+ border-radius: 14px;
+ background: #0c110e;
+ clip-path: inset(1px round 14px);
+}
+
+.authority-footer {
+ margin-top: 30px;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 32px;
+}
+
+.authority-note {
+ max-width: 760px;
+ margin: 0;
+ color: var(--tertiary);
+ font-size: 13px;
+}
+
+.load-tweets {
+ min-height: 44px;
+ flex: 0 0 auto;
+ padding: 0 14px;
+ border: 1px solid var(--strong-border);
+ border-radius: 7px;
+ background: var(--tint);
+ color: var(--ink);
+ cursor: pointer;
+ font-size: 12px;
+ font-weight: 500;
+}
+
+.load-tweets:hover {
+ background: var(--hover);
+}
+
+.load-tweets:disabled {
+ color: var(--tertiary);
+ cursor: wait;
+}
+
+@media (hover: hover) and (pointer: fine) {
+ .dashboard-tab {
+ transition: background 140ms ease, color 140ms ease;
+ }
+}
+
+.metric-table-scroll {
+ margin-top: 72px;
+ overflow-x: auto;
+ border-top: 1px solid var(--strong-border);
+}
+
+.metric-table {
+ width: 100%;
+ border-collapse: collapse;
+ table-layout: fixed;
+}
+
+.metric-table th,
+.metric-table td {
+ height: 75px;
+ padding: 14px 16px;
+ border-bottom: 1px solid var(--border);
+ text-align: left;
+ vertical-align: middle;
+}
+
+.metric-table th:first-child {
+ width: 29%;
+}
+
+.metric-table th:nth-child(2) {
+ width: 24%;
+}
+
+.metric-table tbody tr:nth-child(even) {
+ background: rgb(0 0 0 / 2.5%);
+}
+
+.metric-table tbody th {
+ font-weight: 500;
+}
+
+.metric-table td {
+ color: var(--secondary);
+}
+
+.metric-table code {
+ overflow: hidden;
+ display: block;
+ color: #67e8ff;
+ font-size: 13px;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+}
+
+.metric-header {
+ color: var(--tertiary);
+ font-size: 12px;
+ font-weight: 500;
+}
+
+.metric-header th {
+ height: 52px;
+ font-weight: 500;
+}
+
+.guardrail-heading {
+ max-width: 880px;
+}
+
+.guardrail-body {
+ margin-top: 76px;
+ display: grid;
+ grid-template-columns: minmax(360px, 0.8fr) minmax(0, 1.2fr);
+ align-items: start;
+ gap: clamp(64px, 9vw, 128px);
+}
+
+.code-window {
+ overflow: hidden;
+ border: 1px solid var(--strong-border);
+ border-radius: 12px;
+ background: #020403;
+ color: rgb(255 255 255 / 82%);
+}
+
+.code-window-bar {
+ min-height: 44px;
+ display: flex;
+ align-items: center;
+ gap: 7px;
+ padding-inline: 18px;
+ border-bottom: 1px solid var(--border);
+ background: #090d0a;
+}
+
+.code-window-bar span {
+ width: 7px;
+ height: 7px;
+ border-radius: 50%;
+ background: rgb(255 255 255 / 24%);
+}
+
+.code-window-bar small {
+ margin-left: auto;
+ color: rgb(255 255 255 / 48%);
+ font-family: var(--mono);
+}
+
+.code-window pre {
+ margin: 0;
+ padding: 24px 26px 28px;
+ font-size: 14px;
+ line-height: 1.9;
+}
+
+.code-muted {
+ color: rgb(255 255 255 / 44%);
+}
+
+.guardrail-list {
+ border-top: 1px solid var(--dark-border);
+}
+
+.guardrail-list article {
+ min-height: 128px;
+ display: grid;
+ grid-template-columns: 44px 1fr;
+ align-items: start;
+ gap: 20px;
+ padding: 26px 0;
+ border-bottom: 1px solid var(--dark-border);
+}
+
+.guardrail-list article > span {
+ padding-top: 3px;
+ color: var(--dark-tertiary);
+ font-family: var(--mono);
+ font-size: 11px;
+}
+
+.guardrail-list h3 {
+ margin: 0;
+ color: #fff;
+ font-size: 18px;
+ font-weight: 500;
+ letter-spacing: -0.02em;
+}
+
+.guardrail-list p {
+ max-width: 58ch;
+ margin: 9px 0 0;
+ color: var(--dark-secondary);
+ font-size: 14px;
+}
+
+.guardrails-section .guardrail-docs-link a {
+ color: var(--dark-secondary);
+}
+
+.guardrails-section .guardrail-docs-link a:hover {
+ color: #fff;
+}
+
+.finalize-layout {
+ grid-template-columns: 1.1fr 0.9fr;
+ align-items: center;
+}
+
+.finalize-demo {
+ width: 100%;
+ margin: 0;
+}
+
+.finalize-demo .terminal-player-frame {
+ border-color: var(--strong-border);
+}
+
+.monitor-section .section-heading {
+ max-width: 820px;
+}
+
+.monitor-list {
+ margin-top: 72px;
+ display: grid;
+ gap: 0;
+}
+
+.monitor-list article {
+ min-height: 136px;
+ display: grid;
+ grid-template-columns: 56px 1fr;
+ align-items: center;
+ gap: 24px;
+ border-top: 1px solid var(--border);
+}
+
+.monitor-list article:last-child {
+ border-bottom: 1px solid var(--border);
+}
+
+.monitor-list svg {
+ width: 28px;
+ fill: none;
+ stroke: currentColor;
+ stroke-linecap: round;
+ stroke-linejoin: round;
+ stroke-width: 1.35;
+}
+
+.monitor-list h3 {
+ margin: 0;
+}
+
+.monitor-list p {
+ max-width: 650px;
+}
+
+.monitor-list code,
+.hooks-section code,
+.finalize-layout code {
+ font-size: 0.88em;
+}
+
+.hooks-layout {
+ align-items: center;
+}
+
+.hooks-list {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 12px;
+}
+
+.hooks-list span {
+ min-height: 64px;
+ display: flex;
+ align-items: center;
+ padding: 12px 16px;
+ border: 1px solid var(--border);
+ border-radius: 8px;
+ background: #0c110e;
+ color: var(--secondary);
+ font-size: 14px;
+}
+
+.closing {
+ padding-block: 128px;
+}
+
+.closing-inner {
+ display: flex;
+ flex-direction: column;
+ align-items: flex-start;
+}
+
+.closing h2 {
+ max-width: 850px;
+}
+
+.install-light {
+ border-color: var(--dark-border);
+ background: rgb(255 255 255 / 9%);
+}
+
+.install-light code {
+ color: #fff;
+}
+
+.install-light code span {
+ color: var(--dark-tertiary);
+}
+
+.install-light .copy-button {
+ background: #fff;
+ color: #000;
+}
+
+.install-light .copy-button:hover {
+ background: #e5e5e5;
+}
+
+.install-light .copy-button.copied {
+ background: #c9f2d5;
+}
+
+.closing-links {
+ margin-top: 28px;
+ display: flex;
+ gap: 28px;
+ color: var(--dark-secondary);
+ font-size: 14px;
+}
+
+.closing-links a:hover {
+ color: #fff;
+}
+
+.footer {
+ padding-block: 34px;
+ border-top: 1px solid var(--dark-border);
+ background: var(--dark);
+ color: #fff;
+}
+
+.footer-inner {
+ display: flex;
+ justify-content: space-between;
+ gap: 40px;
+}
+
+.footer p {
+ margin: 0;
+ color: var(--dark-tertiary);
+ font-size: 12px;
+}
+
+.footer p:first-child {
+ color: #fff;
+ font-weight: 500;
+}
+
+.guardrail-docs-link {
+ margin-top: 48px;
+ font-size: 14px;
+ font-weight: 500;
+}
+
+.docs-main {
+ padding-block: 96px 128px;
+ display: grid;
+ grid-template-columns: 200px minmax(0, 820px);
+ gap: clamp(72px, 10vw, 144px);
+ justify-content: start;
+}
+
+.docs-sidebar {
+ position: sticky;
+ top: 108px;
+ align-self: start;
+}
+
+.docs-sidebar > p {
+ margin: 0 0 18px;
+ font-size: 13px;
+ font-weight: 500;
+}
+
+.docs-sidebar nav {
+ display: grid;
+ gap: 10px;
+}
+
+.docs-sidebar a {
+ color: var(--tertiary);
+ font-size: 13px;
+ text-decoration: none;
+}
+
+.docs-sidebar a:hover {
+ color: var(--ink);
+}
+
+.docs-hero {
+ padding-bottom: 80px;
+}
+
+.docs-hero h1 {
+ font-size: clamp(3.6rem, 7vw, 5.25rem);
+ overflow-wrap: normal;
+ white-space: nowrap;
+}
+
+.docs-hero > p:last-child {
+ max-width: 58ch;
+ margin: 28px 0 0;
+ color: var(--secondary);
+ font-size: 19px;
+}
+
+.docs-section {
+ padding-block: 72px;
+ border-top: 1px solid var(--border);
+ scroll-margin-top: 80px;
+}
+
+.docs-kicker {
+ margin: 0 0 14px;
+ color: var(--tertiary);
+ font-size: 12px;
+ font-weight: 500;
+}
+
+.docs-content {
+ min-width: 0;
+ overflow-wrap: break-word;
+}
+
+.docs-content h2 {
+ margin: 0;
+ font-size: clamp(2rem, 4vw, 3rem);
+ font-weight: 500;
+ letter-spacing: -0.04em;
+ line-height: 1.1;
+}
+
+.docs-content h2 code {
+ font-size: 0.8em;
+}
+
+.docs-section > p:not(.docs-kicker) {
+ max-width: 65ch;
+ margin: 22px 0 0;
+ color: var(--secondary);
+}
+
+.docs-code {
+ margin: 30px 0 0;
+ overflow-x: auto;
+ padding: 22px;
+ border-radius: 9px;
+ background: var(--dark);
+ color: rgb(255 255 255 / 82%);
+ font-size: 13px;
+ line-height: 1.7;
+}
+
+.config-table-wrap {
+ margin-top: 30px;
+ overflow-x: auto;
+}
+
+.config-table {
+ width: 100%;
+ border-collapse: collapse;
+ text-align: left;
+}
+
+.config-table th,
+.config-table td {
+ padding: 16px 12px;
+ border-bottom: 1px solid var(--border);
+ vertical-align: top;
+}
+
+.config-table thead th {
+ color: var(--tertiary);
+ font-size: 11px;
+ font-weight: 500;
+}
+
+.config-table tbody th {
+ font-weight: 500;
+}
+
+.config-table td {
+ color: var(--secondary);
+ font-size: 14px;
+}
+
+.docs-note {
+ margin-top: 28px;
+ padding: 20px;
+ border-left: 2px solid var(--ink);
+ background: var(--tint);
+}
+
+.docs-note strong {
+ font-size: 13px;
+ font-weight: 500;
+}
+
+.docs-note p {
+ margin: 6px 0 0;
+ color: var(--secondary);
+ font-size: 14px;
+}
+
+.docs-definitions,
+.docs-commands {
+ margin: 34px 0 0;
+}
+
+.docs-definitions > div,
+.docs-commands > div {
+ padding: 22px 0;
+ border-bottom: 1px solid var(--border);
+}
+
+.docs-definitions dt,
+.docs-commands dt {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 20px;
+ font-weight: 500;
+}
+
+.docs-definitions dt span {
+ color: var(--tertiary);
+ font-size: 11px;
+ font-weight: 400;
+}
+
+.docs-definitions dd,
+.docs-commands dd {
+ max-width: 65ch;
+ margin: 9px 0 0;
+ color: var(--secondary);
+ font-size: 14px;
+}
+
+.docs-list {
+ margin: 30px 0 0;
+ padding: 0;
+ list-style: none;
+}
+
+.docs-list li {
+ padding: 20px 0;
+ display: grid;
+ grid-template-columns: minmax(180px, 0.7fr) 1.3fr;
+ gap: 24px;
+ border-bottom: 1px solid var(--border);
+}
+
+.docs-list strong {
+ font-size: 14px;
+ font-weight: 500;
+}
+
+.docs-list span {
+ color: var(--secondary);
+ font-size: 14px;
+}
+
+.docs-subheading {
+ margin: 42px 0 0;
+ font-size: 17px;
+ font-weight: 500;
+ letter-spacing: -0.02em;
+}
+
+.hook-lifecycle {
+ margin-top: 34px;
+ display: grid;
+ grid-template-columns: 1fr auto 1fr auto 1fr;
+ align-items: center;
+ gap: 16px;
+}
+
+.hook-lifecycle > div {
+ min-height: 104px;
+ display: flex;
+ flex-direction: column;
+ justify-content: space-between;
+ padding: 18px;
+ border: 1px solid var(--border);
+ border-radius: 8px;
+ background: var(--tint);
+}
+
+.hook-lifecycle > div > span {
+ color: var(--tertiary);
+ font-size: 12px;
+}
+
+.hook-lifecycle > span {
+ color: var(--tertiary);
+}
+
+.hook-repeat {
+ margin: 14px 0 0;
+ color: var(--tertiary);
+ font-size: 12px;
+ text-align: right;
+}
+
+.hook-repeat span {
+ margin-right: 5px;
+ color: var(--ink);
+ font-size: 15px;
+}
+
+.hook-definitions {
+ margin-top: 22px;
+}
+
+.docs-code-compact {
+ margin-top: 14px;
+}
+
+.docs-footer-cta {
+ padding-top: 72px;
+ border-top: 1px solid var(--strong-border);
+}
+
+.docs-footer-cta p {
+ margin: 16px 0 28px;
+ color: var(--secondary);
+}
+
+.docs-footer-cta a {
+ font-weight: 500;
+}
+
+::selection {
+ background: rgb(113 255 159 / 24%);
+}
+
+.landing-page .nav a:hover,
+.landing-page .hero-note a,
+.landing-page .authority-note a,
+.landing-page .hooks-file > a,
+.landing-page .guardrail-docs-link a,
+.landing-page .closing-links a,
+.landing-page .case-study-link > span:last-child {
+ color: #67e8ff;
+}
+
+.landing-page .hero {
+ background-image:
+ linear-gradient(rgb(113 255 159 / 3%) 1px, transparent 1px),
+ linear-gradient(90deg, rgb(113 255 159 / 3%) 1px, transparent 1px);
+ background-size: 48px 48px;
+}
+
+.landing-page .chapter-tint {
+ background: #0b100d;
+}
+
+.landing-page .chapter-dark,
+.landing-page .closing,
+.landing-page .footer {
+ background: #030504;
+}
+
+.landing-page .footer {
+ border-top-color: var(--border);
+}
+
+.docs-page .docs-sidebar > p,
+.docs-page .docs-kicker,
+.docs-page .eyebrow {
+ color: #71ff9f;
+ font-family: var(--mono);
+}
+
+.docs-page .docs-content a,
+.docs-page .docs-sidebar a:hover {
+ color: #67e8ff;
+}
+
+.docs-page .docs-sidebar a,
+.docs-page .config-table thead th {
+ color: var(--secondary);
+}
+
+.docs-page .docs-code {
+ border: 1px solid var(--strong-border);
+ background: #020403;
+}
+
+.docs-page .docs-section p code,
+.docs-page .docs-definitions code,
+.docs-page .docs-commands code,
+.docs-page .docs-list code,
+.docs-page .config-table code {
+ color: #67e8ff;
+}
+
+.docs-page .docs-note,
+.docs-page .hook-lifecycle > div {
+ border-color: var(--strong-border);
+ background: #0c110e;
+}
+
+.docs-page .config-table tbody tr:nth-child(even) {
+ background: var(--tint);
+}
+
+.docs-page .docs-footer-cta {
+ border-color: var(--strong-border);
+}
+
+.motion-ready .hero-copy > *,
+.motion-ready .hero-visual {
+ opacity: 0;
+ transform: translateY(18px);
+ animation: enter-page 680ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
+}
+
+.motion-ready .hero-copy .eyebrow { animation-delay: 60ms; }
+.motion-ready .hero-copy h1 { animation-delay: 130ms; }
+.motion-ready .hero-intro { animation-delay: 220ms; }
+.motion-ready .hero-copy .install { animation-delay: 300ms; }
+.motion-ready .hero-note { animation-delay: 350ms; }
+.motion-ready .hero-visual { animation-delay: 400ms; }
+
+.motion-ready .reveal {
+ opacity: 0;
+ transform: translateY(22px);
+ transition: opacity 640ms cubic-bezier(0.22, 1, 0.36, 1), transform 640ms cubic-bezier(0.22, 1, 0.36, 1);
+}
+
+.motion-ready .reveal.is-visible {
+ opacity: 1;
+ transform: none;
+}
+
+.motion-ready .journal-row:nth-child(2),
+.motion-ready .guardrail-list article:nth-child(2),
+.motion-ready .hooks-list span:nth-child(even) {
+ transition-delay: 70ms;
+}
+
+.motion-ready .journal-row:nth-child(3),
+.motion-ready .guardrail-list article:nth-child(3) {
+ transition-delay: 140ms;
+}
+
+.motion-ready .journal-row:nth-child(4) { transition-delay: 210ms; }
+.motion-ready .journal-row:nth-child(5) { transition-delay: 280ms; }
+.motion-ready .journal-row:nth-child(6) { transition-delay: 350ms; }
+
+@keyframes enter-page {
+ to {
+ opacity: 1;
+ transform: none;
+ }
+}
+
+@media (max-width: 900px) {
+ .docs-main {
+ padding-top: 72px;
+ grid-template-columns: 1fr;
+ gap: 64px;
+ }
+
+ .docs-sidebar {
+ position: static;
+ }
+
+ .docs-sidebar nav {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 10px 20px;
+ }
+
+ .shell {
+ width: min(calc(100% - 48px), var(--shell));
+ }
+
+ .hero {
+ min-height: auto;
+ padding-top: 82px;
+ padding-bottom: 88px;
+ grid-template-columns: 1fr;
+ gap: 64px;
+ }
+
+ .hero-copy {
+ max-width: 700px;
+ }
+
+ h1 {
+ font-size: clamp(3.4rem, 12vw, 5rem);
+ }
+
+ .chapter,
+ .closing {
+ padding-block: 96px;
+ }
+
+ .process-journal-layout {
+ grid-template-columns: 1fr;
+ gap: 64px;
+ }
+
+ .process-story,
+ .experiment-journal,
+ .guardrail-body {
+ max-width: 700px;
+ }
+
+ .guardrail-body {
+ grid-template-columns: 1fr;
+ gap: 48px;
+ }
+
+ .split {
+ grid-template-columns: 1fr;
+ gap: 64px;
+ }
+
+ .sticky-copy {
+ position: static;
+ }
+
+ .file-stack {
+ grid-template-columns: repeat(2, 1fr);
+ }
+
+ .confidence-layout {
+ grid-template-columns: 1fr;
+ }
+
+ .confidence-score {
+ min-height: 280px;
+ }
+
+ .tweet-grid {
+ max-width: 560px;
+ grid-template-columns: 1fr;
+ }
+
+ .finalize-layout .finalize-demo {
+ order: 2;
+ }
+}
+
+@media (max-width: 640px) {
+ html {
+ scroll-padding-top: 70px;
+ }
+
+ .shell {
+ width: min(calc(100% - 40px), var(--shell));
+ }
+
+ .docs-main {
+ padding-block: 56px 88px;
+ gap: 48px;
+ }
+
+ .docs-sidebar nav {
+ display: grid;
+ gap: 0;
+ }
+
+ .docs-sidebar a {
+ min-height: 44px;
+ display: flex;
+ align-items: center;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .docs-hero {
+ padding-bottom: 56px;
+ }
+
+ .docs-hero h1 {
+ font-size: 2.9rem;
+ white-space: normal;
+ }
+
+ .docs-section {
+ padding-block: 56px;
+ }
+
+ .docs-list li {
+ grid-template-columns: 1fr;
+ gap: 8px;
+ }
+
+ .hook-lifecycle {
+ grid-template-columns: 1fr;
+ gap: 8px;
+ }
+
+ .hook-lifecycle > span {
+ justify-self: center;
+ transform: rotate(90deg);
+ }
+
+ .hook-lifecycle > div {
+ min-height: 88px;
+ }
+
+ .config-table-wrap {
+ overflow: visible;
+ }
+
+ .config-table,
+ .config-table tbody,
+ .config-table tr,
+ .config-table th,
+ .config-table td {
+ display: block;
+ width: 100%;
+ }
+
+ .config-table thead {
+ display: none;
+ }
+
+ .config-table tr {
+ padding: 18px 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .config-table th,
+ .config-table td {
+ padding: 0;
+ border: 0;
+ }
+
+ .config-table td:first-of-type {
+ margin-top: 5px;
+ color: var(--tertiary);
+ font-size: 12px;
+ }
+
+ .config-table td:last-child {
+ margin-top: 10px;
+ }
+
+ .header-inner {
+ min-height: 62px;
+ }
+
+ .wordmark {
+ font-size: 14px;
+ }
+
+ .nav a:not(.nav-github) {
+ display: none;
+ }
+
+ .hero {
+ padding-top: 50px;
+ padding-bottom: 72px;
+ }
+
+ .eyebrow {
+ margin-bottom: 16px;
+ }
+
+ h1 {
+ font-size: clamp(2.7rem, 13vw, 4rem);
+ line-height: 1.01;
+ }
+
+ .hero-intro {
+ margin-top: 26px;
+ font-size: 17px;
+ }
+
+ .install {
+ margin-top: 30px;
+ gap: 8px;
+ padding-left: 13px;
+ }
+
+ .install code {
+ font-size: 11px;
+ }
+
+ .copy-button {
+ min-width: 78px;
+ }
+
+ .product-frame {
+ margin-top: 44px;
+ }
+
+ .product-frame figcaption {
+ align-items: center;
+ }
+
+ .hero-meta {
+ align-items: flex-start;
+ flex-direction: column;
+ gap: 8px;
+ }
+
+ .chapter,
+ .closing {
+ padding-block: 76px;
+ }
+
+ .section-heading h2,
+ .closing h2 {
+ font-size: clamp(2.35rem, 11vw, 3.25rem);
+ }
+
+ .section-heading > p:not(.eyebrow) {
+ margin-top: 22px;
+ font-size: 16px;
+ }
+
+ .process-journal-layout {
+ gap: 48px;
+ }
+
+ .process-prompt {
+ margin-top: 30px;
+ }
+
+ .journal-progress {
+ min-height: 0;
+ grid-template-columns: 1fr 18px 1fr;
+ gap: 10px;
+ padding: 20px;
+ }
+
+ .journal-progress span:not(.journal-progress-arrow) {
+ font-size: 19px;
+ }
+
+ .journal-progress strong {
+ grid-column: 1 / -1;
+ justify-self: start;
+ margin-top: 4px;
+ }
+
+ .journal-row {
+ min-height: 0;
+ grid-template-columns: 32px 1fr 64px;
+ gap: 8px;
+ padding: 16px 18px;
+ }
+
+ .journal-row:not(.journal-labels) > :nth-child(2) {
+ font-size: 16px;
+ line-height: 1.3;
+ }
+
+ .journal-row > :last-child {
+ grid-column: 2 / -1;
+ }
+
+ .journal-labels > :last-child {
+ display: none;
+ }
+
+ .journal-labels {
+ padding-block: 10px;
+ }
+
+ .experiment-journal figcaption {
+ align-items: flex-start;
+ flex-direction: column;
+ gap: 6px;
+ padding: 16px 18px;
+ }
+
+ .prompt-example {
+ align-items: flex-start;
+ }
+
+ .prompt-example code {
+ overflow: visible;
+ white-space: normal;
+ }
+
+ .split {
+ gap: 48px;
+ }
+
+ .file-stack {
+ grid-template-columns: 1fr;
+ }
+
+ .file-card {
+ min-height: 230px;
+ padding: 24px;
+ }
+
+ .file-card p {
+ margin-top: auto;
+ }
+
+ .confidence-layout {
+ margin-top: 52px;
+ }
+
+ .confidence-score {
+ min-height: 250px;
+ padding: 26px;
+ }
+
+ .confidence-scale {
+ padding: 8px 24px;
+ }
+
+ .scale-row {
+ min-height: 116px;
+ grid-template-columns: 1fr;
+ align-content: center;
+ gap: 10px;
+ }
+
+ .browser-dashboard {
+ margin-top: 50px;
+ padding: 16px;
+ }
+
+ .share-showcase {
+ margin-top: 76px;
+ grid-template-columns: 1fr;
+ gap: 40px;
+ }
+
+ .social-post {
+ padding: 18px;
+ }
+
+ .social-post-label {
+ top: 20px;
+ right: 18px;
+ }
+
+ .social-post > p {
+ font-size: 15px;
+ }
+
+ .case-study-link {
+ grid-template-columns: 1fr;
+ gap: 8px;
+ padding-block: 22px;
+ }
+
+ .case-study-link > span:last-child {
+ margin-top: 8px;
+ text-align: left;
+ }
+
+ .tweet-grid {
+ margin-top: 50px;
+ grid-template-columns: 1fr;
+ gap: 16px;
+ }
+
+ .authority-footer {
+ align-items: flex-start;
+ flex-direction: column;
+ gap: 20px;
+ }
+
+ .tweet-grid blockquote.twitter-tweet {
+ min-height: 0;
+ padding: 22px;
+ }
+
+ .tweet-grid blockquote.twitter-tweet p {
+ font-size: 16px;
+ }
+
+ .dashboard-header {
+ align-items: stretch;
+ flex-direction: column;
+ gap: 22px;
+ }
+
+ .dashboard-session-meta {
+ align-items: flex-start;
+ flex-direction: column;
+ gap: 4px;
+ }
+
+ .dashboard-tabs {
+ width: 100%;
+ }
+
+ .dashboard-tab {
+ min-height: 44px;
+ flex: 1;
+ padding-inline: 8px;
+ }
+
+ .dashboard-cards {
+ grid-template-columns: repeat(2, 1fr);
+ }
+
+ .dashboard-cards article {
+ min-height: 112px;
+ padding: 15px;
+ }
+
+ .dashboard-chart {
+ padding: 18px 12px 6px;
+ }
+
+ .dashboard-results-table {
+ height: auto;
+ max-height: none;
+ overflow: hidden;
+ }
+
+ .dashboard-source {
+ align-items: flex-start;
+ flex-direction: column;
+ gap: 6px;
+ }
+
+ .dashboard-result-row {
+ min-width: 0;
+ grid-template-columns: 32px 62px 72px 70px;
+ gap: 8px;
+ padding: 12px 14px;
+ }
+
+ .dashboard-result-row > :last-child {
+ grid-column: 1 / -1;
+ padding-top: 4px;
+ color: rgb(255 255 255 / 48%);
+ }
+
+ .dashboard-result-header > :last-child {
+ display: none;
+ }
+
+ .dashboard-result-header {
+ min-height: 42px;
+ padding-block: 0;
+ }
+
+ .metric-table-scroll {
+ margin-top: 50px;
+ overflow: visible;
+ }
+
+ .metric-table {
+ min-width: 0;
+ table-layout: auto;
+ }
+
+ .metric-table thead {
+ display: none;
+ }
+
+ .metric-table tbody,
+ .metric-table tr,
+ .metric-table th,
+ .metric-table td {
+ display: block;
+ width: 100%;
+ height: auto;
+ }
+
+ .metric-table tbody tr {
+ padding: 20px 0;
+ border-bottom: 1px solid var(--border);
+ }
+
+ .metric-table th,
+ .metric-table td {
+ padding: 0;
+ border: 0;
+ }
+
+ .metric-table td:nth-child(2) {
+ margin-top: 4px;
+ font-size: 13px;
+ }
+
+ .metric-table td:nth-child(3) {
+ margin-top: 12px;
+ }
+
+ .metric-table code {
+ white-space: normal;
+ }
+
+ .code-window pre {
+ overflow-x: auto;
+ }
+
+ .guardrail-body {
+ margin-top: 50px;
+ gap: 40px;
+ }
+
+ .guardrail-list article {
+ min-height: 0;
+ }
+
+ .monitor-list {
+ margin-top: 50px;
+ }
+
+ .monitor-list article {
+ min-height: 155px;
+ grid-template-columns: 40px 1fr;
+ gap: 16px;
+ }
+
+ .monitor-list svg {
+ width: 24px;
+ }
+
+ .hooks-list {
+ grid-template-columns: 1fr;
+ }
+
+ .closing-links,
+ .footer-inner {
+ align-items: flex-start;
+ flex-direction: column;
+ }
+
+ .footer-inner {
+ gap: 14px;
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ html {
+ scroll-behavior: auto;
+ }
+
+ .journal-live i,
+ .journal-running i,
+ .browser-dashboard.is-live .dashboard-live i,
+ .dashboard-result-row:last-child:not(.dashboard-result-header),
+ .motion-ready .hero-copy > *,
+ .motion-ready .hero-visual {
+ animation: none;
+ }
+
+ .motion-ready .hero-copy > *,
+ .motion-ready .hero-visual,
+ .motion-ready .reveal {
+ opacity: 1;
+ transform: none;
+ transition: none;
+ }
+
+ *,
+ *::before,
+ *::after {
+ scroll-behavior: auto !important;
+ transition-duration: 0.01ms !important;
+ }
+}
diff --git a/site/scripts/generate-casts.mjs b/site/scripts/generate-casts.mjs
new file mode 100644
index 00000000..1dc3478c
--- /dev/null
+++ b/site/scripts/generate-casts.mjs
@@ -0,0 +1,239 @@
+import {mkdirSync, writeFileSync} from 'node:fs';
+import {basename, dirname, resolve} from 'node:path';
+import {fileURLToPath} from 'node:url';
+
+const siteDirectory = resolve(dirname(fileURLToPath(import.meta.url)), '..');
+const recordingsDirectory = resolve(siteDirectory, 'build/recordings');
+const generatedCasts = {};
+
+const ansi = {
+ reset: '\u001b[0m',
+ bold: '\u001b[1m',
+ dim: '\u001b[2m',
+ blue: '\u001b[38;5;75m',
+ green: '\u001b[38;5;78m',
+ red: '\u001b[38;5;203m',
+ yellow: '\u001b[38;5;214m',
+ purple: '\u001b[38;2;178;148;187m',
+ white: '\u001b[38;5;255m',
+ clear: '\u001b[2J\u001b[H\u001b[?25l',
+};
+
+const theme = {
+ fg: '#f1f1f4',
+ bg: '#282c34',
+ palette: '#1d1f21:#cc6666:#b5bd68:#f0c674:#81a2be:#b294bb:#8abeb7:#c5c8c6:#666666:#d54e53:#b9ca4a:#e7c547:#7aa6da:#c397d8:#70c0b1:#eaeaea',
+};
+
+const experimentRuns = [
+ {commit: '6d1fe20', metric: '12.84s', status: 'keep', description: 'Establish test suite baseline', mobileDescription: 'Baseline'},
+ {commit: 'a38fd71', metric: '9.62s', status: 'keep', description: 'Use isolated worker pool', mobileDescription: 'Isolate workers'},
+ {commit: '—', metric: '10.19s', status: 'discard', description: 'Increase thread count to 12', mobileDescription: 'Try 12 threads'},
+ {commit: 'c7a209e', metric: '8.47s', status: 'keep', description: 'Cache transformed setup files', mobileDescription: 'Cache transforms'},
+];
+
+mkdirSync(recordingsDirectory, {recursive: true});
+writeExperimentCast('experiment.cast', 112, desktopExperimentScreen);
+writeExperimentCast('experiment-compact.cast', 72, mobileExperimentScreen);
+writeExperimentCast('experiment-mobile.cast', 42, narrowExperimentScreen);
+writeFinalizeCast('finalize.cast', 72, 20);
+writeFinalizeCast('finalize-mobile.cast', 44, 24);
+writeEmbeddedCasts();
+
+function writeEmbeddedCasts() {
+ const source = `window.autoresearchCasts = ${JSON.stringify(generatedCasts)};\n`;
+ writeFileSync(resolve(recordingsDirectory, 'casts.js'), source);
+}
+
+function writeExperimentCast(filename, columns, renderScreen) {
+ const rows = columns < 50 ? 19 : 20;
+ const cast = createCast(columns, rows);
+ const prompt = columns < 50
+ ? '/autoresearch optimize test runtime'
+ : columns < 80
+ ? '/autoresearch optimize unit test runtime'
+ : '/autoresearch optimize unit test runtime, monitor correctness';
+
+ typePiPrompt(cast, prompt, columns, rows);
+ cast.output(0.45, piApplicationScreen('', prompt, columns, rows));
+ cast.output(0.35, piApplicationScreen(renderScreen([], true), '', columns, rows));
+ cast.output(1.2, piApplicationScreen(renderScreen(experimentRuns.slice(0, 1), false), '', columns, rows));
+ cast.output(1.0, piApplicationScreen(renderScreen(experimentRuns.slice(0, 1), true), '', columns, rows));
+ cast.output(1.25, piApplicationScreen(renderScreen(experimentRuns.slice(0, 2), false), '', columns, rows));
+ cast.output(1.0, piApplicationScreen(renderScreen(experimentRuns.slice(0, 2), true), '', columns, rows));
+ cast.output(1.25, piApplicationScreen(renderScreen(experimentRuns.slice(0, 3), false), '', columns, rows));
+ cast.output(1.0, piApplicationScreen(renderScreen(experimentRuns.slice(0, 3), true), '', columns, rows));
+ cast.output(1.25, piApplicationScreen(renderScreen(experimentRuns, false), '', columns, rows));
+ cast.output(2.3, '');
+ cast.save(resolve(recordingsDirectory, filename));
+}
+
+function desktopExperimentScreen(runs, running) {
+ const activity = running
+ ? `${ansi.yellow}◆${ansi.reset} ${ansi.bold}run_experiment${ansi.reset} ${ansi.dim}pnpm test --run${ansi.reset} ${ansi.dim}(timeout: 120s)${ansi.reset}\r\n${ansi.blue}⠋${ansi.reset} ${ansi.dim}Working…${ansi.reset}`
+ : `${ansi.green}✓${ansi.reset} ${ansi.bold}run_experiment${ansi.reset} ${ansi.dim}pnpm test --run${ansi.reset} ${ansi.green}${latestMetric(runs)}${ansi.reset}\r\n${ansi.green}✅ wall: ${latestMetric(runs)}, test_runtime: ${latestMetric(runs)}${ansi.reset}`;
+
+ if (runs.length === 0) {
+ return `${activity}\r\n\r\n${ansi.blue}🔬${ansi.yellow} running…${ansi.reset}${ansi.dim} │ Vitest runtime │ waiting for first logged result${ansi.reset}`;
+ }
+
+ return `${activity}\r\n\r\n${dashboardTitle(108)}\r\n${summaryLines(runs)}\r\n\r\n${desktopTable(runs)}`;
+}
+
+function mobileExperimentScreen(runs, running) {
+ const activity = running
+ ? `${ansi.yellow}◆${ansi.reset} ${ansi.bold}run_experiment${ansi.reset} ${ansi.dim}pnpm test --run${ansi.reset}\r\n${ansi.blue}⠋${ansi.reset} ${ansi.dim}Working…${ansi.reset}`
+ : `${ansi.green}✓${ansi.reset} ${ansi.bold}run_experiment${ansi.reset} ${ansi.dim}pnpm test --run${ansi.reset}\r\n${ansi.green}✅ test_runtime: ${latestMetric(runs)}${ansi.reset}`;
+
+ if (runs.length === 0) {
+ return `${activity}\r\n\r\n${ansi.blue}🔬${ansi.yellow} running…${ansi.reset}${ansi.dim} │ waiting for first result${ansi.reset}`;
+ }
+
+ return `${activity}\r\n\r\n${dashboardTitle(62)}\r\n${summaryLines(runs)}\r\n\r\n${mobileTable(runs)}`;
+}
+
+function narrowExperimentScreen(runs, running) {
+ const activity = running
+ ? `${ansi.yellow}◆${ansi.reset} ${ansi.bold}run_experiment${ansi.reset} ${ansi.dim}pnpm test${ansi.reset}\r\n${ansi.blue}⠋${ansi.reset} ${ansi.dim}Working…${ansi.reset}`
+ : `${ansi.green}✓${ansi.reset} ${ansi.bold}run_experiment${ansi.reset} ${ansi.dim}pnpm test${ansi.reset}\r\n${ansi.green}✅ test_runtime: ${latestMetric(runs)}${ansi.reset}`;
+ if (runs.length === 0) return `${activity}\r\n\r\n${ansi.blue}🔬 autoresearch${ansi.reset}${ansi.dim} · waiting for baseline${ansi.reset}`;
+ return `${activity}\r\n\r\n${dashboardTitle(38)}\r\n${narrowSummary(runs)}\r\n\r\n${narrowTable(runs)}`;
+}
+
+function narrowSummary(runs) {
+ const kept = runs.filter(({status}) => status === 'keep').length;
+ const best = Math.min(...runs.filter(({status}) => status === 'keep').map(({metric}) => Number.parseFloat(metric)));
+ const delta = ((best - 12.84) / 12.84 * 100).toFixed(1);
+ return `${ansi.dim}Runs:${ansi.reset} ${runs.length} ${ansi.green}${kept} kept${ansi.reset}\r\n${ansi.dim}Baseline:${ansi.reset} 12.84s\r\n${ansi.dim}Best:${ansi.reset} ${ansi.yellow}${ansi.bold}${best.toFixed(2)}s${ansi.reset} ${ansi.green}(${delta}%)${ansi.reset}`;
+}
+
+function narrowTable(runs) {
+ const header = `${ansi.dim}# runtime status experiment${ansi.reset}`;
+ const rule = `${ansi.dim}${'─'.repeat(38)}${ansi.reset}`;
+ const rows = runs.map((run, index) => {
+ const statusColor = run.status === 'keep' ? ansi.green : ansi.yellow;
+ return `${ansi.dim}${index + 1} ${ansi.reset}${ansi.bold}${run.metric.padEnd(10)}${ansi.reset}${statusColor}${run.status.padEnd(10)}${ansi.reset}${ansi.dim}${run.mobileDescription}${ansi.reset}`;
+ }).join('\r\n');
+ return `${header}\r\n${rule}\r\n${rows}`;
+}
+
+function dashboardTitle(width) {
+ const title = ' 🔬 autoresearch: Vitest runtime ';
+ const remaining = Math.max(4, width - 3 - title.length);
+ return `${ansi.dim}───${ansi.reset}${ansi.blue}${title}${ansi.reset}${ansi.dim}${'─'.repeat(remaining)}${ansi.reset}`;
+}
+
+function summaryLines(runs) {
+ const kept = runs.filter(({status}) => status === 'keep').length;
+ const discarded = runs.filter(({status}) => status === 'discard').length;
+ const bestMetric = Math.min(...runs.filter(({status}) => status === 'keep').map(({metric}) => Number.parseFloat(metric)));
+ const bestRun = experimentRuns.findIndex(({metric}) => Number.parseFloat(metric) === bestMetric) + 1;
+ const confidence = runs.length >= 3 ? `${ansi.green} (conf: 2.4×)${ansi.reset}` : '';
+ const discardedText = discarded ? `${ansi.yellow} ${discarded} discarded${ansi.reset}` : '';
+ const improvement = ((bestMetric - 12.84) / 12.84 * 100).toFixed(1);
+ const progress = bestMetric === 12.84 ? '' : `${ansi.green} (${improvement}%)${ansi.reset}`;
+
+ return ` ${ansi.dim}Runs:${ansi.reset} ${runs.length} ${ansi.green}${kept} kept${ansi.reset}${confidence}${discardedText}\r\n` +
+ ` ${ansi.dim}Baseline: ★ test_runtime: 12.84s #1${ansi.reset}\r\n` +
+ ` ${ansi.dim}Progress:${ansi.reset} ${ansi.yellow}${ansi.bold}★ test_runtime: ${bestMetric.toFixed(2)}s${ansi.reset}${ansi.dim} #${bestRun}${ansi.reset}${progress}`;
+}
+
+function desktopTable(runs) {
+ const header = ` ${ansi.dim}# commit ${ansi.reset}${ansi.yellow}${ansi.bold}★ test_runtime ${ansi.reset}${ansi.dim}status description${ansi.reset}`;
+ const rule = ` ${ansi.dim}${'─'.repeat(106)}${ansi.reset}`;
+ const rows = runs.map((run, index) => formatDesktopRow(run, index)).join('\r\n');
+ return `${header}\r\n${rule}\r\n${rows}`;
+}
+
+function formatDesktopRow(run, index) {
+ const statusColor = run.status === 'keep' ? ansi.green : ansi.yellow;
+ const metricColor = index === 0 ? ansi.white : run.status === 'keep' ? ansi.green : ansi.white;
+ return ` ${ansi.dim}${index + 1} ${ansi.reset}${ansi.blue}${run.commit.padEnd(10)}${ansi.reset}${metricColor}${ansi.bold}${run.metric.padEnd(16)}${ansi.reset}${statusColor}${run.status.padEnd(15)}${ansi.reset}${ansi.dim}${run.description}${ansi.reset}`;
+}
+
+function mobileTable(runs) {
+ const header = ` ${ansi.dim}# commit ${ansi.reset}${ansi.yellow}${ansi.bold}★ runtime ${ansi.reset}${ansi.dim}status description${ansi.reset}`;
+ const rule = ` ${ansi.dim}${'─'.repeat(62)}${ansi.reset}`;
+ const rows = runs.map((run, index) => formatMobileRow(run, index)).join('\r\n');
+ return `${header}\r\n${rule}\r\n${rows}`;
+}
+
+function formatMobileRow(run, index) {
+ const statusColor = run.status === 'keep' ? ansi.green : ansi.yellow;
+ return ` ${ansi.dim}${index + 1} ${ansi.reset}${ansi.blue}${run.commit.padEnd(10)}${ansi.reset}${ansi.bold}${run.metric.padEnd(10)}${ansi.reset}${statusColor}${run.status.padEnd(10)}${ansi.reset}${ansi.dim}${run.mobileDescription}${ansi.reset}`;
+}
+
+function latestMetric(runs) {
+ return runs.at(-1)?.metric ?? '—';
+}
+
+function writeFinalizeCast(filename, columns, rows) {
+ const cast = createCast(columns, rows);
+ const prompt = '/skill:autoresearch-finalize';
+ cast.output(0.35, `${ansi.blue}› ${ansi.reset}`);
+ typeText(cast, prompt);
+ cast.output(0.35, '\r\n');
+ cast.output(0.5, `${ansi.blue}◆${ansi.reset} ${ansi.bold}read${ansi.reset} ${ansi.dim}.auto/log.jsonl${ansi.reset}\r\n`);
+ cast.output(0.9, `${ansi.green}✓${ansi.reset} ${ansi.dim}28 experiments · 9 kept · 19 discarded${ansi.reset}\r\n\r\n`);
+ cast.output(0.8, `${ansi.white}${ansi.bold}Two independent changesets found.${ansi.reset}\r\n\r\n`);
+ cast.output(0.8, `${ansi.blue}01${ansi.reset} ${ansi.bold}Worker pool isolation${ansi.reset}\r\n ${ansi.dim}Runs 12 + 18 · test configuration${ansi.reset}\r\n ${ansi.green}−23.4% test runtime${ansi.reset}\r\n\r\n`);
+ cast.output(0.9, `${ansi.blue}02${ansi.reset} ${ansi.bold}Transform cache${ansi.reset}\r\n ${ansi.dim}Run 27 · setup cache${ansi.reset}\r\n ${ansi.green}−8.1% test runtime${ansi.reset}\r\n\r\n`);
+ cast.output(0.8, `${ansi.blue}◆${ansi.reset} ${ansi.bold}bash${ansi.reset} ${ansi.dim}create independent branches from merge-base${ansi.reset}\r\n`);
+ cast.output(1.1, `${ansi.green}✓ perf/test-pool${ansi.reset} ${ansi.dim}2 commits${ansi.reset}\r\n${ansi.green}✓ perf/cache-config${ansi.reset} ${ansi.dim}1 commit${ansi.reset}\r\n\r\n`);
+ const readyMessage = columns < 60
+ ? `${ansi.green}${ansi.bold}Ready for review.${ansi.reset}\r\n${ansi.dim}No shared files. Merge independently.${ansi.reset}`
+ : `${ansi.green}${ansi.bold}Ready for review.${ansi.reset} ${ansi.dim}No shared files; safe to merge independently.${ansi.reset}`;
+ cast.output(0.8, readyMessage);
+ cast.output(2.0, '');
+ cast.save(resolve(recordingsDirectory, filename));
+}
+
+function createCast(columns, rows) {
+ const events = [];
+ const header = {
+ version: 3,
+ term: {cols: columns, rows, type: 'xterm-256color', theme},
+ env: {SHELL: '/bin/zsh'},
+ };
+
+ return {
+ output(delay, text) {
+ events.push([delay, 'o', text]);
+ },
+ save(path) {
+ const lines = [JSON.stringify(header), ...events.map((event) => JSON.stringify(event))];
+ generatedCasts[`recordings/${basename(path)}`] = `${lines.join('\n')}\n`;
+ },
+ };
+}
+
+function typeText(cast, text) {
+ for (const character of text) {
+ cast.output(character === ' ' ? 0.025 : 0.035, character);
+ }
+}
+
+function typePiPrompt(cast, text, columns, rows) {
+ for (let length = 0; length <= text.length; length += 1) {
+ const character = text[length - 1] ?? '';
+ cast.output(character === ' ' ? 0.025 : 0.035, piApplicationScreen('', text.slice(0, length), columns, rows));
+ }
+}
+
+function piApplicationScreen(content, input, columns, rows) {
+ const contentLines = content ? content.split('\r\n').length : 0;
+ const editorLines = 5;
+ const paddingRows = Math.max(0, rows - editorLines - contentLines);
+ const padding = '\r\n'.repeat(paddingRows);
+ const separator = `${ansi.purple}${'─'.repeat(columns)}${ansi.reset}`;
+ const compact = columns < 60;
+ const project = compact
+ ? '~/project (autoresearch/tests)'
+ : '~/project (autoresearch/optimize-tests)';
+ const status = compact
+ ? '0.0%/200k (auto) opus-4-8 • high'
+ : '0.0%/200k (auto) (anthropic) claude-opus-4-8 • high';
+ const cursor = `${ansi.white}\u001b[7m \u001b[27m${ansi.reset}`;
+ const editor = `${separator}\r\n ${ansi.white}${input}${ansi.reset}${cursor}\r\n${separator}\r\n${ansi.dim}${project}${ansi.reset}\r\n${ansi.dim}${status}${ansi.reset}`;
+ return `${ansi.clear}${padding}${content}${content ? '\r\n' : ''}${editor}`;
+}
diff --git a/site/templates/configuration.html b/site/templates/configuration.html
new file mode 100644
index 00000000..d26df4ff
--- /dev/null
+++ b/site/templates/configuration.html
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ {{title}} — pi-autoresearch
+
+
+ Skip to content
+
+
+
+
+ pi-autoresearch
+
+
+
+
+
+
+
+
+
+
+ Reference
+ {{title}}
+ {{intro}}
+
+ {{content}}
+
+
+
+
diff --git a/tests/landing-page-security.test.mjs b/tests/landing-page-security.test.mjs
new file mode 100644
index 00000000..012d4f25
--- /dev/null
+++ b/tests/landing-page-security.test.mjs
@@ -0,0 +1,37 @@
+import assert from "node:assert/strict";
+import { readFileSync } from "node:fs";
+import test from "node:test";
+
+const landingPage = readFileSync(new URL("../site/public/index.html", import.meta.url), "utf8");
+const landingScript = readFileSync(new URL("../site/public/script.js", import.meta.url), "utf8");
+
+function contentSecurityPolicy() {
+ return landingPage.match(/http-equiv="Content-Security-Policy" content="([^"]+)"/)?.[1];
+}
+
+test("landing page executes only same-origin parent scripts", () => {
+ const policy = contentSecurityPolicy();
+ assert.ok(policy);
+ assert.match(policy, /script-src 'self' 'wasm-unsafe-eval'/);
+ assert.match(policy, /connect-src 'self' blob: https:\/\/api\.github\.com/);
+ assert.match(policy, /frame-src https:\/\/platform\.twitter\.com/);
+ assert.doesNotMatch(landingScript, /platform\.twitter\.com\/widgets\.js/);
+});
+
+test("live GitHub stars accept only a valid non-negative integer", () => {
+ assert.match(landingScript, /fetch\('https:\/\/api\.github\.com\/repos\/davebcn87\/pi-autoresearch'/);
+ assert.match(landingScript, /!Number\.isSafeInteger\(stars\) \|\| stars < 0/);
+ assert.match(landingScript, /credentials: 'omit'/);
+});
+
+test("X embeds stay in validated sandboxed cross-origin frames", () => {
+ assert.match(landingScript, /new URL\('https:\/\/platform\.twitter\.com\/embed\/Tweet\.html'\)/);
+ assert.match(landingScript, /event\.origin !== 'https:\/\/platform\.twitter\.com'/);
+ assert.match(landingScript, /embed\.contentWindow !== event\.source/);
+ assert.match(landingScript, /allow-scripts allow-same-origin allow-popups allow-popups-to-escape-sandbox/);
+});
+
+test("dashboard result query is allowlisted before selector construction", () => {
+ assert.match(landingScript, /Object\.hasOwn\(publishedResults, requestedResult\)/);
+ assert.doesNotMatch(landingScript, /dashboard-tab="\$\{requestedResult\}"/);
+});