mesh-delivery: write a delivery only when it changed (hq issue 326) #187

Merged
mesh-admin merged 1 commits from fix/326-write-a-delivery-only-when-it-changed into main 2026-10-10 17:50:53 +00:00
Contributor

Fixes novox/hq issue 326 (mesh-delivery writes a delivery whether or not it changed).

Cause: keep (holder.go) wrote the whole delivery on every call, and Reconcile passes every walk the controller keeps through walkMoved -> settleAndKeep -> moved -> keep every 30 seconds, so the deliveries bucket was rewritten about once per walk per pass with nothing changed.

Fix: keep remembers each delivery as it last wrote it (encoded) and skips the write only when the delivery encodes exactly the same and is not marked dirty. Any change to a delivery (state, steps, walk record, owed effects, their tries) changes its encoding and is written. A failed write stays dirty and Flush writes it again; the remembered value is dropped on failure. Load seeds the remembered values from what it read back; a delivery deleted at the end of its keeping is forgotten. Events, notes, views and forge statuses are owed in moved and done in Flush exactly as before. A retry of an owed effect still writes its new try count (a real change).

Tests: issue326_test.go — five reconcile passes over walks that did not move write nothing and say nothing (fails before: 5 writes); a walk that moves is written, stored, and said; a delivery whose write failed is written again by Flush unchanged. go test -race ./... passes; words check clean.

Fixes novox/hq issue 326 (mesh-delivery writes a delivery whether or not it changed). Cause: `keep` (holder.go) wrote the whole delivery on every call, and `Reconcile` passes every walk the controller keeps through `walkMoved` -> `settleAndKeep` -> `moved` -> `keep` every 30 seconds, so the `deliveries` bucket was rewritten about once per walk per pass with nothing changed. Fix: `keep` remembers each delivery as it last wrote it (encoded) and skips the write only when the delivery encodes exactly the same and is not marked dirty. Any change to a delivery (state, steps, walk record, owed effects, their tries) changes its encoding and is written. A failed write stays dirty and `Flush` writes it again; the remembered value is dropped on failure. `Load` seeds the remembered values from what it read back; a delivery deleted at the end of its keeping is forgotten. Events, notes, views and forge statuses are owed in `moved` and done in `Flush` exactly as before. A retry of an owed effect still writes its new try count (a real change). Tests: `issue326_test.go` — five reconcile passes over walks that did not move write nothing and say nothing (fails before: 5 writes); a walk that moves is written, stored, and said; a delivery whose write failed is written again by Flush unchanged. `go test -race ./...` passes; words check clean.
mesh-admin added 1 commit 2026-10-10 17:46:36 +00:00
mesh-delivery: write a delivery only when it changed (hq issue 326)
mesh/merge-gate pass: builds mesh-delivery → novox; no bus step; every machine composes with the change as it did without (4 of 4 compose)
mesh/repo-check pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)
mesh/delivery delivered
7eb96f2a1d
keep wrote the whole delivery on every call, and Reconcile passes every walk
the controller keeps through settleAndKeep every 30 seconds, so the
deliveries bucket was rewritten about once per walk per pass with nothing
changed: a key's revision no longer meant the delivery moved, and a watcher
of the bucket would receive a stream of non-changes.

keep now remembers each delivery as it last wrote it, encoded, and skips the
write when the delivery encodes exactly the same and is not waiting to be
written again. Anything a delivery holds that changes - its state, steps,
walk record, owed effects and their tries - changes its encoding, so every
change is still written; a failed write stays dirty and Flush writes it
again. Events, notes, views and forge statuses are owed and done as before.
A retry of an owed effect still writes its new try count: it is a change.

The test fails before (five passes over unmoved walks wrote five times) and
passes after; a walk that moves is still written and said.
Author
Contributor

Delivery novox/mesh-catalog@7eb96f2a1d6f — delivered since 2026-10-10T17:55:38Z

Delivery plan — builds mesh-delivery → novox; no bus step

  • tier 0: mesh-delivery
  • novox: receives mesh-delivery

