> 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/release-and-readiness/live-feed-soak.md).

# Live-feed soak and restart proof

Use this runbook for the release soak after the supervised loopback production build is healthy. The runner reads only NIGHTSHIFT's normalized public APIs and writes private aggregate evidence to `%USERPROFILE%\.nightshift\evidence\live-feed-soak-v1.json` on Windows or `~/.nightshift/evidence/live-feed-soak-v1.json` elsewhere. It never stores payloads, provider endpoints, symbols, accounts, wallet addresses or credentials.

## Production qualification

Start the default 24-hour run. Existing evidence is preserved unless `--replace` is explicit.

```powershell
pnpm local:status
pnpm soak:live -- --replace
```

The default cadence is 15 seconds, the request timeout is 10 seconds and one supervised web-child restart is requested after five minutes. Follow progress from another shell:

```powershell
pnpm soak:status
```

If the runner is interrupted, resume with the exact original settings plus `--resume`; do not use `--replace`. For the defaults:

```powershell
pnpm soak:live -- --resume
```

Final verification returns success only for a completed production-qualified run:

```powershell
pnpm soak:verify
```

Exit code `2` means the evidence is structurally valid but not production-qualified. Read its fixed reasons; never edit the evidence to clear them.

## Short operational rehearsal

A short run verifies mechanics but can never satisfy the 24-hour release gate:

```powershell
pnpm soak:live -- --duration-ms 45000 --interval-ms 5000 --restart-at-ms 15000 --checkpoint-every 1 --allow-short --replace
```

`operationalPass=true` proves the normalized probes and controlled restart worked for that short window only. `DURATION_BELOW_24_HOURS` remains mandatory.

## Failure handling

* `UNSAFE_RUNTIME_OBSERVED`: stop immediately. Confirm both execution scopes and both mainnet flags are disabled before creating new evidence.
* `PROBE_NEVER_CONVERGED` or `AVAILABILITY_BELOW_THRESHOLD`: inspect `/api/market/health`, `/api/rhc/providers` and the relevant provider runbook. Payloads are intentionally absent from soak evidence.
* `FORCED_RESTART_NOT_PROVEN`: inspect `pnpm local:status` and `nightshift.log`; a restart command completing without a changed healthy child generation is a failure.
* `RESTART_CONVERGENCE_TOO_SLOW`: keep execution disabled and diagnose provider/history recovery before retrying.
* `RHC_PRODUCTION_TOPOLOGY_NOT_READY`: configure two independent managed Robinhood providers, live WSS and archive-attested reads. The public endpoint is diagnostic only.
* `SAMPLE_GAP_EXCEEDED` or `SAMPLE_COVERAGE_INCOMPLETE`: the observation window is not continuous enough. Preserve the evidence and start a new run after fixing host sleep/process interruption.

The SHA-256 chain detects local mutation but is not a signature. Keep the final file with release evidence and record its `runId` and `finalDigest`; do not commit the evidence file or copy it into source, logs or browser storage.

## Supervised production-service runner

For the deployed systemd service, use `scripts/production-service-soak.mjs` with `infra/systemd/nytshift-production-soak.service`. It reuses the same probe, hash-chain and acceptance library, reads only the loopback public API, writes to the private `/var/lib/nytshift/soak` boundary and proves its controlled restart through a changed healthy `startedAtMs`. The service has no environment file and receives no endpoint, wallet, signer, fee or execution credential.

Install the wrapper and `live-feed-soak-lib.mjs` under a versioned `/opt/nytshift/soak-tools/<revision>` directory, verify their hashes and the unit, create `/var/lib/nytshift/soak` as root mode `0700`, then enable only the one-shot long-running service. A service restart resumes only mutable evidence with the exact original settings; completed or failed evidence is never replaced. Use a distinct output filename for any short rehearsal.


---

# 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/release-and-readiness/live-feed-soak.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.
