Skip to content
Registry StackDocsv0.49.0

Deployment posture

View as Markdown

Every Registry Stack runtime and posture-aware CLI tool runs in one of two deployment postures: production or development. Use this page to understand how posture is declared, which configuration settings each posture accepts, how development processes mark their outputs, and why production and development databases stay separate.

Every runtime and posture-aware tool reads its posture from two inputs: the --posture flag and the REGISTRY_STACK_POSTURE environment variable. When you supply neither input, the process declares production.

Accepted values are exact, case-sensitive production and development. An empty, unknown, or differently cased value stops the process before it reads any configuration file, under code platform.posture.invalid-value. If you set both --posture (or a tool’s --production alias) and REGISTRY_STACK_POSTURE, they must declare the same posture. Any disagreement stops the process under code platform.posture.conflict.

To run a process with development-only settings on a workstation or in a test environment, declare development in one of three ways:

  • Pass --posture development on the command line.
  • Set REGISTRY_STACK_POSTURE=development in the process environment.
  • Start the project with rstack dev, which sets REGISTRY_STACK_POSTURE=development on every Registry Stack product and tool it starts.

Both rstack dev check and rstack dev start refuse to run when REGISTRY_STACK_POSTURE is set to production. Unset the variable or set it to development before running either command.

Every configuration setting a posture-aware runtime reads belongs to one of three classes.

Standard deployment settings are valid in both production and development with no posture diagnostic. Examples include TLS database connections (verified-tls), HTTPS token issuers, explicit allowedClients lists, Vault or OpenBao Transit signing, and loopback HTTP listeners or loopback HTTP issuers where a product permits them.

Development-only settings relax a security boundary for local development or automated tests. Examples include non-loopback plain HTTP issuers (allowInsecureHttp: true), private-network-plaintext database transport, development-generated audit hash keys, local field-encryption key custody, disabled document content verification, and Registry Evidence assuranceProfile: local.

Each development-only setting carries a stable <owner>.posture.<setting> code:

  • In production, check and startup refuse every development-only setting as an error diagnostic. Each diagnostic names the configuration pointer and the production replacement.
  • In development, check and startup accept the setting and report it as a warning under the same code. The --deny-warnings flag does not fail on posture warnings. Startup also writes one warning log line for each active development-only setting.

Explicit production settings are valid in every posture. They represent deliberate operator choices that relax a stricter default, such as accessTokenType: JWT, a custom scopeClaim, issuer-level actorKind or clientActorKinds, loopback HTTP issuer URLs, private-network-plaintext observer hook destinations in Document Store and Registry Scheduling, or anonymousHttps: operator-approved in Registry Adapter.

Explicit production settings never refuse and are never diagnostics or warnings:

  • check --format json lists each active one under explicitProductionSettings.
  • Startup logs one info record for each active one.
  • Unauthenticated readiness responses omit explicit production settings so callers without credentials cannot inspect internal deployment choices.

A process running in production enforces three boundaries:

  • Development-only settings. Configuration checks and startup refuse every development-only setting before opening a listener or modifying a database.

  • Development-marked peers. Production checks the response posture on product API calls and signed outbound deliveries that use the shared peer policy. For signed deliveries, it checks header bounds first, then refuses the exact lowercase development token in any Registry-Posture field, including repeated fields and comma-separated values with surrounding ASCII whitespace. This happens before the sender considers the status or body. Development checks the same bounds and applies the usual acknowledgement rules. The request body and signature use the same format in both postures. Run every service in a composed stack under one posture.

  • Development-marked tokens and task grants. A production runtime refuses a verified token or task grant that carries the registry_posture: "development" claim, recording task-grant-claims as the operator-side failed check:

    • Base Registry Engine, Registry Scheduling, Registry Evidence, registry-mcp, and breg-mcp answer HTTP 401 with problem code platform.task-grant.development-assertion and a Bearer challenge.
    • Registry Casework, Registry Messaging, Document Store, Registry Coordinator, Registry Render, Registry Adapter, Evidence OID4VCI, and Evidence OID4VP answer HTTP 401 with their standard credential-refusal response (authentication.refused, render.unauthorized, GovStack unauthorized, adapter.payment.authentication-required, or equivalent) and a Bearer challenge, keeping production bodies unchanged. On Casework single-target current-source routes, a refused paired Registry-Source-Authorization token is concealed as HTTP 404 request.not-found under visibility so target existence is not disclosed.

Processes running in development mark their runtime outputs so peers, operators, and logs can distinguish them from production:

  • HTTP responses. A development runtime adds Registry-Posture: development to its HTTP responses. A production runtime sends no Registry-Posture header.
  • Readiness responses. A successful GET /ready returns posture and developmentSettings, listing the code and configuration pointer of each active development-only setting.
  • Refusal bodies. In development, JSON refusal bodies include a failedCheck member naming the check that failed. Production refusal bodies omit failedCheck.
  • Audit journal lines. Every audit entry records "posture": "production" or "posture": "development".
  • Startup logs. Startup logs a posture declared record with posture, posture_source (flag, environment, or default), development_settings, and explicit_production_settings.
  • Task grants. Task grants signed in development include registry_posture: "development". Task grants signed in production omit that claim.

Signed hook and webhook deliveries use the same wire format in both postures. Use separate signing keys for development and production deployments, and never give production delivery keys to development producers.

Activation ledger and fresh-database limit

Section titled “Activation ledger and fresh-database limit”

Every PostgreSQL-backed product that uses the shared package activation ledger records the activating process’s declared posture in each activation row. Activation rows recorded before the posture column existed are read as production.

When you run plan, apply, or startup, the product compares its declared posture with the active ledger row. If they differ, the command refuses the database under platform.activation.posture-mismatch. Status and doctor commands report the mismatch alongside the ledger rather than serving.

Each product’s operations and configuration pages list the settings and runtime behaviours that depend on posture: