Skip to content

Docs: split the README into an introduction and a reference manual - #94

Merged
flavorjones merged 10 commits into
masterfrom
card-577-prep-docs-v1
Oct 5, 2026
Merged

flavorjones merged 10 commits into
masterfrom
card-577-prep-docs-v1

Conversation

@flavorjones

@flavorjones flavorjones commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Motivation

The README ran to 681 lines and covered everything from the pitch to the log schema, and discussion #86 called it verbose. Each file in docs/ held rationale, how-to steps and settings tables together, and some facts appeared in several files: the OpenMP bound was in the README, docs/DEPLOYMENT.md and docs/IMAGEMAGICK.md, and the timeout rule was in both docs/DEPLOYMENT.md and docs/TUNING.md.

Nothing tied a page to the code it described. docs/DESIGN.md records that an earlier API description went stale and its errors spread back into code comments.

Details

Layout. The README is a human introduction: what Hot Cell is, an Active Storage quick start, a short custom-operation example, and one line per recommended alert, each linking to a reference page. Everything else is a reference manual under docs/, one topic per page, written in Google developer documentation style. docs/DESIGN.md is split into docs/design/ and docs/contributing/, with the invariant and experiment numbers unchanged. docs/contributing/ is for people working on Hot Cell itself: contributing, keeping the docs current, the experiments and overhead measurements, and the decision records. CONTRIBUTING.md and adr/README.md point there.

Frontmatter. Each page under docs/ starts with Open Knowledge Format (OKF) frontmatter: type, title, a one-line description, and sources, the files or directories that the page describes. Each section's index.md lists its pages with their descriptions, so an agent can choose a page without opening the others.

Tooling. Three rake tasks in rakelib/docs.rake:

  • rake docs:stale lists each page whose sources changed since BASE (default origin/master) while the page did not. It never fails. A new Docs CI job prints the list as warnings on a pull request.
  • rake docs:index regenerates the page list between the <!-- index --> markers in each index.md. Pages with an order in their frontmatter come first, in that order; the rest follow by file name.
  • rake docs:check fails on a page without type, title or description, on a source that does not exist, and on an out-of-date index. The Docs job runs it on every push, and so does rake.

New docs_test.rb files in hotcell-core, hotcell-server and activestorage-hotcell-server fail when the codes and kill-causes table, the log events table, the cell defaults tables or the shipped operation limits table disagree with the code.

During development. After changing code, run rake docs:stale, read each page it names, and fix what the change made wrong. Edit sources when a page starts or stops describing a file, and run rake docs:index after adding a page or changing a title or description. docs/contributing/docs.md says the same. AGENTS.md includes that page and gives the writing rules for each kind of page.

Corrections. The README's Active Storage initializer did not call HotCell.register "active_storage", which every shipped client needs. docs/DEPLOYMENT.md said that an unset HotCell.root runs callers in process; perform_in_hotcell raises HotCell::CellNotConfigured. Both are fixed.

Additional information

The commits are meant to be reviewed one at a time:

  1. Moves every section, unchanged, into its new file, and repoints the code comments that cited the old paths. A script assigned every source line to exactly one destination; only the tables of contents were dropped.
  2. Rewrites the README and the reference pages, merges duplicates, and adds reference that no page had: response codes, HotCell::Operation, Input and Output, and the client's boot checks. The design pages keep their prose; only headings and links changed.
  3. Adds the frontmatter, the rake tasks, the CI job, the tests and AGENTS.md.
  4. Restores details that the rewrite dropped, found by an adversarial review and by comparing every old sentence with the new pages.
  5. Rewrites the design pages to describe the design as it is. It drops withdrawn invariant 1 without renumbering the rest, a deferred check, a socket check that was tried and withdrawn, and the history of reversed decisions.
  6. Adds the docs/contributing/ section.
  7. Orders the reference and design indexes, renames awkward page titles, rewrites the design introduction, and spells the name Hot Cell in prose.
  8. Renames the contributor section to Contributing to Hot Cell, in docs/contributing/, and gives its pages type: Contributing.
  9. Presents the reference manual, Design, and Contributing to Hot Cell as sibling sections: an index no longer lists the indexes below it, and the README and AGENTS.md list each one.
  10. Corrects the statements that Copilot's review found wrong: scratch sizing, how a full scratch is classified, file_size being removable, the supervisor reading a request, and the operation example's output size.

