Record the owner's acceptance of the remote-printers plan
Security / Vulnerability check (push) Successful in 46s
Test / Lint and test (push) Successful in 2m6s

The owner accepted every proposed default of
docs/plans/remote-printers.md on 2026-11-30. Its open questions become
numbered decisions, without the alternatives, and design.md's Planned
next item 3 records them.

The plan's acceptance edits are made: printers.md's seam, question 6,
question 24 and stage 3 point to it, and job-store.md notes that a
remote attempt whose outcome stays unknown turns uncertain during a run
and that the acknowledgement runs at the agent for remote printers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
57_WolveandClaude Opus 5.5 committed 2026-11-30 23:48:55 -06:00
1 parent f0e1deda84
commit 10b6c57afb
4 files changed
+112 -133

No files matched your search

+6 -4
View File
@@ -64,7 +64,7 @@ Before stage 1a:
- Trade-off: renaming a printer fails what waits for it.
- Alternatives: refuse to start until the printer is back, which stops every printer over one; or send them to the default printer, a room nobody chose.
6. **The seam for remote printers.** Assumed: no `kind` key and no address scheme now. Each printer is built by one constructor in internal/app, which returns what `printqueue.Sender` and `server.Printer` need; today that is a `*printer.Client`. The remote-printers plan adds its own key, which is purely additive, since unknown keys are refused today. Architecture, THE SEAM FOR REMOTE PRINTERS, writes down the contract a remote printer keeps, printqueue's send contract (stage 3) included.
- Trade-off: none known; the remote plan names the key.
- Trade-off: none known. docs/plans/remote-printers.md names the key, `agent` (its decision 16).
- Alternative: reserve `kind = "tcp"` now, as the only value accepted.
Before stage 1b:
@@ -179,6 +179,7 @@ Before stage 3:
24. **A printer marked down.** An anycast delivery joins the lane of its first printer. When that printer is dead, the delivery waits behind every earlier delivery on that lane, and each of those retries before it fails. That is about 27 s each at the defaults when dials time out (four dials of 5 s, plus waits of 1, 2 and 4 s), or about 7 s when they are refused. Ten unicast jobs for a dead `office` would delay an `alerts` job by 4-5 minutes while `default` sits idle. Once the dead lane is full, `Submit` would refuse the anycast job. Anycast would fail in the very case it exists for. Assumed:
- A printer is marked down after a failure before any byte of a job: a refused, unreachable or timed-out dial, or a printer still not ready at the anycast check. Any delivery's failure marks it, unicast included. A failure our own context caused never does.
- The mark clears on the printer's next successful send, or after a hold of 30 s (a constant, not a key). It lives in memory and is lost at a restart.
- A printer behind an agent stays marked while its agent is offline or does not list it (docs/plans/remote-printers.md, decision 18).
- At `Submit`, an anycast delivery joins the first printer of its list that is not marked down and whose lane has room; else the first with room. `queue_full` comes only when every lane of the list is full.
- Marking a printer down moves the anycast deliveries waiting on its lane on at once. A worker that takes an anycast delivery for a printer marked down moves it on without dialling.
- A mark only passes a printer over for a later one of the list that is not marked. When every printer left is marked, the first of them is tried as usual, so the attempt renews or clears its mark.
@@ -609,13 +610,13 @@ PROFILES AND STATUS PER MODEL (stages 4a and 4b)
- Status: `printer.Client.Status` keeps `DLE EOT 1-4`, one request at a time. On a profile whose near-end comes from `GS r 1`, it sends that last, only when online and ready, with its own deadline and decoder, and closes the connection after a missed answer (question 28). The anycast check never sends it. `Ready()` and `Normalized()` gain question 29's bits.
THE SEAM FOR REMOTE PRINTERS (named, not built; question 6)
- Each printer is one value built by one constructor in internal/app from its table. It implements `printqueue.Sender` (`Send` with `beforeWrite`, and stage 3's checked send) and `server.Printer` (`Status`). Today it is a `*printer.Client`; the remote-printers plan adds one backed by an agent's link, chosen by a key that plan adds.
- Each printer is one value built by one constructor in internal/app from its table. It implements `printqueue.Sender` (`Send` with `beforeWrite`, and stage 3's checked send) and `server.Printer` (`Status`). Today it is a `*printer.Client`; docs/plans/remote-printers.md adds one backed by an agent's link, chosen by its `agent` key (its decision 16).
- The contract a remote printer keeps is printqueue's send contract (stage 3):
- `beforeWrite` runs only once a connection to the printer itself is open, wherever that is, so the `sending` mark and "nothing sent" stay true across the agent.
- A failed send that never called `beforeWrite` sent nothing. One that called it sent nothing only when its error matches printqueue's `NothingWritten` interface, which a remote sender reports only when the agent says nothing was written. A send whose link is lost part-way counts as "may have printed", never "nothing sent".
- A failed send that never called `beforeWrite` sent nothing. One that called it sent nothing only when its error matches printqueue's `NothingWritten` interface, which a remote sender reports only when the agent says nothing was written. A send whose link is lost part-way counts as "may have printed", never "nothing sent", unless the agent's journal shows nothing was written (docs/plans/remote-printers.md, decision 17).
- Status follows the same rules: read a not-ready answer again; a timeout is never a fault.
- The main instance and an agent never both drive one printer: its second connection blocks until the first closes.
- Nothing of this is built here: no key, no agent, no transport.
- Nothing of this is built here: no key, no agent, no transport. docs/plans/remote-printers.md builds them.
LOGGING AND PRIVACY
- Worker lines gain `printer`. Each printer's start-up line gives its name, address, model, code page and paper width, as today's `listening` line gives the address: logs are private, and that line is where an operator sees which address each name uses.
@@ -1002,6 +1003,7 @@ internal/pkg/printqueue
- Moves (question 26): under the status lock, and the delivery lock once job-store phase 2b exists; only while the queue is open and the delivery is not cancelled; never after a failure while the delivery's context has ended.
- Round timers (question 25); shutdown and a cancel see a delivery on a timer as waiting.
- `Sender` gains the checked send (name assumed).
- A remote printer's checked send is built by whichever of this stage and docs/plans/remote-printers.md's stage 4 lands second.
- store.go: `Sending` adds its printer to `SentTo`; a restore drops printers no longer configured from a delivery's list (question 5).
- `Status`: an anycast delivery's `printers` and `sent_to`.