v1.0.24 (P4b): canary drift alarm + incident snapshots #55
Loading…
Reference in a new issue
No description provided.
Delete branch "oss-oo/pinky-p4b-alarm-snapshots"
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?
What (v1.0.24, roadmap P4b — MasterBrain steer A2-3)
Two observability mechanisms from the 2026-10-01 23:52 delivery-race
forensics — the capped ledgers (200/136/200) rotated out the
racer-side records before anyone could freeze them.
1. Incident snapshots — frozen ledger copies that survive rotation
stream.py snapshot [--reason <text>] [--window <s>]: atomicallycopies the five ledgers (stream-dispatches/bells/pending/history +
usage-ledger) into
<config-dir>/incidents/<utc-ms>/plus amanifest.json (files copied, record counts, reason, epoch,
dispatcher version). Without
--windowthe copies are byte-faithfulraw freezes;
--window <s>subsets by record timestamp (the familymixes epoch-seconds and epoch-ms fields — normalized on read).
v1.0.22 path) takes a snapshot automatically — fail-safe (never
disturbs the exit path; suite-proven with a broken incidents path)
and rate-limited to one per
ZDO_SNAPSHOT_MIN_INTERVAL_S(default 300 s, cross-process: newest-dir check + flock — a cancel
storm produces ONE dir per interval, suite-proven by counting dirs).
ZDO_SNAPSHOT_KEEP(default 20) incident dirs.snapshots.py(core + theDISPATCH_VERSIONconstantthe manifest carries); wired into install.sh FILES + py_compile and
the Makefile lists (the v1.0.17 new-module guard demands it).
2. Canary drift alarm — the alarm clock becomes an alarm
stream.py canary-report [--rebaseline]: runs the contract canary'sprobe groups in their read-only mode and compares group outcomes
against
<config-dir>/canary-baseline.json:ZDO_CANARY_VERBOSE; a missingbaseline is pinned on first run);
zcode/infra/canary-driftpublished (plus thezcode/fleet/<station-id>/mirror viapublish_dual, NOTretained — it is an event) with payload
{schema:"zcode/canary/v1", changedGroups, appVersion (the ZCODE_APP_VERSION derivation), timestamp}; changed groups printed;contract_tests.py --probe(new flag): the read-only group subset —env/infra/db/bundle/fact only; no scratch sessions, no DB writes, no
systemd-run units, no model requests; desktop notifications
suppressed in this mode (the drift alarm is the alerting channel).
zcode-dispatch-canary.timer+.service(install.sh-templated like the bridge unit, explicit
Environment="PATH=%h/.local/bin:…"per the station user-managerPATH lesson, hourly
OnCalendar+Persistent=true) shippedDISABLED BY DEFAULT — the flip is the owner's/MasterBrain's move per
the bridge precedent; runbook documents it. install.sh never runs
systemctl (suite tripwire proves zero invocations).
surfaces contract_tests already pins — no NEW upstream assumptions
(the
--probemode only SELECTS the existing read-only groups; itadds no probes).
Suite + docs
fake app-server cancel_race mode; never the live broker/units):
snapshot content + manifest correctness;
--windowfiltering(seconds/ms mix); retention pruning; auto-snapshot fires exactly
once per interval under a rig cancel storm (dirs counted); broken
snapshot path never disturbs the cancel exit; canary baseline pin →
quiet exit 0; injected drift (probe-group outcome flipped via the
rig's
ZDO_CANARY_CMDseam) → exit 1 + the notice on BOTH topicsasserted non-retained with fresh-connection no-replay;
--rebaselinere-pins; new/vanished groups read as drift; probeexit 7 / garbage report → exit 2; install-leg canary unit-pair
assertions +
--liveprobe list.set).
you, how they feed forensics, retention knobs) + §17 (canary-report:
baseline lifecycle, exit codes, timer flip runbook);
MQTT-TOPICS.md canary-drift row; README tools row + roadmap entry.
PROMPT-APPENDIX.md untouched (agent-facing surface unchanged).