Context
The dependency update on origin/dev moved Commander to 15.0.0. Current CI for PR #14386 now fails in the unit job before completing the suite because several buildScripts/** modules still import commander/esm.mjs.
Live latest-open sweep: checked the latest 20 open issues at 2026-06-30T23:12Z; no equivalent Commander 15 / commander/esm.mjs buildScripts compatibility ticket found. Exact GitHub duplicate searches for commander esm.mjs and ERR_PACKAGE_PATH_NOT_EXPORTED commander returned zero open issues. A2A in-flight sweep: checked latest 30 all-state messages at 2026-06-30T23:12Z; no overlapping buildScripts/Commander lane claim found.
The Problem
V-B-A proves the new Commander package no longer exports the historical subpath:
- Local
npm run agent-preflight -- <changed files> fails before checking files with ERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './esm.mjs' is not defined by "exports" in node_modules/commander/package.json from buildScripts/util/agent-preflight.mjs.
- GitHub Actions unit job
84419181573 for PR #14386 fails with the same ERR_PACKAGE_PATH_NOT_EXPORTED class from buildScripts/docs/index/discussions.mjs, tickets.mjs, release.mjs, docs/seo/generate.mjs, and util/agent-preflight.mjs.
- Repo sweep shows AI scripts already import Commander from
commander, while multiple build scripts still import from commander/esm.mjs.
The Architectural Reality
Commander is the CLI parser dependency shared by build scripts, creation scripts, docs index/SEO helpers, and the local agent preflight helper. Commander 15 exposes the package root for ESM named imports; it does not expose the old commander/esm.mjs subpath. The owning substrate is therefore the buildScripts import surface, not the AI MCP schema layer.
The Fix
- Replace
import {Command} from 'commander/esm.mjs' in buildScripts/** with import {Command} from 'commander'.
- Keep call sites and CLI behavior unchanged.
- Verify the previously failing buildScripts entry points can import under the updated dependency set.
- Re-run local agent preflight and current PR unit CI after the fix.
Contract Ledger Matrix
| Target Surface |
Source of Authority |
Proposed Behavior |
Fallback |
Docs |
Evidence |
| BuildScripts Commander imports |
buildScripts/** CLI modules |
Import Command from the package root supported by Commander 15 |
Import-time failure blocks unit CI and local agent preflight |
Existing CLI code comments/JSDoc |
Direct Node import probes + CI unit failure log |
Decision Record impact
none
Acceptance Criteria
Out of Scope
- No redesign of build scripts or CLI behavior.
- No package version change.
- No AI MCP/Zod schema changes; those remain covered by #14385.
Avoided Traps
- Do not downgrade Commander to preserve a removed subpath; the repo already uses root
commander ESM imports successfully in ai/** scripts.
- Do not treat this as a test flake; both local preflight and GitHub CI fail deterministically at import time.
Related
Related: PR #14386
Related: #14385
Origin Session ID: 019f18b1-1b14-7900-a06f-8ffdc43790b1
Handoff Retrieval Hint: "Commander 15 commander/esm.mjs ERR_PACKAGE_PATH_NOT_EXPORTED buildScripts unit CI agent-preflight"
Context
The dependency update on
origin/devmoved Commander to15.0.0. Current CI for PR #14386 now fails in theunitjob before completing the suite because severalbuildScripts/**modules still importcommander/esm.mjs.Live latest-open sweep: checked the latest 20 open issues at 2026-06-30T23:12Z; no equivalent Commander 15 /
commander/esm.mjsbuildScripts compatibility ticket found. Exact GitHub duplicate searches forcommander esm.mjsandERR_PACKAGE_PATH_NOT_EXPORTED commanderreturned zero open issues. A2A in-flight sweep: checked latest 30 all-state messages at 2026-06-30T23:12Z; no overlapping buildScripts/Commander lane claim found.The Problem
V-B-A proves the new Commander package no longer exports the historical subpath:
npm run agent-preflight -- <changed files>fails before checking files withERR_PACKAGE_PATH_NOT_EXPORTED: Package subpath './esm.mjs' is not defined by "exports" in node_modules/commander/package.jsonfrombuildScripts/util/agent-preflight.mjs.84419181573for PR #14386 fails with the sameERR_PACKAGE_PATH_NOT_EXPORTEDclass frombuildScripts/docs/index/discussions.mjs,tickets.mjs,release.mjs,docs/seo/generate.mjs, andutil/agent-preflight.mjs.commander, while multiple build scripts still import fromcommander/esm.mjs.The Architectural Reality
Commander is the CLI parser dependency shared by build scripts, creation scripts, docs index/SEO helpers, and the local agent preflight helper. Commander 15 exposes the package root for ESM named imports; it does not expose the old
commander/esm.mjssubpath. The owning substrate is therefore the buildScripts import surface, not the AI MCP schema layer.The Fix
import {Command} from 'commander/esm.mjs'inbuildScripts/**withimport {Command} from 'commander'.Contract Ledger Matrix
buildScripts/**CLI modulesCommandfrom the package root supported by Commander 15Decision Record impact
none
Acceptance Criteria
buildScripts/**module importscommander/esm.mjs.npm run agent-preflight -- <changed files>gets past the Commander import boundary.ERR_PACKAGE_PATH_NOT_EXPORTEDfrom Commander.Out of Scope
Avoided Traps
commanderESM imports successfully inai/**scripts.Related
Related: PR #14386 Related: #14385
Origin Session ID: 019f18b1-1b14-7900-a06f-8ffdc43790b1
Handoff Retrieval Hint: "Commander 15 commander/esm.mjs ERR_PACKAGE_PATH_NOT_EXPORTED buildScripts unit CI agent-preflight"