Skip to content

Lesson 6 of 9 · 22m

Reference Documentation That Answers

Reference pages are precision instruments. Learn the field-level habits that make APIs, configuration, and error documentation dependable.

Reference documentation is where precision pays rent. Prose can be forgiven in a tutorial if the outcome is correct; reference cannot. A wrong default, a missing enum value, or an undocumented side effect becomes a production experiment. The goal is not elegance — it is eliminating ambiguity.

Every entry needs the same skeleton

For configuration keys, use a fixed shape:

### `worker.maxConcurrency`

Type: integer
Default: 4
Range: 1-128
Restart required: yes
Introduced: 2.8.0

Maximum number of jobs one worker process executes concurrently. Values above
CPU count usually increase contention rather than throughput.

The shape is the feature. Once users trust that defaults, ranges, and restart behavior are always present, absence becomes meaningful. If a field is unknown, write "unknown" or omit the page from publication — do not silently skip the field sometimes and include it other times.

Document behavior, not just schema

Schema says a field is a string. Behavior says what the string means:

### `retry.after`

Type: duration string
Default: `30s`
Examples: `250ms`, `5s`, `2m`

Delay before retrying a failed delivery. Values are capped at `10m`; larger
values are accepted but clamped. The first retry is not jittered; subsequent
retries use exponential backoff with full jitter.

Units, caps, clamping, jitter, and ordering are the details integrators need. Validation rules belong here too: what happens on invalid input is behavior.

Error reference should be operational

A good error entry translates a symptom into action:

## ERR_QUEUE_DEPTH_EXCEEDED

Meaning: the ingest queue has more than 100,000 unacknowledged jobs.
Common causes: worker outage, downstream database saturation, malformed job loop.
Immediate action: check worker health, then downstream latency.
Safe mitigation: pause producers with `ingestctl producers pause`.
Do not: purge the queue unless jobs are provably replayable.

The distinction between meaning, cause, mitigation, and unsafe action matters. Readers under incident pressure will skim; fixed headings make the right section findable.

Generated docs still need authorship

OpenAPI, protobuf, and typedoc generators are excellent at extraction and terrible at judgment. They can enumerate endpoints, but they cannot decide which warnings matter or which combination is invalid. Treat generated output as raw material: curate descriptions, examples, deprecation notes, and cross-links. Bad generated docs are worse than handwritten ones because they look authoritative while being generic.

Version semantics must be explicit

State when behavior was introduced, changed, deprecated, or removed. since 3.2 is useful only if the page itself is versioned or the reader can determine their version. Link versioned references rather than relying on prose memory. Nothing rots faster than "recent versions" in a page that survives for six years.

Field notes

  • Consistency beats completeness at first: document every required field correctly before expanding into rare internals.
  • Keep enum values sorted or grouped by meaning, and never reorder them casually — readers diff versions.
  • Contradiction is worse than omission. Two correct partial pages beat one confident wrong page.
  • When engineers say "self-documenting," ask whether a user can discover the default, side effects, and failure behavior without reading source.

Was this lesson helpful?

Sign in to rate