instar 1.3.860 → 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.
@@ -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,6 +1,6 @@
1
1
  {
2
2
  "name": "instar",
3
- "version": "1.3.860",
3
+ "version": "1.3.862",
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-07-17T07:48:41.958Z",
5
- "instarVersion": "1.3.860",
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
+ Multi-machine agents now advertise and consume healthy LAN and Tailscale
9
+ endpoints even when an optional Cloudflare tunnel is disabled or fails to
10
+ start.
11
+
12
+ ## What to Tell Your User
13
+
14
+ If one remote-access path is temporarily unavailable, paired machines can keep
15
+ seeing and coordinating with each other through their other working paths.
16
+
17
+ ## Summary of New Capabilities
18
+
19
+ No new setting. This fixes startup wiring for the existing multi-transport
20
+ machine mesh.
21
+
22
+ ## Evidence
23
+
24
+ - Live single-agent CROSS-MACHINE reproduction: LAN and Tailscale health checks
25
+ passed while a quick tunnel returned a rate limit.
26
+ - Mesh advertisement and endpoint unit suites: 40/40 passed.
27
+ - TypeScript `--noEmit` compilation passed.
@@ -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,114 @@
1
+ # Side-Effects Review — Mesh endpoint advertisement without tunnel success
2
+
3
+ **Version / slug:** `mesh-endpoint-advertisement-without-tunnel`
4
+ **Date:** `2026-07-16`
5
+ **Author:** `Instar Agent (instar-codey)`
6
+ **Second-pass reviewer:** `not required`
7
+
8
+ ## Summary
9
+
10
+ The boot composition root now runs self endpoint discovery after the optional
11
+ tunnel attempt rather than only inside its success branch. A resolved
12
+ Cloudflare URL is still recorded as before; LAN and Tailscale ropes are now
13
+ advertised when Cloudflare is unavailable. Pool-presence and session-routing
14
+ calls select the first validated candidate from the existing shared endpoint
15
+ resolver rather than reading only the legacy Cloudflare URL.
16
+
17
+ ## Decision-point inventory
18
+
19
+ - Boot tunnel result — **modified** — no longer controls whether non-tunnel
20
+ mesh endpoints are advertised.
21
+
22
+ ## 1. Over-block
23
+
24
+ No block/allow surface — over-block is not applicable. Advertisement remains
25
+ gated by an enrolled machine identity and the existing
26
+ `meshTransport.enabled` switch.
27
+
28
+ ## 2. Under-block
29
+
30
+ Detection failures remain best-effort and omit only the failed rope. A machine
31
+ with no working LAN, Tailscale, or Cloudflare path remains honestly
32
+ unreachable. Tunnel recovery that happens later still relies on the existing
33
+ TunnelManager/sleep-wake re-advertisement lifecycle; this boot fix does not add
34
+ a competing recovery loop.
35
+
36
+ ## 3. Level-of-abstraction fit
37
+
38
+ The boot composition root is the correct layer because it owns tunnel startup,
39
+ endpoint advertisement, and the shared peer URL seam used by presence/session
40
+ calls. The existing `PeerEndpointResolver` remains the sole validation and
41
+ priority authority; no parallel endpoint-selection logic is added.
42
+
43
+ ## 4. Signal vs authority compliance
44
+
45
+ **Required reference:** [docs/signal-vs-authority.md](../../docs/signal-vs-authority.md)
46
+
47
+ - [x] No — this change has no block/allow surface.
48
+
49
+ This is transport discovery and idempotent registry wiring. It removes an
50
+ accidental dependency; it does not interpret intent, filter information, or
51
+ make a judgment decision.
52
+
53
+ ## 4b. Judgment-point check
54
+
55
+ No new static heuristic at a competing-signals decision point. The enumerable
56
+ rule is that every independently detected healthy transport may be advertised;
57
+ one optional transport's startup outcome does not authorize the others.
58
+
59
+ ## 5. Interactions
60
+
61
+ The endpoint write is idempotent. A successful tunnel contributes its URL; a
62
+ failed quick tunnel contributes `null`, leaving LAN/Tailscale intact. Later
63
+ tunnel recovery and sleep/wake re-advertisement use the existing idempotent
64
+ path and can add or replace the Cloudflare rope. Callers receive one validated
65
+ candidate exactly as before; the candidate may now be LAN or Tailscale when
66
+ Cloudflare is absent.
67
+
68
+ ## 6. External surfaces
69
+
70
+ `GET /pool` becomes more honest because reachable peers retain advertised
71
+ ropes during a tunnel outage. Registry schema, authentication, mesh RPC, and
72
+ operator actions are unchanged. The existing machine registry gains endpoint
73
+ values it was already designed to carry; no new external request is introduced.
74
+
75
+ ## 6b. Operator-surface quality
76
+
77
+ No operator surface — not applicable.
78
+
79
+ ## 7. Multi-machine posture (Cross-Machine Coherence)
80
+
81
+ **Replicated.** Each machine discovers its own physical endpoints and writes
82
+ them to its self-owned registry row. The existing authenticated registry-sync
83
+ path propagates that row to peers, which consume it through the endpoint
84
+ resolver and pool heartbeat. There are no user-facing notices, no topic-bound
85
+ durable state, and no generated user URL. Cloudflare URLs continue to cross
86
+ machine boundaries through the existing `lastKnownUrl` and endpoint fields.
87
+
88
+ ## 8. Rollback cost
89
+
90
+ Pure code rollback with no migration. Rolling back restores the failure where
91
+ a tunnel outage suppresses every endpoint at the next boot.
92
+
93
+ ## Evidence
94
+
95
+ - `tests/unit/mesh-url-advertisement-wiring.test.ts`
96
+ - `tests/unit/MeshEndpointAdvertiser.test.ts`
97
+ - `tests/unit/mesh-url-advertiser.test.ts`
98
+ - Live single-agent CROSS-MACHINE laptop/Mini health probes.
99
+
100
+ ## Conclusion
101
+
102
+ The fix is narrow and clear to ship. It restores the intended independence of
103
+ the three existing mesh transports without changing their security, priority,
104
+ or retry policies.
105
+
106
+ ## Second-pass review
107
+
108
+ Not required: this does not touch messaging block/allow, session lifecycle,
109
+ compaction, a coherence gate, trust, or a sentinel/guard/watchdog.
110
+
111
+ ## Class-Closure Declaration (display-only mirror)
112
+
113
+ No agent-authored-artifact defect and no self-triggered controller is added or
114
+ modified — not applicable.
@@ -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.