declapract-typescript-ehmpathy 0.49.14 → 0.50.0

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 (440) hide show
  1. package/dist/.test/assets/cicd-common/declarations/declapract.declare.yml +8 -0
  2. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.declapract.integration.test.ts +597 -0
  3. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/.test.yml +19 -0
  4. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/consumer-owned.yml +21 -0
  5. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/.github/workflows/review.yml +26 -0
  6. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/declapract.use.yml +6 -0
  7. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/.test/assets/repo-with-unpinned-workflow/package.json +4 -0
  8. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/.declapract.integration.test.ts.snap +604 -0
  9. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/declastruct-insync-grep.declapract.integration.test.ts.snap +3 -0
  10. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/__snapshots__/report-slow-tests.play.declapract.integration.test.ts.snap +28 -0
  11. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/has-changelog-file/changelog.md.declapract.ts +11 -0
  12. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci-on-commit.yml.declapract.ts +3 -0
  13. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/ci_on_commit.yml.declapract.ts +3 -0
  14. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/pr-release-on-main.yml.declapract.ts +3 -0
  15. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test-on-commit.yml.declapract.ts +3 -0
  16. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-names/.github/workflows/test_on_commit.yml.declapract.ts +3 -0
  17. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-use-apikeys/.agent/repo=.this/role=any/skills/use.apikeys.json.declapract.ts +7 -0
  18. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/bad-practices/old-use-apikeys/.agent/repo=.this/role=any/skills/use.apikeys.sh.declapract.ts +7 -0
  19. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.declapract.readme.md +8 -0
  20. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/please-release/action.yml +469 -0
  21. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/actions/test-shards-setup/action.yml +68 -0
  22. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.declastruct.yml +218 -0
  23. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.install.yml +56 -0
  24. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml +434 -0
  25. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/.test.yml.declapract.ts +26 -0
  26. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/release.yml +32 -0
  27. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/report-slow-tests.sh +65 -0
  28. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/review.yml +26 -0
  29. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml +25 -0
  30. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/best-practice/.github/workflows/test.yml.declapract.ts +15 -0
  31. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/declastruct-insync-grep.declapract.integration.test.ts +49 -0
  32. package/dist/.test/assets/cicd-common/declarations/practices/cicd-common/report-slow-tests.play.declapract.integration.test.ts +161 -0
  33. package/dist/.test/assets/cicd-common/declarations/useCases.yml +11 -0
  34. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  35. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  36. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
  37. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
  38. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  39. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
  40. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  41. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/package.json +5 -0
  42. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  43. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  44. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/.declapract.integration.test.ts +15 -21
  45. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.declapract.integration.test.ts +2 -2
  46. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  47. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  48. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  49. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  50. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  51. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  52. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  53. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  54. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
  55. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
  56. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  57. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  58. package/dist/.test/assets/expo-fullusecase/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  59. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  60. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  61. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  62. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  63. package/dist/.test/assets/expo-migration/declarations/practices/git/.declapract.integration.test.ts +2 -2
  64. package/dist/.test/assets/expo-migration/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  65. package/dist/.test/assets/expo-migration/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  66. package/dist/.test/assets/expo-migration/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  67. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  68. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  69. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  70. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  71. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  72. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
  73. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
  74. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  75. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  76. package/dist/.test/assets/expo-migration/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  77. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  78. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  79. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  80. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  81. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  82. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  83. package/dist/.test/assets/git/declarations/declapract.declare.yml +8 -0
  84. package/dist/.test/assets/git/declarations/practices/git/.declapract.integration.test.ts +1001 -0
  85. package/dist/.test/assets/git/declarations/practices/git/.gitattributes.declapract.integration.test.ts +120 -0
  86. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/.gitattributes +6 -0
  87. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +7 -0
  88. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/package.json +4 -0
  89. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/declapract.use.yml +6 -0
  90. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/package.json +4 -0
  91. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/declapract.use.yml +9 -0
  92. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/package.json +4 -0
  93. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +55 -0
  94. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +24 -0
  95. package/dist/.test/assets/git/declarations/practices/git/best-practice/.declapract.readme.md +60 -0
  96. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitattributes.declapract.ts +77 -0
  97. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitignore.declapract.ts +100 -0
  98. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.declapract.integration.test.ts +181 -0
  99. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.declare.yml +4 -0
  100. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.use.yml +11 -0
  101. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/package.json +1 -0
  102. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/useCases.yml +8 -0
  103. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/__snapshots__/.declapract.integration.test.ts.snap +234 -0
  104. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  105. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/codegen.dynamodb.dao.ts +16 -0
  106. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json +16 -0
  107. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json.declapract.ts +3 -0
  108. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/provision/docker/integration-test-db/docker-compose.yml +9 -0
  109. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.declapract.integration.test.ts +237 -0
  110. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +159 -0
  111. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declapract.use.yml +20 -0
  112. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declarations/declapract.declare.yml +6 -0
  113. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/package.json +4 -0
  114. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/codegen.sql.dao.yml +20 -0
  115. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.declare.yml +4 -0
  116. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.use.yml +19 -0
  117. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/package.json +4 -0
  118. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/provision/docker/testdb/build-image.dockerfile +6 -0
  119. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.declare.yml +4 -0
  120. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.use.yml +21 -0
  121. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/package.json +4 -0
  122. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/provision/schema/sql/init/.extensions.sql +9 -0
  123. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
  124. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
  125. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
  126. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
  127. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  128. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  129. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
  130. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
  131. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  132. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +77 -0
  133. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/config-validates-schema.declapract.integration.test.ts.snap +500 -0
  134. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/database-wrappers-typecheck.declapract.integration.test.ts.snap +10 -0
  135. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
  136. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/engine-upgrade.declapract.integration.test.ts.snap +151 -0
  137. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  138. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
  139. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/ssm-param-names.declapract.integration.test.ts.snap +9 -0
  140. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
  141. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/with-connection-in-input.declapract.integration.test.ts.snap +57 -0
  142. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.integration.test.ts +71 -0
  143. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.readme.md +6 -0
  144. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/declapract.declare.yml +4 -0
  145. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/declapract.use.yml +19 -0
  146. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/package.json +4 -0
  147. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.test/assets/demo-repo-with-legacy-change-id/provision/schema/sql/init.yml +15 -0
  148. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/__snapshots__/.declapract.integration.test.ts.snap +39 -0
  149. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/provision/schema/<star><star>/<star>.yml.declapract.ts +68 -0
  150. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/.declapract.readme.md +5 -0
  151. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/database.sql.declapract.ts +3 -0
  152. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/extensions.sql.declapract.ts +13 -0
  153. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/schema.sql.declapract.ts +3 -0
  154. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.cicd.sql.declapract.ts +3 -0
  155. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/provision/schema/sql/init/user.datalakedb.sql.declapract.ts +3 -0
  156. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-config-file-names/codegen.sql.yml.declapract.ts +3 -0
  157. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +23 -0
  158. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.integration.test.ts +221 -0
  159. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.readme.md +11 -0
  160. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/declapract.declare.yml +4 -0
  161. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/declapract.use.yml +19 -0
  162. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/package.json +4 -0
  163. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/access/daos/daoSurfer.ts +15 -0
  164. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/domain.operations/getSurfLesson.ts +14 -0
  165. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/utils/database/getDatabaseConnection.integration.test.ts +10 -0
  166. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/demo-repo-with-old-get-database-connection/src/utils/database/getDatabaseConnection.ts +68 -0
  167. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.3a193e5.ts +65 -0
  168. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.66284e3.ts +30 -0
  169. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.68cf8ba.ts +90 -0
  170. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.9e1bdc4.ts +65 -0
  171. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.c6cef7e.ts +68 -0
  172. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.c8eb35b.ts +90 -0
  173. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.d1e8cd7.ts +31 -0
  174. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.e0c53d8.ts +90 -0
  175. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.eab15c0.ts +89 -0
  176. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.ef25ae0.ts +32 -0
  177. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.test/assets/old-templates/getDatabaseConnection.integration.test.66284e3.ts +10 -0
  178. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/__snapshots__/.declapract.integration.test.ts.snap +75 -0
  179. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/<star><star>/<star>.ts.declapract.ts +33 -0
  180. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/utils/database/getDatabaseConnection.integration.test.ts.declapract.ts +43 -0
  181. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/src/utils/database/getDatabaseConnection.ts.declapract.ts +51 -0
  182. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/.declapract.readme.md +1 -0
  183. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/provision/docker/integration_test_db/<star><star>/<star>.declapract.ts +15 -0
  184. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/.declapract.readme.md +1 -0
  185. package/dist/.test/assets/git/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
  186. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/.declapract.readme.md +1 -0
  187. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json +8 -0
  188. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +10 -0
  189. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json +9 -0
  190. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +22 -0
  191. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-param-placeholder/config/<star>.json.declapract.ts +14 -0
  192. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.integration.test.ts +86 -0
  193. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.readme.md +9 -0
  194. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/declapract.declare.yml +4 -0
  195. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/declapract.use.yml +19 -0
  196. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/package.json +4 -0
  197. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/src/access/sdks/sdkWaveArchive.ts +7 -0
  198. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.test/assets/demo-repo-with-plaintext-pg-client/src/utils/database/getSurfReportConnection.ts +19 -0
  199. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/__snapshots__/.declapract.integration.test.ts.snap +72 -0
  200. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/src/<star><star>/<star>.ts.declapract.ts +32 -0
  201. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/.declapract.readme.md +1 -0
  202. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +12 -0
  203. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +13 -0
  204. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.declapract.integration.test.ts +95 -0
  205. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.declare.yml +4 -0
  206. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/declapract.use.yml +18 -0
  207. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/package.json +4 -0
  208. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.test/assets/demo-repo-with-terraform-ssm/provision/aws/product/parameter-store.tf +32 -0
  209. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/__snapshots__/.declapract.integration.test.ts.snap +60 -0
  210. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/provision/aws/product/parameter-store.tf.declapract.ts +94 -0
  211. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.declapract.readme.md +10 -0
  212. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/declapract.use.yml +2 -0
  213. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/package.json +4 -0
  214. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/src/domain.operations/findSurferById.ts +9 -0
  215. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.test/assets/demo-repo-with-connection-in-input/src/utils/database/withDatabaseConnection.ts +10 -0
  216. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/src/<star><star>/<star>.ts.declapract.ts +55 -0
  217. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +114 -0
  218. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  219. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +18 -0
  220. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml.declapract.ts +35 -0
  221. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.schema.yml +6 -0
  222. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.types.yml +16 -0
  223. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json +40 -0
  224. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json.declapract.ts +11 -0
  225. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json +40 -0
  226. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +11 -0
  227. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json +37 -0
  228. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +11 -0
  229. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json +36 -0
  230. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json.declapract.ts +3 -0
  231. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  232. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/readme.md +113 -0
  233. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +60 -0
  234. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.ts +30 -0
  235. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile +7 -0
  236. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile.declapract.ts +37 -0
  237. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.integration.test.ts +115 -0
  238. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.sh +165 -0
  239. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/compose.sh +43 -0
  240. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/docker-compose.yml +19 -0
  241. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/.gitignore +3 -0
  242. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/readme.md +3 -0
  243. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +25 -0
  244. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/connection.config.js +36 -0
  245. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/control.yml +7 -0
  246. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +97 -0
  247. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.database.sql +10 -0
  248. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql +16 -0
  249. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +46 -0
  250. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.schema.sql +11 -0
  251. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.cicd.sql +14 -0
  252. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.datalakedb.sql +12 -0
  253. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/default_transaction_isolation.sql +6 -0
  254. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/user.service.sql +16 -0
  255. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml +9 -0
  256. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml.declapract.ts +3 -0
  257. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbIdentity.ts +52 -0
  258. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbPort.ts +17 -0
  259. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +77 -0
  260. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.test.ts +82 -0
  261. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.ts +52 -0
  262. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/databaseClientTimeouts.ts +14 -0
  263. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts +10 -0
  264. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts +119 -0
  265. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabasePort.ts +30 -0
  266. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.test.ts +51 -0
  267. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.ts +86 -0
  268. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +54 -0
  269. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +35 -0
  270. package/dist/.test/assets/git/declarations/practices/persist-with-rds/config-validates-schema.declapract.integration.test.ts +332 -0
  271. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-client.declapract.integration.test.ts +291 -0
  272. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-wrappers-typecheck.declapract.integration.test.ts +225 -0
  273. package/dist/.test/assets/git/declarations/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
  274. package/dist/.test/assets/git/declarations/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
  275. package/dist/.test/assets/git/declarations/practices/persist-with-rds/engine-upgrade.declapract.integration.test.ts +243 -0
  276. package/dist/.test/assets/git/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  277. package/dist/.test/assets/git/declarations/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
  278. package/dist/.test/assets/git/declarations/practices/persist-with-rds/ssm-param-names.declapract.integration.test.ts +154 -0
  279. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-per-worktree.declapract.integration.test.ts +332 -0
  280. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
  281. package/dist/.test/assets/git/declarations/practices/persist-with-rds/with-connection-in-input.declapract.integration.test.ts +97 -0
  282. package/dist/.test/assets/git/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
  283. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +9 -0
  284. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
  285. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
  286. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
  287. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/.agent/keyrack.yml +9 -0
  288. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.node.yml +4 -0
  289. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.yml +4 -0
  290. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/package.json +4 -0
  291. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/declapract.use.yml +4 -0
  292. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/package.json +22 -0
  293. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  294. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
  295. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +33 -0
  296. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/keyrack-yml-findsert.declapract.integration.test.ts.snap +28 -0
  297. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/self-link-build-order.declapract.integration.test.ts.snap +81 -0
  298. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/.declapract.readme.md +11 -0
  299. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/rhachet.use.ts.declapract.ts +12 -0
  300. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +59 -0
  301. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.declare.yml +4 -0
  302. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/declapract.use.yml +2 -0
  303. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
  304. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json +5 -0
  305. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +88 -0
  306. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/<star><star>/<star>peer-review<star>.md.declapract.ts +16 -0
  307. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.behavior/<star><star>/.reviews/peer/<star><star>/<star>.md.declapract.ts +16 -0
  308. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
  309. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/keyrack.yml.declapract.ts +143 -0
  310. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +22 -0
  311. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +189 -0
  312. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.declapract.readme.md +40 -0
  313. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  314. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +94 -0
  315. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json +19 -0
  316. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json.declapract.ts +51 -0
  317. package/dist/.test/assets/git/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +91 -0
  318. package/dist/.test/assets/git/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +149 -0
  319. package/dist/.test/assets/git/declarations/practices/rhachet/keyrack-yml-findsert.declapract.integration.test.ts +105 -0
  320. package/dist/.test/assets/git/declarations/practices/rhachet/self-link-build-order.declapract.integration.test.ts +88 -0
  321. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/blackbox/lambdas/consumeSESEmailEventFromSNS.acceptance.test.ts +23 -0
  322. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/declapract.use.yml +9 -0
  323. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/package.json +4 -0
  324. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  325. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/declapract.use.yml +9 -0
  326. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/package.json +4 -0
  327. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  328. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/declapract.use.yml +9 -0
  329. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/package.json +4 -0
  330. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  331. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/livedb-wake-branches.declapract.integration.test.ts.snap +6 -0
  332. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/old-acceptance-test-utils.declapract.integration.test.ts.snap +162 -0
  333. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/test-kind-seam.declapract.integration.test.ts.snap +9 -0
  334. package/dist/.test/assets/git/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +111 -0
  335. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.integration.test.ts +69 -0
  336. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.readme.md +19 -0
  337. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.test/assets/demo-repo-with-stale-test-fns-dep/declapract.use.yml +3 -0
  338. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.test/assets/demo-repo-with-stale-test-fns-dep/package.json +11 -0
  339. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/__snapshots__/.declapract.integration.test.ts.snap +43 -0
  340. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/package.json.declapract.ts +81 -0
  341. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/.declapract.readme.md +1 -0
  342. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/jest.<star>.js.declapract.ts +17 -0
  343. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/.declapract.readme.md +8 -0
  344. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.js +3 -0
  345. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.ts +3 -0
  346. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.integration.test.ts +83 -0
  347. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.readme.md +22 -0
  348. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/.test/assets/.agent/config.yml +1 -0
  349. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/.test/assets/.rhachet/manifest.json +1 -0
  350. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/accept.blackbox/somefile.ts +1 -0
  351. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/declapract.use.yml +6 -0
  352. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.test/assets/demo-repo-with-accept-blackbox-dir/package.json +4 -0
  353. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/accept.blackbox/<star><star>/<star>.declapract.ts +19 -0
  354. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/acceptance/<star><star>/<star>.declapract.ts +19 -0
  355. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +31 -0
  356. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/<star><star>/<star>.ts.declapract.ts +25 -0
  357. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/getDataFromLastOpenBracketAtStartOfLine.ts.declapract.ts +3 -0
  358. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/invokeLambda.ts.declapract.ts +3 -0
  359. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +49 -0
  360. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-2/blackbox/lambdas/<star>.ts.declapract.ts +27 -0
  361. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/_utils/environment.ts.declapract.ts +3 -0
  362. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/lambdas/<star>.ts.declapract.ts +23 -0
  363. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/.declapract.readme.md +3 -0
  364. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.acceptance.ts.declapract.ts +11 -0
  365. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.integration.ts.declapract.ts +11 -0
  366. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/.declapract.readme.md +8 -0
  367. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/<star>.ts.declapract.ts +27 -0
  368. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/__test_assets__/<star><star>/<star>.declapract.ts +17 -0
  369. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/<star><star>/__test_utils__/<star><star>/<star>.declapract.ts +17 -0
  370. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.readme.md +52 -0
  371. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.todo.md +3 -0
  372. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  373. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json +18 -0
  374. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json.declapract.ts +3 -0
  375. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/.test/useWakeOfLivedb.ts +209 -0
  376. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.integration.test.ts.declapract.ts +8 -0
  377. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.test.ts.declapract.ts +7 -0
  378. package/dist/.test/assets/git/declarations/practices/tests-any/build-ifstale.declapract.integration.test.ts +124 -0
  379. package/dist/.test/assets/git/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  380. package/dist/.test/assets/git/declarations/practices/tests-any/livedb-wake-branches.declapract.integration.test.ts +315 -0
  381. package/dist/.test/assets/git/declarations/practices/tests-any/old-acceptance-test-utils.declapract.integration.test.ts +122 -0
  382. package/dist/.test/assets/git/declarations/practices/tests-any/package.json.shell-flags.declapract.integration.test.ts +139 -0
  383. package/dist/.test/assets/git/declarations/practices/tests-any/test-kind-seam.declapract.integration.test.ts +87 -0
  384. package/dist/.test/assets/git/declarations/useCases.yml +29 -0
  385. package/dist/.test/assets/{expo-fullusecase/declarations/practices/git/best-practice → git/repo-with-all-gitattributes-declarers}/.gitattributes +3 -0
  386. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/declapract.use.yml +26 -0
  387. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/package.json +4 -0
  388. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  389. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  390. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  391. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
  392. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
  393. package/dist/.test/assets/pnpm/declarations/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  394. package/dist/.test/assets/pnpm/declarations/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  395. package/dist/.test/assets/pnpm/declarations/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  396. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  397. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  398. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  399. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  400. package/dist/__snapshots__/gitattributesDeclarers.declapract.integration.test.ts.snap +79 -0
  401. package/dist/__snapshots__/repoSkills.declapract.acceptance.test.ts.snap +512 -0
  402. package/dist/__snapshots__/typecheckBestPracticeTemplates.declapract.integration.test.ts.snap +80 -0
  403. package/dist/gitattributesDeclarers.declapract.integration.test.ts +438 -0
  404. package/dist/practiceOwnerPerFile.declapract.integration.test.ts +53 -0
  405. package/dist/practices/cicd-common/.declapract.integration.test.ts +15 -21
  406. package/dist/practices/git/.declapract.integration.test.ts +2 -2
  407. package/dist/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  408. package/dist/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  409. package/dist/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  410. package/dist/practices/git/best-practice/.declapract.readme.md +37 -0
  411. package/dist/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  412. package/dist/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  413. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  414. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  415. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/left-pad@1.3.0.patch +6 -0
  416. package/dist/practices/persist-with-rds/.test/assets/repo-with-hand-patch/patches/pg-pool@3.14.0.patch +12 -0
  417. package/dist/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  418. package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +29 -0
  419. package/dist/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  420. package/dist/practices/persist-with-rds/best-practice/package.json +5 -0
  421. package/dist/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  422. package/dist/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  423. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/declapract.use.yml +4 -0
  424. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/package.json +15 -0
  425. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy.patch +6 -0
  426. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/rhachet-roles-ehmpathy@1.39.1.patch +6 -0
  427. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/patches/type-fns@1.21.3.patch +6 -0
  428. package/dist/practices/pnpm/.test/assets/repo-stale-patch-beside-bare/pnpm-lock.yaml +19 -0
  429. package/dist/practices/pnpm/__snapshots__/stale-patched-dependency.declapract.integration.test.ts.snap +39 -0
  430. package/dist/practices/pnpm/stale-patched-dependency.declapract.integration.test.ts +53 -0
  431. package/dist/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  432. package/dist/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  433. package/dist/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  434. package/dist/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  435. package/dist/repoSkills.declapract.acceptance.test.ts +1150 -0
  436. package/dist/typecheckBestPracticeTemplates.declapract.integration.test.ts +181 -19
  437. package/dist/utils/defineExpectedGitattributesContents.ts +247 -0
  438. package/package.json +6 -6
  439. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes +0 -7
  440. package/dist/practices/git/best-practice/.gitattributes +0 -7
