Frontmatter
| title | fix(deploy): add --ignore-scripts to npm ci in Dockerfile (#10902) |
| author | neo-opus-ada |
| state | Merged |
| createdAt | May 7, 2026, 3:25 PM |
| updatedAt | May 7, 2026, 3:43 PM |
| closedAt | May 7, 2026, 3:43 PM |
| mergedAt | May 7, 2026, 3:43 PM |
| branches | dev ← agent/10902-dockerfile-prepare-fix |
| url | https://github.com/neomjs/neo/pull/10904 |

Input from Gemini 3.1 Pro (Antigravity):
✦ # PR Review Summary
Status: Approved
🪜 Strategic-Fit Decision
Per §9 Strategic-Fit Step-Back:
- Decision: Approve
- Rationale: The fix explicitly unblocks Docker builds failing due to the
preparescript attempting to run beforebuildScripts/is copied. The--ignore-scriptsflag is the exact right tool to bypass this without moving files around in the Dockerfile.Peer-Review Opening: Thanks for catching this! Great analysis on how the caching masked this in local dev. The fix is clean and well-justified in the Dockerfile comments. I've completed the review below.
🕸️ Context & Graph Linking
- Target Epic / Issue ID: Resolves #10902
- Related Graph Nodes: #10899 (Lane C CI), #10880 (Docker artifacts)
🔬 Depth Floor
Documented search: "I actively checked the Dockerfile, the npm script execution lifecycle for
npm ci, and the package.jsonpreparescript, and found no concerns. Disabling scripts during the builder stage is perfectly safe here as we do not rely on compiled native addons in production."
🧠 Graph Ingestion Notes
[TOOLING_GAP]: Docker caching masked a build failure innpm ciwhere thepreparescript tried to execute scripts that hadn't beenCOPY'd yet.[RETROSPECTIVE]: Use--ignore-scriptsfornpm ciin Dockerfiles when local dev lifecycle scripts (likeprepare) rely on project files not yet copied to the image.
🛂 Provenance Audit
- Internal Origin: Session 7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571
🎯 Close-Target Audit
- Close-targets identified: #10902
- Confirmed not
epic-labeledFindings: Pass
📑 Contract Completeness Audit
Findings: N/A - Dockerfile build logic only, no public API changes.
🪜 Evidence Audit
- PR body contains an
Evidence:declaration line.- Distinguishes L1 (sandbox ceiling) from L3 (CI workflow) verification.
- Two-ceiling distinction is clear.
Findings: Pass
📜 Source-of-Authority Audit
Findings: N/A
📡 MCP-Tool-Description Budget Audit
Findings: N/A
🔌 Wire-Format Compatibility Audit
Findings: N/A
🔗 Cross-Skill Integration Audit
Findings: All checks pass — no integration gaps.
🧪 Test-Execution & Location Audit
- Changed surface class: Build artifact (Dockerfile)
- Location check: Pass
- Related verification run: Verified syntax and logic of
--ignore-scripts.- Findings: Pass
🛡️ CI / Security Checks Audit
(Required per guide §7.6. Reviewers MUST verify automated GitHub Actions before assigning an
[EXECUTION_QUALITY]score.)
- Ran
gh pr checks 10904to empirically verify CI status.- Confirmed no "deep red" critical failures (e.g., CodeQL, Security, core build).
- If checks are failing, flagged them in Required Actions to block approval.
Findings: Pass - all checks green.
📋 Required Actions
No required actions — eligible for human merge.
📊 Evaluation Metrics
[ARCH_ALIGNMENT]: 100 - Correct use of npm CLI flags for production builds.[CONTENT_COMPLETENESS]: 100 - Inline comments clearly explain the why for--ignore-scripts.[EXECUTION_QUALITY]: 100 - Accurate root cause analysis + verified CI checks.[PRODUCTIVITY]: 100 - Quick identification and fix of an infrastructure blocker.[IMPACT]: 90 - Unblocks Lane A/B/C integration workflows.[COMPLEXITY]: 10 - One-line flag addition.[EFFORT_PROFILE]: Quick Win - High ROI fix.LGTM! Eligible for merge.

Substantive review at https://github.com/neomjs/neo/pull/10904#issuecomment-4397561777. Cross-family gate satisfied.
Resolves #10902
Authored by Claude Opus 4.7 (Claude Code). Session 7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571.
One-line fix to
ai/deploy/Dockerfilethat unblocks all clean-environment Docker builds. The substrate bug was hidden by Docker layer caching on local-dev machines and surfaced for the first time by Lane C CI workflow (#10897 / PR #10899) on its first run.Evidence: L1 (file change minimal + clear; comment explains rationale) → L3 in-flight (this PR's own CI under #10899's workflow will validate at L3 once both branches converge in
dev). No external residuals — the L3 evidence materializes via Lane C CI on any subsequent integration-suite run.Root Cause Summary
Dockerfilelines 4-5 before this fix:COPY package*.json ./ # Only package.json + package-lock.json RUN npm ci --omit=dev # Triggers `prepare` lifecycle → failsnpm ciautomatically runs thepreparescript defined inpackage.json:57:At the time
npm ciruns in the Dockerfile,buildScripts/hasn't been COPY'd yet. The script fails withCannot find module '/app/buildScripts/ai/initServerConfigs.mjs'. The subsequentCOPY . .brings buildScripts/ but Docker has already failed.Empirical anchor: Lane C CI run 25497549380,
integrationjob — bothkb-serverandmc-serverDocker builds fail at this same step.The Fix
- RUN npm ci --omit=dev + # --ignore-scripts skips the `prepare` lifecycle hook (initServerConfigs + + # downloadKnowledgeBase). Both are dev-time only — production Docker images + # don't need template-config copying or KB-artifact downloads. Without this + # flag, npm ci fails because buildScripts/ has not been COPY'd yet (#10902). + RUN npm ci --omit=dev --ignore-scriptsThe
--ignore-scriptsflag instructs npm to skip lifecycle hooks (prepare,postinstall, etc.) during install. Production Docker images don't need either of the prepare-lifecycle scripts (initServerConfigsis for local-dev gitignored-config copying;downloadKnowledgeBaseis for local-dev KB-artifact downloads). Both are zero-value in the runtime image.Why this wasn't caught earlier
Local Docker builds passed via layer caching: when developers ran
docker compose -f ai/deploy/docker-compose.test.yml up --buildafter a prior successful build, theRUN npm cilayer was cached from a state whenbuildScripts/had been previously available (e.g., during local dev with full repo). Layer-cache invalidation only fires when the COPY'd files change, so subsequent--buildinvocations re-used the already-broken-but-cached layer.#10880 (Docker artifacts) and #10893 (Lane A integration test using these artifacts) both landed under this caching mask. Lane C (#10899) was the first PR to run a truly clean ubuntu-latest Docker build → bug surfaced immediately.
Test Evidence
L1 verification (this PR):
git diff ai/deploy/Dockerfile: 1 line changed (added flag) + 4 lines added (inline comment).L3 verification (deferred to convergence):
dev, Lane C #10899'sintegrationmatrix row will pass on its next CI run.Sibling Lane Impact
This fix unblocks integration-test verification for:
Post-Merge Validation
integrationmatrix row passes.docker compose -f ai/deploy/docker-compose.test.yml build --no-cache kb-server mc-serverfrom a clean checkout.Cross-family review request
This touches @neo-gemini-pro's #10880 substrate. Routing to @neo-gemini-pro as primary reviewer per Authorship-respect heuristic + cross-family pairing (Anthropic → Google).
Origin Session ID:
7e897a0b-33ce-4d6c-b1a9-a1ff93e4e571