instar 1.3.861 → 1.3.862
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 +49 -1
- package/dist/commands/server.js.map +1 -1
- package/dist/core/SessionPoolLocalClaim.d.ts +24 -0
- package/dist/core/SessionPoolLocalClaim.d.ts.map +1 -0
- package/dist/core/SessionPoolLocalClaim.js +38 -0
- package/dist/core/SessionPoolLocalClaim.js.map +1 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/upgrades/1.3.862.md +27 -0
- package/upgrades/side-effects/session-pool-self-placement-confirmation.md +99 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** Minimal ownership row needed to decide whether local delivery may confirm. */
|
|
2
|
+
export interface LocalClaimOwnershipRow {
|
|
3
|
+
ownerMachineId: string;
|
|
4
|
+
status: string;
|
|
5
|
+
}
|
|
6
|
+
/** Dependencies for the post-local-delivery placing → active transition. */
|
|
7
|
+
export interface LocalClaimConfirmationDeps {
|
|
8
|
+
selfMachineId: string;
|
|
9
|
+
readOwnership: (sessionKey: string) => LocalClaimOwnershipRow | null | undefined;
|
|
10
|
+
claimOwnership: (sessionKey: string, machineId: string) => {
|
|
11
|
+
confirmed: boolean;
|
|
12
|
+
afterConfirm?: () => void;
|
|
13
|
+
};
|
|
14
|
+
onError?: (error: unknown) => void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Confirm a local placement after the established local delivery tail succeeds.
|
|
18
|
+
*
|
|
19
|
+
* Active traffic and rows owned by another machine are strict no-ops. Keeping
|
|
20
|
+
* this decision separate from SessionRouter matters: its local handler is only
|
|
21
|
+
* a fall-through marker, not proof that injection or spawn succeeded.
|
|
22
|
+
*/
|
|
23
|
+
export declare function confirmLocalPlacementAfterDelivery(deps: LocalClaimConfirmationDeps, sessionKey: string): boolean;
|
|
24
|
+
//# sourceMappingURL=SessionPoolLocalClaim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionPoolLocalClaim.d.ts","sourceRoot":"","sources":["../../src/core/SessionPoolLocalClaim.ts"],"names":[],"mappings":"AAAA,iFAAiF;AACjF,MAAM,WAAW,sBAAsB;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,4EAA4E;AAC5E,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,sBAAsB,GAAG,IAAI,GAAG,SAAS,CAAC;IACjF,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,KAAK;QACzD,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;KAC3B,CAAC;IACF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,IAAI,EAAE,0BAA0B,EAChC,UAAU,EAAE,MAAM,GACjB,OAAO,CAyBT"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Confirm a local placement after the established local delivery tail succeeds.
|
|
3
|
+
*
|
|
4
|
+
* Active traffic and rows owned by another machine are strict no-ops. Keeping
|
|
5
|
+
* this decision separate from SessionRouter matters: its local handler is only
|
|
6
|
+
* a fall-through marker, not proof that injection or spawn succeeded.
|
|
7
|
+
*/
|
|
8
|
+
export function confirmLocalPlacementAfterDelivery(deps, sessionKey) {
|
|
9
|
+
try {
|
|
10
|
+
const current = deps.readOwnership(sessionKey);
|
|
11
|
+
if (current?.status !== 'placing' || current.ownerMachineId !== deps.selfMachineId)
|
|
12
|
+
return false;
|
|
13
|
+
const outcome = deps.claimOwnership(sessionKey, deps.selfMachineId);
|
|
14
|
+
if (!outcome.confirmed)
|
|
15
|
+
return false;
|
|
16
|
+
try {
|
|
17
|
+
outcome.afterConfirm?.();
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
// @silent-fallback-ok — observer failure is reported through onError;
|
|
21
|
+
// the authoritative ownership transition has already committed.
|
|
22
|
+
// The authoritative transition already committed. Observer emission is
|
|
23
|
+
// best-effort and cannot reverse or falsify the confirmed outcome.
|
|
24
|
+
deps.onError?.(error);
|
|
25
|
+
}
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
// @silent-fallback-ok — registry failure is reported through onError;
|
|
30
|
+
// local message delivery has already succeeded and must not be falsified.
|
|
31
|
+
// Delivery already succeeded before this helper is called. Ownership
|
|
32
|
+
// confirmation is best-effort and never turns a registry failure into a
|
|
33
|
+
// false delivery failure. The exact row state is intentionally not claimed.
|
|
34
|
+
deps.onError?.(error);
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=SessionPoolLocalClaim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SessionPoolLocalClaim.js","sourceRoot":"","sources":["../../src/core/SessionPoolLocalClaim.ts"],"names":[],"mappings":"AAiBA;;;;;;GAMG;AACH,MAAM,UAAU,kCAAkC,CAChD,IAAgC,EAChC,UAAkB;IAElB,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAI,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;QAC/C,IAAI,OAAO,EAAE,MAAM,KAAK,SAAS,IAAI,OAAO,CAAC,cAAc,KAAK,IAAI,CAAC,aAAa;YAAE,OAAO,KAAK,CAAC;QACjG,MAAM,OAAO,GAAG,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,aAAa,CAAC,CAAC;QACpE,IAAI,CAAC,OAAO,CAAC,SAAS;YAAE,OAAO,KAAK,CAAC;QACrC,IAAI,CAAC;YACH,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,sEAAsE;YACtE,gEAAgE;YAChE,uEAAuE;YACvE,mEAAmE;YACnE,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACxB,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,sEAAsE;QACtE,0EAA0E;QAC1E,qEAAqE;QACrE,wEAAwE;QACxE,4EAA4E;QAC5E,IAAI,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./builtin-manifest.schema.json",
|
|
3
3
|
"schemaVersion": 1,
|
|
4
|
-
"generatedAt": "2026-07-
|
|
5
|
-
"instarVersion": "1.3.
|
|
4
|
+
"generatedAt": "2026-07-17T09:43:05.701Z",
|
|
5
|
+
"instarVersion": "1.3.862",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
When the session pool chooses the current machine for a new conversation, its
|
|
9
|
+
ownership row now advances from `placing` to `active` after the established
|
|
10
|
+
local injection or spawn path succeeds.
|
|
11
|
+
|
|
12
|
+
## What to Tell Your User
|
|
13
|
+
|
|
14
|
+
A conversation started on the machine that receives it no longer remains
|
|
15
|
+
stuck in a “starting” ownership state after it is already running.
|
|
16
|
+
|
|
17
|
+
## Summary of New Capabilities
|
|
18
|
+
|
|
19
|
+
No new setting. This repairs the existing session-pool placement lifecycle.
|
|
20
|
+
|
|
21
|
+
## Evidence
|
|
22
|
+
|
|
23
|
+
- Unit and integration coverage verifies the guarded transition, idempotence,
|
|
24
|
+
and the no-confirm-on-failed-spawn ordering.
|
|
25
|
+
- A live single-agent CROSS-MACHINE laptop/Mini test advanced a fresh Mini
|
|
26
|
+
placement from `placing` to `active` at epoch 2.
|
|
27
|
+
- Focused tests and TypeScript build pass.
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# Side-Effects Review — Session-pool self-placement confirmation
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `session-pool-self-placement-confirmation`
|
|
4
|
+
**Date:** `2026-07-17`
|
|
5
|
+
**Author:** `Instar Agent (instar-codey)`
|
|
6
|
+
**Second-pass reviewer:** `continuation_impl_review` (independent Codex reviewer) — CONCUR after two correction rounds
|
|
7
|
+
|
|
8
|
+
## Summary
|
|
9
|
+
|
|
10
|
+
Successful local session delivery now confirms a self-owned `placing` row as
|
|
11
|
+
`active`. Confirmation remains outside `SessionRouter`, after the real local
|
|
12
|
+
inject/spawn seam. Failed spawns do not confirm.
|
|
13
|
+
|
|
14
|
+
## Decision-point inventory
|
|
15
|
+
|
|
16
|
+
- Post-local-delivery ownership transition — **modified** — a successful local
|
|
17
|
+
tail may confirm only its own still-placing row.
|
|
18
|
+
|
|
19
|
+
## 1. Over-block
|
|
20
|
+
|
|
21
|
+
No message is newly blocked. Missing, active, or remotely-owned rows are no-ops.
|
|
22
|
+
|
|
23
|
+
## 2. Under-block
|
|
24
|
+
|
|
25
|
+
The transition cannot run before delivery because every callsite is after a
|
|
26
|
+
synchronous injection that returned true or inside a spawn/respawn success
|
|
27
|
+
continuation. A rejected injection or spawn does not confirm.
|
|
28
|
+
Registry confirmation failure is diagnostic-only after delivery and cannot fall
|
|
29
|
+
into the delivery-failure handler. If the transition commits but observer
|
|
30
|
+
emission fails, the committed outcome remains true and diagnostics avoid
|
|
31
|
+
claiming an unknowable row state.
|
|
32
|
+
|
|
33
|
+
## 3. Level-of-abstraction fit
|
|
34
|
+
|
|
35
|
+
The state predicate is a small pure core. Server wiring owns the timing because
|
|
36
|
+
it alone knows when the legacy local delivery tail has actually succeeded.
|
|
37
|
+
|
|
38
|
+
## 4. Signal vs authority compliance
|
|
39
|
+
|
|
40
|
+
The ownership registry remains the sole transition authority. Local delivery
|
|
41
|
+
success is evidence supplied to that authority, not a parallel ownership store.
|
|
42
|
+
|
|
43
|
+
## 4b. Judgment-point check
|
|
44
|
+
|
|
45
|
+
No heuristic is introduced. The enumerable rule is `status=placing AND
|
|
46
|
+
owner=self AND local delivery succeeded`.
|
|
47
|
+
|
|
48
|
+
## 5. Interactions
|
|
49
|
+
|
|
50
|
+
Ordinary traffic to an active local session calls the helper but performs no
|
|
51
|
+
write. Remote placement confirmation remains unchanged. SpawnAdmission still
|
|
52
|
+
runs before every local spawn and a refusal cannot reach confirmation.
|
|
53
|
+
|
|
54
|
+
## 6. External surfaces
|
|
55
|
+
|
|
56
|
+
`GET /pool/ownership-view` now reports `active` after a successful self-placement.
|
|
57
|
+
No schema, authentication, configuration, or user command changes.
|
|
58
|
+
|
|
59
|
+
## 7. Multi-machine posture (Cross-Machine Coherence)
|
|
60
|
+
|
|
61
|
+
**Replicated.** The transition is written to the existing ownership registry
|
|
62
|
+
and propagated by its existing replication path. A live laptop/Mini test proved
|
|
63
|
+
the receiving Mini's row reached `active`.
|
|
64
|
+
|
|
65
|
+
## 8. Rollback cost
|
|
66
|
+
|
|
67
|
+
Pure code rollback with no migration. Rollback restores stuck `placing` rows
|
|
68
|
+
for new self-placements.
|
|
69
|
+
|
|
70
|
+
## Evidence
|
|
71
|
+
|
|
72
|
+
- `tests/unit/SessionPoolLocalClaim.test.ts`
|
|
73
|
+
- `tests/unit/session-pool-activation-wiring.test.ts`
|
|
74
|
+
- `tests/integration/session-pool-local-claim.integration.test.ts`
|
|
75
|
+
- `tests/unit/no-silent-fallbacks.test.ts` (both contained error paths are
|
|
76
|
+
explicitly annotated and continue to report through `onError`)
|
|
77
|
+
- Live single-agent CROSS-MACHINE topic 3462 placement: owner Mini, epoch 2,
|
|
78
|
+
status `active`.
|
|
79
|
+
|
|
80
|
+
## Conclusion
|
|
81
|
+
|
|
82
|
+
The change is narrow and preserves honest failure semantics. It should ship
|
|
83
|
+
with the independent session-lifecycle second pass concurred.
|
|
84
|
+
|
|
85
|
+
## Second-pass review
|
|
86
|
+
|
|
87
|
+
The first pass found that live injection's boolean result was ignored and that
|
|
88
|
+
confirmation exceptions could falsely enter delivery-failure handling. Both
|
|
89
|
+
were fixed and regression-tested. The second pass found a post-commit honesty
|
|
90
|
+
edge: observer emission could throw after CAS committed while diagnostics
|
|
91
|
+
claimed the row remained placing. The authoritative CAS result is now separate
|
|
92
|
+
from best-effort observation; committed confirmation stays true, diagnostics
|
|
93
|
+
make no unverified state claim, and the observer-failure regression is pinned.
|
|
94
|
+
The reviewer then concurred with no remaining findings.
|
|
95
|
+
|
|
96
|
+
## Class-Closure Declaration (display-only mirror)
|
|
97
|
+
|
|
98
|
+
No agent-authored-artifact defect or self-triggered controller is added or
|
|
99
|
+
modified — not applicable.
|