Skip to content

fix: unbreak docker compose build after husky devDep#39

Merged
ethanj merged 1 commit intomainfrom
fix/dockerfile-husky-prepare
Apr 23, 2026
Merged

fix: unbreak docker compose build after husky devDep#39
ethanj merged 1 commit intomainfrom
fix/dockerfile-husky-prepare

Conversation

@ethanj
Copy link
Copy Markdown
Contributor

@ethanj ethanj commented Apr 23, 2026

Summary

PR #33 added `husky` as a devDep with `"prepare": "husky"` in the root scripts. That broke `docker compose build app`: the Dockerfile runs `npm ci --omit=dev`, npm still invokes the prepare script, husky isn't installed (devDep was omitted), and the build fails with exit code 127. Nobody's been able to rebuild the image since #33 merged — the running container I encountered today was 40 hours stale (pre-snake-case-wire-flip) and still emitting camelCase response bodies.

Fix (two lines)

  • `package.json`: `"prepare": "husky || true"` — husky still installs hooks on local `pnpm install`, silently skips in Docker / CI / any `--omit=dev` install.
  • `Dockerfile`: `RUN HUSKY=0 npm ci ...` as belt-and-suspenders, skipping hook init even if husky ever ends up in the production install tree.

How I caught this

Running the new Add Context regression test (Atomicmem-webapp #22) against the local core instance. The container needed rebuilding to pick up the snake_case formatters from PR #32, but `docker compose build` failed. This PR fixes the build; after it lands, `docker compose up -d --force-recreate` picks up the latest main cleanly.

Test plan

  • `docker compose build --no-cache app` succeeds
  • `docker compose up -d --force-recreate app` boots to healthy
  • POST /v1/memories/ingest returns snake_case wire body (`episode_id`, `stored_memory_ids`, etc.)
  • CI green end-to-end

atomicmemory-core PR #33 added husky as a devDep with a
\`"prepare": "husky"\` lifecycle script. That broke \`docker compose
build app\`: Dockerfile runs \`npm ci --omit=dev\`, npm still invokes
the prepare script, husky isn't installed (devDep was omitted), and
the build fails with exit code 127. The image on disk has been 40
hours stale — nobody could rebuild it after #33 merged.

Two-line fix:

- package.json: \`"prepare": "husky || true"\` — husky still installs
  the hooks during local \`pnpm install\`, and silently skips when
  it's missing (Docker, CI, --omit=dev installs).
- Dockerfile: \`RUN HUSKY=0 npm ci ...\` as belt-and-suspenders,
  skipping hook init even if husky ever ends up in the production
  install tree.

Caught while rebuilding core to verify the Add Context regression
test in Atomicmem-webapp PR #22. Without this the running container
was 40 hours old (pre-snake-case-wire-flip) and returned camelCase
response bodies that the rebuilt SDK no longer translated.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@ethanj ethanj merged commit f7876cf into main Apr 23, 2026
1 check passed
@ethanj ethanj deleted the fix/dockerfile-husky-prepare branch April 23, 2026 00:38
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