# Private Arena asset runtime

This additive host exposes the existing canonical issuer-collection reader and
draft coordinator on Core loopback. It does not replace the shared Core API,
Identity provider or website. It starts no trading, wallet, chain or background
workers, and exposes no generic asset creation, minting or publication routes.
It must use the existing canonical asset database and proof-signing identity when
activated; it is not another registry or asset authority.

## Source and default boundaries

`WSGI_Arena_Assets.py` imports the actual canonical handlers and serves only:

- `GET /health`: release and startup module SHA-256 values, configured flags and
  explicit `database_checked:false`, `participants_checked:false`. Health is not
  permission, migration, database readiness or real asset acceptance.
- `POST /asset-registry/issuer-collections`: existing provider-only signed reader.
- `POST /asset-registry/arena-drafts`: existing exact signed coordinator.

Bind `127.0.0.1:3216` only. The application also rejects non-loopback socket peers,
all browser credentials, proxy identity headers and query parameters. It does
not use ProxyFix or the general Core authentication stack. All responses, including
errors, are private/no-store. The supplied systemd unit disables access logging;
never add request-body, signature or credential logging. Existing per-handler
bounds and signatures still apply. No database connection/migration, key creation,
permission or participant call occurs during import or the inactive boundary check.

## Additive deployment

Use `/home/electrical/hybrid-arena-assets/releases/<full-source-SHA>` and an atomic
`current` symlink. Keep a separate mode-0700 `runtime/` directory and mode-0600
`runtime/service.env`. The first release contains only:

- `WSGI_Arena_Assets.py` and its service/runbook;
- canonical `Handler_Assets.py`, `Handler_AssetIssuerCollections.py` and
  `Handler_ArenaAssetDrafts.py` under `CoreHandlers/`;
- their existing `DBHandler.py` and `Helpers` dependencies;
- the relevant asset migrations for later reviewed application, never auto-run.

Build the exact checked main commit with
`python scripts/package-arena-assets.py <full-source-SHA> /tmp/arena-assets.tar.gz`.
The fixed allowlist reads committed Git objects, excludes working-tree changes and
runtime files, and writes `release-manifest.json` with the source revision and
per-file SHA-256 values. Retain that artifact and compare its manifest and the four
returned health module hashes with the committed source.
Do not copy a development `.env`, tests, fixtures, keys or database into the release.
Use the existing compatible Core Python environment as a read-only dependency,
record its exact target, and retain that dependency release until the asset runtime
moves to its own checked environment. Do not change shared packages in place.

The initial environment contains the actual source SHA and only these false gates:

```text
ARENA_ASSET_RUNTIME_RELEASE=<full-source-SHA>
ASSET_ISSUER_READ_ENABLED=false
ARENA_ASSET_COORDINATOR_ENABLED=false
ASSET_CREATION_RECEIPTS_ENABLED=false
```

There is no database configuration, signer or service key in the inactive rollout.
Install `deploy/hybrid-arena-assets.service` after checking the service name/port
are unused. Run a canary import using the chosen Python dependency, then start only
this new service. Check loopback health and expected module hashes; both unsigned
POST operations must return 503 and no-store. Remote peer/browser/proxy requests
must be rejected. Existing Core, Identity and Arena health must remain unchanged.
No public gateway, Nginx or DNS route is needed or authorized by this private host.

Rollback stops/disables this one service and restores its prior current symlink
when one exists. Preserve runtime configuration and journals. Do not restart or
roll back the shared Core API or Identity as part of this isolated rollout.

## Connected activation is separate

Before enabling either capability, bind the environment to the **existing**
canonical `DB_HOST`, `DB_NAME`, `DB_USER`, `DB_PASSWORD` and, for actual creation,
the existing `ASSET_PROOF_SIGNING_SECRET`. Reuse the established proof identity;
do not generate another signer or point to an empty replacement database. The
Database helper reads environment at import, so reviewed configuration changes
require restarting only this host. The packaged release must contain no `.env`.

Apply only reviewed additive asset/issuer-read/creation-receipt/coordinator
migrations to the identified canonical database after a consistent backup.
Preserve old records and verify the current asset schema and issuer bindings.
Provision separate provider-read, Arena-coordinator, Identity-consumption and
Star Quest acceptance keys through their existing private operator channels.
Never send them through issue comments or browser APIs. Configure the exact Arena
registered app at both the coordinator and owner BFF; do not derive identity from
an alias, email or caller-supplied profile/vault.

Then verify the native Identity issuer lookup/provider/portal, actual collection
ownership, actual explicit personal approval, studio grant/acceptance permit,
original-request recovery after interruption, cancellation/revocation ordering,
one canonical DRAFT and independent readback. The website can use this exact
loopback origin after those prerequisites are coordinated. A deployed inactive
host is not a passed real issuer/studio acceptance test.

Funding, Stripe, minting, public marketplace publication, sales and all value
movement remain separately paused. The host has no endpoints for those actions.
