instar 1.3.163 → 1.3.164
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/dist/commands/server.d.ts.map +1 -1
- package/dist/commands/server.js +8 -0
- package/dist/commands/server.js.map +1 -1
- package/dist/core/SessionRouter.d.ts +10 -0
- package/dist/core/SessionRouter.d.ts.map +1 -1
- package/dist/core/SessionRouter.js +4 -0
- package/dist/core/SessionRouter.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.164.md +47 -0
- package/upgrades/side-effects/router-confirm-claim-on-place.md +96 -0
|
@@ -92,6 +92,16 @@ export interface SessionRouterDeps {
|
|
|
92
92
|
handleLocally: (msg: InboundMessage) => Promise<void>;
|
|
93
93
|
/** Instruct the chosen machine to spawn/resume the session. */
|
|
94
94
|
spawnOnMachine: (machineId: string, msg: InboundMessage) => Promise<void>;
|
|
95
|
+
/**
|
|
96
|
+
* Confirm a just-placed REMOTE session as the owner (status placing→active) once
|
|
97
|
+
* the spawn has been dispatched to it. Without this the ownership stays 'placing'
|
|
98
|
+
* forever and every later message for the session queues (bug #11). Best-effort —
|
|
99
|
+
* a confirm failure leaves the placement to recover via the normal fences.
|
|
100
|
+
* (The owner-side resume runs on the target; in the single-router topology the
|
|
101
|
+
* router holds the authoritative ownReg, so it confirms on the target's behalf —
|
|
102
|
+
* the FSM only permits a claim whose machineId equals the placed owner.)
|
|
103
|
+
*/
|
|
104
|
+
confirmClaim?: (sessionKey: string, machineId: string) => void;
|
|
95
105
|
queueMessage: (msg: InboundMessage, reason: string) => void;
|
|
96
106
|
raiseAttention: (title: string, body: string) => void;
|
|
97
107
|
markOwnerSuspect?: (machineId: string) => void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRouter.d.ts","sourceRoot":"","sources":["../../src/core/SessionRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OA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AK,OAAO,CAAC,UAAU,CAAC,CAAC;IAClJ,4DAA4D;IAC5D,aAAa,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACtD,+DAA+D;IAC/D,cAAc,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC1E;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/D,YAAY,EAAE,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5D,cAAc,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACtD,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/C,KAAK,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,GAAG,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC9B;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAoB;IACzC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAsB;IAC1C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAuC;gBAElD,IAAI,EAAE,iBAAiB,EAAE,GAAG,GAAE,mBAA2C;IAKrF,qFAAqF;IACrF,KAAK,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAQjD,OAAO,CAAC,OAAO;YAID,WAAW;YAyBX,cAAc;YAuCd,aAAa;CAkD5B"}
|
|
@@ -172,6 +172,10 @@ export class SessionRouter {
|
|
|
172
172
|
return { action: fromDead ? 'owner-dead-replaced' : 'handled-locally', owner: decision.chosenMachine, detail: 'placed-self', acked: true };
|
|
173
173
|
}
|
|
174
174
|
await this.deps.spawnOnMachine(decision.chosenMachine, msg);
|
|
175
|
+
// Confirm the remote owner (placing → active). The 'place' above left the record
|
|
176
|
+
// transient; without this the session is owned-but-never-active and every later
|
|
177
|
+
// message routes to the placing/transferring branch → queued forever (bug #11).
|
|
178
|
+
this.deps.confirmClaim?.(msg.sessionKey, decision.chosenMachine);
|
|
175
179
|
return { action, owner: decision.chosenMachine, acked: true };
|
|
176
180
|
}
|
|
177
181
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionRouter.js","sourceRoot":"","sources":["../../src/core/SessionRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA0CH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAqB,EAAE,aAA4B;IACnF,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW,IAAI,OAAO,CAAC,MAAM,KAAK,WAAW;QAAE,OAAO,IAAI,CAAC;IAClF,MAAM,WAAW,GAAG,OAAO,CAAC,KAAK,IAAI,IAAI,IAAI,OAAO,CAAC,KAAK,KAAK,aAAa,CAAC;IAC7E,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IAC7D,IAAI,OAAO,CAAC,MAAM,KAAK,qBAAqB,IAAI,WAAW;QAAE,OAAO,IAAI,CAAC;IACzE,OAAO,KAAK,CAAC;AACf,CAAC;AAUD,MAAM,CAAC,MAAM,qBAAqB,GAAwB;IACxD,wBAAwB,EAAE,CAAC;IAC3B,iCAAiC,EAAE,GAAG;IACtC,+BAA+B,EAAE,IAAI;IACrC,iBAAiB,EAAE,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionRouter.js","sourceRoot":"","sources":["../../src/core/SessionRouter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA0CH;;;;;;;;;;;;;;;;G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ED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-05-31T11:
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-05-31T11:18:35.637Z",
|
|
5
|
+
"instarVersion": "1.3.164",
|
|
6
6
|
"entryCount": 193,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What to Tell Your User
|
|
7
|
+
|
|
8
|
+
If you run your agent on more than one machine and move a conversation between them, the
|
|
9
|
+
move now actually sticks — the receiving machine is confirmed as the new owner and your
|
|
10
|
+
following messages route to it, instead of the move quietly failing. This only applies
|
|
11
|
+
when the multi-machine session pool is on; single-machine agents are unaffected. Nothing
|
|
12
|
+
to configure. (Two related pieces are still in progress: ownership surviving a restart,
|
|
13
|
+
and the moved conversation being able to reply — tracked separately.)
|
|
14
|
+
|
|
15
|
+
## Summary of New Capabilities
|
|
16
|
+
|
|
17
|
+
- `SessionRouter` gains an optional `confirmClaim(sessionKey, machineId)` dep, invoked
|
|
18
|
+
after a successful remote `spawnOnMachine`, advancing the ownership record
|
|
19
|
+
`placing → active`. Self-placement (router keeps it) does not confirm.
|
|
20
|
+
- Wired in the server to the ownership-registry `claim` CAS.
|
|
21
|
+
|
|
22
|
+
## Evidence
|
|
23
|
+
|
|
24
|
+
- Found live on 2026-05-31: after a move, every later message logged
|
|
25
|
+
"route … action=queued owner=?" and was handled back on the origin — the ownership
|
|
26
|
+
state machine requires place→claim→active and the claim was never issued, so the
|
|
27
|
+
record stayed "placing".
|
|
28
|
+
- Unit, `tests/unit/SessionRouter.test.ts`: a remote placement now confirms the owner
|
|
29
|
+
(placing→active); a self-placement does not.
|
|
30
|
+
- Unit, `tests/unit/SessionOwnership.test.ts`: the place→claim→active transition.
|
|
31
|
+
- 47 SessionRouter + ownership + wiring tests pass; tsc --noEmit clean.
|
|
32
|
+
- Spec, `docs/specs/router-confirm-claim-on-place.md` plus the .eli16.md sibling.
|
|
33
|
+
- Side-effects, `upgrades/side-effects/router-confirm-claim-on-place.md`.
|
|
34
|
+
|
|
35
|
+
## What Changed — a moved conversation now finishes its handoff instead of getting stuck
|
|
36
|
+
|
|
37
|
+
Another step toward the multi-machine "move this conversation to my other machine"
|
|
38
|
+
feature. The handoff tracks ownership in two steps: the router assigns the conversation
|
|
39
|
+
to the target machine (status "placing"), then the new owner is confirmed (status
|
|
40
|
+
"active"). The confirm step was never being issued, so a moved conversation stayed in
|
|
41
|
+
"placing" limbo forever — and the router's rule of "hold messages while a handoff is in
|
|
42
|
+
progress" then held every later message, so the move silently failed.
|
|
43
|
+
|
|
44
|
+
This release has the router issue the confirm right after it hands the conversation to
|
|
45
|
+
the target machine, advancing ownership to "active". From then on the router correctly
|
|
46
|
+
forwards your messages to the new owner. The state machine only allows confirming the
|
|
47
|
+
exact machine the conversation was just assigned to, so this stays safe.
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Side-Effects Review — Router confirms remote placement (bug #11)
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `router-confirm-claim-on-place`
|
|
4
|
+
**Date:** `2026-05-31`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `not required`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
`SessionRouter` gains an optional `confirmClaim(sessionKey, machineId)` dep, called in
|
|
11
|
+
`placeAndClaim` right after a successful `spawnOnMachine` on a REMOTE target. `server.ts`
|
|
12
|
+
wires it to `ownReg.cas({ type: 'claim', machineId }, …)`, advancing the ownership
|
|
13
|
+
record `placing → active`. Without it the record stayed `placing` and every later
|
|
14
|
+
message for the session queued (bug #11).
|
|
15
|
+
|
|
16
|
+
## Decision-point inventory
|
|
17
|
+
|
|
18
|
+
- **remote branch only** — `confirmClaim` is called only in `placeAndClaim`'s
|
|
19
|
+
remote-spawn path (after `spawnOnMachine`). Self-placement returns handled-locally
|
|
20
|
+
and never confirms. Both covered by tests.
|
|
21
|
+
- **FSM gate** — `claim` is permitted only when the record's `ownerMachineId` equals the
|
|
22
|
+
claimed `machineId` (the placed owner). Covered in `SessionOwnership.test.ts`.
|
|
23
|
+
|
|
24
|
+
## 1. Over-block
|
|
25
|
+
|
|
26
|
+
**What legitimate inputs does this reject?** Nothing. It only ADDS a confirm after a
|
|
27
|
+
remote placement. Self-placement, forwarding to an existing owner, owner-dead
|
|
28
|
+
re-placement, and queue paths are unchanged. A `confirmClaim` that fails (e.g. CAS
|
|
29
|
+
contention) is best-effort and leaves the placement to recover via the normal fences.
|
|
30
|
+
|
|
31
|
+
## 2. Under-block
|
|
32
|
+
|
|
33
|
+
**What does this still miss?** It does not make ownership durable across restarts (the
|
|
34
|
+
store is per-machine in-memory — the shared Track-H store is separate). It confirms
|
|
35
|
+
optimistically once the spawn is DISPATCHED (the deliverMessage/spawn RPC resolved); if
|
|
36
|
+
the target's session later dies, the existing owner-dead detection re-places it. It does
|
|
37
|
+
not address bug #7 (standby outbound mute).
|
|
38
|
+
|
|
39
|
+
## 3. Level-of-abstraction fit
|
|
40
|
+
|
|
41
|
+
**Right layer?** Yes. The confirm lives in `SessionRouter.placeAndClaim` — the exact
|
|
42
|
+
place that owns the place→spawn lifecycle and already does the `place` CAS. The dep is
|
|
43
|
+
injected (testable, same pattern as `casClaimOwnership`/`spawnOnMachine`). The FSM
|
|
44
|
+
transition itself stays in `SessionOwnership.ts`.
|
|
45
|
+
|
|
46
|
+
## 4. Signal vs authority compliance
|
|
47
|
+
|
|
48
|
+
**Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
|
|
49
|
+
|
|
50
|
+
This advances an ownership record through its designed FSM (`place → claim`), gated by
|
|
51
|
+
the FSM's own legal-transition check (claim machineId must equal the placed owner). It
|
|
52
|
+
adds no user-facing authority and blocks nothing. It RELAXES nothing about who may own a
|
|
53
|
+
session — it completes a transition that was already supposed to happen.
|
|
54
|
+
|
|
55
|
+
## 5. Interactions
|
|
56
|
+
|
|
57
|
+
Consumes the existing `ownReg` CAS (the same registry `place`/`transfer`/`release` use).
|
|
58
|
+
Pairs with `placeAndClaim`'s `place` CAS (the two halves of a new-session handoff). After
|
|
59
|
+
the confirm, `dispatchOne` sees `active` (not `placing`) and forwards subsequent messages
|
|
60
|
+
to the owner instead of queueing. Idempotent at the FSM level (a duplicate claim on an
|
|
61
|
+
already-active record is rejected `claim-out-of-sequence`, harmless). No interaction with
|
|
62
|
+
the lease or the shared-state read-only guard.
|
|
63
|
+
|
|
64
|
+
## 6. External surfaces
|
|
65
|
+
|
|
66
|
+
None. No HTTP routes, config, or notifications. The visible effect is a moved session's
|
|
67
|
+
ownership reaching `active` (so `/pool` + routing reflect the new owner).
|
|
68
|
+
|
|
69
|
+
## 7. Rollback cost
|
|
70
|
+
|
|
71
|
+
Low. Remove the `confirmClaim` dep + call + wiring; transfers revert to stuck-`placing`
|
|
72
|
+
(bug #11). No schema, no persisted state, no migration (the dep is optional + in-memory).
|
|
73
|
+
|
|
74
|
+
## Conclusion
|
|
75
|
+
|
|
76
|
+
Minimal, FSM-gated completion of a handoff transition that was missing, scoped to the
|
|
77
|
+
remote-placement branch, both branches + the FSM transition unit-tested, no new
|
|
78
|
+
authority, no external surface, cheap revert. Makes the live single-router transfer's
|
|
79
|
+
ownership finalize instead of sticking. Durable cross-machine ownership (Track-H) and
|
|
80
|
+
the reply relay (#7) remain separate.
|
|
81
|
+
|
|
82
|
+
## Second-pass review (if required)
|
|
83
|
+
|
|
84
|
+
Not required — completes an existing FSM transition via its own legality gate, remote-
|
|
85
|
+
branch-only, both sides tested, no shared-state authority changed, reversible. The live
|
|
86
|
+
two-machine re-test (fresh topic) is the Tier-3 gate that follows.
|
|
87
|
+
|
|
88
|
+
## Evidence pointers
|
|
89
|
+
|
|
90
|
+
- `tests/unit/SessionRouter.test.ts` — remote placement calls `confirmClaim('s1','m_remote')`;
|
|
91
|
+
self-placement does not.
|
|
92
|
+
- `tests/unit/SessionOwnership.test.ts` — `place(placing) → claim(active)` transition.
|
|
93
|
+
- 47 SessionRouter + ownership + wiring tests green; `tsc --noEmit` clean.
|
|
94
|
+
- Found live: `route … action=queued owner=?` on every post-move message; the ownership
|
|
95
|
+
FSM requires place→claim→active and the claim was never issued.
|
|
96
|
+
- Spec: `docs/specs/router-confirm-claim-on-place.md` (+ `.eli16.md`).
|