Skip to content

feat: bypass stake — default mcp_status='active' (GHB-196)#98

Merged
Gastonfoncea merged 6 commits into
mainfrom
gastonfoncea09/ghb-196-bypass-stake-en-signup-mcp_statusactive-por-default-hasta
May 17, 2026
Merged

feat: bypass stake — default mcp_status='active' (GHB-196)#98
Gastonfoncea merged 6 commits into
mainfrom
gastonfoncea09/ghb-196-bypass-stake-en-signup-mcp_statusactive-por-default-hasta

Conversation

@Gastonfoncea
Copy link
Copy Markdown
Collaborator

Closes GHB-196. Related: GHB-195 (re-enable stake when Anchor program redeployed).

Summary

The on-chain init_stake_deposit instruction is missing from the Anchor program deployed in devnet (the binary predates the stake commits). Every new signup hits AnchorError: InstructionFallbackNotFound and cannot mint an API key.

Until the program is redeployed (tracked separately in GHB-195), this PR parks the stake feature in the product: new profiles default to mcp_status='active' so they skip the stake step entirely.

Changes

  1. DB migration (packages/db/drizzle/0025_bypass_stake.sql) — change the DEFAULT of profiles.mcp_status from 'pending_stake' to 'active' and backfill existing 'pending_stake' rows.
  2. Frontend redirect (frontend/app/app/stake/page.tsx) — /app/stake redirects to /app/credentials. StakeClient.tsx preserved as frozen code.
  3. UI cleanup (CredentialsClient.tsx, ApiKeysSection.tsx, agents/page.tsx) — drop the stakeRequired banner, disabled prop, and collapse the stake step in the /agents landing (renumber Paso 3 → Paso 2, update meta/hero to "2 pasos").

Frozen for reactivation (NOT touched)

  • frontend/lib/stake-route-core.ts and frontend/app/api/stake/route.ts
  • frontend/app/app/stake/StakeClient.tsx
  • frontend/app/api/gas-station/sponsor/route.ts and packages/shared/src/gas-station/
  • apps/mcp/lib/auth/middleware.ts (still rejects non-active, protecting suspended)
  • All backend gates checking mcp_status === 'active'

Migration status

Already applied manually to prod via Supabase SQL Editor (the standard pattern in this repo for migrations 0017-0024 per GHB-190's tech-debt note). Verified post-apply:

  • column_default on profiles.mcp_status is now 'active'::agent_status
  • 18 profiles in prod, all in active state, zero in pending_stake

pnpm db:migrate was NOT used because the Drizzle journal in this repo has known gaps (0023, 0024 entries missing) and the tooling currently fails silently when applying against prod. Cleaning up the migration workflow is tracked in GHB-190. The 0025_bypass_stake.sql file + journal entry are committed for documentation and future automation; the actual schema change is already live.

Test plan

  • pnpm typecheck (workspace-wide) passes
  • pnpm test (workspace-wide) passes
  • pnpm --filter frontend build succeeds
  • Local: /app/stake returns 307 → /app/credentials
  • Local: /agents shows 2 "Paso" sections (was 3)
  • Migration applied to prod: default = 'active', zero pending_stake rows
  • Post-deploy: signup new dev → lands on /app/credentials directly → mint API key → whoami against mcp.ghbounty.com returns mcp_status: 'active'

Spec & plan

  • Spec: docs/superpowers/specs/2026-05-17-bypass-stake-mcp-status-design.md
  • Plan: docs/superpowers/plans/2026-05-17-bypass-stake-mcp-status.md

Reversal plan

When GHB-195 reactivates stake:

  1. New migration: ALTER TABLE profiles ALTER COLUMN mcp_status SET DEFAULT 'pending_stake'
  2. `git revert` commits 2 + 3 (un-redirect, restore banner/prop)
  3. Total revert effort: ~30 min

🤖 Generated with Claude Code

Gastonfoncea and others added 6 commits May 17, 2026 19:28
Diseño aprobado en brainstorming: cambiar el default de profiles.mcp_status
de 'pending_stake' a 'active' via DB migration, migrar los users existentes
en pending_stake al mismo SQL, redirect /app/stake → /app/credentials,
remover el banner stakeRequired + prop disabled del flow de credentials.

Stake infra (StakeClient, /api/stake, gas-station validator) queda
congelada para reactivar via GHB-195 cuando se redeploy el programa
Anchor.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
18 tareas en 6 fases: schema + migration → redirect /app/stake →
cleanup UI credentials → workspace typecheck/test/build → PR (con
consent humano) → migration aplicada por humano post-merge.

Cada commit del PR es self-contained (3 commits: db migration, redirect,
UI cleanup) para revert quirúrgico si algo se rompe.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Migration 0025_bypass_stake: change the DEFAULT of profiles.mcp_status
from 'pending_stake' to 'active' and backfill existing pending_stake
rows. Unblocks new signups from the broken on-chain init_stake_deposit
step (the Anchor program deployed on devnet predates that instruction).

The stake feature is parked, not removed: StakeClient, /api/stake, and
the gas-station validator are frozen for reactivation via GHB-195.

Migration must be applied by a human (pnpm db:migrate against prod
Supabase) per CLAUDE.md — CI does not run migrations.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The implementer used a 2025 timestamp (1747526400000) by mistake; should
be current (2026-05-17). Updated to 1779057697000. Drizzle does not use
`when` for ordering, but consistent timestamps help humans reading the
journal.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Stake feature parked per GHB-195 (Anchor program redeploy pending).
StakeClient.tsx preserved as frozen code; only page.tsx changes to a
thin redirect so users with old bookmarks land somewhere sensible
instead of hitting a 404.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
CredentialsClient.tsx: remove the 'Activá tu cuenta de MCP' banner and
the stakeRequired derivation. ApiKeysSection: drop the 'disabled' prop
and its consumers (Button disabled + tooltip). Audit ConnectedAppsSection
for the same prop (no-op if absent).

Public /agents landing: collapse the 'Paso 2 — Activá tu cuenta' stake
step; renumber 'Paso 3 — Conectá tu agente' as the new Paso 2. Update
hero text from '3 pasos' to '2 pasos' and metadata description.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Gastonfoncea Gastonfoncea requested a review from tomazzi14 as a code owner May 17, 2026 23:06
@vercel
Copy link
Copy Markdown

vercel Bot commented May 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
gh-bounty-frontend Ready Ready Preview, Comment May 17, 2026 11:08pm
ghbounty-mcp Ready Ready Preview, Comment May 17, 2026 11:08pm

@Gastonfoncea Gastonfoncea merged commit ee76e99 into main May 17, 2026
5 checks passed
@Gastonfoncea Gastonfoncea deleted the gastonfoncea09/ghb-196-bypass-stake-en-signup-mcp_statusactive-por-default-hasta branch May 17, 2026 23:09
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