# Curly Versions Audit
<!--
ref: @protocol/curly-versions-audit
type: protocol
tags: [curly, maintenance, versions, audit, retro, groom-op]
triggers: [audit curly versions, check curly drift, refresh integration headers, curly version retro]
trigger_prompt: When you run a periodic maintenance pass on curly's pinned per-service API versions, or when a service returns 404/400 errors that smell like version mismatch.
category: maintenance
last_reviewed: 2026-07-13
complements: [@integrations/curly, @integrations/notion, @integrations/gh, @protocol/retro]
audience: [agent-author, claude-code-user]
version: 5
updated_at: 2026-09-10T16:27:40.541Z
-->

Refresh the date-pinned API-version headers that curly sends, on both surfaces that carry them.

> **Why this exists.** Some APIs gate endpoints on a date-pinned version header — `Notion-Version`, `X-GitHub-Api-Version`. Pin them too far back and endpoints don't 400, they **vanish**: Notion returns `404 invalid_request_url` for a path that exists perfectly well on a newer version. That failure reads like a bad URL or a bad token, and costs an hour before anyone suspects the header. Drift is measured in months, so nothing catches it in the moment. This protocol is the periodic catch.

## The two surfaces (this is the whole trick)

A version pin lives in **two independent places**, and fixing one does not fix the other:

| Surface | Where | Who it affects | How to fix |
|---|---|---|---|
| **Built-in default** | the `curly` script's known-service table, on [GitHub](https://github.com/wildeagency/curly) | **Future** installs — seeds `headers` when `curly init <svc>` *creates* a service | PR to the repo |
| **Your config** | `services.<svc>.headers` in `~/.curly.yaml` | **You, on every call, today** | `curly init <svc> Header=Value` |

The trap: `curly init` seeds headers **only when it creates the service**. Upgrading the curly script, or re-running `curly init` on a service you already have, will **not** re-pin an existing entry. So a machine set up two years ago keeps sending a two-year-old version header forever, no matter how current the script is. Audit *your config*, not just the repo.

## When to Run

- **Quarterly**, as a maintenance ritual.
- **On smoke-test failure** — any `curly <service>` call to a version-sensitive endpoint returning `404 invalid_request_url`, a `400` with a version hint, or `"this endpoint requires <Header> >= X"`.
- **On major-version announcement** from any pinned service.
- **On a new machine**, once, right after setup — a fresh `curly init` gives you whatever the script's table said, which may itself be stale.

No cron. Drift cadence is months; a job pinging Notion's docs page daily would be silly.

## Scope

Re-derive the in-scope list at audit time rather than trusting the table below — services get added.

```bash
# Every service on THIS machine that pins any header:
yq '.services | to_entries[] | select(.value.headers) |
    {"service": .key, "headers": .value.headers}' ~/.curly.yaml
```

Known version-pinned services:

| Service | Header | Canonical current value |
|---|---|---|
| `notion` | `Notion-Version` | https://developers.notion.com/reference/versioning (top of page) |
| `gh` | `X-GitHub-Api-Version` | https://docs.github.com/en/rest/overview/api-versions (newest in selector) |

If a new pinned service has appeared, add a row here in the same publish that fixes it.

## Procedure

For each in-scope service:

### 1. Read what you're actually sending

```bash
yq '.services.notion.headers."Notion-Version"' ~/.curly.yaml
```

This — not the script, not the docs — is what goes over the wire.

### 2. Find the canonical current stable

Visit the versioning page above. Take the **stable** value, not beta/preview. If the currently-pinned value has a published deprecation date, raise the priority.

### 3. Smoke-test the candidate per-call

`-H` overrides without persisting anything (curl takes the last value of a repeated header). Test at minimum an identity call **and** one endpoint you actually depend on — identity calls pass on almost any version and will happily hide the breakage:

```bash
curly notion /users/me -H "Notion-Version: <candidate>"

curly notion /data_sources/{id}/query -X POST \
  -H "Notion-Version: <candidate>" \
  -d '{"page_size":1}'
```

