Skip to content

feat(stacks): anonymous stacks expire after 6h, not 24h#214

Merged
mastermanas805 merged 1 commit into
masterfrom
feat/anon-stack-6h-ttl
May 31, 2026
Merged

feat(stacks): anonymous stacks expire after 6h, not 24h#214
mastermanas805 merged 1 commit into
masterfrom
feat/anon-stack-6h-ttl

Conversation

@mastermanas805

Copy link
Copy Markdown
Member

What

Anonymous (team_id IS NULL) stacks now expire after 6h instead of 24h.

POST /stacks/new is the existing anonymous-capable deploy path (OptionalAuthStrict; migration 005_stacks_anon.sql made stacks.team_id nullable). A stack is live compute (build pod + running services), so the anonymous free-compute window should be tighter than the 24h anon data-resource TTL. The zero-signup wedge is unchanged — an agent ships a working app URL anonymously — but the window is bounded; claim/upgrade keeps an app past 6h.

Context: this replaces an attempt to enable anonymous /deploy/new, which is not viable as a small change — that route is behind RequireAuth and deployments.team_id is NOT NULL (no anonymous row possible). Anonymous deploy already ships via /stacks/new; this PR only retunes its TTL.

Changes

  • anonymousStackTTL = 6 * time.Hour + anonymousStackTTLLabel = "6h" named constants (rule 16: one token, all call sites — expires_at write, expires_in response field, upgrade-nudge note).
  • TestStackNew_Anonymous_Returns202 asserts expires_in="6h", the 6h note copy, and expires_at ≈ now()+6h on the persisted row.

Contract sync (rule 22)

Docs updated in sibling repos (separate deploys): content/llms.txt, web/llms.txt, web/llms-full.txt, web/docs/{quickstart,api-reference}.md, web/content/landing.md.

Test evidence

  • go build ./... + go vet clean.
  • All TestStack* pass against a migrated test DB (incl. the new 6h assertions).
  • Unrelated TestQueue_* / TestBulkTwin_* failures locally are NATS/customer-DB infra artifacts (no backend in the ad-hoc local DB) — CI runs the authoritative suite with service containers.

A stack is live compute (build pod + running services), so the anonymous
window should be tighter than the 24h anon data-resource TTL. The
zero-signup wedge stays — agents ship a working app URL anonymously — but
the free compute window is bounded; claim/upgrade keeps an app past 6h.

Introduce anonymousStackTTL (6h) + anonymousStackTTLLabel ("6h") as named
constants so the expires_at write, the response expires_in field, and the
upgrade-nudge note copy stay in lock-step (rule 16: one token, all sites).

TestStackNew_Anonymous_Returns202 now asserts expires_in="6h", the 6h
note copy, and expires_at ≈ now()+6h on the persisted row.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mastermanas805 mastermanas805 merged commit a7a4c14 into master May 31, 2026
18 checks passed
@mastermanas805 mastermanas805 deleted the feat/anon-stack-6h-ttl branch May 31, 2026 11:49
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.

1 participant