Two contract tests in test_dockerfile_pid1_reaping.py guarded properties
of the @hermes/ink materialization dance introduced in 5f215b13 (PR
#16690): ``--prefix node_modules/@hermes/ink`` install + ``omit=dev`` +
nested-react cleanup + ``await import('@hermes/ink')`` smoke check.
That mechanism was retired in a49f4c6 ("fix: prevent tui rebuilding
assets") in favour of a simpler approach:
1. Copy the full ``ui-tui/packages/hermes-ink/`` tree (not just
manifests) so npm can resolve the ``file:`` workspace dep against
real content rather than a bare package.json.
2. Set ``ENV npm_config_install_links=false`` to force npm to install
``file:`` deps as symlinks on Debian's bundled npm 9.x (which
defaults to ``install-links=true`` and installs as copies). The
host-side lockfile is generated by npm 10+ using symlinks, so
install-as-copy produces a hidden node_modules/.package-lock.json
that permanently disagrees with the root lock on @hermes/ink — and
that disagreement trips the TUI launcher's
``_tui_need_npm_install()`` check on every startup, triggering a
runtime ``npm install`` that fails with EACCES.
The tests were never updated for the new design; they remained pinned
to the retired materialization step and the manifest-only COPY shape.
This commit:
- Updates ``test_dockerfile_installs_tui_dependencies`` to assert the
full ``COPY ui-tui/packages/hermes-ink/ ui-tui/packages/hermes-ink/``
shape — catches a regression that reverts to manifest-only copies.
- Replaces ``test_dockerfile_materializes_local_tui_ink_package`` with
``test_dockerfile_forces_npm_install_links_false_for_workspace_resolution``,
which scans the parsed instruction list for an ENV directive (not a
comment) setting ``npm_config_install_links=false``. Negative-tested:
removing only the ENV line correctly fails the assertion even with
the explanatory comment block above it left intact.
PID-1 reaping tests (the file's primary purpose) are unmodified and
continue to assert tini install + ENTRYPOINT routing.
Partial close hermes-agent#9 — addresses 2 of the ~28 real failures
surfaced after the disk-pressure fix; does not touch the other ~19+
unrelated test failures in that issue.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>