@agfpd/iapeer 0.2.76 → 0.2.78

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.
Files changed (113) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +2 -2
  3. package/package.json +21 -2
  4. package/src/cli/index.ts +47 -48
  5. package/src/connect/index.ts +4 -4
  6. package/src/core/constants.ts +3 -3
  7. package/src/core/normalize.ts +2 -2
  8. package/src/create/index.ts +1 -1
  9. package/src/daemon/index.ts +5 -5
  10. package/src/daemon/main.ts +9 -9
  11. package/src/enable/index.ts +19 -18
  12. package/src/enable/provisionCommand.ts +10 -10
  13. package/src/identity/index.ts +2 -2
  14. package/src/identity/profileStandard.ts +8 -8
  15. package/src/init/index.ts +20 -13
  16. package/src/install/index.ts +2 -2
  17. package/src/install/signing.ts +3 -4
  18. package/src/launch/adapters/claude.ts +7 -7
  19. package/src/launch/adapters/codex.ts +5 -6
  20. package/src/launch/canary.ts +8 -8
  21. package/src/launch/cmdlog.ts +3 -3
  22. package/src/launch/composeSystemPrompt.ts +2 -1
  23. package/src/launch/index.ts +5 -6
  24. package/src/launch/invocation.ts +1 -1
  25. package/src/launch/launchd.ts +14 -15
  26. package/src/launch/launchdRun.ts +6 -6
  27. package/src/launch/nativeMemory.ts +9 -9
  28. package/src/launch/ptyHost.ts +1 -1
  29. package/src/launch/readyGateModel.ts +3 -3
  30. package/src/launch/types.ts +7 -7
  31. package/src/lifecycle/eventlog.ts +2 -2
  32. package/src/lifecycle/index.ts +21 -21
  33. package/src/lifecycle/queue.ts +1 -1
  34. package/src/onboard/index.ts +19 -13
  35. package/src/onboard/memory.ts +5 -5
  36. package/src/onboard/steps.ts +8 -9
  37. package/src/provision/index.ts +2 -3
  38. package/src/runtime/deploy.ts +2 -2
  39. package/src/runtime/index.ts +4 -4
  40. package/src/shadow/gate.ts +6 -6
  41. package/src/shadow/index.ts +2 -2
  42. package/src/status/index.ts +11 -11
  43. package/src/storage/index.ts +1 -1
  44. package/src/supervisor/daemon.ts +14 -8
  45. package/src/transport/index.ts +11 -11
  46. package/src/update/index.ts +4 -4
  47. package/src/cli/cli.test.ts +0 -603
  48. package/src/cli/listTui.test.ts +0 -71
  49. package/src/codec/codec.test.ts +0 -271
  50. package/src/connect/connect.test.ts +0 -163
  51. package/src/core/constants.test.ts +0 -32
  52. package/src/core/normalize.test.ts +0 -98
  53. package/src/create/create.test.ts +0 -143
  54. package/src/daemon/daemon-http.test.ts +0 -114
  55. package/src/daemon/daemon.test.ts +0 -267
  56. package/src/daemon/main.test.ts +0 -413
  57. package/src/enable/enable.test.ts +0 -95
  58. package/src/enable/provisionCommand.test.ts +0 -107
  59. package/src/identity/identity.test.ts +0 -279
  60. package/src/identity/profileStandard.test.ts +0 -204
  61. package/src/init/init.test.ts +0 -213
  62. package/src/init/runtime-resolve.test.ts +0 -49
  63. package/src/install/install.test.ts +0 -66
  64. package/src/install/signing.test.ts +0 -84
  65. package/src/launch/bootdeliver.test.ts +0 -108
  66. package/src/launch/bootstrap.test.ts +0 -56
  67. package/src/launch/canary.test.ts +0 -346
  68. package/src/launch/cmdlog.test.ts +0 -94
  69. package/src/launch/codexHooksTrust.test.ts +0 -248
  70. package/src/launch/composeSystemPrompt.layers.test.ts +0 -445
  71. package/src/launch/composeSystemPrompt.test.ts +0 -145
  72. package/src/launch/hostComposerOccupied.test.ts +0 -63
  73. package/src/launch/invocation.test.ts +0 -174
  74. package/src/launch/launch.test.ts +0 -359
  75. package/src/launch/launchd.test.ts +0 -499
  76. package/src/launch/nativeMemory.test.ts +0 -193
  77. package/src/launch/ptyHost.test.ts +0 -38
  78. package/src/launch/readyGateModel.test.ts +0 -72
  79. package/src/launch/sockdir.test.ts +0 -74
  80. package/src/lifecycle/eventlog.test.ts +0 -114
  81. package/src/lifecycle/lifecycle.test.ts +0 -1056
  82. package/src/lifecycle/queue.test.ts +0 -185
  83. package/src/onboard/memory.test.ts +0 -157
  84. package/src/onboard/onboard.test.ts +0 -39
  85. package/src/onboard/steps.test.ts +0 -201
  86. package/src/provision/provision.test.ts +0 -288
  87. package/src/registry/registry.test.ts +0 -432
  88. package/src/runtime/runtime.test.ts +0 -226
  89. package/src/runtime/update.test.ts +0 -192
  90. package/src/shadow/enumerate-skip.test.ts +0 -67
  91. package/src/shadow/gate.test.ts +0 -286
  92. package/src/shadow/install.test.ts +0 -153
  93. package/src/shadow/shadow.test.ts +0 -42
  94. package/src/status/status.test.ts +0 -208
  95. package/src/storage/peers-home.test.ts +0 -34
  96. package/src/storage/rotatelog.test.ts +0 -44
  97. package/src/storage/storage.test.ts +0 -65
  98. package/src/supervisor/attached-marker.test.ts +0 -84
  99. package/src/supervisor/boot.test.ts +0 -66
  100. package/src/supervisor/client.attach.test.ts +0 -107
  101. package/src/supervisor/daemon.test.ts +0 -213
  102. package/src/supervisor/deliver.test.ts +0 -58
  103. package/src/supervisor/panelog.test.ts +0 -95
  104. package/src/supervisor/protocol.test.ts +0 -222
  105. package/src/supervisor/selfargv.test.ts +0 -22
  106. package/src/supervisor/spinner-strip.test.ts +0 -52
  107. package/src/transport/compactDone.test.ts +0 -144
  108. package/src/transport/composerQueue.test.ts +0 -204
  109. package/src/transport/hostControl.test.ts +0 -87
  110. package/src/transport/hostDeliver.test.ts +0 -137
  111. package/src/transport/hostLive.test.ts +0 -50
  112. package/src/transport/routesend-wake.test.ts +0 -357
  113. package/src/update/update.test.ts +0 -208