The README is 331 lines; most of what remains is the Kamal configuration, which a reader copies.

The README and each file in `docs/` held both guide prose and reference
material, and some facts appeared in more than one file.

Move each section of the README, `docs/DESIGN.md`,
`docs/DEPLOYMENT.md`, `docs/TUNING.md` and `docs/LOGS.md`, unchanged,
into one file per topic under `docs/`, and repoint the code comments
that cite those files. Links between the moved sections stay broken
until the next commit.
The README ran to 681 lines, and each reference page held rationale,
how-to steps and settings tables together. The README's Active Storage
initializer also omitted `HotCell.register`, and the deployment guide
said that callers run in process when `HotCell.root` is unset, but
`perform_in_hotcell` raises `HotCell::CellNotConfigured`.

Cut the README to an introduction and a quick start that links to the
reference pages. Rewrite each reference page in Google developer
documentation style, keep each fact in one place, correct both
statements, and add reference for what no page covered: the response
codes, `HotCell::Operation`, `Input` and `Output`, and the client's
boot checks. Leave the design pages' prose as written.
Nothing connected a reference page to the code it describes, so a
change to the code left the page wrong without notice.

Give each page OKF frontmatter with a description and the `sources` it
describes. Add `rake docs:index` to generate the page lists,
`rake docs:check` to fail on missing frontmatter, missing sources and
stale indexes, and `rake docs:stale` to name the pages whose sources a
branch changed. Run the check and the stale list in a new CI job, add
tests that compare the codes, events, defaults and shipped limits
tables with the code, and say in `AGENTS.md` how to use all of it.
The rewrite dropped the README's RPC framing, its extensibility list
and a few development notes, dropped the performance side of
`max_requests_per_worker`, and overstated when a `protocol` mismatch
heals.

Restore them, and say that `protocol` heals when the accessory reboots
on a matching image.
Copilot AI balanced review requested due to automatic review settings October 2, 2026 21:20

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟡 Changes recommended

Several operational rules and API examples contradict the implementation and could cause failures or unsafe scratch sizing.

Review effort: Balanced
Findings: 13 Low severity

Open (13)
What changed in this PR

Splits the monolithic documentation into a concise README and source-linked reference manual, with validation tooling and synchronization tests.

Changes:

  • Adds topic-focused reference and design pages.
  • Adds documentation indexing, staleness checks, CI, and table synchronization tests.
  • Updates code comments and contributor guidance to reference the new structure.

Pull request overview

[!TIP]
If you aren't ready for review, convert to a draft PR.
Click "Convert to draft" or run gh pr ready --undo.
Click "Ready for review" or run gh pr ready to reengage.

