Keep a condition's looks in the store, so a look that changes nothing writes no bucket (issue 420)
mesh/merge-gate pass: builds build-agent, mesh-controller, route-proxy → ace, g14, novox, shanks; no bus step; every machine composes with the change as it…
mesh/repo-check pass: its merge-check.sh passed
mesh/delivery delivered

Every look rewrote the condition's value in the conditions bucket, because the
value carried the count of looks, the last look and the newest evidence: 131 647
writes in four days for twelve open conditions, against ADR 0289's rule that a
bucket is written only when what it describes changed. The looks now live in the
controller's store (migration 0095, condition_looks), the bucket holds what a
condition says and is written only when that changes, and the conditions verb and
the condition events put the looks back.
This commit is contained in:
jochen
2026-10-12 12:11:13 +02:00
parent 22a2f73f7b
commit dcdafd37f0
18 changed files with 803 additions and 38 deletions
@@ -0,0 +1,20 @@
-- The looks of an open condition are kept here, not in the conditions bucket (novox/hq issue 420, ADR 0289
-- §1 and §4).
--
-- On 2026-10-10 the bus had stored 131 647 writes to the conditions bucket in four days while twelve
-- conditions were open: every look rewrote a condition's value, because the value carried how many times it
-- had been observed, when last and the newest evidence. A watcher heard a write for every look, not for
-- every change. The bucket now holds what a condition says, written when that changes; how often and when
-- it was last seen, and what each look said, change on every look and are kept in this row, written by the
-- serving controller under its lease (`epoch`) and read back by `conditions` and the events it says.
--
-- One row per open condition, removed when it clears. `evidence` is the newest observations, newest first,
-- as the condition's `evidence` says them: [{"at", "said"}].
create table condition_looks (
key text primary key,
observations integer not null check (observations >= 0),
last_observed timestamptz not null,
evidence jsonb not null default '[]',
epoch bigint,
kept_at timestamptz not null default now()
);