declapract-typescript-ehmpathy 0.49.11 → 0.49.13

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 (752) hide show
  1. package/dist/.test/assets/cache/declarations/practices/cache/.declapract.integration.test.ts +4 -4
  2. package/dist/.test/assets/cache/declarations/practices/cache/.test/assets/repo-with-valid-cache-package/package.json +1 -1
  3. package/dist/.test/assets/cache/declarations/practices/cache/best-practice/package.json +3 -3
  4. package/dist/.test/assets/cicd-service/declarations/declapract.declare.yml +9 -0
  5. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.declapract.integration.test.ts +175 -0
  6. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/.github/workflows/provision.yml +110 -0
  7. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/declapract.use.nords.yml +20 -0
  8. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/declapract.use.rds.yml +20 -0
  9. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/package.json +4 -0
  10. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.test/assets/demo-repo-service/declapract.use.nords.yml +20 -0
  11. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.test/assets/demo-repo-service/declapract.use.rds.yml +20 -0
  12. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/.test/assets/demo-repo-service/package.json +4 -0
  13. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/__snapshots__/.declapract.integration.test.ts.snap +24 -0
  14. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/__snapshots__/acceptanceContempFleetGuard.declapract.integration.test.ts.snap +13 -0
  15. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/__snapshots__/insync-grep.declapract.integration.test.ts.snap +5 -0
  16. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/__snapshots__/provision.yml.declapract.integration.test.ts.snap +297 -0
  17. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/acceptanceContempFleetGuard.declapract.integration.test.ts +89 -0
  18. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/old-names/.github/workflows/deploy_dev_on_master.yml.declapract.ts +3 -0
  19. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/old-names/.github/workflows/deploy_on_tag.yml.declapract.ts +3 -0
  20. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/old-names/.github/workflows/deploy_prod_on_tag.yml.declapract.ts +3 -0
  21. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.declapract.integration.test.ts +153 -0
  22. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.declapract.readme.md +38 -0
  23. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.github/workflows/provision.yml.declapract.integration.test.ts +167 -0
  24. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.github/workflows/provision.yml.declapract.ts +88 -0
  25. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.test/assets/repo-non-rds/readme.md +9 -0
  26. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.test/assets/repo-with-aws-resources-callee/provision/aws/resources.ts +5 -0
  27. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.test/assets/repo-with-schema-callee/provision/schema/init.sql +5 -0
  28. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/__snapshots__/.declapract.integration.test.ts.snap +183 -0
  29. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.declapract.readme.md +22 -0
  30. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.github/workflows/.deploy-sls.yml +163 -0
  31. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.github/workflows/.sql-schema-control.yml +154 -0
  32. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.github/workflows/.terraform.yml +118 -0
  33. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.github/workflows/deploy.yml +77 -0
  34. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.github/workflows/deploy.yml.declapract.ts +15 -0
  35. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.github/workflows/provision.yml +110 -0
  36. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/.github/workflows/provision.yml.declapract.ts +74 -0
  37. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/best-practice/package.json +7 -0
  38. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/insync-grep.declapract.integration.test.ts +76 -0
  39. package/dist/.test/assets/cicd-service/declarations/practices/cicd-service/provision.yml.declapract.integration.test.ts +182 -0
  40. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.declapract.integration.test.ts +224 -0
  41. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +38 -0
  42. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
  43. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
  44. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
  45. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
  46. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  47. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +42 -0
  48. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
  49. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
  50. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/ssm-cicd-param-names.declapract.integration.test.ts.snap +10 -0
  51. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
  52. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/database.sql.declapract.ts +3 -0
  53. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/extensions.sql.declapract.ts +13 -0
  54. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/schema.sql.declapract.ts +3 -0
  55. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.cicd.sql.declapract.ts +3 -0
  56. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.datalakedb.sql.declapract.ts +3 -0
  57. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/readme.md +5 -0
  58. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-config-file-names/codegen.sql.yml.declapract.ts +3 -0
  59. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +33 -0
  60. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/.declapract.readme.md +1 -0
  61. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/provision/docker/integration_test_db/<star><star>/<star>.declapract.ts +15 -0
  62. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/.declapract.readme.md +1 -0
  63. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/provision/docker/integration-test-db/<star><star>/<star>.declapract.ts +15 -0
  64. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/.declapract.readme.md +1 -0
  65. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json +8 -0
  66. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +10 -0
  67. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json +9 -0
  68. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +22 -0
  69. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/old-param-placeholder/config/<star>.json.declapract.ts +14 -0
  70. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/.declapract.readme.md +1 -0
  71. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +12 -0
  72. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +13 -0
  73. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.declapract.integration.test.ts +88 -0
  74. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.declare.yml +4 -0
  75. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.use.yml +18 -0
  76. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/package.json +4 -0
  77. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/provision/aws/product/parameter-store.tf +23 -0
  78. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/__snapshots__/.declapract.integration.test.ts.snap +44 -0
  79. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/provision/aws/product/parameter-store.tf.declapract.ts +55 -0
  80. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.declapract.readme.md +1 -0
  81. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/src/utils/database/withDatabaseConnection.ts +3 -0
  82. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +58 -0
  83. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +18 -0
  84. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml.declapract.ts +3 -0
  85. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/codegen.sql.schema.yml +6 -0
  86. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/codegen.sql.types.yml +16 -0
  87. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/config/prep.json +36 -0
  88. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/config/prep.json.declapract.ts +15 -0
  89. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/config/prod.json +36 -0
  90. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +15 -0
  91. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/config/test.json +33 -0
  92. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +15 -0
  93. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/package.json +30 -0
  94. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/package.json.declapract.ts +3 -0
  95. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/aws/readme.md +79 -0
  96. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +106 -0
  97. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.ts +30 -0
  98. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile +7 -0
  99. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/docker-compose.yml +18 -0
  100. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/.gitignore +3 -0
  101. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/readme.md +3 -0
  102. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +25 -0
  103. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/connection.config.js +29 -0
  104. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/control.yml +7 -0
  105. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +97 -0
  106. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.database.sql +10 -0
  107. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql +16 -0
  108. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +37 -0
  109. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.schema.sql +11 -0
  110. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.cicd.sql +14 -0
  111. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.datalakedb.sql +12 -0
  112. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/default_transaction_isolation.sql +6 -0
  113. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/user.service.sql +16 -0
  114. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml +9 -0
  115. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml.declapract.ts +3 -0
  116. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +110 -0
  117. package/dist/{practices/persist-with-rds/best-practice/src/utils/database/getDatabaseConnection.integration.test.ts → .test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts} +3 -3
  118. package/dist/{practices/persist-with-rds/best-practice/src/utils/database/getDatabaseConnection.ts → .test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts} +1 -1
  119. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +53 -0
  120. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +33 -0
  121. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
  122. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
  123. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
  124. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/ssm-cicd-param-names.declapract.integration.test.ts +73 -0
  125. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
  126. package/dist/.test/assets/cicd-service/declarations/useCases.yml +13 -0
  127. package/dist/.test/assets/environments/declarations/declapract.declare.yml +4 -0
  128. package/dist/.test/assets/environments/declarations/practices/environments/.declapract.integration.test.ts +136 -0
  129. package/dist/.test/assets/environments/declarations/practices/environments/__snapshots__/.declapract.integration.test.ts.snap +55 -0
  130. package/dist/.test/assets/environments/declarations/practices/environments/bad-practices/old-dev-scripts/package.json.declapract.ts +59 -0
  131. package/dist/.test/assets/environments/declarations/practices/environments/bad-practices/old-stage-enum/.declapract.integration.test.ts +133 -0
  132. package/dist/.test/assets/environments/declarations/practices/environments/bad-practices/old-stage-enum/.test/assets/demo-repo-with-stage-enum/declapract.use.yml +8 -0
  133. package/dist/.test/assets/environments/declarations/practices/environments/bad-practices/old-stage-enum/.test/assets/demo-repo-with-stage-enum/package.json +4 -0
  134. package/dist/.test/assets/environments/declarations/practices/environments/bad-practices/old-stage-enum/.test/assets/demo-repo-with-stage-enum/src/logic/getDeployTarget.ts +15 -0
  135. package/dist/.test/assets/environments/declarations/practices/environments/bad-practices/old-stage-enum/__snapshots__/.declapract.integration.test.ts.snap +40 -0
  136. package/dist/.test/assets/environments/declarations/practices/environments/bad-practices/old-stage-enum/src/<star><star>/<star>.ts.declapract.ts +304 -0
  137. package/dist/.test/assets/environments/declarations/practices/environments/best-practice/.declapract.readme.md +61 -0
  138. package/dist/.test/assets/environments/declarations/practices/environments/best-practice/package.json +7 -0
  139. package/dist/.test/assets/environments/declarations/practices/environments/best-practice/package.json.declapract.ts +3 -0
  140. package/dist/.test/assets/environments/declarations/practices/environments/best-practice/src/access/sdks/sdkAwsLambdaEnvAccessAncient.ts +32 -0
  141. package/dist/.test/assets/environments/declarations/practices/environments/best-practice/src/access/sdks/sdkAwsLambdaEnvAccessContemp.ts +14 -0
  142. package/dist/.test/assets/environments/declarations/practices/environments/best-practice/src/utils/environment.ts +9 -0
  143. package/dist/.test/assets/environments/declarations/useCases.yml +5 -0
  144. package/dist/.test/assets/expo/declarations/practices/cicd-app-react-native-expo/.declapract.integration.test.ts +122 -22
  145. package/dist/.test/assets/expo/declarations/practices/cicd-app-react-native-expo/__snapshots__/.declapract.integration.test.ts.snap +40 -29
  146. package/dist/.test/assets/expo/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/.deploy-expo.yml +16 -6
  147. package/dist/.test/assets/expo/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/deploy.yml +11 -11
  148. package/dist/.test/assets/expo/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/test.yml +3 -5
  149. package/dist/.test/assets/expo/declarations/practices/cicd-app-react-native-expo/best-practice/package.json +2 -2
  150. package/dist/.test/assets/expo/declarations/practices/node/bad-practices/self-deps-not-link/.declapract.integration.test.ts +102 -0
  151. package/dist/.test/assets/expo/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.declare.yml +4 -0
  152. package/dist/.test/assets/expo/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.use.yml +8 -0
  153. package/dist/.test/assets/expo/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/package.json +15 -0
  154. package/dist/.test/assets/expo/declarations/practices/node/bad-practices/self-deps-not-link/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  155. package/dist/.test/assets/expo/declarations/practices/node/bad-practices/self-deps-not-link/package.json.declapract.ts +22 -29
  156. package/dist/.test/assets/expo/declarations/practices/node/best-practice/.npmrc.declapract.ts +5 -1
  157. package/dist/.test/assets/expo/declarations/practices/node/best-practice/package.json +1 -1
  158. package/dist/.test/assets/expo-fullusecase/declarations/practices/cache/.declapract.integration.test.ts +4 -4
  159. package/dist/.test/assets/expo-fullusecase/declarations/practices/cache/.test/assets/repo-with-valid-cache-package/package.json +1 -1
  160. package/dist/.test/assets/expo-fullusecase/declarations/practices/cache/best-practice/package.json +3 -3
  161. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-app-react-native-expo/.declapract.integration.test.ts +122 -22
  162. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-app-react-native-expo/__snapshots__/.declapract.integration.test.ts.snap +40 -29
  163. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/.deploy-expo.yml +16 -6
  164. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/deploy.yml +11 -11
  165. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/test.yml +3 -5
  166. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-app-react-native-expo/best-practice/package.json +2 -2
  167. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/.declapract.integration.test.ts +25 -0
  168. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/__snapshots__/.declapract.integration.test.ts.snap +11 -23
  169. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/__snapshots__/declastruct-insync-grep.declapract.integration.test.ts.snap +3 -0
  170. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/best-practice/.github/workflows/.declastruct.yml +22 -8
  171. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml +11 -23
  172. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml.declapract.ts +12 -1
  173. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/best-practice/.github/workflows/report-slow-tests.sh +65 -0
  174. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/declastruct-insync-grep.declapract.integration.test.ts +49 -0
  175. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/report-slow-tests.play.declapract.integration.test.ts +144 -0
  176. package/dist/.test/assets/expo-fullusecase/declarations/practices/conventional-commits/__snapshots__/commitlint-body-max-line.declapract.integration.test.ts.snap +3 -0
  177. package/dist/.test/assets/expo-fullusecase/declarations/practices/conventional-commits/best-practice/commitlint.config.js +5 -0
  178. package/dist/.test/assets/expo-fullusecase/declarations/practices/conventional-commits/best-practice/package.json +1 -1
  179. package/dist/.test/assets/expo-fullusecase/declarations/practices/conventional-commits/commitlint-body-max-line.declapract.integration.test.ts +49 -0
  180. package/dist/.test/assets/expo-fullusecase/declarations/practices/domain/.declapract.integration.test.ts +115 -0
  181. package/dist/.test/assets/expo-fullusecase/declarations/practices/domain/bad-practices/schematic-joi-model/src/{domain → domain.objects}/<star><star>/<star>.ts.declapract.ts +4 -1
  182. package/dist/.test/assets/expo-fullusecase/declarations/practices/domain/best-practice/package.json +2 -2
  183. package/dist/.test/assets/expo-fullusecase/declarations/practices/domain/best-practice/src/domain.objects/index.ts.declapract.ts +12 -0
  184. package/dist/.test/assets/expo-fullusecase/declarations/practices/errors/.declapract.integration.test.ts +121 -0
  185. package/dist/.test/assets/expo-fullusecase/declarations/practices/errors/bad-practices/own-implementation/src/<star><star>/UnexpectedCodePathError.ts.declapract.ts +8 -0
  186. package/dist/.test/assets/expo-fullusecase/declarations/practices/errors/best-practice/package.json +1 -1
  187. package/dist/.test/assets/expo-fullusecase/declarations/practices/format/.declapract.integration.test.ts +131 -0
  188. package/dist/.test/assets/expo-fullusecase/declarations/practices/format/__snapshots__/.declapract.integration.test.ts.snap +17 -0
  189. package/dist/.test/assets/expo-fullusecase/declarations/practices/format/bad-practices/prettier/prettier.config.js.declapract.ts +1 -1
  190. package/dist/.test/assets/expo-fullusecase/declarations/practices/format/best-practice/package.json.declapract.ts +36 -18
  191. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.declapract.integration.test.ts +57 -6
  192. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +2 -0
  193. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitattributes.declapract.ts +50 -37
  194. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitignore.declapract.ts +8 -0
  195. package/dist/.test/assets/expo-fullusecase/declarations/practices/husky/__snapshots__/check.timestamps.play.declapract.integration.test.ts.snap +7 -0
  196. package/dist/.test/assets/expo-fullusecase/declarations/practices/husky/best-practice/.husky/check.timestamps.sh +11 -2
  197. package/dist/.test/assets/expo-fullusecase/declarations/practices/husky/check.timestamps.play.declapract.integration.test.ts +65 -0
  198. package/dist/.test/assets/expo-fullusecase/declarations/practices/lint/__snapshots__/dpdmrc-exclude-policy.declapract.integration.test.ts.snap +3 -0
  199. package/dist/.test/assets/expo-fullusecase/declarations/practices/lint/bad-practices/depcheck-denylisted-ignores/.depcheckrc.yml.declapract.ts +4 -0
  200. package/dist/.test/assets/expo-fullusecase/declarations/practices/lint/best-practice/.depcheckrc.yml.declapract.ts +10 -9
  201. package/dist/.test/assets/expo-fullusecase/declarations/practices/lint/best-practice/.dpdmrc.yaml +10 -6
  202. package/dist/.test/assets/expo-fullusecase/declarations/practices/lint/dpdmrc-exclude-policy.declapract.integration.test.ts +50 -0
  203. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/bad-practices/self-deps-not-link/.declapract.integration.test.ts +102 -0
  204. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.declare.yml +4 -0
  205. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.use.yml +8 -0
  206. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/package.json +15 -0
  207. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/bad-practices/self-deps-not-link/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  208. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/bad-practices/self-deps-not-link/package.json.declapract.ts +22 -29
  209. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/best-practice/.npmrc.declapract.ts +5 -1
  210. package/dist/.test/assets/expo-fullusecase/declarations/practices/node/best-practice/package.json +1 -1
  211. package/dist/.test/assets/expo-fullusecase/declarations/practices/package-json-order/best-practice/package.json.declapract.ts +7 -1
  212. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.declapract.integration.test.ts +163 -13
  213. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-npm-to-pnpm/package.json +1 -1
  214. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-npm-to-pnpm/pnpm-workspace.yaml +3 -0
  215. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/__snapshots__/.declapract.integration.test.ts.snap +9 -2
  216. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/bad-practices/inert-build-allowlist/pnpm-workspace.yaml.declapract.ts +59 -0
  217. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/best-practice/.declapract.readme.md +1 -1
  218. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/best-practice/package.json +1 -1
  219. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/best-practice/package.json.declapract.ts +4 -2
  220. package/dist/.test/assets/expo-fullusecase/declarations/practices/provision-github/best-practice/package.json +2 -2
  221. package/dist/.test/assets/expo-fullusecase/declarations/practices/provision-github/best-practice/provision/github.repo/resources.ts +16 -0
  222. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
  223. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +7 -0
  224. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
  225. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
  226. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
  227. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  228. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
  229. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +27 -0
  230. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +6 -2
  231. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.declare.yml +4 -0
  232. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.use.yml +2 -0
  233. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
  234. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +58 -17
  235. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +46 -0
  236. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +165 -0
  237. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +18 -5
  238. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/package.json +8 -8
  239. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +89 -0
  240. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +145 -0
  241. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  242. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +104 -0
  243. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +2 -2
  244. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +9 -9
  245. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/package.json +3 -3
  246. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  247. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/{best-practice/package.json.shell-flags.declapract.integration.test.ts → package.json.shell-flags.declapract.integration.test.ts} +26 -16
  248. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/.declapract.integration.test.ts +7 -3
  249. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/.test/assets/repo-expo-greenfield/package.json +5 -1
  250. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/__snapshots__/.declapract.integration.test.ts.snap +17 -8
  251. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +60 -0
  252. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/best-practice/jest.acceptance.config.ts +5 -0
  253. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/best-practice/jest.integration.config.ts +5 -0
  254. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/best-practice/jest.integration.env.ts +5 -1
  255. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/best-practice/jest.unit.config.ts +5 -0
  256. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/best-practice/jest.unit.env.ts +6 -1
  257. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/best-practice/package.json.declapract.ts +190 -13
  258. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/package.json.declapract.integration.test.ts +94 -0
  259. package/dist/.test/assets/expo-fullusecase/declarations/practices/typescript-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +8 -0
  260. package/dist/.test/assets/expo-fullusecase/declarations/practices/typescript-expo/__snapshots__/tsconfig.json.declapract.integration.test.ts.snap +19 -0
  261. package/dist/.test/assets/expo-fullusecase/declarations/practices/typescript-expo/{best-practice/package.json.declapract.integration.test.ts → package.json.declapract.integration.test.ts} +15 -2
  262. package/dist/.test/assets/{expo-toolchain/declarations/practices/typescript-expo/best-practice → expo-fullusecase/declarations/practices/typescript-expo}/tsconfig.json.declapract.integration.test.ts +13 -2
  263. package/dist/.test/assets/expo-migration/declarations/practices/cicd-app-react-native-expo/.declapract.integration.test.ts +122 -22
  264. package/dist/.test/assets/expo-migration/declarations/practices/cicd-app-react-native-expo/__snapshots__/.declapract.integration.test.ts.snap +40 -29
  265. package/dist/.test/assets/expo-migration/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/.deploy-expo.yml +16 -6
  266. package/dist/.test/assets/expo-migration/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/deploy.yml +11 -11
  267. package/dist/.test/assets/expo-migration/declarations/practices/cicd-app-react-native-expo/best-practice/.github/workflows/test.yml +3 -5
  268. package/dist/.test/assets/expo-migration/declarations/practices/cicd-app-react-native-expo/best-practice/package.json +2 -2
  269. package/dist/.test/assets/expo-migration/declarations/practices/domain/.declapract.integration.test.ts +115 -0
  270. package/dist/{practices/domain/bad-practices/schematic-joi-model/src/domain → .test/assets/expo-migration/declarations/practices/domain/bad-practices/schematic-joi-model/src/domain.objects}/<star><star>/<star>.ts.declapract.ts +4 -1
  271. package/dist/.test/assets/expo-migration/declarations/practices/domain/best-practice/package.json +2 -2
  272. package/dist/.test/assets/expo-migration/declarations/practices/domain/best-practice/src/domain.objects/index.ts.declapract.ts +12 -0
  273. package/dist/.test/assets/expo-migration/declarations/practices/git/.declapract.integration.test.ts +57 -6
  274. package/dist/.test/assets/expo-migration/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +2 -0
  275. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes.declapract.ts +50 -37
  276. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitignore.declapract.ts +8 -0
  277. package/dist/.test/assets/expo-migration/declarations/practices/node/bad-practices/self-deps-not-link/.declapract.integration.test.ts +102 -0
  278. package/dist/.test/assets/expo-migration/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.declare.yml +4 -0
  279. package/dist/.test/assets/expo-migration/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.use.yml +8 -0
  280. package/dist/.test/assets/expo-migration/declarations/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/package.json +15 -0
  281. package/dist/.test/assets/expo-migration/declarations/practices/node/bad-practices/self-deps-not-link/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  282. package/dist/.test/assets/expo-migration/declarations/practices/node/bad-practices/self-deps-not-link/package.json.declapract.ts +22 -29
  283. package/dist/.test/assets/expo-migration/declarations/practices/node/best-practice/.npmrc.declapract.ts +5 -1
  284. package/dist/.test/assets/expo-migration/declarations/practices/node/best-practice/package.json +1 -1
  285. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.declapract.integration.test.ts +163 -13
  286. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-npm-to-pnpm/package.json +1 -1
  287. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-npm-to-pnpm/pnpm-workspace.yaml +3 -0
  288. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/__snapshots__/.declapract.integration.test.ts.snap +9 -2
  289. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/bad-practices/inert-build-allowlist/pnpm-workspace.yaml.declapract.ts +59 -0
  290. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/best-practice/.declapract.readme.md +1 -1
  291. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/best-practice/package.json +1 -1
  292. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/best-practice/package.json.declapract.ts +4 -2
  293. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
  294. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +7 -0
  295. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
  296. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
  297. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
  298. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  299. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
  300. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +27 -0
  301. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +6 -2
  302. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.declare.yml +4 -0
  303. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.use.yml +2 -0
  304. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
  305. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +58 -17
  306. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +46 -0
  307. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +165 -0
  308. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +18 -5
  309. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/package.json +8 -8
  310. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +89 -0
  311. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +145 -0
  312. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  313. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +104 -0
  314. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +2 -2
  315. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +9 -9
  316. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/package.json +3 -3
  317. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  318. package/dist/.test/assets/{expo-toolchain/declarations/practices/tests-any/best-practice → expo-migration/declarations/practices/tests-any}/package.json.shell-flags.declapract.integration.test.ts +26 -16
  319. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/.declapract.integration.test.ts +7 -3
  320. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/.test/assets/repo-expo-greenfield/package.json +5 -1
  321. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/__snapshots__/.declapract.integration.test.ts.snap +17 -8
  322. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +60 -0
  323. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/best-practice/jest.acceptance.config.ts +5 -0
  324. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/best-practice/jest.integration.config.ts +5 -0
  325. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/best-practice/jest.integration.env.ts +5 -1
  326. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/best-practice/jest.unit.config.ts +5 -0
  327. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/best-practice/jest.unit.env.ts +6 -1
  328. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/best-practice/package.json.declapract.ts +190 -13
  329. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/package.json.declapract.integration.test.ts +94 -0
  330. package/dist/.test/assets/expo-migration/declarations/practices/typescript-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +8 -0
  331. package/dist/.test/assets/expo-migration/declarations/practices/typescript-expo/__snapshots__/tsconfig.json.declapract.integration.test.ts.snap +19 -0
  332. package/dist/.test/assets/{expo-toolchain/declarations/practices/typescript-expo/best-practice → expo-migration/declarations/practices/typescript-expo}/package.json.declapract.integration.test.ts +15 -2
  333. package/dist/.test/assets/{expo-fullusecase/declarations/practices/typescript-expo/best-practice → expo-migration/declarations/practices/typescript-expo}/tsconfig.json.declapract.integration.test.ts +13 -2
  334. package/dist/.test/assets/expo-migration/repo-app-protools-shaped/.github/workflows/.deploy-expo.yml +1 -1
  335. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  336. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +104 -0
  337. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +2 -2
  338. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +9 -9
  339. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/package.json +3 -3
  340. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  341. package/dist/.test/assets/{expo-migration/declarations/practices/tests-any/best-practice → expo-toolchain/declarations/practices/tests-any}/package.json.shell-flags.declapract.integration.test.ts +26 -16
  342. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/.declapract.integration.test.ts +7 -3
  343. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/.test/assets/repo-expo-greenfield/package.json +5 -1
  344. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/__snapshots__/.declapract.integration.test.ts.snap +17 -8
  345. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +60 -0
  346. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/best-practice/jest.acceptance.config.ts +5 -0
  347. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/best-practice/jest.integration.config.ts +5 -0
  348. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/best-practice/jest.integration.env.ts +5 -1
  349. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/best-practice/jest.unit.config.ts +5 -0
  350. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/best-practice/jest.unit.env.ts +6 -1
  351. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/best-practice/package.json.declapract.ts +190 -13
  352. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/package.json.declapract.integration.test.ts +94 -0
  353. package/dist/.test/assets/expo-toolchain/declarations/practices/typescript-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +8 -0
  354. package/dist/.test/assets/expo-toolchain/declarations/practices/typescript-expo/__snapshots__/tsconfig.json.declapract.integration.test.ts.snap +19 -0
  355. package/dist/.test/assets/{expo-migration/declarations/practices/typescript-expo/best-practice → expo-toolchain/declarations/practices/typescript-expo}/package.json.declapract.integration.test.ts +15 -2
  356. package/dist/{practices/typescript-expo/best-practice → .test/assets/expo-toolchain/declarations/practices/typescript-expo}/tsconfig.json.declapract.integration.test.ts +13 -2
  357. package/dist/.test/assets/format/declarations/declapract.declare.yml +9 -0
  358. package/dist/.test/assets/format/declarations/practices/format/.declapract.integration.test.ts +131 -0
  359. package/dist/.test/assets/format/declarations/practices/format/__snapshots__/.declapract.integration.test.ts.snap +17 -0
  360. package/dist/.test/assets/format/declarations/practices/format/bad-practices/format-script/package.json.declapract.ts +26 -0
  361. package/dist/.test/assets/format/declarations/practices/format/bad-practices/prettier/.declapract.readme.md +6 -0
  362. package/dist/.test/assets/format/declarations/practices/format/bad-practices/prettier/.prettierignore +3 -0
  363. package/dist/.test/assets/format/declarations/practices/format/bad-practices/prettier/.prettierignore.declapract.ts +8 -0
  364. package/dist/.test/assets/format/declarations/practices/format/bad-practices/prettier/package.json +10 -0
  365. package/dist/.test/assets/format/declarations/practices/format/bad-practices/prettier/package.json.declapract.ts +35 -0
  366. package/dist/.test/assets/format/declarations/practices/format/bad-practices/prettier/prettier.config.js +10 -0
  367. package/dist/.test/assets/format/declarations/practices/format/bad-practices/prettier/prettier.config.js.declapract.ts +8 -0
  368. package/dist/.test/assets/format/declarations/practices/format/best-practice/package.json.declapract.ts +50 -0
  369. package/dist/.test/assets/format/declarations/practices/terraform-common/bad-practices/terraform-dir/.declapract.readme.md +8 -0
  370. package/dist/.test/assets/format/declarations/practices/terraform-common/bad-practices/terraform-dir/provision/terraform/<star><star>/<star>.declapract.ts +17 -0
  371. package/dist/.test/assets/format/declarations/practices/terraform-common/best-practice/.terraform-version +1 -0
  372. package/dist/.test/assets/format/declarations/practices/terraform-common/best-practice/package.json +6 -0
  373. package/dist/.test/assets/format/declarations/practices/terraform-common/best-practice/package.json.declapract.ts +3 -0
  374. package/dist/.test/assets/format/declarations/useCases.yml +13 -0
  375. package/dist/.test/assets/format/repo-with-terraform/declapract.use.yml +8 -0
  376. package/dist/.test/assets/format/repo-with-terraform/package.json +5 -0
  377. package/dist/.test/assets/format/repo-without-terraform/declapract.use.yml +6 -0
  378. package/dist/.test/assets/format/repo-without-terraform/package.json +5 -0
  379. package/dist/.test/assets/node-service/declarations/declapract.declare.yml +4 -0
  380. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/license/package.json.declapract.ts +22 -0
  381. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-client/.declapract.readme.md +55 -0
  382. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-client/package.json +5 -0
  383. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-client/package.json.declapract.ts +27 -0
  384. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-client/src/<star><star>/<star>.ts.declapract.ts +44 -0
  385. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/.declapract.integration.test.ts +103 -0
  386. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/.declapract.readme.md +60 -0
  387. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/.test/assets/demo-repo-with-simple-lambda-handlers/declapract.use.yml +5 -0
  388. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/.test/assets/demo-repo-with-simple-lambda-handlers/package.json +4 -0
  389. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/.test/assets/demo-repo-with-simple-lambda-handlers/src/contract/handlers/getWidget.ts +13 -0
  390. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/__snapshots__/.declapract.integration.test.ts.snap +44 -0
  391. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/package.json +5 -0
  392. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/package.json.declapract.ts +27 -0
  393. package/dist/.test/assets/node-service/declarations/practices/node-service/bad-practices/simple-lambda-handlers/src/<star><star>/<star>.ts.declapract.ts +130 -0
  394. package/dist/.test/assets/node-service/declarations/practices/node-service/best-practice/package.json +6 -0
  395. package/dist/.test/assets/node-service/declarations/practices/node-service/best-practice/package.json.declapract.ts +3 -0
  396. package/dist/.test/assets/node-service/declarations/useCases.yml +5 -0
  397. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.declapract.integration.test.ts +163 -13
  398. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-npm-to-pnpm/package.json +1 -1
  399. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-npm-to-pnpm/pnpm-workspace.yaml +3 -0
  400. package/dist/.test/assets/pnpm/declarations/practices/pnpm/__snapshots__/.declapract.integration.test.ts.snap +9 -2
  401. package/dist/.test/assets/pnpm/declarations/practices/pnpm/bad-practices/inert-build-allowlist/pnpm-workspace.yaml.declapract.ts +59 -0
  402. package/dist/.test/assets/pnpm/declarations/practices/pnpm/best-practice/.declapract.readme.md +1 -1
  403. package/dist/.test/assets/pnpm/declarations/practices/pnpm/best-practice/package.json +1 -1
  404. package/dist/.test/assets/pnpm/declarations/practices/pnpm/best-practice/package.json.declapract.ts +4 -2
  405. package/dist/.test/assets/runtime-schemas/declarations/declapract.declare.yml +4 -0
  406. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/.declapract.integration.test.ts +102 -0
  407. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/.declapract.readme.md +3 -0
  408. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/.test/assets/demo-repo-with-joi/declapract.use.yml +5 -0
  409. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/.test/assets/demo-repo-with-joi/package.json +4 -0
  410. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/.test/assets/demo-repo-with-joi/src/contract/schemas/widget.schema.ts +9 -0
  411. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/__snapshots__/.declapract.integration.test.ts.snap +37 -0
  412. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/package.json +5 -0
  413. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/package.json.declapract.ts +23 -0
  414. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/bad-practices/joi/src/<star><star>/<star>.ts.declapract.ts +79 -0
  415. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/best-practice/package.json +5 -0
  416. package/dist/.test/assets/runtime-schemas/declarations/practices/runtime-schemas/best-practice/package.json.declapract.ts +3 -0
  417. package/dist/.test/assets/runtime-schemas/declarations/useCases.yml +5 -0
  418. package/dist/.test/assets/tests-service/declarations/declapract.declare.yml +10 -0
  419. package/dist/.test/assets/tests-service/declarations/practices/tests-service/.test/assets/demo-repo-service/declapract.use.yml +5 -0
  420. package/dist/.test/assets/tests-service/declarations/practices/tests-service/.test/assets/demo-repo-service/package.json +4 -0
  421. package/dist/.test/assets/tests-service/declarations/practices/tests-service/__snapshots__/package.json.declapract.integration.test.ts.snap +26 -0
  422. package/dist/.test/assets/tests-service/declarations/practices/tests-service/asFunctionNameFromTestFileName.ts +7 -0
  423. package/dist/.test/assets/tests-service/declarations/practices/tests-service/best-practice/.declapract.readme.md +68 -0
  424. package/dist/.test/assets/tests-service/declarations/practices/tests-service/best-practice/blackbox/<star><star>/<star>.acceptance.test.ts.declapract.ts +3 -0
  425. package/dist/.test/assets/tests-service/declarations/practices/tests-service/best-practice/blackbox/lambdas/<star>.acceptance.test.ts.declapract.ts +56 -0
  426. package/dist/.test/assets/tests-service/declarations/practices/tests-service/best-practice/package.json +8 -0
  427. package/dist/.test/assets/tests-service/declarations/practices/tests-service/best-practice/package.json.declapract.ts +101 -0
  428. package/dist/.test/assets/tests-service/declarations/practices/tests-service/best-practice/src/<star><star>/<star>.integration.test.ts.declapract.ts +3 -0
  429. package/dist/.test/assets/tests-service/declarations/practices/tests-service/best-practice/src/<star><star>/<star>.test.ts.declapract.ts +3 -0
  430. package/dist/.test/assets/tests-service/declarations/practices/tests-service/package.json.declapract.integration.test.ts +204 -0
  431. package/dist/.test/assets/tests-service/declarations/useCases.yml +9 -0
  432. package/dist/__snapshots__/ancientTargetPublished.declapract.integration.test.ts.snap +42 -0
  433. package/dist/__snapshots__/workflowCallerCalleeReconciliation.declapract.integration.test.ts.snap +450 -0
  434. package/dist/__snapshots__/workflowEnvDeploymentFalse.declapract.integration.test.ts.snap +36 -0
  435. package/dist/actionPins.declapract.integration.test.ts +3 -18
  436. package/dist/ancientTargetPublished.declapract.integration.test.ts +174 -0
  437. package/dist/bestPracticeTemplateParse.declapract.integration.test.ts +169 -0
  438. package/dist/parsePackageJSONAdoption.declapract.integration.test.ts +136 -0
  439. package/dist/practiceTestFileLocation.declapract.integration.test.ts +75 -0
  440. package/dist/practices/cache/.declapract.integration.test.ts +4 -4
  441. package/dist/practices/cache/.test/assets/repo-with-valid-cache-package/package.json +1 -1
  442. package/dist/practices/cache/best-practice/package.json +3 -3
  443. package/dist/practices/cicd-app-react-native-expo/.declapract.integration.test.ts +122 -22
  444. package/dist/practices/cicd-app-react-native-expo/__snapshots__/.declapract.integration.test.ts.snap +40 -29
  445. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/.deploy-expo.yml +16 -6
  446. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/deploy.yml +11 -11
  447. package/dist/practices/cicd-app-react-native-expo/best-practice/.github/workflows/test.yml +3 -5
  448. package/dist/practices/cicd-app-react-native-expo/best-practice/package.json +2 -2
  449. package/dist/practices/cicd-common/.declapract.integration.test.ts +25 -0
  450. package/dist/practices/cicd-common/__snapshots__/.declapract.integration.test.ts.snap +11 -23
  451. package/dist/practices/cicd-common/__snapshots__/declastruct-insync-grep.declapract.integration.test.ts.snap +3 -0
  452. package/dist/practices/cicd-common/best-practice/.github/workflows/.declastruct.yml +22 -8
  453. package/dist/practices/cicd-common/best-practice/.github/workflows/.test.yml +11 -23
  454. package/dist/practices/cicd-common/best-practice/.github/workflows/.test.yml.declapract.ts +12 -1
  455. package/dist/practices/cicd-common/best-practice/.github/workflows/report-slow-tests.sh +65 -0
  456. package/dist/practices/cicd-common/declastruct-insync-grep.declapract.integration.test.ts +49 -0
  457. package/dist/practices/cicd-common/report-slow-tests.play.declapract.integration.test.ts +144 -0
  458. package/dist/practices/cicd-package/best-practice/.github/workflows/provision.yml +2 -1
  459. package/dist/practices/cicd-service/.declapract.integration.test.ts +175 -0
  460. package/dist/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/.github/workflows/provision.yml +110 -0
  461. package/dist/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/declapract.use.nords.yml +20 -0
  462. package/dist/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/declapract.use.rds.yml +20 -0
  463. package/dist/practices/cicd-service/.test/assets/demo-repo-pre-stamped-nords/package.json +4 -0
  464. package/dist/practices/cicd-service/.test/assets/demo-repo-service/declapract.use.nords.yml +20 -0
  465. package/dist/practices/cicd-service/.test/assets/demo-repo-service/declapract.use.rds.yml +20 -0
  466. package/dist/practices/cicd-service/.test/assets/demo-repo-service/package.json +4 -0
  467. package/dist/practices/cicd-service/__snapshots__/.declapract.integration.test.ts.snap +24 -0
  468. package/dist/practices/cicd-service/__snapshots__/acceptanceContempFleetGuard.declapract.integration.test.ts.snap +13 -0
  469. package/dist/practices/cicd-service/__snapshots__/insync-grep.declapract.integration.test.ts.snap +5 -0
  470. package/dist/practices/cicd-service/__snapshots__/provision.yml.declapract.integration.test.ts.snap +297 -0
  471. package/dist/practices/cicd-service/acceptanceContempFleetGuard.declapract.integration.test.ts +89 -0
  472. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.declapract.integration.test.ts +153 -0
  473. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.declapract.readme.md +38 -0
  474. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.github/workflows/provision.yml.declapract.integration.test.ts +167 -0
  475. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.github/workflows/provision.yml.declapract.ts +88 -0
  476. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.test/assets/repo-non-rds/readme.md +9 -0
  477. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.test/assets/repo-with-aws-resources-callee/provision/aws/resources.ts +5 -0
  478. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/.test/assets/repo-with-schema-callee/provision/schema/init.sql +5 -0
  479. package/dist/practices/cicd-service/bad-practices/rds-jobs-in-non-rds-service/__snapshots__/.declapract.integration.test.ts.snap +183 -0
  480. package/dist/practices/cicd-service/best-practice/.declapract.readme.md +18 -0
  481. package/dist/practices/cicd-service/best-practice/.github/workflows/.deploy-sls.yml +32 -11
  482. package/dist/practices/cicd-service/best-practice/.github/workflows/.sql-schema-control.yml +20 -10
  483. package/dist/practices/cicd-service/best-practice/.github/workflows/.terraform.yml +14 -4
  484. package/dist/practices/cicd-service/best-practice/.github/workflows/deploy.yml +17 -9
  485. package/dist/practices/cicd-service/best-practice/.github/workflows/provision.yml +15 -10
  486. package/dist/practices/cicd-service/best-practice/.github/workflows/provision.yml.declapract.ts +74 -0
  487. package/dist/practices/cicd-service/best-practice/package.json +3 -3
  488. package/dist/practices/cicd-service/insync-grep.declapract.integration.test.ts +76 -0
  489. package/dist/practices/cicd-service/provision.yml.declapract.integration.test.ts +182 -0
  490. package/dist/practices/commands/best-practice/package.json +2 -2
  491. package/dist/practices/commands/best-practice/src/contract/commands/sayHello.ts +3 -2
  492. package/dist/practices/config/.declapract.integration.test.ts +116 -0
  493. package/dist/practices/config/.test/assets/demo-repo-with-dev-config/config/dev.json +17 -0
  494. package/dist/practices/config/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
  495. package/dist/practices/config/.test/assets/demo-repo-with-dev-config/declapract.use.yml +9 -0
  496. package/dist/practices/config/.test/assets/demo-repo-with-dev-config/package.json +4 -0
  497. package/dist/practices/config/__snapshots__/.declapract.integration.test.ts.snap +43 -0
  498. package/dist/practices/config/bad-practices/divergent-config-shapes/config/prep.json.declapract.ts +3 -3
  499. package/dist/practices/config/bad-practices/divergent-config-shapes/config/prod.json.declapract.ts +3 -3
  500. package/dist/practices/config/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +10 -12
  501. package/dist/practices/config/best-practice/package.json +2 -2
  502. package/dist/practices/config/best-practice/src/utils/config/getConfig.ts +24 -5
  503. package/dist/practices/config/best-practice/src/utils/config/getOneCacheDirectory.ts +33 -0
  504. package/dist/practices/config/best-practice/src/utils/config/getOneProjectBucket.ts +22 -0
  505. package/dist/practices/config/best-practice/src/utils/environment.ts +9 -3
  506. package/dist/practices/config/best-practice/src/utils/environment.ts.declapract.ts +8 -0
  507. package/dist/practices/config/no-hand-written-config-type.declapract.integration.test.ts +64 -0
  508. package/dist/practices/conventional-commits/__snapshots__/commitlint-body-max-line.declapract.integration.test.ts.snap +3 -0
  509. package/dist/practices/conventional-commits/best-practice/commitlint.config.js +5 -0
  510. package/dist/practices/conventional-commits/best-practice/package.json +1 -1
  511. package/dist/practices/conventional-commits/commitlint-body-max-line.declapract.integration.test.ts +49 -0
  512. package/dist/practices/domain/.declapract.integration.test.ts +115 -0
  513. package/dist/{.test/assets/expo-migration/declarations/practices/domain/bad-practices/schematic-joi-model/src/domain → practices/domain/bad-practices/schematic-joi-model/src/domain.objects}/<star><star>/<star>.ts.declapract.ts +4 -1
  514. package/dist/practices/domain/best-practice/package.json +2 -2
  515. package/dist/practices/domain/best-practice/src/domain.objects/index.ts.declapract.ts +12 -0
  516. package/dist/practices/environments/.declapract.integration.test.ts +136 -0
  517. package/dist/practices/environments/__snapshots__/.declapract.integration.test.ts.snap +55 -0
  518. package/dist/practices/environments/bad-practices/old-dev-scripts/package.json.declapract.ts +6 -4
  519. package/dist/practices/environments/bad-practices/old-stage-enum/.declapract.integration.test.ts +133 -0
  520. package/dist/practices/environments/bad-practices/old-stage-enum/.test/assets/demo-repo-with-stage-enum/declapract.use.yml +8 -0
  521. package/dist/practices/environments/bad-practices/old-stage-enum/.test/assets/demo-repo-with-stage-enum/package.json +4 -0
  522. package/dist/practices/environments/bad-practices/old-stage-enum/.test/assets/demo-repo-with-stage-enum/src/logic/getDeployTarget.ts +15 -0
  523. package/dist/practices/environments/bad-practices/old-stage-enum/__snapshots__/.declapract.integration.test.ts.snap +40 -0
  524. package/dist/practices/environments/bad-practices/old-stage-enum/src/<star><star>/<star>.ts.declapract.ts +291 -24
  525. package/dist/practices/environments/best-practice/.declapract.readme.md +44 -11
  526. package/dist/practices/environments/best-practice/src/access/sdks/sdkAwsLambdaEnvAccessAncient.ts +32 -0
  527. package/dist/practices/environments/best-practice/src/access/sdks/sdkAwsLambdaEnvAccessContemp.ts +14 -0
  528. package/dist/practices/environments/best-practice/src/utils/environment.ts +3 -2
  529. package/dist/practices/errors/.declapract.integration.test.ts +121 -0
  530. package/dist/practices/errors/bad-practices/own-implementation/src/<star><star>/UnexpectedCodePathError.ts.declapract.ts +8 -0
  531. package/dist/practices/errors/best-practice/package.json +1 -1
  532. package/dist/practices/format/.declapract.integration.test.ts +131 -0
  533. package/dist/practices/format/__snapshots__/.declapract.integration.test.ts.snap +17 -0
  534. package/dist/practices/format/bad-practices/prettier/prettier.config.js.declapract.ts +1 -1
  535. package/dist/practices/format/best-practice/package.json.declapract.ts +36 -18
  536. package/dist/practices/git/.declapract.integration.test.ts +57 -6
  537. package/dist/practices/git/__snapshots__/.declapract.integration.test.ts.snap +2 -0
  538. package/dist/practices/git/best-practice/.gitattributes.declapract.ts +50 -37
  539. package/dist/practices/git/best-practice/.gitignore.declapract.ts +8 -0
  540. package/dist/practices/husky/__snapshots__/check.timestamps.play.declapract.integration.test.ts.snap +7 -0
  541. package/dist/practices/husky/best-practice/.husky/check.timestamps.sh +11 -2
  542. package/dist/practices/husky/check.timestamps.play.declapract.integration.test.ts +65 -0
  543. package/dist/practices/lint/__snapshots__/dpdmrc-exclude-policy.declapract.integration.test.ts.snap +3 -0
  544. package/dist/practices/lint/bad-practices/depcheck-denylisted-ignores/.depcheckrc.yml.declapract.ts +4 -0
  545. package/dist/practices/lint/best-practice/.depcheckrc.yml.declapract.ts +10 -9
  546. package/dist/practices/lint/best-practice/.dpdmrc.yaml +10 -6
  547. package/dist/practices/lint/dpdmrc-exclude-policy.declapract.integration.test.ts +50 -0
  548. package/dist/practices/logs/.declapract.integration.test.ts +100 -0
  549. package/dist/practices/logs/__snapshots__/.declapract.integration.test.ts.snap +33 -0
  550. package/dist/practices/logs/bad-practices/leveled-term/.test/assets/demo-repo-with-leveled-term/declapract.declare.yml +4 -0
  551. package/dist/practices/logs/bad-practices/leveled-term/.test/assets/demo-repo-with-leveled-term/declapract.use.yml +2 -0
  552. package/dist/practices/logs/bad-practices/leveled-term/.test/assets/demo-repo-with-leveled-term/package.json +12 -0
  553. package/dist/practices/logs/bad-practices/leveled-term/package.json.declapract.ts +56 -12
  554. package/dist/practices/node/bad-practices/self-deps-not-link/.declapract.integration.test.ts +102 -0
  555. package/dist/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.declare.yml +4 -0
  556. package/dist/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/declapract.use.yml +8 -0
  557. package/dist/practices/node/bad-practices/self-deps-not-link/.test/assets/demo-repo-with-self-deps/package.json +15 -0
  558. package/dist/practices/node/bad-practices/self-deps-not-link/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  559. package/dist/practices/node/bad-practices/self-deps-not-link/package.json.declapract.ts +22 -29
  560. package/dist/practices/node/best-practice/.npmrc.declapract.ts +5 -1
  561. package/dist/practices/node/best-practice/package.json +1 -1
  562. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/.declapract.integration.test.ts +103 -0
  563. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/.declapract.readme.md +8 -0
  564. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/.test/assets/demo-repo-with-simple-lambda-handlers/declapract.use.yml +5 -0
  565. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/.test/assets/demo-repo-with-simple-lambda-handlers/package.json +4 -0
  566. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/.test/assets/demo-repo-with-simple-lambda-handlers/src/contract/handlers/getWidget.ts +13 -0
  567. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/__snapshots__/.declapract.integration.test.ts.snap +44 -0
  568. package/dist/practices/node-service/bad-practices/simple-lambda-handlers/src/<star><star>/<star>.ts.declapract.ts +90 -10
  569. package/dist/practices/node-service/best-practice/package.json +1 -1
  570. package/dist/practices/package-json-order/best-practice/package.json.declapract.ts +7 -1
  571. package/dist/practices/persist-with-dynamodb/.declapract.integration.test.ts +92 -0
  572. package/dist/practices/persist-with-dynamodb/.test/assets/demo-repo-with-divergent-jest-env/declapract.declare.yml +4 -0
  573. package/dist/practices/persist-with-dynamodb/.test/assets/demo-repo-with-divergent-jest-env/declapract.use.yml +2 -0
  574. package/dist/practices/persist-with-dynamodb/.test/assets/demo-repo-with-divergent-jest-env/jest.integration.env.ts +4 -0
  575. package/dist/practices/persist-with-dynamodb/.test/assets/demo-repo-with-divergent-jest-env/package.json +4 -0
  576. package/dist/practices/persist-with-dynamodb/__snapshots__/.declapract.integration.test.ts.snap +20 -0
  577. package/dist/practices/persist-with-dynamodb/best-practice/jest.integration.env.ts +3 -3
  578. package/dist/practices/persist-with-dynamodb/best-practice/package.json +2 -2
  579. package/dist/practices/persist-with-rds/.declapract.integration.test.ts +224 -0
  580. package/dist/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +38 -0
  581. package/dist/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
  582. package/dist/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
  583. package/dist/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
  584. package/dist/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
  585. package/dist/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  586. package/dist/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +42 -0
  587. package/dist/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
  588. package/dist/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
  589. package/dist/practices/persist-with-rds/__snapshots__/ssm-cicd-param-names.declapract.integration.test.ts.snap +10 -0
  590. package/dist/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
  591. package/dist/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +22 -8
  592. package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +32 -0
  593. package/dist/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +1 -1
  594. package/dist/practices/persist-with-rds/best-practice/package.json +5 -5
  595. package/dist/practices/persist-with-rds/best-practice/provision/aws/readme.md +9 -6
  596. package/dist/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +38 -14
  597. package/dist/practices/persist-with-rds/best-practice/provision/aws/resources.ts +6 -3
  598. package/dist/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +13 -3
  599. package/dist/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +27 -22
  600. package/dist/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +13 -6
  601. package/dist/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts +10 -0
  602. package/dist/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts +90 -0
  603. package/dist/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +12 -4
  604. package/dist/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +16 -4
  605. package/dist/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
  606. package/dist/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
  607. package/dist/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
  608. package/dist/practices/persist-with-rds/ssm-cicd-param-names.declapract.integration.test.ts +73 -0
  609. package/dist/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
  610. package/dist/practices/pnpm/.declapract.integration.test.ts +163 -13
  611. package/dist/practices/pnpm/.test/assets/repo-npm-to-pnpm/package.json +1 -1
  612. package/dist/practices/pnpm/.test/assets/repo-npm-to-pnpm/pnpm-workspace.yaml +3 -0
  613. package/dist/practices/pnpm/__snapshots__/.declapract.integration.test.ts.snap +9 -2
  614. package/dist/practices/pnpm/bad-practices/inert-build-allowlist/pnpm-workspace.yaml.declapract.ts +59 -0
  615. package/dist/practices/pnpm/best-practice/.declapract.readme.md +1 -1
  616. package/dist/practices/pnpm/best-practice/package.json +1 -1
  617. package/dist/practices/pnpm/best-practice/package.json.declapract.ts +4 -2
  618. package/dist/practices/provision-github/best-practice/package.json +2 -2
  619. package/dist/practices/provision-github/best-practice/provision/github.repo/resources.ts +16 -0
  620. package/dist/practices/rhachet/.declapract.integration.test.ts +98 -0
  621. package/dist/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +7 -0
  622. package/dist/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
  623. package/dist/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
  624. package/dist/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
  625. package/dist/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  626. package/dist/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
  627. package/dist/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +27 -0
  628. package/dist/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +6 -2
  629. package/dist/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.declare.yml +4 -0
  630. package/dist/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.use.yml +2 -0
  631. package/dist/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
  632. package/dist/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +58 -17
  633. package/dist/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +46 -0
  634. package/dist/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +165 -0
  635. package/dist/practices/rhachet/best-practice/.gitignore.declapract.ts +18 -5
  636. package/dist/practices/rhachet/best-practice/package.json +8 -8
  637. package/dist/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +89 -0
  638. package/dist/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +145 -0
  639. package/dist/practices/runtime-schemas/bad-practices/joi/.declapract.integration.test.ts +102 -0
  640. package/dist/practices/runtime-schemas/bad-practices/joi/.test/assets/demo-repo-with-joi/declapract.use.yml +5 -0
  641. package/dist/practices/runtime-schemas/bad-practices/joi/.test/assets/demo-repo-with-joi/package.json +4 -0
  642. package/dist/practices/runtime-schemas/bad-practices/joi/.test/assets/demo-repo-with-joi/src/contract/schemas/widget.schema.ts +9 -0
  643. package/dist/practices/runtime-schemas/bad-practices/joi/__snapshots__/.declapract.integration.test.ts.snap +37 -0
  644. package/dist/practices/runtime-schemas/bad-practices/joi/src/<star><star>/<star>.ts.declapract.ts +32 -3
  645. package/dist/practices/serverless/.declapract.integration.test.ts +230 -0
  646. package/dist/practices/serverless/.test/assets/demo-repo-with-serverless/declapract.declare.yml +4 -0
  647. package/dist/practices/serverless/.test/assets/demo-repo-with-serverless/declapract.use.yml +8 -0
  648. package/dist/practices/serverless/.test/assets/demo-repo-with-serverless/package.json +4 -0
  649. package/dist/practices/serverless/.test/assets/demo-repo-with-serverless/serverless.yml +8 -0
  650. package/dist/practices/serverless/__snapshots__/.declapract.integration.test.ts.snap +43 -0
  651. package/dist/practices/serverless/__snapshots__/cache-grant-stage-globbed.declapract.integration.test.ts.snap +3 -0
  652. package/dist/practices/serverless/__snapshots__/deployment-bucket-account-scoped.declapract.integration.test.ts.snap +9 -0
  653. package/dist/practices/serverless/__snapshots__/divergentStageGuard.declapract.integration.test.ts.snap +15 -0
  654. package/dist/practices/serverless/__snapshots__/serverless.yml.declapract.integration.test.ts.snap +165 -0
  655. package/dist/practices/serverless/best-practice/.declapract.readme.md +111 -0
  656. package/dist/practices/serverless/best-practice/package.json +7 -5
  657. package/dist/practices/serverless/best-practice/serverless.yml +14 -6
  658. package/dist/practices/serverless/best-practice/serverless.yml.declapract.ts +609 -64
  659. package/dist/practices/serverless/cache-grant-stage-globbed.declapract.integration.test.ts +69 -0
  660. package/dist/practices/serverless/deployment-bucket-account-scoped.declapract.integration.test.ts +78 -0
  661. package/dist/practices/serverless/divergentStageGuard.declapract.integration.test.ts +280 -0
  662. package/dist/practices/serverless/serverless.yml.declapract.integration.test.ts +1285 -0
  663. package/dist/practices/terraform-aws/best-practice/provision/aws/environments/prep/main.tf +1 -1
  664. package/dist/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  665. package/dist/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +104 -0
  666. package/dist/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +2 -2
  667. package/dist/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +9 -9
  668. package/dist/practices/tests-any/best-practice/package.json +3 -3
  669. package/dist/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  670. package/dist/practices/tests-any/{best-practice/package.json.shell-flags.declapract.integration.test.ts → package.json.shell-flags.declapract.integration.test.ts} +26 -16
  671. package/dist/practices/tests-expo/.declapract.integration.test.ts +7 -3
  672. package/dist/practices/tests-expo/.test/assets/repo-expo-greenfield/package.json +5 -1
  673. package/dist/practices/tests-expo/__snapshots__/.declapract.integration.test.ts.snap +17 -8
  674. package/dist/practices/tests-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +60 -0
  675. package/dist/practices/tests-expo/best-practice/jest.acceptance.config.ts +5 -0
  676. package/dist/practices/tests-expo/best-practice/jest.integration.config.ts +5 -0
  677. package/dist/practices/tests-expo/best-practice/jest.integration.env.ts +5 -1
  678. package/dist/practices/tests-expo/best-practice/jest.unit.config.ts +5 -0
  679. package/dist/practices/tests-expo/best-practice/jest.unit.env.ts +6 -1
  680. package/dist/practices/tests-expo/best-practice/package.json.declapract.ts +190 -13
  681. package/dist/practices/tests-expo/package.json.declapract.integration.test.ts +94 -0
  682. package/dist/practices/tests-node/__snapshots__/livedb-wake-branches.declapract.integration.test.ts.snap +6 -0
  683. package/dist/practices/tests-node/best-practice/jest.acceptance.config.ts +8 -0
  684. package/dist/practices/tests-node/best-practice/jest.acceptance.env.ts +16 -26
  685. package/dist/practices/tests-node/best-practice/jest.acceptance.prepare.ts +36 -0
  686. package/dist/practices/tests-node/best-practice/jest.integration.config.ts +8 -0
  687. package/dist/practices/tests-node/best-practice/jest.integration.env.db.ts +90 -0
  688. package/dist/practices/tests-node/best-practice/jest.integration.env.ts +26 -74
  689. package/dist/practices/tests-node/best-practice/jest.integration.prepare.ts +33 -0
  690. package/dist/practices/tests-node/best-practice/jest.unit.config.ts +7 -0
  691. package/dist/practices/tests-node/best-practice/jest.unit.env.ts +11 -4
  692. package/dist/practices/tests-node/best-practice/jest.unit.env.ts.declapract.ts +3 -1
  693. package/dist/practices/tests-node/best-practice/src/.test/useKeyrack.ts +211 -0
  694. package/dist/practices/tests-node/best-practice/src/.test/useWakeOfLivedb.ts +181 -0
  695. package/dist/practices/tests-node/best-practice/src/.test/useWakeOfTestdb.ts +71 -0
  696. package/dist/practices/tests-node/livedb-wake-branches.declapract.integration.test.ts +227 -0
  697. package/dist/practices/tests-node/livedb-wake-prepare.declapract.integration.test.ts +112 -0
  698. package/dist/practices/tests-node/testdb-preflight-branches.declapract.integration.test.ts +203 -0
  699. package/dist/practices/tests-node/testdb-preflight-env.declapract.integration.test.ts +65 -0
  700. package/dist/practices/tests-service/.test/assets/demo-repo-service/declapract.use.yml +5 -0
  701. package/dist/practices/tests-service/.test/assets/demo-repo-service/package.json +4 -0
  702. package/dist/practices/tests-service/__snapshots__/package.json.declapract.integration.test.ts.snap +26 -0
  703. package/dist/practices/tests-service/asFunctionNameFromTestFileName.ts +7 -0
  704. package/dist/practices/tests-service/best-practice/.declapract.readme.md +68 -0
  705. package/dist/practices/tests-service/best-practice/blackbox/lambdas/<star>.acceptance.test.ts.declapract.ts +33 -8
  706. package/dist/practices/tests-service/best-practice/package.json +4 -1
  707. package/dist/practices/tests-service/best-practice/package.json.declapract.ts +99 -1
  708. package/dist/practices/tests-service/package.json.declapract.integration.test.ts +204 -0
  709. package/dist/practices/typescript-expo/__snapshots__/package.json.declapract.integration.test.ts.snap +8 -0
  710. package/dist/practices/typescript-expo/__snapshots__/tsconfig.json.declapract.integration.test.ts.snap +19 -0
  711. package/dist/practices/typescript-expo/{best-practice/package.json.declapract.integration.test.ts → package.json.declapract.integration.test.ts} +15 -2
  712. package/dist/{.test/assets/expo-migration/declarations/practices/typescript-expo/best-practice → practices/typescript-expo}/tsconfig.json.declapract.integration.test.ts +13 -2
  713. package/dist/practices/typescript-node/best-practice/package.json.declapract.ts +3 -1
  714. package/dist/practices/uuid/best-practice/package.json +1 -1
  715. package/dist/stageAccessBridge.declapract.integration.test.ts +163 -0
  716. package/dist/utils/asPackageJSON.ts +57 -0
  717. package/dist/utils/asPrepConfigPath.ts +12 -0
  718. package/dist/utils/getAllPathsUnderDir.ts +45 -0
  719. package/dist/utils/getAllPracticesForUsecase.ts +35 -9
  720. package/dist/utils/migrateDevConfigToPrep.ts +47 -0
  721. package/dist/utils/readFile.ts +2 -2
  722. package/dist/workflowCallerCalleeReconciliation.declapract.integration.test.ts +319 -0
  723. package/dist/workflowEnvDeploymentFalse.declapract.integration.test.ts +173 -0
  724. package/package.json +10 -9
  725. package/dist/.test/assets/expo-fullusecase/declarations/practices/domain/best-practice/src/domain/objects/index.ts.declapract.ts +0 -4
  726. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-expo/best-practice/package.json +0 -9
  727. package/dist/.test/assets/expo-migration/declarations/practices/domain/best-practice/src/domain/objects/index.ts.declapract.ts +0 -4
  728. package/dist/.test/assets/expo-migration/declarations/practices/tests-expo/best-practice/package.json +0 -9
  729. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-expo/best-practice/package.json +0 -9
  730. package/dist/practices/config/best-practice/src/utils/config/Config.ts +0 -10
  731. package/dist/practices/config/best-practice/src/utils/config/Config.ts.declapract.ts +0 -16
  732. package/dist/practices/config/best-practice/src/utils/config/getCacheDirectory.ts +0 -42
  733. package/dist/practices/domain/best-practice/src/domain/objects/index.ts.declapract.ts +0 -4
  734. package/dist/practices/logs/bad-practices/leveled-term/package.json +0 -5
  735. package/dist/practices/persist-with-rds/best-practice/src/utils/config/Config.ts +0 -26
  736. package/dist/practices/persist-with-rds/best-practice/src/utils/config/Config.ts.declapract.ts +0 -39
  737. package/dist/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts.declapract.ts +0 -49
  738. package/dist/practices/persist-with-rds/best-practice/src/utils/config/getConfig.ts +0 -2
  739. package/dist/practices/tests-expo/best-practice/package.json +0 -9
  740. package/dist/practices/tests-service/defineFunctionNameFromTestFileName.ts +0 -11
  741. /package/dist/.test/assets/{expo-fullusecase/declarations/practices/errors/bad-practices/own-implementation/src/utils/errors/UnexpectedCodePathError.ts.declapract.ts → cicd-service/declarations/practices/cicd-service/bad-practices/old-names/.github/workflows/deploy-dev-on-main.yml.declapract.ts} +0 -0
  742. /package/dist/{practices/errors/bad-practices/own-implementation/src/utils/errors/UnexpectedCodePathError.ts.declapract.ts → .test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/old-names/.github/workflows/deploy-prod-on-tag.yml.declapract.ts} +0 -0
  743. /package/dist/{practices/persist-with-rds/best-practice/src/utils/config/getConfig.ts.declapract.ts → .test/assets/cicd-service/declarations/practices/cicd-service/bad-practices/old-names/.github/workflows/deploy_dev_on_main.yml.declapract.ts} +0 -0
  744. /package/dist/{practices/persist-with-dynamodb/best-practice/jest.integration.env.ts.declapract.ts → .test/assets/cicd-service/declarations/practices/cicd-service/best-practice/package.json.declapract.ts} +0 -0
  745. /package/dist/.test/assets/expo/declarations/practices/node/{best-practice/.npmrc.declapract.integration.test.ts → .npmrc.declapract.integration.test.ts} +0 -0
  746. /package/dist/.test/assets/expo/declarations/practices/node/{best-practice/__snapshots__ → __snapshots__}/.npmrc.declapract.integration.test.ts.snap +0 -0
  747. /package/dist/.test/assets/expo-fullusecase/declarations/practices/node/{best-practice/.npmrc.declapract.integration.test.ts → .npmrc.declapract.integration.test.ts} +0 -0
  748. /package/dist/.test/assets/expo-fullusecase/declarations/practices/node/{best-practice/__snapshots__ → __snapshots__}/.npmrc.declapract.integration.test.ts.snap +0 -0
  749. /package/dist/.test/assets/expo-migration/declarations/practices/node/{best-practice/.npmrc.declapract.integration.test.ts → .npmrc.declapract.integration.test.ts} +0 -0
  750. /package/dist/.test/assets/expo-migration/declarations/practices/node/{best-practice/__snapshots__ → __snapshots__}/.npmrc.declapract.integration.test.ts.snap +0 -0
  751. /package/dist/practices/node/{best-practice/.npmrc.declapract.integration.test.ts → .npmrc.declapract.integration.test.ts} +0 -0
  752. /package/dist/practices/node/{best-practice/__snapshots__ → __snapshots__}/.npmrc.declapract.integration.test.ts.snap +0 -0
@@ -3,105 +3,650 @@ import { FileCheckType } from 'declapract';
3
3
 
4
4
  export const check = FileCheckType.CONTAINS; // i.e., check that the contents of the file contains what's declared (default is equals)
5
5
 
6
+ // .note = ON A MISS, EVERY TRANSFORM SOFT-SKIPS (returns the contents unchanged); none throws.
7
+ // a soft-skip is NOT a silent break: the overall check is CONTAINS, so any declared line a
8
+ // transform could not land is absent from the output, which leaves `declapract plan` RED — that
9
+ // red IS the signal. a throw was the wrong mechanism for a miss: `fix` folds 14 transforms, so
10
+ // one throw aborts the whole chain and a very common arrival shape (a var before NODE_ENV, a
11
+ // pre-extant custom: block, an underscore in the service name) then blocks every unrelated repair
12
+ // — the runtime bump, the plugin removal, the IAM grants — from landing at all. CONTAINS already
13
+ // supplies the visibility a throw reached for, without that abort. the one true silent break a
14
+ // throw once guarded — a SECOND top-level key of a section the file already holds, a yaml
15
+ // last-wins clobber that PASSES CONTAINS — is prevented by NOT inserting when the section already
16
+ // exists (a soft-skip that declines the duplicate), which needs no throw either.
17
+
18
+ /**
19
+ * .what = convert crlf newlines to unix lf, as the first transform in the fold.
20
+ * .why = every peer transform anchors on a literal `\n` (`environment:\n NODE_ENV:`, the insert
21
+ * regexes, etc.). a consumer checked out with crlf line endings holds `\r\n`, so every
22
+ * anchor misses and each transform soft-skips — `declapract plan` then stays RED forever,
23
+ * with no diagnostic that names the cause (the exact silent, compiler-invisible friction the
24
+ * wish exists to kill). this practice is lf-canonical: every declared line uses `\n` and the
25
+ * emitted output is lf, so a crlf file SHOULD converge to lf. a conversion here makes every
26
+ * anchor match and the file converge in one `fix`. idempotent: an lf file has no `\r\n`, so
27
+ * a re-run is a no-op. the CONTAINS check then passes against the now-lf output — no custom
28
+ * check needed, because the fix makes the file lf before the next plan reads it.
29
+ */
30
+ const withUnixNewlines = (input: { contents: string }): string =>
31
+ input.contents.replace(/\r\n/g, '\n');
32
+
6
33
  const accessInferencePolicy = ` # allow access inference from account name
7
34
  - Effect: Allow
8
35
  Action:
9
36
  - account:GetAccountInformation
10
37
  Resource: '*'`;
