instar 1.3.1633 → 1.3.1634
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 +21 -0
- package/dist/commands/server.js.map +1 -1
- package/dist/data/standards-guard-index.json +1 -1
- package/dist/data/standards-guard-index.meta.json +2 -2
- package/dist/data/standards-registry.meta.json +1 -1
- package/dist/monitoring/PresenceProxy.d.ts +23 -0
- package/dist/monitoring/PresenceProxy.d.ts.map +1 -1
- package/dist/monitoring/PresenceProxy.js +110 -11
- package/dist/monitoring/PresenceProxy.js.map +1 -1
- package/dist/native/InstarWedgeCanary.app/Contents/MacOS/InstarWedgeCanary +0 -0
- package/dist/native/instar-desktop-host +0 -0
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +2 -2
- package/src/data/standards-guard-index.json +1 -1
- package/src/data/standards-guard-index.meta.json +2 -2
- package/src/data/standards-registry.meta.json +1 -1
- package/upgrades/1.3.1634.md +21 -0
- package/upgrades/side-effects/presence-follows-replacement-session.md +92 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"generatedFrom": "source-tree",
|
|
4
4
|
"registrySha256": "db01d9f92c6aa26ca903702896b41be53722982ed07d27633237bb254c214290",
|
|
5
|
-
"packageVersion": "1.3.
|
|
5
|
+
"packageVersion": "1.3.1634",
|
|
6
6
|
"guards": [
|
|
7
7
|
{
|
|
8
8
|
"ref": "docs/audits/phase-b/f10-triage.md",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"sha256": "
|
|
2
|
+
"sha256": "a8426ccefa0111bd61fd05bfcc0f65199d90cee3984a7f811331eb1f20a4424d",
|
|
3
3
|
"registrySha256": "db01d9f92c6aa26ca903702896b41be53722982ed07d27633237bb254c214290",
|
|
4
|
-
"packageVersion": "1.3.
|
|
4
|
+
"packageVersion": "1.3.1634"
|
|
5
5
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
The watcher that posts status lines when a message goes unanswered now follows the session that is actually answering. A message sent to a Slack channel or Telegram topic whose old session had died used to arm the watcher with the old session's name. The server then started a replacement, but the watcher kept checking the dead name. About half a minute in, it posted "5-minute check — The session appears to have stopped" while the new session was working. Now the watcher looks the session up again before every check. It holds the alarm while a session is starting, and a single dead reading at the first check gets until the 2-minute mark for a replacement to appear. "5-minute check" is printed only once about 5 minutes have passed. A session that is really dead with nothing replacing it is still reported, with wording that makes no time claim.
|
|
9
|
+
|
|
10
|
+
## What to Tell Your User
|
|
11
|
+
|
|
12
|
+
If you message me after my previous session ended, you won't get a false "the session appears to have stopped" a minute later while I'm already working on your message. If a session really does stop, I still tell you.
|
|
13
|
+
|
|
14
|
+
## Summary of New Capabilities
|
|
15
|
+
|
|
16
|
+
- No false "session stopped" alarm while a replacement session starts or is already working.
|
|
17
|
+
- "5-minute check" appears only after about 5 minutes.
|
|
18
|
+
|
|
19
|
+
## Evidence
|
|
20
|
+
|
|
21
|
+
Reproduced in `tests/unit/presence-proxy-replacement-session.test.ts`: all four scenario tests fail on the previous code and pass after. They cover a live replacement (no alarm, watcher switches name), a spawn in progress (no alarm until it lands), really dead with no replacement (still reported, no "5-minute" label at the 2-minute mark), and a spawn that never lands (reported at the real 5-minute mark). Two more tests check that the server wires the spawn-in-progress signal for Slack and Telegram. Incident: indra on Slack, 2026-11-03 11:46–11:47 PST.
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
# Side-Effects Review — the unanswered-message watcher follows the replacement session
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `presence-follows-replacement-session`
|
|
4
|
+
**Date:** `2026-11-03`
|
|
5
|
+
**Author:** `echo`
|
|
6
|
+
**Second-pass reviewer:** `independent general-purpose subagent (read-only diff review)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
Tier 1: a narrow fix to one monitor that a revert fully undoes. Files: `src/monitoring/PresenceProxy.ts`, `src/commands/server.ts`, a new unit test file.
|
|
11
|
+
|
|
12
|
+
The PresenceProxy (the tiered "standby" watcher on an unanswered message) recorded the session name once, when the user message was logged. Slack and Telegram log the inbound message before they find the old session dead and spawn a replacement. So the watcher kept the dead name, read it dead at Tier 1 (20 s), jumped to the Tier 3 dead branch and posted "5-minute check — The session appears to have stopped" about 30 s in, while the replacement worked (indra, Slack, 2026-11-03).
|
|
13
|
+
|
|
14
|
+
1. `refreshSessionName()` re-resolves `getSessionForTopic` before every liveness read in `fireTier` and `fireTier3`, and follows a replacement. The pre-message baseline is dropped on a switch because it belonged to the old pane.
|
|
15
|
+
2. New optional dep `isSessionStarting(topicId)`. On Slack, `server.ts` keeps an in-flight counter per channel around `spawnInteractiveSession`, decremented in `finally`. On Telegram it reads the existing `SpawningTopicsRegistry`. While it reads true and less than the Tier 3 delay has passed, the dead alarm is held and the same tier re-runs after the Tier 1 delay.
|
|
16
|
+
3. A dead reading at Tier 1 re-checks at the Tier 2 mark instead of jumping to Tier 3.
|
|
17
|
+
4. `tier3Label()`: "5-minute check" only when at least 90% of the Tier 3 delay has passed, otherwise "Check". An early real death says "The session handling this conversation has stopped, and no new session has started for it."
|
|
18
|
+
|
|
19
|
+
## Decision-point inventory
|
|
20
|
+
|
|
21
|
+
- PresenceProxy dead-session branch: **modify**. It now waits (until Tier 2, or while a spawn is in flight, capped at Tier 3) before taking the dead path, and it resolves the current session name first.
|
|
22
|
+
- Tier 3 message label: **modify** (wording only).
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 1. Over-block
|
|
27
|
+
|
|
28
|
+
The watcher has no block authority. It only decides whether to post a status line. The new holds delay a real dead-session report from about 30 s to about 2 minutes, or to at most the 5-minute mark while a spawn is in flight. That is the intended trade.
|
|
29
|
+
|
|
30
|
+
## 2. Under-block
|
|
31
|
+
|
|
32
|
+
- A spawn that hangs past 5 minutes is reported at the 5-minute mark as "5-minute check — The session appears to have stopped". That is accurate.
|
|
33
|
+
- If the old session is still listed as alive but is not answering (stuck), this change does not alter detection. The live-session tiers run as before.
|
|
34
|
+
- Slack thread sessions: the counter is keyed by the parent `channelId`, which is what the proxy's synthetic id maps to. A thread spawn therefore holds the channel's watcher too. That only widens the "starting" hold for the same channel, capped at Tier 3.
|
|
35
|
+
|
|
36
|
+
## 3. Level-of-abstraction fit
|
|
37
|
+
|
|
38
|
+
The fix lives in the watcher. It already owns the "is anyone answering" judgment and already gets the registry lookup (`getSessionForTopic`). Re-ordering the server's inbound path (spawn before logging) would touch every adapter and the message-log contract. The spawn signal reuses Telegram's existing registry rather than adding a second one.
|
|
39
|
+
|
|
40
|
+
## 4. Signal vs authority compliance
|
|
41
|
+
|
|
42
|
+
- [x] No — this change has no block/allow surface. It changes when and with what words a status message is sent.
|
|
43
|
+
|
|
44
|
+
## 4b. Judgment-point check
|
|
45
|
+
|
|
46
|
+
No new heuristic at a competing-signals point. "Which session is registered now" and "is a spawn in flight" are facts the server records.
|
|
47
|
+
|
|
48
|
+
## 5. Interactions
|
|
49
|
+
|
|
50
|
+
- **Triage mutex:** `fireTier3` re-resolves before acquiring the mutex. If the name changes during its 5 s re-check, it releases the old name's claim and acquires the new one, so the mutex stays balanced.
|
|
51
|
+
- **SessionMonitor "The session has stopped" (PR 2601):** a different component. Untouched.
|
|
52
|
+
- **Race guard / agent reply:** unchanged. Every hold returns through `scheduleTier`, which drops a cancelled state.
|
|
53
|
+
- **Rate limits:** a held check returns before any LLM call, so the holds spend no LLM budget. The 5 s retry wait runs once per held check.
|
|
54
|
+
- **Persisted state:** `persistState` writes the current (possibly switched) name, so a restart restores the replacement.
|
|
55
|
+
- **Stand-down / one-voice:** unchanged. All sends still go through `sendProxyMessage`.
|
|
56
|
+
|
|
57
|
+
## 6. External surfaces
|
|
58
|
+
|
|
59
|
+
Status-message timing and wording only: "Check — …" instead of "5-minute check — …" for reports before the 5-minute mark. No API, config or schema change.
|
|
60
|
+
|
|
61
|
+
## 6b. Operator-surface quality
|
|
62
|
+
|
|
63
|
+
Plain wording, no time claim that isn't true. No new controls.
|
|
64
|
+
|
|
65
|
+
## 7. Multi-machine posture
|
|
66
|
+
|
|
67
|
+
**Machine-local by design.** Each machine's watcher reads its own session registry and its own in-flight spawns, exactly like the existing liveness read. One-voice gating (`speakerElection`) is unchanged. No new durable state.
|
|
68
|
+
|
|
69
|
+
## 8. Rollback cost
|
|
70
|
+
|
|
71
|
+
Pure code. Revert and ship a patch. No migration, no state to repair.
|
|
72
|
+
|
|
73
|
+
## Conclusion
|
|
74
|
+
|
|
75
|
+
This fixes the false alarm at its cause (a stale name plus treating "starting" as "stopped") and keeps the real alarm.
|
|
76
|
+
|
|
77
|
+
## Second-pass review
|
|
78
|
+
|
|
79
|
+
**Reviewer:** independent subagent (read-only review of the diff, given the incident and required outcome but not my conclusions)
|
|
80
|
+
**Independent read:** concur, with fixes applied
|
|
81
|
+
|
|
82
|
+
- **Applied (severe):** a Tier 1 skipped on a dead read went to Tier 2 without marking Tier 1 passed. `fireTier2` returns early when `tier1FiredAt` is unset, so Tier 3 was never scheduled. A replacement that later hung would then never be reported. Tier 1's stage is now marked passed on that path, the same as the existing ack-suppressed path.
|
|
83
|
+
- **Applied (severe):** a spawn hold ending after the Tier 2 mark ran a late Tier 1 whose time to Tier 2 was ≤ 0, so nothing more was scheduled. `fireTier` now runs the tier that matches the elapsed time once the session is alive. Two new tests cover both cases. They fail on the first version of the fix and pass now.
|
|
84
|
+
- **Applied (minor):** the triage-mutex hand-off on a name switch now honours a claim held by the StallTriageNurse, the same as the first acquire.
|
|
85
|
+
- **Follow-up (found by the full suite):** with sped-up timers, the 5 s liveness retry alone could pass later tier marks, and the catch-up then skipped Tier 1 (`tests/e2e/presence-proxy.test.ts`, transient false negative). The catch-up now runs only when the previous check was held or deferred (`heldTopics`).
|
|
86
|
+
- **Stated, not changed:** the Slack counter is per channel, so a spawn for one thread holds the channel watcher too. That is capped at the Tier 3 delay and is already listed under Under-block.
|
|
87
|
+
- Checked fine by the reviewer: counter balance on every exit path, key match with `slackProxyChannelMap`, registration before the in-flight flag clears (Slack and Telegram), Telegram respawn paths all using `SpawningTopicsRegistry`, the hold loop cap, rate limits, the persisted-state restore, and the single construction site.
|
|
88
|
+
|
|
89
|
+
## Evidence pointers
|
|
90
|
+
|
|
91
|
+
- `tests/unit/presence-proxy-replacement-session.test.ts`: 8 tests. The 4 incident scenarios fail on the previous code. The 2 continuation tests fail on the first version of the fix. All pass now.
|
|
92
|
+
- Live logs from indra were **not** read: the laptop's Echo server, the only route to indra's files, was down for this whole session. The cause is shown by code reading (`SlackAdapter` logs the inbound before `server.ts` spawns and registers) and by the reproduction test.
|