{"slug":"operations/PACKAGE_AND_DEPLOYMENT","title":"Package and Deployment","section":"operations","sectionLabel":"Operations","status":"unclassified","type":"document","path":"operations/PACKAGE_AND_DEPLOYMENT.mdx","bytes":4220,"description":null,"updated":null,"source":"integratewise/Integratewise-docs-wiki","content":"\nIntegrateWise is packaged and deployed as a Cloudflare Workers platform. The separate frontend-only repositories described in historical material are not deployment targets for this repository.\n\nThe cross-functional release decision, design-partner rollout, and public launch\nsequence live in [Go-Live and GTM Plan](GO_LIVE_AND_GTM_PLAN.md). This document\nremains the mechanical package and Worker deployment runbook.\n\n## Release boundary\n\nThe core Worker release profile is deliberately explicit:\n\n```text\npipeline → connector → mcp-connector → connector-sync → knowledge\n→ continuity → intelligence → workflow → l2 → gateway\n```\n\nGateway is always last. The profile includes only Workers that declare both locked deployment surfaces: `test` and canonical `prod`. A Worker must not be added until its surface configuration is complete.\n\n`mcp-connector` is checked separately because it must remain isolated as:\n\n```text\ntest: mcp-connector-test\nprod: mcp-connector-prod\n```\n\n## Package a release\n\nCreate an immutable source archive and SHA-256 checksum from the current commit:\n\n```bash\npnpm release:package\n```\n\nThe archive is placed in `releases/` and includes a `RELEASE_MANIFEST.json` with the commit, platform version, and deployment target. It uses `git archive`, so it excludes dependencies, build output, environment files, and any uncommitted work. To package a particular commit or tag:\n\n```bash\npnpm release:package -- --ref <commit-or-tag>\n```\n\n## Publish public packages\n\nOnly `@integratewise/sdk` and `@integratewise/spine-schema` are currently\npublishable frontend contracts. Services and implementation packages stay\nprivate; frontends call the Gateway through the SDK instead of importing service\ncode.\n\n```bash\n# Builds, typechecks, tests, and inspects both npm tarballs.\npnpm release:packages:check\n\n# Requires a clean worktree, npm authentication for @integratewise, and new versions.\npnpm release:packages:publish\n```\n\nThe publish command refuses to overwrite an existing npm version. Bump the\npackage versions and commit them before publishing.\n\n## Validate before deployment\n\nValidation is local and does not call Cloudflare:\n\n```bash\npnpm release:check -- --environment test\npnpm release:check -- --environment prod\n```\n\nIt verifies the selected Workers have an entry point and an environment-specific Worker name ending in `-test` or `-prod`.\n\nEvery non-dry deployment also runs Wrangler dry-runs first. A Wrangler warning blocks publication by default, because it commonly means an environment is missing a non-inherited binding. `--allow-wrangler-warnings` is an explicit operational override, not a normal release path.\n\n## Deploy to test\n\nTest is the first remote surface:\n\n```bash\npnpm release:deploy -- --environment test --service core\n```\n\nTo validate Wrangler builds without publishing a Worker:\n\n```bash\npnpm release:deploy -- --environment test --service core --dry-run\n```\n\nFor a shared release, use the **Release Core Workers** GitHub Action instead\nof a direct Worker deployment. It accepts only the locked core profile or one\nnamed core Worker, defaults to a dry run, and invokes this same canonical\nrelease script. Worker source changes and package changes do not publish\nWorkers automatically.\n\n## Deploy to production\n\nProduction uses the canonical `prod` environment. A non-dry deployment requires all of the following:\n\n- `--confirm-production`\n- `CLOUDFLARE_API_TOKEN`\n- CI, or `ALLOW_LOCAL_PROD_DEPLOY=true` after explicit approval\n- a recorded successful test-release run or change record when using the\n  shared GitHub Action\n\n```bash\npnpm release:deploy -- --environment prod --service core --confirm-production\n```\n\nLocal development is not a remote deployment surface. Use `pnpm dev` or a Worker’s `wrangler dev` command instead.\n\n## Verify\n\nAfter a successful production deployment, verify the Gateway health endpoint:\n\n```bash\npnpm release:verify\n```\n\nThe release validator proves configuration shape and Worker-name isolation. Before a first deployment or any storage-binding change, also confirm in Cloudflare that test and prod do not share KV namespaces, Queues, or D1 databases, as required by Platform Lock v1.0.\n"}