Skip to content

Release v0.79.3 — only a known driver start opens the node-down start window; node-down dwells outlive the add-on - #177

Merged
tesseractAZ merged 6 commits into
mainfrom
start-anchor-v0793
Nov 20, 2026
Merged

tesseractAZ merged 6 commits into
mainfrom
start-anchor-v0793

Conversation

@tesseractAZ

Copy link
Copy Markdown
Owner

Repairs 0.79.2's node-down start window, found at the 0.79.2 live check: a restart of this add-on read as a driver start, and a raised node-down did not survive it.

Fixed — a restart of this add-on held back a FLiRS node's node-down for 90 minutes (0.79.2)

0.79.2 took the driver's start from every driver-WS handshake (driverReconnectedAt()), this add-on's own first one included, and kept the node-down dwell, its latched flag with it, in memory. After a deploy, update or restart, a node auto-ping does not probe that was already Dead read as a new start death: the critical card and binary_sensor.zwave_tui_degraded cleared and came back 90 minutes later. Reproduced at the detector and through the real data layer (degraded off at 0.5, 5.5, 30 and 89.5 min after the restart, on at 90). It did not occur on the reference mesh, where nothing was Dead at the 0.79.2 deploy.

  • Only a known driver start opens the window (DetectInput.driverStarts, spans the driver started within): the host's boot (now − uptime, so a death's verdict at its first reading rests on the host's uptime); a driver-WS link this add-on did not end itself followed by a new handshake (onHomeId's new link.peerClosedAt, set only by the socket's close listener, which the client's own teardowns strip, and cleared by a WS_ERR_* protocol error); and such a restart carried from the previous run on the same boot. driverReconnectedAt() is unchanged for auto-ping's burst refusal.
  • A start death stays one (DwellEntry.start, carried as st): a later restart, or a deploy carrying only the newest, no longer cuts its 90 minutes to 5.
  • Node-down dwells outlive the add-on (evidence.json, optional nodeDown and driverStart; no schema change), seeded at the first engine tick after the home id is bound, for nodes on the roster. On the same boot every dwell and the driver restart carry; after a host reboot only raised node-downs do (a waiting dwell began before that boot's own start). A raised node-down is raised at once while it reads Dead; Unknown is no reading (it neither ends nor advances a dwell, and its card counts Dead time only).
  • Nothing is lost to a crash or a power cut, and nothing is said early: the raised node-downs, the start deaths and the newest driver restart are saved within a minute (spaced a minute apart; the key starts from the restored carry), and Home Assistant is sent nothing until the engine's first tick (EngineStatus.ran). A carry of another network is not written; a node that leaves the network takes its dwells with it.

Rejected alternatives

  • bgRSSI presence in the state dump (absent at both saved reboots, present at both add-on-only restarts): present about 70 s after a driver start, and absent at every connect on a controller without background RSSI.
  • Ignoring only the add-on's first handshake with nothing carried: a start death still waiting at a deploy would become an alarm at the deploy.
  • A boot fixed at the first tick: with the start verdict sticky it protected nothing and misjudged a death first seen after a clock jump.

Install note

The update from 0.79.2 carries nothing (0.79.2 wrote no carry): a node-down raised at the update, or a FLiRS start death 0.79.2 is still holding, is raised 5 minutes after it. The deploy therefore installs only while the three FLiRS nodes read Alive.

Verification

  • 1,769 tests pass (32 new: test/nodeDownCarry.test.ts, the driver-link test, the publish gate); npm run typecheck exits 0; the suite is also green with the default uptime forced to 60 s (a freshly booted CI runner).
  • Mutation harness: 70 new entries, none equivalent; 4 existing entries re-anchored, 1 retired with the check it covered. Full harness on the final head: 1,781 killed, 0 survived, 17 equivalent, 0 missing, 0 ambiguous, 0 invalid, 0 relabel (1,798 entries, 5.9 h).
  • Three review rounds, each with skeptics and a critic: the first found a reboot regression (a waiting start death carried across a host reboot raised at once) and the second gaps in the prompt save and an early degraded off; both are fixed and re-tested. The final round played this mesh's real event sequences (deploys, reboots, Z-Wave JS restarts, a power cut, a flapping node, the update from 0.79.2) through the real data layer and found only text to correct, now corrected.
  • A production-wired test once hung the harness under a mutant (an assertion skipped its own stop); every wired test now stops what it started in finally, and the mock's close terminates connected clients.
  • CHANGELOG 29,988 B (0.77.3–0.77.1 rotated byte-for-byte into docs/CHANGELOG-history.md).

🤖 Generated with Claude Code

tesseractAZ and others added 6 commits November 19, 2026 17:50
…de-down dwells survive a restart

v0.79.2 took the driver's start from every driver-WS handshake, the add-on's
own first one included, and kept its dwell state in memory. After a deploy, a
FLiRS node already Dead lost its raised node-down for 90 minutes.

- symptoms: DetectInput.driverStarts (spans the driver started within) replaces
  driverStartedAt; nodeDownCarry / seedNodeDown (since clamped to now).
- driverWsClient: onHomeId reports peerClosedAt, set only when the SERVER ended
  a handshaken link (our own teardowns strip the close listener).
- zwaveData: driverStarts() = host boot (fixed at the first engine tick), a
  restart seen over the link, one carried on the same boot; the carry is taken
  at the first tick, after the home id is bound; opts.uptimeMs.
- evidenceStore: optional nodeDown / driverStart fields, takeCarry(), a carry
  change alone saves the store; reset drops the carry.
- 18 new tests, 42 harness entries; CHANGELOG 0.79.3, 0.77.2 + 0.77.1 rotated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode-downs only, Unknown is no reading

Review wf_b808a39d-d1a: ship after fixes. All three state lenses found that a
start death still waiting, carried across a host reboot, was raised on the new
boot's first tick.

- symptoms: DwellEntry.start (a start death stays one; carried as st:1);
  Unknown neither ends nor advances a node-down dwell, a raised one stays
  raised through it; a raised dwell is raised at once while it reads Dead.
- evidenceStore: on another boot only raised node-downs load; the carry is
  stamped with its network and another network's is not written; the carry
  key is by content, sorted by node.
- zwaveData: the carry getter stamps lastHomeId; a node-down dwell that
  starts, is raised or ends saves the store at once.
- driverWsClient: a WS_ERR_* protocol error (the ws library closes the link
  itself) is not a peer close.
- Tests: 8 more (26 in all); startRun registers its cleanup before its waits.
  Harness: 16 more entries, 13 re-anchored. CHANGELOG/DOCS corrected; 0.77.3
  rotated verbatim.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e latch check the raise-at-once branch made redundant

The touched harness left two survivors, each made redundant by the review
fixes:
- node-down-latched: a raised node-down is now raised at once whatever dwell
  its flags ask for, so excluding latched entries from the start rule did
  nothing. The conjunct is removed and its entry retired.
- boot-read-once: with the start verdict sticky, a boot frozen at the first
  tick no longer protects anything, and it misjudged a death first seen after
  the wall clock jumped ahead of uptime. driverStarts(now) now takes the boot
  as now - uptime at each tick, so a verdict is judged on uptime and then kept.

New wired test: a death first seen 12.5 min of clock ahead of uptime is a start
death (90 min; a frozen boot gave 5). Harness: boot-judged-each-tick added, 4
entries re-anchored. 1,764 tests; 1,786 harness entries.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…g sections

From doc-accuracy scan wf_9f64829e-15d:
- CHANGELOG 0.79.3 intro: the start window is 10 minutes; 90 is the dwell.
- CHANGELOG 0.79.2: impersonal "the add-on's own" for "our own" (twice).
- CHANGELOG 0.79.1: 31 existing entries were re-anchored, not 43 (12 of the
  43 commented entries were new in that release).
- CHANGELOG 0.78.3: describe the Supervisor's mechanism, not what the badge
  will do.
- DOCS §6: onHomeId's v0.79.3 signature and what it records; §5: the save's
  no-op condition includes the carry. DESIGN: the node-down row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…yed on what must not be lost, spaced a minute

Re-review wf_7f833b0c-f03 (on 9274268): do not publish until these are fixed.
- The prompt save missed a carried node-down ending on the first tick (its key
  started empty) and a start verdict or driver restart reached later. Its key
  is now the raised node-downs, start deaths and newest driver restart,
  initialised from the restored carry, with at most one save a minute (a
  flapping node rewrote the 2.3 MB store every tick).
- Home Assistant is sent nothing until the engine's first tick
  (EngineStatus.ran), so degraded is not sent off before a carried node-down
  is raised again; an engine with no evidence store reads as run.
- The Unknown card counts Dead time only and says the status is Unknown; a
  seeded dwell is Dead as of the restart.
- A node that leaves the network takes its dwells with it (a reused id read
  Unknown would re-raise the latch).
- Text: the clock-battery claim holds only inside the 180 s boot grace; a
  network drop is not told apart from a restart; the reboot trade-off is in
  the cost; the §11.12 note names the self-proven credit.
- 1,769 tests; 1,798 harness entries (14 added, 2 replaced ones retired).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Final review wf_39a32712-c3c: ship f11b88a with no code change once the text is
corrected and the full harness is green.
- Only a start verdict stays; a death not yet judged one is judged again each
  tick, so a forward clock step during its dwell can still make it one.
- A plain 5-minute dwell is written by the flush and the shutdown save, so a
  crash restart can bring one back with its old onset.
- A reused id is covered only after 5 minutes off the roster;
  replace_failed_node keeps the id, so the raised node-down is held.
- The update from 0.79.2 also raises a FLiRS start death still waiting at it
  (the deploy now refuses to install while a FLiRS node reads Dead).
- /api/health and the HA states disagree until the engine's first tick.
- 70 new harness entries (net 69: one retired).
Comments only in src (index.ts, zwaveData.ts).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tesseractAZ
tesseractAZ merged commit 34f3fed into main Nov 20, 2026
8 checks passed
@tesseractAZ
tesseractAZ deleted the start-anchor-v0793 branch November 20, 2026 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant