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

+19 -18
View File
@@ -85,6 +85,14 @@ client ─HTTPS─▶ Caddy ─▶ server ── validate ──▶ printqueue (
`items`, so an index out of range or given twice is a validation
problem, and so is an empty item. A done item's `√` prints as `x` where
the code page lacks it.
- **Existing jobs keep their meaning and their bytes.** Every element,
field and response keeps its meaning, and `/print` stays strictly
decoded. TestRenderCompat (`receipt/testdata/compat`) and
TestPaperReceipts, in `internal/pkg/receipt/compat_test.go`, pin the
bytes of existing jobs, and later work keeps them passing.
`Renderer.Render` is the only path to printer bytes. A job is
printer-neutral, so the same job prints alike on each printer it is
rendered for.
- **Modules build ordinary jobs.** A module (`internal/pkg/modules`) turns a
plain payload into a `receipt.Job` made of the existing elements and
blocks, which then takes the same path as a `/print` job: validation, the
@@ -100,6 +108,8 @@ client ─HTTPS─▶ Caddy ─▶ server ── validate ──▶ printqueue (
the client gets `422` `module_failed` with the problems, and it is
logged and reported to Sentry once, without the problems, which can
quote the payload.
- Labels are in English, and the footer's time zone and date format come
from the config (owner, 2026-11-29).
- A module never reads the clock. It gets the time, zone and layout in an
`Env`, from `format.timezone` and `format.time_layout`, so its output is
reproducible in tests. The binary embeds the zone database, because
@@ -426,21 +436,10 @@ client ─HTTPS─▶ Caddy ─▶ server ── validate ──▶ printqueue (
hardware; a short test over real sockets covers `net/http`'s own
goroutines. Both run in every `go test`.
## Planned: formatters
Modules, ntfy among them, that turn plain input into receipts built from the
blocks. The plan is `docs/plans/formatters.md`. Its first four phases are
built: the blocks and the preview; the `list` block, the module layer and
the `note` module; the `notify` and `ntfy` modules and scoped tokens; and
the ntfy subscriptions. What is left, phase 5, is built only when a need
appears. Labels are in English, and the footer's time zone and date format
come from the config (owner, 2026-11-29).
## Planned next (owner, 2026-11-30)
Formatters phase 5 is split into features of their own, each planned in
`docs/plans/<feature>.md` before anything is built, in this order. A plan
not yet written is described here until it is.
Each feature below has its own plan in `docs/plans/<feature>.md`, written
before anything is built. They come in this order.
1. **Job store and print previews**: `docs/plans/job-store.md` (written;
the owner accepted every proposed default, 2026-12-01).
@@ -629,11 +628,13 @@ not yet written is described here until it is.
streams at once; and no `response_buffers`.
- There is no ntfy-compatible publish endpoint (owner, 2026-12-01).
Once every phase 5 item has its plan, `docs/plans/formatters.md` folds
into this page and goes.
## Deferred
- **Printer alerts sent out to ntfy** (paper out, cover open). They have not
been requested. Printing incoming ntfy messages is part of the formatters
plan.
been requested. Incoming ntfy messages already print (Decisions, ntfy
subscriptions).
- **Nested boxes, and goldmark for full CommonMark.** Cards need the
hand-written markdown subset only.
- **Geometry checks in the HTTP handler** (`Renderer.Check`) stay
rejected. Layout never fails on a valid job, the preview shows the result
and its line count at once, and each module caps its own lengths.