NNO Docs
Concepts

Platform Lifecycle

Documentation for Platform Lifecycle

Status: Phase 1 (core transitions) + Phase 2 (KV enforcement at Gateway) Date: 2026-03-30

1. Overview

Every platform in the Neutrino system has a lifecycle status that governs what operations are allowed, what resources are accessible, and how the Gateway routes requests. The Registry service is the authoritative source for platform status.

2. States

StatusDescription
pendingPlatform record created — awaiting provisioning bootstrap
provisioningInfrastructure bootstrap in progress (CF resources, repo, DNS)
activeNormal operation — all services accessible
suspendedTemporarily disabled — operator or automated action
pending_cancellationCancellation requested — active until billing period ends
cancelledFully cancelled — resources scheduled for cleanup
deletedSoft-deleted — resources deprovisioned, data retained per policy

3. Valid Transitions [Phase 1]

   ┌─────────┐   (bootstrap)   ┌──────────────┐   (complete)   ┌──────────┐
   │ pending │────────────────►│ provisioning │───────────────►│  active  │
   └─────────┘                 └──────────────┘                └────┬──┬──┘
                                                          suspend │  │ cancel
                                                                  ▼  │
                                                           ┌──────────┐
                                                           │ suspended│◄─ restore ─┐
                                                           └────┬──┬──┘            │
                                                        cancel  │  └───────────────┘

                    ┌──────────┐                    ┌─────────────────────┐
                    │ deleted  │◄── delete ─────────│ pending_cancellation│
                    └──────────┘         │          └─────────┬───────────┘
                          ▲              │                    │ (period ends)
                          └─── delete ───┴─── ◄──────────────┘
                                     cancelled

Transition Rules (from VALID_TRANSITIONS in Registry):

ActionAllowed FromTarget Status
provisionpendingprovisioning
activateprovisioningactive
suspendactivesuspended
restoresuspendedactive
cancelactive, suspendedpending_cancellation
deletecancelled, pending_cancellation, active, suspendeddeleted

Invalid transitions return 422 Unprocessable Entity with error code INVALID_STATE_TRANSITION.

4. API Endpoints [Phase 1]

All endpoints are on the Registry service, proxied via Gateway at /api/v1/platforms/*.

MethodPathDescription
POST/platforms/:id/suspendSuspend platform — sets suspendedAt, records reason
POST/platforms/:id/restoreRestore platform — clears suspendedAt/suspensionReason
POST/platforms/:id/cancelCancel platform — sets pending_cancellation, cancels Stripe subscription
POST/platforms/:id/deleteSoft-delete — sets deleted, triggers DEPROVISION_PLATFORM job
GET/platforms/:id/lifecycleLifecycle event history (cursor-paginated)

Request body (suspend/restore/cancel/delete): \{ "reason": "optional explanation" \}

5. Side Effects

TransitionSide Effect
suspendKV write-through: platform:\{id\}:status = suspended (Phase 2)
restoreKV write-through: platform:\{id\}:status = active (Phase 2)
cancelStripe subscription cancellation (DELETE /subscriptions/\{customerId\}) at period end
deleteEnqueue DEPROVISION_PLATFORM job via Provisioning service binding

All transitions record a platform_lifecycle_events row with fromStatus, toStatus, triggeredBy, triggerType (operator_action or user_action), and optional reason/metadata.

6. Gateway Suspension Enforcement [Phase 2]

The Gateway enforces platform suspension at the edge:

  1. Read platform:\{platformId\}:status from NNO_PLATFORM_STATUS_KV
  2. If suspended or cancelled → return 403 PLATFORM_SUSPENDED
  3. Operator-role users bypass suspension checks

Phase 1: No Gateway-level enforcement — status is checked by downstream services only.

See services/gateway.md for Gateway implementation details.

7. Trigger Types

TypeDescription
operator_actionNNO operator manually triggers via console or API
user_actionPlatform owner requests cancellation
automatedSystem-triggered (e.g., billing failure, trial expiry) (Phase 2)
billing_eventStripe webhook triggers status change (Phase 2)

On this page