If response shapes or fields shift, note the diff — downstream protocols (`@integrations/notion`, etc.) may need updating in the same pass.

### 4. Summarize drift before changing anything

Surface one line per service and confirm before mutating:

```
notion: Notion-Version 2026-03-11 → 2026-09-04 (6 months stale, no breaking changes per changelog)
gh:     X-GitHub-Api-Version 2022-11-28 → 2024-04-01 (cosmetic field renames, opt-in)
```

If a smoke test failed, document the blocker and stop. ("Candidate drops a field the `@integrations/notion` query examples rely on — protocol update needed first.")

### 5. Re-pin your config

```bash
curly init notion Notion-Version=2026-09-04
```

Re-running `init` on an existing service updates the field in place: the token is preserved and there's no re-prompt. Any key that isn't `host`/`auth`/`auth_header`/`user_agent`/`token` is written as a **header**, which is exactly what a version pin is.

Confirm, then re-run the step-3 smoke test with no `-H` override — it must now pass on the persisted config alone:

```bash
yq '.services.notion.headers' ~/.curly.yaml
curly notion /data_sources/{id}/query -X POST -d '{"page_size":1}'
```

### 6. Fix the built-in default, so fresh installs aren't born stale

Step 5 fixed *your* machine. Every future `curly init notion` on any machine still seeds the old value until the script's known-service table changes.

Open a PR against **https://github.com/wildeagency/curly** updating the service's entry in that table (for Notion, the `NEW_HEADERS_JSON` on the `notion)` case). Reference the smoke-test evidence from step 3.

Until that PR lands, the drift is only half-fixed — say so explicitly in the audit summary rather than reporting the service as done.

### 7. Update the docs that quote a version

Grep the integration protocols for the old value and refresh any that name it inline, so the docs don't re-teach the stale pin:

```bash
curly protocol "@integrations/notion" | grep -n 'Notion-Version'
```

## What this protocol does NOT do

- **No cron.** Run it when you have a reason to.
- **No version flags in curly.** The per-call `-H` override is for *testing candidates* in step 3 — never the steady state. The steady state is the persisted header.
- **No auto-publish.** A human confirms the smoke-test output before config or the upstream repo is mutated.
- **No editing the curly script on your machine.** Service config is data. If a procedure tells you to hand-edit `~/.local/bin/curly`, it predates the YAML registry.

## Reference: the failure that motivated this protocol

On 2026-05-18, `curly notion /data_sources/<id>/query` returned `404 invalid_request_url` — not because the path was wrong, but because the pin was `Notion-Version: 2022-06-28` and `/data_sources/*` requires `2025-09-03` or later. The endpoint does not exist on that version, so the API's honest answer is "not found." Fixed to `2026-03-11`.

The lesson that generalizes: **a version-gated endpoint fails as a 404, not as a version error.** When a path you're sure about returns "not found," check the pin before you check the path.

*Part of the grooming ecosystem: the master pass is `@protocol/grooming`; sibling operations are `/search?q=tag:groom-op`.*

---

*Related: `@protocol/groom-protocols` · `@content/youtube/yifan-bth/cursor-windsurf-settings-to-5x-ais-output-quality-works-with-vs-code-too` · `@content/youtube/cole-medin/your-ai-second-brain-is-slowly-rotting-here-s-how-to-fix-it` · `@protocol/retro` · `@protocol/caper`*

---

*You're reading a protocol on [protocol.supply](https://protocol.supply) — hosted, searchable knowledge for AI agents. Think Agent Skills, as an API: bootstrap once (`curl -sL https://api.protocol.supply/bootstrap`), search (`/search?q=…`), fetch (`/@repo/slug`).*

*Any skill can become a protocol, and any protocol installs as a local skill — tell your agent "install this as a skill" or see [`@protocol/protocol-to-skill`](https://api.protocol.supply/@protocol/protocol-to-skill).*