Fold the formatters plan into design.md
Security / Vulnerability check (push) Successful in 43s
Test / Lint and test (push) Successful in 2m6s

Phases 1-4 of docs/plans/formatters.md are built and described in
design.md, and every phase 5 item now has a plan of its own, under
Planned next. So the plan goes, and what still matters moves into
design.md.

A new decision says that existing jobs keep their meaning and their
bytes: /print stays strictly decoded, TestRenderCompat and
TestPaperReceipts pin the bytes, and Renderer.Render is the only path
to printer bytes. The labels and footer settings join "Modules build
ordinary jobs". Deferred gains nested boxes and goldmark, and the
geometry checks in the HTTP handler that stay rejected. The plan's
other invariants were already design.md decisions.

The plans that cited formatters.md now cite design.md, or drop the
reference: job-store.md, printers.md, blocks.md and templates.md.
job-store.md's phase 5 list moves to design.md's Deferred section once
its other phases are done.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-12-01 11:09:30 -06:00
1 parent 68bce4db59
commit 709e7904e9
6 files changed
+25 -71

No files matched your search

+2 -3
View File
@@ -544,7 +544,7 @@ DELIVERIES AND SEVERAL PRINTERS
- Anycast: a delivery's printer is chosen when it is dispatched, and its row records the printer used. Before any byte was sent, a failure fails over to the next printer at once: the delivery moves to it and no `sending` mark is written, just as a dial failure writes nothing today. After a `sending` mark, the existing retry rule on that printer runs, then failover to the next (docs/plans/printers.md decision 22). That failover can print a whole receipt on two printers (decision 23). A queued delivery restored after a restart starts again from the top of its stored list (printers decision 18).
- One store per instance. Each delivery names its printer, so one store serves every printer: one queue with a lane and a worker per printer, each loading its own unfinished deliveries (docs/plans/printers.md decision 4).
- Job IDs stay global, so `GET /api/v1/jobs/{id}` needs no printer.
- The stored job is printer-neutral (formatters invariant 1) and rendered bytes are not stored, so a queued delivery can move to another printer. A queued delivery whose printer was removed from the config fails at restore (docs/plans/printers.md decision 5).
- The stored job is printer-neutral (design.md, "Blocks are laid out when the job renders") and rendered bytes are not stored, so a queued delivery can move to another printer. A queued delivery whose printer was removed from the config fails at restore (docs/plans/printers.md decision 5).
- Acknowledgement IDs are counted per printer.
- `cancelled` comes with phase 2b, as a delivery's state; the `deliveries.state` column takes it without a schema change.
- Two instances must not share a state directory. Exclusive locking makes the second fail at start; today they would also share the `ntfy-<name>.json` files. Until one instance drives several printers, each instance gets its own directory.
@@ -854,7 +854,6 @@ Docs
- docs/api.md: the route table, a "Cancel a job" section, the `job_started` row in the error table, and the Job status section (`cancelled`).
- docs/ntfy.md: how a subscription behaves: a `message_delete` cancels the waiting receipts of its notification and drops its held digest rows, also under `min_priority` and past `max_backlog`; a `message_clear` does neither; `min_priority` is applied by the subscriber, which reads every message of its topics.
- design.md: the state machine's `cancelled`, its synced commit and the delivery lock; the ntfy subscriptions paragraph (deletes cancel, clears do not, and the subscriber filters priorities itself).
- docs/plans/formatters.md: its phase 5 item "Queue.Cancel so message_delete can cancel a still-queued job" goes, since this phase builds it.
- CHANGELOG: under **Breaking**, the `cancelled` status; under Added, `DELETE /api/v1/jobs/{id}` and cancelling by ntfy deletes; under Changed, that a subscription with `min_priority` reads every message and filters itself.
- docs/swagger.json regenerated.
@@ -998,7 +997,7 @@ Docs
**Done when.**
- A job printed earlier previews by its ID as text and as PNG.
- The full gate passes.
- Once phases 1-4, 2b included, are all done: design.md's Planned next item 1 goes, and this plan is trimmed to its phase 5 list, as formatters.md is.
- Once phases 1-4, 2b included, are all done: design.md's Planned next item 1 goes, the phase 5 list moves to design.md's Deferred section, and this plan is deleted, its findings with it.
### Phase 5: Later, on demand (build only when the owner asks)