instar 1.3.799 → 1.3.800
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 +13 -2
- package/dist/commands/server.js.map +1 -1
- package/dist/core/PostUpdateMigrator.d.ts.map +1 -1
- package/dist/core/PostUpdateMigrator.js +32 -2
- package/dist/core/PostUpdateMigrator.js.map +1 -1
- package/dist/messaging/TelegramAdapter.d.ts +37 -0
- package/dist/messaging/TelegramAdapter.d.ts.map +1 -1
- package/dist/messaging/TelegramAdapter.js +108 -0
- package/dist/messaging/TelegramAdapter.js.map +1 -1
- package/dist/scaffold/templates.d.ts.map +1 -1
- package/dist/scaffold/templates.js +1 -0
- package/dist/scaffold/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/data/builtin-manifest.json +19 -19
- package/src/scaffold/templates.ts +1 -0
- package/upgrades/1.3.800.md +28 -0
- package/upgrades/side-effects/attention-single-topic-routing.md +123 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../src/scaffold/templates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AASH,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,MAAM,CAgG/D;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CA2E/F;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAiBvD;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAA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 +681,7 @@ I declare owner/blockedOn at commitment creation; a later state change goes thro
|
|
|
681
681
|
- **Failure resilience**: If Cloudflare can't give you a link (e.g. rate-limited), I'll DM you (owner only) with two buttons to approve a consent-gated backup relay through a third party. While the backup is active your dashboard traffic briefly passes through that operator, so when Cloudflare recovers I switch back automatically (after several healthy checks) and rotate your dashboard PIN + access token — which signs out open tabs and invalidates previously-shared private view links. \`GET /tunnel\` reports the live \`lifecycle.state\` (active / retrying / awaiting-consent / relay-active / self-healing / exhausted) so you can explain a link issue. Opt out of backups entirely with \`{"tunnel": {"relaysEnabled": false}}\` or \`{"tunnel": {"relayConsent": "never"}}\` (Cloudflare-only).
|
|
682
682
|
|
|
683
683
|
**Attention Queue** — Signal important items to the user. When something needs their attention — a decision, a review, an anomaly — queue it here instead of hoping they see a chat message.
|
|
684
|
+
- **Where alerts land**: EVERY queued item — all priorities, HIGH/URGENT included — posts as a message into the single dedicated "🔔 Attention" hub topic. Alerts NEVER spawn their own Telegram topic (per-item topics are opt-in legacy via \`messaging[].config.attentionRouting = { "mode": "per-item" }\`). If a user asks "why do all my alerts land in one topic?" — that is the single-alerts-topic default doing its job.
|
|
684
685
|
- Queue: \`curl -X POST -H "Authorization: Bearer $AUTH" http://localhost:${port}/attention -H 'Content-Type: application/json' -d '{"id":"agent:unique-item-id","title":"...","body":"...","priority":"medium","source":"agent"}'\`
|
|
685
686
|
- View queue: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/attention\`
|
|
686
687
|
- View the WHOLE POOL (across every machine): \`curl -H "Authorization: Bearer $AUTH" "http://localhost:${port}/attention?scope=pool"\` — merges each online machine's items (each tagged with its machineId/machineNickname), tolerant of a dark peer (a \`pool.failed\` entry, never a 500), short-TTL cached, and P17-coalesced: machines raising the SAME pool-wide event collapse to ONE row (HIGH/URGENT always stay individually visible). Use this when the user asks "what needs my attention?" on a multi-machine setup — the plain view only shows THIS machine's items.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.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O,IAAI;;;;;;;uGAOU,IAAI;yFAClB,IAAI;;;;;;0DAMnC,IAAI;;;;;;;;;;;;;;;;;;;;;;;2FAuB6B,IAAI;8FACD,IAAI;+MAC6G,IAAI;mGAChH,IAAI;;;mMAG4F,IAAI;;;;;0LAKb,IAAI;;;;4EAIlH,IAAI;+LAC+G,IAAI;;;;8DAIrI,IAAI;;;;;;;;;;;0CAWxB,IAAI;oCACV,IAAI;;;;;;;;;;;;;yDAaiB,IAAI;;;;;;;;0DAQH,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+GhD,SAAS;;;;;;;;;;;;sEAY+C,IAAI;;CAEzE,CAAC;IAEA,OAAO,OAAO,CAAC;AACjB,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-10T08:29:55.743Z",
|
|
5
|
+
"instarVersion": "1.3.800",
|
|
6
6
|
"entryCount": 202,
|
|
7
7
|
"entries": {
|
|
8
8
|
"hook:session-start": {
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"domain": "identity",
|
|
12
12
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
13
13
|
"installedPath": ".instar/hooks/instar/session-start.sh",
|
|
14
|
-
"contentHash": "
|
|
14
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
15
15
|
"since": "2025-01-01"
|
|
16
16
|
},
|
|
17
17
|
"hook:dangerous-command-guard": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"domain": "safety",
|
|
21
21
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
22
22
|
"installedPath": ".instar/hooks/instar/dangerous-command-guard.sh",
|
|
23
|
-
"contentHash": "
|
|
23
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
24
24
|
"since": "2025-01-01"
|
|
25
25
|
},
|
|
26
26
|
"hook:grounding-before-messaging": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"domain": "safety",
|
|
30
30
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
31
31
|
"installedPath": ".instar/hooks/instar/grounding-before-messaging.sh",
|
|
32
|
-
"contentHash": "
|
|
32
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
33
33
|
"since": "2025-01-01"
|
|
34
34
|
},
|
|
35
35
|
"hook:compaction-recovery": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"domain": "identity",
|
|
39
39
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
40
40
|
"installedPath": ".instar/hooks/instar/compaction-recovery.sh",
|
|
41
|
-
"contentHash": "
|
|
41
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
42
42
|
"since": "2025-01-01"
|
|
43
43
|
},
|
|
44
44
|
"hook:external-operation-gate": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"domain": "safety",
|
|
48
48
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
49
49
|
"installedPath": ".instar/hooks/instar/external-operation-gate.js",
|
|
50
|
-
"contentHash": "
|
|
50
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
51
51
|
"since": "2025-01-01"
|
|
52
52
|
},
|
|
53
53
|
"hook:deferral-detector": {
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"domain": "safety",
|
|
57
57
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
58
58
|
"installedPath": ".instar/hooks/instar/deferral-detector.js",
|
|
59
|
-
"contentHash": "
|
|
59
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
60
60
|
"since": "2025-01-01"
|
|
61
61
|
},
|
|
62
62
|
"hook:self-stop-guard": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"domain": "coherence",
|
|
66
66
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
67
67
|
"installedPath": ".instar/hooks/instar/self-stop-guard.js",
|
|
68
|
-
"contentHash": "
|
|
68
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
69
69
|
"since": "2025-01-01"
|
|
70
70
|
},
|
|
71
71
|
"hook:post-action-reflection": {
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"domain": "evolution",
|
|
75
75
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
76
76
|
"installedPath": ".instar/hooks/instar/post-action-reflection.js",
|
|
77
|
-
"contentHash": "
|
|
77
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
78
78
|
"since": "2025-01-01"
|
|
79
79
|
},
|
|
80
80
|
"hook:external-communication-guard": {
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"domain": "safety",
|
|
84
84
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
85
85
|
"installedPath": ".instar/hooks/instar/external-communication-guard.js",
|
|
86
|
-
"contentHash": "
|
|
86
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
87
87
|
"since": "2025-01-01"
|
|
88
88
|
},
|
|
89
89
|
"hook:scope-coherence-collector": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"domain": "coherence",
|
|
93
93
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
94
94
|
"installedPath": ".instar/hooks/instar/scope-coherence-collector.js",
|
|
95
|
-
"contentHash": "
|
|
95
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
96
96
|
"since": "2025-01-01"
|
|
97
97
|
},
|
|
98
98
|
"hook:scope-coherence-checkpoint": {
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"domain": "coherence",
|
|
102
102
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
103
103
|
"installedPath": ".instar/hooks/instar/scope-coherence-checkpoint.js",
|
|
104
|
-
"contentHash": "
|
|
104
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
105
105
|
"since": "2025-01-01"
|
|
106
106
|
},
|
|
107
107
|
"hook:free-text-guard": {
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"domain": "safety",
|
|
111
111
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
112
112
|
"installedPath": ".instar/hooks/instar/free-text-guard.sh",
|
|
113
|
-
"contentHash": "
|
|
113
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
114
114
|
"since": "2025-01-01"
|
|
115
115
|
},
|
|
116
116
|
"hook:claim-intercept": {
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
"domain": "coherence",
|
|
120
120
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
121
121
|
"installedPath": ".instar/hooks/instar/claim-intercept.js",
|
|
122
|
-
"contentHash": "
|
|
122
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
123
123
|
"since": "2025-01-01"
|
|
124
124
|
},
|
|
125
125
|
"hook:claim-intercept-response": {
|
|
@@ -128,7 +128,7 @@
|
|
|
128
128
|
"domain": "coherence",
|
|
129
129
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
130
130
|
"installedPath": ".instar/hooks/instar/claim-intercept-response.js",
|
|
131
|
-
"contentHash": "
|
|
131
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
132
132
|
"since": "2025-01-01"
|
|
133
133
|
},
|
|
134
134
|
"hook:stop-gate-router": {
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
"domain": "safety",
|
|
138
138
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
139
139
|
"installedPath": ".instar/hooks/instar/stop-gate-router.js",
|
|
140
|
-
"contentHash": "
|
|
140
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
141
141
|
"since": "2025-01-01"
|
|
142
142
|
},
|
|
143
143
|
"hook:auto-approve-permissions": {
|
|
@@ -146,7 +146,7 @@
|
|
|
146
146
|
"domain": "safety",
|
|
147
147
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
148
148
|
"installedPath": ".instar/hooks/instar/auto-approve-permissions.js",
|
|
149
|
-
"contentHash": "
|
|
149
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
150
150
|
"since": "2025-01-01"
|
|
151
151
|
},
|
|
152
152
|
"job:health-check": {
|
|
@@ -1562,7 +1562,7 @@
|
|
|
1562
1562
|
"type": "subsystem",
|
|
1563
1563
|
"domain": "updates",
|
|
1564
1564
|
"sourcePath": "src/core/PostUpdateMigrator.ts",
|
|
1565
|
-
"contentHash": "
|
|
1565
|
+
"contentHash": "b2c5a65ba74ef9a45d452e14fc872afde2b28fccebcceb0463d660d52f1e19e0",
|
|
1566
1566
|
"since": "2025-01-01"
|
|
1567
1567
|
},
|
|
1568
1568
|
"subsystem:scheduler": {
|
|
@@ -702,6 +702,7 @@ I declare owner/blockedOn at commitment creation; a later state change goes thro
|
|
|
702
702
|
- **Failure resilience**: If Cloudflare can't give you a link (e.g. rate-limited), I'll DM you (owner only) with two buttons to approve a consent-gated backup relay through a third party. While the backup is active your dashboard traffic briefly passes through that operator, so when Cloudflare recovers I switch back automatically (after several healthy checks) and rotate your dashboard PIN + access token — which signs out open tabs and invalidates previously-shared private view links. \`GET /tunnel\` reports the live \`lifecycle.state\` (active / retrying / awaiting-consent / relay-active / self-healing / exhausted) so you can explain a link issue. Opt out of backups entirely with \`{"tunnel": {"relaysEnabled": false}}\` or \`{"tunnel": {"relayConsent": "never"}}\` (Cloudflare-only).
|
|
703
703
|
|
|
704
704
|
**Attention Queue** — Signal important items to the user. When something needs their attention — a decision, a review, an anomaly — queue it here instead of hoping they see a chat message.
|
|
705
|
+
- **Where alerts land**: EVERY queued item — all priorities, HIGH/URGENT included — posts as a message into the single dedicated "🔔 Attention" hub topic. Alerts NEVER spawn their own Telegram topic (per-item topics are opt-in legacy via \`messaging[].config.attentionRouting = { "mode": "per-item" }\`). If a user asks "why do all my alerts land in one topic?" — that is the single-alerts-topic default doing its job.
|
|
705
706
|
- Queue: \`curl -X POST -H "Authorization: Bearer $AUTH" http://localhost:${port}/attention -H 'Content-Type: application/json' -d '{"id":"agent:unique-item-id","title":"...","body":"...","priority":"medium","source":"agent"}'\`
|
|
706
707
|
- View queue: \`curl -H "Authorization: Bearer $AUTH" http://localhost:${port}/attention\`
|
|
707
708
|
- View the WHOLE POOL (across every machine): \`curl -H "Authorization: Bearer $AUTH" "http://localhost:${port}/attention?scope=pool"\` — merges each online machine's items (each tagged with its machineId/machineNickname), tolerant of a dark peer (a \`pool.failed\` entry, never a 500), short-TTL cached, and P17-coalesced: machines raising the SAME pool-wide event collapse to ONE row (HIGH/URGENT always stay individually visible). Use this when the user asks "what needs my attention?" on a multi-machine setup — the plain view only shows THIS machine's items.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Upgrade Guide — vNEXT
|
|
2
|
+
|
|
3
|
+
<!-- assembled-by: assemble-next-md -->
|
|
4
|
+
<!-- bump: patch -->
|
|
5
|
+
|
|
6
|
+
## What Changed
|
|
7
|
+
|
|
8
|
+
Attention alerts no longer spawn one Telegram forum topic per item. `TelegramAdapter.createAttentionItem` now defaults to single-topic routing (`attentionRouting.mode: 'single-topic'`, a code default — existing agents flip on update with no config edit): EVERY attention item, all priorities including HIGH/URGENT, posts as one message into the durable "🔔 Attention" hub topic the server already creates at boot (state key `agent-attention-topic`, resolved live through a new injected `getAttentionHubTopicId` accessor wired in `server.ts`). Hub messages carry the priority emoji, title, category | priority, summary, a clipped description, and the source. Hub-routed items are marked `coalesced` and are deliberately NOT registered in the per-item topic maps, so resolving one item can never close the shared hub. If the hub id cannot be resolved (fresh install) or the send fails (deleted hub), the adapter finds-or-creates the hub once (create-once + in-flight-promise, mirroring the agent-health lane) — it NEVER falls back to a per-item topic, and every item is always recorded in the attention store regardless. The 2026-05-28 flood guard and the global topic-creation ceiling remain intact and load-bearing for the legacy opt-out (`messaging[].config.attentionRouting = { "mode": "per-item" }`) and for every non-attention topic creator. The agent-health lane is unchanged and still takes precedence for its items. This closes the slow-drip hole the burst-only flood guard could not see (alerts hours apart, each a new topic — ~317 junk topics by 2026-07-09) and executes the operator directive from topic 11960: "Alerts should all go into a SINGLE topic with a dedicated name that is for alerts and NOTHING else."
|
|
9
|
+
|
|
10
|
+
## What to Tell Your User
|
|
11
|
+
|
|
12
|
+
- **All alerts now land in one place**: "My alerts — every priority, including urgent ones — now go into the single '🔔 Attention' topic instead of each creating its own new topic. Your topic list stays clean; urgency is still visible from the priority emoji on each message."
|
|
13
|
+
- **Nothing for you to do**: "This is automatic. Every alert is still tracked in my attention list and on the dashboard. If you ever want the old one-topic-per-alert behavior back, it's a one-line setting."
|
|
14
|
+
|
|
15
|
+
## Summary of New Capabilities
|
|
16
|
+
|
|
17
|
+
| Capability | How to Use |
|
|
18
|
+
|-----------|-----------|
|
|
19
|
+
| Single-alerts-topic routing (all attention items → the "🔔 Attention" hub) | automatic (code default) |
|
|
20
|
+
| Legacy per-item alert topics | set `messaging[].config.attentionRouting` to `{ "mode": "per-item" }` |
|
|
21
|
+
|
|
22
|
+
## Evidence
|
|
23
|
+
|
|
24
|
+
- Unit (`tests/unit/attention-single-topic-routing.test.ts`): all four priorities route into the injected hub with ZERO `createForumTopic` calls; the hub message format is pinned (HTML-escaped title, `category | Priority`, 500-char description clip, source line); resolving a hub-routed item performs no `closeForumTopic`; with no injected hub id the hub is found-or-created exactly ONCE for N items; a dead injected hub self-heals to a created hub (item still delivered); an agent-health-lane item still routes to the lane, not the hub; legacy `per-item` mode still creates its own topic, registers the maps, and /done closes it; `server.ts` carries the resolver wiring at BOTH TelegramAdapter construction sites.
|
|
25
|
+
- Integration (`tests/integration/notification-flood-burst-invariant.test.ts`): SHIPPED DEFAULT — 1,000 attention items of every priority with unique sources create ≤ 1 topic (the hub) and all 1,000 are stored; the legacy-mode guard invariants (per-source cap + coalesce topic, guard-disabled backstop, critical-flood ceiling, mid-flood critical carve-out) all still hold under the explicit `per-item` pin; the Standard-C contract block now pins HIGH/URGENT → the SAME single hub.
|
|
26
|
+
- E2E (`tests/e2e/attention-topic-flood-guard-lifecycle.test.ts`): a stock production config (token + chatId ONLY — exactly what a fleet agent has after a silent dist update) routes a 40-item mixed-priority slow-drip into exactly ONE hub topic with every item stored and pointing at it; the legacy opt-out still caps a flooding source at budget + 1 coalesced notice topic.
|
|
27
|
+
- Slack verified unchanged: the Slack attention surface already routes to the single `slack-attention-channel`; no per-item surfaces exist there.
|
|
28
|
+
- Full `test:all` (unit + integration + e2e) green in the worktree before push.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# Side-Effects Review — Single-alerts-topic attention routing (kill per-item alert topics)
|
|
2
|
+
|
|
3
|
+
**Version / slug:** `attention-single-topic-routing`
|
|
4
|
+
**Date:** `2026-07-10`
|
|
5
|
+
**Author:** `echo (instar-dev agent)`
|
|
6
|
+
**Second-pass reviewer:** `independent reviewer subagent (see below)`
|
|
7
|
+
|
|
8
|
+
## Summary of the change
|
|
9
|
+
|
|
10
|
+
`TelegramAdapter.createAttentionItem` gains a routing mode, `attentionRouting.mode`, with the code DEFAULT `'single-topic'`: every attention item — all priorities, HIGH/URGENT included — is posted as one message into the durable "🔔 Attention" hub topic (created at boot by `ensureAgentAttentionTopic`, state key `agent-attention-topic`, resolved live via a new injected `getAttentionHubTopicId` accessor wired at both TelegramAdapter construction sites in `src/commands/server.ts`). No per-item forum topic is ever created in this mode. `'per-item'` restores the legacy behavior byte-for-byte (still shaped by `attentionTopicGuard` + `topicCreationBudget`). If no hub id resolves or the hub send fails, the adapter finds-or-creates the hub once (create-once + in-flight-promise, mirroring the agent-health lane) — never a per-item topic. Hub-routed items are marked `coalesced` and deliberately NOT registered in the per-item topic maps. Files: `src/messaging/TelegramAdapter.ts`, `src/commands/server.ts`, `src/scaffold/templates.ts`, `src/core/PostUpdateMigrator.ts` (CLAUDE.md awareness parity), docs (`STANDARDS-REGISTRY.md`, `attention-topic-flood-guard.md` addendum), and tests across all three tiers. Trigger: operator directive, topic 11960, 2026-07-09 — ~317 junk topics from slow-drip alert sources that never trip the burst guard.
|
|
11
|
+
|
|
12
|
+
## Decision-point inventory
|
|
13
|
+
|
|
14
|
+
- `TelegramAdapter.createAttentionItem` routing branch — **modify** — chooses WHERE an alert surfaces (hub message vs per-item topic); never whether it surfaces.
|
|
15
|
+
- `AttentionTopicGuard` decide() at createAttentionItem — **pass-through** — unreached in single-topic mode; unchanged and load-bearing in legacy mode.
|
|
16
|
+
- `topicCreationGuard` ceiling inside createForumTopic — **pass-through** — unchanged; hub creation uses the exempt `origin:'system', bounded:true` class (fixed cardinality: one hub).
|
|
17
|
+
- Agent-health lane branch — **pass-through** — unchanged; still takes precedence for `lane:'agent-health'` items.
|
|
18
|
+
- `updateAttentionStatus` topic close/reopen — **pass-through** — hub items are absent from `attentionItemToTopic`, so resolving one never closes the shared hub (same mechanism the coalesce path already relies on).
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## 1. Over-block
|
|
23
|
+
|
|
24
|
+
**What legitimate inputs does this change reject that it shouldn't?**
|
|
25
|
+
|
|
26
|
+
No input is rejected. Every attention item is still accepted, stored, and delivered. The nearest thing to an over-block is a VISIBILITY reduction: a HIGH/URGENT alert no longer gets its own topic (it is a hub message with a priority emoji). That is the deliberate, operator-directed behavior, not a side effect — and the per-item carve-out remains available via the legacy mode.
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## 2. Under-block
|
|
31
|
+
|
|
32
|
+
**What failure modes does this still miss?**
|
|
33
|
+
|
|
34
|
+
- A deleted-hub + stale-registry edge: if the user deletes the hub topic in Telegram AND the adapter's topic registry still holds the hub name, `findOrCreateForumTopic` can return the dead id; the send fails, the cached id is dropped, and the item remains store-only until the registry entry is corrected (same semantics the agent-health lane already has). No item is lost; delivery degrades to the store + dashboard.
|
|
35
|
+
- The hub can accumulate many messages under a pathological flood (there is no per-hub message rate cap). That is Telegram messages in ONE topic — exactly the surface the directive asks for — and upstream emitters remain bounded by their own dedup/aggregation rules. No issue identified beyond this accepted shape.
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## 3. Level-of-abstraction fit
|
|
40
|
+
|
|
41
|
+
The change sits at the exact chokepoint where per-item topics were born (`createAttentionItem`), which is the layer the Bounded-Notification-Surface standard names for this class of fix. It does not re-implement any primitive: hub resolution reuses the boot topic + StateManager key; self-heal reuses `findOrCreateForumTopic`; delivery reuses `sendToTopic`. The flood guard stays at its layer for the legacy mode rather than being deleted — the default simply stops reaching it for attention items.
|
|
42
|
+
|
|
43
|
+
---
|
|
44
|
+
|
|
45
|
+
## 4. Signal vs authority compliance
|
|
46
|
+
|
|
47
|
+
**Required reference:** docs/signal-vs-authority.md
|
|
48
|
+
|
|
49
|
+
- [x] No — this change has no block/allow surface.
|
|
50
|
+
|
|
51
|
+
The routing branch holds no blocking authority: it decides destination, not permission. Every failure path fails toward delivery (self-heal hub creation) or toward durable recording (attention store) plus a DegradationReporter signal — never toward silent suppression of content.
|
|
52
|
+
|
|
53
|
+
---
|
|
54
|
+
|
|
55
|
+
## 5. Interactions
|
|
56
|
+
|
|
57
|
+
- **Shadowing:** the single-topic branch runs AFTER the agent-health lane (lane wins, unchanged) and BEFORE the flood guard (guard unreached in default mode — intended; it still runs in legacy mode). Verified order in `createAttentionItem`.
|
|
58
|
+
- **Double-fire:** no other component posts attention items to the hub; `CrossPlatformAlerts.alertOnTelegram` already targets the same hub via `getAlertTopicId` for a different event class (adapter disconnects) — both are plain messages into one topic, no conflict.
|
|
59
|
+
- **Races:** concurrent first-items share ONE in-flight hub creation via `attentionHubPending` (the same promise-guard pattern as the agent-health lane and flood-notice topics). The `attentionItemToTopic` map is untouched for hub items, so no reverse-map corruption (the exact hazard the coalesce-path comment documents).
|
|
60
|
+
- **Feedback loops:** none — routing output does not feed any input of the attention system.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## 6. External surfaces
|
|
65
|
+
|
|
66
|
+
- **Telegram:** user-visible change — alerts appear as messages in the existing "🔔 Attention" topic instead of new topics. This is the requested behavior.
|
|
67
|
+
- **API consumers:** `AttentionItem.topicId` now points at the shared hub and `coalesced: true` is set (the shape the coalesce path already produced); `/attention` routes, dashboard, and pool reads are unchanged. `/ack`-family commands inside the hub topic are no-ops for hub items (as they already were for coalesced items) — management is via `/attention` PATCH / dashboard.
|
|
68
|
+
- **Slack:** verified — the Slack attention surface already routes to the single `slack-attention-channel`; no per-item surfaces exist there. No change.
|
|
69
|
+
- **Operator surface (Mobile-Complete):** no new operator-facing action; no dashboard change required. The dashboard attention tab continues to manage items.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## 6b. Operator-surface quality
|
|
74
|
+
|
|
75
|
+
No operator surface touched — not applicable (no dashboard/approval/form files staged).
|
|
76
|
+
|
|
77
|
+
---
|
|
78
|
+
|
|
79
|
+
## 7. Multi-machine posture (Cross-Machine Coherence)
|
|
80
|
+
|
|
81
|
+
**Machine-local BY DESIGN, matching the existing attention-topic architecture:** each machine's TelegramAdapter holds its own attention store, and the hub topic id lives in each machine's StateManager under `agent-attention-topic` (the boot path already ensures it per machine; all machines share ONE Telegram chat, and `findOrCreateForumTopic` name-matching keeps them converging on the same hub topic rather than minting one per machine). The pool-wide question ("what needs my attention across machines?") is already answered by the proxied-on-read `GET /attention?scope=pool`, which is unchanged. User-facing notices: this change REDUCES notice surface (one topic); one-voice gating is unaffected because delivery still flows through the same adapter send funnel. No URLs generated; no durable state strands on topic transfer (attention items were never topic-transferable state).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## 8. Rollback cost
|
|
86
|
+
|
|
87
|
+
- **Hot-fix release:** pure code-default change — revert and ship a patch, or flip `messaging[].config.attentionRouting = { "mode": "per-item" }` per agent (live rollback lever, no code).
|
|
88
|
+
- **Data migration:** none. No persistent state format changes; hub-routed items reuse the existing `coalesced`/`topicId` fields.
|
|
89
|
+
- **Agent state repair:** none. The CLAUDE.md awareness migration is idempotent text replacement.
|
|
90
|
+
- **User visibility:** rollback restores per-item topics going forward; hub messages already posted stay in the hub (harmless history).
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Conclusion
|
|
95
|
+
|
|
96
|
+
The review confirmed the design rides existing, battle-tested patterns (boot hub + injected resolver, create-once promise guard, coalesced-item map exclusion) and holds no blocking authority. One design choice was re-verified against the hazard comment in the coalesce path: hub items must NOT enter the per-item topic maps, or resolving one item would close the shared hub — the implementation and a dedicated unit test pin this. Clear to ship; the legacy mode plus a one-key rollback bound the blast radius.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Second-pass review (if required)
|
|
101
|
+
|
|
102
|
+
**Reviewer:** independent reviewer subagent (general-purpose, fresh context, artifact + diff only)
|
|
103
|
+
**Independent read of the artifact: concur**
|
|
104
|
+
|
|
105
|
+
Verbatim verdict core: "Concur with the review." The reviewer independently verified against the working-tree diff: (1) the no-drop guarantee — the store write is unconditional after `routeToAttentionHub`, whose injected-send, `ensureAttentionHubTopic`, and fallback-send paths are all caught, with store-only degradation carrying a DegradationReporter signal; (2) hub-close immunity including across restart — hub items never enter the per-item maps, and the pre-existing `!item.coalesced` guard in `loadAttentionItems` keeps that true after a reload; (3) bounded self-heal — `findOrCreateForumTopic` with the budget-exempt bounded/system class, same name + label as the boot path, shared in-flight promise; (4) branch order and legacy fidelity — the agent-health lane runs first, and the `'per-item'` path is byte-for-byte unchanged.
|
|
106
|
+
|
|
107
|
+
Three non-blocking observations were raised; ALL THREE were folded into this change rather than deferred: (1) fresh-install race where a self-healed hub could be duplicated by the boot path → `ensureAgentAttentionTopic` now uses `findOrCreateForumTopic` (reuse-by-name, intro message only on a genuinely new topic); (2) the injected accessor was the one call outside a try/catch → now wrapped, making the no-drop claim injector-independent; (3) the migrator's in-place patch left the old "Default-ON" bullet on previously-migrated agents → the patch now rewrites that stale bullet too (covered by a new migrator test).
|
|
108
|
+
|
|
109
|
+
---
|
|
110
|
+
|
|
111
|
+
## Evidence pointers
|
|
112
|
+
|
|
113
|
+
- `tests/unit/attention-single-topic-routing.test.ts` — all-priorities hub routing, zero topic creation, hub-close immunity, self-heal (null id + dead hub), legacy byte-for-byte, lane precedence, server.ts wiring (both construction sites).
|
|
114
|
+
- `tests/integration/notification-flood-burst-invariant.test.ts` — SHIPPED DEFAULT burst: 1,000 mixed-priority items → ≤1 topic; legacy-mode guard invariants preserved under `attentionRouting.mode:'per-item'`.
|
|
115
|
+
- `tests/e2e/attention-topic-flood-guard-lifecycle.test.ts` — stock production config (token+chatId only): slow-drip 40 alerts → exactly ONE hub topic; legacy opt-out still capped at budget+1.
|
|
116
|
+
|
|
117
|
+
---
|
|
118
|
+
|
|
119
|
+
## Class-Closure Declaration (display-only mirror)
|
|
120
|
+
|
|
121
|
+
No agent-authored-artifact defect — the change alters product-source routing behavior (a code default), not a defect in an LLM prompt, hook, config, skill, or standards text.
|
|
122
|
+
|
|
123
|
+
For the `unbounded-self-action` class (the added diff introduces `sendToTopic`/`findOrCreateForumTopic` emit callsites), the trace carries the explicit NEGATIVE declaration: `{ "defectClass": "unbounded-self-action", "closure": "n/a", "reason": "caller-driven delivery-path routing inside the existing createAttentionItem funnel — not a new self-triggered controller/loop; emission is one hub message per item (replacing one TOPIC per item, a strict reduction), and hub creation is bounded create-once behind an in-flight-promise guard" }`. No new self-triggered controller is added or modified; the controllers that CALL createAttentionItem are unchanged and separately registered.
|