hermes-agent/tests/plugins/platforms/photon
Shannon Sands 0dfd5546fc fix(photon): support immutable install trees for the sidecar (NS-606)
The Photon iMessage sidecar needs node_modules under
plugins/platforms/photon/sidecar/, but hosted/managed images keep the
whole install tree under an immutable /opt/hermes — every install and
self-heal path (setup CLI, stale-deps reinstall, cold install) died on
EROFS, and hosted users have no shell to work around it.

Three-layer fix, mirroring the WhatsApp bridge resolver pattern:

1. Bake the deps into the image. The Dockerfile now runs npm ci for the
   sidecar in the layer-cached dependency stage (deterministic installs
   from the committed lockfile; the postinstall spectrum-ts patch runs
   at build time). Hosted happy path needs no runtime install at all.

2. New sidecar_paths.resolve_sidecar_dir() decides where the sidecar
   runs from: PHOTON_SIDECAR_DIR override > writable source dir (dev
   installs, unchanged) > read-only dir with baked fresh deps (managed
   image) > mirror to $HERMES_HOME/photon/sidecar (writable data
   volume) when deps are missing or stale in a read-only tree. The
   mirror refreshes changed source files on image updates while
   keeping node_modules, so the existing lockfile-staleness self-heal
   works there.

3. connect() can now cold-install: _start_sidecar() runs the bounded
   npm ci bootstrap when node_modules is missing instead of raising
   immediately, and check_requirements() reports available when a
   self-install is possible (npm present + writable resolved dir) so
   the gateway actually creates the adapter on hosted instances. A
   failed bootstrap still raises the actionable error, which connect()
   surfaces as the retryable SIDECAR_FAILED fatal state on the
   dashboard.

Tests: resolver decision table (env override, in-place, mirror,
refresh, fail-open), cold-install lifecycle paths, and a Dockerfile
contract test guarding the baked-deps + no-chown invariants.

Fixes NS-606.
2026-07-28 22:41:32 -07:00
..
test_auth.py test(photon): allow auth.lock sentinel in temp-file leak assertions 2026-07-28 18:20:06 -07:00
test_check_requirements_risks.py fix(photon): support immutable install trees for the sidecar (NS-606) 2026-07-28 22:41:32 -07:00
test_fatal_notify_self_cancel.py fix(photon): dispatch fatal-error notification from a detached task 2026-07-28 21:45:52 -07:00
test_inbound.py fix(photon): ignore iMessage media placeholders 2026-07-28 18:17:52 -07:00
test_markdown.py feat(photon): upgrade to spectrum-ts 3.0.0 (pinned) with markdown + reactions 2026-06-12 01:07:38 -07:00
test_mention_gating.py feat(photon): gRPC-native iMessage channel (no webhook) 2026-06-08 21:03:58 -07:00
test_npm_error_log_regression.py fix(photon): support immutable install trees for the sidecar (NS-606) 2026-07-28 22:41:32 -07:00
test_outbound_media.py feat(photon): add native message effects 2026-07-28 22:10:57 -07:00
test_overflow_recovery.py test(photon): fix PlatformConfig kwargs in target_not_allowed standalone test 2026-07-28 21:45:52 -07:00
test_poll_clarify.py feat(photon): render multiple-choice clarify as a native iMessage poll 2026-07-28 22:10:57 -07:00
test_presence_watchdog.py fix(photon): rework zombie-stream watchdog for spectrum-ts 8 with strict probe semantics 2026-07-28 22:22:42 -07:00
test_reactions.py fix(photon): correlate tapbacks to bot message context 2026-06-27 00:51:34 -07:00
test_rich_links.py feat(photon): support rich link previews 2026-07-28 22:10:57 -07:00
test_runtime_record.py fix(photon): un-shadow the U+FFFC deferred-wait handler; fix stale sidecar-deps fixture 2026-07-28 21:28:25 -07:00
test_setup_access.py test(photon): stub token validation in setup tests to avoid network 2026-07-28 18:20:06 -07:00
test_sidecar_deps_stale.py fix(photon): auto-reinstall stale sidecar deps before start 2026-07-05 17:38:32 -07:00
test_sidecar_lifecycle.py fix(photon): support immutable install trees for the sidecar (NS-606) 2026-07-28 22:41:32 -07:00
test_sidecar_paths.py fix(photon): support immutable install trees for the sidecar (NS-606) 2026-07-28 22:41:32 -07:00
test_spectrum_patch.py test(photon): copy sidecar helper modules into the spectrum-patch fixture 2026-07-28 22:22:42 -07:00
test_streaming.py fix(photon): mark adapter as not supporting message editing to suppress streaming cursor 2026-07-28 18:17:52 -07:00
test_url_send_path.py test(photon): replace source-grep URL-routing tests with behavior tests 2026-07-28 22:22:42 -07:00
test_zombie_stream_watchdog.py test(photon): drain detached fatal-notification task in zombie watchdog test 2026-07-28 22:22:42 -07:00