109 lines
7.0 KiB
Markdown
109 lines
7.0 KiB
Markdown
# Documentation, examples, and developer experience
|
|
|
|
Status: planned product documentation work. This roadmap package is the current
|
|
documentation deliverable; guides and runnable examples described here are future tasks.
|
|
|
|
## Current evidence and audience
|
|
|
|
The [project README](../../README.md) explains the build and an older module inventory.
|
|
[ShortUrl's contract](../short-url.md) is the existing dedicated service/ABI document.
|
|
The source tree contains additional modules and evolved behavior that are not fully
|
|
represented in the README. Public headers/tests are useful evidence but are not a
|
|
substitute for a supported-use guide.
|
|
|
|
Documentation must serve three entry points: a developer selecting a small utility,
|
|
a developer adopting a complete module in an existing application, and a developer
|
|
choosing a managed application platform. Each should reach a minimal working example
|
|
without being required to understand the entire library.
|
|
|
|
## Information architecture
|
|
|
|
| Layer | Content | Acceptance |
|
|
| --- | --- | --- |
|
|
| Start/select | Current capability catalog, module dependencies, supported toolchains, installation choices | Every advertised capability maps to implemented/experimental/planned status and a verified consumer path. |
|
|
| Learn/use | Foundation recipes, complete module workflows, embedded/managed examples | Preconditions, ownership, failures and cleanup are shown alongside happy paths. |
|
|
| Reference | Public types/functions, thread-safety, invalidation, errors, limits, ABI/wire/disk versions | References come from public contracts and name version-specific behavior. |
|
|
| Compose/operate | Platform startup, configuration, health, deployment examples, upgrades and recovery | Operational examples reuse modules and identify the point of durable commitment. |
|
|
| Maintain | Architecture decisions, dependency/ownership map, contribution/test guidance, migration notes | A new maintainer can select and verify a bounded task without reconstructing chat history. |
|
|
|
|
The roadmap stays distinct from implemented-feature documentation. When a task ships,
|
|
update the capability catalog and guide with actual commands/evidence; retain the plan's
|
|
decision history and mark its task status accurately.
|
|
|
|
## Example contract
|
|
|
|
Each future runnable example identifies selected modules, compiler/dependency prerequisites,
|
|
resource/trust configuration, input/output, failure paths, cleanup and verification command.
|
|
Examples consume exported/installed targets as appropriate and are compiled/tested in CI.
|
|
Avoid hidden external accounts, production data, credentials, public endpoints or network
|
|
services as prerequisites. Use loopback fixtures and private test certificates.
|
|
|
|
Start with:
|
|
|
|
1. A minimal utility/CLI consumer with no managed runtime or optional engine dependency.
|
|
2. Reflection/binary/JSON round trips with large integers, bounds and checked errors.
|
|
3. An application-owned executor with cancellation, deadlines and explicit lifetime.
|
|
4. A managed streaming service using a selected storage backend and observable shutdown.
|
|
5. A reloadable host with retained service handles, failed-candidate rollback and a C ABI
|
|
plugin example distinct from the same-toolchain C++ example.
|
|
6. A later fixed-membership replicated KV demonstration with partition/restart scenarios
|
|
and clearly limited consistency/availability claims.
|
|
|
|
Documentation snippets marked NEW in these plans are design illustrations. They become
|
|
copyable supported examples only after interfaces exist and snippets compile in the
|
|
declared configuration. Do not invent commands that appear executable without labels.
|
|
|
|
## Per-module documentation requirements
|
|
|
|
- State whether the module is header-only, compiled, an adapter, or a composition, and
|
|
show its actual CMake target separately from C++ namespaces.
|
|
- Give the smallest dependency closure and identify optional capabilities/backends.
|
|
- Explain value/borrow/ownership lifetime, threading, callback execution, allocation,
|
|
cancellation, deadlines and shutdown wherever relevant.
|
|
- Document defaults and limits numerically, including the meaning of zero/unbounded
|
|
options and what overload looks like.
|
|
- Present errors as actionable caller choices: retry, inspect ambiguous outcome, change
|
|
configuration, reject input, or report corruption. Avoid broad silent fallbacks.
|
|
- Include version/default changes, migration adapters and capability restrictions.
|
|
- Link deeper algorithms and operational implications without duplicating authoritative
|
|
shared contracts.
|
|
|
|
## Developer workflows
|
|
|
|
Provide reproducible configure/build/test instructions for supported profiles and clear
|
|
diagnostics for missing compiler reflection or external packages. Include fast focused
|
|
tests, full integration checks, package consumers and the criteria for using each.
|
|
Explain that a selected-module build and a kitchen-sink test build answer different
|
|
questions. Preserve the user's build directories and local configuration.
|
|
|
|
Generated API/reference material must use a documented tool/version and reproducible
|
|
inputs. Generated output is not hand-edited. Prefer source-adjacent comments for individual
|
|
symbols and maintained guides for cross-component workflows. No documentation generator
|
|
or hosting service is mandated by this package before its bounded implementation task.
|
|
|
|
## Plan-file authoring and upkeep
|
|
|
|
Each area plan records baseline source links, concrete scope and NEW APIs, algorithms
|
|
and flow, native/backend choice, lifetime/failure/resource behavior, performance workloads,
|
|
task IDs/dependencies/ownership, validation and migration. The task backlog must be
|
|
specific to the area; repeated generic paragraphs do not count as expanded design.
|
|
|
|
Shared requirements, architecture and decisions have one authoritative home. A changed
|
|
contract updates dependent plans in the same review. The master coverage matrix identifies
|
|
all affected areas. Durable workflow records distinguish authoring completion from future
|
|
feature implementation and record observed commands rather than invented success.
|
|
|
|
## Tasks
|
|
|
|
| ID | Planned work | Acceptance |
|
|
| --- | --- | --- |
|
|
| X-DOC-01 | Reconcile capability/module catalog and README | Every current module has correct target, status, dependency and guide links. |
|
|
| X-DOC-02 | Author minimal adoption guides and compiled examples | Utility/module/platform entry points each work with declared prerequisites. |
|
|
| X-DOC-03 | Generate and validate API reference from supported public contracts | No undocumented public defaults/lifetime behavior; links/snippets checked. |
|
|
| X-DOC-04 | Author operations, recovery and migration recipes | Failure/rollback scenarios are rehearsed against implementation and reflect real commit boundaries. |
|
|
| X-DOC-05 | Add documentation consistency checks to CI | Broken links, stale snippets, missing capability entries and unresolved contract changes are detected. |
|
|
|
|
Root/maintainer owns architecture and release-facing statements. Module owners own their
|
|
examples and contract accuracy. A documentation or editorial specialist may polish prose,
|
|
but source/behavior acceptance remains a technical review responsibility.
|