Skip to content

feat(api): populate claim_url on every 201 anon provision response (DOG-21)#181

Merged
mastermanas805 merged 1 commit into
masterfrom
fix/populate-claim-url-on-anon-201
May 29, 2026
Merged

feat(api): populate claim_url on every 201 anon provision response (DOG-21)#181
mastermanas805 merged 1 commit into
masterfrom
fix/populate-claim-url-on-anon-201

Conversation

@mastermanas805
Copy link
Copy Markdown
Member

Summary

DOG-21 — marketing landing page promises 'the agent surfaces the claim card directly in chat' with a clickable claim_url, but the live 201 response on `/db/new` (and every sibling) returned `claim_url: null`. Agents had to hand-construct `https://api.instanode.dev/start?t=<upgrade_jwt>` from the `upgrade_jwt` field — pushing composition responsibility into every vendor integration.

Fix

Emit `claim_url` alongside `upgrade` / `upgrade_jwt` at every 201 anonymous provision site (14 total — 7 dedup branches + 7 fresh-201 branches across db/cache/nosql/queue/vector/webhook/storage).

Semantically same URL (the `/start?t=` page handles both claim and upgrade flows); distinct field signals intent so an agent can render a 'Claim with email' CTA without parsing the upgrade URL.

Surfaces (rule 22)

  • ✅ 7 handler files — 14 emit sites (every `upgrade_jwt` site now also carries `claim_url`)
  • ✅ `openapi.go` — `claim_url` field added to all 7 `*ProvisionResponse` schemas
  • ✅ `openapi.go` — `ErrorResponse.claim_url` description widened to cover the 201-anon emit (closes the doc gap that produced the original DOG-21 report)

What did NOT change

  • `upgrade` + `upgrade_jwt` fields unchanged — back-compat preserved
  • Same URL as `upgrade` — no new endpoint, no new JWT minting
  • Authenticated paths unchanged (no anon claim flow there)

Coverage block

```
Symptom: claim_url:null on 201 /db/new despite marketing promise
Enumeration: rg -n '"upgrade":[[:space:]]+upgradeURL,' internal/handlers/
Sites found: 14 (7 dedup + 7 fresh-201)
Sites touched: 14 / 14
Coverage test: TestDOG21_ClaimURLEmittedOnEveryAnonProvision iterates the
live anonProvisionHandlerFiles registry (rule 18 — registry-
iterating, not hand-typed) and asserts claim_url count ≥
upgrade_jwt count per file; TestDOG21_OpenAPISchemaDocumentsClaimURL
pins ErrorResponse + per-service schema description
Live verified: pre-merge DOG-21 in personal-dogfood-log.md
```

Local gate

  • `go build ./...` ✅
  • `go vet ./...` ✅
  • `go test -short -run TestOpenAPI` ✅ (all 18 pass)
  • `go test -short -run TestDOG21` ✅
  • `go test -short -run Recycle` ✅

🤖 Generated with Claude Code

@mastermanas805 mastermanas805 force-pushed the fix/populate-claim-url-on-anon-201 branch from a41c32a to 19c2cfb Compare May 29, 2026 18:30
…OG-21)

DOG-21 — marketing landing page L106-109 promises "the agent surfaces the
claim card directly in chat" with a clickable claim_url, but on the live
201 response /db/new (and every sibling) returned `claim_url: null`.
Agents had to hand-construct `https://api.instanode.dev/start?t=<upgrade_jwt>`
from the upgrade_jwt field — pushing composition responsibility into every
vendor integration and producing different broken links per integration.

Fix: emit `claim_url` alongside `upgrade` / `upgrade_jwt` at every 201
anonymous provision site. Same URL semantically (the /start?t=<jwt> page
handles both claim and upgrade flows); distinct field signals intent so
an agent can render a "Claim with email" CTA without parsing the upgrade
URL from upgrade_jwt.

Surfaces covered (rule 22):
  - db.go      dedup branch + fresh-201 (2 sites)
  - cache.go   dedup branch + fresh-201 (2 sites)
  - nosql.go   dedup branch + fresh-201 (2 sites)
  - queue.go   dedup branch + fresh-201 (2 sites)
  - vector.go  dedup branch + fresh-201 (2 sites)
  - webhook.go dedup branch + fresh-201 (2 sites)
  - storage.go dedup branch + fresh-201 (2 sites)
  Total: 14 anon-provision emit sites — all carry claim_url.
  - openapi.go all 7 response schemas + ErrorResponse description
    widened to cover the 201-anon case (the pre-fix doc had it only on
    402 recycle-gate, which is the documentation gap that produced the
    original report).

What did NOT change:
  - upgrade / upgrade_jwt fields unchanged — back-compat preserved
  - Same URL as upgrade — no new endpoint, no new minting
  - Authenticated paths unchanged (no anon claim flow there)

Coverage block:
  Symptom:        claim_url:null on 201 /db/new despite marketing promise
  Enumeration:    rg -n '"upgrade":[[:space:]]+upgradeURL,' internal/handlers/
  Sites found:    14 (7 dedup + 7 fresh-201)
  Sites touched:  14 / 14
  Coverage test:  TestDOG21_ClaimURLEmittedOnEveryAnonProvision iterates the
                  live anonProvisionHandlerFiles registry (rule 18 — registry-
                  iterating, not hand-typed) and asserts claim_url count >=
                  upgrade_jwt count per file; TestDOG21_OpenAPISchemaDocumentsClaimURL
                  asserts ErrorResponse.claim_url description reflects the new
                  201 emit (rule 22 surface checklist).
  Live verified:  pre-merge: see DOG-21 in personal-dogfood-log.md ("claim_url: null
                  in the response"). post-merge curl below.

Local gate:
  - go build ./...                              PASS
  - go vet ./...                                PASS
  - go test -short -run TestOpenAPI ./internal/handlers/  PASS (all 18 pass)
  - go test -short -run TestDOG21 ./internal/handlers/    PASS
  - go test -short -run Recycle ./internal/handlers/      PASS

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 force-pushed the fix/populate-claim-url-on-anon-201 branch from 19c2cfb to 887ce7c Compare May 29, 2026 18:47
@mastermanas805 mastermanas805 merged commit e83b724 into master May 29, 2026
14 checks passed
@mastermanas805 mastermanas805 deleted the fix/populate-claim-url-on-anon-201 branch May 29, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants