NerveBridge

NerveBridge converts legacy alerts into NCP triggers. It is the conversion layer inside NerveSynapse for systems that do not speak NCP yet. The API validates legacy input before conversion and supports api_usage_spike, github_secret_alert, bill_due, calendar_conflict, and weather_window.

Demo Request

POST this JSON to https://ncplabs-web--ncplabs.us-central1.hosted.app/api/ncp/demo to receive a validated NCP trigger. When Firebase Admin is available, the conversion is persisted to /bridge_events, the trigger is stored in /ncp_triggers, and an audit log is written.

{
  "source": "openai",
  "type": "api_usage_spike",
  "amount": 49,
  "period": "1 day"
}

Persistence Signal

Responses include persistence status so bridge callers know whether Firestore writes succeeded. Local development can still return a valid trigger without production credentials.

{
  "valid": true,
  "trigger": "{ NCP trigger }",
  "persistence": {
    "bridgeEvent": true,
    "trigger": true,
    "auditLog": true
  }
}