@@ -0,0 +1,37 @@
1
+ {
2
+ "database": {
3
+ "target": {
4
+ "database": "@declapract{variable.databaseName}",
5
+ "schema": "@declapract{variable.databaseName}"
6
+ },
7
+ "role": {
8
+ "cicd": {
9
+ "for-plan": {
10
+ "username": "@declapract{variable.databaseUserName.cicdUser}",
11
+ "password": "__CHANG3_ME__"
12
+ },
13
+ "for-apply": {
14
+ "username": "@declapract{variable.databaseUserName.cicdUser}",
15
+ "password": "__CHANG3_ME__"
16
+ }
17
+ },
18
+ "crud": {
19
+ "username": "@declapract{variable.databaseUserName.serviceUser}",
20
+ "password": "__CHANG3_ME__"
21
+ }
22
+ },
23
+ "tunnel": {
24
+ "bastion": {
25
+ "exid": "vpc-main-bastion"
26
+ },
27
+ "cluster": {
28
+ "name": "@declapract{variable.databaseClusterName}"
29
+ },
30
+ "local": {
31
+ "host": "localhost",
32
+ "port": 7821
33
+ },
34
+ "lambda": null
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,11 @@
1
+ import { genRdsConfigDeclaration } from '../../../../utils/genRdsConfigDeclaration';
2
+
3
+ /**
4
+ * .what = the contents, check, and fix that deep-merge the rds keys into config/test.json.
5
+ * .why = a deep merge adds the absent rds keys and keeps the leaves a repo holds on purpose, so an
6
+ * apply never clobbers a value a service tuned (#638); see genRdsConfigDeclaration.
7
+ */
8
+ export const { contents, check, fix } = genRdsConfigDeclaration({
9
+ env: 'test',
10
+ templatePath: `${__dirname}/test.json`,
11
+ });
@@ -0,0 +1,36 @@
1
+ {
2
+ "dependencies": {
3
+ "iso-time": "@declapract{check.minVersion('1.11.7')}",
4
+ "pg": "@declapract{check.minVersion('8.3.0')}",
5
+ "yesql": "@declapract{check.minVersion('3.2.2')}"
6
+ },
7
+ "devDependencies": {
8
+ "sql-code-generator": "@declapract{check.minVersion('0.10.2')}",
9
+ "sql-dao-generator": "@declapract{check.minVersion('0.13.1')}",
10
+ "sql-schema-control": "@declapract{check.minVersion('1.8.1')}",
11
+ "sql-schema-generator": "@declapract{check.minVersion('0.26.1')}",
12
+ "@types/yesql": "@declapract{check.minVersion('3.2.2')}",
13
+ "@types/pg": "@declapract{check.minVersion('8.6.1')}"
14
+ },
15
+ "pnpm": {
16
+ "patchedDependencies": {
17
+ "pg-pool": "patches/pg-pool.patch"
18
+ }
19
+ },
20
+ "scripts": {
21
+ "generate:dao:postgres": "sql-dao-generator generate && npm run fix:format",
22
+ "generate:schema": "sql-schema-generator generate -c codegen.sql.schema.yml && npm run fix:format",
23
+ "generate:types-from-sql": "sql-code-generator generate -c codegen.sql.types.yml && npm run fix:format",
24
+ "provision:schema:plan": "sql-schema-control plan -c provision/schema/control.yml",
25
+ "provision:schema:apply": "sql-schema-control apply -c provision/schema/control.yml",
26
+ "provision:schema:sync": "sql-schema-control sync -c provision/schema/control.yml",
27
+ "provision:testdb:docker:clear": "for port in $(bash provision/docker/testdb/compose.sh config --format json | jq -r '.services[].ports[]?.published'); do docker rm -f $(docker ps -a -f \"publish=$port\" -q) 2>/dev/null || true; done && echo 'ensured ports are available 👍'",
28
+ "provision:testdb:docker:prepare": "cp provision/schema/sql/init/.extensions.sql provision/docker/testdb/init/extensions.sql && cp provision/schema/sql/init/.schema.sql provision/docker/testdb/init/schema.sql && cp provision/schema/sql/init/.user.cicd.sql provision/docker/testdb/init/user.cicd.sql",
29
+ "provision:testdb:docker:up": "bash provision/docker/testdb/compose.sh up -d --force-recreate --build --renew-anon-volumes",
30
+ "provision:testdb:docker:await": "bash provision/docker/testdb/compose.sh exec -T postgres /root/wait-for-postgres.sh",
31
+ "provision:testdb:docker:down": "bash provision/docker/testdb/compose.sh down",
32
+ "provision:testdb": "npm run provision:testdb:docker:clear && npm run provision:testdb:docker:prepare && npm run provision:testdb:docker:up && npm run provision:testdb:docker:await && ACCESS=test npm run provision:schema:plan && ACCESS=test npm run provision:schema:apply && ACCESS=test npm run provision:schema:plan",
33
+ "start:testdb": "npm run provision:testdb",
34
+ "start:livedb:prep": "rhx use.rds.capacity --env prep"
35
+ }
36
+ }
@@ -0,0 +1,3 @@
1
+ import { FileCheckType } from 'declapract';
2
+
3
+ export const check = FileCheckType.CONTAINS;
@@ -0,0 +1,21 @@
1
+ .what = drops pg-pool's lazy `require('pg')` fallback, so dpdm sees no pg <-> pg-pool require cycle
2
+ .why = pg passes its own Client into every pool it builds, so the fallback never runs under pg; but
3
+ dpdm reads it statically, and `test:lint:cycles` checks node_modules (exclude: []) by policy
4
+ .note = shipped by declapract-typescript-ehmpathy, practice persist-with-rds. if pnpm warns that this
5
+ patch failed to apply, pg-pool moved the line: upgrade declapract-typescript-ehmpathy and
6
+ re-apply. if no fix has shipped yet, pin your own `pg-pool@<version>` patch: an exact key
7
+ outranks this bare one. code that calls `new Pool()` from pg-pool directly must pass
8
+ `{ Client: require('pg').Client }`. after an apply, run `pnpm install` and commit the
9
+ lockfile: it records this file's hash.
10
+ .recut = keep one context line on each side of the changed line. wider context misfits older
11
+ pg-pool releases, and pnpm then warns and installs pg-pool unpatched. edit this file only
12
+ when the hunk must move: its hash sits in every adopter's lockfile, header included.
13
+
14
+ diff --git a/index.js b/index.js
15
+ --- a/index.js
16
+ +++ b/index.js
17
+ @@ -94,3 +94,3 @@ class Pool extends EventEmitter {
18
+ this.log = this.options.log || function () {}
19
+ - this.Client = this.options.Client || Client || require('pg').Client
20
+ + this.Client = this.options.Client || Client
21
+ this.Promise = this.options.Promise || global.Promise
@@ -0,0 +1,113 @@
1
+ # provision / aws
2
+
3
+ the declastruct-aws wish for this service's aws resources.
4
+
5
+ - `resources.ts` — the wish entrypoint (providers + `getResources`).
6
+ - `resources.parameters.ts` — the secret ssm parameters, adopted from terraform.
7
+ - `product/parameter-store.tf` — the terraform FORGET blocks (transitional).
8
+
9
+ ## why declastruct-aws, not terraform
10
+
11
+ terraform managed these secrets with the `__IGNORED__` + `ignore_changes = [value]`
12
+ workaround: the value was written once at seed, then terraform pretended it never
13
+ drifted. that hides real drift and forces the secret through terraform state.
14
+
15
+ `DeclaredAwsSsmParameterSecure` is **write-only by contract**:
16
+
17
+ | phase | reads value? | kms | api |
18
+ | ----- | ------------ | --- | --- |
19
+ | plan | never | no kms:Decrypt | DescribeParameters (metadata only) |
20
+ | apply | only when a value is supplied | kms:Encrypt | PutParameter |
21
+
22
+ ## the param names
23
+
24
+ each name is the one sdk-config (>= 0.3.0) derives for a bare `$.at(aws::param)` in
25
+ `config/{env}.json`:
26
+
27
+ ```
28
+ /{org}/{project}/{config}/{keyPath}
29
+ ```
30
+
31
+ | config key | ssm name (prep) |
32
+ | ---------- | --------------- |
33
+ | `database.role.crud.password` | `/{org}/{project}/prep/database.role.crud.password` |
34
+ | `database.role.cicd.for-plan.password` | `/{org}/{project}/prep/database.role.cicd.for-plan.password` |
35
+ | `database.role.cicd.for-apply.password` | `/{org}/{project}/prep/database.role.cicd.for-apply.password` |
36
+
37
+ the config segment is the CONFIG slug (`CONFIG`), never the access: config's reader, the
38
+ oidc iam policy, and the declared `name` must be byte-identical.
39
+
40
+ ## adoption by absence
41
+
42
+ the wish supplies **no `value`**: a value-less secret is write-only KEEP. plan reports
43
+ KEEP for every extant param and never reads or rewrites it.
44
+
45
+ - a **CREATE at plan** means no live param holds that name yet → copy its value first
46
+ (below), never let the apply create it.
47
+ - a value-less secret that is **ABSENT** throws on apply (declastruct-aws
48
+ `setSsmParameterSecure`). only prep + prod apply the wish, so test never meets it.
49
+
50
+ ## copy params to the derived names (before the first plan at a new name)
51
+
52
+ a repo whose values sit at a prior name holds no value at the derived name, so its
53
+ first `provision` apply throws at the absent param. copy each value first, per env
54
+ (prep, then prod). a copy keeps the source param, so it is safe to repeat.
55
+
56
+ | prior name | derived name |
57
+ | ---------- | ------------ |
58
+ | `{org}.{project}.{dev\|prod}.database.role.crud.password` | `/{org}/{project}/{config}/database.role.crud.password` |
59
+ | `/{org}/{project}/database/role/cicd/for-plan/password` | `/{org}/{project}/{config}/database.role.cicd.for-plan.password` |
60
+ | `/{org}/{project}/database/role/cicd/for-apply/password` | `/{org}/{project}/{config}/database.role.cicd.for-apply.password` |
61
+
62
+ where the roles were also renamed (`role.admin` / `role.service` in an older config), the
63
+ values move with the rename:
64
+
65
+ | prior role | derived name it seeds |
66
+ | ---------- | --------------------- |
67
+ | `admin` | `/{org}/{project}/{config}/database.role.cicd.for-plan.password` |
68
+ | `admin` | `/{org}/{project}/{config}/database.role.cicd.for-apply.password` |
69
+ | `service` | `/{org}/{project}/{config}/database.role.crud.password` |
70
+
71
+ the copy is a manual aws ssm step, run with the access for the env:
72
+
73
+ ```sh
74
+ VALUE=$(aws ssm get-parameter --with-decryption --name "<prior name>" --query Parameter.Value --output text)
75
+ aws ssm put-parameter --type SecureString --name "<derived name>" --value "$VALUE"
76
+ ```
77
+
78
+ then set each `config/{env}.json` password to the bare `$.at(aws::param)`.
79
+
80
+ ## iam boundary (the two oidc roles)
81
+
82
+ the prod oidc plan/apply split (see `.github/workflows/.declastruct.yml`, the aws-auth
83
+ path) maps onto the write-only contract exactly:
84
+
85
+ - **plan role** (`CREDS_CICD_AWS_PROD_OIDC_PLAN_ROLE_ARN`): `ssm:DescribeParameters` +
86
+ `ssm:ListTagsForResource` only. NO `ssm:GetParameter`, NO `kms:Decrypt` — it
87
+ reconciles metadata. its ONE decrypt exception is the
88
+ `/{org}/{project}/{config}/database.role.cicd.for-plan.password` credential.
89
+ - **apply role** (`CREDS_CICD_AWS_PROD_OIDC_APPLY_ROLE_ARN`): `ssm:PutParameter` +
90
+ `kms:Encrypt` (default `aws/ssm` key) + the tag write perms. never needs decrypt.
91
+
92
+ tags conform to the access vocab (`prep`), so an apply reconciles a live `dev` tag to
93
+ `prep` (a metadata-only change, no value write).
94
+
95
+ ## order of operations (once per env — prep, then prod)
96
+
97
+ the handoff is lossless because terraform forgets the param without a destroy of the
98
+ live value. run ONCE per env, in order:
99
+
100
+ 1. copy params to the derived names (above).
101
+ 2. `npx declapract apply` — the `terraform-parameters` bad-practice rewrites every
102
+ `resource "aws_ssm_parameter"` in `product/parameter-store.tf` into a `removed{}`
103
+ forget block (`destroy = false`) and drops the `data` reads; a forget of an
104
+ admin/service param names its copy target in a comment. requires terraform >= 1.7
105
+ (bump `versions.tf#required_version` if below).
106
+ 3. `terraform apply` (the `aws-*-terraform` provision jobs) — terraform drops the
107
+ params from state; live values untouched. 🚩 if the plan shows any
108
+ `DeleteParameter`, STOP — the forget is wrong.
109
+ 4. declastruct plan/apply the wish (the `aws-*-declastruct` provision jobs) — plan
110
+ shows KEEP for every param (no decrypt). a CREATE means a value was not copied → STOP.
111
+
112
+ after both land in every env, the `removed{}` blocks (and this transitional tf file)
113
+ can be pruned in a follow-up.
@@ -0,0 +1,60 @@
1
+ import { DeclaredAwsSsmParameterSecure } from 'declastruct-aws';
2
+ import { getEnvironment } from 'sdk-environment';
3
+
4
+ /**
5
+ * .what = the secret ssm parameters this service manages via declastruct.
6
+ * .why = declastruct-aws owns them, off terraform (provision/aws/product/parameter-store.tf is a
7
+ * forget). each is a write-only DeclaredAwsSsmParameterSecure: plan reads metadata only and
8
+ * never the value.
9
+ * .note = no `value` is supplied: plan KEEPs an extant param and never rewrites it. a value-less
10
+ * param that is ABSENT throws on apply (declastruct-aws setSsmParameterSecure). only prep
11
+ * and prod apply this wish, so test never meets that throw.
12
+ * .scope = the db-role credentials only. a service declares its own other secrets beside these.
13
+ */
14
+
15
+ /**
16
+ * .what = the environment this wish runs in.
17
+ * .why = `config` NAMES each param (the segment sdk-config derives); `access` TAGS it. the two may
18
+ * differ (ACCESS=prep CONFIG=prod is legal), and the app reads the params of its config.
19
+ */
20
+ const { access, config } = getEnvironment.static();
21
+
22
+ /**
23
+ * .what = declare a secret ssm parameter for adoption (write-only, default key).
24
+ * .why = the value already lives in aws, so plan KEEPs it and never reads or rewrites it.
25
+ * keyId=null selects the account default aws/ssm key.
26
+ */
27
+ const secret = (input: { name: string }): DeclaredAwsSsmParameterSecure =>
28
+ DeclaredAwsSsmParameterSecure.as({
29
+ name: input.name,
30
+ keyId: null, // default aws/ssm key
31
+ description: null,
32
+ tags: {
33
+ app: '@declapract{variable.organizationName}',
34
+ environment: access,
35
+ product: '@declapract{variable.projectName}',
36
+ },
37
+ // no `value` → write-only KEEP: adopt the live value, never read or rewrite it
38
+ });
39
+
40
+ /**
41
+ * .what = the full set of secret ssm parameters this wish declares.
42
+ * .why = each name is the one sdk-config derives for a bare `$.at(aws::param)` placeholder in
43
+ * config/{env}.json: `/{org}/{project}/{config}/{keyPath}`. the provision declares exactly
44
+ * the names the app reads.
45
+ * .note = @declapract:review — a param whose value still sits only at a prior name has no value
46
+ * here, and its first apply throws at the absent param. copy each value to its derived
47
+ * name first (see provision/aws/readme.md, "copy params to the derived names").
48
+ */
49
+ export const getAllParameters = (input: {
50
+ choice: string | null;
51
+ }): DeclaredAwsSsmParameterSecure[] => {
52
+ // the derived namespace: org, project, then the config slug as the segment
53
+ const namespace = `/@declapract{variable.organizationName}/@declapract{variable.projectName}/${input.choice ?? config}`;
54
+
55
+ return [
56
+ secret({ name: `${namespace}/database.role.crud.password` }),
57
+ secret({ name: `${namespace}/database.role.cicd.for-plan.password` }),
58
+ secret({ name: `${namespace}/database.role.cicd.for-apply.password` }),
59
+ ];
60
+ };
@@ -0,0 +1,30 @@
1
+ import type { DeclastructProvider } from 'declastruct';
2
+ import { getDeclastructAwsProvider } from 'declastruct-aws';
3
+ import type { DomainEntity } from 'domain-objects';
4
+ import { genLogMethods } from 'sdk-logs';
5
+
6
+ import { getAllParameters } from './resources.parameters';
7
+
8
+ /**
9
+ * .what = the declastruct wish for this service's aws resources.
10
+ * .why = declastruct-aws owns the ssm parameters that terraform now forgets (see
11
+ * provision/aws/product/parameter-store.tf). the plan role reconciles secrets
12
+ * without any ssm:GetParameter or kms:Decrypt; apply writes via PutParameter +
13
+ * kms:Encrypt.
14
+ * .name = `getProviders` + `getResources` are declastruct's REQUIRED wish entrypoint names, so
15
+ * both are exempt from the get-set-gen One/All cardinality rule (a `getAll*` rename makes
16
+ * declastruct find no entrypoint — the wish dies). external-framework contract names.
17
+ */
18
+
19
+ export const getProviders = async (): Promise<DeclastructProvider[]> => [
20
+ await getDeclastructAwsProvider(
21
+ {},
22
+ {
23
+ // MUST be an sdk-logs logger — the DAOs read log._.level via as-procedure
24
+ log: genLogMethods(),
25
+ },
26
+ ),
27
+ ];
28
+
29
+ export const getResources = async (): Promise<DomainEntity<any>[]> =>
30
+ getAllParameters({ choice: null });
@@ -0,0 +1,7 @@
1
+ FROM postgres:13.20
2
+
3
+ COPY init/ /docker-entrypoint-initdb.d/
4
+
5
+ ADD wait-for-postgres.sh /root/
6
+ RUN chmod +x /root/wait-for-postgres.sh
7
+
@@ -0,0 +1,37 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+
3
+ const POSTGRES_PIN_LINE = /^FROM postgres:\S+$/m;
4
+
5
+ /**
6
+ * .what = the declared image, with the repo's own postgres pin kept in place of the template's
7
+ * .why = each repo pins the testdb to its own livedb's major, and the majors differ across the
8
+ * fleet. an exact compare would move every testdb onto the template's pin, which lands
9
+ * some ahead of their livedb — the skew where a suite passes on sql the livedb rejects.
10
+ * check-engine-skew.sh guards that the pin never leads the livedb (#664)
11
+ */
12
+ const asDeclaredWithPinFound = (input: {
13
+ declared: string;
14
+ found: string | null;
15
+ }): string => {
16
+ const pinFound = input.found?.match(POSTGRES_PIN_LINE)?.[0];
17
+ if (!pinFound) return input.declared;
18
+ return input.declared.replace(POSTGRES_PIN_LINE, pinFound);
19
+ };
20
+
21
+ export const check: FileCheckFunction = (contents, context) => {
22
+ const expected = asDeclaredWithPinFound({
23
+ declared: context.declaredFileContents!,
24
+ found: contents,
25
+ });
26
+ if (contents === expected) return; // the image matches, whatever postgres major it pins
27
+ throw new Error(
28
+ 'best practice violated: build-image.dockerfile must match the template, with any `FROM postgres:<version>` pin',
29
+ );
30
+ };
31
+
32
+ export const fix: FileFixFunction = (contents, context) => ({
33
+ contents: asDeclaredWithPinFound({
34
+ declared: context.declaredFileContents!,
35
+ found: contents,
36
+ }),
37
+ });
@@ -0,0 +1,115 @@
1
+ import { genTempDir, given, then, useThen, when } from 'test-fns';
2
+
3
+ import { spawnSync } from 'node:child_process';
4
+ import { writeFileSync } from 'node:fs';
5
+ import { join } from 'node:path';
6
+
7
+ /**
8
+ * .what = run the skew check, against a testdb pin and a supplied livedb version, or the livedb
9
+ */
10
+ const runSkewCheck = (input: {
11
+ testdbPin: string | null;
12
+ livedbVersion: string | null;
13
+ }): { status: number | null; stdout: string; stderr: string } => {
14
+ const dockerfileArgs = (() => {
15
+ if (input.testdbPin === null) return [];
16
+ const dockerfile = join(
17
+ genTempDir({ slug: 'check-engine-skew' }),
18
+ 'build-image.dockerfile',
19
+ );
20
+ writeFileSync(dockerfile, `${input.testdbPin}\n`);
21
+ return ['--dockerfile', dockerfile];
22
+ })();
23
+ const result = spawnSync(
24
+ 'bash',
25
+ [
26
+ join(__dirname, 'check-engine-skew.sh'),
27
+ ...dockerfileArgs,
28
+ ...(input.livedbVersion === null
29
+ ? []
30
+ : ['--livedb-version', input.livedbVersion]),
31
+ ],
32
+ { encoding: 'utf-8', env: process.env },
33
+ );
34
+ return {
35
+ status: result.status,
36
+ stdout: result.stdout,
37
+ stderr: result.stderr,
38
+ };
39
+ };
40
+
41
+ describe('check-engine-skew', () => {
42
+ given('[case1] the testdb leads the livedb', () => {
43
+ when('[t0] the check runs', () => {
44
+ const result = useThen('it halts', async () =>
45
+ runSkewCheck({
46
+ testdbPin: 'FROM postgres:17.11',
47
+ livedbVersion: '13.23',
48
+ }),
49
+ );
50
+
51
+ then('it exits 2 and names both fixes', () => {
52
+ expect(result.status).toEqual(2);
53
+ expect(result.stderr).toContain('✋ ConstraintError');
54
+ expect(result.stderr).toContain('pin the testdb to postgres 13');
55
+ });
56
+ });
57
+ });
58
+
59
+ given('[case2] the testdb trails the livedb', () => {
60
+ when('[t0] the check runs', () => {
61
+ const result = useThen('it passes with a warn', async () =>
62
+ runSkewCheck({
63
+ testdbPin: 'FROM postgres:13.20',
64
+ livedbVersion: '17.11',
65
+ }),
66
+ );
67
+
68
+ then('it exits 0 and emits a github warn', () => {
69
+ expect(result.status).toEqual(0);
70
+ expect(result.stdout).toContain('::warning title=engine skew::');
71
+ });
72
+ });
73
+ });
74
+
75
+ given('[case3] the majors match', () => {
76
+ when('[t0] the check runs', () => {
77
+ const result = useThen('it passes', async () =>
78
+ runSkewCheck({
79
+ testdbPin: 'FROM postgres:17.11',
80
+ livedbVersion: '17.7',
81
+ }),
82
+ );
83
+
84
+ then('it exits 0 with no warn', () => {
85
+ expect(result.status).toEqual(0);
86
+ expect(result.stdout).toContain('majors match');
87
+ expect(result.stdout).not.toContain('::warning');
88
+ });
89
+ });
90
+ });
91
+
92
+ // the gate: the one case that reads the livedb through aws. it needs rds:DescribeDBClusters on
93
+ // the livedb's account, and with no grant it fails loud on the MalfunctionError, which names it
94
+ given('[case4] the livedb, read through aws', () => {
95
+ when('[t0] the check runs against this repo testdb pin', () => {
96
+ const result = useThen('the read completes', async () =>
97
+ runSkewCheck({ testdbPin: null, livedbVersion: null }),
98
+ );
99
+
100
+ then('the read succeeds, never a malfunction', () => {
101
+ expect(result.stderr).not.toContain('💥 MalfunctionError');
102
+ expect(result.status).not.toEqual(1);
103
+ });
104
+
105
+ then('the testdb does not lead the livedb', () => {
106
+ expect(result.stderr).not.toContain('✋ ConstraintError');
107
+ expect(result.status).toEqual(0);
108
+ });
109
+
110
+ then('it reports the version the livedb returned', () => {
111
+ expect(result.stdout).toMatch(/livedb: postgres \d+(\.\d+)*\n/);
112
+ });
113
+ });
114
+ });
115
+ });
@@ -0,0 +1,165 @@
1
+ #!/usr/bin/env bash
2
+ ######################################################################
3
+ # .what = compare the testdb's postgres major against the livedb's.
4
+ # halt when the testdb leads; warn when it trails
5
+ #
6
+ # .why = the suite runs against the testdb alone. a testdb ahead of the
7
+ # livedb can pass on a feature the livedb rejects — a false green
8
+ # that ships. a testdb behind the livedb is the safe skew: the newer
9
+ # major accepts near all of the older one's sql
10
+ #
11
+ # .note = the livedb is the cluster config/test.json names, read with the
12
+ # aws access the integration suite already holds. the integration
13
+ # suite runs this check against the livedb, so a testdb that leads
14
+ # it fails the suite
15
+ #
16
+ # usage:
17
+ # bash provision/docker/testdb/check-engine-skew.sh
18
+ # bash provision/docker/testdb/check-engine-skew.sh --livedb-version 13.23
19
+ # bash provision/docker/testdb/check-engine-skew.sh --dockerfile path/to/build-image.dockerfile
20
+ # bash provision/docker/testdb/check-engine-skew.sh --declared-version 17.11
21
+ #
22
+ # options:
23
+ # --livedb-version the livedb's engine version; skips the aws read when given
24
+ # --declared-version the engine version the infrastructure declares; when
25
+ # given, a halt names how the skew arrived and prints the
26
+ # one fix for it. absent, the halt prints both fixes
27
+ # --dockerfile the testdb image (default: beside this file)
28
+ # --config the config that names the livedb (default: config/test.json)
29
+ # --help, -h print this block and exit
30
+ #
31
+ # the livedb read names the aws cluster from the config's tunnel
32
+ #
33
+ # guarantee:
34
+ # - exit 0 = majors match, or the testdb trails the livedb (a warn)
35
+ # - exit 1 = malfunction (the config names no cluster, the aws read failed or returned no version, the dockerfile is unreadable or has no postgres pin)
36
+ # - exit 2 = constraint (the testdb leads the livedb, or an arg is absent or malformed)
37
+ ######################################################################
38
+ set -euo pipefail
39
+
40
+ SELF_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
41
+ DOCKERFILE="$SELF_DIR/build-image.dockerfile"
42
+ CONFIG="$SELF_DIR/../../../config/test.json"
43
+ LIVEDB_VERSION=""
44
+ DECLARED_VERSION=""
45
+
46
+ # fail on a flag given with no value, or with the next flag where its value was owed
47
+ require_value() {
48
+ local flag="" value=""
49
+ local pair
50
+ for pair in "$@"; do
51
+ case "$pair" in
52
+ flag=*) flag="${pair#flag=}" ;;
53
+ value=*) value="${pair#value=}" ;;
54
+ esac
55
+ done
56
+ if [[ -z "$value" || "$value" == --* ]]; then
57
+ echo "✋ ConstraintError: $flag needs a value" >&2
58
+ echo " └─ fix: see $0 --help" >&2
59
+ exit 2
60
+ fi
61
+ }
62
+
63
+ # parse named args
64
+ while [[ $# -gt 0 ]]; do
65
+ case "$1" in
66
+ --help|-h) sed -n '3,/^######/{/^######/!p;}' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;;
67
+ --livedb-version) require_value flag="$1" value="${2:-}"; LIVEDB_VERSION="$2"; shift 2 ;;
68
+ --declared-version) require_value flag="$1" value="${2:-}"; DECLARED_VERSION="$2"; shift 2 ;;
69
+ --dockerfile) require_value flag="$1" value="${2:-}"; DOCKERFILE="$2"; shift 2 ;;
70
+ --config) require_value flag="$1" value="${2:-}"; CONFIG="$2"; shift 2 ;;
71
+ *)
72
+ echo "✋ ConstraintError: unknown arg '$1'" >&2
73
+ echo " └─ fix: see $0 --help" >&2
74
+ exit 2
75
+ ;;
76
+ esac
77
+ done
78
+
79
+ # fail on a dockerfile the grep cannot read, so a read failure never reads as an absent pin
80
+ if [[ ! -f "$DOCKERFILE" || ! -r "$DOCKERFILE" ]]; then
81
+ echo "💥 MalfunctionError: cannot read the testdb dockerfile at $DOCKERFILE" >&2
82
+ echo " └─ fix: pass --dockerfile with a readable path, or restore build-image.dockerfile beside this file" >&2
83
+ exit 1
84
+ fi
85
+
86
+ # read the testdb major from its image pin; the grep exits 1 on no match, which the guard below reports
87
+ TESTDB_MAJOR="$(grep -oE '^FROM postgres:[0-9]+' "$DOCKERFILE" | grep -oE '[0-9]+$' || true)"
88
+ if [[ -z "$TESTDB_MAJOR" ]]; then
89
+ echo "💥 MalfunctionError: no 'FROM postgres:<major>' pin found in $DOCKERFILE" >&2
90
+ echo " └─ fix: pin a major, like 'FROM postgres:17.11', or pass --dockerfile with the testdb image" >&2
91
+ exit 1
92
+ fi
93
+
94
+ # reject a supplied version that is not a postgres version
95
+ VERSION_SHAPE='^[0-9]+(\.[0-9]+)*$'
96
+ for supplied in "$LIVEDB_VERSION" "$DECLARED_VERSION"; do
97
+ if [[ -n "$supplied" && ! "$supplied" =~ $VERSION_SHAPE ]]; then
98
+ echo "✋ ConstraintError: '$supplied' is not a postgres version" >&2
99
+ echo " └─ fix: pass a version like 17.11 or 17" >&2
100
+ exit 2
101
+ fi
102
+ done
103
+
104
+ # read the livedb version, unless supplied
105
+ if [[ -z "$LIVEDB_VERSION" ]]; then
106
+ CLUSTER="$(jq -r '.database.tunnel.cluster.name // empty' "$CONFIG" || true)"
107
+ if [[ -z "$CLUSTER" ]]; then
108
+ echo "💥 MalfunctionError: no cluster name at .database.tunnel.cluster.name in $CONFIG" >&2
109
+ echo " └─ fix: the file must exist, parse as json, and name the aws cluster the tunnel reaches" >&2
110
+ exit 1
111
+ fi
112
+ if ! LIVEDB_VERSION="$(aws rds describe-db-clusters \
113
+ --db-cluster-identifier "$CLUSTER" \
114
+ --query 'DBClusters[0].EngineVersion' \
115
+ --output text)"; then
116
+ echo "💥 MalfunctionError: could not read the engine version of cluster '$CLUSTER'" >&2
117
+ echo " └─ fix: the caller needs aws auth with rds:DescribeDBClusters on the livedb's account" >&2
118
+ exit 1
119
+ fi
120
+ if [[ ! "$LIVEDB_VERSION" =~ $VERSION_SHAPE ]]; then
121
+ echo "💥 MalfunctionError: cluster '$CLUSTER' reported engine version '$LIVEDB_VERSION', which is not a postgres version" >&2
122
+ exit 1
123
+ fi
124
+ fi
125
+
126
+ # the livedb major: its version up to the first dot (17.11 → 17)
127
+ LIVEDB_MAJOR="${LIVEDB_VERSION%%.*}"
128
+
129
+ # report the two engines
130
+ echo "🔭 engine skew"
131
+ echo " ├─ testdb: postgres $TESTDB_MAJOR ($DOCKERFILE)"
132
+ echo " └─ livedb: postgres $LIVEDB_VERSION"
133
+
134
+ # halt when the testdb leads the livedb
135
+ if (( TESTDB_MAJOR > LIVEDB_MAJOR )); then
136
+ echo "✋ ConstraintError: the testdb (postgres $TESTDB_MAJOR) leads the livedb (postgres $LIVEDB_MAJOR)" >&2
137
+ echo " ├─ why: a green suite here can rest on a postgres $TESTDB_MAJOR feature the livedb rejects" >&2
138
+
139
+ # name the arrival when the declared target is known
140
+ DECLARED_MAJOR="${DECLARED_VERSION%%.*}"
141
+ if [[ -n "$DECLARED_MAJOR" ]] && (( DECLARED_MAJOR > LIVEDB_MAJOR )); then
142
+ echo " ├─ how: the livedb sits below its declared target $DECLARED_MAJOR — a flip was reverted, or has not yet applied" >&2
143
+ echo " └─ fix: pin the testdb to postgres $LIVEDB_MAJOR until the flip holds. do not re-flip a reverted livedb from here" >&2
144
+ exit 2
145
+ fi
146
+ if [[ -n "$DECLARED_MAJOR" ]]; then
147
+ echo " ├─ how: the livedb matches its declared target $DECLARED_MAJOR — the testdb pin moved ahead of the flip" >&2
148
+ echo " └─ fix: declare postgres $TESTDB_MAJOR in the infrastructure, then merge after the livedb reads it" >&2
149
+ exit 2
150
+ fi
151
+
152
+ echo " └─ fix: one of two, by how the skew arrived" >&2
153
+ echo " ├─ the pin moved before the flip: merge after the livedb reads postgres $TESTDB_MAJOR" >&2
154
+ echo " └─ the livedb fell back: pin the testdb to postgres $LIVEDB_MAJOR until the flip holds" >&2
155
+ exit 2
156
+ fi
157
+
158
+ # warn when the testdb trails the livedb
159
+ if (( TESTDB_MAJOR < LIVEDB_MAJOR )); then
160
+ echo ""
161
+ echo "::warning title=engine skew::testdb postgres $TESTDB_MAJOR trails the livedb's postgres $LIVEDB_MAJOR. safe, but bump the pin on the next declapract upgrade"
162
+ exit 0
163
+ fi
164
+
165
+ echo "✨ majors match"