indigo-matter-bridge 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,8 +4,9 @@ The Matter **bridge node** for the
4
4
  [indigo-matter](https://github.com/simons-plugins/indigo-matter) Indigo plugin.
5
5
 
6
6
  It exports selected [Indigo](https://www.indigodomo.com) devices as Matter
7
- accessories, so Apple Home, Alexa, Google Home and SmartThings see them as
8
- ordinary Matter devices on a bridge.
7
+ accessories, so an ecosystem sees them as ordinary Matter devices on a bridge.
8
+ **Apple Home** is the ecosystem this is built and documented for; Alexa, Google
9
+ Home and SmartThings are untested and unclaimed.
9
10
 
10
11
  > **This package is not useful on its own.** It has no configuration of its own,
11
12
  > no discovery, and no idea what an Indigo device is. It is one half of a pair:
@@ -25,6 +25,18 @@
25
25
  * baseline stays, so the drift keeps being reported until a human resolves it
26
26
  * with §3.11.
27
27
  *
28
+ * **It also carries what it takes to REBUILD an endpoint** (issue #141). Numbers
29
+ * alone were enough while the file was only a witness, but a node that comes
30
+ * online with an empty aggregator and waits for the plugin tells every paired
31
+ * ecosystem that every accessory has gone — Apple re-adds them as new arrivals
32
+ * and the user's room assignments are destroyed on every restart. So each entry
33
+ * also records the `role` and `label` the endpoint was last created with, which
34
+ * is exactly (and only) what `createEndpoint` needs; `node.ts` restores the set
35
+ * from here before the stack goes online. `options` is deliberately NOT stored:
36
+ * nothing in this node reads it (window-covering polarity is applied
37
+ * plugin-side), so persisting it would be storing a field to satisfy a sentence
38
+ * rather than a caller.
39
+ *
28
40
  * Stdlib only — no matter.js import — which is what lets the whole detector be
29
41
  * tested without a Matter stack. Callers hand in `{uniqueId, endpointNumber}`
30
42
  * pairs; deriving `uniqueId` from an Indigo device id is `endpoints.ts`'s job.
@@ -80,28 +92,79 @@ export interface EndpointIdentityState {
80
92
  export declare function refuseReasonFor(state: EndpointIdentityState): string | undefined;
81
93
  /** Sibling of `identity.json` in the bridge storage dir. */
82
94
  export declare const ENDPOINT_MAP_FILE = "endpoint-map.json";
83
- /** Schema version of the persisted file. Bump only on an incompatible change. */
84
- export declare const ENDPOINT_MAP_VERSION = 1;
85
- /** The on-disk shape. */
95
+ /**
96
+ * Schema version of the persisted file.
97
+ *
98
+ * **2 since issue #141**, which added `role`/`label` to every entry so the
99
+ * endpoint set can be rebuilt without the plugin. Version 1 files are still
100
+ * read — see {@link ENDPOINT_MAP_VERSION_LEGACY} — because a v1 file holds the
101
+ * one thing that can never be re-derived: the numbers paired ecosystems know.
102
+ */
103
+ export declare const ENDPOINT_MAP_VERSION = 2;
104
+ /** The numbers-only shape shipped by E5. Still read; never written again. */
105
+ export declare const ENDPOINT_MAP_VERSION_LEGACY = 1;
106
+ /**
107
+ * One persisted endpoint.
108
+ *
109
+ * `number` is the identity half and is always there. `role`/`label` are the
110
+ * *restoration* half and are optional, because a v1 file has neither and
111
+ * discarding a v1 file to get a tidier type would throw away the numbers every
112
+ * paired ecosystem is keyed on. An entry without them is still a perfectly good
113
+ * witness; it simply cannot be restored until the plugin next attaches and
114
+ * fills them in.
115
+ */
116
+ export interface EndpointRecord {
117
+ number: number;
118
+ role?: string;
119
+ label?: string;
120
+ }
121
+ /** The on-disk shape (v2). */
86
122
  export interface EndpointMapFile {
87
123
  version: number;
88
- /** `UniqueID → endpoint number`. */
124
+ /** `UniqueID → {number, role?, label?}`. */
125
+ endpoints: Record<string, EndpointRecord>;
126
+ }
127
+ /** The v1 on-disk shape — `UniqueID → endpoint number`. Read-only, for tests and migration. */
128
+ export interface EndpointMapFileV1 {
129
+ version: 1;
89
130
  endpoints: Record<string, number>;
90
131
  }
91
132
  /** One live endpoint, as the detector needs to see it. */
92
133
  export interface LiveEndpointNumber {
93
134
  uniqueId: string;
94
135
  endpointNumber: number;
136
+ /**
137
+ * What it would take to rebuild this endpoint at the next start. Optional
138
+ * so a caller that genuinely does not know (the E5 migration seed, which
139
+ * has no live set at all) cannot be forced to invent them — an absent
140
+ * value never erases a recorded one.
141
+ */
142
+ role?: string;
143
+ label?: string;
144
+ }
145
+ /** An entry complete enough for `node.ts` to reconstruct before going online. */
146
+ export interface RestorableEndpoint {
147
+ uniqueId: string;
148
+ endpointNumber: number;
149
+ role: string;
150
+ label: string;
95
151
  }
96
152
  /** The outcome of reading the file: absent, usable, or present-but-broken. */
97
153
  export interface EndpointMapLoad {
98
- numbers: Map<string, number>;
154
+ endpoints: Map<string, EndpointRecord>;
99
155
  /** True when a file was there at all — absent is a first run, not a fault. */
100
156
  present: boolean;
101
157
  /** Set only when a file was present and could not be used. */
102
158
  problem?: string;
103
159
  }
104
- /** Read `endpoint-map.json`. Never throws — the caller decides what a fault means. */
160
+ /**
161
+ * Read `endpoint-map.json`. Never throws — the caller decides what a fault means.
162
+ *
163
+ * **A v1 file is migrated, never rejected.** Its entries are numbers-only, so
164
+ * they load as records with no `role`/`label` and are simply not restorable
165
+ * until the next attach records them; the numbers themselves are the identity
166
+ * every paired ecosystem is keyed on and must survive the upgrade untouched.
167
+ */
105
168
  export declare function loadEndpointMap(storagePath: string): EndpointMapLoad;
106
169
  /** Delete `endpoint-map.json`. Returns whether a file was actually removed. */
107
170
  export declare function deleteEndpointMap(storagePath: string): boolean;
@@ -149,6 +212,52 @@ export declare class EndpointMapStore {
149
212
  /** The recorded number for a `UniqueID`, if there is one. */
150
213
  numberFor(uniqueId: string): number | undefined;
151
214
  get size(): number;
215
+ /**
216
+ * The entries complete enough to rebuild before the stack goes online
217
+ * (issue #141).
218
+ *
219
+ * Entries missing `role` or `label` are silently absent rather than
220
+ * reported as a fault: that is precisely a v1 file's normal state, and one
221
+ * attach fills it in. Order is the map's own insertion order, which is the
222
+ * order the numbers were first recorded — irrelevant to matter.js, which
223
+ * keys each endpoint's number on its `Endpoint.id`, but stable, which makes
224
+ * the log read the same way twice.
225
+ */
226
+ restorable(): RestorableEndpoint[];
227
+ /**
228
+ * A device was **un-exported**: keep its number, drop what would rebuild it.
229
+ *
230
+ * The other half of {@link restorable}, and without it the restore is a bug
231
+ * rather than a fix. `check` only ever *adds* and *refreshes*, so once an
232
+ * entry has carried a `role`/`label` it carries them for ever — and a device
233
+ * the user deliberately un-exported therefore stayed restorable, was
234
+ * re-created as a child endpoint on every single boot, and was removed again
235
+ * by the plugin's next attach seconds later. That is precisely the
236
+ * appear-then-vanish churn issue #141 exists to eliminate, aimed at the
237
+ * devices the user had already told us to stop exporting, and it regresses
238
+ * XAC7's "un-exported accessories are gone".
239
+ *
240
+ * **The number stays.** §3.3 retains the allocation on purpose, so re-adding
241
+ * the same device gets the same endpoint number back and paired ecosystems
242
+ * see the accessory they already know rather than a new one. Deleting the
243
+ * entry outright would throw that away to save three fields. Clearing only
244
+ * the restoration half makes the entry non-restorable — {@link restorable}
245
+ * filters on `role` **and** `label` — while leaving the identity intact, and
246
+ * one re-export refills it through the ordinary {@link check}.
247
+ *
248
+ * **Only a caller that watched a specific endpoint go may call this.** An
249
+ * empty live set is not evidence of anything: a node that has never attached
250
+ * has none, and `seed([])` deliberately knows nothing. So this takes the
251
+ * uniqueIds that were actually removed rather than inferring them from
252
+ * whatever happens to be live, and `node.ts` derives them by diffing the
253
+ * live set across one mutation. A factory reset is deliberately NOT such a
254
+ * caller: `erase()` wipes matter.js's endpoints, but the user un-exported
255
+ * nothing and the plugin's re-attach re-creates the same set.
256
+ *
257
+ * Returns how many entries actually lost something, so a no-op costs no
258
+ * disk write.
259
+ */
260
+ forget(uniqueIds: readonly string[]): number;
152
261
  /**
153
262
  * Compare the live endpoint numbers against the map (PRD §4.3).
154
263
  *
@@ -173,6 +282,16 @@ export declare class EndpointMapStore {
173
282
  * true is the migration; refusing to serve until a human confirms a
174
283
  * *rebuild* would take a working bridge offline to fix a file it never had.
175
284
  *
285
+ * **This is a full REPLACE, not a merge**, and the next caller has to mean
286
+ * it: whatever is in memory is dropped, so seeding a partial list silently
287
+ * discards the numbers of everything absent from it — the one thing in this
288
+ * file that cannot be re-derived. Today's single caller
289
+ * (`node.bootstrapEndpointMap`) passes `[]` against a map that is by
290
+ * definition absent, so it drops nothing; the assertion below is what keeps
291
+ * that true if a later caller has a map in hand. A caller that wants to add
292
+ * to a baseline wants {@link check}, and one that wants to replace a
293
+ * *disagreeing* baseline wants {@link rebuild}, which quarantines first.
294
+ *
176
295
  * Returns whether the baseline reached disk.
177
296
  */
178
297
  seed(numbers: readonly LiveEndpointNumber[], why: string): boolean;
@@ -25,6 +25,18 @@
25
25
  * baseline stays, so the drift keeps being reported until a human resolves it
26
26
  * with §3.11.
27
27
  *
28
+ * **It also carries what it takes to REBUILD an endpoint** (issue #141). Numbers
29
+ * alone were enough while the file was only a witness, but a node that comes
30
+ * online with an empty aggregator and waits for the plugin tells every paired
31
+ * ecosystem that every accessory has gone — Apple re-adds them as new arrivals
32
+ * and the user's room assignments are destroyed on every restart. So each entry
33
+ * also records the `role` and `label` the endpoint was last created with, which
34
+ * is exactly (and only) what `createEndpoint` needs; `node.ts` restores the set
35
+ * from here before the stack goes online. `options` is deliberately NOT stored:
36
+ * nothing in this node reads it (window-covering polarity is applied
37
+ * plugin-side), so persisting it would be storing a field to satisfy a sentence
38
+ * rather than a caller.
39
+ *
28
40
  * Stdlib only — no matter.js import — which is what lets the whole detector be
29
41
  * tested without a Matter stack. Callers hand in `{uniqueId, endpointNumber}`
30
42
  * pairs; deriving `uniqueId` from an Indigo device id is `endpoints.ts`'s job.
@@ -72,48 +84,110 @@ export function refuseReasonFor(state) {
72
84
  }
73
85
  /** Sibling of `identity.json` in the bridge storage dir. */
74
86
  export const ENDPOINT_MAP_FILE = "endpoint-map.json";
75
- /** Schema version of the persisted file. Bump only on an incompatible change. */
76
- export const ENDPOINT_MAP_VERSION = 1;
87
+ /**
88
+ * Schema version of the persisted file.
89
+ *
90
+ * **2 since issue #141**, which added `role`/`label` to every entry so the
91
+ * endpoint set can be rebuilt without the plugin. Version 1 files are still
92
+ * read — see {@link ENDPOINT_MAP_VERSION_LEGACY} — because a v1 file holds the
93
+ * one thing that can never be re-derived: the numbers paired ecosystems know.
94
+ */
95
+ export const ENDPOINT_MAP_VERSION = 2;
96
+ /** The numbers-only shape shipped by E5. Still read; never written again. */
97
+ export const ENDPOINT_MAP_VERSION_LEGACY = 1;
77
98
  /** Stable keys so a repeated failure replaces its warning rather than stacking. */
78
99
  const WARN_PERSIST = "endpoint-map-persist";
79
100
  const WARN_DELETE = "endpoint-map-delete";
80
- function isEndpointMapFile(value) {
81
- if (typeof value !== "object" || value === null) {
82
- return false;
101
+ function isNonEmptyString(value) {
102
+ return typeof value === "string" && value.length > 0;
103
+ }
104
+ function isEndpointNumber(value) {
105
+ return typeof value === "number" && Number.isInteger(value) && value >= 0;
106
+ }
107
+ /**
108
+ * Read one entry in either schema, or `undefined` if it is not usable.
109
+ *
110
+ * A v2 entry with a bad `role`/`label` keeps its number and loses only the
111
+ * fields that were wrong, for the same reason a v1 file is not discarded: the
112
+ * number is the irreplaceable part, and refusing the whole file over a label
113
+ * would turn a cosmetic corruption into a refuse-to-start.
114
+ */
115
+ function readRecord(value) {
116
+ if (isEndpointNumber(value)) {
117
+ return { number: value };
118
+ }
119
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
120
+ return undefined;
83
121
  }
84
122
  const candidate = value;
85
- if (candidate.version !== ENDPOINT_MAP_VERSION) {
86
- return false;
123
+ if (!isEndpointNumber(candidate.number)) {
124
+ return undefined;
125
+ }
126
+ const record = { number: candidate.number };
127
+ if (isNonEmptyString(candidate.role)) {
128
+ record.role = candidate.role;
87
129
  }
88
- const { endpoints } = candidate;
89
- if (typeof endpoints !== "object" || endpoints === null || Array.isArray(endpoints)) {
90
- return false;
130
+ if (isNonEmptyString(candidate.label)) {
131
+ record.label = candidate.label;
91
132
  }
92
- return Object.values(endpoints).every(number => typeof number === "number" && Number.isInteger(number) && number >= 0);
133
+ return record;
134
+ }
135
+ /**
136
+ * Parse the `endpoints` object of either schema version, or `undefined` if the
137
+ * file is not an endpoint map at all.
138
+ */
139
+ function readEndpoints(value) {
140
+ if (typeof value !== "object" || value === null || Array.isArray(value)) {
141
+ return undefined;
142
+ }
143
+ const endpoints = new Map();
144
+ for (const [uniqueId, entry] of Object.entries(value)) {
145
+ const record = readRecord(entry);
146
+ if (record === undefined) {
147
+ return undefined;
148
+ }
149
+ endpoints.set(uniqueId, record);
150
+ }
151
+ return endpoints;
152
+ }
153
+ function isKnownVersion(version) {
154
+ return version === ENDPOINT_MAP_VERSION || version === ENDPOINT_MAP_VERSION_LEGACY;
93
155
  }
94
156
  function isNotFound(error) {
95
157
  return error?.code === "ENOENT";
96
158
  }
97
- /** Read `endpoint-map.json`. Never throws — the caller decides what a fault means. */
159
+ /**
160
+ * Read `endpoint-map.json`. Never throws — the caller decides what a fault means.
161
+ *
162
+ * **A v1 file is migrated, never rejected.** Its entries are numbers-only, so
163
+ * they load as records with no `role`/`label` and are simply not restorable
164
+ * until the next attach records them; the numbers themselves are the identity
165
+ * every paired ecosystem is keyed on and must survive the upgrade untouched.
166
+ */
98
167
  export function loadEndpointMap(storagePath) {
99
168
  const file = join(storagePath, ENDPOINT_MAP_FILE);
100
169
  try {
101
170
  const parsed = JSON.parse(readFileSync(file, "utf8"));
102
- if (!isEndpointMapFile(parsed)) {
171
+ const version = parsed?.version;
172
+ const endpoints = isKnownVersion(version)
173
+ ? readEndpoints(parsed.endpoints)
174
+ : undefined;
175
+ if (endpoints === undefined) {
103
176
  return {
104
- numbers: new Map(),
177
+ endpoints: new Map(),
105
178
  present: true,
106
- problem: `${file} is not a version ${ENDPOINT_MAP_VERSION} endpoint map`,
179
+ problem: `${file} is not a version ${ENDPOINT_MAP_VERSION} ` +
180
+ `(or legacy version ${ENDPOINT_MAP_VERSION_LEGACY}) endpoint map`,
107
181
  };
108
182
  }
109
- return { numbers: new Map(Object.entries(parsed.endpoints)), present: true };
183
+ return { endpoints, present: true };
110
184
  }
111
185
  catch (error) {
112
186
  if (isNotFound(error)) {
113
- return { numbers: new Map(), present: false };
187
+ return { endpoints: new Map(), present: false };
114
188
  }
115
189
  return {
116
- numbers: new Map(),
190
+ endpoints: new Map(),
117
191
  present: true,
118
192
  problem: `${file} is unreadable (${describeError(error)})`,
119
193
  };
@@ -132,6 +206,49 @@ export function deleteEndpointMap(storagePath) {
132
206
  throw error;
133
207
  }
134
208
  }
209
+ /** A fresh record from a live endpoint, carrying whatever it could tell us. */
210
+ function recordFor(entry) {
211
+ const record = { number: entry.endpointNumber };
212
+ if (entry.role !== undefined) {
213
+ record.role = entry.role;
214
+ }
215
+ if (entry.label !== undefined) {
216
+ record.label = entry.label;
217
+ }
218
+ return record;
219
+ }
220
+ /**
221
+ * Refresh an existing record's restoration half from a live endpoint.
222
+ *
223
+ * An **absent** value never erases a recorded one: the seed path has no live
224
+ * set at all, and reading its silence as "this endpoint has no role any more"
225
+ * would strip a perfectly good entry of the very fields that make it
226
+ * restorable. Returns whether anything changed, so a steady state still costs
227
+ * no disk write.
228
+ */
229
+ function noteRestorable(record, entry) {
230
+ let changed = false;
231
+ if (entry.role !== undefined && record.role !== entry.role) {
232
+ record.role = entry.role;
233
+ changed = true;
234
+ }
235
+ if (entry.label !== undefined && record.label !== entry.label) {
236
+ record.label = entry.label;
237
+ changed = true;
238
+ }
239
+ return changed;
240
+ }
241
+ /** Why {@link EndpointMapStore.check} is writing, for the log line. */
242
+ function persistReason(added, refreshed) {
243
+ const parts = [];
244
+ if (added > 0) {
245
+ parts.push(`recorded ${added} new endpoint number(s)`);
246
+ }
247
+ if (refreshed > 0) {
248
+ parts.push(`refreshed ${refreshed} endpoint role/label(s)`);
249
+ }
250
+ return parts.length === 0 ? "retried after a failed write" : parts.join(" and ");
251
+ }
135
252
  /**
136
253
  * The map plus the operations §3.10/§3.11 and the drift detector need.
137
254
  *
@@ -143,7 +260,7 @@ export class EndpointMapStore {
143
260
  storagePath;
144
261
  log;
145
262
  now;
146
- #numbers = new Map();
263
+ #endpoints = new Map();
147
264
  #present = false;
148
265
  #problem;
149
266
  #checked = false;
@@ -179,7 +296,7 @@ export class EndpointMapStore {
179
296
  /** Read the file into memory. Idempotent; the last read wins. */
180
297
  load() {
181
298
  const loaded = loadEndpointMap(this.storagePath);
182
- this.#numbers = loaded.numbers;
299
+ this.#endpoints = loaded.endpoints;
183
300
  this.#present = loaded.present;
184
301
  this.#problem = loaded.problem;
185
302
  this.#checked = false;
@@ -193,7 +310,9 @@ export class EndpointMapStore {
193
310
  this.log("No endpoint map yet; the first reconcile will record one");
194
311
  }
195
312
  else {
196
- this.log(`Loaded endpoint map: ${loaded.numbers.size} endpoint number(s)`);
313
+ const restorable = this.restorable().length;
314
+ this.log(`Loaded endpoint map: ${loaded.endpoints.size} endpoint number(s), ` +
315
+ `${restorable} restorable at startup`);
197
316
  }
198
317
  return loaded;
199
318
  }
@@ -230,10 +349,86 @@ export class EndpointMapStore {
230
349
  }
231
350
  /** The recorded number for a `UniqueID`, if there is one. */
232
351
  numberFor(uniqueId) {
233
- return this.#numbers.get(uniqueId);
352
+ return this.#endpoints.get(uniqueId)?.number;
234
353
  }
235
354
  get size() {
236
- return this.#numbers.size;
355
+ return this.#endpoints.size;
356
+ }
357
+ /**
358
+ * The entries complete enough to rebuild before the stack goes online
359
+ * (issue #141).
360
+ *
361
+ * Entries missing `role` or `label` are silently absent rather than
362
+ * reported as a fault: that is precisely a v1 file's normal state, and one
363
+ * attach fills it in. Order is the map's own insertion order, which is the
364
+ * order the numbers were first recorded — irrelevant to matter.js, which
365
+ * keys each endpoint's number on its `Endpoint.id`, but stable, which makes
366
+ * the log read the same way twice.
367
+ */
368
+ restorable() {
369
+ const restorable = [];
370
+ for (const [uniqueId, record] of this.#endpoints) {
371
+ if (record.role === undefined || record.label === undefined) {
372
+ continue;
373
+ }
374
+ restorable.push({
375
+ uniqueId,
376
+ endpointNumber: record.number,
377
+ role: record.role,
378
+ label: record.label,
379
+ });
380
+ }
381
+ return restorable;
382
+ }
383
+ /**
384
+ * A device was **un-exported**: keep its number, drop what would rebuild it.
385
+ *
386
+ * The other half of {@link restorable}, and without it the restore is a bug
387
+ * rather than a fix. `check` only ever *adds* and *refreshes*, so once an
388
+ * entry has carried a `role`/`label` it carries them for ever — and a device
389
+ * the user deliberately un-exported therefore stayed restorable, was
390
+ * re-created as a child endpoint on every single boot, and was removed again
391
+ * by the plugin's next attach seconds later. That is precisely the
392
+ * appear-then-vanish churn issue #141 exists to eliminate, aimed at the
393
+ * devices the user had already told us to stop exporting, and it regresses
394
+ * XAC7's "un-exported accessories are gone".
395
+ *
396
+ * **The number stays.** §3.3 retains the allocation on purpose, so re-adding
397
+ * the same device gets the same endpoint number back and paired ecosystems
398
+ * see the accessory they already know rather than a new one. Deleting the
399
+ * entry outright would throw that away to save three fields. Clearing only
400
+ * the restoration half makes the entry non-restorable — {@link restorable}
401
+ * filters on `role` **and** `label` — while leaving the identity intact, and
402
+ * one re-export refills it through the ordinary {@link check}.
403
+ *
404
+ * **Only a caller that watched a specific endpoint go may call this.** An
405
+ * empty live set is not evidence of anything: a node that has never attached
406
+ * has none, and `seed([])` deliberately knows nothing. So this takes the
407
+ * uniqueIds that were actually removed rather than inferring them from
408
+ * whatever happens to be live, and `node.ts` derives them by diffing the
409
+ * live set across one mutation. A factory reset is deliberately NOT such a
410
+ * caller: `erase()` wipes matter.js's endpoints, but the user un-exported
411
+ * nothing and the plugin's re-attach re-creates the same set.
412
+ *
413
+ * Returns how many entries actually lost something, so a no-op costs no
414
+ * disk write.
415
+ */
416
+ forget(uniqueIds) {
417
+ let forgotten = 0;
418
+ for (const uniqueId of uniqueIds) {
419
+ const record = this.#endpoints.get(uniqueId);
420
+ if (record === undefined || (record.role === undefined && record.label === undefined)) {
421
+ continue;
422
+ }
423
+ delete record.role;
424
+ delete record.label;
425
+ forgotten += 1;
426
+ }
427
+ if (forgotten > 0) {
428
+ this.persist(`cleared the role/label of ${forgotten} un-exported endpoint(s), keeping their ` +
429
+ "numbers so a re-export returns the same accessory");
430
+ }
431
+ return forgotten;
237
432
  }
238
433
  /**
239
434
  * Compare the live endpoint numbers against the map (PRD §4.3).
@@ -251,15 +446,23 @@ export class EndpointMapStore {
251
446
  check(live) {
252
447
  const drift = [];
253
448
  let added = 0;
254
- for (const { uniqueId, endpointNumber } of live) {
255
- const expected = this.#numbers.get(uniqueId);
256
- if (expected === undefined) {
257
- this.#numbers.set(uniqueId, endpointNumber);
449
+ let refreshed = 0;
450
+ for (const entry of live) {
451
+ const record = this.#endpoints.get(entry.uniqueId);
452
+ if (record === undefined) {
453
+ this.#endpoints.set(entry.uniqueId, recordFor(entry));
258
454
  added += 1;
259
455
  continue;
260
456
  }
261
- if (expected !== endpointNumber) {
262
- drift.push({ uniqueId, expected, actual: endpointNumber });
457
+ // The restoration half is refreshed even when the number drifted:
458
+ // a renamed accessory whose number also moved must still come back
459
+ // under its current name, and role/label are independent facts from
460
+ // the number. The NUMBER is never touched — see the class comment.
461
+ if (noteRestorable(record, entry)) {
462
+ refreshed += 1;
463
+ }
464
+ if (record.number !== entry.endpointNumber) {
465
+ drift.push({ uniqueId: entry.uniqueId, expected: record.number, actual: entry.endpointNumber });
263
466
  }
264
467
  }
265
468
  // `#dirty` is the retry: a write that failed last time leaves the map
@@ -267,8 +470,8 @@ export class EndpointMapStore {
267
470
  // steady state (`added === 0`, clean) still costs no I/O. Without it a
268
471
  // full disk at the moment of the first check would never be revisited,
269
472
  // and `checked` — see the `#dirty` field — would never come true again.
270
- if (added > 0 || this.#dirty) {
271
- this.persist(added > 0 ? `recorded ${added} new endpoint number(s)` : "retried after a failed write");
473
+ if (added > 0 || refreshed > 0 || this.#dirty) {
474
+ this.persist(persistReason(added, refreshed));
272
475
  }
273
476
  // An empty comparison compared nothing, so it cannot make `driftChecked`
274
477
  // true — the same rule {@link seed} already applies. §4.3 says
@@ -292,13 +495,29 @@ export class EndpointMapStore {
292
495
  * true is the migration; refusing to serve until a human confirms a
293
496
  * *rebuild* would take a working bridge offline to fix a file it never had.
294
497
  *
498
+ * **This is a full REPLACE, not a merge**, and the next caller has to mean
499
+ * it: whatever is in memory is dropped, so seeding a partial list silently
500
+ * discards the numbers of everything absent from it — the one thing in this
501
+ * file that cannot be re-derived. Today's single caller
502
+ * (`node.bootstrapEndpointMap`) passes `[]` against a map that is by
503
+ * definition absent, so it drops nothing; the assertion below is what keeps
504
+ * that true if a later caller has a map in hand. A caller that wants to add
505
+ * to a baseline wants {@link check}, and one that wants to replace a
506
+ * *disagreeing* baseline wants {@link rebuild}, which quarantines first.
507
+ *
295
508
  * Returns whether the baseline reached disk.
296
509
  */
297
510
  seed(numbers, why) {
298
- this.#numbers = new Map(numbers.map(({ uniqueId, endpointNumber }) => [uniqueId, endpointNumber]));
511
+ if (this.#endpoints.size > 0 && numbers.length < this.#endpoints.size) {
512
+ throw new Error(`refusing to seed ${numbers.length} endpoint number(s) over a baseline of ` +
513
+ `${this.#endpoints.size}: seed() replaces the whole map, so this would discard ` +
514
+ "endpoint numbers paired ecosystems are keyed on — use check() to add, or " +
515
+ "rebuild() to deliberately replace");
516
+ }
517
+ this.#endpoints = new Map(numbers.map(entry => [entry.uniqueId, recordFor(entry)]));
299
518
  this.#problem = undefined;
300
519
  this.#checked = numbers.length > 0;
301
- return this.persist(`seeded with ${this.#numbers.size} endpoint number(s) — ${why}`);
520
+ return this.persist(`seeded with ${this.#endpoints.size} endpoint number(s) — ${why}`);
302
521
  }
303
522
  /**
304
523
  * §3.11 — throw the baseline away and adopt the live numbers as the truth.
@@ -322,9 +541,9 @@ export class EndpointMapStore {
322
541
  "records an empty baseline and stops refusing; the numbers themselves are " +
323
542
  "recorded by the reconcile that follows.");
324
543
  }
325
- this.#numbers = new Map(live.map(({ uniqueId, endpointNumber }) => [uniqueId, endpointNumber]));
544
+ this.#endpoints = new Map(live.map(entry => [entry.uniqueId, recordFor(entry)]));
326
545
  this.#problem = undefined;
327
- const persisted = this.persist(`rebuilt from ${this.#numbers.size} live endpoint(s)`);
546
+ const persisted = this.persist(`rebuilt from ${this.#endpoints.size} live endpoint(s)`);
328
547
  // Same rule as `check`: a rebuild from zero live endpoints — which is
329
548
  // the *normal* rebuild, since §1.1 keeps `attach` out of the recovery
330
549
  // commands — has compared nothing, and the baseline it wrote is empty.
@@ -364,7 +583,7 @@ export class EndpointMapStore {
364
583
  * what is corrupt.
365
584
  */
366
585
  discard() {
367
- this.#numbers = new Map();
586
+ this.#endpoints = new Map();
368
587
  this.#problem = undefined;
369
588
  this.#checked = false;
370
589
  this.#dirty = false;
@@ -407,7 +626,7 @@ export class EndpointMapStore {
407
626
  this.quarantineUnusable();
408
627
  const file = {
409
628
  version: ENDPOINT_MAP_VERSION,
410
- endpoints: Object.fromEntries(this.#numbers),
629
+ endpoints: Object.fromEntries(this.#endpoints),
411
630
  };
412
631
  try {
413
632
  writeJsonAtomic(join(this.storagePath, ENDPOINT_MAP_FILE), file);
@@ -1 +1 @@
1
- {"version":3,"file":"endpoint-map.js","sourceRoot":"","sources":["../src/endpoint-map.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,aAAa,EAAmB,YAAY,EAAE,MAAM,eAAe,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAmB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,UAAU,eAAe,CAAC,KAA4B;IACxD,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACrB,OAAO,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,aAAa,CAAC;IACnF,CAAC;IACD,OAAO,KAAK,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,iBAAiB,CAAC;AAC3F,CAAC;AAED,4DAA4D;AAC5D,MAAM,CAAC,M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