NSC Labs
Practical README

Copr Gateway

Last updated: 2026-04-18

copr_gateway is a commercial container image product for running the copr bounded runtime behind a small HTTP gateway. It is designed for single-container deployment, exposes a compact JSON control surface, and uses SQLite-backed continuity under /data.

Status: Private distribution

Go + Rust + SQLite Container-first Thin status Step-driven

License summary

copr_gateway is licensed, not sold.

The license covers the purchasing customer and its affiliates under common control.

Service providers may operate the software on the customer’s behalf, but do not receive independent license rights.

copr_gateway may be used in the customer group’s business operations, including internet-facing deployments and customer-serving systems.

copr_gateway itself may not be resold, sublicensed, or transferred as a standalone product without written permission.

Purchase or subscription does not guarantee future updates, upgrades, downgrades, bug-fix releases, support, or continued development unless expressly stated in the applicable order, Marketplace offer, or Seller support policy.

Optional operational surfaces may be offered separately from time to time. If an optional capability is offered for a separate fee, it is included only when expressly covered by the applicable order, Marketplace offer, or Seller support policy.

Use of copr_gateway is governed by the applicable order and the EULA.

What it is

Bounded runtime

Small HTTP surface over a bounded runtime with explicit session and step control.

Continuity

SQLite-backed continuity across calls and restarts through /data.

Container-friendly

Single-container deployment model with stable JSON responses for wrappers and internal tooling.

What it does

Deployment model

copr_gateway is intended to run as a single container.

Default runtime configuration:

Environment variables:

Quick start

Build the container:

docker build -f nsc_mai/crates/copr_gateway/Dockerfile -t copr_gateway:2026.1.0 .

Run it:

docker run --rm \
  -p 8080:8080 \
  -v $(pwd)/data:/data \
  -e COPR_BIND_ADDR=:8080 \
  -e COPR_API_BIN=/usr/local/bin/copr_api \
  -e COPR_DB_PATH=/data/copr.sqlite3 \
  -e COPR_RECOVERY_ENABLED=0 \
  -e COPR_RECOVERY_DB_PATH=/data/copr_recover.sqlite3 \
  -e COPR_REPLAY_ENABLED=0 \
  -e COPR_REPLAY_DB_PATH=/data/copr_replay.sqlite3 \
  -e COPR_STATUS_THIN=true \
  copr_gateway:2026.1.0

API overview

GET /health

Minimal liveness check.

{"ok":true}

GET /status

Returns grouped runtime status.

Current top-level groups:

The status surface is intentionally thin by default.

POST /open-note

Open or re-enter a note session.

{"note_id":42}

POST /step

Advance the runtime by one bounded step.

Request with defaults:

{}

Request with explicit bounds:

{"max_edges":4,"max_results":4}

POST /step-with-replay

Advance the runtime by one bounded step and append replay through the replay add-on surface.

Request with defaults:

{}

Request with explicit bounds:

{"max_edges":4,"max_results":4}

POST /close-session

Close the active session.

Example calls

curl -s http://127.0.0.1:8080/health
curl -s http://127.0.0.1:8080/status
curl -s -X POST http://127.0.0.1:8080/open-note \
  -H 'Content-Type: application/json' \
  -d '{"note_id":42}'
curl -s -X POST http://127.0.0.1:8080/step \
  -H 'Content-Type: application/json' \
  -d '{}'
curl -s -X POST http://127.0.0.1:8080/step-with-replay \
  -H 'Content-Type: application/json' \
  -d '{}'
curl -s -X POST http://127.0.0.1:8080/close-session

Replay examples

These examples apply only when the replay add-on is licensed and replay routes are enabled.

curl -s -X POST http://127.0.0.1:8080/step-with-replay \
  -H 'Content-Type: application/json' \
  -d '{}'
curl -s http://127.0.0.1:8080/replay/entries
curl -s http://127.0.0.1:8080/replay/latest
curl -s -X POST http://127.0.0.1:8080/replay/stop-admitting
curl -s -X POST http://127.0.0.1:8080/replay/start-admitting

Persistence

The runtime uses SQLite for continuity across calls.

Default container path:

When recovery or replay are enabled, deployments may also set separate recovery and replay SQLite paths.

This lets the runtime preserve session and state information across subprocess-style API calls.

Operational notes

Scope

This package is:

This package is not:

Version