Skip to content

v2 handoff: staging validated, ready for production cutover #48

@arc0btc

Description

@arc0btc

@whoabuddy — aibtc-projects v2 is built, tested, and deployed to staging. Here's everything you need to decide on the cutover.


What was built

Full rewrite of aibtc-projects as a proper Cloudflare Worker with Durable Objects. See #44 for the full overview.

Branch: v2
Staging URL: https://aibtc-projects-staging.stacklets.workers.dev


What's different

v1 v2
Runtime CF Pages Functions CF Worker
Storage KV single JSON blob Durable Object SQLite (normalized tables)
Scheduling GitHub Actions cron every 15min DO alarm chain (self-scheduling)
Language JavaScript TypeScript (strict)
Routing Manual fetch handler Hono
Tests None 148 vitest tests (91 unit + 57 integration)
CI/CD Single deploy-on-push release-please + staging/prod split
Observability None worker-logs service binding
Concurrency Optimistic locking (409 conflicts) DO single-threaded (zero conflicts)

Feature parity test results

148/148 tests pass on staging. Full coverage:

  • All CRUD operations (create, read, update, delete items)
  • All 8 PUT actions: claim, unclaim, rate, add_goal, complete_goal, transfer_leadership, claim_leadership, deliverable
  • Activity feed (GET /api/feed)
  • Mention details (GET /api/mentions)
  • Reorder (POST /api/reorder)
  • Agent auth middleware
  • Static assets (index.html, how.html)
  • DO alarm chain (background tasks)

4 intentional differences from v1 (see #47 for full details):

  1. Response envelope on GET /api/items simplified (removed writeVersion/version — concurrency artifacts)
  2. GET /api/mentions unified response shape (was split live/archive, now unified list)
  3. GET /api/feed adds cursor field for pagination (backward compatible)
  4. /api/health endpoint added (new, wasn't in v1)

Architecture (state diagrams)

Full Mermaid diagrams in research/aibtc-projects-v2-architecture.md on the arc-starter repo. Key flow:

Client → Hono Router → Auth Middleware → Durable Object → SQLite
                                        ↑
                              DO Alarm (self-scheduling)
                              → GitHub API
                              → aibtc.com/api

Migration plan (when ready)

Step 1: Run data migration

POST https://aibtc-projects-staging.stacklets.workers.dev/api/migrate
Authorization: Bearer <REFRESH_KEY>

Reads all v1 KV data, writes to DO SQLite. Idempotent.

Step 2: Validate migrated data
Compare item count and spot-check 3-5 items between v1 and v2.

Step 3: DNS cutover
Point custom domain (or aibtc-projects.pages.dev) to v2 Worker.

  • In Cloudflare dashboard: update the Worker route or custom domain binding
  • Or: create a new Worker route pointing to aibtc-projects Worker

Step 4: Delete GitHub Actions refresh cron
Remove .github/workflows/ cron job that hits /api/refresh. The DO alarm handles scheduling automatically.

Step 5: Monitor

  • Check worker-logs for errors in first 24h
  • Watch DO alarm chain fires (should see GitHub refresh events in activity feed)
  • Keep v1 KV namespace for 30 days as read-only backup, then delete

Rollback: Revert DNS to v1 Pages deployment. v1 KV is untouched throughout.


What to test on staging

  1. Open https://aibtc-projects-staging.stacklets.workers.dev — frontend should load
  2. Submit an item (requires AIBTC agent auth)
  3. Check the activity feed updates
  4. Wait 15min — verify GitHub data refreshes in background (alarm chain)
  5. Check /api/health — should show DO status and item count

Open issues resolved by v2


What I need from you

  1. Review staging — does it look right? Spot any issues?
  2. Cutover timing — when do you want to go live?
  3. Domain decision — keep aibtc-projects.pages.dev or move to Worker route?
  4. GitHub Actions cleanup — confirm which workflow file runs the refresh cron so I can remove it on merge

No rush — v1 is still live and stable. v2 stays on staging until you're ready.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestv2v2 rewrite tracking

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions