instar 1.3.313 → 1.3.315

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.
@@ -0,0 +1,53 @@
1
+ # Side-effects review — TunnelManager unit-suite rewrite + quarantine re-arm
2
+
3
+ Closes the durable commitment "Rewrite TunnelManager unit suite" opened during
4
+ the 2026-06-05 full-suite triage (the one knowingly-stale entry left parked by
5
+ the test-debt re-arm PR #837).
6
+
7
+ ## 1. The change
8
+
9
+ - **`tests/unit/TunnelManager.test.ts`** — full rewrite. The old suite
10
+ predated the tunnel provider/tier rewrite: it mocked the `cloudflared`
11
+ module directly, while production drives a provider pool with a REAL
12
+ reachability probe (`driveTier1` → `probeReachability` fetches
13
+ `<url>/health` and requires 2xx), so 22/29 tests could never pass. The new
14
+ suite uses the constructor injection seams exclusively
15
+ (`injections.providers`, `injections.fetch`) plus the public deterministic
16
+ drivers (`runSelfHealCheck()`, `grantConsent()`, `declineConsent()`):
17
+ 51 tests covering constructor/persisted-state restore, the happy start
18
+ path, provider-pool fallback (unavailable / start-throw / probe-fail /
19
+ fetch-throw), Tier-2-never-auto-started, exhaustion + relaysEnabled /
20
+ relayConsent config gates, the consent flow (nonce issuance, wrong-nonce
21
+ rejection, single-use replay, decline cooldown, timeout, cooldown
22
+ suppression across restart, post-grant probe/start failure), the self-heal
23
+ stability gate (reset / progress / switched, counter reset on flap,
24
+ throwaway-probe release, self-healed event), stop semantics (relay-stop
25
+ rotates credentials, plain stop doesn't, pending consent cleared), and
26
+ credential rotation (no-op when not pending, failure retains the flag +
27
+ emits rotation-failed, boot recovery, unwired-rotator loud-clear).
28
+ - **`vitest.push.config.ts`** — `tests/unit/TunnelManager.test.ts` REMOVED
29
+ from FLAKY_TESTS (re-armed) with a dated comment. No other entries touched.
30
+
31
+ ## 2. Blast radius
32
+
33
+ - Zero production code changed — test + CI-config only.
34
+ - CI runs 51 additional deterministic tests (~0.8s, no network/timers/
35
+ processes). Risk is future-positive: tunnel-lifecycle regressions now fail
36
+ PRs instead of rotting behind the quarantine.
37
+ - Honest overlap note: the rewrite-era sibling suites
38
+ (tunnel-manager-rewrite.test.ts, tunnel-self-heal.test.ts,
39
+ tunnel-consent-state-machine.test.ts, tunnel-credential-rotation.test.ts —
40
+ 39 tests, already in CI) cover parts of this surface. The new suite
41
+ consolidates manager-level coverage under the canonical filename and adds
42
+ edge paths they don't exercise (persisted-state restore + corrupted state
43
+ file, concurrent-start coalescing, start-after-exhaustion semantics, nonce
44
+ replay, cooldown suppression across construction, rotation-failure flag
45
+ retention, probe-handle release). Redundancy between them is cheap and
46
+ deliberate.
47
+
48
+ ## 3. Test coverage
49
+
50
+ - New suite: 51/51 green across three consecutive runs (including under the
51
+ push config — proving the re-arm actually executes it).
52
+ - Full tunnel family (11 files incl. the 4 rewrite-era siblings): 165/165.
53
+ - `npx tsc --noEmit` clean.