11
38
 
39
+ // .note = these comment strings are BYTE-IDENTICAL to the template `serverless.yml` accessByStage
40
+ // block (lines 13-16). the CONTAINS check asserts `foundContents` includes `declaredFileContents`
41
+ // — the WHOLE hydrated template as one contiguous span (declapract's checkContainsSubstring) — so a
42
+ // migrated consumer's fix output must reproduce the template's prose verbatim or the whole toContain
43
+ // match fails and `declapract plan` stays red forever. the `template holds the accessByStage block`
44
+ // clamp in the unit test reads the real template and asserts this block sits inside it, so a reword
45
+ // of either copy reddens CI rather than a consumer's plan.
12
46
  const accessByStageCustom = `custom:
13
47
  accessByStage:
14
48
  dev: prep # stage=dev deploys to $service-dev but uses ACCESS=prep (config/prep.json)
49
+ prep: prep # stage=prep deploys to $service-prep also with ACCESS=prep; one service answers to both the -dev and -prep fleets while callers migrate
15
50
  prod: prod
51
+ access: \${self:custom.accessByStage.\${opt:stage}, 'prep'} # the resolved access for this deploy — one source, referenced by the ACCESS env var + every access-keyed resource arn below, so a partial edit cannot re-split the stage/access axes
16
52
 
17
53
  `;
18
54
 
19
- export const fix: FileFixFunction = (contents) => {
20
- if (!contents) return { contents }; // do nothing if file dne
21
- let fixed = contents
22
- .replace(/runtime: nodejs\d\d.x/, 'runtime: nodejs22.x')
23
- .replace(/ {2}- serverless-offline .*\n/, '') // a plugin we no longer use (never used it, no need to have it)
24
- .replace(/ {2}- serverless-pseudo-parameters .*\n/, '') // a plugin we no longer use (serverless supports variables natively now)
25
- .replace(/#\{AWS::Region\}/g, '${aws:region}') // use the serverless native variables, instead of the pseudo-parameters format
26
- .replace(/#\{AWS::AccountId\}/g, '${aws:accountId}') // use the serverless native variables, instead of the pseudo-parameters format
55
+ /**
56
+ * .what = bump the lambda runtime to the current node major.
57
+ * .why = an old runtime string silently deploys onto an unsupported node version.
58
+ */
59
+ const withNodeRuntime = (input: { contents: string }): string =>
60
+ input.contents.replace(/runtime: nodejs\d\d.x/, 'runtime: nodejs22.x');
61
+
62
+ /**
63
+ * .what = drop the plugins serverless no longer needs.
64
+ * .why = serverless-offline is unused, and serverless-pseudo-parameters is obsolete
65
+ * (serverless supports native variables now).
66
+ */
67
+ const withoutDeprecatedPlugins = (input: { contents: string }): string =>
68
+ input.contents
69
+ .replace(/ {2}- serverless-offline .*\n/, '')
70
+ .replace(/ {2}- serverless-pseudo-parameters .*\n/, '');
71
+
72
+ /**
73
+ * .what = rewrite the pseudo-parameter `#{AWS::*}` syntax to serverless native `${aws:*}`.
74
+ * .why = the native form drops the serverless-pseudo-parameters plugin dependency.
75
+ */
76
+ const withNativeVariables = (input: { contents: string }): string =>
77
+ input.contents
78
+ .replace(/#\{AWS::Region\}/g, '${aws:region}')
79
+ .replace(/#\{AWS::AccountId\}/g, '${aws:accountId}');
80
+
81
+ /**
82
+ * .what = collapse the doubled `##` comment headers down to a single `#`.
83
+ * .why = a `##` header is a stray double-hash; the house style is one `#` per comment.
84
+ */
85
+ const withSingleHashCommentHeaders = (input: { contents: string }): string =>
86
+ input.contents
27
87
  .replace('## paramstore access', '# parameter store access')
28
88
  .replace(
29
89
  '## allow invocation of other lambdas',
30
90
  '# allow invocation of other lambdas',
31
- )
32
- .replace(
91
+ );
92
+
93
+ /**
94
+ * .what = prepend an idempotent `# @declapract:review` marker to the file when a NODE_ENV-anchored
95
+ * env insert could not land (an `environment:` block exists, but NODE_ENV is not its first
96
+ * key, so the positional anchor missed). the marker NAMES the line to add + why the
97
+ * auto-insert declined, so a red `declapract plan` carries an actionable diagnostic.
98
+ * .why = a bare soft-skip leaves CONTAINS red with the declared line absent but NO signal about
99
+ * WHICH arrival shape failed — a consumer whose env block puts a var before NODE_ENV sees
100
+ * only "line missing", not "your NODE_ENV is not first, so the anchor missed". this marker
101
+ * closes that ergonomic gap with the same `@declapract:review` vocabulary withInsertOnceBefore
102
+ * uses. a top-of-file comment is indent-safe (a nested `environment:` block has an unknown
103
+ * indent in an arbitrary consumer) and cannot disturb any peer transform's anchor.
104
+ * .note = fires ONLY when an `environment:` block is present (the miss is a key-order shape, not an
105
+ * absent block); with no env block there is no shape to converge, so CONTAINS-red naming the
106
+ * absent line is signal enough. idempotent (guards on the marker's presence). a residual
107
+ * marker may persist after a consumer hand-fixes their key order; it is a one-line comment a
108
+ * consumer removes on merge, never a re-inserted or duplicated line.
109
+ * .note = converging MORE arrival shapes (inject as first env child regardless of key order) is the
110
+ * tracked follow-on `.dream/v2026_09_10.fix.serverless-soft-skip-convergence.md`; this marker
111
+ * is the running-consumer diagnostic that follow-on's convergence has not yet delivered.
112
+ */
113
+ const withEnvInsertReviewMarker = (input: {
114
+ contents: string;
115
+ need: string;
116
+ }): string => {
117
+ // no environment block at all → no shape to converge; CONTAINS-red already names the absent line
118
+ if (!input.contents.includes('environment:')) return input.contents;
119
+ const marker = `# @declapract:review — could not auto-insert \`${input.need}\` under \`environment:\` because NODE_ENV is not the block's first key (the positional anchor missed); add \`${input.need}\` as a child of your \`environment:\` block by hand — the failing \`declapract plan\` diff names it.`;
120
+ // idempotent: the marker is already present, so a re-run is a no-op
121
+ if (input.contents.includes(marker)) return input.contents;
122
+ return `${marker}\n${input.contents}`;
123
+ };
124
+
125
+ /**
126
+ * .what = declare `TZ: UTC` in the function environment, above `NODE_ENV`.
127
+ * .why = an explicit utc timezone is a pit of success against date drift across regions.
128
+ * .note = idempotent skip when `TZ: UTC` is already declared. on the primary shape the `.replace`
129
+ * lands the line; on any OTHER shape (env block present, NODE_ENV not first) it emits a
130
+ * `@declapract:review` marker naming the shape to converge, so the still-red CONTAINS plan
131
+ * carries a diagnostic rather than a bare missing-line. a throw here would abort the 16 peer
132
+ * transforms; the marker does not.
133
+ */
134
+ const withUtcTimezone = (input: { contents: string }): string => {
135
+ // idempotent skip: the timezone is already declared
136
+ if (input.contents.includes('TZ: UTC')) return input.contents;
137
+
138
+ // primary anchor: NODE_ENV is the first key under the env block
139
+ if (input.contents.includes('environment:\n NODE_ENV:'))
140
+ return input.contents.replace(
33
141
  'environment:\n NODE_ENV:',
34
142
  'environment:\n TZ: UTC # guarantee that utc timezone will be used explicitly, to facilitate a pit of success\n NODE_ENV:',
143
+ );
144
+
145
+ // anchor missed: emit an actionable diagnostic marker (not a silent no-op), CONTAINS stays red
146
+ return withEnvInsertReviewMarker({
147
+ contents: input.contents,
148
+ need: 'TZ: UTC',
149
+ });
150
+ };
151
+
152
+ /**
153
+ * .what = enable aws-sdk connection reuse in the function environment.
154
+ * .why = connection reuse cuts cold-start latency; see the aws-sdk-for-javascript guide.
155
+ * .note = idempotent skip when the flag is already declared. on the primary shape the `.replace`
156
+ * lands the flag; on any OTHER shape (env block present, this NODE_ENV form absent) it emits
157
+ * a `@declapract:review` marker naming the flag to add, so the still-red CONTAINS plan
158
+ * carries a diagnostic rather than a bare missing-line. this anchor is the legacy NODE_ENV
159
+ * form, so it runs BEFORE `withNodeEnvProduction` rewrites that value.
160
+ * .note = the anchor is the NODE_ENV line ALONE, not a NODE_ENV+deploymentBucket pair. an earlier
161
+ * anchor required `deploymentBucket` on the very next line as a positional marker for the
162
+ * env-block boundary — but that coupled the flag's insert to a line this transform does not
163
+ * own, so a legacy consumer whose environment block is NOT directly succeeded by
164
+ * `deploymentBucket` (it sits elsewhere, or the consumer has none) never landed the flag and
165
+ * stayed CONTAINS-red forever with no diagnostic — a non-convergent fix (the row-1 class the
166
+ * wish forbids). the insert fixes its own indent (`\n ` = env level), so the boundary
167
+ * marker was never needed; an anchor on NODE_ENV alone converges every legacy shape. the
168
+ * later `withNodeEnvProduction` rewrites the same NODE_ENV line by regex on its own line, so
169
+ * a flag inserted on the next line does not disturb that rewrite.
170
+ */
171
+ const withConnectionReuse = (input: { contents: string }): string => {
172
+ // idempotent skip: the flag is already declared
173
+ if (input.contents.includes('AWS_NODEJS_CONNECTION_REUSE_ENABLED'))
174
+ return input.contents;
175
+
176
+ // primary anchor: the legacy NODE_ENV line (runs BEFORE withNodeEnvProduction rewrites it)
177
+ if (
178
+ input.contents.includes(
179
+ 'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}',
35
180
  )
36
- .replace(
37
- 'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}\n deploymentBucket',
38
- 'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: true # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html\n deploymentBucket',
39
- ) // add this env flag
40
- .replace(
41
- /service: ([a-zA-Z0-9-]+)\n\n?provider:/,
42
- 'service: $1\n\npackage:\n artifact: .artifact/contents.zip\n\nprovider:',
43
- )
44
- .replace(
45
- ' artifact: .artifact/contents.zip\n\nprovider:', // if no plugins at all
46
- ' artifact: .artifact/contents.zip\n\nplugins:\n - serverless-prune-plugin\n\nprovider:', // add the sls prune plugin
47
- )
48
- .replace(
49
- ' timeout: 10',
50
- ' timeout: 60 # default timeout to 1min, for resilience against increased cold start times; individual functions can override this', // bump the timeout
181
+ )
182
+ return input.contents.replace(
183
+ 'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}',
184
+ 'NODE_ENV: ${self:custom.stageToNodeEnvMapping.${self:provider.stage}}\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: true # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html',
51
185
  );
52
186
 
53
- // add variablesResolutionMode after service line if not present
54
- if (!fixed.includes('variablesResolutionMode:')) {
55
- fixed = fixed.replace(
56
- /^(service: [a-zA-Z0-9-]+)\n/m,
57
- '$1\n\nvariablesResolutionMode: 20210326\n',
187
+ // go-forward anchor: a consumer already on the literal `NODE_ENV: production` line that lacks the
188
+ // flag (e.g. it was hand-edited out, or the value was rewritten before this file gained the flag)
189
+ // converges here rather than a marker-only red plan — the flag lands on the next line, and any
190
+ // comment after `production` is preserved. this closes the go-forward non-convergence shape.
191
+ if (/NODE_ENV: production/.test(input.contents))
192
+ return input.contents.replace(
193
+ /NODE_ENV: production([^\n]*)/,
194
+ 'NODE_ENV: production$1\n AWS_NODEJS_CONNECTION_REUSE_ENABLED: true # https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html',
58
195
  );
59
- }
60
196
 
61
- // add custom accessByStage block before provider if not present
62
- if (!fixed.includes('accessByStage:')) {
63
- fixed = fixed.replace(/\nprovider:/, `\n${accessByStageCustom}provider:`);
64
- }
197
+ // anchor missed: emit an actionable diagnostic marker (not a silent no-op), CONTAINS stays red
198
+ return withEnvInsertReviewMarker({
199
+ contents: input.contents,
200
+ need: 'AWS_NODEJS_CONNECTION_REUSE_ENABLED: true',
201
+ });
202
+ };
203
+
204
+ /**
205
+ * .what = rewrite a legacy `NODE_ENV: ${self:custom.stageToNodeEnvMapping.${...stage}}` to the
206
+ * go-forward literal `NODE_ENV: production`.
207
+ * .why = the template's go-forward NODE_ENV is the literal `production` (prep and prod run the same
208
+ * production code paths). a legacy file that references `custom.stageToNodeEnvMapping` while
209
+ * the fix inserts a `custom:` block holding only `accessByStage` would deploy-fail (the
210
+ * emitted custom: block never declares stageToNodeEnvMapping) AND fail its own CONTAINS
211
+ * check (which requires `NODE_ENV: production`). rewrite the value so the fix converges to
212
+ * the template and never emits a reference to a key it does not supply. runs AFTER
213
+ * withConnectionReuse, which anchors on the legacy form. a file already on
214
+ * `NODE_ENV: production` is a no-op.
215
+ */
216
+ const withNodeEnvProduction = (input: { contents: string }): string =>
217
+ input.contents.replace(
218
+ /NODE_ENV: \$\{self:custom\.stageToNodeEnvMapping\.\$\{self:provider\.stage\}\}[^\n]*/,
219
+ 'NODE_ENV: production # deploy with production optimizations of all resources, to make `prep` and `prod` stage deployments equivalent functionally (i.e., the same code paths in prep and prod)',
220
+ );
221
+
222
+ /**
223
+ * .what = insert a `block` at `anchor` exactly once. skipped when `guard` is already present, or
224
+ * (when `section` is given) when that top-level key already sits in the file under other
225
+ * content, or when no `anchor` matches. every skip is a soft return of the contents
226
+ * unchanged.
227
+ * .why = every "add a top-level block if absent" transformer shares this one shape. one audited
228
+ * implementation is safer than many hand-derived anchor/guard pairs. the `guard`
229
+ * presence-check makes each caller idempotent on a re-apply. the `section` soft-skip
230
+ * forecloses a silent-break class: a `guard` that checks only DECLARED CONTENT would insert
231
+ * a whole `package:` / `plugins:` / `custom:` block even when the consumer's legacy file
232
+ * already holds that top-level key under DIFFERENT content — a yaml last-wins clobber that
233
+ * silently drops the consumer's block while CONTAINS still passes (the declared lines are
234
+ * present, once). declining to insert a second key of a section the file already holds
235
+ * prevents that clobber, and CONTAINS (which requires the declared block) surfaces the
236
+ * needed manual merge as a red plan. an anchor miss returns the contents unchanged too;
237
+ * CONTAINS surfaces the un-inserted block. no throw, so a single miss never aborts the fold.
238
+ */
239
+ export const withInsertOnceBefore = (input: {
240
+ contents: string;
241
+ guard: string;
242
+ anchor: string | RegExp;
243
+ insert: string;
244
+ section?: string;
245
+ }): string => {
246
+ // idempotent skip: the block is already declared, so re-insert is a no-op
247
+ if (input.contents.includes(input.guard)) return input.contents;
65
248
 
66
- // replace STAGE env var with ACCESS + COMMIT pattern
249
+ // soft-skip on a pre-extant section this insert does not own — but NOT silently. a content-only
250
+ // guard would insert a second top-level `${section}:` key here, and yaml last-wins would drop the
251
+ // consumer's block, so the duplicate is declined. rather than return the contents unchanged (a
252
+ // silent stall a consumer cannot diagnose — CONTAINS-red names the absent key, not the reason),
253
+ // inject an idempotent `@declapract:review` marker on the line above the extant section. that
254
+ // makes `declapract plan` show an actionable diff naming the hand-merge, while CONTAINS stays red
255
+ // until the declared keys are merged. the marker uses the wish's own review-marker vocabulary.
67
256
  if (
68
- fixed.includes('STAGE: ${self:provider.stage}') &&
69
- !fixed.includes('ACCESS:')
257
+ input.section &&
258
+ new RegExp(`(^|\\n)${input.section}:`).test(input.contents)
70
259
  ) {
71
- fixed = fixed.replace(
72
- /STAGE: \$\{self:provider\.stage\}[^\n]*/,
73
- "ACCESS: ${self:custom.accessByStage.${opt:stage}, 'prep'} # sdk-environment access tier, to target the correct config + resources (e.g., hit prep db -vs- prod db)\n COMMIT: ${env:COMMIT} # sdk-environment commit slug, must be set by deploy command",
260
+ const marker = `# @declapract:review — a \`${input.section}:\` block is already present; merge the declared \`${input.section}\` keys (from the failing \`declapract plan\` diff) into your extant \`${input.section}:\` block by hand — auto-insert was declined to avoid a yaml last-wins clobber that would drop your block.`;
261
+ // idempotent: the marker is already present, so a re-run is a no-op
262
+ if (input.contents.includes(marker)) return input.contents;
263
+ // insert the marker immediately above the extant section
264
+ return input.contents.replace(
265
+ new RegExp(`(^|\\n)(${input.section}:)`),
266
+ `$1${marker}\n$2`,
74
267
  );
75
268
  }
76
269
 
77
- // replace old iam:ListAccountAliases with account:GetAccountInformation
78
- if (fixed.includes('iam:ListAccountAliases')) {
79
- fixed = fixed.replace(
80
- /# allow inferring access from account alias\n\s+- Effect: Allow\n\s+Action:\n\s+- iam:ListAccountAliases\n\s+Resource: '\*'/,
81
- accessInferencePolicy.trim(),
270
+ // soft-skip on an anchor miss: a no-op .replace returns the contents unchanged (insert always
271
+ // adds bytes, so an unchanged result can only mean the anchor did not match). CONTAINS requires
272
+ // the declared block, so a missed anchor leaves `plan` red — the signal, without a chain abort.
273
+ return input.contents.replace(input.anchor, input.insert);
274
+ };
275
+
276
+ /**
277
+ * .what = insert the `package:` artifact block immediately before `provider:`, once.
278
+ * .why = anchor on `provider:` — a required, singular top-level key — so the insert holds no
279
+ * matter what sits between `service:` and `provider:` (a `plugins:` / `custom:` block is a
280
+ * common legacy layout). an earlier anchor that required `provider:` within one blank line
281
+ * of `service:` silently no-opped when any block sat between them.
282
+ * .why = `section: 'package'` — a legacy file may already hold a `package:` block under other
283
+ * keys (`individually:`, `patterns:`). the section soft-skip declines to insert a second
284
+ * `package:` key (a yaml last-wins clobber); CONTAINS surfaces the merge.
285
+ */
286
+ export const withPackageArtifact = (input: { contents: string }): string =>
287
+ withInsertOnceBefore({
288
+ contents: input.contents,
289
+ guard: 'artifact: .artifact/contents.zip',
290
+ section: 'package',
291
+ anchor: /\nprovider:/,
292
+ insert: '\npackage:\n artifact: .artifact/contents.zip\n\nprovider:',
293
+ });
294
+
295
+ /**
296
+ * .what = add a `plugins: [serverless-prune-plugin]` block before `provider:`, once.
297
+ * .why = prune keeps only recent function versions, to stay under the code-storage cap. anchor on
298
+ * `provider:` (the same structural anchor the 3 peer inserts use) — NOT on the byte sequence
299
+ * `withPackageArtifact` emits. an earlier anchor keyed on ` artifact: …\n\nprovider:`
300
+ * coupled this insert to a peer's literal output, so any other `package:` key after
301
+ * `artifact:` (a common `individually:` / `patterns:`) silently defeated it. the `guard`
302
+ * skips insertion when the plugin is already declared anywhere — a legacy `plugins:` block
303
+ * that survives `withoutDeprecatedPlugins` may already hold it.
304
+ * .why = `section: 'plugins'` — a legacy file may hold a `plugins:` block with a DIFFERENT plugin
305
+ * (esbuild/webpack) and no prune plugin. the section soft-skip declines to insert a second
306
+ * `plugins:` key (a yaml last-wins clobber of the consumer's plugin); CONTAINS surfaces it.
307
+ */
308
+ export const withPrunePlugin = (input: { contents: string }): string =>
309
+ withInsertOnceBefore({
310
+ contents: input.contents,
311
+ guard: '- serverless-prune-plugin',
312
+ section: 'plugins',
313
+ anchor: /\nprovider:/,
314
+ insert: '\nplugins:\n - serverless-prune-plugin\n\nprovider:',
315
+ });
316
+
317
+ /**
318
+ * .what = bump the default provider timeout from 10s to 60s.
319
+ * .why = a 1min default is resilient against increased cold-start times; individual
320
+ * functions can still override it.
321
+ * .note = the anchor is line-start + exactly two-space indent (`^ timeout:`), which targets the
322
+ * PROVIDER-level timeout only — a function-level ` timeout:` sits at four-space indent
323
+ * and never matches. this also forecloses a subsegment clobber: a raw `.replace(' timeout: 10')`
324
+ * would match the last two spaces of a four-space ` timeout: 100` and corrupt it.
325
+ * .note = on the primary shape (provider `timeout: 10`) the line converges to `timeout: 60`. on a
326
+ * provider timeout at any OTHER value it emits a `@declapract:review` marker rather than an
327
+ * override of a deliberate operational choice — the same visibility terminus as `withUtcTimezone`.
328
+ * whether the practice should FORCE 60 over a consumer's explicit value, or RELAX the
329
+ * `timeout: 60` CONTAINS clamp, is a design decision reserved to the wisher
330
+ * (`inventory.of=fulcrums.case=F-serverless-soft-skip-convergence`); the marker makes the
331
+ * still-red plan actionable and does not pick that fork.
332
+ */
333
+ const withProviderTimeoutReviewMarker = (input: {
334
+ contents: string;
335
+ }): string => {
336
+ const marker =
337
+ '# @declapract:review — provider `timeout:` is not the 60s default and could not be auto-bumped, because a non-default value is a deliberate operational choice; set provider `timeout: 60` (individual functions can still override it) or relax the requirement by hand — the red `declapract plan` diff names the `timeout: 60` line.';
338
+ // idempotent: the marker is already present, so a re-run is a no-op
339
+ if (input.contents.includes(marker)) return input.contents;
340
+ return `${marker}\n${input.contents}`;
341
+ };
342
+
343
+ const withDefaultTimeout = (input: { contents: string }): string => {
344
+ // idempotent skip: the 60s provider default is already declared
345
+ if (/^ {2}timeout: 60\b/m.test(input.contents)) return input.contents;
346
+
347
+ // primary anchor: the legacy 10s provider default (two-space indent = provider level)
348
+ if (/^ {2}timeout: 10\b/m.test(input.contents))
349
+ return input.contents.replace(
350
+ /^ {2}timeout: 10\b.*$/m,
351
+ ' timeout: 60 # default timeout to 1min, for resilience against increased cold start times; individual functions can override this',
352
+ );
353
+
354
+ // a provider timeout at some OTHER value → emit an actionable diagnostic, not a silent no-op;
355
+ // CONTAINS stays red and the marker names the shape to converge (the wisher-reserved fork)
356
+ if (/^ {2}timeout: \d+/m.test(input.contents))
357
+ return withProviderTimeoutReviewMarker({ contents: input.contents });
358
+
359
+ // no provider timeout at all → CONTAINS-red already names the absent line
360
+ return input.contents;
361
+ };
362
+
363
+ /**
364
+ * .what = insert `variablesResolutionMode:` after the `service:` line, if absent.
365
+ * .why = the service line may carry an inline comment; `[^\n]*` captures it into `$1` and
366
+ * preserves it. the name class is `\S[^\n]*` so ANY legal service name matches — an
367
+ * underscore (`svc_orders`) or a dotted name converges rather than soft-skips.
368
+ */
369
+ const withVariablesResolutionMode = (input: { contents: string }): string =>
370
+ withInsertOnceBefore({
371
+ contents: input.contents,
372
+ guard: 'variablesResolutionMode:',
373
+ anchor: /^(service: \S[^\n]*)\n/m,
374
+ insert: '$1\n\nvariablesResolutionMode: 20210326\n',
375
+ });
376
+
377
+ /**
378
+ * .what = insert the `custom.accessByStage` block before `provider:`, if absent.
379
+ * .why = the block maps BOTH non-prod deploy stages to the `prep` access (see the north-star
380
+ * axis-collapse): `dev → prep` (the ancient slug) AND `prep → prep` (the contemp slug), so
381
+ * self dual-publishes the dev+prep fleets and both read `ACCESS=prep`. absent it, an
382
+ * access-keyed lookup has no stage bridge.
383
+ * .note = TIER-C SCAFFOLD — this stage↔access bridge is transition-only, and the `prep: prep`
384
+ * dual-publish key is the transition mechanism itself. once the north-star axis-collapse
385
+ * retires the divergent `stage` (grep AccessAncient → 0 org-wide), the ancient `dev → prep`
386
+ * entry, the `-dev-` publish, and this whole transformer are DELETED — only the single
387
+ * access slug remains. it reads as a tidy permanent function on purpose (the decomposition
388
+ * named it clearly), but it is scaffold scheduled for removal, not settled design.
389
+ * .why = `section: 'custom'` — a real consumer commonly already holds a `custom:` block. this
390
+ * transformer emits a whole `custom:` block, so a content-only guard would insert a SECOND
391
+ * `custom:` key and yaml last-wins would silently drop the consumer's block. the section
392
+ * soft-skip declines that duplicate and CONTAINS surfaces the needed merge (add
393
+ * `accessByStage:` into the consumer's `custom:` block) as a red plan.
394
+ */
395
+ export const withAccessByStage = (input: { contents: string }): string =>
396
+ withInsertOnceBefore({
397
+ contents: input.contents,
398
+ guard: 'accessByStage:',
399
+ section: 'custom',
400
+ anchor: /\nprovider:/,
401
+ insert: `\n${accessByStageCustom}provider:`,
402
+ });
403
+
404
+ /**
405
+ * .what = replace the `STAGE` env var with the `ACCESS` + `COMMIT` sdk-environment pair.
406
+ * .why = sdk-environment targets resources by access + commit slug, not by stage.
407
+ * .note = TIER-C SCAFFOLD — the emitted `ACCESS` value reads through `${self:custom.access}`, the
408
+ * single hoisted var the `withAccessByStage` block declares (one source for the axis, so a
409
+ * partial edit cannot re-split it — D27). this rewrite gates on `accessByStage:` present, so
410
+ * it fires only once that block has landed: on a fresh consumer withAccessByStage inserts the
411
+ * block first (it runs earlier in the fold), then this rewrite lands the ACCESS pair against
412
+ * the now-declared `custom.access`; on a legacy consumer with a pre-extant `custom:` block
413
+ * withAccessByStage soft-skips (a review marker, no `custom.access`), so this rewrite also
414
+ * soft-skips rather than emit an unresolvable ref, and both land on a later pass once the
415
+ * human merges the block. when the axis-collapse lands, `ACCESS` derives from a single axis
416
+ * and this remap is removed. tracked with `withAccessByStage`.
417
+ * .note = anchor-missed marker: a consumer whose `custom.access` HAS landed (`accessByStage:` present)
418
+ * but whose env block holds no `STAGE: ${self:provider.stage}` var to convert (a legacy env
419
+ * block that predates the STAGE var, or one hand-stripped of it) cannot land the ACCESS pair by
420
+ * replace. the template's CONTAINS check still REQUIRES `ACCESS:`/`COMMIT:`, so that after-state
421
+ * is CONTAINS-red — and, absent a diagnostic, silently so. this emits a `@declapract:review`
422
+ * marker naming the pair to add by hand, matching the marker-on-miss standard of
423
+ * withUtcTimezone / withConnectionReuse, so the still-red `plan` carries an actionable
424
+ * diagnostic rather than a bare missing-line. a throw would abort the peer transforms; the
425
+ * marker does not.
426
+ */
427
+ const withAccessCommitEnv = (input: { contents: string }): string => {
428
+ // idempotent / already-correct skip: the ACCESS pair is already declared. this ALSO trips on the
429
+ // anchor-missed marker below, whose own text contains `ACCESS: ${self:custom.access}`, so a re-apply
430
+ // over marker-injected output is a clean no-op (no second marker, no double insert).
431
+ if (input.contents.includes('ACCESS:')) return input.contents;
432
+
433
+ // caller-without-callee guard: the `${self:custom.access}` ref the ACCESS pair (and the marker
434
+ // below) names is declared ONLY by the `withAccessByStage` block (which emits `accessByStage:` and
435
+ // `access:` together). on a legacy consumer that already holds a top-level `custom:` block,
436
+ // `withAccessByStage` soft-skipped its insert (a review marker, no `custom.access`), so emitting the
437
+ // ref now — via a rewrite OR a marker that quotes it — would dangle. defer to the later pass once the
438
+ // human merges the block; withAccessByStage's own marker already names that merge, so do NOT stack a
439
+ // second one here.
440
+ if (!input.contents.includes('accessByStage:')) return input.contents;
441
+
442
+ // primary anchor: a legacy `STAGE: ${self:provider.stage}` env var to replace with the ACCESS pair.
443
+ // withAccessByStage runs first in the fold, so `custom.access` is already declared to reference.
444
+ if (input.contents.includes('STAGE: ${self:provider.stage}'))
445
+ return input.contents.replace(
446
+ /STAGE: \$\{self:provider\.stage\}[^\n]*/,
447
+ 'ACCESS: ${self:custom.access} # sdk-environment access, to target the correct config + resources (e.g., hit prep db -vs- prod db)\n COMMIT: ${env:COMMIT} # sdk-environment commit slug, must be set by deploy command',
82
448
  );
449
+
450
+ // anchor missed: no `environment:` block at all → no shape to converge; CONTAINS-red already names
451
+ // the absent lines, and there is no env block to attach a marker to.
452
+ if (!input.contents.includes('environment:')) return input.contents;
453
+
454
+ // anchor missed with an env block present: `custom.access` is declared but no STAGE var exists to
455
+ // convert. emit an actionable diagnostic naming the ACCESS/COMMIT pair to add by hand (not a silent
456
+ // no-op), so the still-red CONTAINS `plan` self-documents the incomplete migration — consistent with
457
+ // the sibling env-insert transforms above.
458
+ const marker =
459
+ '# @declapract:review — could not auto-insert `ACCESS: ${self:custom.access}` + `COMMIT: ${env:COMMIT}` under `environment:` because no `STAGE: ${self:provider.stage}` env var was present to convert; add both as children of your `environment:` block by hand — the failing `declapract plan` diff names them.';
460
+ return `${marker}\n${input.contents}`;
461
+ };
462
+
463
+ /**
464
+ * .what = migrate a legacy stage-keyed `deploymentBucket: <base>-${self:provider.stage}` to the
465
+ * account-scoped `deploymentBucketByStage` map plus a map-reference. the bucket base is
466
+ * DERIVED from the consumer's own extant bucket name — never a guessed value (D27/row-1).
467
+ * .why = the deployment bucket is ACCOUNT-scoped: a prod deploy assumes the prod-account oidc role,
468
+ * which holds no cross-account grant to the prep-account bucket. the legacy
469
+ * `-${self:provider.stage}` name resolves to a nonexistent `-prep` bucket for a prep deploy
470
+ * (only `-dev` and `-prod` buckets exist), so the deploy fails at bucket lookup — the exact
471
+ * #596 break. the map keys dev+prep to the shared prep-account `-dev` bucket and prod to the
472
+ * prod-account `-prod` bucket. #596 added this shape to the template + a CONTAINS clamp, but
473
+ * no transform emitted it, so a legacy consumer's CONTAINS check stayed RED forever with no
474
+ * diagnostic — a non-convergent fix (the very row-1 class the wish forbids). this transform
475
+ * closes that: it converges the legacy shape and stays a fixed point on the go-forward shape.
476
+ * .note = the base is read from the consumer's own `deploymentBucket:` line (with or without a
477
+ * namespace segment), so the emitted names match the consumer's own convention rather than a
478
+ * guess. a consumer with no `deploymentBucket:` line has no base to derive, so this SOFT-SKIPS
479
+ * (returns unchanged) and CONTAINS surfaces the residual as a red plan — a value the fix
480
+ * cannot know is never invented. gated on `accessByStage:` present (the withAccessByStage
481
+ * block landed) so the `${self:custom.deploymentBucketByStage...}` reference never emits
482
+ * against a callee the fix did not also declare — the same caller-without-callee guard
483
+ * withAccessCommitEnv uses. runs after withAccessByStage.
484
+ * .note = TIER-C SCAFFOLD — dev+prep share the `-dev` bucket only through the transition; once the
485
+ * axis-collapse retires the divergent stage (grep AccessAncient -> 0), the `dev` key and this
486
+ * transformer are deleted, and the one access slug names the one bucket.
487
+ */
488
+ const withDeploymentBucketByStage = (input: { contents: string }): string => {
489
+ // idempotent skip: the map is already declared (go-forward shape or a prior fix pass)
490
+ if (input.contents.includes('deploymentBucketByStage:'))
491
+ return input.contents;
492
+
493
+ // caller-without-callee guard: the map sits in the withAccessByStage custom block and the
494
+ // reference points at custom.deploymentBucketByStage, so absent that block neither may land
495
+ if (!input.contents.includes('accessByStage:')) return input.contents;
496
+
497
+ // derive the bucket base from the consumer's own legacy stage-keyed deploymentBucket line; a value
498
+ // the fix cannot know is read, not guessed. the base is all that sits before `-${self:provider.stage}`
499
+ // (`serverless-deployment` or `serverless-deployment-<ns>`). soft-skip when no legacy line matches.
500
+ const legacy = input.contents.match(
501
+ /deploymentBucket: (serverless-deployment(?:-\S+?)?)-\$\{self:provider\.stage\}[^\n]*/,
502
+ );
503
+ // no legacy line to derive a base from → soft-skip. two sub-cases, in step with the env-insert
504
+ // soft-skips above (which gate on `environment:` presence):
505
+ // - a `deploymentBucket:` line EXISTS but does not match the legacy stage-keyed shape → the
506
+ // consumer has a bucket the fix cannot read, so emit an actionable review marker (not a
507
+ // silent no-op) so they get a named next step. a value the fix cannot know is never invented.
508
+ // - NO `deploymentBucket:` line at all → no base to derive, so return unchanged silently; there
509
+ // is no cross-account bucket to key, and CONTAINS surfaces any residual as a red plan.
510
+ if (!legacy) {
511
+ if (!input.contents.includes('deploymentBucket:')) return input.contents;
512
+ const marker = `# @declapract:review — could not derive an account-scoped \`deploymentBucketByStage\` map: the \`deploymentBucket:\` line present does not match the legacy \`serverless-deployment...-\${self:provider.stage}\` shape to read the bucket base from. if this service deploys cross-account, add a \`deploymentBucketByStage\` map under \`custom:\` by hand (dev+prep -> the prep-account bucket, prod -> the prod-account bucket) — the red \`declapract plan\` diff names it.`;
513
+ // idempotent: the marker is already present, so a re-run is a no-op
514
+ if (input.contents.includes(marker)) return input.contents;
515
+ return `${marker}\n${input.contents}`;
83
516
  }
517
+ const base = legacy[1];
84
518
 
85
- // add account:GetAccountInformation policy if not present
86
- if (!fixed.includes('account:GetAccountInformation')) {
87
- if (/iamRoleStatements:\s*\n/.test(fixed)) {
88
- fixed = fixed.replace(
519
+ // insert the deploymentBucketByStage map immediately after the hoisted `access:` line in custom
520
+ const withMap = input.contents.replace(
521
+ /( +access: \$\{self:custom\.accessByStage\.\$\{opt:stage\}, 'prep'\}[^\n]*\n)/,
522
+ `$1 deploymentBucketByStage: # the deployment bucket is ACCOUNT-scoped: it must live in the account the deploy role assumes, so it is keyed by stage like accessByStage above\n dev: ${base}-dev # prep-account bucket\n prep: ${base}-dev # prep-account bucket, shared with the -dev fleet, so no separate -prep bucket need exist\n prod: ${base}-prod # prod-account bucket — a prod deploy assumes the prod-account oidc role, which has no cross-account grant to the prep-account -dev bucket\n`,
523
+ );
524
+
525
+ // caller-without-callee guard: the `access:` anchor above may not match byte-for-byte (a
526
+ // hand-edited or mid-migration custom block whose `access:` line differs), in which case the map
527
+ // insert no-opped and `withMap` holds no `deploymentBucketByStage:` key. do NOT then rewrite the
528
+ // `deploymentBucket:` ref against an absent map — that would emit an orphan
529
+ // `${self:custom.deploymentBucketByStage...}` reference (the exact caller-without-callee class the
530
+ // file's other transforms guard against). soft-skip; CONTAINS stays red and names the residual.
531
+ if (!withMap.includes('deploymentBucketByStage:')) return input.contents;
532
+
533
+ // rewrite the legacy stage-keyed reference to the map (dev+prep -> -dev bucket, prod -> -prod)
534
+ return withMap.replace(
535
+ /deploymentBucket: serverless-deployment(?:-\S+?)?-\$\{self:provider\.stage\}[^\n]*/,
536
+ `deploymentBucket: \${self:custom.deploymentBucketByStage.\${opt:stage}, '${base}-dev'} # account-scoped via deploymentBucketByStage above; provision the -prod bucket in the prod account before the first prod deploy, or a prod deploy trades a cross-account-deny for an absent-bucket error`,
537
+ );
538
+ };
539
+
540
+ /**
541
+ * .what = swap the old `iam:ListAccountAliases` access-inference grant for
542
+ * `account:GetAccountInformation`, and add the grant when absent.
543
+ * .why = access inference from the account name is the go-forward path; the alias grant is
544
+ * obsolete.
545
+ */
546
+ const withAccessInferencePolicy = (input: { contents: string }): string => {
547
+ // swap the obsolete alias grant for the account-information grant, when present
548
+ const withAliasSwapped = input.contents.includes('iam:ListAccountAliases')
549
+ ? input.contents.replace(
550
+ /# allow inferring access from account alias\n\s+- Effect: Allow\n\s+Action:\n\s+- iam:ListAccountAliases\n\s+Resource: '\*'/,
551
+ accessInferencePolicy.trim(),
552
+ )
553
+ : input.contents;
554
+
555
+ // add the grant when absent and an iamRoleStatements block exists to hold it
556
+ const needsGrant =
557
+ !withAliasSwapped.includes('account:GetAccountInformation') &&
558
+ /iamRoleStatements:\s*\n/.test(withAliasSwapped);
559
+ return needsGrant
560
+ ? withAliasSwapped.replace(
89
561
  /iamRoleStatements:\s*\n/,
90
562
  `iamRoleStatements:\n${accessInferencePolicy}\n`,
91
- );
92
- }
93
- }
563
+ )
564
+ : withAliasSwapped;
565
+ };
94
566
 
95
- // add ssm:GetParameter to SSM permissions if only GetParameters exists
96
- if (
97
- fixed.includes('ssm:GetParameters') &&
98
- !fixed.includes('ssm:GetParameter\n')
99
- ) {
100
- fixed = fixed.replace(
101
- /Action: 'ssm:GetParameters'/,
102
- 'Action:\n - ssm:GetParameter\n - ssm:GetParameters',
103
- );
104
- }
567
+ /**
568
+ * .what = grant `ssm:GetParameter` alongside `ssm:GetParameters`, when only the plural exists.
569
+ * .why = the singular action is needed to read one param at a time; a grant of the plural
570
+ * alone denies it.
571
+ * .note = handles BOTH plural shapes yaml admits — the inline `Action: 'ssm:GetParameters'` and the
572
+ * list-item `- ssm:GetParameters` — so a consumer on either shape converges. deliberate no-op
573
+ * skip when no plural grant exists. a plural present in a THIRD shape neither anchor matched
574
+ * soft-skips (returns unchanged); CONTAINS requires the singular grant, so that residual
575
+ * leaves `plan` red — the signal, without a chain abort.
576
+ * .note = BOTH replaces are GLOBAL: a file with TWO separate ssm grant blocks (each its own Resource)
577
+ * augments every block, not just the first. idempotency is per-occurrence, not a
578
+ * whole-file early-return: a plural already preceded by its singular peer is left as-is, so
579
+ * `fix(fix(x)) === fix(x)` even across multiple blocks AND when one block already grants the
580
+ * singular while a second is plural-only (the whole-file `includes` guard could not
581
+ * distinguish those, so it left the second block non-convergent).
582
+ */
583
+ const withSsmGetParameter = (input: { contents: string }): string => {
584
+ // deliberate no-op skip: no plural grant to augment
585
+ if (!input.contents.includes('ssm:GetParameters')) return input.contents;
586
+
587
+ // inline form: `Action: 'ssm:GetParameters'` -> expand to a list that grants both (every match)
588
+ const withInlineExpanded = input.contents.replace(
589
+ /Action: 'ssm:GetParameters'/g,
590
+ 'Action:\n - ssm:GetParameter\n - ssm:GetParameters',
591
+ );
592
+
593
+ // list form: `- ssm:GetParameters` -> add the singular peer at the same indent, for EVERY block.
594
+ // per-occurrence idempotency: a plural already preceded by its singular peer is left untouched.
595
+ // soft-skip is implicit: a plural in a shape neither anchor matched (e.g. a double-quoted or
596
+ // flow-sequence form) matches no regex, so .replace returns the string unchanged; CONTAINS
597
+ // requires the singular, so `plan` stays red for that unhandled shape.
598
+ return withInlineExpanded.replace(
599
+ /( *)- ssm:GetParameters/g,
600
+ (match, indent: string, offset: number, whole: string) =>
601
+ whole.slice(0, offset).endsWith(`${indent}- ssm:GetParameter\n`)
602
+ ? match
603
+ : `${indent}- ssm:GetParameter\n${indent}- ssm:GetParameters`,
604
+ );
605
+ };
606
+
607
+ // the ordered transform chain. each reads as what, not how; the fold applies them in sequence.
608
+ // withNodeEnvProduction runs after withConnectionReuse, which anchors on the legacy NODE_ENV form.
609
+ const transforms: Array<(input: { contents: string }) => string> = [
610
+ withUnixNewlines,
611
+ withNodeRuntime,
612
+ withoutDeprecatedPlugins,
613
+ withNativeVariables,
614
+ withSingleHashCommentHeaders,
615
+ withUtcTimezone,
616
+ withConnectionReuse,
617
+ withNodeEnvProduction,
618
+ withPackageArtifact,
619
+ withPrunePlugin,
620
+ withDefaultTimeout,
621
+ withVariablesResolutionMode,
622
+ withAccessByStage,
623
+ withAccessCommitEnv,
624
+ withDeploymentBucketByStage,
625
+ withAccessInferencePolicy,
626
+ withSsmGetParameter,
627
+ ];
105
628
 
106
- return { contents: fixed };
629
+ /**
630
+ * .what = fold an ordered chain of pure content transforms over the file contents.
631
+ * .why = names the fold as one intent (`withTransformsApplied`), so `fix` reads what-not-how — the
632
+ * reduce mechanics live HERE, inside a named transformer, rather than inline in the `fix`
633
+ * orchestrator where a reader must simulate the accumulator across 17 transforms.
634
+ * .note = a pure reducer, no reassigned accumulator; each transform receives the prior transform's
635
+ * output. the chain ORDER matters (withConnectionReuse anchors the legacy NODE_ENV form that
636
+ * withNodeEnvProduction then rewrites) and is CLAMPED end-to-end: the unit suite asserts the
637
+ * converged post-fold shape and the `.declapract.integration.test.ts` runs the REAL
638
+ * executeApply, so a reorder that breaks a downstream anchor reddens CI, not prod.
639
+ */
640
+ const withTransformsApplied = (input: {
641
+ contents: string;
642
+ transforms: Array<(step: { contents: string }) => string>;
643
+ }): string =>
644
+ input.transforms.reduce(
645
+ (acc, transform) => transform({ contents: acc }),
646
+ input.contents,
647
+ );
648
+
649
+ export const fix: FileFixFunction = (contents) => {
650
+ if (!contents) return { contents }; // skip an absent file
651
+ return { contents: withTransformsApplied({ contents, transforms }) };
107
652
  };