Machines

  • mesh-delivery on novox: passed — healthy 3 times over 2m29s
  • mesh-delivery on the rest running it: sent

Transitions

  • 2026-10-10 17:47 (new) → proposed (announced): novox/mesh-catalog#187's head announced
  • 2026-10-10 17:49 proposed → checked (checked): the verdict names this commit
  • 2026-10-10 17:49 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail
  • 2026-10-10 17:52 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move
  • 2026-10-10 17:52 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit
  • 2026-10-10 17:55 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says

The commit's note under refs/notes/mesh-plan keeps every transition: git log --notes=mesh-plan.

<!-- mesh-delivery:view --> **Delivery** `novox/mesh-catalog@7eb96f2a1d6f` — **delivered** since 2026-10-10T17:55:38Z **Delivery plan** — builds mesh-delivery → novox; no bus step - tier 0: mesh-delivery - novox: receives mesh-delivery **Machines** - mesh-delivery on novox: passed — healthy 3 times over 2m29s - mesh-delivery on the rest running it: sent **Transitions** - 2026-10-10 17:47 (new) → proposed (announced): novox/mesh-catalog#187's head announced - 2026-10-10 17:49 proposed → checked (checked): the verdict names this commit - 2026-10-10 17:49 checked → ready (accepted): the gate passed or warned, and the repository's own check did not fail - 2026-10-10 17:52 ready → published (merged): on the trunk its modules follow: merged there, and its walk opened — or nothing for a walk to move - 2026-10-10 17:52 published → delivering (go): its walk started: let go by this owner in its group's order, by a person, or on the controller's own path — not a failed walk that carried a later commit for it, after which it waits for a walk of its own commit - 2026-10-10 17:55 delivering → delivered (done): its walk is done, carrying its own commit: every machine of its deploy plan passed, or was left as its policy says The commit's note under `refs/notes/mesh-plan` keeps every transition: `git log --notes=mesh-plan`.
Author
Contributor

Merge check at 7eb96f2a

  • mesh/merge-gate: PASS — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-delivery)
  • mesh/repo-check: PASS — its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript)

Delivery plan — builds mesh-delivery → novox; no bus step

  • tier 0: mesh-delivery
  • novox: receives mesh-delivery
  • read by no module's build: modules/mesh-delivery/cmd/mesh-delivery/fakes_test.go, modules/mesh-delivery/cmd/mesh-delivery/issue326_test.go

Run by the build seat on g14 as build-1791654424751792031 (builds --log build-1791654424751792031).

--- the gate: mesh-delivery
mesh-delivery: ok, 1 tool(s), invokes seat:mesh-controller.delivery-plan, seat:mesh-controller.delivery-order, seat:mesh-controller.delivery-check, seat:mesh-controller.deliver, seat:mesh-controller.delivery-stop, seat:mesh-controller.delivery-walks, gitea.gitea_note_append, gitea.gitea_delivery_view, gitea.gitea_commit_status, gitea.gitea_commit_statuses, gitea.gitea_contains, gitea.gitea_open_pulls, keeps state deliveries, groups
long-running resources without health: 0
files asking for a setting without saying whether it is trusted: 0
1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here
judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-10T17:35:04Z says they run
composing every machine as the mesh is
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
composing every machine with the change
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued
merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose)
judged by controller development build against the facts of 2026-10-10T17:35:04Z

machines:
  - a machine (f35): composes
  - holds mesh-dns-resolver (idt): composes
  - holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes
  - a machine (yvbpsm): composes

a merge would rebuild 1 module(s) in 1 tier(s): mesh-delivery

notes:
  - modules/mesh-delivery/cmd/mesh-delivery/fakes_test.go and modules/mesh-delivery/cmd/mesh-delivery/issue326_test.go read by no module's build, and rebuild nothing (issue 280)
