From 376c85f2c50ac62bb0bc4d8d8fd3196dbe06443c Mon Sep 17 00:00:00 2001 From: William Gill Date: Tue, 1 Dec 2026 22:47:22 -0600 Subject: [PATCH] Update the releases plan for the landed JSON-body series The releases plan treated the JSON-body series as still on its branch and made its landing v0.2.0's first need. The series is now on main, with the owner's job-store decisions 25-39, so v0.2.0 needs it no longer and v0.3.0 needs nothing from it. The findings now describe main as it stands, list the query-string refusal among the breaking changes a 0.1.2 user meets, and cite the lines the series moved in CHANGELOG.md, docs/api.md, docs/design.md, the route table and the module routes' handler. Co-Authored-By: Claude Opus 5.5 --- docs/plans/releases.md | 53 +++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/docs/plans/releases.md b/docs/plans/releases.md index ed956c7..df3d7a2 100644 --- a/docs/plans/releases.md +++ b/docs/plans/releases.md @@ -34,20 +34,20 @@ Each has the default the plan assumes unless the owner says otherwise. Each answ 13. **One minor per feature group.** Assumed: each group in the train is a minor of its own once its last stage lands, and a patch carries fixes alone. Trade-off: more tags, each costing the checklist and the owner's time for paper checks and the tag itself. Fewer, larger tags would mean longer waits and larger upgrades. 14. **The Docker image.** Assumed: not published. Users build it from the tag's Dockerfile, as docs/docker.md says, and each tag's checklist builds and runs it. Trade-off: no `docker pull`. Publishing needs a registry, its credentials in CI and a rule for image tags. 15. **Paper for each tag.** Assumed: each stage's own paper checks pass before it lands. Each tag adds one short smoke receipt, printed from the tag's commit on the workstation with the owner's OK: internal/pkg/receipt/testdata/paper/note.json, whose bytes note.hex pins. The owner checks the box's borders and corners, the wrapped text, the checkboxes and the cut against the receipt he passed, and the job reads `done`. Trade-off: the receipt comes from a Windows build, not from the Linux release binary, but from the same commit. A receipt from a release binary would need a Linux host on the printer's network. -16. **The JSON-body series before v0.2.0.** Assumed: the series lands first, and v0.2.0 carries it. Trade-off: the tag waits for the series and its review. Tagging first would mean v0.3.0 breaks the module routes again, soon after v0.2.0 brings them. +16. **The JSON-body series before v0.2.0.** The series has landed on main, so v0.2.0 carries it and the module routes do not break again just after the tag. 17. **Docs and plans just outside the binary archives.** README.md and api.md link to design.md, whose Planned next describes unfinished work. The source archive is the whole tree at the tag (.goreleaser.yaml:82-84), docs/plans/ included. Assumed: both stay. The links point at the repository's pages and explain why the daemon works as it does, and a plan says that it is a plan. Trade-off: unfinished features are one step away from a shipped doc. Dropping the links means editing README.md and api.md, and losing the reasons they point to. `docs/plans export-ignore` in .gitattributes would drop the plans from goreleaser's and Gitea's source archives. 18. **Where users get install.sh.** No doc says, and the archives do not carry it (.goreleaser.yaml:50-79). README.md and install.md only run `./install.sh`. Assumed: each release attaches the install.sh of its tag (`release.extra_files`, and in `checksums.txt`). README.md and install.md download it from the latest release with curl, or from a named release. Trade-off: a goreleaser change in v0.2.0's work, with a snapshot. A link to the file at the tag instead needs no build change, but the docs must name a tag, and the file is not in `checksums.txt`. ## Investigation findings -Checked on main at 2e29181, and on the JSON-body branch as it stood on 2026-12-01, offline. leil-test-1 had one read-only look, which needs no lease. Nothing was printed, the printer was not contacted, and no `config.toml` was read. +Checked on main at 188230b, offline. leil-test-1 had one read-only look, which needs no lease. Nothing was printed, the printer was not contacted, and no `config.toml` was read. WHERE THINGS STAND -- The tags are v0.1.1 and v0.1.2, both from 2025-01-12. main holds 72 commits since v0.1.2, none tagged. origin/main, as last fetched, is the same commit. +- The tags are v0.1.1 and v0.1.2, both from 2025-01-12. main holds 78 commits since v0.1.2, none tagged. origin/main, as last fetched, is the same commit. - Gitea's latest release is therefore v0.1.2. install.sh downloads `latest` unless `UBERBRINGER_VERSION` names a tag (install.sh:37-39), and stops when the archive has no `packaging/uberbringer.service` (install.sh:170-171), which 0.1.2's archives lack. So the quick start in README.md installs nothing today, and no version that install.sh accepts exists yet. -- CHANGELOG.md has `[Unreleased]` (8-175) above `[0.2.0] - 2026-11-30` (177-509), which was never tagged. Its links already compare `v0.1.2...v0.2.0` and `v0.2.0...main` (528-529). install.md:20-23 and install.sh:8-10 name v0.2.0 as the first release they install, and design.md:3 calls the code version 0.2.0. -- The JSON-body series is on its own branch and has not landed. On main, the module routes take `copies` and `printer` in the query (routes.go:314-318). On the branch, they take them in an envelope, `{"payload": {...}, "copies": 2, "printer": "default"}`, and a query string on any route answers `400` `invalid_query`. design.md:501-512 lists what the series changes. It edits the `[0.2.0]` and `[Unreleased]` entries in place, since no tag carries the module query. -- The same branch records that the owner accepted job-store questions 25-39 as decisions on 2026-12-01, and plans the job list as `POST /api/v1/jobs/list`. This plan cites them as job-store decisions 25-39. +- CHANGELOG.md has `[Unreleased]` (8-175) above `[0.2.0] - 2026-11-30` (177-513), which was never tagged. Its links already compare `v0.1.2...v0.2.0` and `v0.2.0...main` (532-533). install.md:20-23 and install.sh:8-10 name v0.2.0 as the first release they install, and design.md:3 calls the code version 0.2.0. +- The JSON-body series has landed. The module routes take `copies` and `printer` in an envelope, `{"payload": {...}, "copies": 2, "printer": "default"}`, and a query string on any route answers `400` `invalid_query` (design.md:505-514). The series edited the `[0.2.0]` entries in place, since no tag carries the module query. +- main also records the owner's job-store decisions 25-39, the details of reprinting, and plans the job list as `POST /api/v1/jobs/list`. - Job-store phase 1 is done. Its schema has had no migration step because no release has written a `jobs.db`. From the first tag on, the schema changes only by a schema step. - `.gitea/workflows/release.yml` has never run on a tag, since none has been pushed while it exists. Its secrets, `TOKEN_GITEA` and `SENTRY_DSN` (release.yml:59-66), are untested. @@ -57,41 +57,42 @@ WHAT A USER OF 0.1.2 MEETS - `202` with a JSON job and a `job_` TypeID in place of `200` and text (189-191). - JSON errors with a `code` (192-194). - Tokens from the `Authorization` header only (195-197). - - install.sh sets up a fresh host behind Caddy and does not upgrade a 0.1 host (198-199; design.md:561-562). - - `printer.address` required, unknown keys refused, `api.secret` at least 32 bytes (200-204), and `config.toml` no longer tracked (205-207). + - install.sh sets up a fresh host behind Caddy and does not upgrade a 0.1 host (201-202; design.md:563-564). + - `printer.address` required, unknown keys refused, `api.secret` at least 32 bytes (203-207), and `config.toml` no longer tracked (208-210). + - A query string on any route answers `400` `invalid_query` (198-200). - A job with `raw` elements needs a token issued with `--raw` (49-53). - A printer must answer `DLE EOT` and `GS r 1`, or `printer.confirm = false` must be set, and `GS a 0` turns the printer's automatic status off for other clients (16-36). - - Under Security, the API secret in 0.1.x's tracked `config.toml` must be replaced (489-499). + - Under Security, the API secret in 0.1.x's tracked `config.toml` must be replaced (493-499). - Entries written against 0.2.0 that read differently against 0.1.2, which had no job status, no queue and no Dockerfile: - `uncertain` (12-15) is one of the statuses, not a change to them. - - Waiting jobs after a restart (37-42) and the shutdown rule (261-262) are what the queue does, with or without `state.dir`. - - The Docker image's store (43-48) belongs with the image itself (269). + - Waiting jobs after a restart (37-42) and the shutdown rule (264-265) are what the queue does, with or without `state.dir`. + - The Docker image's store (43-48) belongs with the image itself (272). - The blank lines before the cut (54-60) are part of a new layout, since no 0.1 job decodes. - The digest's reference (162-166), the QR width (167-170) and the docs (171-175) are part of their features. - "Going back to 0.2.0" (80-83; configuration.md:212-215) names a release that does not exist, and install.sh refuses anything older than v0.2.0. THE FOLLOW-UPS FROM JOB-STORE STAGE 1D - **A cut-short receipt.** When a write stops part-way, through a kill, a power cut or a dropped link, the printer can wait inside an image command for bytes that never come, and answers no status until it is switched off and on. With `printer.confirm`, the ready wait then sends nothing (design.md:73-77), and each job fails as not ready. `/healthz` reads `unknown` with `200`. `Status` gets no answer within its 2-s `statusTimeout` and reports the printer as one that does not answer status (printer.go:19, 531-535; handlers.go:250-252). configuration.md:265-269 still says the next receipt prints as noise, which holds only with `printer.confirm = false`. Question 5. -- **`/healthz` with the cover open.** The TM-T88IV answers no `DLE EOT` while its cover is open. Job-store stage 1d's review saw it on paper, and no doc records it yet: design.md:140-145 says only that the TM-T88IV answers `DLE EOT`. With no job waiting, `/healthz` reads `unknown` with `200`, by the same path. While a job waits for the printer, the job holds its connection, and `/healthz` answers `503` `timeout` (design.md:146-148; api.md:269-274). api.md:232-233 says an open cover gives `503`, and api.md:275-276 and CHANGELOG.md:240-241 describe a cover flag that the TM-T88IV never sends. Question 4. +- **`/healthz` with the cover open.** The TM-T88IV answers no `DLE EOT` while its cover is open. Job-store stage 1d's review saw it on paper, and no doc records it yet: design.md:140-145 says only that the TM-T88IV answers `DLE EOT`. With no job waiting, `/healthz` reads `unknown` with `200`, by the same path. While a job waits for the printer, the job holds its connection, and `/healthz` answers `503` `timeout` (design.md:146-148; api.md:274-279). api.md:237-238 says an open cover gives `503`, and api.md:280-281 and CHANGELOG.md:243-244 describe a cover flag that the TM-T88IV never sends. Question 4. - **`printer.confirm` needs a printer that answers.** It needs `DLE EOT` answered on receipt and `GS r` answered with bits 4 and 7 clear (design.md:110-117; configuration.md:91). Only the TM-T88IV is checked; the TM-T88VII and TM-m50II wait for printers stage 4a's probe. A printer that answers neither fails every job as not ready, with nothing sent (printer.go:237-246). Question 6. - **ARM.** The armv6, armv7 and arm64 builds ship the store untested on ARM hardware (CHANGELOG.md:78-79; design.md:261-264). CI cross-compiles armv6 and arm64 on every push (test.yml:82-88); armv7 is built only by goreleaser. The owner has no ARM boards. Question 7. THE HIDE AUDIT -The search covered README.md, every doc the archives carry (.goreleaser.yaml:50-79), configs/config.example.toml, the route table (routes.go:131-309), the error codes (errors.go:25-47), the CLI's commands (cli.go:66-148, preview.go:23, licenses.go:20), the enum tags and docs/swagger.json. No route, error code, command or enum value of a planned stage is on main: there is no `cancelled` status (queue.go:87), and no `job_started`, `job_content_expired`, `job_not_finished`, `preview_too_long` or `invalid_body` code. No doc the binary archives carry points into docs/plans/. What remains: +The search covered README.md, every doc the archives carry (.goreleaser.yaml:50-79), configs/config.example.toml, the route table (routes.go:133-313), the error codes (errors.go:25-47), the CLI's commands (cli.go:66-148, preview.go:23, licenses.go:20), the enum tags and docs/swagger.json. No route, error code, command or enum value of a planned stage is on main: there is no `cancelled` status (queue.go:87), and no `job_started`, `job_content_expired`, `job_not_finished`, `preview_too_long` or `invalid_body` code. No doc the binary archives carry points into docs/plans/. What remains: | What | Where | Recommendation | |------|-------|----------------| -| The module routes' `printer`, which takes only `default` and is described as "Reserved for a second printer" | routes.go:316-318; swagger.json:1187, 1548; api.md:650-653; CHANGELOG.md:321-323 | Keep as reserved and documented, worded as taking only `default` (question 10). The JSON-body series moves it into the body but keeps "for a second printer", so v0.2.0's work rewords it. | +| The module routes' `printer`, which takes only `default` and is described as "Reserved for a second printer" | handlers_modules.go:35-37; swagger.json:489; api.md:649 | Keep as reserved and documented, worded as taking only `default` (question 10). The CHANGELOG entry (CHANGELOG.md:324-327) already says so; v0.2.0's work rewords the rest. | | `unknown_printer` | errors.go:30 | Keep: the module routes answer it for any other printer name. | -| `invalid_query` | errors.go:29 | Keep: the JSON-body series makes it the answer to a query string on any route. | +| `invalid_query` | errors.go:29 | Keep: it answers a query string on any route. | | `queue.content_bytes`, whose content nothing reads until job-store phase 2 | configuration.md:178; config.example.toml:152; queue.go:808 | Keep (question 9). | | "Going back to 0.2.0" | configuration.md:212-215; CHANGELOG.md:80-83 | Hide: the fold drops it. | | "An older config without that setting", a config without `state.dir` that no release wrote | install.md:36-38 | Hide: v0.2.0's work drops it. | -| 0.1 users sent to "README § Quick start", which has nothing for a 0.1 host | CHANGELOG.md:198-199 | Fix in the fold. | +| 0.1 users sent to "README § Quick start", which has nothing for a 0.1 host | CHANGELOG.md:201-202 | Fix in the fold. | | "v0.2.0 or later" | install.md:20-23; install.sh:8-10, 170-171 | Keep: true once v0.2.0 is tagged (question 1). | -| An open cover said to give `503`, and a cover flag the TM-T88IV never sends | api.md:232-233, 275-276; CHANGELOG.md:240-241 | Fix the docs before v0.2.0 (question 4). | +| An open cover said to give `503`, and a cover flag the TM-T88IV never sends | api.md:237-238, 280-281; CHANGELOG.md:243-244 | Fix the docs before v0.2.0 (question 4). | | A stuck printer said to print the next receipt as noise | configuration.md:265-269 | Fix the doc before v0.2.0 (question 5). | -| Links to docs/development.md and docs/design.md, which the binary archives leave out | README.md:55-56; install.md:7; api.md:137-140 | Keep (question 17): they resolve on the repository's pages, and design.md's Planned next stays out of the binary archives. | +| Links to docs/development.md and docs/design.md, which the binary archives leave out | README.md:55-56; install.md:7; api.md:142-145 | Keep (question 17): they resolve on the repository's pages, and design.md's Planned next stays out of the binary archives. | | `./install.sh` with no word on where to get it | README.md:36-38; install.md:9-11 | Finish before v0.2.0 (question 18). | No feature needs finishing before the first tag. Several docs need fixing, and install.sh needs a place to download from. @@ -126,9 +127,9 @@ THE TRAIN | Tag | What a user gets | Stages | Needs first | |-----|------------------|--------|-------------| -| v0.2.0 | Everything on main: elements and blocks, previews, the note, notify and ntfy modules, scoped tokens, ntfy subscriptions, jobs that survive a restart, confirmed jobs, the Caddy installer, the hardened unit, the Docker image | What main has, and the JSON-body series | Phases, v0.2.0 | +| v0.2.0 | Everything on main: elements and blocks, previews, the note, notify and ntfy modules, scoped tokens, ntfy subscriptions, jobs that survive a restart, confirmed jobs, the Caddy installer, the hardened unit, the Docker image | What main has | Phases, v0.2.0 | | v0.2.1 | A subscriber that keeps its replay and prints nothing for ntfy's errors; `/healthz` that reports a printer that stops answering | ntfy stage 1; the fix of question 4 | Phases, v0.2.1 | -| v0.3.0 | The job history (`POST /api/v1/jobs/list`), a job's `ref`, the `uncertain` count in `/healthz`, reprints by ID and by category, cancelling waiting jobs over HTTP and by ntfy deletes; `cancelled` under **Breaking** | job-store phases 2 and 2b | The JSON-body series, which carries job-store decisions 25-39 and the job list's route to main. jobs.db's first schema step, to `user_version` 2, for `reprint_of` and the mark (job-store decisions 28 and 32), which phase 2 must add, since v0.2.0 ships the store, and which job-store.md does not name yet. 2b needs no step and can go alone first, as v0.3.0, if the owner wants cancelling sooner | +| v0.3.0 | The job history (`POST /api/v1/jobs/list`), a job's `ref`, the `uncertain` count in `/healthz`, reprints by ID and by category, cancelling waiting jobs over HTTP and by ntfy deletes; `cancelled` under **Breaking** | job-store phases 2 and 2b | jobs.db's first schema step, to `user_version` 2, for `reprint_of` and the mark (job-store decisions 28 and 32), which phase 2 must add, since v0.2.0 ships the store, and which job-store.md does not name yet. 2b needs no step and can go alone first, as v0.3.0, if the owner wants cancelling sooner | | v0.4.0 | Image previews as PNG, and previews of stored jobs by ID | job-store phases 3a-3c and 4 | A bitmap font that meets job-store decision 19; phase 3a stops and asks the owner otherwise | | v0.5.0 | Named printers, each chosen per request; `deliveries` in job status; `/healthz` per printer | printers stages 1a and 1b | job-store stage 1c, which is done | | v0.6.0 | Routing rules in Expr: unicast, multicast and broadcast, a reload on SIGHUP, and `uberbringer route` | printers stages 2a-2c | Expr, which adds 5.3-5.8 MB to the binary (printers decision 10); a schema step for printers decision 18's columns, which becomes `user_version` 3 after phase 2's step; printers.md:121 still says 2 | @@ -170,7 +171,7 @@ Every tag passes it, the patches included. The session preparing the tag checks - A fake printer in each test's network, a scratch program that answers `DLE EOT` and `GS r 1` as the TM-T88IV does. In the install containers it listens on 127.0.0.1:9100, which install.sh takes as the printer's address. Never the live printer. - A fresh install with `UBERBRINGER_VERSION` set to the candidate, on Debian and on Ubuntu. The service runs as `uberbringer`; the config is 0640 `root:uberbringer`; `initial-token` is 0600; `/var/lib/uberbringer` is 0700 and `jobs.db` 0600; Caddy's config validates and Caddy starts; `uberbringer version` names the candidate; a job sent to `127.0.0.1:8080` reads `done`. The job's token comes from `initial-token` into a 0600 header file that curl reads (`-H @file`), never onto the command line or into output. - A re-run with the same version keeps the config and a drop-in, and restarts the service. - - An upgrade: the previous tag installed by name, with `printer.retries` raised in its config so that jobs outlast a stopped printer. With the fake printer stopped, a few jobs are sent and the service is stopped, so they wait in `jobs.db`. Then the fake printer starts, and the candidate's install.sh runs with the candidate. The waiting jobs print once each, in order, and their statuses and the config are kept. For v0.2.0, whose previous tag is v0.1.2, install.sh does not upgrade. Only if the owner says 0.1 hosts are still in use: a 0.1-style config with a `[printer]` section with `address`, and a fresh secret that is never printed, loads with `uberbringer config get` (CHANGELOG.md:200-204, 361-362). + - An upgrade: the previous tag installed by name, with `printer.retries` raised in its config so that jobs outlast a stopped printer. With the fake printer stopped, a few jobs are sent and the service is stopped, so they wait in `jobs.db`. Then the fake printer starts, and the candidate's install.sh runs with the candidate. The waiting jobs print once each, in order, and their statuses and the config are kept. For v0.2.0, whose previous tag is v0.1.2, install.sh does not upgrade. Only if the owner says 0.1 hosts are still in use: a 0.1-style config with a `[printer]` section with `address`, and a fresh secret that is never printed, loads with `uberbringer config get` (CHANGELOG.md:203-207, 365-366). - The image: built with podman from the candidate's commit, run with a named volume and `--stop-timeout 40`. It runs in a podman pod beside a fake printer of its own, with its config from a 0600 env file whose secret is never printed. A job reads `done`; a new container on the same volume keeps its status. From v0.2.1 on, the previous tag's image runs first and is stopped with a job left waiting, as above, and the new one prints it once. 8. For v0.2.0 alone: the ARM run of question 7. 9. The owner pushes `vX.Y.Z` on the same commit. The release page shows its assets. Then the session, on question 8's host under the lease, fetches install.sh as README.md says and runs it without a version in a fresh container. It installs the tag as `latest`. @@ -179,15 +180,15 @@ Every tag passes it, the patches included. The session preparing the tag checks ### v0.2.0: the first tag -**Goal.** A user can install a tagged release of everything main holds, with install.sh, the tarballs or the Docker image, and upgrade from it later. Needs the JSON-body series landed (question 16), and the owner's answers to questions 1, 2, 4-10 and 14-18, or his acceptance of their defaults. Needs the ARM run of question 7, unless the owner drops it. Decisions; questions 1, 2, 4-10 and 14-18. +**Goal.** A user can install a tagged release of everything main holds, with install.sh, the tarballs or the Docker image, and upgrade from it later. The JSON-body series has landed (question 16). Needs the owner's answers to questions 1, 2, 4-10 and 14-18, or his acceptance of their defaults. Needs the ARM run of question 7, unless the owner drops it. Decisions; questions 1, 2, 4-10 and 14-18. -**Work.** One session, briefed from this section, after the JSON-body series has landed: -- docs/api.md § Health: a printer that answers no status reads `unknown` with `200`. On the TM-T88IV that includes an open cover while no job waits, and a printer stuck inside a cut-short receipt. While a job waits for the printer, the reading is `503` `timeout`. api.md:232-233 changes with it. The cover flag (api.md:275-276; CHANGELOG.md:240-241) is not sent by the TM-T88IV, whose cover stops its status answers. design.md's status section (474-484) records that. +**Work.** One session, briefed from this section: +- docs/api.md § Health: a printer that answers no status reads `unknown` with `200`. On the TM-T88IV that includes an open cover while no job waits, and a printer stuck inside a cut-short receipt. While a job waits for the printer, the reading is `503` `timeout`. api.md:237-238 changes with it. The cover flag (api.md:280-281; CHANGELOG.md:243-244) is not sent by the TM-T88IV, whose cover stops its status answers. design.md's status section (478-488) records that. - docs/configuration.md § Logs (265-269): with `printer.confirm`, a stuck printer gets nothing sent, and each job fails as not ready, until it is switched off and on. With `printer.confirm = false`, it prints the next receipt as noise. -- The module routes' `printer`, in the doc comment the JSON-body series gives it, api.md and its CHANGELOG entry: it takes only `default` (question 10). swagger.json is regenerated. +- The module routes' `printer`, in its doc comment (handlers_modules.go:35-36) and api.md:649: it takes only `default` (question 10). swagger.json is regenerated. - install.sh's download (question 18): `release.extra_files` and `checksum.extra_files` in .goreleaser.yaml; README.md § Quick start and install.md show the download; a CHANGELOG entry under Added. - design.md's ARM paragraph (261-264) and the CHANGELOG's ARM entry: the store's tests pass under emulation, which is not hardware. -- CHANGELOG.md: `[Unreleased]` folds into `[0.2.0]`, dated the day the owner means to tag. Each folded entry compares against 0.1.2 (Investigation findings, WHAT A USER OF 0.1.2 MEETS). **Breaking** keeps only what breaks a 0.1.2 caller, config or install, and question 6's wording joins it. The rest moves under Added or Changed, into the features they belong to. The "Going back to 0.2.0" entry goes, with configuration.md:212-215. The entry at CHANGELOG.md:198-199 says what a 0.1 host does instead of pointing at the quick start. install.md:36-38's older config goes. +- CHANGELOG.md: `[Unreleased]` folds into `[0.2.0]`, dated the day the owner means to tag. Each folded entry compares against 0.1.2 (Investigation findings, WHAT A USER OF 0.1.2 MEETS). **Breaking** keeps only what breaks a 0.1.2 caller, config or install, and question 6's wording joins it. The rest moves under Added or Changed, into the features they belong to. The "Going back to 0.2.0" entry goes, with configuration.md:212-215. The entry at CHANGELOG.md:201-202 says what a 0.1 host does instead of pointing at the quick start. install.md:36-38's older config goes. - This plan's Status, in the last commit: v0.2.0 is ready to tag. **Commits.**