newsletters-wears-kit: both settings reconcilers gate on Listmonk's FORK, not its listener — the kit apply exit 0s into a refused connection and reports green #1357
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1357
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The failure
Drive
20260909T134009Z(artifacts/verdict.json: 33 legs, 32 green,firstRedLeg: newsletters-wears-kit) red at the last leg:The title is listmonk's stock public-page title, so
app.site_namewas never set. Nothing was applied at all.The evidence
logs/guest-system-journal.log:310-320is the whole defect, in six lines:Both reconcilers ran to completion and reported GREEN before the daemon bound its serve port. The daemon then read listmonk's stock
username@smtp.yoursite.comrelay off the untouched settings row — independent proof thatnewsletters-smtp's PUT no-opped too, not just the brand one.logs/guest-failed-units.loglists zero failed units: the fault was invisible to every guest-side check.The layer
internal/clan/newsletters.go— the two settings-PUT reconcilers it renders.renderListmonkSMTP(oldnewsletters.go:376) andrenderNewslettersBrand(oldnewsletters.go:480) each opened withcurrent=$(curl -sf … "$addr/api/settings") || exit 0. On a refused connection that is an exit-zero, so systemd records a successful oneshot that applied nothing.after = [ "listmonk.service" ]. The nixpkgs module runs ListmonkType=simple, so systemd calls the unit started the instant the process forks — ~200 ms before it listens. This is exactly the standing rule indocs/GOTCHAS.md:31-43(#2, "the port lies"): "systemdafter=is ordering, not readiness — a oneshot that needs a peer answering carries its own bounded retry." The sibling brand oneshots already obey it —internal/clan/video.go:394-414andinternal/clan/whakapapa.go:564-575both pollfor i in $(seq 1 30)andexit 1loud. Newsletters was the one port that never did.GET /api/settings→ jq-merge →PUTof the one settings object. Concurrently, whichever read first has its keys silently dropped by the other's PUT — andapp.root_urlis the SMTP reconciler's key (newsletters.go:383), the base every public stylesheet link (and so the accent the check reads) resolves against.The fix
One shared
newslettersSettingsReadyGate(internal/clan/newsletters.go:393-430) both reconcilers now open with (:377,:505): poll the capability actually needed — the settings API answering — over a 60 s budget, keep the answered object in$currentfor the jq merge, andexit 1loud when the budget elapses. The SMTP unit grows the coreutils path the retry'sseq/sleepcome off (:359). The brand oneshot orders after the SMTP one (:477,afteralone, neverrequires— a failed send-path reconcile must not withhold the brand).One thing worth a later look (not fixed here, does not block)
The leg reported
[name; accent]missing but notlogo, against a Listmonk where demonstrably nothing was applied — sopickLogoRef(app/tests/e2e/fixtures/brandreach.ts:535) accepted one of listmonk's own stock assets. That is the same class the Grist heal addressed by preferring a kit-bearing document; here no document carried the accent, so the natural-order fallback took an upstream asset. After this fix the accent lands, the kit-bearing document wins, and the fallback is not reached — so it is not a blocker, but the logo half of the newsletters contract is not independently proven today.Proposed ruling (Ruled by the healer under ADR 0174 — veto anytime)
Two-way door. The whole change is confined to the shell body and unit ordering of two reconciler oneshots that
internal/clan/newsletters.gorenders —git revert 069070a9restores the previous|| exit 0bytes exactly, and the render is deterministic (TestRenderNewsletters_Deterministic), so a revert is byte-identical, with no migration, no persisted state and no infra footprint. It is a mechanical repair, not a design decision: it changes nothing about what the newsletters port means to do. The keys applied (app.site_name,appearance.public.custom_css,app.logo_url/app.favicon_url, the SMTP relay), the carrier (DDR 0225's live settings-PUT oneshot), the identity (the #1306 API-user token) and the live-apply/no-restart semantic are all untouched — the code now merely waits for the daemon to be able to accept the apply it already intended, which is what its own doc comments already claim ("AFTER Listmonk is up", newsletters.go:39-43) and what docs/GOTCHAS.md #2 already rules as house law for every oneshot in this tree. No security, trust, secrets, route or message surface is touched. Proven here by TestRenderNewsletters_ReconcilersGateOnListmonkServing (internal/clan/newsletters_test.go:261), written red-first: it failed on the pre-fix render and passes on the post-fix one, pinning the bounded retry on both reconcilers, the loud failure on budget elapse, the absence of the exit-0 swallow, and the serialisation of the two whole-object PUTs. Every pre-existing pin in the package still holds unchanged. Built on the workstation (never the drive host) and closed through the close-report gate — the same gate a swarm worker passes.drive
20260909T134009Zred atnewsletters-wears-kit(sig 1c728f5612b3) — self-fixed on the fast lane, commitf08c46a0c3ae32fdc56a5471165b8ff3c0d016a4; checks: targeted (red-first):go test ./internal/clan/ -run TestRenderNewsletters_ReconcilersGateOnListmonkServing→ FAIL before the fix (no retry loop, no loud-failure message, the|| exit 0swallow still rendered, brand unordered against newsletters-smtp);go test ./internal/clan/ -run TestRenderNewsletters→ ok after (all 9 newsletters render tests, including the 8 pre-existing ones, unchanged and passing). package:go test ./internal/clan/→ ok 18.016s;go vet ./internal/clan/→ clean;gofmt -lon both changed files → clean. whole tree:go build ./...→ clean andgo test ./...→ every package ok, no failures. commit shape: 2 files, 97 insertions / 8 deletions, of which 54/8 are non-test (internal/clan/newsletters.go); one commit 069070a9, not pushed, working tree clean. rails self-check: all 8 removed lines are in newsletters.go and are plumbing only — the twocurrent=$(curl …) || exit 0GET lines, oneafter = [ "listmonk.service" ];render line, and four comment-render lines; ZERO removed lines in any test file (newsletters_test.go is +43/-0), none matching expect(/assert/require./t.Fatal/t.Error/toBe/toEqual/func Test/it(/test(/describe(/.skip; no skip added; 2 files and 54 non-test changed lines, under the cap; no.sandcastle/rehearsal-*or.forgejo/workflows/path touched.. evidence:/home/swarm/swarm/Matou/idss/test-results/private-path/20260909T134009Zon matou-workstation.close-report for #1357 — status
success✅ close-report gates passed — every claim verified against main; issue closed.
envelope