Await Node migration entrypoints to reject silent completion
A Node.js ESM migration command should await its asynchronous entrypoint at module scope, then verify the migration ledger before reporting success. Calling an async function with only a rejection handler can exit successfully when its promise remains unresolved and no event-loop handles remain. A fresh-process regression should simulate unfinished migration and connection shutdown separately, as well as ordinary rejection and missing ledger state. Top-level await makes the unfinished cases fail, but does not diagnose why a database client stopped making progress or replace connection deadlines. Preserve any dedicated failure codes used by safe ephemeral-environment recovery.
Applies when: A CI migration command exits successfully without reaching its completion receipt. Keywords: Node ESM migration promise exit CI postgres ledger await completion