@zaaxch/tailframe 4.0.2 → 4.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/new.mjs +23 -15
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaaxch/tailframe",
3
- "version": "4.0.2",
3
+ "version": "4.0.3",
4
4
  "description": "Tailframe architecture toolkit: validates the Tailframe structure, import-boundary, and file-convention contracts. The package version is the contract version.",
5
5
  "type": "module",
6
6
  "bin": {
package/src/new.mjs CHANGED
@@ -551,7 +551,7 @@ ${options.ui ? "- In production, serve the compiled UI from `dist/public` with a
551
551
  The ECR build targets \`linux/amd64\`. ${options.ui ? "Its default immutable tag is `<product-sha>` and production Compose requires that exact tag." : "Its default immutable tag is `<product-sha>` and production Compose requires that exact tag."} The runtime image contains production dependencies only and runs as the Node user.${options.ui && options.auth === "firebase" ? ` The build requires \`${ui}/.env.production\` and mounts it as a BuildKit secret only while Vite compiles the browser bundle; it is not copied into the final image.` : ""}
552
552
 
553
553
  ## Production deployment
554
- Pull requests into product \`main\` validate release candidates. The resulting \`main\` push validates again before GitHub Actions may publish an immutable image tagged with the full product commit SHA. Image publication and production deployment are separate workflows: deployment is manual from \`main\`, accepts only an already-published full SHA from \`main\` history, and checks out that exact commit for deployment files. GitHub Actions may replace files under \`/opt/${options.name}/current\` and MUST NOT replace persistent configuration, credentials, keyfiles, or data under \`/opt/${options.name}/shared\`. Keep Node runtime behavior in the shared service \`.env.production\`, Compose interpolation and infrastructure credentials in \`.env.infrastructure\`, and fixed topology wiring in Compose \`environment:\`. The optional UI build-time \`.env.production\` is a separate ephemeral file. Do not run deployment until the host and GitHub environments have been bootstrapped according to \`docs/production-deployment.md\`.
554
+ Pull requests into product \`main\` validate release candidates. The resulting \`main\` push validates again before GitHub Actions may publish an immutable image tagged with the full product commit SHA. Image publication and production deployment are separate workflows with distinct AWS roles: the release role publishes, while the pull-only deployment role manually deploys from \`main\` using an already-published full SHA from \`main\` history and that commit's deployment files. Product data migrations must authenticate to the registry, pull and digest-verify that exact release image, and explicitly select the production datastore; never inherit rehearsal image or target defaults. GitHub Actions may replace files under \`/opt/${options.name}/current\` and MUST NOT replace persistent configuration, credentials, keyfiles, or data under \`/opt/${options.name}/shared\`. Keep Node runtime behavior in the shared service \`.env.production\`, Compose interpolation and infrastructure credentials in \`.env.infrastructure\`, and fixed topology wiring in Compose \`environment:\`. The optional UI build-time \`.env.production\` is a separate ephemeral file. Do not run deployment until the host and GitHub environments have been bootstrapped according to \`docs/production-deployment.md\`.
555
555
 
556
556
  ## Tests and validation
557
557
  Run \`pnpm validate:architecture\` and \`pnpm format:check\` after changing files or imports. The generated service also includes unit tests and ${postgres ? "PostgreSQL-backed" : "Mongo-backed"} integration tests. Run focused service database tests through pnpm for the full service check. Test use cases, policies, ${postgres ? "PostgreSQL" : "Mongo"} repository adapters, and HTTP boundaries where behavior lives. Every public operation needs success and error-envelope coverage; authenticated operations need trusted-identity coverage; persisted capabilities need ${postgres ? "PostgreSQL" : "Mongo"} ownership/query coverage; UI-enabled services must verify that \`/api\` paths never fall through to the SPA. All AWS/ECR and Docker commands, including the release image script, must run outside the sandbox from the first attempt.
@@ -872,7 +872,7 @@ jobs:
872
872
  github.event_name == 'push' &&
873
873
  vars.AWS_ACCOUNT_ID != '' &&
874
874
  vars.AWS_REGION != '' &&
875
- vars.AWS_ROLE_ARN != ''
875
+ vars.AWS_RELEASE_ROLE_ARN != ''
876
876
  runs-on: ubuntu-latest
877
877
  environment:
878
878
  name: release
@@ -892,7 +892,7 @@ jobs:
892
892
  - name: Configure AWS credentials
893
893
  uses: aws-actions/configure-aws-credentials@v6
894
894
  with:
895
- role-to-assume: \${{ vars.AWS_ROLE_ARN }}
895
+ role-to-assume: \${{ vars.AWS_RELEASE_ROLE_ARN }}
896
896
  aws-region: \${{ vars.AWS_REGION }}
897
897
 
898
898
  - name: Resolve immutable image
@@ -950,8 +950,8 @@ ${workflowUiEnvironment}
950
950
  {
951
951
  echo "### ${title} release image"
952
952
  echo
953
- echo "- Image: \`\${IMAGE}:\${IMAGE_TAG}\`"
954
- echo "- Digest: \`\${IMAGE_DIGEST}\`"
953
+ printf -- '- Image: \`%s:%s\`\\n' "$IMAGE" "$IMAGE_TAG"
954
+ printf -- '- Digest: \`%s\`\\n' "$IMAGE_DIGEST"
955
955
  } >> "$GITHUB_STEP_SUMMARY"
956
956
  `);
957
957
  add(".github/workflows/deploy.yml", `name: Deploy release image
@@ -1009,7 +1009,7 @@ jobs:
1009
1009
  - name: Configure AWS credentials
1010
1010
  uses: aws-actions/configure-aws-credentials@v6
1011
1011
  with:
1012
- role-to-assume: \${{ vars.AWS_ROLE_ARN }}
1012
+ role-to-assume: \${{ vars.AWS_DEPLOY_ROLE_ARN }}
1013
1013
  aws-region: \${{ vars.AWS_REGION }}
1014
1014
 
1015
1015
  - name: Resolve and verify image
@@ -1073,8 +1073,8 @@ jobs:
1073
1073
  {
1074
1074
  echo "### ${title} production deployment"
1075
1075
  echo
1076
- echo "- Image: \`\${IMAGE}:\${IMAGE_TAG}\`"
1077
- echo "- Digest: \`\${IMAGE_DIGEST}\`"
1076
+ printf -- '- Image: \`%s:%s\`\\n' "$IMAGE" "$IMAGE_TAG"
1077
+ printf -- '- Digest: \`%s\`\\n' "$IMAGE_DIGEST"
1078
1078
  } >> "$GITHUB_STEP_SUMMARY"
1079
1079
  `);
1080
1080
  add(`${svc}/scripts/deploy_remote.sh`, `#!/usr/bin/env bash
@@ -1140,8 +1140,8 @@ Only service${options.ui ? ", UI," : ","} workspace, lockfile, architecture, and
1140
1140
  The ECR build job runs only for the post-merge \`main\` push and remains skipped until the repository AWS variables are
1141
1141
  configured. No push or merge deploys production automatically.
1142
1142
 
1143
- Configure the ECR repository with immutable image tags and restrict routine push permission to the repository's
1144
- release workflow. Record the full commit SHA and ECR digest; deployment and migration must use that release image.
1143
+ Configure the ECR repository with immutable image tags. The release-only role may publish; the distinct deployment
1144
+ role is pull-only. Record the full commit SHA and ECR digest; deployment and product migrations use that release image.
1145
1145
 
1146
1146
  The host separates replaceable artifacts from persistent state:
1147
1147
 
@@ -1192,10 +1192,10 @@ Use a fresh ${postgres ? "PostgreSQL" : "MongoDB"} data directory. Migrating an
1192
1192
 
1193
1193
  ## GitHub repository variables
1194
1194
 
1195
- Configure \`AWS_ACCOUNT_ID\`, \`AWS_REGION\`, and \`AWS_ROLE_ARN\` as repository variables for the
1196
- repository-restricted OIDC role. Optionally set \`ECR_REPOSITORY\`; the default is \`${options.name}\`.
1195
+ Configure \`AWS_ACCOUNT_ID\`, \`AWS_REGION\`, \`AWS_RELEASE_ROLE_ARN\`, and \`AWS_DEPLOY_ROLE_ARN\` as repository
1196
+ variables. Optionally set \`ECR_REPOSITORY\`; the default is \`${options.name}\`.
1197
1197
 
1198
- The ECR repository and AWS OIDC provider/role are provisioned separately. Workflows never store long-lived AWS keys
1198
+ The ECR repository and AWS OIDC provider/roles are provisioned separately. Workflows never store long-lived AWS keys
1199
1199
  or create cloud infrastructure.
1200
1200
 
1201
1201
  ## GitHub release environment
@@ -1209,8 +1209,10 @@ Configure \`DEPLOY_HOST\` and \`DEPLOY_USER\` as production-environment variable
1209
1209
  - \`DEPLOY_SSH_PRIVATE_KEY\`: dedicated host deployment key.
1210
1210
  - \`DEPLOY_SSH_KNOWN_HOSTS\`: pinned host key.
1211
1211
 
1212
- Restrict the production environment's deployment branches to \`main\`. Required reviewer approval MAY add a second
1213
- manual gate, but the branch restriction and manual full-SHA input remain mandatory.
1212
+ Restrict both environments' deployment branches to \`main\`. The release role trust accepts only the repository's
1213
+ \`release\` environment OIDC subject; the pull-only deployment role accepts only its \`production\` subject. Use the
1214
+ repository's active GitHub subject format: legacy subjects name the owner/repository, while immutable subjects use
1215
+ their IDs. Do not use a repository-wide wildcard. Required reviewer approval MAY add a second manual gate.
1214
1216
 
1215
1217
  ## Deploy and rollback
1216
1218
 
@@ -1223,6 +1225,12 @@ The remote script requires the provisioned infrastructure file, atomically repla
1223
1225
  full-SHA release and running the same workflow. Never use \`docker compose down -v\` in production; image rollback
1224
1226
  does not restore database state.
1225
1227
 
1228
+ ## Product data-migration handoff
1229
+
1230
+ Tailframe does not generate product-specific data-migration orchestration. Before a production data migration,
1231
+ authenticate to ECR, pull the selected full-SHA release image, verify its digest against the release record, and
1232
+ explicitly configure the production datastore target. Never inherit a rehearsal URI, local image default, or source build.
1233
+
1226
1234
  ${postgres ? "PostgreSQL" : "MongoDB"} and optional Redis expose no host ports and require authentication. Verify API readiness, container health,
1227
1235
  database/cache authentication, file permissions, and off-host backup/restore before treating the deployment as
1228
1236
  production-ready. Product-specific TLS, capacity limits, migrations, and scheduled-work grace periods must be added