Plan / spec
Plan: queryable drop metadata
Let agents tag a drop with a few key/value pairs and find it again later, so the next turn updates the same URL instead of making a new one.
Problem
An agent that published a preview for PR #42 yesterday has no way to find that drop today except remembering its slug. It usually forgets, so every run makes a new URL and the old links go stale.
Shape of the API
POST /api/drops { "html": "…", "metadata": { "repo": "acme/web", "pr": "42" } }
GET /api/drops?metadata.repo=acme/web&metadata.pr=42
PUT /api/drops/:slug { "html": "…" } # same URL, new version
Rules
| Limit | Value |
|---|---|
| Keys per drop | 10 |
| Key length | 64 chars, [a-z0-9_.-] |
| Value | string, 256 chars |
| Visibility | owner only; never shown on the public page |
Rollout
- Migration. Add a nullable
metadataJSON column todrops. - Write path. Validate on POST; replace the whole map on PUT and PATCH.
- Read path. Filter with bound
json_extractclauses, AND across pairs. - Docs. Teach the lookup-then-update recipe in the skill and onboarding.
Not doing
- An upsert endpoint. Lookup then update covers it; add later if races bite.
- Per-version metadata. Versions already carry
context. - Nested values. Flat strings keep filtering simple.