For AI agents: the complete documentation index is available at /hclapi/llms.txt, the full documentation bundle is available at /hclapi/llms-full.txt, and this page is available as Markdown at /hclapi/docs/concepts/lifecycle.md.

Request lifecycle

hclapi has two phases. Manifests are validated once, at boot. Every request after that runs the same fixed pipeline.

PhaseTriggerResultOn failure
Boothclapi serve startsManifests parsed, connections opened, routes registeredProcess exits with a file and line diagnostic
RequestHTTP request arrivesRoute matched, pipeline runs, response serializedRequest returns RFC 9457 error; server continues

Stages

1. Ingress

The method and path are matched. Headers, query parameters, and body are parsed.

2. Context initialization

A request-scoped execution context is created.

3. Step execution

Pipeline steps run in order, reading from and appending to the context.

4. Response

A respond step serializes status, headers, and body, and terminates the pipeline.

A request that fails schema validation or arrives with unparseable JSON never reaches step execution.