--- its merge-check.sh (go toolchain)
ok  	git.novox.be/novox/mesh-catalog/checks/words	0.002s
words: 12 retired words and 70 daemons' lines, none in the 38991 strings of 649 files
ok  	git.novox.be/novox/mesh-catalog/checks/agenthome	0.009s
agent-home: no archive and no file written into under the agent's home
ok  	git.novox.be/novox/mesh-catalog/checks/paths	0.005s
paths: no module names another's state on its machine (3 known, listed to go)
long-running resources without health: 69, as kept
testing modules/mesh-delivery
ok  	mesh-delivery/cmd/mesh-delivery	1.780s
--- its merge-check-typescript.sh (typescript toolchain)
**Merge check** at `7eb96f2a` - `mesh/merge-gate`: **PASS** — every machine composes with the change as it did without (4 of 4 compose) (modules: mesh-delivery) - `mesh/repo-check`: **PASS** — its merge-check.sh passed, each part in its toolchain: merge-check.sh (go), merge-check-typescript.sh (typescript) **Delivery plan** — builds mesh-delivery → novox; no bus step - tier 0: mesh-delivery - novox: receives mesh-delivery - read by no module's build: modules/mesh-delivery/cmd/mesh-delivery/fakes_test.go, modules/mesh-delivery/cmd/mesh-delivery/issue326_test.go Run by the build seat on g14 as `build-1791654424751792031` (`builds --log build-1791654424751792031`). ``` --- the gate: mesh-delivery mesh-delivery: ok, 1 tool(s), invokes seat:mesh-controller.delivery-plan, seat:mesh-controller.delivery-order, seat:mesh-controller.delivery-check, seat:mesh-controller.deliver, seat:mesh-controller.delivery-stop, seat:mesh-controller.delivery-walks, gitea.gitea_note_append, gitea.gitea_delivery_view, gitea.gitea_commit_status, gitea.gitea_commit_statuses, gitea.gitea_contains, gitea.gitea_open_pulls, keeps state deliveries, groups long-running resources without health: 0 files asking for a setting without saying whether it is trusted: 0 1 manifest(s) checked. Judged against the seats this binary carries; a claim on one of the mesh's own seats is judged fully at registration, and a seat declared by a module not given here reads as unknown. Identities judged on a 6-character machine name, against the bounds of the providers given here judging 0 module(s) changed against 4 machine(s), as the snapshot of 2026-10-10T17:35:04Z says they run composing every machine as the mesh is the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued composing every machine with the change the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued the bus's user list leaves out 5 user(s) the mesh has minted no credential for: controller, node.f35, node.idt, node.ygcyr, node.yvbpsm. Each is a user that cannot connect until one is issued merge gate: PASS — every machine composes with the change as it did without (4 of 4 compose) judged by controller development build against the facts of 2026-10-10T17:35:04Z machines: - a machine (f35): composes - holds mesh-dns-resolver (idt): composes - holds git, holds mesh-artifact-store, holds mesh-broker, holds mesh-catalog, holds mesh-delivery, holds mesh-dns-resolver, holds mesh-store, holds mesh-vault, holds npm-package-registry, the control node, the hub (ygcyr): composes - a machine (yvbpsm): composes a merge would rebuild 1 module(s) in 1 tier(s): mesh-delivery notes: - modules/mesh-delivery/cmd/mesh-delivery/fakes_test.go and modules/mesh-delivery/cmd/mesh-delivery/issue326_test.go read by no module's build, and rebuild nothing (issue 280) --- its merge-check.sh (go toolchain) ok git.novox.be/novox/mesh-catalog/checks/words 0.002s words: 12 retired words and 70 daemons' lines, none in the 38991 strings of 649 files ok git.novox.be/novox/mesh-catalog/checks/agenthome 0.009s agent-home: no archive and no file written into under the agent's home ok git.novox.be/novox/mesh-catalog/checks/paths 0.005s paths: no module names another's state on its machine (3 known, listed to go) long-running resources without health: 69, as kept testing modules/mesh-delivery ok mesh-delivery/cmd/mesh-delivery 1.780s --- its merge-check-typescript.sh (typescript toolchain) ```
mesh-admin merged commit a14fa306f2 into main 2026-10-10 17:50:53 +00:00
mesh-admin deleted branch fix/326-write-a-delivery-only-when-it-changed 2026-10-10 17:50:53 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-catalog#187