Skip to content

fix(images): install libexpat 2.9.0 in the Hermes 0.1.x base - #96

Draft
derekhsu wants to merge 1 commit into
feat/image-only-clifrom
fix/hermes-01x-libexpat-profile
Draft

derekhsu wants to merge 1 commit into
feat/image-only-clifrom
fix/hermes-01x-libexpat-profile

Conversation

@derekhsu

@derekhsu derekhsu commented Dec 3, 2026

Copy link
Copy Markdown
Owner

Summary

LibreOffice 4:26.8.3.1-0+deb13u1 in Debian trixie-security depends on libexpat1 (>= 2.9.0), but the Hermes 0.1.x base holds libexpat1 2.8.3-1, so the Hermes tools image cannot install it (#92). This change makes the Hermes 0.1.x base install libexpat1 2.9.0-1~deb13u1 and adds a Hermes 0.1.x controlled package profile, hermes-01x. The other bases and profiles do not change. No image is published here.

Related Issue

Refs #95
Refs #92

Changes

  • agents/hermes-01x/Dockerfile.base:
    • Installs libexpat1 2.9.0-1~deb13u1 from snapshot.debian.org 20261017T204620Z, with the SHA-256 values that Dockerfile.base (OpenClaw) already uses.
    • Checks pyexpat for expat_2.9.0.
    • Writes and probes the hermes-01x inventory instead of shared.
  • agents/hermes-01x/Dockerfile: the completed-image check probes hermes-01x instead of hermes-compatible and checks expat_2.9.0. A Hermes 0.1.x image can no longer build on the 2026.11.25 base, which still has 2.8.3.
  • New profile hermes-01x: the shared inventory with libexpat1=2.9.0-1~deb13u1. It is added in src/lib/sandbox-base-image/security-package-specs.ts, in scripts/security/standalone-security-package-inventory.mts (the copy that image builds use), and in scripts/security/security-package-inventory.mts.
    • Requirement: the Hermes 0.1.x base needs a different controlled libexpat1 than the shared profile.
    • Why not change shared: the OpenShell 0.0.x Hermes base, the Deep Agents Code base, and the CLI inventory check (sandboxBaseImageHasSecurityInventory, used for Deep Agents Code) depend on it.
    • Protecting tests: test/runtime/sandbox/sandbox-base-security-packages.test.ts renders the hermes-01x probe and inventory from both scripts and runs the Hermes 0.1.x base and completed-image contracts.
  • shared, openclaw, and hermes-compatible are unchanged. The existing tests for those profiles, the OpenShell 0.0.x Hermes base, Deep Agents Code, OpenClaw, and the published Hermes base still pass.
  • Tests:
    • sandbox-base-security-packages.test.ts adds Hermes 0.1.x to SECURITY_IMAGES, so the existing base, completed-image, stale-package, Vim, Node, and architecture cases run for it.
    • A new case rejects a Hermes 0.1.x completed image on a base with the shared libexpat1 2.8.3-1 inventory. It fails when agents/hermes-01x/Dockerfile is left on hermes-compatible.
    • The probe substitution in the test now accepts profile names with digits.
  • test/helpers/dockerfile-run-shell.ts: new dockerSubshellBetween. The Hermes 0.1.x completed-image check is a && ( ... ) subshell inside a merged RUN (fix(hermes-01x): 映像 130 層超過 Docker 125 層上限,Docker 主機無法拉取 #70), not its own RUN instruction. test/helpers/dockerfile-run-shell.test.ts covers the subshell case and the error case.
  • test/helpers/base-apt-security-functions.ts: HERMES_01X_BASE_APT_PACKAGES.
  • docs/modification/2026-11-17-hermes-tools-image.md: the cause, the change, and the steps after merge.

Follow-up after merge (not in this PR)

  1. Run Images / Hermes OpenShell 0.1.x to publish a new Hermes 0.1.x image.
  2. Update BASE_IMAGE in agents/hermes-01x/Dockerfile.tools to the new tag and index digest. The base tag and digest lines in the Hermes tools document change at the same time.
  3. Merge fix(images): pin the current Debian LibreOffice and Chromium releases #93 (LibreOffice and Chromium pins) and the fix(images): tools layer 新增的 Node.js tar 7.5.22 帶入 19 個 HIGH CVE #94 fix, then release the tools image.

Dockerfile.tools keeps the 2026.11.25 digest in this PR because the new base has no digest yet.

Not verified

  1. No pull-request workflow builds agents/hermes-01x/Dockerfile.base or agents/hermes-01x/Dockerfile. The only workflow that builds them, Images / Hermes OpenShell 0.1.x, also publishes images, so it was not run. The Hermes 0.1.x Docker build is not verified. The CI on this PR covers the shell-level contract tests and the OpenShell 0.0.x Hermes and Deep Agents Code builds in Images / Managed Images.
  2. I did not build an image locally (no container runtime was used).
  3. The libexpat1 2.9.0 deb is the file the OpenClaw base installs from the same snapshot URL. On 2026-12-03 the current Debian Packages indexes list the same SHA-256 values for amd64 and arm64.
  4. I checked the other apt pins in agents/hermes-01x/Dockerfile.base against the current Debian Packages indexes, and all are available. I did not check npm, pip, or download sources that the base and final image builds also use.
  5. Runtime acceptance in an OpenShell 0.1.7 sandbox, including Dashboard CHAT, happens after publication.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — justification:
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — reviewer/approval link/justification:
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Documentation Writer Review

  • Documentation writer subagent reviewed the completed changes
  • Result: docs-updated
  • Evidence: docs/modification/2026-11-17-hermes-tools-image.md. The review passed with nits. I applied four of them; the fifth, renaming OPENCLAW_LIBEXPAT_PACKAGE, was optional and out of scope. It found no other document that needs a change now. npm run docs does not apply: docs/modification/ is not part of the Fern site.
  • Agent: Claude Code

DGX Station Hardware Evidence

  • Tested on DGX Station
  • Tested commit:
  • Station profile/scenario:
  • Result:
  • Supporting evidence:

Verification

  • PR description includes a Signed-off-by: line and every commit appears as Verified in GitHub
  • Normal pre-commit, commit-msg, and pre-push hooks passed, or npm run validate:pr passed after refreshing origin/main when hooks were skipped or unavailable
  • Targeted behavior tests pass for the current change set, or tests are marked not applicable above — command/result or justification: npx vitest run test/runtime/sandbox/sandbox-base-security-packages.test.ts test/helpers/dockerfile-run-shell.test.ts passed 159/159 after the final edits. The 26 test files that import the changed modules or read the Hermes 0.1.x Dockerfiles, plus test/hermes-01x-image.test.ts and test/check-image-layer-count.test.ts, passed 480/480 with dist/ built. npm run typecheck:cli, hadolint, npm run source-shape:check, npm run test:projects:check, and markdownlint-cli2 passed.
  • Applicable broad gate passed — npm test for broad runtime/test-harness changes; npm run check for repo-wide validation/coverage changes — command/result:
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only)
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Signed-off-by: Derek Hsu derekhsu@hotmail.com

LibreOffice 4:26.8.3.1-0+deb13u1 in Debian trixie-security depends on
libexpat1 (>= 2.9.0). The Hermes 0.1.x base held libexpat1 2.8.3-1, so
the Hermes tools image could not install it (#92).

- agents/hermes-01x/Dockerfile.base installs libexpat1 2.9.0-1~deb13u1
  from the snapshot.debian.org URL and with the SHA-256 values that the
  OpenClaw base already uses, and checks pyexpat for expat 2.9.0.
- A new controlled package profile, hermes-01x, is the shared inventory
  with libexpat1=2.9.0-1~deb13u1. The Hermes 0.1.x base writes and
  probes it, and the final Hermes 0.1.x image probes it instead of
  hermes-compatible and checks expat 2.9.0.
- The shared, openclaw, and hermes-compatible profiles do not change, so
  the OpenShell 0.0.x Hermes and Deep Agents Code bases and the CLI
  inventory checks keep their behavior.
- The base security package test covers the Hermes 0.1.x base and final
  image, including a final image on a base that still has libexpat
  2.8.3, which must fail.

No image is published here. After merge, the Hermes 0.1.x image must be
published and agents/hermes-01x/Dockerfile.tools must move to its digest
before the tools image can be released.

Refs #95, #92

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Derek Hsu <derekhsu@hotmail.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant