session-peer 0.2.1 → 0.3.1

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/PARITY.md CHANGED
@@ -1,15 +1,17 @@
1
1
  # Python compatibility and npm migration
2
2
 
3
- Updated 2026-09-29 KST. Python reference: **1.0.2**,
3
+ Updated 2026-10-03 KST. Python reference: **1.0.2**,
4
4
  [`47c2371`](https://github.com/abruption/session-peer/tree/47c23713d0a2a3c11ebde6186afd8c43489b8b65/session_peer_core).
5
- This matrix describes **TS 0.2.1**: the 0.2.0 unified listing, safe home selection,
5
+ This matrix describes **TS 0.3.1**: the 0.2.0 unified listing, safe home selection,
6
6
  read-only doctor, text/help/positional input, Unicode 14.0.0 name matching and
7
- separately managed TS skill guidance (#16/#17/#18/#19/#25), plus the
8
- [0.2.1 reliability and hardening](#021-reliability-and-hardening) changes. Historical **0.1.0**
7
+ separately managed TS skill guidance (#16/#17/#18/#19/#25), the
8
+ [0.2.1 reliability and hardening](#021-reliability-and-hardening) changes, and the
9
+ [0.3.0 remote usability and maintenance](#030-remote-usability-and-maintenance)
10
+ changes with their known limitations. Historical **0.1.0**
9
11
  differences are called out explicitly. Public availability and tags must be
10
12
  checked in the registry; this document does not assert a publication outcome.
11
- SSH endpoints require the same version; unreleased source builds also require
12
- the same commit. `referenceVersion: "1.0.2"` identifies the comparison baseline,
13
+ SSH endpoints require the same version; builds from source between releases also
14
+ require the same commit. `referenceVersion: "1.0.2"` identifies the comparison baseline,
13
15
  not complete parity. See [VALIDATION.md](VALIDATION.md) for dated evidence.
14
16
 
15
17
  ## Feature and command matrix
@@ -27,9 +29,9 @@ not a missing implementation. Issue links describe work, not available features.
27
29
  | Implicit home / inactive queue | Select unique live home; explicit inactive opt-in under separate guards | Source: unique live selection; explicit saved inactive home with opt-in and verified inactive candidates. Public 0.1.0 has neither | Implemented in source for #17, 0.2.0; no wake/resume |
28
30
  | `doctor` | Readiness diagnostics; return-route check is opt-in | Source: read-only local/SSH metadata, per-agent/home results, capabilities and bounded TS skill compatibility. Published 0.1.0 has no doctor | Implemented in source for [#18](https://github.com/abruption/session-peer-ts/issues/18), 0.2.0; no return-route probing |
29
31
  | CLI input, help and names | Human text or JSON; positional or named/stdin message; Unicode casefold matching | 0.2.0: explicit JSON/text format, positional/named/stdin body, command help, exact Unicode 14.0.0 casefold with PID for ambiguity | Implemented; [#19](https://github.com/abruption/session-peer-ts/issues/19), 0.2.0. Published 0.1.0 help still says “preview”; source help now describes unified list |
30
- | From / Reply-To | Caller detection, automatic return-route metadata, structured URI resolution | From uses Codex environment UUID only; explicit `--reply-address`; local/SSH Reply-To URI parsing with conflict checks | Partial; [#21](https://github.com/abruption/session-peer-ts/issues/21), 0.3.0 |
31
- | SSH | Python source streamed to POSIX remote Python; multiple hosts/options/host metadata | Same-version installed TS CLI required; one host; strict preflight; JSON stdin; explicit Windows PowerShell path | Partial; [#20](https://github.com/abruption/session-peer-ts/issues/20) hosts/options, [#23](https://github.com/abruption/session-peer-ts/issues/23) deployment/version design, 0.3.0 |
32
- | Updates | Cached advisory client/skill notices; explicit manager-aware update commands | No update cache/command; `--no-update-notice` accepted as a no-op | Planned [#22](https://github.com/abruption/session-peer-ts/issues/22), 0.3.0 |
32
+ | From / Reply-To | Caller detection, automatic return-route metadata, structured URI resolution | 0.2.1 and earlier: From uses Codex environment UUID only; explicit `--reply-address`; local/SSH Reply-To URI parsing with conflict checks. 0.3.0: Claude/Codex sender detection, generated routes, `--reply-to`, same-user self normalization, Tailscale routing hint and `doctor --check-return-route` ([details](#sender-context-and-return-routes-unreleased-source)) | Implemented for [#21](https://github.com/abruption/session-peer-ts/issues/21); no Antigravity identity, no executable `Reply:` line, 0.3.0 |
33
+ | SSH | Python source streamed to POSIX remote Python; multiple hosts/options/host metadata | Same-version installed TS CLI required; strict preflight; JSON stdin; explicit Windows PowerShell path. 0.3.0: ordered repeated `--host`, allowlisted `--ssh-opt`, typed single-hop `--ssh-jump` (POSIX clients), IPv6 literals and `sshUser`/`sshUserSource` ([details](#multi-host-ssh-and-connection-options-unreleased-source)) | Partial; [#20](https://github.com/abruption/session-peer-ts/issues/20) (no arbitrary options or multi-hop; `--ssh-jump` refused on Windows clients; Tailscale routing hint in #21), [#23](https://github.com/abruption/session-peer-ts/issues/23) deployment/version design ([proposed ADR](docs/design/remote-deployment.md)), 0.3.0 |
34
+ | Updates | Cached advisory client/skill notices (on by default); GitHub release check; standalone self-update and remote push; package-manager guidance | 0.3.0: `update --check` reads npm dist-tags (`latest`/`preview`) with installation-manager guidance; no self-update or remote update; cached client notices are opt-in (`SESSION_PEER_UPDATE_NOTICE=1`), honor `--no-update-notice`/`SESSION_PEER_NO_UPDATE_NOTICE`; no skill notices. 0.2.1 only accepts `--no-update-notice` as a no-op | Partial for [#22](https://github.com/abruption/session-peer-ts/issues/22), 0.3.0; [update boundaries](#source-update-checks--22) |
33
35
  | Reusable execution API | Agent/transport capability adapters | Package root exposes pure protocol helpers only; no general typed execution API | Planned [#24](https://github.com/abruption/session-peer-ts/issues/24), Future — Agent integrations |
34
36
  | Skill guidance/setup | Companion `session-peer` skill targets Python | Separate `session-peer-ts` companion PR and exact-commit setup; baseline/version/help gates | Source [#25](https://github.com/abruption/session-peer-ts/issues/25), 0.2.0; no tag/publish |
35
37
  | MCP | Optional extra, restricted destinations; separate wake permission | Unsupported | Planned [#26](https://github.com/abruption/session-peer-ts/issues/26), Future — Agent integrations |
@@ -55,8 +57,12 @@ Source anchors at the baselines:
55
57
  | `CLAUDE_CONFIG_DIR`, `ANTHROPIC_CONFIG_DIR` | Claude config precedence: first nonempty value in that order, otherwise `~/.claude`. No Codex home is required for Claude listing. |
56
58
  | `CODEX_HOME`, default `~/.codex`, macOS Orca account homes | Source: bounded automatic Codex listing and writer safety inventory. Codex send selects a unique stable live home, or validates the explicit home against all competitors. Published 0.1.0 requires it for Codex list too. No recursive disk scan. |
57
59
  | `SESSION_PEER_CODEX_HOMES` | Source: JSON array of absolute or `~/` paths adds required listing homes and writer candidates. Invalid list configuration is rejected as a whole with other sources preserved; send keeps fail-closed inventory. Published 0.1.0 uses it only for writer checks. |
58
- | `CODEX_THREAD_ID`, `CODEX_SESSION_ID` | Valid UUID enables default From metadata; `--no-from` disables it. Claude/Antigravity caller detection is not implemented. |
59
- | Reply/update/Relay settings from Python | No blanket compatibility. Only the flags and environment reads in the TS baseline above are implemented. Do not infer a route or permission from an environment variable or From header. |
60
+ | `CODEX_THREAD_ID`, `CODEX_SESSION_ID` | Valid UUID enables default From metadata; `--no-from` disables it. 0.3.0: two different values, or Claude evidence at the same time, give no identity. |
61
+ | `CLAUDE_CODE_MESSAGING_SOCKET` | 0.3.0: must match exactly one live registered Claude session to give `From: claude:NAME` (PID when the name is not a unique printable target). Antigravity caller detection is not implemented. |
62
+ | `SESSION_PEER_REPLY_HOST`, `CC_PEER_REPLY_HOST` | 0.3.0: return host for generated Reply-To and `doctor --check-return-route`, after `--reply-to` and before the tailnet address. Invalid values are refused (`invalid_reply_host`). |
63
+ | `SESSION_PEER_TAILSCALE` | TS only, 0.3.0: `off` skips `tailscale status --json`, so every destination is ordinary SSH. |
64
+ | `SESSION_PEER_UPDATE_NOTICE`, `SESSION_PEER_NO_UPDATE_NOTICE`, `SESSION_PEER_CACHE_DIR`, `SESSION_PEER_UPDATE_REGISTRY` | 0.3.0 (#22): opt-in cached notices, opt-out (wins), absolute cache directory override, and npm registry mirror for update checks (HTTPS, or loopback HTTP; no credentials). Python's `XDG_CACHE_HOME` `update.json` is not read; TS uses its own `npm-update.json`. |
65
+ | Reply/update/Relay settings from Python | No blanket compatibility. Only the flags and environment reads above are implemented. Do not infer a route or permission from an environment variable or From header. |
60
66
  | Runtime and native dependency | TS needs Node 22.13+ within 22.x or Node 24.x, plus a matching native lock binary. Python is not a TS runtime fallback. |
61
67
  | CLI ownership | Both distributions install `session-peer`; npm does not remove Python/uv/pipx/venv installations. Select one path deliberately and update it through its owning manager. |
62
68
  | Skills | Install separately and explicitly; no package `postinstall` downloads a skill or invokes another package manager. |
@@ -110,6 +116,15 @@ are in [windows-contract.test.ts](https://github.com/abruption/session-peer-ts/b
110
116
  The Python oracle runs in POSIX CI; deterministic fixtures and injected filesystem
111
117
  failures run on Windows too. Error injection is not a real Windows ACL test.
112
118
 
119
+ ### Bounded Claude registry reads — source patch #99
120
+
121
+ 0.3.1 patch for #99: Claude list/send/sender discovery skips
122
+ non-regular, symlinked or larger-than-1-MiB registry records while retaining
123
+ healthy records. Descriptor checks, POSIX nonblocking open and bounded reads
124
+ cover FIFO replacement races. This is not a deadline for network-filesystem
125
+ I/O; doctor retains its separately bounded metadata contract. The patch is not
126
+ in the immutable npm 0.3.0 archive.
127
+
113
128
  ## JSON result compatibility
114
129
 
115
130
  Do not parse human messages or assume an optional key exists. Python's
@@ -127,11 +142,11 @@ TS normal envelopes have `schemaVersion`, `host`, `command`, `ok`, `version`,
127
142
  | `queueId` | Present if native queue stdout supplies an ID | Source #17: optional bounded native confirmation ID on successful queue only; absent in public 0.1.0 |
128
143
  | `codexHomeResolution` | Resolution diagnostics on Codex success and some refusals | Source #17: sanitized resolution on success and failures after resolution begins; private owner fingerprints remain internal. Absent in public 0.1.0 |
129
144
  | `remoteVersion` | Optional remote `list` metadata after version discovery (also update diagnostics); not universal on send | Absent; exact TS version banner must pass preflight; mismatch is a refusal |
130
- | `replyRoute`, `addressResolution` | Optional metadata when route advertised / Reply-To destination resolved | Absent; explicit envelope/URI support does not imply these JSON fields |
145
+ | `replyRoute`, `addressResolution` | Optional metadata when route advertised / Reply-To destination resolved | 0.2.1 and earlier: absent. 0.3.0: same names and values as Python for generated routes and URI destinations; an explicit `--reply-address` has no `replyRoute` |
131
146
  | `wake` | Optional, opt-in; failed activation may still have `submitted:true` and `ok:false` | Absent; unsupported option |
132
- | SSH metadata | Requested/resolved host and SSH metadata; multi-host list may be an array | Verified remote response adds `host`/`sshHost`; caught local SSH failure reports the local host; no host aggregation |
147
+ | SSH metadata | Requested/resolved host and SSH metadata; multi-host list may be an array | Verified remote response adds `host`/`sshHost`; caught local SSH failure for one host reports the local host. 0.3.0 adds `sshUser`/`sshUserSource` and returns an ordered array for repeated `--host` (see #20 section); with a resolved Tailscale peer, `host` is its MagicDNS name and `sshHost` the requested alias (#21) |
133
148
  | `error`, `retryAllowed` | Error/detail fields vary by path; submission may already have happened | Fixed error codes, caught failure has `retryAllowed:false`; native stderr/message body are not copied into errors |
134
- | `clientUpdate`, `skillUpdates` | Optional advisory notice metadata | Absent |
149
+ | `clientUpdate`, `skillUpdates` | Optional advisory notice metadata | 0.3.0 (#22): client-local. Added by the invoking client to a flat (single-result) `list`/`send`/`doctor` JSON result, including a single `--host` result that failed or is unknown, when notices are opted in and a fresh npm cache shows a newer stable version. Never inside a repeated `--host` array, never on top-level parse/local caught failures, never produced by a `--stdio-request` receiver; a remote-supplied `clientUpdate` is dropped. It never changes status, exit code, consumption or retry decisions. `skillUpdates` absent |
135
150
 
136
151
  An **absent** submission field is not `false`; `null` is not `false` either.
137
152
  Check `ok`, command, status, exit code and presence separately. TS unknown means
@@ -150,7 +165,7 @@ Output sources: TS CLI/send above; Python
150
165
 
151
166
  | Boundary | Python 1.0.2 | TS (source differences noted) |
152
167
  | --- | --- | --- |
153
- | Remote prerequisite | POSIX-compatible remote shell and usable Python; source delivered over stdin. Native Windows destination is not this SSH path | Installed same-version TS CLI + supported Node/native dependency. POSIX shell by default; explicit `--remote-platform win32` uses PowerShell and a `.cmd` launcher |
168
+ | Remote prerequisite | POSIX-compatible remote shell and usable Python; source delivered over stdin. Native Windows destination is not this SSH path | Installed same-version TS CLI + supported Node/native dependency. POSIX shell by default; explicit `--remote-platform win32` uses PowerShell and a `.cmd` launcher. Provisioning and a separate compatibility contract are proposed, not implemented, in the [remote deployment ADR](docs/design/remote-deployment.md) (#23) |
154
169
  | Message on SSH | Base64 body in quoted remote argv; source on stdin | Message in UTF-8 stdin JSON; PowerShell's encoded command contains launcher/flag, not the message |
155
170
  | Remote body/command | 90,000-character remote message cap; fully quoted UTF-8 SSH command capped at 131,071 bytes after base64/argument expansion | Stdin reader capped at 4,100,000 bytes, including JSON framing/escaping. No unlimited stream; OS argv limits still apply when invoking native queue |
156
171
  | General message | At most 1,000,000 characters; Codex at most 32 KiB UTF-8 | At most 1,000,000 Unicode code points; Codex at most 32,768 UTF-8 bytes; rejects blank/NUL |
@@ -194,8 +209,10 @@ Windows support, WSL/POSIX SSH and TS native Windows SSH are separate paths.
194
209
  `--remote-bin` where PATH is ambiguous; for Windows add
195
210
  `--remote-platform win32` and the `.cmd` path. Retain existing SSH host trust
196
211
  and authentication; a control socket is not new authorization. Account for
197
- the size limits above and lack of multi-host aggregation.
198
- 6. **Keep unsupported workflows on an explicit Python path.** Updates,
212
+ the size limits above. In TS 0.3.0, repeat `--host` for ordered per-host
213
+ results; the single-host result stays flat. TS 0.2.1 and earlier lacked
214
+ multi-host aggregation.
215
+ 6. **Keep unsupported workflows on an explicit Python path.** Remote updates,
199
216
  MCP, wake, Antigravity and paired devices need their existing implementation
200
217
  until their issues are delivered. Doctor is available in 0.2.0; 0.1.0 lacked this command. Updating npm does not update Python, skills,
201
218
  external Relay infrastructure or a remote host automatically. To return to
@@ -217,7 +234,8 @@ The implemented rows map to these repeatable checks:
217
234
  - [transport.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/transport.test.ts): real POSIX inbox, guarded queue, wrong/competing writer, unknown native outcome, inert Reply-To, host boundaries, SSH preflight/framing/loss.
218
235
  - [windows.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/windows.test.ts) and [windows-contract.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/windows-contract.test.ts): the bounded Windows native contracts described above.
219
236
  - [input-boundaries.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/input-boundaries.test.ts): exact 1,000,000-code-point / 32,768-byte message bounds, envelope overhead, 4,100,000-byte escaped JSON wire bound and invalid UTF-8 refusal. Python SSH limits are source-inspected here; these TS tests do not exercise the Python transport.
220
- - [types.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/types.test.ts), [package-smoke.ts](https://github.com/abruption/session-peer-ts/blob/main/test/package-smoke.ts), [release.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/release.test.ts): pure typed helpers, package/native loading, artifact and publication gates. They do not test future update/provisioning implementations.
237
+ - [types.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/types.test.ts), [package-smoke.ts](https://github.com/abruption/session-peer-ts/blob/main/test/package-smoke.ts), [release.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/release.test.ts): pure typed helpers, package/native loading, artifact and publication gates. package-smoke also checks installed-path update guidance without network or file changes.
238
+ - [updates.test.ts](https://github.com/abruption/session-peer-ts/blob/main/test/updates.test.ts): #22 update checks and notices against a local fixture registry (see below).
221
239
 
222
240
  Windows expansion belongs to [#34](https://github.com/abruption/session-peer-ts/issues/34);
223
241
  this matrix belongs to [#33](https://github.com/abruption/session-peer-ts/issues/33).
@@ -230,6 +248,7 @@ a release commitment. Recheck the exact packaged copy during release review.
230
248
 
231
249
  ## Source Codex home selection — #17 / 0.2.0
232
250
 
251
+
233
252
  This is 0.2.0 behavior; it does not change the immutable npm 0.1.0 archive. `send --to codex:UUID` selects only a unique stable live writer across
234
253
  bounded known homes. `--codex-home` pins the destination but still inventories
235
254
  competitors. A unique live writer without a saved row yields
@@ -280,6 +299,13 @@ changing successful queue status. Failed native processes never expose an ID.
280
299
  Contracts: `test/codex-homes.test.ts`, `test/transport.test.ts` and
281
300
  `test/windows-contract.test.ts`. These are fixtures, not real recipient ACKs.
282
301
 
302
+ ### UID-zero writer identity — source patch #100
303
+
304
+ 0.3.1 patch for #100: numeric UID 0 is a valid caller identity
305
+ for writer verification. Unknown or mismatched owners still refuse, and all
306
+ lock stability/start-time checks and Windows SID validation are retained.
307
+ This patch is not in the immutable npm 0.3.0 archive.
308
+
283
309
  ## Source read-only doctor — #18 / 0.2.0
284
310
 
285
311
  Evidence date: 2026-09-28. `doctor --json [--agent claude|codex]` supports local
@@ -414,3 +440,288 @@ command, transport or JSON field. Callers may notice the stricter refusals below
414
440
  | Windows batch shims (#57) | A `.cmd`/`.bat` executable found first on `PATH` (or given explicitly) is reported as `executable_unsupported` by `send` and `doctor`, because Node cannot spawn them without a shell and a shell would interpret the message. Use the native `codex.exe`. |
415
441
  | Envelope trimming (#59, #64) | Leading/trailing `\n` is trimmed by index scanning instead of `/^\n+\|\n+$/`, which was quadratic on long interior newline runs (CodeQL `js/polynomial-redos`). Trimming semantics are unchanged. |
416
442
  | Windows owner inspection (#65) | The compiling `Add-Type` owner inspection waits up to 20000 ms; the compile-free creation-time probe keeps 8000 ms. Timeouts still refuse. |
443
+
444
+ ## 0.3.1 reliability fixes
445
+
446
+ 0.3.1 source includes the following patch updates; publication is a separate
447
+ approved release operation. The dated public 0.3.0 evidence remains historical.
448
+
449
+ | Area | Patch contract |
450
+ |---|---|
451
+ | SSH results (#93, #97) | Malformed successful send responses affect only that host; other outcomes are preserved. Unnamed Claude PID targets accept `name:null`. Unknown outcomes are never retried automatically. |
452
+ | Codex storage (#94) | Parse TOML root keys, including escaped keys, with TOML semantics. Nested `sqlite_home` is not a root override; malformed configuration is refused. An inactive opt-in does not bypass the root storage guard. |
453
+ | Reply-To (#98) | Reject decoded Claude session values with reserved `codex:` or `session-peer:` prefixes; wire receivers reject unresolved nested URI transports before SSH or queue execution. |
454
+ | Claude discovery (#99) | Read bounded regular registry files, skip unsafe/oversized entries and preserve healthy sessions. POSIX FIFO/nonblocking and descriptor race tests are platform-specific evidence. |
455
+ | Writer identity (#100) | UID 0 is a valid verified identity; missing or malformed identity information remains refused. |
456
+ | Documentation (#90) | Includes the migration wording correction absent from the immutable public 0.3.0 archive. |
457
+
458
+ SSH still requires identical TS versions on both ends: 0.3.0 and 0.3.1 refuse
459
+ each other at preflight. Coordinate endpoint upgrades. The 0.3.0 known
460
+ limitations below remain: Windows-client jump routing, the Windows deployment
461
+ cell and newer receipt/recovery rules, and update notice validation gaps are
462
+ not resolved by this patch.
463
+
464
+ ## 0.3.0 remote usability and maintenance
465
+
466
+ 0.3.0 (#20, #21, #22, #74, #78/#79, #87; design #23) adds remote and
467
+ maintenance features to 0.2.1. Existing commands, exit codes and the delivery
468
+ boundaries (`posted`/`queued` are submission, never consumption or ACK) are
469
+ unchanged. SSH still requires the same version on both ends, so 0.2.1 and 0.3.0
470
+ endpoints refuse each other at preflight; upgrade them together.
471
+
472
+ | Area | 0.3.0 behavior |
473
+ | --- | --- |
474
+ | Multi-host SSH (#20) | Ordered repeated `--host` for `list`/`send`/`doctor` (array output for two or more), all hosts validated before any `ssh` starts, `duplicate_ssh_host`, IPv6 literals and `sshUser`/`sshUserSource`. See [details](#multi-host-ssh-and-connection-options--20--030) |
475
+ | Connection options (#20) | `--ssh-opt` is an allowlist (`-p`, `-l`, `-i`, `-o Port/User/IdentityFile/IdentitiesOnly`, `-4`, `-6`); everything else is refused. Typed single-hop `--ssh-jump USER@HOST[:PORT]` with a fixed hardened `ProxyCommand`, **POSIX clients only** |
476
+ | Sender context and return routes (#21) | Verified Claude/Codex sender identity (`From:`), generated structured Reply-To URIs, `--reply-to`, a Tailscale routing hint and opt-in `doctor --check-return-route`. No executable `Reply:` line. See [details](#sender-context-and-return-routes--21--030) |
477
+ | Update checks (#22) | `update --check` reads npm dist-tags once (3 s, no retries) and reports manager-specific guidance; nothing is installed. Cached client notices are **opt-in** (`SESSION_PEER_UPDATE_NOTICE=1`) and opt-out wins. See [details](#update-checks--22--030) |
478
+ | `sp` shorthand (#74) | Opt-in, shell-scoped Bash/zsh and PowerShell activation files; npm registers only `session-peer`. See [details](#optional-shorthand--74--030) |
479
+ | Bounded timeouts (#87) | On POSIX, external commands run in their own process group, and a timeout, output overflow or termination signal kills the whole group (including a jump `ProxyCommand`). On Windows only the direct child is killed; the call still returns at its deadline |
480
+ | Windows process probe (#78, #79) | The compile-free creation-time probe waits up to 15000 ms (was 8000 ms) after a CI cold-start timeout; the compiling owner inspection keeps 20000 ms. Timeouts still exclude the process |
481
+ | Remote deployment (#23) | Design only: a [proposed ADR](docs/design/remote-deployment.md) for Python-free deployment and version compatibility. No deployment code ships; the exact-version preflight is unchanged |
482
+
483
+ ### Known limitations in 0.3.0
484
+
485
+ - **#20 — Partial.** `--ssh-jump` is refused on Windows clients
486
+ (`ssh_jump_unsupported_platform`) until Win32-OpenSSH `ProxyCommand` behavior
487
+ is verified. No multi-hop and no arbitrary ssh options.
488
+ - **#23 — Partial.** The remote deployment ADR is a proposal. Its POSIX cell
489
+ was exercised by hand ([record](VALIDATION.md#remote-deployment-workflow-posix-cell-23-f5--2026-10-02-kst));
490
+ the Windows cell and the newer receipt and recovery rules are unvalidated.
491
+ - **Update notices (#22).** The Windows refresh, refresh-failure and
492
+ forged-`clientUpdate` (injection) cells are unverified; Windows CI covers only
493
+ the array/flat shape and one text stderr line. Those cases have POSIX fixture
494
+ evidence only.
495
+ - Fixture and CI evidence is not a live-agent ACK.
496
+
497
+ <a id="sender-context-and-return-routes-unreleased-source"></a>
498
+
499
+ ## Sender context and return routes — #21 / 0.3.0
500
+
501
+ 0.3.1 patch for #98: a Claude Reply-To URI whose decoded
502
+ `session` starts with reserved lowercase `codex:` or `session-peer:` is `invalid_reply_uri` before
503
+ local selection or SSH dispatch. Ordinary Claude names and Codex UUID routes
504
+ keep their existing contract; this patch is not in the immutable npm 0.3.0 archive.
505
+ Wire receivers require an already resolved target; an unresolved Reply-To URI
506
+ in `--stdio-request` is `nested_transport_forbidden` before queue or SSH calls.
507
+
508
+ [#21](https://github.com/abruption/session-peer-ts/issues/21) behavior added in
509
+ 0.3.0; 0.2.1 and earlier do not have it. Compared with Python
510
+ 1.0.2 `replies.py`/`diagnostics.py`:
511
+
512
+ | Area | Python 1.0.2 | TS source |
513
+ | --- | --- | --- |
514
+ | Claude sender | PID parsed from `CLAUDE_CODE_MESSAGING_SOCKET`, matched in the registry; name or PID | Same evidence. The match must be exactly one live row (exact socket match when the path has no PID). A name that is not unique by casefold, is all digits, contains `:` or a control character falls back to the PID |
515
+ | Codex sender | `CODEX_THREAD_ID`, else `CODEX_SESSION_ID`; `codexHome` from `CODEX_HOME` | Same, plus `codexHome` only for an absolute `CODEX_HOME`. Two different IDs give no identity |
516
+ | Nested agents | Claude wins over Codex variables | Both kinds of evidence give **no** identity (ambiguous), per #21 |
517
+ | From line | `From: agent:id @ user@host` with a local-hostname fallback | `From: agent:id` only. The return host appears only in the structured Reply-To |
518
+ | Reply-To | URI plus executable `Reply: python3 … send …` line | URI only; no executable line. Generated only with a sender; local sends without a configured host get `transport=local` |
519
+ | Host precedence | `--reply-to`, `SESSION_PEER_REPLY_HOST`, `CC_PEER_REPLY_HOST`, detected tailnet address; user added when missing | Same order. Detection reads only `tailscale status --json` (MagicDNS name, else 100.64.0.0/10 IPv4); no `tailscale ip`/`ip addr`/`ifconfig` scraping. `--reply-to` conflicts with `--reply-address`/`--no-reply-to` |
520
+ | Self normalization | User (if any) equals this user and host is local | The user is **required** and must equal this user, and the host must be an exact local form (`localhost`, canonical `127.x.y.z`, `::1`, `::ffff:127.x.y.z`, the host name or Tailscale self); non-canonical numerics and IPv4-compatible IPv6 (RFC 4291 section 2.5.5.1) never normalize to local. This strict predicate is separate from the fail-closed return-host refusal. Applies only when the route came from the URI alone (no `--host`/SSH options, including `--ssh-jump`) |
521
+ | Tailscale routing | Online peer: alias kept, `HostName`/`HostKeyAlias` added; offline/ambiguous refused; unknown unchanged; MagicDNS off means no lookup | Alias kept and `HostName` added only for `Online === true` with MagicDNS on. `HostKeyAlias` is added only when the same `ssh -G` used for `sshUser` read the config and found none; a configured alias is kept and an unread config is never overridden. `Online === false` is refused even with MagicDNS off; any other `Online` value is ordinary SSH. Status is queried at most once per command with a 3 s bound; `host` is the MagicDNS name and `sshHost` the requested alias. `SESSION_PEER_TAILSCALE=off` disables it. The macOS app CLI is used only when no `tailscale` is on `PATH` |
522
+ | Return-route probe | `doctor --check-return-route [--reply-to]`; fixed `true` command; `detail` may contain stderr | Same options plus `-T` and `ControlPath=none`. Fixed `exit 0` (a no-op in POSIX shells, cmd.exe and PowerShell; only POSIX return hosts have fixture coverage). The 8 s deadline covers the final `ssh` only; the Tailscale (3 s) and `ssh -G` (5 s) lookups are bounded separately. Same `returnRoute` statuses and reasons plus `return_host_is_receiver`; never includes stderr. With `--host`, a return host that might name a machine (fail closed, no DNS: localhost names, canonical 127.0.0.0/8 and 0.0.0.0/8, `::1`, `::`, `::ffff:`-mapped forms, IPv4-compatible IPv6 and every non-canonical numeric such as `127.1`, `0177.0.0.1`, `2130706433` or `4294967296`, whose meaning differs between resolvers) is `invalid_return_route` before SSH, on the receiver a known self name (exact OS host name or Tailscale self name/address, for any user; other DNS/LAN aliases are not detected) or an unprovable numeric form fails as `return_host_is_receiver` instead of normalizing to local, and the receiver gets only the return host through the JSON request. A remote send refuses a loopback or non-canonical numeric reply host (`invalid_reply_host`). Like every `ssh` this CLI starts, the probe and its `ssh -G` lookup use the probing machine's trusted ssh_config; see the #20 trust boundary |
523
+
524
+ Evidence: POSIX fake `ssh`/`tailscale` fixtures in `test/replies.test.ts`
525
+ (sender detection and ambiguity, name fallback, precedence and conflicts,
526
+ same-user/wrong-user self routes, offline/unknown/ambiguous peers, generated
527
+ and malformed URIs, probe argv and auth/host-key/timeout/other outcomes,
528
+ remote probe forwarding). A test preload sets `SESSION_PEER_TAILSCALE=off` and
529
+ clears `CLAUDE_CODE_MESSAGING_SOCKET`, `CODEX_THREAD_ID`, `CODEX_SESSION_ID` and the reply-host variables for every test; fixtures that need an identity set it explicitly. No real tailnet, SSH destination
530
+ or agent session was used.
531
+
532
+ <a id="multi-host-ssh-and-connection-options-unreleased-source"></a>
533
+
534
+ ## Multi-host SSH and connection options — #20 / 0.3.0
535
+
536
+ [#20](https://github.com/abruption/session-peer-ts/issues/20) behavior added in
537
+ 0.3.0; 0.2.1 and earlier do not have it. Compared with Python
538
+ 1.0.2 `--host`/`--ssh-opt`:
539
+
540
+ | Area | Python 1.0.2 | TS source |
541
+ | --- | --- | --- |
542
+ | Repeated `--host` | Ordered per-host loop; one host stays flat, several return a JSON array; any failure exits 1 | Same shape and order for `list`, `send` and `doctor`. Every element keeps `schemaVersion`, `ok`, `host` (as requested) and `command`. Any failed host makes the overall exit 1; a single host keeps its own 0/1/2 exit code |
543
+ | Malformed successful send response | No delivery may be inferred from an invalid response | A spawned send response with a missing or command-invalid target is `unknown` for that host (`submitted:null`, no retry); other host results remain intact. Target validation follows the requested agent and accepts the Python Claude shape without `target.agent`. Text output falls back to JSON for values that cannot be string-coerced, so formatting cannot turn an accepted send into a false command-wide refusal |
544
+ | Validation before dispatch | Host/option checks run inside the loop, so an earlier host may already be contacted. argparse syntax errors print usage to stderr (exit 2) without JSON; other pre-dispatch errors are attributed to each `--host` | Every host, `--ssh-opt`, message and remote option is validated before any `ssh` process starts (including `ssh -G`). TS always answers in JSON. Every `--host VALUE`/`--host=VALUE` before `--` is collected before any other check, so with two or more of them every pre-dispatch refusal, including syntax errors such as an unknown option or a missing value, is an array with one `submitted:false` element per host; with fewer it is one flat object |
545
+ | Duplicate destinations | Not checked | `duplicate_ssh_host` for a repeated destination string (user, case-insensitive host name, canonical IPv6). Syntactic only: aliases or addresses of the same physical host are not detected |
546
+ | Attempts | One attempt per host | One preflight and at most one request per destination. Refused/unknown hosts are reported in place; later hosts still get their single attempt. No failover, resend or retry after `unknown` |
547
+ | Timeouts | Python subprocess timeouts on the direct child | POSIX: each `ssh` (and every other external command) starts detached, in a new session and process group without a controlling terminal, registered as soon as its PID exists; cleanup covers that group only (a descendant that calls `setsid()` leaves it and is out of scope; no PID scanning); a timeout, an output overflow or SIGINT/SIGTERM/SIGHUP to the CLI kills the whole group, including a jump `ProxyCommand` that holds the pipes, and the call completes after the exit plus a 100 ms grace instead of waiting for the pipes. Windows: only the direct child is killed, descendants may linger, and the call still returns at the deadline. Preflight timeout stays a refusal and request timeout stays `unknown` without retry ([#87](https://github.com/abruption/session-peer-ts/issues/87)) |
548
+ | `--ssh-opt` | Arbitrary ssh arguments minus a substring blocklist (`proxycommand`, `localcommand`, `permitlocalcommand`) | Allowlist only: `-p PORT`, `-l USER`, `-i IDENTITY_FILE`, `-o Port=`/`User=`/`IdentityFile=`/`IdentitiesOnly=yes\|no`, `-4`, `-6`, as separate or attached tokens. Anything else is `unsupported_ssh_option`; a bad, duplicate or dash-leading value is `invalid_ssh_option`. Identity paths refuse `%` and `$` (OpenSSH token/environment expansion). Options are re-emitted canonically after the fixed `BatchMode=yes`, `StrictHostKeyChecking=yes` and `ConnectTimeout=10`, which OpenSSH therefore keeps |
549
+ | Jump hosts | `ProxyJump`/`-J` allowed through `--ssh-opt`; the hop gets no command-line `BatchMode`/`StrictHostKeyChecking` | **Done for POSIX clients:** typed `--ssh-jump USER@HOST[:PORT]` (one hop, explicit user, shell- and %-inert characters only). The CLI builds a fixed `ProxyCommand`: the shell-quoted, %-escaped `ssh` path with `BatchMode=yes`, `StrictHostKeyChecking=yes`, `UpdateHostKeys=no`, `ConnectTimeout=10`, `ConnectionAttempts=1`, `ProxyCommand=none`, `ProxyJump=none`, `ControlPath=none`, `ForwardAgent=no`, `ClearAllForwardings=yes`, `PermitLocalCommand=no`, `-W '[%h]:%p'`. It is placed with the fixed options, together with outer `ControlMaster=no`, `ControlPath=none` and `ProxyUseFdpass=no`, so it overrides a `ProxyJump`/`ProxyCommand` and any control master in ssh_config for the target (checked with `ssh -G -F <fixture>`). `-J`/`ProxyJump`/`ProxyCommand` through `--ssh-opt` stay refused. Refused with `--ssh-control-path` and on **Windows clients** (`ssh_jump_unsupported_platform`) until Win32-OpenSSH `ProxyCommand` behavior is verified. No multi-hop, and no Tailscale lookup for the hop (v1). Result field `sshJump`. `--ssh-opt` values (including `-4`/`-6`) apply to the target only, not the hop. Shell scope: the generated `ProxyCommand` was verified with sh, bash and zsh; other login shells are unverified. Unverified boundaries: Win32-OpenSSH clients. Python parity: Python accepts arbitrary `-J` hops; TS offers a stricter, typed single hop |
550
+ | User | `sshUser`/`sshUserSource`: `explicit` from `USER@HOST`, else `ssh -G` (`ssh_config_or_local_default`), else `unknown` | Same fields and sources; `-l USER` also counts as `explicit`. `-l` together with `USER@HOST` is `conflicting_ssh_user`, because `-l` silently wins. Without an explicit user, one local `ssh -G` runs per host (5 s limit). It does not connect, but per ssh(1)/ssh_config(5) it evaluates the user's ssh configuration, including `Match exec` commands, as Python's lookup does. A failed or unexpected lookup gives `unknown` for that host only |
551
+ | Trust boundary | Blocklisted command-line options; user ssh config trusted | The allowlist governs only options this CLI puts on the `ssh` command line. The user's and system ssh_config are trusted user configuration: `ProxyCommand`, `ProxyJump`, `Match exec`, `Include` and similar settings there apply to every `ssh` this CLI starts, as for the user's own `ssh` |
552
+ | IPv6 | Passed through to `ssh` | `2001:db8::1`, `[2001:db8::1]` and `user@[2001:db8::1]` are accepted; brackets are removed for `ssh`, `sshHost` shows the destination used. Zone IDs (`%`) are refused |
553
+ | Control socket / Windows | n/a | `--ssh-control-path` requires exactly one `--host`. `--remote-platform win32` and `--remote-bin` apply to every host with the same encoded PowerShell command |
554
+ | Text output | Per-host human blocks | Per-host blocks prefixed by `Host: <host>` |
555
+
556
+ Evidence: POSIX fake-`ssh` fixtures in `test/ssh-hosts.test.ts` (ordering,
557
+ argv, zero invocations on invalid input including syntax errors, flat versus
558
+ array refusals, partial results, per-host `ssh -G` failure, IPv6, POSIX/Windows
559
+ remote commands, body absent from argv) and a two-host case in the Windows
560
+ native fixture. `--ssh-jump` fixtures use a fake `ssh` (installed under a path
561
+ with spaces, a quote and `%`) that expands `%h`/`%p`/`%%` and runs the
562
+ `ProxyCommand` through `/bin/sh -c exec`, recording the exact hop argv;
563
+ injection attempts start no `ssh`. Before implementation, local
564
+ `ssh -G -F <fixture config>` (OpenSSH 10.3p1, no connection) confirmed that a
565
+ command-line `ProxyCommand` overrides the target's configured
566
+ `ProxyJump`/`ProxyCommand` without error, and that the hop's command-line
567
+ `ProxyCommand=none`/`ProxyJump=none` override the jump host's configured
568
+ proxies; ssh_config(5) does not list `ProxyCommand` among the keywords with
569
+ `${ENV}` expansion. The `unknown` case is a classification fixture: the fake exits
570
+ 255 on the request without running the remote CLI, so it shows that `unknown`
571
+ is never retried, not that a delivered message's response was lost. No real
572
+ SSH destination was contacted.
573
+
574
+ <a id="source-update-checks--22"></a>
575
+
576
+ ## Update checks — #22 / 0.3.0
577
+
578
+ Evidence date: 2026-10-02. Added in 0.3.0; 0.2.1 and earlier have no `update`
579
+ command. `session-peer update --check --json [--channel latest|preview]` makes one
580
+ GET to `<registry>/-/package/session-peer/dist-tags` (default
581
+ `https://registry.npmjs.org/`, 3-second timeout covering the body, 64 KiB body
582
+ limit, redirects refused, no retries). `latest` must be a stable npm semver;
583
+ `preview` may be a prerelease. Versions follow SemVer 2.0 precedence without a
584
+ `v` prefix or build metadata. Python 1.0.2's GitHub tags are a different stream
585
+ and are never compared; `referenceVersion` is unrelated to this check.
586
+
587
+ | Field | Meaning |
588
+ | --- | --- |
589
+ | `current`, `latest`, `channel`, `distTag` | Running TS version, the dist-tag's version, and the tag name |
590
+ | `source` | `npm_registry` |
591
+ | `status`, `outdated` | `update_available` (`outdated:true`), `up_to_date` or `ahead` |
592
+ | `updated` | Always `false`; nothing is installed |
593
+ | `managedBy`, `updateCommand`, `guidance` | Owner from the resolved CLI path, positively identified only: `npm` (global prefix whose `bin/session-peer` symlink or `session-peer.cmd` launcher targets this package: default, Homebrew, nvm, nvm-windows, fnm), `pnpm`/`yarn`/`bun` (global store whose `package.json` declares `session-peer`), `volta`, `npx`. Command only for those owners and only when outdated. `npm_project`/`pnpm_project` (project `package.json` declares the dependency), `source` (checkout) and `unknown` (anything else, such as an unconfirmed nvm-windows prefix) always get `null` plus a `guidance` sentence |
594
+ | `cache` | `written`, `skipped_locked`, `skipped_stale_lock`, `skipped_newer`, `failed`, or `not_applicable` (preview channel) |
595
+ | `skills`, `skillsManagedBy` | Same local TS skill metadata check as `doctor`; `separate` |
596
+
597
+ Failures use the standard caught-failure envelope with `registry_timeout`,
598
+ `registry_unreachable`, `registry_http_error`, `registry_response_invalid`,
599
+ `dist_tag_missing` (exit 1), or `invalid_update_registry`,
600
+ `unsupported_update_channel` (exit 2). Response bodies are never emitted.
601
+ `update` without `--check` is `self_update_unsupported` (exit 2) with `updated:false`,
602
+ `managedBy`, `updateCommand` (dist-tag spec, same owner rules), `guidance` and `checkCommand`; it makes no
603
+ request. `--host`, other list/send options and `--stdio-request` (error
604
+ `remote_update_unsupported`) are refused, so a remote destination never performs
605
+ update checks. `doctor` capabilities add `updateCheck:true`, `selfUpdate:false`.
606
+
607
+ Notices are deliberately **opt-in** (Python's are on by default): agents and
608
+ scripts call this CLI frequently, and an unrequested registry call or extra
609
+ stderr line would change its no-network default. With
610
+ `SESSION_PEER_UPDATE_NOTICE=1` (`1/true/yes/on`), completed local
611
+ `list`/`send`/`doctor` results read only the local cache. A fresh (24 h) cache
612
+ whose stable `latest` is newer adds `clientUpdate` (`schemaVersion`, `status`,
613
+ `current`, `latest`, `channel`, `checkedAt`, `source: "npm_registry_cache"`,
614
+ `managedBy`, `command`, `guidance`) to JSON, or one stderr line for text; stdout text is
615
+ unchanged. A missing, invalid, future-dated or expired cache spawns one detached
616
+ refresh and returns immediately. A failed refresh stores `latest:null`, which
617
+ suppresses attempts for 1 hour. Opt-out (`--no-update-notice`,
618
+ `SESSION_PEER_NO_UPDATE_NOTICE`) suppresses these background notices and
619
+ refreshes and wins over opt-in. An explicit `update --check` is an intended
620
+ request: it always contacts the registry and, on `latest`, writes the cache under
621
+ the same lock rules (reported as `cache`).
622
+ Cache and network failures never change results or exit codes.
623
+
624
+ Scope: notices belong to the invoking client. With `--host`, the client adds
625
+ `clientUpdate` (or its stderr line) to its own top-level output, including the
626
+ verified result obtained over SSH; the `--stdio-request` receiver never reads,
627
+ refreshes or produces a notice. The notice is computed once per invocation.
628
+ Multi-host and failures (integration candidate with #20/#21):
629
+
630
+ - Repeated `--host` JSON array: request order and every element's exact shape are
631
+ kept; no `clientUpdate` in elements and no wrapper object.
632
+ - Flat result: one destination (local or a single `--host`) gets the additive
633
+ field, also when that per-host result failed (preflight refusal, remote
634
+ `ok:false`) or is unknown. Top-level parse errors and local caught failures
635
+ (the top-level catch path in `cli.ts`) never get it.
636
+ - Text output: one stderr line per invocation, for flat or array output and
637
+ with failed, mixed or successful hosts; stdout is unchanged.
638
+ - The advisory never changes status, exit code, `submitted`,
639
+ `consumptionConfirmed` or `retryAllowed`.
640
+ - `clientUpdate` is reserved for the client: `remote()` deletes any
641
+ `clientUpdate` in a verified receiver response before it is shown.
642
+ - Refresh count: the notice is computed at a single call site after dispatch,
643
+ once per invocation. The fixture evidence is indirect: registry request counts
644
+ with the single-flight cache lock (one request for three hosts, none from
645
+ receivers). It does not instrument the call itself.
646
+
647
+ Evidence: POSIX `test/integration-multihost-updates.test.ts` (fake ssh).
648
+ Windows: `test/windows-contract.test.ts` checks one opted-in repeated `--host`
649
+ array (no element field), one text stderr line and a flat single-host field
650
+ through the encoded PowerShell fixture; it is not evidence for the refresh count
651
+ or the failure/forged-field cases, which are POSIX-only.
652
+
653
+ Single flight, fail closed (changed after review). Earlier revisions of this PR
654
+ reclaimed stale locks and used a takeover mutex; review found legal filesystem
655
+ interleavings that let a newer cache record be overwritten or another
656
+ generation's lock or mutex be deleted. That code is removed:
657
+
658
+ - One lock, `npm-update.lock`, created with `O_EXCL` and holding a random token.
659
+ The notice path creates it before spawning the detached refresh, which inherits
660
+ the token. `update --check` creates it around its own cache write.
661
+ - Every cache write (background or explicit) happens only while holding the
662
+ lock, and only when the existing record is older than the writer's start
663
+ (`checkedAt`); an explicit check that finds the lock held still reports its
664
+ result with `cache: "skipped_locked"`. A refresh without the current token does
665
+ nothing.
666
+ - No code path takes over, renames or deletes a lock, temporary file or other
667
+ resource it did not create, and no mutex exists. The shared cache record
668
+ `npm-update.json` is the one file that is replaced by design, by atomic
669
+ rename and only under the lock rules above. An existing lock of any age makes the background refresh skip.
670
+ The holder deletes its own lock after re-reading its token.
671
+
672
+ Guaranteed, with no automatic recovery: at most one lock holder at a time (`O_EXCL`), so
673
+ at most one background refresh and at most one cache writer at once; no writer
674
+ replaces a record newer than its own start; no invocation deletes or moves a
675
+ foreign lock, temporary file or other resource. Cost: a lock can be left behind
676
+ when its holder crashes (the detached child runs for at most about 3 seconds)
677
+ or when releasing it fails, for example because its token cannot be read back.
678
+ A failed token write right after creation is undone only for that same inode.
679
+ A left-behind lock blocks background refreshes until a user deletes
680
+ `npm-update.lock` by hand while no session-peer process runs. `update --check` reports `cache: "skipped_stale_lock"` once the lock is older
681
+ than 60 s; it never removes it. Manual deletion during a running refresh is the
682
+ only way to break the guarantee (the holder could then remove a lock created
683
+ after the deletion).
684
+
685
+ Cache: `npm-update.json` (0600, atomic temp-file rename) in a 0700 directory
686
+ owned by the user: `SESSION_PEER_CACHE_DIR` (absolute), else
687
+ `$XDG_CACHE_HOME/session-peer` on macOS/Linux, `~/Library/Caches/session-peer`,
688
+ `~/.cache/session-peer`, or `%LOCALAPPDATA%\session-peer\Cache`. It holds only
689
+ package name, channel, version and timestamp. Windows relies on the per-user
690
+ profile ACL instead of POSIX modes. No checks or notices modify npm-owned files,
691
+ Python installations, remote hosts or skills.
692
+
693
+ Acceptance evidence: `test/updates.test.ts` (POSIX and Windows CI) covers SemVer
694
+ ordering, stable/prerelease tags, invalid/oversized/HTTP/redirect/timeout/offline
695
+ registry responses without body leakage, manager guidance per install layout,
696
+ including nvm, nvm-windows, fnm, Volta and ambiguous prefixes (`unknown`, no command),
697
+ cache paths and modes, opt-in default off, flag/env opt-out, JSON additivity,
698
+ text stderr, offline/invalid/expired/future caches, concurrent single-flight
699
+ refresh, fail-closed live and stale locks (no refresh until manual removal),
700
+ review regressions: an explicit check while a background holder runs reports
701
+ `skipped_locked` and writes nothing, then the holder publishes; a holder whose
702
+ start predates a newer record publishes nothing; a stale lock is never taken
703
+ over, so its holder's release cannot remove a successor; a stale lock and a
704
+ leftover mutex keep the same inode and content after notices and an explicit
705
+ check; a non-holder token neither releases nor writes; multi-process
706
+ acquisition yields one owner (none for a stale lock), failure backoff, Python cache isolation, TS skill metadata,
707
+ wire isolation, and a POSIX fake-SSH `list --host` where only the client adds
708
+ the notice. `test/package-smoke.ts` checks the installed
709
+ package's guidance and unchanged files. All use a local fixture registry; no
710
+ test contacts npm.
711
+
712
+ <a id="source-optional-shorthand--74--planned-030"></a>
713
+
714
+ ## Optional shorthand — #74 / 0.3.0
715
+
716
+ 0.3.0 ships opt-in Bash/zsh and PowerShell aliases for `sp`. 0.2.1 and earlier
717
+ have no activation assets. npm still registers only canonical `session-peer`.
718
+ Sourcing in the caller's shell/scope refuses existing sp executables, aliases and
719
+ functions; no install hook, profile/PATH edits or runtime dispatcher is added.
720
+ The alias resolves the same canonical command with the same arguments, stdin,
721
+ output, exit codes and delivery boundaries. Automation/SSH/help/version retain
722
+ canonical identity. See [activation and lifecycle](docs/shorthand.md).
723
+
724
+ Python/TS co-installation is excluded; replacing an implementation respects its
725
+ original manager. This TS change does not implement additional Python features.
726
+ Package fixtures cover name equivalence, collisions, an in-place version update
727
+ and removal on every supported shell. They do not establish live delivery or ACK.
package/README.ja.md CHANGED
@@ -18,6 +18,10 @@ Python 不要の Node.js クライアントです。パッケージ名とコマ
18
18
 
19
19
  ## Demo
20
20
 
21
+ ![TypeScript session-peer 0.2.1 による実際の Codex・Claude Code 間の要求と返信](https://raw.githubusercontent.com/abruption/session-peer-ts/main/docs/assets/session-peer-ts-v0.2.1-roundtrip.gif)
22
+
23
+ npm 0.2.1 でローカルの要求と明示的な `ACK DEMO-READY` の返信を確認しました。CLI・メッセージの抜粋を識別情報の除去とタイミング編集後に再描画したもので、画面録画ではありません。提出だけでは ACK を意味しません。
24
+
21
25
  インストール後、一覧から選んだ正確な PID に `CLAUDE_PID` を置き換えます:
22
26
 
23
27
  ```sh
@@ -47,22 +51,26 @@ SSH は既存の鍵・ホスト信頼設定と両端の**同じバージョン
47
51
  別の管理ツールのファイルを `--force` で上書きしないでください。
48
52
 
49
53
  ```sh
50
- npm install --global --ignore-scripts session-peer@0.2.1
54
+ npm view session-peer@0.3.1 version dist.integrity
55
+ npm install --global --ignore-scripts session-peer@0.3.1
51
56
  session-peer --version
52
57
  ```
53
58
 
54
- 期待する出力: `session-peer 0.2.1 (typescript)`。分離インストール・ソースビルド・
59
+ 期待する出力: `session-peer 0.3.1 (typescript)`。分離インストール・ソースビルド・
55
60
  Windows・削除の手順は以下の詳細ガイドを参照してください。
56
61
 
62
+ 任意の `sp` 短縮名は 0.3.0 以降に含まれ(0.2.1 以前にはありません)、自動では有効になりません。
63
+ [明示的な有効化・衝突・解除(英語)](docs/shorthand.md)を参照してください。
64
+
57
65
  ### Update
58
66
 
59
67
  npm で導入したクライアントは npm で更新します。タグと対象バージョンを確認してから
60
- 正確なバージョンを指定してください。以下は古い npm 版を 0.2.1 に更新する例です。
61
- CLI 自体に自己更新コマンドはありません。
68
+ 正確なバージョンを指定してください。以下は古い npm 版を 0.3.1 に更新する例です。
69
+ CLI は更新をインストールせず、`session-peer update --check` は確認のみ行います。
62
70
 
63
71
  ```sh
64
72
  npm view session-peer dist-tags
65
- npm install --global --ignore-scripts session-peer@0.2.1
73
+ npm install --global --ignore-scripts session-peer@0.3.1
66
74
  session-peer --version
67
75
  ```
68
76
 
package/README.ko.md CHANGED
@@ -18,6 +18,10 @@ Python 없이 Node.js로 실행하는 클라이언트입니다. 패키지와 명
18
18
 
19
19
  ## Demo
20
20
 
21
+ ![TypeScript session-peer 0.2.1의 실제 Codex·Claude Code 요청과 회신](https://raw.githubusercontent.com/abruption/session-peer-ts/main/docs/assets/session-peer-ts-v0.2.1-roundtrip.gif)
22
+
23
+ npm 0.2.1로 로컬 요청과 명시적인 `ACK DEMO-READY` 회신을 확인했습니다. CLI·메시지 발췌를 식별자 제거와 타이밍 편집 후 재구성한 것으로, 화면 녹화가 아닙니다. 제출만으로 ACK를 의미하지 않습니다.
24
+
21
25
  설치 후 세션을 조회하고, 선택한 정확한 PID로 `CLAUDE_PID`를 바꾸세요:
22
26
 
23
27
  ```sh
@@ -47,22 +51,26 @@ SSH에는 기존 키·호스트 신뢰 설정과 양쪽의 **동일 버전 TypeS
47
51
  다른 설치 관리자의 파일을 `--force`로 덮어쓰지 마세요.
48
52
 
49
53
  ```sh
50
- npm install --global --ignore-scripts session-peer@0.2.1
54
+ npm view session-peer@0.3.1 version dist.integrity
55
+ npm install --global --ignore-scripts session-peer@0.3.1
51
56
  session-peer --version
52
57
  ```
53
58
 
54
- 예상 출력: `session-peer 0.2.1 (typescript)`. 격리 설치·소스 빌드·Windows·제거
59
+ 예상 출력: `session-peer 0.3.1 (typescript)`. 격리 설치·소스 빌드·Windows·제거
55
60
  방법은 아래 상세 가이드에서 확인할 수 있습니다.
56
61
 
62
+ 선택적 `sp` 단축 이름은 0.3.0 이상에 포함되며(0.2.1 이하에는 없음) 자동으로 켜지지 않습니다.
63
+ [명시적 활성화·충돌·해제 안내(영문)](docs/shorthand.md)를 참고하세요.
64
+
57
65
  ### Update
58
66
 
59
67
  npm으로 설치한 클라이언트는 npm으로 갱신합니다. 태그와 대상 버전을 검토한 뒤
60
- 정확한 버전을 설치하세요. 아래 예시는 이전 npm 설치본을 0.2.1로 갱신합니다.
61
- CLI 자체 업데이트 명령은 없습니다.
68
+ 정확한 버전을 설치하세요. 아래 예시는 이전 npm 설치본을 0.3.1로 갱신합니다.
69
+ CLI는 업데이트를 설치하지 않으며 `session-peer update --check`는 확인만 합니다.
62
70
 
63
71
  ```sh
64
72
  npm view session-peer dist-tags
65
- npm install --global --ignore-scripts session-peer@0.2.1
73
+ npm install --global --ignore-scripts session-peer@0.3.1
66
74
  session-peer --version
67
75
  ```
68
76
 
package/README.md CHANGED
@@ -18,6 +18,10 @@ A Node.js client that runs without Python. Package and command: `session-peer`.
18
18
 
19
19
  ## Demo
20
20
 
21
+ ![Actual Codex to Claude Code request and reply with TypeScript session-peer 0.2.1](https://raw.githubusercontent.com/abruption/session-peer-ts/main/docs/assets/session-peer-ts-v0.2.1-roundtrip.gif)
22
+
23
+ Actual local request and explicit `ACK DEMO-READY` reply using npm 0.2.1. CLI/message excerpts are re-rendered, identifiers redacted and timing edited; this is not a screen recording. Submission alone is not an ACK.
24
+
21
25
  After installation, list sessions and replace `CLAUDE_PID` with the exact PID you selected:
22
26
 
23
27
  ```sh
@@ -47,22 +51,27 @@ in PowerShell before installing. Choose the intended PATH entry; do not use
47
51
  `--force` to overwrite another manager’s files.
48
52
 
49
53
  ```sh
50
- npm install --global --ignore-scripts session-peer@0.2.1
54
+ npm view session-peer@0.3.1 version dist.integrity
55
+ npm install --global --ignore-scripts session-peer@0.3.1
51
56
  session-peer --version
52
57
  ```
53
58
 
54
- Expected: `session-peer 0.2.1 (typescript)`. For isolated installation, source
59
+ Expected: `session-peer 0.3.1 (typescript)`. For isolated installation, source
55
60
  builds, Windows and removal, see the detailed guide below.
56
61
 
62
+ Optional `sp` shorthand ships with 0.3.0 and later (not 0.2.1 or earlier) and is
63
+ never enabled automatically. See [explicit activation and collisions](docs/shorthand.md).
64
+
57
65
  ### Update
58
66
 
59
67
  Use npm for an npm-managed installation. Check the available tags and review
60
68
  the target version, then install that exact version; this example updates an
61
- older npm installation to 0.2.1. The CLI has no self-update command.
69
+ older npm installation to 0.3.1. The CLI does not install updates;
70
+ `session-peer update --check` only reports them.
62
71
 
63
72
  ```sh
64
73
  npm view session-peer dist-tags
65
- npm install --global --ignore-scripts session-peer@0.2.1
74
+ npm install --global --ignore-scripts session-peer@0.3.1
66
75
  session-peer --version
67
76
  ```
68
77
 
package/README.zh-CN.md CHANGED
@@ -18,6 +18,10 @@
18
18
 
19
19
  ## Demo
20
20
 
21
+ ![TypeScript session-peer 0.2.1 的实际 Codex 与 Claude Code 请求和回复](https://raw.githubusercontent.com/abruption/session-peer-ts/main/docs/assets/session-peer-ts-v0.2.1-roundtrip.gif)
22
+
23
+ 使用 npm 0.2.1 确认了本地请求及明确的 `ACK DEMO-READY` 回复。CLI 与消息摘录经过重新渲染、标识信息匿名化及时间编辑,并非屏幕录像。仅提交不代表 ACK。
24
+
21
25
  安装后列出会话,将 `CLAUDE_PID` 替换为选中的准确 PID:
22
26
 
23
27
  ```sh
@@ -45,21 +49,25 @@ session-peer send --to CLAUDE_PID --message '请检查 API 契约并回复。' -
45
49
  覆盖其他安装管理器的文件。
46
50
 
47
51
  ```sh
48
- npm install --global --ignore-scripts session-peer@0.2.1
52
+ npm view session-peer@0.3.1 version dist.integrity
53
+ npm install --global --ignore-scripts session-peer@0.3.1
49
54
  session-peer --version
50
55
  ```
51
56
 
52
- 预期输出:`session-peer 0.2.1 (typescript)`。隔离安装、源码构建、Windows 和
57
+ 预期输出:`session-peer 0.3.1 (typescript)`。隔离安装、源码构建、Windows 和
53
58
  卸载步骤见下方详细指南。
54
59
 
60
+ 可选的 `sp` 简写包含在 0.3.0 及更高版本中(0.2.1 及更早版本没有),不会自动启用。
61
+ 请参阅[显式启用、冲突与停用(英文)](docs/shorthand.md)。
62
+
55
63
  ### Update
56
64
 
57
65
  使用 npm 更新由 npm 管理的安装。先检查标签并审阅目标版本,再安装指定版本。
58
- 下面示例将旧 npm 安装更新至 0.2.1。CLI 没有自更新命令。
66
+ 下面示例将旧 npm 安装更新至 0.3.1。CLI 不会安装更新,`session-peer update --check` 只做检查。
59
67
 
60
68
  ```sh
61
69
  npm view session-peer dist-tags
62
- npm install --global --ignore-scripts session-peer@0.2.1
70
+ npm install --global --ignore-scripts session-peer@0.3.1
63
71
  session-peer --version
64
72
  ```
65
73