Commit Graph
2 Commits
Author SHA1 Message Date
57_WolveandClaude Opus 5.5 45b57ab196 Restore stored jobs at start, ending interrupted sends uncertain
Breaking: job status can be "uncertain", a new status value. Clients
that switch on status must handle it.

The queue loads what its store keeps before the worker, the server and
the subscriptions start. Queued deliveries wait again in submission
order, ahead of any new job, even beyond queue.size: Submit answers
queue_full until the backlog falls below it. Restored statuses answer
at once, and the sequence continues from the highest stored.

A delivery found in sending at start may have reached the printer, so
the store ends it uncertain, a new terminal state, and it is never sent
again; a person checks the paper and sends it again if it is missing.
Each one is logged once at WARN by its job's ID, printer, source and
reference. A job's status is uncertain once all its deliveries have
finished and any is, over failed over done.

With the memory store there is nothing to restore, so the daemon
behaves as before; a store on disk comes in stage 1d. Part of stage 1c
of docs/plans/job-store.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-01 13:45:07 -06:00
57_WolveandClaude Opus 5.5 bdd337e2dc Generate the OpenAPI document from a route table
Security / Vulnerability check (push) Successful in 38s
Test / Lint and test (push) Successful in 1m53s
The server registers its routes from one table in server/routes.go, and
tools/genopenapi (run by go generate) writes docs/swagger.json, an
OpenAPI 3.1 document, from the same table and the Go types it names.
Schemas are reflected with invopop/jsonschema: descriptions from the
first paragraph of the doc comments, enums and limits from jsonschema
tags. Request schemas are strict, as the decoder is; response schemas
allow fields added later. The daemon serves the embedded document at
GET /openapi.json without a token, internal/app passes it to the server
in its config, and release archives and the Docker build include it.

Tests keep it honest: a golden test and a CI step fail when the
document is stale, every registered route must be in the table, and the
tags are held to validation, to the Go constants and to the values the
handlers send. receipt.Element and printqueue.Status gain field doc
comments for the descriptions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-30 09:30:42 -06:00