package/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -22,8 +22,8 @@ iapeer держит AI-агентов как **живые интерактивн
22
22
 
23
23
  ## Документация
24
24
 
25
- Документация проекта — в [`docs/`](docs/README.md): продуктовая часть (что это и как пользоваться) и механика изнутри ([`docs/internals/`](docs/internals/README.md)). Этот репозиторий — кодовая реализация.
25
+ Документация проекта — в [`docs/`](https://github.com/agfpd/iapeer/tree/main/docs): продуктовая часть (что это и как пользоваться) и механика изнутри ([`docs/internals/`](https://github.com/agfpd/iapeer/tree/main/docs/internals)). Этот репозиторий — кодовая реализация.
26
26
 
27
27
  ## Статус
28
28
 
29
- Версия — **0.2.73**. Платформа — macOS/launchd.
29
+ Платформа — macOS/launchd. Актуальная версия — в `package.json` / `iapeer version`.
package/package.json CHANGED
@@ -1,7 +1,25 @@
1
1
  {
2
2
  "name": "@agfpd/iapeer",
3
- "version": "0.2.76",
3
+ "version": "0.2.78",
4
4
  "description": "Foundation core for the iapeer multi-agent ecosystem: identity, registry, storage, codec.",
5
+ "license": "Apache-2.0",
6
+ "author": "agfpd",
7
+ "homepage": "https://github.com/agfpd/iapeer#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/agfpd/iapeer.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/agfpd/iapeer/issues"
14
+ },
15
+ "keywords": [
16
+ "multi-agent",
17
+ "agents",
18
+ "mcp",
19
+ "ipc",
20
+ "launchd",
21
+ "bun"
22
+ ],
5
23
  "type": "module",
6
24
  "bin": {
7
25
  "iapeer": "bin/iapeer"
@@ -9,7 +27,8 @@
9
27
  "files": [
10
28
  "src",
11
29
  "bin",
12
- "tsconfig.json"
30
+ "tsconfig.json",
31
+ "!src/**/*.test.ts"
13
32
  ],
14
33
  "exports": {
15
34
  ".": "./src/index.ts",
package/src/cli/index.ts CHANGED
@@ -102,7 +102,7 @@ export interface PeerListing {
102
102
  /** The peer's working directory (registry fact). Machine-readable so host-local
103
103
  * tooling (e.g. the memory provider's init/verify rendering doctrine into
104
104
  * <cwd>/.iapeer/) keys on the REGISTRY instead of copying the layout default —
105
- * a layout change must not silently strand consumers (iapeer-memory ask, 10.06). */
105
+ * a layout change must not silently strand consumers. */
106
106
  cwd: string
107
107
  runtimes: RuntimeStatus[]
108
108
  }
@@ -235,8 +235,8 @@ export function stopPeer(personality: string, runtime: string | undefined, opts:
235
235
  killSession(sock, identity)
236
236
  out.push({ personality, runtime: rt, action: 'bootout', reason: r.status === 0 ? undefined : `launchctl bootout exited ${r.status}${(r.stderr ?? '').trim() ? `: ${(r.stderr ?? '').trim()}` : ''}` })
237
237
  } else {
238
- // A deliberate stop is a CLEAN PARK, not a death (boris 10.06 — stop→start
239
- // must survive ≥ idle-reap): park-mark BEFORE the kill so the post-`start`
238
+ // A deliberate stop is a CLEAN PARK, not a death (stop→start must survive ≥
239
+ // idle-reap): park-mark BEFORE the kill so the post-`start`
240
240
  // wake RESUMES, and drop the supervise session-state with the session so
241
241
  // the tick never tags this kill as a death (crash-loop ring stays clean,
242
242
  // no reaped-gone death class for a state the daemon knows 100%).
@@ -268,8 +268,8 @@ export function startPeer(personality: string, runtime: string | undefined, opts
268
268
  const identity = buildProcessAddress(rt, personality)
269
269
  if (isInfraRuntime(rt)) {
270
270
  const plist = launchdPlistPath(personality, env)
271
- // UNDEAD-JOB-SAFE start (boris's connect-acceptance find 10.06): a bootstrap
272
- // right after a bootout used to hit the still-dismantling job (exit 5 I/O
271
+ // UNDEAD-JOB-SAFE start: a bootstrap right after a bootout used to hit the
272
+ // still-dismantling job (exit 5 I/O
273
273
  // error) and leave the router DOWN. launchctlBootstrap now waits for the
274
274
  // job to vanish and retries with backoff (~22 s budget); a failure after
275
275
  // every attempt is LOUD with the manual rescue recipe. (Also gains the
@@ -300,8 +300,8 @@ export interface AddRuntimeOutcome {
300
300
 
301
301
  /**
302
302
  * add-runtime <runtime> (--peer <p> | --all) — give EXISTING peers an additional
303
- * AGENTIC runtime in one command (codex-parity audit, директива Артура 12.06: the
304
- * fleet-switch enabler — 14/23 peers were claude-only with nothing to switch to).
303
+ * AGENTIC runtime in one command (the fleet-switch enabler — a claude-only peer
304
+ * has nothing to switch to).
305
305
  * Per target: initPeer({cwd, runtime}) — ensurePeerProfile MERGES runtimes (the
306
306
  * default_runtime lever is deliberately untouched — capability ≠ routing flip; see
307
307
  * `default-runtime`), scaffolds the runtime scope, and the codex side runs its
@@ -325,8 +325,8 @@ export async function addRuntime(
325
325
  if (targets.length === 0) throw new Error(opts.peer ? `peer "${opts.peer}" is not registered` : 'no targets — pass --peer <p> or --all')
326
326
  // CROSS-PEER operation: strip the CALLER's identity env (PEER_*) — an operator
327
327
  // (or an agent peer) running this from inside their own session would otherwise
328
- // poison the TARGET's ensurePeerProfile identity check (live-caught on the very
329
- // first 0.2.45 probe: PEER_PERSONALITY="iapeer" vs target "twpar" → failed).
328
+ // poison the TARGET's ensurePeerProfile identity check (the caller's
329
+ // PEER_PERSONALITY would mismatch the target personality → failed).
330
330
  const cleanEnv: NodeJS.ProcessEnv = { ...env }
331
331
  delete cleanEnv.PEER_PERSONALITY
332
332
  delete cleanEnv.PEER_RUNTIME
@@ -353,8 +353,8 @@ export async function addRuntime(
353
353
  // Self-heal the registry from the locals: provisionPeer's upsert sets the record's
354
354
  // default to the PROVISIONED runtime («args.runtime wins» — right for births, wrong
355
355
  // here: add-runtime is capability-only and must NOT flip routing). The reindex
356
- // REPLACE projection restores the local profile's untouched default (live-caught
357
- // on the 0.2.45 probe: registry default flipped to codex while the local kept claude).
356
+ // REPLACE projection restores the local profile's untouched default (otherwise
357
+ // the registry default flips to the added runtime while the local keeps its own).
358
358
  if (out.some(o => o.action === 'added')) await reindexFromLocals({ env })
359
359
  return out
360
360
  }
@@ -367,8 +367,8 @@ export interface DefaultRuntimeOutcome {
367
367
 
368
368
  /**
369
369
  * default-runtime <runtime> (--peer <p> | --all) — flip the PRIMARY lever
370
- * (contract Идентичность: primary держит default_runtime, НЕ порядок runtimes[];
371
- * linus precedent 11.06). This is the routing/wake/first-launch default — the
370
+ * (contract Идентичность: primary держит default_runtime, НЕ порядок runtimes[]).
371
+ * This is the routing/wake/first-launch default — the
372
372
  * actual fleet-switch moment is a mass flip of exactly this field. The local
373
373
  * profile is rewritten through the H1 merge-writer (default_runtime + the legacy
374
374
  * in-sync mirror; normalizeRuntimes re-prepends the new default), then the
@@ -432,7 +432,7 @@ export interface NewPeerOutcome {
432
432
 
433
433
  /**
434
434
  * new <peer> [runtime] — the UNCONDITIONAL fresh-restart control command
435
- * (docs/Control-команды §new; постановка boris 01:32 12.06, санкция Артура).
435
+ * (docs/Control-команды §new).
436
436
  *
437
437
  * The emergency lever for a HUNG or dead agent session: /alias-new covers only
438
438
  * the COOPERATIVE path (a live peer reads the expanded prompt and runs
@@ -444,7 +444,7 @@ export interface NewPeerOutcome {
444
444
  * wakeOrSpawn(resume:false, task:'') — fresh BY CONSTRUCTION, the same recipe
445
445
  * as the eager relaunch (the C2 initial_prompt seeds the first turn).
446
446
  *
447
- * exit-0 contract (сверка telegram-runtime): success ⟺ the fresh session is UP
447
+ * exit-0 contract: success ⟺ the fresh session is UP
448
448
  * and READY (verified by the wake's ready gate, not merely scheduled) — for a
449
449
  * sleeping, dead AND hung target alike. Duration is a real TUI boot: typically
450
450
  * 5–30 s, bounded by cfg.bootDeadlineSecs. Idempotent in effect: each repeat
@@ -645,7 +645,7 @@ export interface RemoveOutcome {
645
645
  reason?: string
646
646
  /** The removed peer's cwd (registry fact, captured BEFORE the removal). remove
647
647
  * deliberately keeps the folder — user data is never deleted by a registry reap
648
- * (boris's finding 10.06: say so in the output instead of leaving silent orphans). */
648
+ * (say so in the output instead of leaving silent orphans). */
649
649
  cwd?: string
650
650
  /** v1.2: per-runtime unprovision outcomes (`<rt>:<state>`), present when the
651
651
  * slot declares an unprovision command (occasion=remove ran before the purge). */
@@ -660,8 +660,8 @@ export interface RemoveOutcome {
660
660
  codexHooksTrust?: string
661
661
  /** Identity-keyed lifecycle artifacts purged with the record (state/lifecycle/
662
662
  * `<identity>.*` per runtime). Without this purge a NEWBORN peer reusing the
663
- * personality inherits the dead namesake's parking (live defect, boris 10.06:
664
- * stale .stopped → `mode=refused cause=stopped` on a freshly-created peer). */
663
+ * personality inherits the dead namesake's parking (defect: stale .stopped →
664
+ * `mode=refused cause=stopped` on a freshly-created peer). */
665
665
  purgedState?: string[]
666
666
  }
667
667
 
@@ -734,7 +734,7 @@ export async function removePeerCli(
734
734
  unprovisionOutcomes.push(`failed: ${e instanceof Error ? e.message : String(e)}`)
735
735
  }
736
736
  // Codex pre-trust cleanup (reap-side counterpart of the birth-time
737
- // preTrustCodexCwd; backlog made live by D4 11.06): a removed codex peer must
737
+ // preTrustCodexCwd): a removed codex peer must
738
738
  // not leave its cwd trusted in the host ~/.codex/config.toml forever. After
739
739
  // unprovision (the provider sees the peer's last consistent state first),
740
740
  // best-effort like everything else on this path.
@@ -800,7 +800,7 @@ export async function sendMessage(
800
800
  ): Promise<{ ok: true; delivered_to: { personality: string; runtime: string }; queued?: boolean; queueDepth?: number }> {
801
801
  const env = opts.env ?? process.env
802
802
  const caller = resolveCallerIdentity(parseIdentity(opts.from), readPeersIndex({ env }))
803
- // wake_policy:ephemeral M3 parity (iapeer-memory ask, 10.06): the CLI path used
803
+ // wake_policy:ephemeral M3 parity: the CLI path used
804
804
  // to route an ephemeral target through the normal live/miss path — a notifier
805
805
  // burst landed as TURNS in one live worker session instead of serializing
806
806
  // through the disk FIFO the daemon path uses. Same seam, ONE difference: the
@@ -822,12 +822,12 @@ export async function sendMessage(
822
822
  },
823
823
  // noteLiveTopic — CLI-path parity (same seam the daemon wires): a live delivery
824
824
  // through the CLI fallback must update the target's .topic marker too, or a
825
- // daemon-restart-window send re-opens the stale-marker false-fresh (defect 11.06).
825
+ // daemon-restart-window send re-opens the stale-marker false-fresh.
826
826
  { wake: cliWake, ephemeral: makeEphemeralRouteDeps(cfg, env, () => {}), noteLiveTopic: makeNoteLiveTopic(cfg, env) },
827
827
  )
828
- // delivery.log sink — CLI-path parity (boris's observability gap 10.06: enqueues
829
- // routed through the CLI left to=<peer> at ZERO for the day while real wakes
830
- // happened; the daemon tool-path logs, this path was blind). Same fields, plus
828
+ // delivery.log sink — CLI-path parity (observability gap: enqueues routed
829
+ // through the CLI left to=<peer> at ZERO while real wakes happened; the daemon
830
+ // tool-path logs, this path was blind). Same fields, plus
831
831
  // path=cli so the two entry points are distinguishable. Both branches logged.
832
832
  const { appendDeliveryEvent } = await import('../daemon/deliverylog.ts')
833
833
  appendDeliveryEvent(cfg.eventLogDir, {
@@ -849,10 +849,10 @@ export async function sendMessage(
849
849
  err: result.ok ? undefined : result.error.message,
850
850
  })
851
851
  if (!result.ok) throw new Error(result.error.message)
852
- // M2 arm-on-outbound — CLI-path parity (live gap 10.06: an ephemeral worker's
853
- // final reply sent through the CLI fallback — e.g. inside a daemon-restart
854
- // window, four deploys that day — never armed, so the worker idled to the
855
- // unarmed bound and stalled its FIFO). Same hook the daemon path uses; ONLY on
852
+ // M2 arm-on-outbound — CLI-path parity (gap: an ephemeral worker's final reply
853
+ // sent through the CLI fallback — e.g. inside a daemon-restart window — never
854
+ // armed, so the worker idled to the unarmed bound and stalled its FIFO). Same
855
+ // hook the daemon path uses; ONLY on
856
856
  // an ok outcome, errors swallowed (arming is best-effort, never fails the send).
857
857
  try {
858
858
  makeArmEphemeralOnDelivered(cfg)(caller)
@@ -976,7 +976,7 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
976
976
  out(r.noop ? 'onboard: no marketplace changes (already configured / dry-run)\n' : 'onboard: marketplace(s) registered\n')
977
977
  let infraFailed = false
978
978
  const infra = typeof flags.infra === 'string' ? flags.infra.split(',').map(s => s.trim()).filter(Boolean) : []
979
- // Backbone default-yes steps (design «Onboard костяка», FINAL 10.06). ORDER is
979
+ // Backbone default-yes steps (design «Onboard костяка»). ORDER is
980
980
  // significant: notifier → TELEGRAM (creates the human peer) → memory below
981
981
  // (its --human resolves from the natural peer that just appeared). Each step
982
982
  // is soft-skip on unavailability; only a REAL deploy/create break fails.
@@ -1025,7 +1025,7 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
1025
1025
  } else if (infra.length) {
1026
1026
  out(`onboard --dry-run: would onboard infra runtimes: ${infra.join(', ')}\n`)
1027
1027
  }
1028
- // Memory slot (контракт «Слот памяти», 10.06): optional DEFAULT-YES install of
1028
+ // Memory slot (контракт «Слот памяти»): optional DEFAULT-YES install of
1029
1029
  // the default provider; its own init runs with INHERITED stdio (the provider
1030
1030
  // owns the install questions). The step is REPORT-ONLY for the exit code — an
1031
1031
  // empty slot is a valid state regardless of why.
@@ -1354,9 +1354,9 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
1354
1354
  return 1
1355
1355
  }
1356
1356
  case 'start': {
1357
- // --all re-enables every REGISTERED peer (mirror of `stop --all` — the 11.06
1358
- // incident: bringing a stopped fleet back required a manual loop over ~25
1359
- // peers). Enumeration is the registry, so unregistered garbage (stray flag
1357
+ // --all re-enables every REGISTERED peer (mirror of `stop --all` — without
1358
+ // it, bringing a stopped fleet back required a manual loop over every
1359
+ // peer). Enumeration is the registry, so unregistered garbage (stray flag
1360
1360
  // files for identities no record claims) is never touched. NOTE: for warm
1361
1361
  // peers this clears the stop flag only — no session is launched; each peer
1362
1362
  // becomes wakeable and the daemon brings its session up on the first message.
@@ -1390,13 +1390,13 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
1390
1390
  if (o.codexHooksTrust) {
1391
1391
  out(`codex hooks trust: ${o.codexHooksTrust}\n`)
1392
1392
  }
1393
- // Stale identity-keyed markers must die with the record (boris 10.06: a
1394
- // namesake newborn inherited a dead peer's .stopped → refused to wake).
1393
+ // Stale identity-keyed markers must die with the record (a namesake
1394
+ // newborn inherited a dead peer's .stopped → refused to wake).
1395
1395
  if (o.purgedState?.length) {
1396
1396
  out(`lifecycle state purged: ${o.purgedState.join(', ')}\n`)
1397
1397
  }
1398
1398
  // Deliberate: the registry reap never deletes user data — but SAY so, or
1399
- // the default-location peers leave silent orphan folders (boris 10.06).
1399
+ // the default-location peers leave silent orphan folders.
1400
1400
  if (o.cwd && existsSync(o.cwd)) {
1401
1401
  out(`folder kept: ${o.cwd} (remove never deletes peer data — \`rm -rf\` it yourself if it was a throwaway)\n`)
1402
1402
  }
@@ -1586,10 +1586,10 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
1586
1586
  return await runAlwaysOn(positionals[0], positionals[1], process.cwd())
1587
1587
  }
1588
1588
  case 'self-done': {
1589
- // SILENT-FINISH self-call for an ephemeral worker (контракт ЖЦ §wake_policy;
1590
- // развилка boris 10.06): a worker whose task produced NOTHING to send must
1591
- // still release its M3 FIFO — but an EMPTY report would violate Артур's
1592
- // invariant «событие-всё-отфильтровано = тишина» (no empty wakes of the
1589
+ // SILENT-FINISH self-call for an ephemeral worker (контракт ЖЦ §wake_policy):
1590
+ // a worker whose task produced NOTHING to send must still release its M3
1591
+ // FIFO — but an EMPTY report would violate the invariant
1592
+ // «событие-всё-отфильтровано = тишина» (no empty wakes of the
1593
1593
  // target). This verb is the non-waking arm: it sets the worker's OWN
1594
1594
  // .ephemeral-armed (same marker the ok-outbound hook sets), so the quiet
1595
1595
  // window reaps it within seconds and the drain feeds the next task — nobody
@@ -1610,10 +1610,9 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
1610
1610
  setEphemeralArmed(cfg, identity)
1611
1611
  // The ephemeral check keys on the peer's CANONICAL cwd (registry), NOT on
1612
1612
  // process.cwd(): the verb is invoked from wherever the agent's shell
1613
- // happens to be (scriber lives in the vault half the time), and a foreign
1614
- // cwd made this warning LIE — «marker is inert» on a genuinely ephemeral
1615
- // peer (live case scriber 11.06: the false warning sent doc/scriber down a
1616
- // wrong root-cause chase). The marker itself was never affected — it is
1613
+ // happens to be, and a foreign cwd made this warning LIE — «marker is
1614
+ // inert» on a genuinely ephemeral peer (the false warning sends the reader
1615
+ // down a wrong root-cause chase). The marker itself was never affected — it is
1617
1616
  // identity-keyed and supervise checks the SESSION's canonical cwd.
1618
1617
  const addr = parseSessionName(identity)!
1619
1618
  const canonicalCwd = findPeer(readPeersIndex({ env }), addr.personality)?.cwd ?? process.cwd()
@@ -1667,7 +1666,7 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
1667
1666
  return 0
1668
1667
  }
1669
1668
  case 'compact': {
1670
- // Dialogue control (UX directive 12.06): if the session is merely asleep
1669
+ // Dialogue control: if the session is merely asleep
1671
1670
  // after a clean idle-reap, resume the same dialogue and compact it; if there
1672
1671
  // is no resumable dialogue, fail honestly instead of compacting a fresh one.
1673
1672
  if (!positionals[0]) return usage(errOut)
@@ -1736,9 +1735,9 @@ export async function runCli(argv: string[], env: NodeJS.ProcessEnv = process.en
1736
1735
  return 1
1737
1736
  }
1738
1737
  out(`${r.woke ? 'woke + ' : ''}attaching ${r.identity}…\n`)
1739
- // Attach-window observability (killer-hunt 11.06: «была ли смерть под
1740
- // attach» was answerable only INDIRECTLY via wake cause=attach — i.e. only
1741
- // when the session was dead at attach time). Bracket the operator's client
1738
+ // Attach-window observability (whether a death happened under attach was
1739
+ // answerable only INDIRECTLY via wake cause=attach — i.e. only when the
1740
+ // session was dead at attach time). Bracket the operator's client
1742
1741
  // window in lifecycle.log: ev=attach at entry, ev=attach-end (with the tmux
1743
1742
  // client's exit code) when the operator detaches or the server dies under
1744
1743
  // the client. A death timestamp inside an attach…attach-end window now
@@ -1,5 +1,5 @@
1
- // connect — per-peer channel attachment in ONE flow (design «Onboard костяка» §(в),
2
- // FINAL 10.06; flow facts confirmed by the telegram-runtime owner against v0.10.3).
1
+ // connect — per-peer channel attachment in ONE flow (design «Onboard костяка» §(в);
2
+ // flow facts confirmed by the telegram-runtime owner against v0.10.3).
3
3
  // Namespace: `iapeer connect <channel> <peer>` — extensible to future channels;
4
4
  // v1 implements `connect telegram <peer> [--token <t>]`.
5
5
  //
@@ -184,8 +184,8 @@ export async function connectTelegram(opts: ConnectTelegramOptions): Promise<Con
184
184
  return { state: 'bot-add-failed', peer, detail: (add.stderr || add.stdout || `exit ${add.status}`).trim() }
185
185
  }
186
186
  // @username: the bots/<alias>/.env TELEGRAM_BOT_USERNAME field is the RELIABLE
187
- // source (present on the live host; survives a quiet bot-add stdout — boris's
188
- // acceptance saw the activation line degrade to the BotFather hint). stdout
187
+ // source (present on the live host; survives a quiet bot-add stdout — acceptance
188
+ // testing saw the activation line degrade to the BotFather hint). stdout
189
189
  // match stays as the fallback.
190
190
  const envAfterAdd = readBotEnv(alias, env)
191
191
  const envUser = envAfterAdd?.match(/^TELEGRAM_BOT_USERNAME=(.+)$/m)?.[1]?.trim()
@@ -18,12 +18,12 @@ export const PEERS_SCHEMA_VERSION = 2
18
18
  // 450 (was 250): self-documenting API-peer descriptions (notifier timer/watcher)
19
19
  // must fit "who the peer is + registration format + a live example" — dense full
20
20
  // texts run to ~408 chars; 250 cut them mid-word so the caller could not compose
21
- // the call. Bumped with Arthur's sanction (2026-06-08). NB: this is COMPILE-TIME
21
+ // the call. NB: this is COMPILE-TIME
22
22
  // baked — the live daemon re-clamps descriptions on read (registry parsePeerRecord),
23
23
  // so the running router keeps the OLD limit until restarted onto the new binary.
24
24
  export const MAX_DESCRIPTION_LEN = 450
25
25
 
26
- // Contract vocabulary (docs/Идентичность, Артур 05.06): the nature of the
26
+ // Contract vocabulary (docs/Идентичность): the nature of the
27
27
  // intelligence expressing itself through a runtime.
28
28
  // artificial — AI agent · natural — human · absent — programmatic source
29
29
  export const INTELLIGENCE_VALUES = ['artificial', 'natural', 'absent'] as const
@@ -127,7 +127,7 @@ export const DEFAULT_SOCK_DIR = '/tmp'
127
127
  // agree — a site that hardcodes DEFAULT_SOCK_DIR would look in /tmp while a sandbox
128
128
  // (IAPEER_SOCK_DIR set) created the session elsewhere → a false "offline".
129
129
  //
130
- // IAPEER_ROOT IMPLIES SOCKET ISOLATION (boris's e2e find 10.06): an alt-root used
130
+ // IAPEER_ROOT IMPLIES SOCKET ISOLATION: an alt-root used
131
131
  // to inherit the GLOBAL /tmp, so a sandboxed `list` saw PROD sessions live by name
132
132
  // collision, and a sandboxed stop/start would have HIT a prod session. A set root
133
133
  // now derives `<root>/socks` unless IAPEER_SOCK_DIR explicitly says otherwise; the
@@ -11,7 +11,7 @@
11
11
  // and system `uconv`/`iconv` are forbidden by the zone (OS-nondeterministic) and
12
12
  // absent here. `transliteration` is the one pure-JS engine that reproduces ICU
13
13
  // across WRITING SYSTEMS — CJK → pinyin WITH syllable spacing (项目 → "Xiang Mu"),
14
- // Cyrillic (Артур → "Artur"), Greek (Ω → "O"), Latin diacritics (Köln → "Koln") —
14
+ // Cyrillic (Привет → "Privet"), Greek (Ω → "O"), Latin diacritics (Köln → "Koln") —
15
15
  // and it bundles its own CLDR/unidecode-derived tables, so it is deterministic
16
16
  // across OSes (exactly the property the zone's iconv ban is protecting). It is the
17
17
  // deterministic CLDR-EQUIVALENT of ICU, NOT a literal ICU engine.
@@ -75,7 +75,7 @@ function slug(value: string): string {
75
75
  * derivation/comparison routes through (basename(cwd) → personality, PEER_*
76
76
  * comparisons, profile re-validation).
77
77
  *
78
- * IDEMPOTENT on already-valid names: normalize("boris") === "boris",
78
+ * IDEMPOTENT on already-valid names: normalize("alice") === "alice",
79
79
  * normalize("notifier-timer") === "notifier-timer" — required because
80
80
  * validatePersonality re-normalizes stored profile names.
81
81
  *
@@ -11,7 +11,7 @@
11
11
  // NO-CLOBBER: making the folder is mkdir-recursive (never deletes); init is
12
12
  // idempotent (profile kept, .mcp.json merged, doctrine never overwritten). The one
13
13
  // hard refusal: a target that already holds a DIFFERENT peer's profile — creating
14
- // "maria" into a folder that is already "boris" would either silently adopt boris or
14
+ // "alice" into a folder that is already "bob" would either silently adopt bob or
15
15
  // split an identity, so it fails loudly instead.
16
16
  //
17
17
  // INFRA (telegram human via operator-add / notifier function via a declared set):
@@ -79,7 +79,7 @@ export function resolveCallerFromHeader(value: string | undefined, index: PeersI
79
79
  // The roster of known peers is DELIBERATELY NOT in this description. It is rendered
80
80
  // ONCE, in the peer's system prompt (composeSystemPrompt → Layer 3 "## Known peers").
81
81
  // Embedding it here ALSO duplicated the full list into every agent's context on every
82
- // turn — a live consumer (boris) confirmed seeing the identical roster twice. The
82
+ // turn — confirmed live: an agent saw the identical roster twice. The
83
83
  // description stays light: purpose + parameter semantics only; the model gets the
84
84
  // roster from its system prompt. Likewise the MCP server-level `instructions` field is
85
85
  // left unset (createMcpServer) — it would re-inject doctrine into the client system
@@ -211,7 +211,7 @@ export async function callTool(
211
211
  // Ф-#8a: ONE durable outcome line per delivery attempt (delivery.log, sibling
212
212
  // to lifecycle.log) — metadata only, never the body. Both branches of the
213
213
  // routeSend result are recorded, so a suspected loss is reconstructable from
214
- // disk (the gap the 09.06 investigation hit). No-op when no dir is wired
214
+ // disk (the gap a delivery-loss investigation hit). No-op when no dir is wired
215
215
  // (library/test daemons); appendDeliveryEvent itself never throws.
216
216
  appendDeliveryEvent(deps.deliveryLogDir, {
217
217
  ev: 'delivery',
@@ -221,8 +221,8 @@ export async function callTool(
221
221
  ok: String(sent.ok),
222
222
  via: sent.ok ? `${sent.value.delivered_to.runtime}-${sent.value.delivered_to.personality}` : undefined,
223
223
  woke: sent.ok ? String(sent.value.woke) : undefined,
224
- // M3 queue observability (boris acceptance (a)): a queued accept is marked
225
- // and carries the queue depth at accept time — a stuck queue is visible.
224
+ // M3 queue observability: a queued accept is marked and carries the queue
225
+ // depth at accept time — a stuck queue is visible.
226
226
  queued: sent.ok && sent.value.queued ? 'true' : undefined,
227
227
  qkind: sent.ok ? sent.value.queuedBy : undefined,
228
228
  qd: sent.ok ? sent.value.queueDepth : undefined,
@@ -345,7 +345,7 @@ export interface StartDaemonOptions extends StorageOptions {
345
345
  * `Authorization: Bearer <token>` or it is rejected 401 BEFORE any MCP dispatch.
346
346
  * Unset → no auth (the same-uid unix-socket base / loopback default). This is the
347
347
  * structural layer for closing H8 on the TCP loopback listener — kept OFF until
348
- * Артур enables it (the production main reads IAPEER_BEARER_TOKEN). Loopback is
348
+ * explicitly enabled (the production main reads IAPEER_BEARER_TOKEN). Loopback is
349
349
  * broader than same-uid, so a token gates it without changing the on-wire MCP.
350
350
  */
351
351
  bearerToken?: string