instar 1.3.243 → 1.3.244

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.243",
3
+ "version": "1.3.244",
4
4
  "description": "Coherence infrastructure for self-evolving AI agents — on the Claude Code or Codex subscription you already have.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "./builtin-manifest.schema.json",
3
3
  "schemaVersion": 1,
4
- "generatedAt": "2026-06-04T07:16:51.612Z",
5
- "instarVersion": "1.3.243",
4
+ "generatedAt": "2026-06-04T16:26:00.075Z",
5
+ "instarVersion": "1.3.244",
6
6
  "entryCount": 198,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -0,0 +1,23 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- assembled-by: assemble-next-md -->
4
+ <!-- bump: patch -->
5
+
6
+ ## What Changed
7
+
8
+ - The Telegram authorized-user check is now type-tolerant. The legacy auth path compared the incoming numeric Telegram id against the configured `authorizedUserIds` with a strict membership check, so an id written as a string in config silently failed to match and the authorized user was treated as unknown (hitting the registration gate).
9
+ - The mini-onboarding auto-add now also compares ids loosely, so it no longer appends a duplicate when the configured list already holds the id as a string.
10
+
11
+ ## What to Tell Your User
12
+
13
+ - **Telegram access fix**: "If your Telegram user id was ever written as text in my config, I would have wrongly treated you as a stranger and asked you to register. That comparison now ignores whether the id is stored as a number or text, so the right person is recognized either way."
14
+
15
+ ## Summary of New Capabilities
16
+
17
+ | Capability | How to Use |
18
+ |-----------|-----------|
19
+ | Type-tolerant Telegram authorization | No action needed. Existing `authorizedUserIds` entries are honored whether they are stored as numbers or strings. |
20
+
21
+ ## Evidence
22
+
23
+ Added a focused unit test (`telegram-auth-id-type-tolerant.test.ts`, 5 cases) covering number-configured ids, string-configured ids (the regression), mixed lists, unauthorized rejection, and the empty/open passthrough. `tsc --noEmit` is clean. CI is the authority across the full shard matrix.
@@ -0,0 +1,56 @@
1
+ # Side-Effects Review — Telegram authorizedUserIds type-tolerant comparison
2
+
3
+ **Version / slug:** `telegram-auth-id-type-tolerant`
4
+ **Date:** `2026-06-04`
5
+ **Author:** `echo`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary of the change
9
+
10
+ The legacy (non-shared-AuthGate) Telegram auth path used
11
+ `authorizedUserIds.includes(userId)` where `userId` is a `number` but the config
12
+ field, though typed `number[]`, is untyped JSON at runtime and may hold the id as
13
+ a string. `Array.prototype.includes` uses SameValueZero (no coercion), so a
14
+ string-configured id silently failed to match and the authorized user was treated
15
+ as unknown. The fix compares as strings (`authorized.some(id => String(id) ===
16
+ String(userId))`), mirroring the shared-AuthGate path which is already string-based.
17
+ The mini-onboarding auto-add (`server.ts`) is given the same loose membership check
18
+ so it does not append a duplicate when the list already holds the id as a string.
19
+
20
+ ## Decision-point inventory
21
+
22
+ One decision point: `isAuthorized(userId)` returns true/false (authorized vs gated).
23
+ The change only affects WHICH equal-by-value ids match; it does not change the
24
+ empty-list semantics (still "accept all" on the legacy path) or any other branch.
25
+
26
+ ## 1. Over-block
27
+
28
+ **What legitimate inputs does this change reject?** None. The change only makes the
29
+ comparison match MORE inputs that were always intended to match (an id equal by
30
+ value, regardless of number-vs-string representation). No id that previously
31
+ authorized stops authorizing: `String(n) === String(n)` holds for every number that
32
+ `includes` would have matched. The empty/absent-list "accept all" path is untouched.
33
+
34
+ ## 2. Under-block
35
+
36
+ **What does this still miss?** It does not change the fail-open vs fail-closed
37
+ posture of the legacy path (empty list still accepts all — unchanged, out of scope).
38
+ It does not touch the shared-AuthGate path (already string-based) or the Slack/
39
+ WhatsApp/iMessage adapters (separate code, their own typing). It compares by exact
40
+ string equality after coercion, so it intentionally does NOT treat e.g. leading-zero
41
+ or whitespace-padded ids as equal — Telegram ids are canonical integers, so this is
42
+ correct.
43
+
44
+ ## 3. Blast radius
45
+
46
+ Two callsites: `TelegramAdapter.isAuthorized` (the auth gate) and the `server.ts`
47
+ mini-onboarding auto-add. Both are Telegram-only. No schema, config-shape, or API
48
+ change — existing configs (number ids, string ids, or mixed) all keep working, and
49
+ configs that already worked are unaffected. Behavior strictly widens recognition to
50
+ match the documented intent.
51
+
52
+ ## 4. Reversibility
53
+
54
+ Fully reversible: revert the two edits. No state migration, no persisted format
55
+ change. Config files are not rewritten by this change (the mini-onboarding still
56
+ pushes a numeric id as before; it just no longer duplicates an existing string id).