# CMS r40: preserve the accepted Node base before recreation Run 40 qualified commit `02318ab6689298244a2ac8b4e7521ed1945600ee`. Its artifact SHA-256 is `68b36de85f56ad5c003e89f8f4dfe9e0a70b8d01e65846111b18106f677a30e9`. Canonical apply failed at `2026-11-04T20:37:58Z`, reporting only `config.Env`. Rollback `ok:dc-cms-release` restored and verified the original image, source, configuration, other services and project/site data. Backup: `dc-cms-release-dc-cms-release-v1-r40-02318ab6689298244a2ac8b4e7521ed1945600ee-20261104-233622`. The failed archive/receipt stay immutable. No reconciliation is required and this artifact is never retried. The application builder used mutable `FROM node:24-alpine`. The source Dockerfile, Compose and env-file were unchanged; rollback recreated the old image with the same Compose and passed exact Env comparison. This locates the drift in the new image's inherited environment. The discarded new container's individual differing Env values were not recorded, so no exact Node version transition is claimed. An application release must preserve its accepted base, not silently update the Node image selected by a mutable local tag. The initial correction inspected the accepted image by immutable ID and a bounded global local-image inventory. That lookup was rejected by the NAS in r41 preflight; it is superseded by the [scoped base discovery](R41_BASE_DISCOVERY.md). The current read-only preflight selects a Node 24 base whose complete root filesystem layers form a strict prefix of the accepted image, and whose environment plus the registered HOST/PORT instructions exactly equals the accepted image environment. Entrypoint, user, shell, labels, stop signal and healthcheck must match. Base CMD is node, working directory is empty, and there are no volumes, exposed ports or ONBUILD instructions. Duplicate Env keys, missing or ambiguous ancestors and architecture changes fail before apply. Proof stores image IDs and hashes only, never environment values. Build rechecks that proof and the registered source Dockerfile hash. In the clean temporary context it replaces only FROM with the proved local image ID. Docker 24 legacy builder is selected explicitly with DOCKER_BUILDKIT=0 and --pull=false. BuildKit's FROM sha256: was tested locally and attempted registry resolution; legacy builder resolved the local ID and completed. This explicit selection avoids a backend-dependent pull or fallback. The base contains no prior application/project layers. projects is empty in the build context, while the live registry, secrets, site workspaces and NAS metadata stay outside it. The new image's full inherited configuration and environment are compared before any service recreation. A difference reports field/key names only and stops there. Runtime acceptance and rollback remain unchanged and strict. There is no relaxed Env comparison, image pull, queue reset, dependency change, production file edit or broader service selection. Validation: 87 CMS deployment tests, 95 Device Core regression tests, Python 3.8 AST and diff check. A separate local Docker integration creates isolated fixture images without launching workload containers, invokes the actual base resolver and builder, verifies exact environment/base ancestry, checks all exported layers for the excluded private-project fixture and removes its own image tags. It verifies the build mechanism, not NAS cache availability; the production preflight remains authoritative for that. Promotion is the separate root-owned runner gate. r41 is the new CMS commit released after this correction; it remains staged, before application apply. The discovery correction resumes that queued run after runner promotion; no bootstrap, reconciliation replay or manual container command is needed.