@twinsearth/w2m-dsh-plugin 0.34.0 → 0.35.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/CHANGELOG.md CHANGED
@@ -4,6 +4,59 @@ All notable changes to this project are documented here. The format follows
4
4
  [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project
5
5
  adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
+ ## [0.35.0] — 2026-10-15
8
+
9
+ **§1.5 measured at last: the reachability report, and the honest reason it is not a gate.**
10
+
11
+ `docs/1.0.0-ACCEPTANCE.md` §1.5 recorded that **nothing** measured whether an export is reachable. Three
12
+ mechanisms shipped in this span fully tested and completely uncalled — `field-authority.mjs`,
13
+ `approval-gate.mjs`, `createApprovalIndex` — and **a tested mechanism with no caller is indistinguishable from
14
+ a finished feature** by reading either the tests or the source.
15
+
16
+ `scripts/reachability-check.mjs` measures it.
17
+
18
+ ### The first version was unusable, and the false positive that proved it
19
+
20
+ It asked *"which files mention this name"* and reported **378 findings**, almost all false. The clearest:
21
+ `deepEqual` from `src/relay/state.mjs`, which appeared to be named by **69 test files** — every one of them
22
+ calling `assert.deepEqual`. Whole-word matching cannot tell an imported binding from a coincidental name.
23
+
24
+ **An import is a statement about two things at once — a module and a name — so matching on the name alone
25
+ throws away half of what the source says.** The check now reads both and matches on the pair:
26
+
27
+ ```
28
+ importedNames(text) -> module specifier -> imported names
29
+ resolveSpecifier() -> the file that specifier names, the way Node resolves it
30
+ ```
31
+
32
+ ### Why it exits 0, which is the part worth defending
33
+
34
+ Measured against this repository it names **465 exports**, and it **cannot tell three kinds apart**:
35
+
36
+ 1. **the defect** — built, tested, never wired;
37
+ 2. **a deliberate surface** — the plugin's entry points and re-exports;
38
+ 3. **composition** — a capability reached only through another module's use.
39
+
40
+ Only the first is a finding, and no static name-and-import check separates them. **A check that fails on 465
41
+ things nobody will fix is a check that gets disabled within a week — and a disabled check is worse than none,
42
+ because it is cited as coverage.** So it prints, exits 0, and closes with *"READ THIS AS A LIST TO TRIAGE, NOT
43
+ A LIST OF BUGS."*
44
+
45
+ **§1.5 is therefore measured, not closed.** A defect of this class is now *visible*; nothing fails when one
46
+ appears. The tests build synthetic trees where ground truth is known, because asserting on the real 465 would
47
+ pin noise.
48
+
49
+ ### Three of my own errors, and one of them is the lesson of this whole span
50
+
51
+ * My re-export exclusion looked for ` from ` **inside** the captured braces, so it never saw it —
52
+ `export { X } from './y.mjs'` was counted as a definition. **The test failed because the code was wrong.**
53
+ * I expected `b` in an export list where the source says `b as bee`. The implementation was right.
54
+ * **I "fixed" that by sorting my own guessed array.** Sorting a wrong list does not make it measured — and
55
+ that is the same mistake, in miniature, that this project has now paid for six times: **predicting what the
56
+ output is instead of printing it.** The fix was to print it.
57
+
58
+ **16 new tests, 0 failures.**
59
+
7
60
  ## [0.34.0] — 2026-10-15
8
61
 
9
62
  **`requireAuthorityLevel`: the policy that makes 分权限 real, and why it is a flag rather than a default.**
@@ -18,13 +18,36 @@ but has no caller, that is stated in its own column rather than hidden behind a
18
18
  | 1.2 | Every dependency edge is declared, and every declared edge is used | `scripts/layer-check.mjs` | **yes** |
19
19
  | 1.3 | Every suite on disk is named by a script | pre-flight `test wiring`, `claims` | **yes** — reported, not silently ignored |
20
20
  | 1.4 | Every document's claim about the artifact matches the artifact | `test/claims.test.mjs` | **yes** — 48 claims, and it has caught real drift |
21
- | 1.5 | No module is unreachable — every declared thing has a caller | *nothing* | **NO — see §4** |
21
+ | 1.5 | No module is unreachable — every declared thing has a caller | `scripts/reachability-check.mjs` | **MEASURED, not enforced — see below** |
22
22
 
23
- `1.5` is the row that matters most and is the one **not** satisfied. This span shipped three mechanisms that
24
- were, for a round each, fully tested and completely uncalled: `field-authority.mjs`, `approval-gate.mjs`, and
25
- before them `createApprovalIndex`. **A tested mechanism with no caller is indistinguishable from a finished
26
- feature by reading either the tests or the source.** `1.4` catches *documentation* drift and cannot catch this,
27
- because the document and the code can agree while neither is reachable.
23
+ `1.5` is the row that mattered most and the one that went unsatisfied longest. This span shipped three
24
+ mechanisms that were, for a round each, fully tested and completely uncalled: `field-authority.mjs`,
25
+ `approval-gate.mjs`, and before them `createApprovalIndex`. **A tested mechanism with no caller is
26
+ indistinguishable from a finished feature by reading either the tests or the source.** `1.4` catches
27
+ *documentation* drift and cannot catch this, because the document and the code can agree while neither is
28
+ reachable.
29
+
30
+ **0.35.0 measures it.** `scripts/reachability-check.mjs` matches **imports** — a module and a name together —
31
+ and reports exports that only test files import.
32
+
33
+ ### Why it is a report and not a gate, which is the honest part
34
+
35
+ Measured against this repository it names **465 exports**, and it **cannot tell three kinds apart**:
36
+
37
+ 1. **the defect** — built, tested, never wired;
38
+ 2. **a deliberate surface** — the plugin's entry points and re-exports;
39
+ 3. **composition** — a capability reached only through another module's use.
40
+
41
+ Only the first is a finding. **A check that fails on 465 things nobody will fix is a check that gets
42
+ disabled within a week, and a disabled check is worse than none because it is cited as coverage.** So it exits
43
+ **0** and prints, and its own output says *"READ THIS AS A LIST TO TRIAGE, NOT A LIST OF BUGS."*
44
+
45
+ The tests therefore build **synthetic trees where ground truth is known** and pin the one distinction it *is*
46
+ reliable for — including the false positive that broke the first version, `deepEqual` from
47
+ `src/relay/state.mjs` appearing to be named by **69 test files** that were all calling `assert.deepEqual`.
48
+
49
+ **So `1.5` is measured, not closed.** A defect of this class is now *visible*; it is not *prevented*, and
50
+ nothing in the pre-flight fails when one appears.
28
51
 
29
52
  ---
30
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twinsearth/w2m-dsh-plugin",
3
- "version": "0.34.0",
3
+ "version": "0.35.0",
4
4
  "description": "DSH: Windows2MacOS — drive the same project on online Windows and macOS machines from one DeepSeek account, across networks and regions. P2P hole punching is the default path (relay + shared server as rendezvous, ledger and fallback), with a bundled STUN responder, Tailscale/public-VPS/tunnel shapes, Rabbit relay + per-machine Localside + eight DSH tools (replicate / split), nine aggregate verdicts and signed requests.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -113,13 +113,13 @@
113
113
  }
