BOSSTORQUERollback plan Β· 2026-05-13
CF Restructure β€” Rollback Plan v3 (LIVING DOC)

How to revert any phase, in any order, without breaking anything.

Every change in this sprint is additive. Workers at *.jason-8ce.workers.dev never died. The 5 tenant subdomains, the registry D1, the chatbot, the cron, and the rules-deploy are all reversible in <15 minutes total. This doc shows you exactly how, per phase and en bloc.

πŸ“Œ Living doc rule: this rollback plan is updated EVERY time something ships, drifts, or is rolled back. The Cowork session/task making the change is responsible for appending a "Changelog" entry below and redeploying this worker. Single source of truth.

Changelog (newest first)

What's changed since the sprint started

2026-05-13 β€” v3 update (Phase 1.0 completion + drift event)

2026-05-13 β€” v2 initial (sprint completion baseline)

The panic button β€” total revert in 15 min

If everything must come down, run these in order:

TOK="cfat_2KhI8ZseoSlZleebNGqKaaU057NTRbvwsbwUWq15de4b6b15"
ACCT="8cef3a20d2c22491d2bbbc594cf4865d"
API="https://api.cloudflare.com/client/v4/accounts/$ACCT"

# 1. Remove all 6 sprint-added custom domains
for HOST in bt sperry giftcue trnka me plan.bt; do
  ID=$(curl -s "$API/workers/domains?hostname=${HOST}.bosstorque.ai" -H "Authorization: Bearer $TOK" \
       | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['result'][0]['id'] if d.get('result') else '')")
  [ -n "$ID" ] && curl -s -X DELETE "$API/workers/domains/$ID" -H "Authorization: Bearer $TOK"
done

# 2. Delete the 8 new workers (NONE of them are customer-facing; safe to remove)
for W in bt-tenant-hub sperry-tenant-hub giftcue-tenant-hub trnka-tenant-hub personal-tenant-hub \
         bt-chat bt-registry-sync bt-cf-restructure-plan-may2026 \
         bt-cf-restructure-summary-may2026 bt-url-inventory-may2026; do
  curl -s -X DELETE "$API/workers/scripts/$W" -H "Authorization: Bearer $TOK"
done

# 3. Delete the registry D1 (or keep β€” non-destructive on its own)
curl -s -X DELETE "$API/d1/database/36578b81-7532-4fac-bf4e-57c4423493f4" -H "Authorization: Bearer $TOK"

# 4. Restore bosstorque-hub to pre-sprint version (from local git backup)
PASTE=$(curl -s --data-binary @/Users/Jason/My\ Drive*/4_Strategy*/Internal*/BT\ Hub/cf-baseline-may2026/workers/bosstorque-hub.js https://paste.rs/)
curl -s -X POST "https://mdp-api-proxy-may2026.jason-8ce.workers.dev/deploy/bosstorque-hub?raw_js=1" \
  -H "Authorization: Bearer Dtr1oXnkX4sA_AvexQwwlLFCaedgjmWQQ_oPByo4aj8" \
  -H "Content-Type: application/json" -d "{\"url\":\"$PASTE\"}"

# 5. Restore global rules to pre-sprint version
PASTE=$(curl -s --data-binary @/Users/Jason/My\ Drive*/4_Strategy*/Internal*/BT\ Hub/cf-baseline-may2026/workers/bosstorque-rules.js https://paste.rs/)
curl -s -X POST "https://mdp-api-proxy-may2026.jason-8ce.workers.dev/deploy/bosstorque-rules?raw_js=1" \
  -H "Authorization: Bearer Dtr1oXnkX4sA_AvexQwwlLFCaedgjmWQQ_oPByo4aj8" \
  -H "Content-Type: application/json" -d "{\"url\":\"$PASTE\"}"

# Done. Every original *.jason-8ce.workers.dev URL still resolves.

Effect: all custom subdomains 404, all sprint-added workers gone, bosstorque-hub restored to pre-sprint version, rules restored. Original 144 workers unaffected throughout. Total elapsed: ~10 minutes.

What lives where (state snapshot)

Current canonical sources for every credential and config

bt-notify Bearer (NOTIFY_TOKEN, BT_NOTIFY_TOKEN, REGISTRY_TOKEN)
351222a9a17e40cb5154cd7ec21bc1480b5be2d8ffb3bf816112e661371ac052
Β· Apple Note
"BT Notify Token" (title may show first content line; lookup by the title or by the long-form name with the prior cf15bdaf… prefix)
Β· CF KV
BOSSTORQUE_CONFIG (id fc91179257c34d0ca13af644aa4f3f81) β†’ key bt_notify_token
Β· Bound on
bt-notify, bt-email-monitor, bt-tree-care-copilot, bt-registry-sync, bt-tenant-hub, sperry-tenant-hub, giftcue-tenant-hub, trnka-tenant-hub, personal-tenant-hub
CF admin token (withered-poetry-d166, rolled by Jason 2026-05-13)
cfat_2KhI8ZseoSlZleebNGqKaaU057NTRbvwsbwUWq15de4b6b15
Β· Apple Note
"CF Withered Poetry Token"
Β· CF KV
BOSSTORQUE_CONFIG β†’ cf_admin_token
Β· Scopes
Workers, KV, R2, D1, DNS, Pages, Stream, Images, all major Workers products. MISSING: Cloudflare Access (Apps + Service Tokens).
Anthropic API key (working β€” different from the "Anthropic API Key" note)
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
Β· Apple Note
"BT Tree Care Copilot API"
Β· CF KV
BOSSTORQUE_CONFIG β†’ anthropic_api_key
Β· Bound on
bt-chat, bt-tree-care-copilot
Deploy relay token (UNROTATED, embedded in global rules)
Dtr1oXnkX4sA_AvexQwwlLFCaedgjmWQQ_oPByo4aj8
Β· Worker
mdp-api-proxy-may2026 (CALLER_TOKEN secret)
Backup location (12 MB, every worker source pre-sprint)
/Users/Jason/My Drive (jason@bosstorque.ai)/4_Strategy & IP/Internal Tech Stack/BT Hub/cf-baseline-may2026/
Registry D1
UUID 36578b81-7532-4fac-bf4e-57c4423493f4 Β· name bt-registry Β· 155 artifacts Β· FTS5 search Β· url_references table

Tenant model (corrected)

5 tenants, 4 personal/internal, 1 client (Sperry)

SubdomainTenantAllowlist (Phase 1 target)Notes
bt.bosstorque.aiBT Internaljason@bosstorque.aiP&L, banking, hiring, strategy. Most sensitive tenant.
sperry.bosstorque.aiSperry Tree Carejason@ + rob@sperrytreecare.com + michele@sperrytreecare.com (Michele Hatfield)Only client tenant. Active engagement. 74 artifacts including approvals and SOWs.
giftcue.bosstorque.aiGiftCuejason@ only initially; co-founders TBDPre-launch product. 13 artifacts including business plan.
trnka.bosstorque.aiTrnkajason@ only β€” Jason's personal citizenship case, not a clientCzech Β§31(3) descent case via grandfather Hans Trnka. PII-sensitive.
me.bosstorque.aiPersonaljason@ onlyConcerts, AAA, fitness. Separate from Trnka (different correspondence cadence).
Correction logged: earlier plan referenced "Lukas Trnka" β€” that person doesn't exist. The Trnka surname is Jason's grandfather (Hans Trnka, b. Bohemia, citizen by Heimatrecht 1918). Apologies for the fabrication.

Worker visibility β€” public vs internal

44 public, 118 internal

Critical for Phase 1 (Cloudflare Access). PUBLIC workers MUST stay reachable without authentication β€” they serve customer emails, public marketing, embedded asset URLs, and infra relays. INTERNAL workers go behind Access on canonical .bosstorque.ai URLs. The classification is stored on artifacts.visibility in bt-registry D1.

TenantPublicInternalExamples of public
BT1444bosstorque-site, bosstorque-rules, bosstorque-templates, bt-notify, bosstorque-powerleak-apr2026 (customer-facing assessment)
Sperry1856sperry-assets (email image server), sperry-spring-lp-apr2026 (customer LP), sperry-stock-gallery, sperry-images-apr2026, sperry-bosstorque-tos, sperry-club-thankyou (customer page)
GiftCue85getgiftcue-landing-may2026, giftcue-tos-may2026, giftcue-privacy-may2026, giftcue-marketing-may2026 (most of giftcue is public β€” pre-launch surface)
MDP22mothers-day-picker-may2026, mdp-api-proxy-may2026 (the deploy relay β€” infra-public)
Personal25seated-relay (Slack relay), fancy-frog-c42e (CF placeholder)
Trnka06All internal β€” personal citizenship records
Decision recorded: public workers' *.jason-8ce.workers.dev URLs stay permanently public. Customer emails contain these URLs (e.g. Sperry email image src tags reference sperry-assets.jason-8ce.workers.dev/<img>). Killing those would break all previously-sent emails. Phase 1 Access never goes near them.

Phase-by-phase rollback matrix

Every change reversible independently

PhaseForward action (what shipped)Rollback actionDifficulty
0a Plan publishDeployed bt-cf-restructure-plan-may2026; added pinned card to bosstorque-hubRemove card from hub; delete worker2 min
0b Slack channelRotated bt-notify token to 351222a9... (final value)Token policy now in global rules β€” do not roll back to a prior value. If broken, follow the policy: re-read from KV/Apple Note, do not rotate.N/A
0c Backup12 MB written to BT Hub Drive folder (cf-baseline-may2026)Non-destructive. Delete folder if desired. Drive trash retains for 30 days.1 min
0 DNS6 custom domains attached (bt., sperry., giftcue., trnka., me., plan.bt.)DELETE each via /workers/domains. CF auto-removes the DNS record on detach.3 min
2 Registry D1Created bt-registry D1 (UUID above), 155 artifacts indexed, url_references tableDELETE D1 via API. Or keep β€” no consumers outside this sprint. Non-destructive to other workers.1 min
3 BT Internal hubDeployed bt-tenant-hub, bound to bt.bosstorque.aiDetach domain + DELETE script. Original bosstorque-hub still serves at .workers.dev.1 min
4 Sperry hubDeployed sperry-tenant-hub, bound to sperry.bosstorque.aiSame. Legacy sperry-hub still serves at .workers.dev.1 min
5 Global navBaked into tenant hub workersReverts when those workers are deleted.included
6 GiftCue/Trnka/Personal hubs3 more tenant hubs deployed + boundSame pattern.2 min
7 AI chatbotDeployed bt-chat with Anthropic key + D1 bindingDELETE script. Chat panel in tenant hubs returns network error on use; non-fatal.1 min
8 Auto-update cronDeployed bt-registry-sync with hourly :05 cronDELETE script. Registry stops auto-updating; manual /api/register still works.1 min
1.0a Patch bosstorque-hubReplace workers.dev URLs in cards with .bosstorque.ai canonicalsRedeploy from /BT Hub/cf-baseline-may2026/workers/bosstorque-hub.js (pre-sprint snapshot) via deploy relay.2 min
1.0b Patch sperry-hubEither replace URLs in-line OR convert to 301 redirect to sperry.bosstorque.aiRedeploy from baseline snapshot.2 min
1.0c Source-replace internal refs~40 workers patched, internal→internal URL refs swapped to .bosstorque.aiRedeploy each from baseline snapshot. Per-worker reversal possible.~15 min for all
1.0d WP page patchspring-estimate page on sperrytreecare.com β€” JS inline URL swapped (or left workers.dev if customer-facing)WP REST API PATCH with original snippet. Pre-patch content saved in Drive.1 min
1.0e Deploy relay lintmdp-api-proxy-may2026 rejects workers.dev refs in submitted JSRedeploy mdp-api-proxy-may2026 from pre-lint snapshot.2 min
1 Cloudflare Access (when shipped)Create 5 Access apps, attach allowlists, enforce on canonical subdomainsDELETE each Access app via /access/apps/{id}. Workers stay reachable; auth gate removed.3 min
9 Stale cleanup (deferred)Not startedN/AN/A

Specific rollback scenarios

What to do in each likely failure mode

Scenario A β€” Bosstorque-hub renders blank or broken after a 1.0a patch

  1. Open plan.bt.bosstorque.ai or https://bt-cf-restructure-plan-may2026.jason-8ce.workers.dev to verify the hub URL is the only thing broken.
  2. Run the panic-button restore command #4 from the top of this page β€” redeploys bosstorque-hub from baseline snapshot.
  3. Hub is restored within ~30 sec.

Scenario B β€” Customer email images break (sperry-assets returning 401)

  1. This means sperry-assets accidentally went behind Access or was misclassified as internal.
  2. Check artifacts.visibility for sperry-assets: should be public.
  3. Detach any Access policy on the worker.
  4. Verify curl https://sperry-assets.jason-8ce.workers.dev/sperry-logo-oval-crop.png -I returns 200.
  5. Apologize to Sperry; the email images were down for <15 min.
Prevent this: never put Access on any worker classified as public. The Phase 1 setup script must filter by artifacts.visibility = 'internal' before attaching Access policies.

Scenario C β€” Token thrash returns

  1. If a session starts auto-rotating bt-notify again, it's not following the global rules. First action: ping #bt-ops with the rotation source so we know which task did it.
  2. Re-set bt-notify NOTIFY_TOKEN to the canonical value from BOSSTORQUE_CONFIG KV.
  3. Update the offending session/task with a hard reminder of the policy in its system prompt.

Scenario D β€” Cloudflare Access locks Rob/Michele out of sperry.bosstorque.ai

  1. Most likely cause: their email isn't on the allowlist, or they're using a different email (work vs personal).
  2. Open CF Zero Trust β†’ Access β†’ Applications β†’ sperry.bosstorque.ai β†’ Policies β†’ Allow.
  3. Add the email they actually used. Save.
  4. Have them retry within 60 sec. Refresh clears the prior 403.
  5. If still locked out: temporarily remove the Access policy. Sperry hub is then public β€” patch & re-enable Access after their email is confirmed.

Scenario E β€” Registry D1 corrupted or wrong data

  1. D1 is reconciliable. bt-registry-sync cron rebuilds the artifacts table from CF workers_list every hour.
  2. Manual trigger: curl -X POST https://bt-registry-sync.jason-8ce.workers.dev/sync -H "Authorization: Bearer <sync_token from KV>"
  3. If a destructive op happened (UPDATE without WHERE): D1 has point-in-time recovery; restore via dashboard.

What CANNOT be rolled back

Be aware before proceeding

Verification commands after any rollback

Run these to confirm clean state

TOK=$(curl -s "https://api.cloudflare.com/client/v4/accounts/8cef3a20d2c22491d2bbbc594cf4865d/storage/kv/namespaces/fc91179257c34d0ca13af644aa4f3f81/values/cf_admin_token" \
  -H "Authorization: Bearer cfat_2KhI8ZseoSlZleebNGqKaaU057NTRbvwsbwUWq15de4b6b15")

# 1. All 144 original workers still alive?
curl -s "https://api.cloudflare.com/client/v4/accounts/8cef3a20d2c22491d2bbbc594cf4865d/workers/scripts?per_page=200" \
  -H "Authorization: Bearer $TOK" | python3 -c "import sys,json; print('Workers in CF:', len(json.load(sys.stdin)['result']))"

# 2. Original bosstorque-hub responds?
curl -s -o /dev/null -w "bosstorque-hub: HTTP %{http_code}\n" https://bosstorque-hub.jason-8ce.workers.dev

# 3. Customer-facing public URLs responding?
for HOST in sperry-assets sperry-spring-lp-apr2026 bosstorque-site mothers-day-picker-may2026; do
  curl -s -o /dev/null -w "$HOST: HTTP %{http_code}\n" https://$HOST.jason-8ce.workers.dev/
done

# 4. bt-notify still functional?
NOTIFY=$(curl -s "https://api.cloudflare.com/client/v4/accounts/8cef3a20d2c22491d2bbbc594cf4865d/storage/kv/namespaces/fc91179257c34d0ca13af644aa4f3f81/values/bt_notify_token" \
  -H "Authorization: Bearer $TOK")
curl -s -X POST https://bt-notify.jason-8ce.workers.dev/send -H "Authorization: Bearer $NOTIFY" \
  -H "Content-Type: application/json" \
  -d '{"channel":"bt-ops","text":"rollback verification probe","source":"rollback"}'