Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions agents/hermes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,12 @@ RUN if [ "$NEMOCLAW_DARWIN_VM_COMPAT" = "1" ]; then \
# container and retains evidence keyed to the final image ID.
COPY --from=hermes-scan-payload / /

# These executables are git-tracked 0755 but check out group-writable (0775)
# under umask 002, and COPY carries that source mode into the image. Normalize
# before the check_metadata gate below asserts root:root 755. A RUN chmod is
# builder-independent; COPY --chmod requires BuildKit.
RUN chmod 755 /usr/local/lib/nemoclaw/hermes-wrapper.py /scripts/checks/node-tar-image-scan.mts

RUN check_metadata() { \
path="$1"; \
expected="$2"; \
Expand Down
6 changes: 6 additions & 0 deletions test/hermes-final-image-layout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ describe("Hermes final image layout", () => {
'RUN if [ "$NEMOCLAW_DARWIN_VM_COMPAT" = "1" ]',
);
const metadataCheck = indexOfRequired(finalStage, "RUN check_metadata()");
const modeNormalize = indexOfRequired(
finalStage,
"RUN chmod 755 /usr/local/lib/nemoclaw/hermes-wrapper.py /scripts/checks/node-tar-image-scan.mts",
);
const imageScan = indexOfRequired(
finalStage,
"node --experimental-strip-types /scripts/checks/node-tar-image-scan.mts",
Expand All @@ -218,6 +222,8 @@ describe("Hermes final image layout", () => {
expect(wrapper).toBeLessThan(pythonCheck);
expect(scan).toBeGreaterThan(darwinCompatibility);
expect(scan).toBeLessThan(metadataCheck);
expect(modeNormalize).toBeGreaterThan(scan);
expect(modeNormalize).toBeLessThan(metadataCheck);
for (const metadataContract of [
"/scripts/patch-bundled-npm-brace-expansion.mts 'root:root 444'",
"/scripts/patch-bundled-npm-tar.mts 'root:root 444'",
Expand Down
Loading