114
114
  },
115
115
  "scripts": {
116
- "test": "node --test --test-force-exit test/relay.test.mjs test/broadcast.test.mjs test/agent.test.mjs test/authority.test.mjs test/blocks.test.mjs test/approval-index.test.mjs test/fleet-sync.test.mjs test/health.test.mjs test/storage.test.mjs test/exit-channel.test.mjs test/council.test.mjs test/log-bounds.test.mjs test/test-report.test.mjs test/fleet-scale.test.mjs test/fleet-state.test.mjs test/crypto-blake2s.test.mjs test/installed-version.test.mjs test/permission.test.mjs test/machine-test-packet.test.mjs test/field-authority.test.mjs test/approval-gate.test.mjs test/authority-choice.test.mjs test/layer-model.test.mjs test/memory.test.mjs test/tools.test.mjs test/claims.test.mjs test/fleet-target.test.mjs test/client-bundle.test.mjs test/schedule.test.mjs test/auto-update.test.mjs test/update-source.test.mjs test/update-install.test.mjs test/update-wiring.test.mjs test/signing.test.mjs test/stress.test.mjs test/shared-config.test.mjs test/metrics.test.mjs test/metrics-route.test.mjs test/tool-cards.test.mjs test/p2p-stun.test.mjs test/p2p-transport.test.mjs test/p2p-signaling.test.mjs test/p2p-node.test.mjs test/p2p-transport-fields.test.mjs test/p2p-plugin.test.mjs test/p2p-crypto.test.mjs test/stun-server.test.mjs test/loader-entry.test.mjs test/mdns-wire.test.mjs test/mdns-discover.test.mjs test/chatops-approval.test.mjs test/chatops-policy.test.mjs test/chatops-file-safety.test.mjs test/chatops-outbound-queue.test.mjs test/chatops-commands.test.mjs test/chatops-bridge.test.mjs test/chatops-config-route.test.mjs test/chatops-apply.test.mjs test/chatops-ilink-contract.test.mjs test/chatops-fleet.test.mjs test/chatops-account.test.mjs test/chatops-auth.test.mjs test/chatops-fleet-scope.test.mjs test/chatops-handoff.test.mjs test/chatops-fleet-wiring.test.mjs test/chatops-fleet-live.test.mjs test/chatops-takeover.test.mjs test/chatops-device-signing.test.mjs test/chatops-relay-verify.test.mjs test/chatops-durability.test.mjs test/chatops-run-command.test.mjs test/secrets-guard.test.mjs test/chatops-ilink-fleet-bridge.test.mjs test/chatops-fleet-join.test.mjs",
116
+ "test": "node --test --test-force-exit test/relay.test.mjs test/broadcast.test.mjs test/agent.test.mjs test/authority.test.mjs test/blocks.test.mjs test/approval-index.test.mjs test/fleet-sync.test.mjs test/health.test.mjs test/storage.test.mjs test/exit-channel.test.mjs test/council.test.mjs test/log-bounds.test.mjs test/test-report.test.mjs test/fleet-scale.test.mjs test/fleet-state.test.mjs test/crypto-blake2s.test.mjs test/installed-version.test.mjs test/permission.test.mjs test/machine-test-packet.test.mjs test/field-authority.test.mjs test/approval-gate.test.mjs test/authority-choice.test.mjs test/reachability-check.test.mjs test/layer-model.test.mjs test/memory.test.mjs test/tools.test.mjs test/claims.test.mjs test/fleet-target.test.mjs test/client-bundle.test.mjs test/schedule.test.mjs test/auto-update.test.mjs test/update-source.test.mjs test/update-install.test.mjs test/update-wiring.test.mjs test/signing.test.mjs test/stress.test.mjs test/shared-config.test.mjs test/metrics.test.mjs test/metrics-route.test.mjs test/tool-cards.test.mjs test/p2p-stun.test.mjs test/p2p-transport.test.mjs test/p2p-signaling.test.mjs test/p2p-node.test.mjs test/p2p-transport-fields.test.mjs test/p2p-plugin.test.mjs test/p2p-crypto.test.mjs test/stun-server.test.mjs test/loader-entry.test.mjs test/mdns-wire.test.mjs test/mdns-discover.test.mjs test/chatops-approval.test.mjs test/chatops-policy.test.mjs test/chatops-file-safety.test.mjs test/chatops-outbound-queue.test.mjs test/chatops-commands.test.mjs test/chatops-bridge.test.mjs test/chatops-config-route.test.mjs test/chatops-apply.test.mjs test/chatops-ilink-contract.test.mjs test/chatops-fleet.test.mjs test/chatops-account.test.mjs test/chatops-auth.test.mjs test/chatops-fleet-scope.test.mjs test/chatops-handoff.test.mjs test/chatops-fleet-wiring.test.mjs test/chatops-fleet-live.test.mjs test/chatops-takeover.test.mjs test/chatops-device-signing.test.mjs test/chatops-relay-verify.test.mjs test/chatops-durability.test.mjs test/chatops-run-command.test.mjs test/secrets-guard.test.mjs test/chatops-ilink-fleet-bridge.test.mjs test/chatops-fleet-join.test.mjs",
117
117
  "test:e2e": "node --test --test-force-exit test/e2e.test.mjs test/crossnetwork.test.mjs test/signing-e2e.test.mjs test/outbound-only.test.mjs test/recovery.test.mjs test/pipeline-e2e.test.mjs test/p2p-agent.test.mjs",
118
118
  "test:relay": "node --test --test-force-exit test/relay.test.mjs",
119
119
  "test:agent": "node --test --test-force-exit test/agent.test.mjs test/memory.test.mjs",
120
120
  "test:tools": "node --test --test-force-exit test/tools.test.mjs",
121
121
  "test:crossnetwork": "node --test --test-force-exit test/crossnetwork.test.mjs",
122
- "test:all": "node --test --test-force-exit test/relay.test.mjs test/broadcast.test.mjs test/agent.test.mjs test/authority.test.mjs test/blocks.test.mjs test/approval-index.test.mjs test/fleet-sync.test.mjs test/health.test.mjs test/storage.test.mjs test/exit-channel.test.mjs test/council.test.mjs test/log-bounds.test.mjs test/test-report.test.mjs test/fleet-scale.test.mjs test/fleet-state.test.mjs test/crypto-blake2s.test.mjs test/installed-version.test.mjs test/permission.test.mjs test/machine-test-packet.test.mjs test/field-authority.test.mjs test/approval-gate.test.mjs test/authority-choice.test.mjs test/layer-model.test.mjs test/memory.test.mjs test/tools.test.mjs test/claims.test.mjs test/fleet-target.test.mjs test/client-bundle.test.mjs test/schedule.test.mjs test/auto-update.test.mjs test/update-source.test.mjs test/update-install.test.mjs test/update-wiring.test.mjs test/signing.test.mjs test/stress.test.mjs test/e2e.test.mjs test/crossnetwork.test.mjs test/signing-e2e.test.mjs test/outbound-only.test.mjs test/recovery.test.mjs test/pipeline-e2e.test.mjs test/shared-config.test.mjs test/metrics.test.mjs test/metrics-route.test.mjs test/tool-cards.test.mjs test/p2p-stun.test.mjs test/p2p-transport.test.mjs test/p2p-signaling.test.mjs test/p2p-node.test.mjs test/p2p-transport-fields.test.mjs test/p2p-plugin.test.mjs test/p2p-agent.test.mjs test/stun-server.test.mjs test/loader-entry.test.mjs test/mdns-wire.test.mjs test/mdns-discover.test.mjs test/p2p-crypto.test.mjs test/chatops-approval.test.mjs test/chatops-policy.test.mjs test/chatops-file-safety.test.mjs test/chatops-outbound-queue.test.mjs test/chatops-commands.test.mjs test/chatops-bridge.test.mjs test/chatops-config-route.test.mjs test/chatops-apply.test.mjs test/chatops-ilink-contract.test.mjs test/chatops-fleet.test.mjs test/chatops-account.test.mjs test/chatops-auth.test.mjs test/chatops-fleet-scope.test.mjs test/chatops-handoff.test.mjs test/chatops-fleet-wiring.test.mjs test/chatops-fleet-live.test.mjs test/chatops-takeover.test.mjs test/chatops-device-signing.test.mjs test/chatops-relay-verify.test.mjs test/chatops-durability.test.mjs test/chatops-run-command.test.mjs test/secrets-guard.test.mjs test/chatops-ilink-fleet-bridge.test.mjs test/chatops-fleet-join.test.mjs",
122
+ "test:all": "node --test --test-force-exit test/relay.test.mjs test/broadcast.test.mjs test/agent.test.mjs test/authority.test.mjs test/blocks.test.mjs test/approval-index.test.mjs test/fleet-sync.test.mjs test/health.test.mjs test/storage.test.mjs test/exit-channel.test.mjs test/council.test.mjs test/log-bounds.test.mjs test/test-report.test.mjs test/fleet-scale.test.mjs test/fleet-state.test.mjs test/crypto-blake2s.test.mjs test/installed-version.test.mjs test/permission.test.mjs test/machine-test-packet.test.mjs test/field-authority.test.mjs test/approval-gate.test.mjs test/authority-choice.test.mjs test/reachability-check.test.mjs test/layer-model.test.mjs test/memory.test.mjs test/tools.test.mjs test/claims.test.mjs test/fleet-target.test.mjs test/client-bundle.test.mjs test/schedule.test.mjs test/auto-update.test.mjs test/update-source.test.mjs test/update-install.test.mjs test/update-wiring.test.mjs test/signing.test.mjs test/stress.test.mjs test/e2e.test.mjs test/crossnetwork.test.mjs test/signing-e2e.test.mjs test/outbound-only.test.mjs test/recovery.test.mjs test/pipeline-e2e.test.mjs test/shared-config.test.mjs test/metrics.test.mjs test/metrics-route.test.mjs test/tool-cards.test.mjs test/p2p-stun.test.mjs test/p2p-transport.test.mjs test/p2p-signaling.test.mjs test/p2p-node.test.mjs test/p2p-transport-fields.test.mjs test/p2p-plugin.test.mjs test/p2p-agent.test.mjs test/stun-server.test.mjs test/loader-entry.test.mjs test/mdns-wire.test.mjs test/mdns-discover.test.mjs test/p2p-crypto.test.mjs test/chatops-approval.test.mjs test/chatops-policy.test.mjs test/chatops-file-safety.test.mjs test/chatops-outbound-queue.test.mjs test/chatops-commands.test.mjs test/chatops-bridge.test.mjs test/chatops-config-route.test.mjs test/chatops-apply.test.mjs test/chatops-ilink-contract.test.mjs test/chatops-fleet.test.mjs test/chatops-account.test.mjs test/chatops-auth.test.mjs test/chatops-fleet-scope.test.mjs test/chatops-handoff.test.mjs test/chatops-fleet-wiring.test.mjs test/chatops-fleet-live.test.mjs test/chatops-takeover.test.mjs test/chatops-device-signing.test.mjs test/chatops-relay-verify.test.mjs test/chatops-durability.test.mjs test/chatops-run-command.test.mjs test/secrets-guard.test.mjs test/chatops-ilink-fleet-bridge.test.mjs test/chatops-fleet-join.test.mjs",
123
123
  "pack": "node scripts/pack.mjs",
124
124
  "verify:join": "node scripts/verify-join.mjs",
125
125
  "lint": "eslint .",
@@ -149,7 +149,9 @@
149
149
  "test:packet": "node --test --test-force-exit test/machine-test-packet.test.mjs",
150
150
  "test:field-authority": "node --test --test-force-exit test/field-authority.test.mjs",
151
151
  "test:approval-gate": "node --test --test-force-exit test/approval-gate.test.mjs",
152
- "test:authority-choice": "node --test --test-force-exit test/authority-choice.test.mjs"
152
+ "test:authority-choice": "node --test --test-force-exit test/authority-choice.test.mjs",
153
+ "test:reachability": "node --test --test-force-exit test/reachability-check.test.mjs",
154
+ "reachability": "node scripts/reachability-check.mjs"
153
155
  },
154
156
  "keywords": [
155
157
  "dsh-bundle",
@@ -198,7 +198,7 @@ const MAX_STAGES = 16;
198
198
  * `package.json` during `scripts/pack.mjs` rather than hand-maintained, and `W2M_PLUGIN_VERSION`
199
199
  * overrides it at runtime for tests and packagers.
200
200
  */
201
- const PLUGIN_VERSION = '0.34.0';
201
+ const PLUGIN_VERSION = '0.35.0';
202
202
 
203
203
  /** How long any single HTTP call may take before it is aborted, in milliseconds. */
204
204
  const DEFAULT_REQUEST_TIMEOUT_MS = 15_000;