# Astro adapter — pilot wiring

Mount the badge on pilot pages only (homepage + pilot collection pages), not
site-wide. Site-wide rollout happens only after two clean rounds.

## 1. Badge

```astro
---
import AnnotateBadge from 'annotate-loop/adapters/astro/AnnotateBadge.astro';
---
<AnnotateBadge pilot="home" />
```

The badge renders nothing in production: the component returns early unless
`import.meta.env.DEV`, so no badge markup and no picker source reach the
prerendered HTML. The picker is `?raw`-imported (no `node:fs` in frontmatter —
frontmatter also executes under the Cloudflare workerd dev runner, where
Node-only imports render blank).

## 2. Receiver scripts

```json
{
  "scripts": {
    "annotate:receiver": "annotate-loop-receiver",
    "annotate:bookmarklet": "annotate-loop-bookmarklet --out=bookmarklet.txt",
    "verify:annotate": "annotate-loop-guard --dir=dist/client"
  }
}
```

## 3. CI leak check

Run the guard right after the build — it fails on any picker/badge marker in
the publish dir or any stray picker copy under `public/`:

```yaml
- run: npm run build
- run: npm run verify:annotate
```

## 4. Rules

- Never put picker/bookmarklet copies under `public/` (it ships verbatim to
  `dist/`).
- Gitignore the intake jobs (`data/annotations/*.json`, keep a `.gitkeep`).
- Triage jobs per [docs/usage.md](../docs/usage.md): re-verify, implement,
  archive/delete.
