instar 1.3.92 → 1.3.93

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.92",
3
+ "version": "1.3.93",
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-05-29T16:08:56.086Z",
5
- "instarVersion": "1.3.92",
4
+ "generatedAt": "2026-05-29T16:44:14.621Z",
5
+ "instarVersion": "1.3.93",
6
6
  "entryCount": 193,
7
7
  "entries": {
8
8
  "hook:session-start": {
@@ -1,63 +1,27 @@
1
- # Instar Upgrade Guide — NEXT
1
+ # Upgrade Guide — vNEXT
2
2
 
3
- > In-flight shipment notes for the **Multi-Machine Session Pool** (active-active,
4
- > per-session placement + transfer). Built track-by-track behind a dark stage
5
- > gate; this guide grows as tracks land and becomes the versioned guide at the
6
- > release cut. Spec: docs/specs/MULTI-MACHINE-SESSION-POOL-SPEC.md (approved).
3
+ <!-- bump: patch -->
7
4
 
8
5
  ## What Changed
9
6
 
10
- **Multi-Machine Session Pool — foundation (Track A: Router-Leader Lease).** The
11
- groundwork for one agent identity running across several machines, all awake at
12
- once, with each conversation placed on the best-fit machine and transferable
13
- between machines. This shipment lands the foundation and ships **dark** (the
14
- entire layer is inert unless explicitly enabled and its rollout stage advanced):
15
-
16
- - **Clock-jump-proof router lease.** The machine that holds the "who's in charge"
17
- lease now judges its own lease expiry on a **monotonic clock** instead of the
18
- wall clock. A wall-clock jump — an NTP correction, a VM pause/resume, a
19
- sleep/wake, or a CPU-starvation timer slip — can no longer fool a partitioned
20
- machine into thinking it still holds the lease (or into giving it up early).
21
- This is the lease-substrate-robustness hardening that the whole session pool
22
- rests on, and it directly answers the SleepWakeDetector CPU-starvation lesson.
23
- - **Router role.** The existing leader lease is now also addressable as the
24
- "router" role (the machine that dispatches conversations to machines). On a
25
- single machine this is a no-op — it is its own router.
26
- - **Dark config block.** A new `multiMachine.sessionPool` config block ships
27
- turned off (`enabled: false`, `stage: 'dark'`, `dryRun: true`). Existing
28
- agents receive these dark defaults automatically on update.
29
-
30
- **Track B (part 1: machine nicknames).** Every machine the agent is installed on
31
- now gets a friendly, auto-assigned **nickname** (e.g. "Mac Mini", "Justins Macbook
32
- Pro") — the handle you'll use to say "run this on the mini" / "move this to <name>".
33
- Nicknames are unique within the pool, editable, and derived deterministically from
34
- the machine's hostname. Still dark (the Machines dashboard tab + the placement
35
- commands that consume nicknames land in the next part of Track B).
7
+ The Multi-Machine Session Pool gains its activation wiring (still DARK): the SessionRouter
8
+ is now constructed at boot and consulted on the inbound message path — but ONLY when the
9
+ rollout stage is advanced past 'dark'. A single-machine, un-activated agent behaves exactly
10
+ as before (the interception is gated off on three independent conditions and fails safe to
11
+ local dispatch).
36
12
 
37
13
  ## What to Tell Your User
38
14
 
39
- Nothing changes for you yet — this ships turned off. When the full feature is
40
- ready, your agent will be able to spread conversations across all the machines
41
- it's installed on (and you'll get a Machines tab in the dashboard to name them
42
- and move conversations between them by nickname). For now, this update just makes
43
- the under-the-hood "who's in charge" machinery immune to clock jumps, which makes
44
- everything steadier. A one-machine agent behaves exactly as before.
15
+ Nothing changes yet — this is the plumbing that lets the session pool actually move
16
+ conversations between machines once it's staged on. It stays off until explicitly activated.
45
17
 
46
18
  ## Summary of New Capabilities
47
19
 
48
- - Monotonic, clock-jump-proof self-fence for the router/leader lease
49
- (`LeaseCoordinator`).
50
- - `MultiMachineCoordinator.isRouter()` — router-role accessor (alias of
51
- `holdsLease()`).
52
- - `multiMachine.sessionPool` dark config block (`enabled`/`stage`/`dryRun`) with
53
- migration parity for existing agents.
20
+ | Area | Capability |
21
+ | --- | --- |
22
+ | Multi-machine | The inbound dispatch can route a topic's message to the machine that owns the session (gated; dark by default). |
54
23
 
55
24
  ## Evidence
56
25
 
57
- - Tier-1 unit tests: monotonic self-fence (incl. the backward-wall-clock-jump
58
- immunity proof and the mid-tick `holdsLease` fence), real-monotonic default
59
- wiring integrity, `isRouter()`, and the dark config defaults + migration parity
60
- (adds-into-existing-multiMachine, no-clobber, inert, idempotent).
61
- - 155 tests green across the lease/config/coordinator/seamlessness cluster after
62
- the change; tsc clean. Full suite runs in CI.
63
- - Side-effects review: upgrades/side-effects/session-pool-track-a-router-lease.md
26
+ - `tests/unit/session-pool-activation-wiring.test.ts` pins the safety invariants: gated on a
27
+ non-dark stage, fail-safe to local dispatch, real-deps construction, module-ref sharing.
@@ -0,0 +1,28 @@
1
+ # Upgrade Guide — vNEXT
2
+
3
+ <!-- bump: patch -->
4
+
5
+ ## What Changed
6
+
7
+ The Multi-Machine Session Pool gains its activation wiring (still DARK): the SessionRouter
8
+ is constructed at boot and consulted on the inbound message path, and a forwarded message
9
+ now resumes the session on the owner machine — but ALL of this is gated on the rollout stage
10
+ being advanced past 'dark'. A single-machine, un-activated agent behaves exactly as before:
11
+ the interception is gated off on three independent conditions (no router without machine
12
+ identity, stage defaults dark, fail-safe to local dispatch).
13
+
14
+ ## What to Tell Your User
15
+
16
+ Nothing changes yet — this is the plumbing that lets the session pool actually move
17
+ conversations between machines once it's staged on. It stays off until explicitly activated.
18
+
19
+ ## Summary of New Capabilities
20
+
21
+ | Area | Capability |
22
+ | --- | --- |
23
+ | Multi-machine | Inbound dispatch can route a topic's message to the machine that owns the session, and the owner resumes it (gated; dark by default). |
24
+
25
+ ## Evidence
26
+
27
+ - `tests/unit/session-pool-activation-wiring.test.ts` pins the safety invariants: gated on a
28
+ non-dark stage, fail-safe to local dispatch, real-deps construction, owner-side resume bridge.
@@ -0,0 +1,22 @@
1
+ # Side effects — Session Pool activation wiring (§L4 live-ingress, dark)
2
+
3
+ ## What this adds (task A of the activation)
4
+ Wires the SessionRouter into the live boot + the inbound message-dispatch path, GATED so it is inert until the rollout stage advances past 'dark'.
5
+
6
+ - `src/commands/server.ts`:
7
+ - Module-level refs `_sessionRouter` + `_sessionPoolStage()` (the idiomatic instar pattern — the inbound handler in `wireTelegramRouting` is defined above `startServer`, so the router constructed in startServer's mesh block is shared via a module ref, like `_orphanReaper`/`_topicResumeMap`).
8
+ - **Construction** (mesh block, when a machine identity exists): `new SessionRouter({...})` wired to the real `MachinePoolRegistry` (machineRegistry), `SessionOwnershipRegistry` (resolveOwnership + casClaimOwnership), `PlacementExecutor`, and an outbound `MeshRpcClient` (deliverMessage/spawnOnMachine to peers via `lastKnownUrl`). `_sessionPoolStage()` reads the live `multiMachine.sessionPool.{enabled,stage}` (defaults 'dark').
9
+ - **Interception** (inbound `onTopicMessage`, after target-session resolution): when `_sessionRouter && _sessionPoolStage() !== 'dark'`, consult `route()`; a `forwarded`/`duplicate` outcome short-circuits (the owner machine handles it); everything else falls through to the existing local dispatch. Wrapped in try/catch → falls back to local on any error.
10
+
11
+ ## Risk / blast radius
12
+ **None in production.** The gate defaults to dark on three independent conditions: `_sessionRouter` is null without machine identity; `_sessionPoolStage()` returns 'dark' unless `enabled && stage` set (ConfigDefaults ships enabled:false/stage:dark); and the interception fails safe to local dispatch. So a single-machine, un-activated agent is byte-identical to today. The live-transfer behavior is gated by the staged rollout (StageAdvancer + E2E records).
13
+
14
+ ## Tests
15
+ - `tests/unit/session-pool-activation-wiring.test.ts` — 4 wiring-integrity tests pinning the safety invariants: gated on non-dark stage (default-dark → inert), fail-safe try/catch → local, real-deps construction (registry/ownership/placement + MeshRpcClient), module-ref sharing. Guards against a regression that removes the gate (which would activate cross-machine routing unconditionally).
16
+ - SessionRouter behavior itself is covered by its 17 unit + 3 integration tests (#506).
17
+
18
+ ## Remaining (the hardware operation — B/C/D)
19
+ Deploy to laptop + bring up the mini as machine #2; advance dark→shadow→live-transfer (each E2E-gated); test-as-self nickname-swap proof. The owner-side deliverMessage→local-spawn bridge (so a forwarded message actually spawns on the owner) is the final piece, validated on the 2-machine setup.
20
+
21
+ ## Addendum — owner-side bridge (task A.2)
22
+ `createDeliverMessageHandler` now takes an `onAccepted` hook wired (in the mesh block) to `spawnSessionForTopic`: a FIRST-seen forwarded `deliverMessage` spawns/resumes the local session for the topic so the conversation continues on the OWNER machine — the receive-side of the §L4 handoff. Gated on `_sessionPoolStage() !== 'dark'` + `telegram` present; fire-and-forget (the durable receipt is ACKed before this runs); fails safe (logs, never throws into the dispatcher). Inert until live-transfer (a deliverMessage only arrives from a router peer). This makes the activation code-complete: outbound forward (router) + receive+ACK (handler) + owner-side resume (bridge). Remaining is purely the 2-machine hardware proof.