Commit 01ccbf2
docs: document the command boundary and spec its public surface
The @moduledoc was still the placeholder `mix new` writes and none of
the commands carried a @doc or a @SPEC, so the published page said
nothing about the one thing a reader has to know before calling any of
it: these are not an Elixir API. Every function but `customize/1` is a
command entry point that `bin/castle` reaches over `rpc` - it prints its
report and returns a bare `:ok`, and it raises `Castle.Error` on failure
so that the calling VM exits non-zero. A reader who takes them for
ordinary functions is surprised by both halves, so the moduledoc says
what a command boundary is and every @doc names the `bin/castle` command
that reaches it. castle#11.
The distinction the issue asked to be settled, settled deliberately:
* `make_releases/0` is @doc false. Its only caller is the launcher's
`env.sh` fragment, in the preboot VM of a start whose deployment has
no `RELEASES` yet, and by hand it either does nothing or does what
the next start would do anyway. It keeps its @SPEC: the spec is the
contract whether or not the function is published.
* `install/2..5` is documented as what it is. One @doc covers every
arity of a clause with defaults, so silence about the extra four
would leave a test seam reading as an API.
* Everything else is a command an operator invokes, and is documented
with that framing rather than hidden - `upgradable/0` included,
since the state it reports is invisible otherwise and a diagnostic
nobody is told about is one nobody thinks to ask.
The specs say `:: :ok` and nothing more, because that is the whole of
what `report!/1` returns. `mix docs` is clean; its one complaint was a
reference to `Kernel.CLI`, which is hidden, so `Castle.Error`'s own
wording is used instead.
Three internal notes had gone stale and are corrected with it: two named
a `commit/3` that is now `commit/5`, and one claimed `commit` still
composes materialisation outside the serialised region, which castle#14
ended.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01C4oaMvbR1cbxrZBj8qwkqN1 parent 0564785 commit 01ccbf2
4 files changed
Lines changed: 349 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
515 | 515 | | |
516 | 516 | | |
517 | 517 | | |
518 | | - | |
519 | | - | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
520 | 523 | | |
521 | 524 | | |
522 | 525 | | |
| |||
925 | 928 | | |
926 | 929 | | |
927 | 930 | | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
928 | 959 | | |
929 | 960 | | |
930 | 961 | | |
| |||
1418 | 1449 | | |
1419 | 1450 | | |
1420 | 1451 | | |
1421 | | - | |
1422 | | - | |
1423 | | - | |
1424 | | - | |
1425 | | - | |
1426 | | - | |
1427 | | - | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
1428 | 1462 | | |
1429 | 1463 | | |
1430 | 1464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
263 | 290 | | |
264 | 291 | | |
265 | 292 | | |
| |||
0 commit comments