@theokit/gateway 0.6.0 → 0.6.1

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.
Files changed (2) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - b631af7: **The integration bootstrap scripts now name reused container state as the cause.** Both create a server and then create accounts inside it, so both are idempotent only against a _fresh_ container. Run either against one that survived a previous run and it fails in a voice that does not name the cause — and Matrix's is actively misleading:
8
+
9
+ ```
10
+ matrix: register theokit-bot failed: {… "error":"Invalid registration token"}
11
+ mattermost: create first user failed (400): An account with that username already exists.
12
+ ```
13
+
14
+ The token was read from the log and sent correctly. It is "invalid" only because the server consumed it at its first boot, so the message sends the reader hunting the one thing that is not wrong. Measured: two round-trips before the remedy — a `:down` — became obvious, and the remedy is one command.
15
+
16
+ Each failure now prints it, and only when the failure actually matches a reused-state signature. Attaching the advice to every failure would send someone to recreate a container over a network blip and would train them to skip the line, which is how a helpful message becomes noise.
17
+
18
+ The decision is a pure function with its own tests, kept out of both scripts: the scripts boot containers and call `process.exit`, so they are untestable by construction, and "is this reused state?" is the only part with a right answer.
19
+
20
+ - 58d302e: **A behavioural conformance suite now runs the `PlatformAdapter` contract against all nine credential-based adapters at once**, in `integration/tests/unit/`. It needs no credential and no network — every assertion is about what an adapter does _before_ it connects, because a conformance suite that needs provisioning is a conformance suite that does not run.
21
+
22
+ The existing cross-adapter gate reads source text, which is the right tool for what it catches and the wrong one for this. Getting that file honest took five attempts in this repository, four of which passed while checking nothing: a regex matching zero declarations, a window reaching into the neighbouring method and accepting its guard, a brace matcher fooled by a string literal, a floor that only fired when the count dropped. Each was a statement about text that read like a statement about behaviour.
23
+
24
+ What the new suite asserts, per adapter: it declares the platform it is (the routing key — an adapter naming itself wrong is silently unreachable rather than broken); `disconnect()` on one that never connected resolves rather than throwing, and again on a second call; and the unsubscribe `onInbound` returns is safe to call twice. All nine conform today, verified by mutation — a wrong `platform`, a throwing `disconnect()`, and an `off()` that throws on reuse each fail it.
25
+
26
+ One invariant is **deliberately absent and says so in the file**: "a stale unsubscribe does not deafen a live subscription". It was written, it passed, and mutation showed it could not fail — the only assertion available without a connection is that `onInbound` returns a function, which holds either way. It stays covered textually for all ten and behaviourally for WhatsApp, whose adapter takes a backend and therefore has a dispatch seam. A file arguing that behaviour beats text should not make the argument with an assertion that cannot fail.
27
+
3
28
  ## 0.6.0
4
29
 
5
30
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theokit/gateway",
3
- "version": "0.6.0",
3
+ "version": "0.6.1",
4
4
  "description": "Multi-platform messaging gateway core for @theokit/sdk — transport-agnostic primitives (BasePlatformAdapter, MessageEvent, SessionRouter, DeliveryRouter, GatewayRunner, hooks). Inspired by hermes-agent/gateway. ADRs D170-D181.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {