Files
uberbringer/docs/plans/formatters.md
T
57_WolveandClaude Opus 5.5 68bce4db59 Record the owner's acceptance of the printers plan
The owner accepted every proposed default of docs/plans/printers.md on
2026-12-01. Its open questions become numbered decisions, without the
alternatives, and design.md's Planned next item 2 records them.
Decisions 6, 10 and 17 keep the wording that the remote-printers and
templates plans had already settled. Decision 14 amends the owner's
earlier wording: a rule that fails to compile stops the start rather
than being skipped.

The plan's acceptance edits are made, and its list of them goes.
formatters.md loses its open question, which the routing example
answers, and points to this plan for a second printer and per-model
line spacing, without the printer pool's tests. job-store.md points to
these decisions for the deliveries array, the stored route, failover
after a sending mark, the lanes and their content bound, and a printer
removed from the config. Its invariant 2 speaks of the job's bytes,
since an anycast check sends DLE EOT before the mark. Its findings
confirm the TM-m50II's command list and the power-on part of the
automatic-status side finding. Phase 2b, phases 3c and 4 and phase 5
say how they meet several printers.

The other plans cite printers decisions in place of questions, and
templates decision 1 now follows printers decisions 12, 14, 15 and 17
rather than leaning on assumed defaults.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 11:07:58 -06:00

3.0 KiB

Plan: CP437 blocks, modules and ntfy printing

Status: phases 1-4 are done: the blocks and the preview; the list block, the module layer and the note module; the notify and ntfy modules, their cards and scoped tokens; and the ntfy subscriptions, with their digest, paper budget and quiet hours. All four are built and checked on paper, and docs/api.md, README.md and design.md describe them. Phase 5 is a list of items built one at a time, each when a real need appears, in its own session briefed from its item.

Rules for phase 5

BACKWARD COMPATIBILITY

  • Every existing element, field and response keeps its meaning, and /print stays strictly decoded.
  • TestRenderCompat (receipt/testdata/compat) and TestPaperReceipts pin the bytes of existing jobs; later work keeps them passing.
  • Emoji are removed only on the module and ntfy paths; /print prints an emoji sequence as one '?'.

DEFERRED UNTIL A NEED APPEARS

  • nested boxes and goldmark.
  • Geometry checks in the HTTP handler (Renderer.Check) stay rejected: layout never fails on a valid job, preview shows the result and line count synchronously, and each module caps its own length.

INVARIANTS (all match the current code)

  1. receipt.Job stays printer-neutral. Blocks are sized at render time from Options.Columns or Profile.Columns(font). The same job therefore prints correctly on a TM-T88IV, TM-T88VII or TM-m50II, and on several printers later.
  2. Job.Validate stays structural and independent of geometry, so handlePrint keeps its Validate-then-Submit flow.
  3. Layout never fails on a valid job. Widths clamp, titles are cut with "...", and over-long words split the way wrap() already splits them. The only render-time failure is the [format].max_lines backstop (default 2000).
  4. Renderer.Render is the only path to printer bytes, and is all-or-nothing.
  5. New code never emits raw ESC/POS. Payload text only ever lands in string fields of elements. The raw element stays available on /print only, to tokens issued with --raw.
  6. /print stays strictly decoded (DisallowUnknownFields). A byte-compatibility test pins today's bytes.
  7. Layers call only downward: server -> modules -> receipt -> escpos. ntfy never imports modules; internal/app connects the subscriptions to modules.

Phases

Phase 5: Later, on demand (1-3 days each; build only when a real need appears)

Goal. Keep the core small. Each item below is independent and waits for real demand or an owner decision.

Work.

  • Several printers: planned in docs/plans/printers.md.
  • User templates: planned in docs/plans/templates.md.
  • More blocks: planned in docs/plans/blocks.md.
  • Queue.Cancel so message_delete can cancel a still-queued job.
  • Webhook sources: planned in docs/plans/templates.md.
  • Default line spacing per model: planned in docs/plans/printers.md (decision 30).

Tests.

Each item ships with its own goldens and table tests in the phase 1-4 style.

Done when.

Each item is done when its feature has golden or preview coverage, README docs, and a real-paper check where layout changes. Nothing here blocks phases 1-4.