File Description
.github/​workflows/​ci.yml Adds documentation CI.
AGENTS.md Documents the reference workflow.
CHANGELOG.md Records the documentation restructure.
CONTRIBUTING.md Updates documentation guidance.
README.md Becomes the introduction and quick start.
Rakefile Adds documentation validation to defaults.
activestorage-hotcell-server/​test/​docs_test.rb Verifies documented operation limits.
bin/​conformance Updates documentation references.
docs/​DEPLOYMENT.md Removes the former deployment guide.
docs/​DESIGN.md Removes the monolithic design document.
docs/​IMAGEMAGICK.md Replaced by the new reference page.
docs/​LOGS.md Replaced by observability documentation.
docs/​TUNING.md Replaced by the rewritten tuning page.
docs/​active-storage.md Documents Active Storage operations.
docs/​cell-settings.md Documents cell configuration.
docs/​client-api.md Documents the client API.
docs/​codes.md Documents response classifications.
docs/​concepts.md Defines core terminology.
docs/​conformance.md Documents image conformance checks.
docs/​container.md Documents container configuration.
docs/​design/​descriptors.md Records descriptor design rationale.
docs/​design/​experiments.md Preserves numbered experiments.
docs/​design/​index.md Indexes design documentation.
docs/​design/​invariants.md Preserves numbered invariants.
docs/​design/​overhead.md Records overhead findings.
docs/​design/​threat-model.md Separates the threat model.
docs/​design/​worker-isolation.md Documents worker isolation.
docs/​imagemagick.md Rewrites ImageMagick guidance.
docs/​index.md Indexes the reference manual.
docs/​observability.md Consolidates logs and metrics guidance.
docs/​operation-api.md Documents operation and descriptor APIs.
docs/​request-lifecycle.md Documents request processing.
docs/​scratch.md Documents scratch layouts and sizing.
docs/​tuning.md Rewrites tuning guidance.
examples/​gate Updates documentation references.
hotcell-client/​lib/​hot_cell/​client.rb Updates client API reference.
hotcell-client/​test/​describe_survival_test.rb Updates design reference.
hotcell-core/​lib/​hot_cell/​codes.rb Updates isolation reference.
hotcell-core/​test/​docs_test.rb Verifies documented response codes.
hotcell-server/​lib/​hot_cell/​log.rb Updates observability reference.
hotcell-server/​lib/​hot_cell/​operation.rb Updates operation reference.
hotcell-server/​lib/​hot_cell/​slot.rb Updates isolation reference.
hotcell-server/​lib/​hot_cell/​supervisor.rb Updates design and logging references.
hotcell-server/​test/​docs_test.rb Verifies events and defaults.
hotcell-server/​test/​log_test.rb Updates log schema reference.
rakelib/​docs.rake Adds index, check, and stale tasks.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread docs/codes.md Outdated
Comment thread docs/concepts.md Outdated
Comment thread docs/concepts.md Outdated
Comment thread docs/container.md Outdated
Comment thread docs/operation-api.md Outdated
Comment thread docs/scratch.md Outdated
Comment thread docs/scratch.md Outdated
Comment thread docs/scratch.md Outdated
Comment thread docs/tuning.md Outdated
Comment thread docs/tuning.md Outdated
The design pages listed a withdrawn invariant, a deferred check, a
withdrawn socket check, and decisions since reversed.

Drop them, retire invariant 1's number so the others keep theirs, and
describe the rest of the design in the present tense.
The contributor material sat in `CONTRIBUTING.md`, `AGENTS.md` and
`adr/README.md`, outside the docs, and the design section held the
experiment and overhead pages, which users of the gems don't need.

Move all of it into `docs/development/`, leave `CONTRIBUTING.md`,
`adr/README.md` and `AGENTS.md` pointing at the new pages, and drop
the `toc` rake task that only `CONTRIBUTING.md` used.
The indexes listed pages by file name, some page titles were awkward,
and the prose spelled the project's name `HotCell`.

Add an `order` frontmatter key that lists pages in the order it gives,
ahead of pages without one, and use it for the reference and design
pages. Rename the awkward titles, rewrite the design introduction, and
spell the name Hot Cell in prose, leaving the `HotCell` module name as
it is.
The contributor pages sat in `docs/development/` under the name
Developing Hot Cell, and OpenWiki grouped three of them under Design
because they kept `type: Design`.

Move them to `docs/contributing/`, name the section Contributing to Hot
Cell, give all five pages `type: Contributing`, and order them.
The reference manual's index listed the Design and Contributing
sections as if they were part of it, while the README and the OpenWiki
sidebar showed them beside it.

Stop listing subdirectory indexes in a generated index, list the
sections side by side in the README and `AGENTS.md`, and move the
frontmatter notes to Keep the docs current.
Several pages overstated what the code does. They sized scratch from
`file_size × concurrency`, though `file_size` limits each file and not
a request's total. They said that a full scratch is always `failed`,
that a cell can remove `file_size`, and that the supervisor never reads
a request, and the operation example's `File.size(destination.path)`
staged the output, so the worker shipped zero bytes.

Correct each statement, and read the size through `fd_path`.
@flavorjones
flavorjones merged commit e654d04 into master Oct 5, 2026
17 checks passed
@flavorjones
flavorjones deleted the card-577-prep-docs-v1 branch October 5, 2026 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants