Operations
Operating a product means starting it, watching it, and keeping its runtime state visible, and this page states how a LiteSpec product does each: local startup, diagnostics, and the operating records that answer failures. It applies to everyone who operates a release and to any change that touches schema, external dependencies, or background work. A product that follows it stays observable with one maintainer on call; deployment, rollback, backup, restore, alerts, runbooks and the alerting regime live in the Delivery extension for projects that select it.
On this page
Concepts#
Operating Records#
Everything this page asks an operator to know lives in operating records with a fixed home and one writer. A person writes the operations log and the secret inventory; the model builder writes the sub-processor list from the project records. Only the operations log keeps the past: the others describe the present.
Operations Log#
The operations log is append-only: one file per month under .litespec/implementation/operations/log/, named YYYY-MM.md, with entries appended and never edited. It records branch-protection bypasses, runbook rehearsals, restores, production deployments, and incidents, so the dated rehearsal each runbook needs has one home.
Secret Inventory#
The secret inventory is hand-written at .litespec/implementation/operations/secrets.json. Each entry names the secret, where it lives, and its next rotation date, and never the value itself. Each rotation date is reviewed before it passes. An entry has this shape:
{
"name": "database-password",
"location": "production vault",
"rotationDate": "2027-02-01"
}Sub-Processor List#
The sub-processor list names every provider that processes personal data for the product. The model builder renders it from the project's provider actors, the actor records that name its providers, on .litespec/implementation/operations/sub-processors.md. Nobody edits it by hand.
Standards#
Start the Stack with One Local Command#
rulerequiredguidancelitespec/quality/operations#start-the-stack-with-one-local-commandA workspace MUST start WebApi, PostgreSQL, configured frontends, and its Worker where one exists, with one local command named in the consumer AGENTS.md.
Applies toartifact: any
Why
A stack that needs several terminals and a wiki page starts differently for every developer, and the differences become bug reports nobody can reproduce. One named command brings WebApi, PostgreSQL, the frontends, and the background Worker up together, so every developer and every agent starts from the same running system. The baseline command is Aspire's AppHost, with ServiceDefaults supplying the shared discovery, health, resilience, and telemetry defaults its resources rely on. A workspace that orchestrates the same set another way satisfies this rule with its own command: the obligation is that one command brings the stack up, not that one tool does.
Checka reviewer answers
Reviewed forDoes one command named in the consumer AGENTS.md start WebApi, PostgreSQL, the frontends, and the Worker? Look at AGENTS.md and the AppHost project.
Marked guidance: a reviewer answers this question.
Emit Correlated Diagnostics#
rulerequiredguidancelitespec/quality/operations#emit-correlated-diagnosticsA host MUST emit structured logs, traces, and metrics, with correlation identifiers on logs and traces and service labels on metrics.
Applies toartifact: any
Why
Each running service is a host, and one request often crosses several. Logs and traces carry timestamp, level, service, environment, trace identifier, and span identifier, and metrics carry service and environment labels. The correlation identifiers let one request be followed across every host it touched, which is the only trail a cross-host failure leaves. Stable event names keep dashboards working across releases instead of breaking each time a message is reworded.
Checka reviewer answers
Reviewed forDo logs and traces carry correlation identifiers, and do metrics carry service labels? Look at one request's logs, traces, and metrics in the telemetry backend.
Marked guidance: a reviewer answers this question.
Point Every Runtime Record at Its Use Case#
rulerequiredguidancelitespec/quality/operations#point-every-runtime-record-at-its-use-caseA host MUST carry the use-case identity of every mediated message, resolved from the generated registry, as litespec.use_case on its span, its log scope, and its error report.
Applies toartifact: any
Why
A trace identifier joins the runtime records of one request to each other, but not to the specification: a person holding a slow span, a log line, or an error report still has to guess which use case it was. The identity is already a generated value, so a pipeline stage reads it from the registry once per message and stamps it on every surface under one name, and reactions, jobs, and outbox consumers carry it as well as requests. A metric carries it only as a label on an instrument whose series stay bounded: a duration histogram labeled by every use case multiplies its series by hundreds, so request instruments label by module instead.
Example
A Claimwick request to submit an expense opens a span and a log scope carrying litespec.use_case = use-case/spending.submit-expense, and an unhandled failure inside it reaches the error tracker with the same tag.
Checka reviewer answers
Reviewed forDoes a pipeline stage stamp litespec.use_case on the span, log scope, and error report of each mediated message? Look at the mediator pipeline and one error report per host.
Marked guidance: a reviewer answers this question.
Pass Trace Context in the W3C Format#
rulerequiredguidancelitespec/quality/operations#pass-trace-context-in-the-w3c-formatA host MUST read and write trace context as the W3C Trace Context traceparent and tracestate headers, using one configured propagator.
Applies toartifact: any
Why
An identifier that each host formats its own way correlates nothing across the boundary between them. traceparent is the format OpenTelemetry implements and every managed backend accepts, so a trace crosses a frontend, an API, a background host, and a provider without translation. One propagator, the component that reads and writes the headers, is the part that matters: two configured propagators produce two identifiers for one request, and the trace splits at whichever hop reads the other one.
Example
The trace identifier in a Problem Details response is the trace-id field of the current traceparent, which is what litespec/backend/api#return-stable-problem-details returns.
Checka reviewer answers
Reviewed forDoes one configured propagator read and write W3C trace context on every host? Look at the telemetry setup of each host.
Marked guidance: a reviewer answers this question.
Separate Liveness and Readiness#
rulerequiredguidancelitespec/quality/operations#separate-liveness-and-readinessA host MUST expose /health/live without dependency checks and /health/ready including its critical dependencies.
Applies toartifact: any
Why
Liveness answers whether the process is alive; readiness answers whether it can safely serve traffic. When a dependency fails, readiness fails so the orchestrator stops sending traffic, while liveness stays true so the orchestrator does not restart a healthy process. One endpoint for both forces a choice between serving traffic the application cannot handle and restarting a process that only needs its dependency back.
Checka reviewer answers
Reviewed forDoes /health/live answer without dependency checks, while /health/ready includes the critical dependencies? Look at the health check registrations of each host.
Marked guidance: a reviewer answers this question.
Operate Background Work Independently#
rulerequiredguidancelitespec/quality/operations#operate-background-work-independentlyA Worker MUST publish its own liveness, readiness, processing rate, failure count, retry count, oldest pending age, and shutdown behavior.
Applies toartifact: any
Why
A Worker fails on its own schedule: its queue grows, its retries climb, its oldest item ages, while WebApi keeps answering health checks. Without its own liveness, readiness, processing rate, failure count, retry count, oldest pending age, and shutdown behavior, the failure stays invisible until the backlog is the incident. WebApi readiness otherwise hides a failed Worker while the queue grows unobserved.
Checka reviewer answers
Reviewed forDoes the Worker publish its own health, processing rate, failure count, retry count, oldest pending age, and shutdown behavior? Look at the Worker's health endpoints and metrics.
Marked guidance: a reviewer answers this question.
Bound External Calls#
rulerequiredguidancelitespec/quality/operations#bound-external-callsEvery network call MUST declare an explicit timeout and cancellation path, with retries only for idempotent operations named by a bounded retry policy.
Applies toartifact: any
Why
Every network call waits on a system the product does not control. Without an explicit timeout and cancellation path, one slow provider holds a request thread until that unrelated system recovers, and each held thread is one less thread for healthy requests. Retries stay bounded and idempotent-only, because retrying a call that already acted repeats the act.
Checka reviewer answers
Reviewed forDoes each network call declare a timeout, a cancellation path, and bounded retries for idempotent operations only? Look at each HTTP client registration and its resilience policy.
Marked guidance: a reviewer answers this question.
List Every Sub-Processor#
rulerequiredguidancelitespec/quality/operations#list-every-sub-processorA release MUST call only providers the generated sub-processor list names from the project's provider actors.
Applies toartifact: record:actor
Why
Customers ask which providers touch their data, and the sub-processor list is the answer. The model builder renders it from the provider actor records, so a provider added in code but missing from the list answers that question wrong. Generating the list from records keeps the answer and the code in step.
Checka reviewer answers
Reviewed forDoes each provider the release calls appear on the generated sub-processor list? Compare the release's provider clients with .litespec/implementation/operations/sub-processors.md.
Marked guidance: a reviewer answers this question.
Keep Production Secrets Out of the Repository#
rulerequiredguidancelitespec/quality/operations#keep-production-secrets-out-of-the-repositoryProduction environment values MUST live on the host, never in the repository, under litespec/quality/security#keep-secrets-out-of-tracked-and-observable-data.
Applies toartifact: any
Why
A secret committed once lives in history after deletion, readable to everyone the repository ever reaches, as litespec/quality/security#keep-secrets-out-of-tracked-and-observable-data states. Keeping production values on the host and only placeholders in a repository example file keeps the values with the deployment that needs them and out of every clone.
Checka reviewer answers
Reviewed forDo production values live on the host, with only placeholders in the repository example file? Search the tree for production values and read the example file.
Marked guidance: a reviewer answers this question.
Conventions#
Keep Runbooks Near Project Documentation#
conventiondefaultguidancelitespec/quality/operations#keep-runbooks-near-project-documentationPlace a runbook under .litespec/implementation/runbooks/ when it answers product-wide failures, or under .litespec/implementation/modules/<module>/runbooks/ when every record naming it sits in one module, stating trigger, impact, prerequisites, procedure, verification, recovery, and escalation, covering restore, rollback, schema failure, leaked secrets, dependency outages, and extension recovery.
ReplacementA consumer records a runbook-layout convention naming where its runbooks live and what each holds.
Applies toartifact: record:runbook
Why
An alert names its runbook, and the reader follows the pointer under pressure. A runbook sits at product level when it answers product-wide failures and under its module when every caller sits in one module, so each pointer resolves to a procedure with the same fields: trigger, impact, prerequisites, procedure, verification, recovery, and escalation. A runbook kept anywhere else breaks the pointer the alert gave.
Checka reviewer answers
Reviewed forDoes each runbook sit under .litespec/implementation/runbooks/ or its module's runbooks folder, with its fields, or does the convention name another arrangement? Look at the runbook folders and their headings.
Marked guidance: a reviewer answers this question.
Reference Example#
This informative example demonstrates litespec/quality/operations#emit-correlated-diagnostics and litespec/quality/operations#separate-liveness-and-readiness.
A Claimwick host emits structured logs and traces with one trace identifier across the API and the Worker, answers /health/live without dependency checks, and answers /health/ready with its database check, so traffic stops when the database fails while the process stays alive.