> For the complete documentation index, see [llms.txt](https://nytshift.gitbook.io/nytshift-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nytshift.gitbook.io/nytshift-docs/arcus/arcus-execution-alert-delivery.md).

# Execution alert delivery

Use this runbook before enabling Arcus testnet entry. Alert delivery is an operational dependency, not execution authority. It never signs, submits, cancels, or reconciles an order.

## Receiver contract

1. Provision an operator-controlled HTTPS endpoint that rejects redirects and accepts a bounded JSON POST.
2. Generate a distinct random secret of 32-4096 characters. Do not reuse the signer internal token, operator secret, confirmation secret, wallet key, or provider credential.
3. Before parsing the body, reject stale timestamps and verify `x-nightshift-signature: v1=<hex>` with constant-time HMAC-SHA256 over `<x-nightshift-timestamp>.<exact raw request body>`.
4. Durably deduplicate `x-nightshift-delivery-id`, which equals `idempotency-key`. Return 2xx only after the event is durably accepted. Repeated delivery of the same ID is expected and must be safe.
5. Alert on every critical event and on `ARCUS_ALERT_OUTBOX_OVERFLOW`. Resolution events should close the matching operational incident; they do not prove account exposure without venue reconciliation.

## Signer configuration

Set both values in the private shell that launches `pnpm signer:start`:

```powershell
$env:ARCUS_ALERT_WEBHOOK_URL = "https://operator.example/nightshift/arcus"
$env:ARCUS_ALERT_WEBHOOK_SECRET = [Convert]::ToBase64String([Security.Cryptography.RandomNumberGenerator]::GetBytes(48))
```

Use the bounded tuning defaults in `.env.example` unless the receiver's reviewed SLO requires a change. The URL and secret are passed only to the isolated child, are excluded from supervisor state/logs and health, and must not be placed in repository config, prompts, browser storage, or URLs.

Run:

```powershell
pnpm preflight
pnpm signer:doctor
pnpm signer:start
pnpm signer:health
```

Healthy signer output must show `alertDeliveryEnabled=true`, `alertDeliverySafe=true`, `executionAlertOutboxOverflowed=false`, and no `lastExecutionAlertError`. Pending count may be briefly non-zero while delivery is in flight. The terminal Safety settings show only enabled/safe state and aggregate pending/delivered counts.

## Failure response

* `ARCUS_OPERATOR_ALERTING_REQUIRED`: configure both URL and secret, restart the signer, and recheck health. Do not release the entry kill switch.
* `ARCUS_OPERATOR_ALERTING_DEGRADED`: keep the kill switch active, inspect receiver availability and signer health, then wait for the same durable delivery IDs to retry. Do not delete the SQLite database or manually clear the outbox.
* `WEBHOOK_TIMEOUT`, `WEBHOOK_NETWORK_ERROR`, or `WEBHOOK_HTTP_ERROR`: repair the receiver or network path. NIGHTSHIFT retries with a bounded delay and does not retain response bodies.
* `executionAlertOutboxOverflowed=true`: keep entry locked. Restore receiver service and let existing events deliver. The signer records a critical overflow-recovery marker before clearing the durable overflow latch.
* If exposure must be reduced while alerting is degraded, the authenticated kill-switch-only emergency cancel-all remains available. Its ACK is non-final; follow the normal zero-open-order reconciliation procedure.

After recovery, require `alertDeliverySafe=true` and zero overflow before any separately authorized testnet rehearsal. Alert delivery health never replaces eligibility, funding, rate, risk, reconciliation, emergency-stop, canary, or final authorization gates.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://nytshift.gitbook.io/nytshift-docs/arcus/arcus-execution-alert-delivery.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
