Record the owner's acceptance of the job-store plan

The owner accepted every proposed default of docs/plans/job-store.md on
2026-12-01. Its open questions become numbered decisions, without the
alternatives, and design.md's Planned next item 1 records them.
Decisions 7 and 21 keep the wording that the remote-printers plan had
already settled. Each stage now follows its decisions, and the
"(assumed)" marks on the plan's own defaults go.

The other plans cite job-store decisions in place of questions:
printers.md, remote-printers.md, templates.md and ntfy.md. Templates
decision 22 now follows job-store decision 10 rather than leaning on an
assumed default.

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:03:30 -06:00
1 parent a06c12a202
commit f302b76ef4
6 files changed
+181 -154

No files matched your search

+3 -3
View File
@@ -1,6 +1,6 @@
# Plan: templates and rules in Expr, for ntfy and webhooks
Status: **planned; nothing is built.** The owner accepted every proposed default on 2026-12-01 (Decisions), and design.md's Planned next item 5 records them. Each stage runs in its own session, briefed from its section: stage 1 follows decisions 1-11, stage 2 decisions 12-17, stage 3 decision 18, and stage 4 decisions 19-29. The stages run in order, except that stage 3 needs only stage 2, and stage 4 needs stages 1 and 2. This plan shares Expr with docs/plans/printers.md, whose questions still await the owner; where a stage leans on one of its assumed defaults, the decision here says so. Stage 4 leans on docs/plans/job-store.md in the same way, on its stage 1c and question 10's duplicate check (decision 22). Every receipt printed on the live printer needs the owner's OK. Whichever stage finishes last deletes this plan, its findings with it, and design.md's Planned next item 5.
Status: **planned; nothing is built.** The owner accepted every proposed default on 2026-12-01 (Decisions), and design.md's Planned next item 5 records them. Each stage runs in its own session, briefed from its section: stage 1 follows decisions 1-11, stage 2 decisions 12-17, stage 3 decision 18, and stage 4 decisions 19-29. The stages run in order, except that stage 3 needs only stage 2, and stage 4 needs stages 1 and 2. This plan shares Expr with docs/plans/printers.md, whose questions still await the owner; where a stage leans on one of its assumed defaults, the decision here says so. Stage 4 leans on docs/plans/job-store.md in the same way, on its stage 1c and decision 10's duplicate check (decision 22). Every receipt printed on the live printer needs the owner's OK. Whichever stage finishes last deletes this plan, its findings with it, and design.md's Planned next item 5.
## Decisions (owner, 2026-11-30)
@@ -122,8 +122,8 @@ For stage 4:
- `gitlab` and `standard` refuse a timestamp more than 5 minutes from the host's clock, `401` `invalid_signature`. The specification leaves the window open. A Raspberry Pi without a clock that boots with the wrong time refuses them until its clock is set; docs/templates.md says to start the daemon after the time is synced.
- A delivery's ID, where its preset has one, becomes the job's reference, with the source `hook:<name>`. An ID longer than 128 bytes, or with a byte that is not visible ASCII, is ignored, and the ID and the header values are copied out of fasthttp's buffers, as the request ID is.
- The ID is reserved under a lock before the rules run, so a second delivery with it, sent while the first is in hand, waits and gets the first's answer. It is recorded with the job's ID after a `202`, and as "nothing printed" after a `204`, so a repeat gets the same answer. After any other answer it is released, so a retry runs again.
- Until job-store stage 1c has shipped, each hook keeps its last 512 IDs in memory. Once it has, hook jobs join its duplicate check (job-store question 10), which runs in `Submit` under the submit lock and replaces the memory for jobs that were queued.
- This leans on job-store question 10's assumed default, which leaves the HTTP routes' jobs out because a client chooses their reference. A hook's ID is read only after its signature passed, which is why hook jobs may join.
- Until job-store stage 1c has shipped, each hook keeps its last 512 IDs in memory. Once it has, hook jobs join its duplicate check (job-store decision 10), which runs in `Submit` under the submit lock and replaces the memory for jobs that were queued.
- This follows job-store decision 10, which leaves the HTTP routes' jobs out because a client chooses their reference. A hook's ID is read only after its signature passed, which is why hook jobs may join.
- What it covers: a GitHub redelivery keeps its ID, and so do a Standard Webhooks retry and GitLab's retries, so none prints twice. Gitea and Forgejo give each attempt a new ID, a manual replay included, so a replay prints again, as the person replaying asked. GitHub's ID is not signed, so someone who captured a whole request could send it again under a new ID; only `gitlab` and `standard` sign theirs.
- Trade-off: without the job store, a restart forgets the IDs.
23. **Webhook rules.** They are `[[webhooks.rules]]`, shaped as `[[ntfy.rules]]` (decision 12) less `bypass`, seeing decision 5's `json` environment with `hook`, `event`, `delivery` and `headers` set. Actions are `print`, which needs `template`, and `drop`. A hook's own `template` key is what prints when no rule matches; a hook without one prints nothing then. So a hook for one kind of event needs no rule, and `event == "push"` picks Gitea's pushes out of everything else. `template` names a template whose `input` is `json`.