declapract-typescript-ehmpathy 0.49.15 → 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 (390) 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/best-practice/.declapract.readme.md +7 -0
  35. package/dist/.test/assets/cicd-service/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  36. package/dist/.test/assets/expo-fullusecase/declarations/practices/cicd-common/.declapract.integration.test.ts +15 -21
  37. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.declapract.integration.test.ts +2 -2
  38. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  39. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  40. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  41. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  42. package/dist/.test/assets/expo-fullusecase/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  43. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  44. package/dist/.test/assets/expo-fullusecase/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  45. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  46. package/dist/.test/assets/expo-fullusecase/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  47. package/dist/.test/assets/expo-migration/declarations/practices/git/.declapract.integration.test.ts +2 -2
  48. package/dist/.test/assets/expo-migration/declarations/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  49. package/dist/.test/assets/expo-migration/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  50. package/dist/.test/assets/expo-migration/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  51. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.declapract.readme.md +37 -0
  52. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  53. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  54. package/dist/.test/assets/expo-migration/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  55. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  56. package/dist/.test/assets/expo-migration/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  57. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  58. package/dist/.test/assets/expo-toolchain/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  59. package/dist/.test/assets/git/declarations/declapract.declare.yml +8 -0
  60. package/dist/.test/assets/git/declarations/practices/git/.declapract.integration.test.ts +1001 -0
  61. package/dist/.test/assets/git/declarations/practices/git/.gitattributes.declapract.integration.test.ts +120 -0
  62. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/.gitattributes +6 -0
  63. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +7 -0
  64. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-legacy-gitattributes/package.json +4 -0
  65. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/declapract.use.yml +6 -0
  66. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-with-rhachet-only/package.json +4 -0
  67. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/declapract.use.yml +9 -0
  68. package/dist/.test/assets/git/declarations/practices/git/.test/assets/repo-without-cache-ignores/package.json +4 -0
  69. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.declapract.integration.test.ts.snap +55 -0
  70. package/dist/.test/assets/git/declarations/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +24 -0
  71. package/dist/.test/assets/git/declarations/practices/git/best-practice/.declapract.readme.md +60 -0
  72. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitattributes.declapract.ts +77 -0
  73. package/dist/.test/assets/git/declarations/practices/git/best-practice/.gitignore.declapract.ts +100 -0
  74. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.declapract.integration.test.ts +181 -0
  75. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.declare.yml +4 -0
  76. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/declapract.use.yml +11 -0
  77. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/package.json +1 -0
  78. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/.test/assets/demo-repo-with-dynamodb/useCases.yml +8 -0
  79. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/__snapshots__/.declapract.integration.test.ts.snap +234 -0
  80. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  81. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/codegen.dynamodb.dao.ts +16 -0
  82. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json +16 -0
  83. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/package.json.declapract.ts +3 -0
  84. package/dist/.test/assets/git/declarations/practices/persist-with-dynamodb/best-practice/provision/docker/integration-test-db/docker-compose.yml +9 -0
  85. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.declapract.integration.test.ts +237 -0
  86. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.extensions.sql.declapract.integration.test.ts +159 -0
  87. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declapract.use.yml +20 -0
  88. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/declarations/declapract.declare.yml +6 -0
  89. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-config-schema/package.json +4 -0
  90. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/codegen.sql.dao.yml +20 -0
  91. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.declare.yml +4 -0
  92. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/declapract.use.yml +19 -0
  93. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-on-a-prior-major/package.json +4 -0
  94. 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
  95. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.declare.yml +4 -0
  96. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/declapract.use.yml +21 -0
  97. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-custom-extensions/package.json +4 -0
  98. 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
  99. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/config/dev.json +18 -0
  100. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.declare.yml +4 -0
  101. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/declapract.use.yml +18 -0
  102. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/demo-repo-with-dev-config/package.json +4 -0
  103. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/declapract.use.yml +4 -0
  104. package/dist/.test/assets/git/declarations/practices/persist-with-rds/.test/assets/repo-with-hand-patch/package.json +17 -0
  105. 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
  106. 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
  107. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.declapract.integration.test.ts.snap +45 -0
  108. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/.extensions.sql.declapract.integration.test.ts.snap +77 -0
  109. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/config-validates-schema.declapract.integration.test.ts.snap +500 -0
  110. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/database-wrappers-typecheck.declapract.integration.test.ts.snap +10 -0
  111. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/deploy-database-gerunds.declapract.integration.test.ts.snap +102 -0
  112. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/engine-upgrade.declapract.integration.test.ts.snap +151 -0
  113. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/pg-pool-patch.declapract.integration.test.ts.snap +147 -0
  114. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/provision-testdb-access.declapract.integration.test.ts.snap +3 -0
  115. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/ssm-param-names.declapract.integration.test.ts.snap +9 -0
  116. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/testdb-preflight-failloud.declapract.integration.test.ts.snap +30 -0
  117. package/dist/.test/assets/git/declarations/practices/persist-with-rds/__snapshots__/with-connection-in-input.declapract.integration.test.ts.snap +57 -0
  118. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.integration.test.ts +71 -0
  119. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/.declapract.readme.md +6 -0
  120. 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
  121. 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
  122. 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
  123. 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
  124. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/legacy-change-id/__snapshots__/.declapract.integration.test.ts.snap +39 -0
  125. 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
  126. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/non-prefixed-manual-init-sqls/.declapract.readme.md +5 -0
  127. 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
  128. 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
  129. 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
  130. 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
  131. 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
  132. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-config-file-names/codegen.sql.yml.declapract.ts +3 -0
  133. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-dev-config-location/config/dev.json.declapract.ts +23 -0
  134. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.integration.test.ts +221 -0
  135. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/.declapract.readme.md +11 -0
  136. 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
  137. 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
  138. 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
  139. 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
  140. 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
  141. 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
  142. 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
  143. 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
  144. 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
  145. 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
  146. 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
  147. 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
  148. 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
  149. 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
  150. 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
  151. 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
  152. 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
  153. 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
  154. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-get-database-connection/__snapshots__/.declapract.integration.test.ts.snap +75 -0
  155. 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
  156. 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
  157. 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
  158. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-dir/.declapract.readme.md +1 -0
  159. 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
  160. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-hyphen-dir/.declapract.readme.md +1 -0
  161. 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
  162. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/.declapract.readme.md +1 -0
  163. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json +8 -0
  164. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-integration-test-db-paths/package.json.declapract.ts +10 -0
  165. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json +9 -0
  166. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-packagejson-script-names/package.json.declapract.ts +22 -0
  167. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/old-param-placeholder/config/<star>.json.declapract.ts +14 -0
  168. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.integration.test.ts +86 -0
  169. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/.declapract.readme.md +9 -0
  170. 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
  171. 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
  172. 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
  173. 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
  174. 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
  175. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/pg-client-without-ssl/__snapshots__/.declapract.integration.test.ts.snap +72 -0
  176. 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
  177. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/.declapract.readme.md +1 -0
  178. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/entities/<star>.ts.declapract.ts +12 -0
  179. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/schema-entities-dir/provision/schema/sql/entities.yml.declapract.ts +13 -0
  180. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/.declapract.integration.test.ts +95 -0
  181. 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
  182. 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
  183. 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
  184. 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
  185. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/__snapshots__/.declapract.integration.test.ts.snap +60 -0
  186. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/terraform-parameters/provision/aws/product/parameter-store.tf.declapract.ts +94 -0
  187. package/dist/.test/assets/git/declarations/practices/persist-with-rds/bad-practices/with-connection-in-input/.declapract.readme.md +10 -0
  188. 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
  189. 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
  190. 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
  191. 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
  192. 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
  193. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.declapract.readme.md +114 -0
  194. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  195. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml +18 -0
  196. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.dao.yml.declapract.ts +35 -0
  197. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.schema.yml +6 -0
  198. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/codegen.sql.types.yml +16 -0
  199. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json +40 -0
  200. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prep.json.declapract.ts +11 -0
  201. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json +40 -0
  202. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/prod.json.declapract.ts +11 -0
  203. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json +37 -0
  204. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/config/test.json.declapract.ts +11 -0
  205. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json +36 -0
  206. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/package.json.declapract.ts +3 -0
  207. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/patches/pg-pool.patch +21 -0
  208. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/readme.md +113 -0
  209. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.parameters.ts +60 -0
  210. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/aws/resources.ts +30 -0
  211. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile +7 -0
  212. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/build-image.dockerfile.declapract.ts +37 -0
  213. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.integration.test.ts +115 -0
  214. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/check-engine-skew.sh +165 -0
  215. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/compose.sh +43 -0
  216. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/docker-compose.yml +19 -0
  217. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/.gitignore +3 -0
  218. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/init/readme.md +3 -0
  219. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/docker/testdb/wait-for-postgres.sh +25 -0
  220. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/connection.config.js +36 -0
  221. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/control.yml +7 -0
  222. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/deploy.database.sh +97 -0
  223. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.database.sql +10 -0
  224. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql +16 -0
  225. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.extensions.sql.declapract.ts +46 -0
  226. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.schema.sql +11 -0
  227. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.cicd.sql +14 -0
  228. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/.user.datalakedb.sql +12 -0
  229. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/default_transaction_isolation.sql +6 -0
  230. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init/user.service.sql +16 -0
  231. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml +9 -0
  232. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/provision/schema/sql/init.yml.declapract.ts +3 -0
  233. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbIdentity.ts +52 -0
  234. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/.test/assets/database/getTestdbPort.ts +17 -0
  235. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/config/config.schema.ts +77 -0
  236. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.test.ts +82 -0
  237. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/asDatabaseClientSsl.ts +52 -0
  238. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/databaseClientTimeouts.ts +14 -0
  239. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.integration.test.ts +10 -0
  240. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabaseConnection.ts +119 -0
  241. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/getOneDatabasePort.ts +30 -0
  242. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.test.ts +51 -0
  243. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/rdsCaBundleUsEast1.ts +86 -0
  244. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseContext.ts +54 -0
  245. package/dist/.test/assets/git/declarations/practices/persist-with-rds/best-practice/src/utils/database/withDatabaseTransaction.ts +35 -0
  246. package/dist/.test/assets/git/declarations/practices/persist-with-rds/config-validates-schema.declapract.integration.test.ts +332 -0
  247. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-client.declapract.integration.test.ts +291 -0
  248. package/dist/.test/assets/git/declarations/practices/persist-with-rds/database-wrappers-typecheck.declapract.integration.test.ts +225 -0
  249. package/dist/.test/assets/git/declarations/practices/persist-with-rds/deploy-database-gerunds.declapract.integration.test.ts +57 -0
  250. package/dist/.test/assets/git/declarations/practices/persist-with-rds/empty-template-declares-zero-clusters.declapract.integration.test.ts +71 -0
  251. package/dist/.test/assets/git/declarations/practices/persist-with-rds/engine-upgrade.declapract.integration.test.ts +243 -0
  252. package/dist/.test/assets/git/declarations/practices/persist-with-rds/pg-pool-patch.declapract.integration.test.ts +884 -0
  253. package/dist/.test/assets/git/declarations/practices/persist-with-rds/provision-testdb-access.declapract.integration.test.ts +50 -0
  254. package/dist/.test/assets/git/declarations/practices/persist-with-rds/ssm-param-names.declapract.integration.test.ts +154 -0
  255. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-per-worktree.declapract.integration.test.ts +332 -0
  256. package/dist/.test/assets/git/declarations/practices/persist-with-rds/testdb-preflight-failloud.declapract.integration.test.ts +83 -0
  257. package/dist/.test/assets/git/declarations/practices/persist-with-rds/with-connection-in-input.declapract.integration.test.ts +97 -0
  258. package/dist/.test/assets/git/declarations/practices/rhachet/.declapract.integration.test.ts +98 -0
  259. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/.agent/repo=.this/role=any/boot.yml +9 -0
  260. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.declare.yml +4 -0
  261. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/declapract.use.yml +2 -0
  262. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/demo-repo-with-consumer-boot/package.json +4 -0
  263. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/.agent/keyrack.yml +9 -0
  264. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.node.yml +4 -0
  265. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/declapract.use.yml +4 -0
  266. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-keyrack-extant/package.json +4 -0
  267. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/declapract.use.yml +4 -0
  268. package/dist/.test/assets/git/declarations/practices/rhachet/.test/assets/repo-self-linked/package.json +22 -0
  269. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/.declapract.integration.test.ts.snap +46 -0
  270. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-refs-glossary.declapract.integration.test.ts.snap +6 -0
  271. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/boot-yml-findsert.declapract.integration.test.ts.snap +33 -0
  272. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/keyrack-yml-findsert.declapract.integration.test.ts.snap +28 -0
  273. package/dist/.test/assets/git/declarations/practices/rhachet/__snapshots__/self-link-build-order.declapract.integration.test.ts.snap +81 -0
  274. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/.declapract.readme.md +11 -0
  275. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/deprecated-use-file/rhachet.use.ts.declapract.ts +12 -0
  276. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.declapract.readme.md +59 -0
  277. 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
  278. 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
  279. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/.test/assets/demo-repo-with-rhachet-prod-deps/package.json +12 -0
  280. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json +5 -0
  281. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/prod-deps/package.json.declapract.ts +88 -0
  282. 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
  283. 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
  284. package/dist/.test/assets/git/declarations/practices/rhachet/bad-practices/review-peer-artifacts/.declapract.readme.md +12 -0
  285. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/keyrack.yml.declapract.ts +143 -0
  286. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml +22 -0
  287. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.agent/repo=.this/role=any/boot.yml.declapract.ts +189 -0
  288. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.declapract.readme.md +40 -0
  289. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  290. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/.gitignore.declapract.ts +94 -0
  291. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json +19 -0
  292. package/dist/.test/assets/git/declarations/practices/rhachet/best-practice/package.json.declapract.ts +51 -0
  293. package/dist/.test/assets/git/declarations/practices/rhachet/boot-refs-glossary.declapract.integration.test.ts +91 -0
  294. package/dist/.test/assets/git/declarations/practices/rhachet/boot-yml-findsert.declapract.integration.test.ts +149 -0
  295. package/dist/.test/assets/git/declarations/practices/rhachet/keyrack-yml-findsert.declapract.integration.test.ts +105 -0
  296. package/dist/.test/assets/git/declarations/practices/rhachet/self-link-build-order.declapract.integration.test.ts +88 -0
  297. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/blackbox/lambdas/consumeSESEmailEventFromSNS.acceptance.test.ts +23 -0
  298. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/declapract.use.yml +9 -0
  299. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils/package.json +4 -0
  300. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  301. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/declapract.use.yml +9 -0
  302. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-2/package.json +4 -0
  303. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/blackbox/lambdas/addDecoratedImage.acceptance.test.ts +19 -0
  304. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/declapract.use.yml +9 -0
  305. package/dist/.test/assets/git/declarations/practices/tests-any/.test/assets/repo-old-acceptance-utils-3/package.json +4 -0
  306. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/changedsince-origin-main.declapract.integration.test.ts.snap +8 -0
  307. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/livedb-wake-branches.declapract.integration.test.ts.snap +6 -0
  308. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/old-acceptance-test-utils.declapract.integration.test.ts.snap +162 -0
  309. package/dist/.test/assets/git/declarations/practices/tests-any/__snapshots__/test-kind-seam.declapract.integration.test.ts.snap +9 -0
  310. package/dist/.test/assets/git/declarations/practices/tests-any/autoprune-hooks.declapract.integration.test.ts +111 -0
  311. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.integration.test.ts +69 -0
  312. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/.declapract.readme.md +19 -0
  313. 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
  314. 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
  315. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/__snapshots__/.declapract.integration.test.ts.snap +43 -0
  316. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/dev-tool-in-dependencies/package.json.declapract.ts +81 -0
  317. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/.declapract.readme.md +1 -0
  318. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/javascript-config-files/jest.<star>.js.declapract.ts +17 -0
  319. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/.declapract.readme.md +8 -0
  320. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.js +3 -0
  321. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/mocks/<star><star>/__mock__/<star>.ts +3 -0
  322. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.integration.test.ts +83 -0
  323. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/.declapract.readme.md +22 -0
  324. 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
  325. 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
  326. 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
  327. 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
  328. 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
  329. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/accept.blackbox/<star><star>/<star>.declapract.ts +19 -0
  330. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-dir-location/acceptance/<star><star>/<star>.declapract.ts +19 -0
  331. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/.declapract.readme.md +31 -0
  332. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-import-paths/<star><star>/<star>.ts.declapract.ts +25 -0
  333. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/getDataFromLastOpenBracketAtStartOfLine.ts.declapract.ts +3 -0
  334. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/_utils/invokeLambda.ts.declapract.ts +3 -0
  335. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils/blackbox/lambdas/<star>.ts.declapract.ts +49 -0
  336. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-2/blackbox/lambdas/<star>.ts.declapract.ts +27 -0
  337. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/_utils/environment.ts.declapract.ts +3 -0
  338. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-acceptance-test-utils-3/blackbox/lambdas/<star>.ts.declapract.ts +23 -0
  339. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/.declapract.readme.md +3 -0
  340. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.acceptance.ts.declapract.ts +11 -0
  341. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-extension-pattern/<star><star>/<star>.test.integration.ts.declapract.ts +11 -0
  342. package/dist/.test/assets/git/declarations/practices/tests-any/bad-practices/old-test-utils-and-assets-location/.declapract.readme.md +8 -0
  343. 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
  344. 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
  345. 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
  346. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.readme.md +52 -0
  347. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.declapract.todo.md +3 -0
  348. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  349. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json +18 -0
  350. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/package.json.declapract.ts +3 -0
  351. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/.test/useWakeOfLivedb.ts +209 -0
  352. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.integration.test.ts.declapract.ts +8 -0
  353. package/dist/.test/assets/git/declarations/practices/tests-any/best-practice/src/<star><star>/<star>.test.ts.declapract.ts +7 -0
  354. package/dist/.test/assets/git/declarations/practices/tests-any/build-ifstale.declapract.integration.test.ts +124 -0
  355. package/dist/.test/assets/git/declarations/practices/tests-any/changedsince-origin-main.declapract.integration.test.ts +58 -0
  356. package/dist/.test/assets/git/declarations/practices/tests-any/livedb-wake-branches.declapract.integration.test.ts +315 -0
  357. package/dist/.test/assets/git/declarations/practices/tests-any/old-acceptance-test-utils.declapract.integration.test.ts +122 -0
  358. package/dist/.test/assets/git/declarations/practices/tests-any/package.json.shell-flags.declapract.integration.test.ts +139 -0
  359. package/dist/.test/assets/git/declarations/practices/tests-any/test-kind-seam.declapract.integration.test.ts +87 -0
  360. package/dist/.test/assets/git/declarations/useCases.yml +29 -0
  361. package/dist/.test/assets/{expo-fullusecase/declarations/practices/git/best-practice → git/repo-with-all-gitattributes-declarers}/.gitattributes +3 -0
  362. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/declapract.use.yml +26 -0
  363. package/dist/.test/assets/git/repo-with-all-gitattributes-declarers/package.json +4 -0
  364. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  365. package/dist/.test/assets/rhachet/declarations/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  366. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  367. package/dist/.test/assets/tests-any-only/declarations/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  368. package/dist/__snapshots__/gitattributesDeclarers.declapract.integration.test.ts.snap +79 -0
  369. package/dist/__snapshots__/repoSkills.declapract.acceptance.test.ts.snap +512 -0
  370. package/dist/gitattributesDeclarers.declapract.integration.test.ts +438 -0
  371. package/dist/practiceOwnerPerFile.declapract.integration.test.ts +53 -0
  372. package/dist/practices/cicd-common/.declapract.integration.test.ts +15 -21
  373. package/dist/practices/git/.declapract.integration.test.ts +2 -2
  374. package/dist/practices/git/.gitattributes.declapract.integration.test.ts +34 -19
  375. package/dist/practices/git/.test/assets/repo-with-legacy-gitattributes/declapract.use.yml +3 -3
  376. package/dist/practices/git/__snapshots__/.gitattributes.declapract.integration.test.ts.snap +4 -4
  377. package/dist/practices/git/best-practice/.declapract.readme.md +37 -0
  378. package/dist/practices/git/best-practice/.gitattributes.declapract.ts +42 -63
  379. package/dist/practices/persist-with-dynamodb/best-practice/.gitattributes.declapract.ts +56 -0
  380. package/dist/practices/persist-with-rds/best-practice/.declapract.readme.md +7 -0
  381. package/dist/practices/persist-with-rds/best-practice/.gitattributes.declapract.ts +64 -0
  382. package/dist/practices/rhachet/best-practice/.declapract.readme.md +8 -0
  383. package/dist/practices/rhachet/best-practice/.gitattributes.declapract.ts +65 -0
  384. package/dist/practices/tests-any/best-practice/.declapract.readme.md +7 -0
  385. package/dist/practices/tests-any/best-practice/.gitattributes.declapract.ts +60 -0
  386. package/dist/repoSkills.declapract.acceptance.test.ts +1150 -0
  387. package/dist/utils/defineExpectedGitattributesContents.ts +247 -0
  388. package/package.json +4 -4
  389. package/dist/.test/assets/expo-migration/declarations/practices/git/best-practice/.gitattributes +0 -7
  390. package/dist/practices/git/best-practice/.gitattributes +0 -7
@@ -0,0 +1,94 @@
1
+ import type { FileCheckFunction, FileFixFunction } from 'declapract';
2
+ import expect from 'expect';
3
+
4
+ import { defineExpectedGitignoreContents } from '../../../utils/defineExpectedGitignoreContents';
5
+
6
+ /**
7
+ * ignores that this practice itself owns
8
+ *
9
+ * .why = rhachet boots roles which write scratch state into `.agent/.cache/`, and the
10
+ * claude-code harness those roles run writes machine-local scheduler state into
11
+ * `.claude/scheduled_tasks*` at any depth (a lock + queue). the practice that creates a dir
12
+ * declares the ignore for it, so a repo that takes `rhachet` is never left with
13
+ * cruft it did not ask for:
14
+ * - a worktree teardown is not snagged by untracked scratch
15
+ * - a hurried `git add .` cannot sweep a machine-local lock or a debug file that
16
+ * holds a secret
17
+ *
18
+ * .note = `.claude/scheduled_tasks*` at any depth is machine-local by nature -- a lock/queue for THIS
19
+ * host's scheduler, never shared across a team -- so it is ignored, never tracked.
20
+ * it belongs HERE, not in `git`: rhachet's role-boot harness is what creates it, and
21
+ * a practice declares the ignore for the dirs IT creates. (`*.local.json`, the other
22
+ * `.claude/` machine-local shape, stays in `git` -- it is a generic suffix, not a
23
+ * rhachet-created path.)
24
+ *
25
+ * .note = `.cache/` is generic tool scratch and belongs to the `git` practice, not
26
+ * here. a practice declares the ignore for the dirs IT creates, and no more.
27
+ *
28
+ * .note = this list is NOT sorted here, and that is deliberate. `defineExpectedGitignoreContents`
29
+ * sorts the union of these lines with the repo's own, so a `.sort()` at this site would
30
+ * be a second sort that changes no output -- while it mutates a module-cached array in
31
+ * place. `readonly` forbids that mutation outright rather than merely discourages it
32
+ * (`rule.prefer.prevent-over-correct`).
33
+ */
34
+ const ignoresSortable: readonly string[] = [
35
+ '.agent/.cache/',
36
+ // role scratch notes (e.g. a draft issue comment); host-local, never source (#688)
37
+ '.agent/.notes/',
38
+ // `**/` so the actor brain's own `.agent/.actors/<actor>/brain/.claude/` lock is
39
+ // ignored too; a line with a slash anchors to the repo root otherwise (#667)
40
+ '**/.claude/scheduled_tasks*',
41
+ ];
42
+
43
+ /**
44
+ * .what = lines this practice once declared and now replaces
45
+ * .why = the root-anchored `.claude/scheduled_tasks*` is superseded by the any-depth form;
46
+ * a union alone would leave it in every extant file forever
47
+ * .note = a lock already tracked stays tracked until `git rm --cached` — an ignore never
48
+ * untracks a file
49
+ */
50
+ const ignoresRetired: readonly string[] = ['.claude/scheduled_tasks*'];
51
+
52
+ /**
53
+ * .what = emits the `.gitignore` this practice declares, given the repo's extant one
54
+ * .why = the algorithm AND the ordered tail are imported, not declared here, because
55
+ * `src/practices/git/best-practice/.gitignore.declapract.ts` declares this same
56
+ * repo-root file. two declarers converge only while both emit an identical tail
57
+ * by an identical algorithm -- so they share one, and the drift that would break
58
+ * convergence cannot be written.
59
+ * .note = this file declares only `ignoresSortable`, which is the part the two
60
+ * practices legitimately DIFFER on: rhachet owns `.agent/.cache/`, git owns
61
+ * the generic scratch. the shared part is shared; the owned part is owned.
62
+ */
63
+ const defineExpectedContents = (contents: string | null): string =>
64
+ defineExpectedGitignoreContents({
65
+ contents,
66
+ ignoresSortable,
67
+ ignoresRetired,
68
+ });
69
+
70
+ /**
71
+ * .what = throws when the repo's `.gitignore` does not carry what this practice declares
72
+ * .why = `check` is the GATE: declapract runs `fix` for a file only when `check`
73
+ * rejects it. so this is what makes an upgrade actually deliver
74
+ * `.agent/.cache/` to a repo that lacks it.
75
+ * .note = best-practice semantics are inverted from what a reader expects -- a THROW
76
+ * means the practice is violated, a return means it is followed. see
77
+ * `.agent/repo=.this/role=any/briefs/declapract-check-semantics.md`.
78
+ */
79
+ export const check: FileCheckFunction = (contents) => {
80
+ expect(contents).toEqual(defineExpectedContents(contents));
81
+ };
82
+
83
+ /**
84
+ * .what = unions this practice's declared ignores into the repo's `.gitignore`
85
+ * .why = a findsert by construction -- a line already present stays present once,
86
+ * and a repo's own custom ignores survive, because the file's extant lines
87
+ * are unioned in before the sort.
88
+ * .note = a fixed point: `fix(fix(x)) === fix(x)`, and `check` passes on its own
89
+ * output -- without both, `declapract fix` would rewrite this file forever.
90
+ * clamped by `.gitignore.declapract.test.ts` -> `idempotency`.
91
+ */
92
+ export const fix: FileFixFunction = (contents) => {
93
+ return { contents: defineExpectedContents(contents) };
94
+ };
@@ -0,0 +1,19 @@
1
+ {
2
+ "devDependencies": {
3
+ "rhachet": "@declapract{check.minVersion('1.49.2')}",
4
+ "rhachet-brains-anthropic": "@declapract{check.minVersion('0.4.3')}",
5
+ "rhachet-brains-fireworksai": "@declapract{check.minVersion('0.2.3')}",
6
+ "rhachet-brains-openrouter": "@declapract{check.minVersion('0.1.3')}",
7
+ "rhachet-brains-xai": "@declapract{check.minVersion('0.3.3')}",
8
+ "rhachet-roles-bhrain": "@declapract{check.minVersion('0.40.0')}",
9
+ "rhachet-roles-bhrowser": "@declapract{check.minVersion('0.1.0')}",
10
+ "rhachet-roles-bhuild": "@declapract{check.minVersion('0.23.2')}",
11
+ "rhachet-roles-ehmpathy": "@declapract{check.minVersion('1.39.5')}",
12
+ "rhachet-roles-ghlitch": "@declapract{check.minVersion('0.3.0')}",
13
+ "rhachet-roles-rhachet": "@declapract{check.minVersion('0.1.7')}"
14
+ },
15
+ "scripts": {
16
+ "prepare:rhachet": "rhachet init --keys --hooks --roles mechanic behaver driver reviewer librarian ergonomist architect dispatcher learner achiever telepath operator observer deployer playwright enroller",
17
+ "upgrade:rhachet": "rhachet upgrade"
18
+ }
19
+ }
@@ -0,0 +1,51 @@
1
+ import { FileCheckType, type FileContentsFunction } from 'declapract';
2
+
3
+ import { getFileTextOrNull } from '../../../utils/getFileTextOrNull';
4
+ import { readFile } from '../../../utils/readFile';
5
+
6
+ /**
7
+ * .what = whether a package.json declares a `link:.` self-dep (a rhachet roles package)
8
+ * .why = such a repo links its own roles, and `rhachet init` loads their hooks from `dist/`; any
9
+ * dep whose value is `link:.` counts, so a self-dep under an alias still keys the build
10
+ */
11
+ const hasSelfLinkDep = (input: { packageJson: string }): boolean => {
12
+ const parsed = JSON.parse(input.packageJson) as {
13
+ dependencies?: Record<string, string>;
14
+ devDependencies?: Record<string, string>;
15
+ };
16
+ return [
17
+ ...Object.values(parsed.dependencies ?? {}),
18
+ ...Object.values(parsed.devDependencies ?? {}),
19
+ ].some((version) => version === 'link:.' || version === 'link:./');
20
+ };
21
+
22
+ /**
23
+ * .what = declare the rhachet package.json, with `npm run build && ` before `rhachet init` in a
24
+ * repo that self-links its own roles (#520)
25
+ * .why = a `link:.` repo boots its own roles, whose hooks load from the compiled `dist/`; with no
26
+ * build first, hook discovery fails before jest starts. CONTAINS used to strip a hand-added
27
+ * build step; a branch on the repo's own package.json keeps it (rule.avoid.runtime-forks)
28
+ */
29
+ export const contents: FileContentsFunction = async (context) => {
30
+ // grab the declared package.json
31
+ const declared = await readFile({ filePath: `${__dirname}/package.json` });
32
+
33
+ // read the repo's own package.json, if any, to see whether it self-links
34
+ const repoPackageJson = getFileTextOrNull({
35
+ root: context.getProjectRootDirectory(),
36
+ relativePath: 'package.json',
37
+ });
38
+ const isSelfLinked =
39
+ repoPackageJson !== null &&
40
+ hasSelfLinkDep({ packageJson: repoPackageJson });
41
+
42
+ // a self-linked repo builds before it inits
43
+ return isSelfLinked
44
+ ? declared.replace(
45
+ '"prepare:rhachet": "rhachet init ',
46
+ '"prepare:rhachet": "npm run build && rhachet init ',
47
+ )
48
+ : declared;
49
+ };
50
+
51
+ export const check = FileCheckType.CONTAINS;
@@ -0,0 +1,91 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+
4
+ import { given, then, when } from 'test-fns';
5
+
6
+ /**
7
+ * .what = clamps that the rhachet practice's shipped boot.yml defaults every brief to SAY level and
8
+ * refs ONLY the deep glossary variants (`.reason`, `.example`), via GLOBs — never this repo's
9
+ * enumerated term list, and never a `say:` enumeration.
10
+ * .why = the boot.yml is a TEMPLATE copied to every consumer. under #105 the shape is SIMPLE mode
11
+ * with `say` ABSENT + `ref` present, so the loader reads every discovered brief at say-level
12
+ * EXCEPT the ref-matched deep variants. the ref entries must be globs (matched against the
13
+ * consumer's tree by rhachet's fast-glob), never a hardcoded list of THIS repo's terms -- an
14
+ * enumerated list would ref terms a consumer does not have and miss the ones it does. a glob
15
+ * is also drift-proof: a new term's deep variants auto-demote, and no say entry is ever
16
+ * enumerated.
17
+ * .teeth = swap a `term=*` deep-variant glob for an enumerated `term=convergence._.choice.reason.md`
18
+ * and the "no hardcoded term name" case reddens; add a `say:` key and the "no say
19
+ * enumeration" case reddens; add an `always:` key and the "simple mode" case reddens; ref
20
+ * the `._.choice._.md` root (a say-level brief) and the "choice root stays say" case reddens.
21
+ * .note = the subject is the shipped TEMPLATE text. the `.integration.test.ts` suffix reads the
22
+ * filesystem (a remote boundary); this file sits at the practice ROOT (not under
23
+ * best-practice/), so it is neither loaded as a declaration nor copied to a consumer.
24
+ * .note = this supersedes the #587 ref-all clamp: #587 refed the whole glossary (choice root +
25
+ * readme) for a near-zero boot cost; #105 flips the default to say and refs only the
26
+ * reason/example deep variants. the assertions below encode the #105 shape.
27
+ */
28
+
29
+ // anchor on __dirname, not process.cwd(): a nested `jest src/practices/...` run has a different cwd.
30
+ // from this file (src/practices/rhachet/) the best-practice tree is one segment down.
31
+ const bootYmlPath = join(
32
+ __dirname,
33
+ 'best-practice/.agent/repo=.this/role=any/boot.yml',
34
+ );
35
+
36
+ const REASON_REF = 'briefs/domain.terms/term=*._.choice.reason.md';
37
+ const EXAMPLE_REF = 'briefs/domain.terms/term=*._.choice.example=*.md';
38
+ const CHOICE_ROOT_REF = 'briefs/domain.terms/term=*._.choice._.md';
39
+
40
+ describe('rhachet boot.yml defaults to say, refs only deep glossary variants', () => {
41
+ given('[case1] the shipped boot.yml template', () => {
42
+ const contents = readFileSync(bootYmlPath, 'utf8');
43
+
44
+ when('[t0] the template is read', () => {
45
+ then('it is simple mode (top-level briefs:, no always:)', () => {
46
+ expect(contents).toMatch(/^briefs:/m);
47
+ expect(contents).not.toMatch(/^always:/m);
48
+ });
49
+
50
+ then('it enumerates no say entry (say defaults for every brief)', () => {
51
+ // the whole point of #105: `say` is absent, so the loader defaults every discovered brief to
52
+ // say. a `say:` key would enumerate — exactly what #105 forbids.
53
+ expect(contents).not.toMatch(/^\s*say:/m);
54
+ });
55
+
56
+ then('it drops the deep glossary variants via globs under not, never ref (#689)', () => {
57
+ expect(contents).toContain(REASON_REF);
58
+ expect(contents).toContain(EXAMPLE_REF);
59
+ expect(contents).toMatch(/^ {2}not:\n {4}- briefs\/domain\.terms\/term=\*\._\.choice\.reason\.md$/m);
60
+ expect(contents).not.toMatch(/^ {2}ref:/m);
61
+ });
62
+
63
+ then('it does not ref the choice root (it stays say-level)', () => {
64
+ // the `._.choice._.md` root is the say-lean brief a consumer wants in context; only the
65
+ // reason-deep + example variants demote to ref.
66
+ expect(contents).not.toContain(CHOICE_ROOT_REF);
67
+ });
68
+
69
+ then('it hardcodes no specific term name (stays per-consumer correct)', () => {
70
+ // a concrete `term=<slug>._.choice...` (slug != the `*` glob) would be this repo's own term,
71
+ // wrong for a consumer. the only legal `term=` token is the glob wildcard.
72
+ const concreteTermRefs = (
73
+ contents.match(/term=[a-z][a-z-]*\._\.choice/g) || []
74
+ ).filter((m) => !m.startsWith('term=*'));
75
+ expect(concreteTermRefs).toEqual([]);
76
+ });
77
+
78
+ then('the emitted glossary ref lines match snapshot', () => {
79
+ // snapshot the governed glossary ref lines themselves, so a reshaped ref that keeps the glob
80
+ // tokens green (a reordered entry, a rephrased comment) reddens a vibecheck in review
81
+ // (rule.require.contract-snapshot-exhaustiveness)
82
+ const refLines = contents
83
+ .split('\n')
84
+ .filter((line) => line.includes('domain.terms/'))
85
+ .map((line) => line.trim())
86
+ .join('\n');
87
+ expect(refLines).toMatchSnapshot('boot.yml glossary refs');
88
+ });
89
+ });
90
+ });
91
+ });
@@ -0,0 +1,149 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'node:path';
3
+
4
+ import { executeApply } from 'declapract';
5
+ // eslint-disable-next-line import/no-extraneous-dependencies
6
+ import yaml from 'yaml';
7
+ import { genTempDir, given, then, useThen, when } from 'test-fns';
8
+
9
+ /**
10
+ * .what = end-to-end proof of the boot.yml FINDSERT (#105 req 1), run through the REAL declapract
11
+ * apply pipeline against a genTempDir clone of a consumer whose boot.yml already carries its
12
+ * OWN say + ref entries.
13
+ * .why = req 1 is that the boot.yml is only ever findserted into a consumer, never whole-file
14
+ * overwritten — so a consumer's own boot entries survive. per
15
+ * `rule.require.declapract-integration-tests`, a `fix` with logic (a yaml union that reads the
16
+ * consumer's extant file) owes a pipeline test: a unit test of the exported `fix` never
17
+ * exercises the glob→file match nor the apply against a real consumer file. this is that test.
18
+ * .note = the consumer boot is SIMPLE mode with a `say` pick and a `ref` pick of its own. the
19
+ * after-state proves both declared deep-variant globs are unioned in AND both consumer picks
20
+ * survive byte-for-value — the whole-file-overwrite failure this guards against would drop them.
21
+ * .note = the boot is snapshotted in full (before AND after) so a reviewer can eyeball the exact
22
+ * end-state (`rule.require.snapshots`).
23
+ */
24
+ describe('rhachet — boot.yml findsert (req 1: consumer entries survive)', () => {
25
+ given("[case1] a consumer whose boot.yml carries its own entries", () => {
26
+ const tempDir = genTempDir({
27
+ slug: 'declapract-rhachet-boot-findsert',
28
+ clone:
29
+ './src/practices/rhachet/.test/assets/demo-repo-with-consumer-boot',
30
+ symlink: [{ at: 'declarations', to: 'src' }],
31
+ });
32
+
33
+ const bootPath = '.agent/repo=.this/role=any/boot.yml';
34
+ const REASON_REF = 'briefs/domain.terms/term=*._.choice.reason.md';
35
+ const EXAMPLE_REF = 'briefs/domain.terms/term=*._.choice.example=*.md';
36
+
37
+ const read = (relativePath: string) =>
38
+ fs.readFile(path.join(tempDir, relativePath), 'utf-8');
39
+ const applyFix = () =>
40
+ executeApply({
41
+ config: path.join(tempDir, 'declapract.use.yml'),
42
+ practice: 'rhachet',
43
+ file: bootPath,
44
+ });
45
+
46
+ when('[t0] the input (before any fix)', () => {
47
+ then('the consumer boot.yml carries its own picks, no budget, + matches snapshot', async () => {
48
+ const before = await read(bootPath);
49
+ expect(before).toContain('briefs/my-own-brief.md');
50
+ expect(before).toContain('briefs/my-own-deep-variant.md');
51
+ // the consumer carries the old practice shape: a declared glob under ref (#689)
52
+ expect(yaml.parse(before).briefs.ref).toContain(REASON_REF);
53
+ // the consumer predates the budget cap — it carries none (the findsert-add path)
54
+ expect(yaml.parse(before).budget).toBeUndefined();
55
+ expect(before).toMatchSnapshot('boot.yml — before');
56
+ });
57
+ });
58
+
59
+ when('[t1] the findsert fix is applied', () => {
60
+ useThen('union the declared deep-variant globs into the consumer boot', async () =>
61
+ applyFix(),
62
+ );
63
+
64
+ then(
65
+ "both declared globs land AND the consumer's own say + ref picks survive, and it matches snapshot",
66
+ async () => {
67
+ const after = await read(bootPath);
68
+ const parsed = yaml.parse(after);
69
+
70
+ // the two declared deep-variant globs landed under not (#689) — the one the old
71
+ // practice shape put under ref was moved, never duplicated
72
+ expect(parsed.briefs.not).toEqual([REASON_REF, EXAMPLE_REF]);
73
+ expect(parsed.briefs.ref).not.toContain(REASON_REF);
74
+ expect(parsed.briefs.ref).not.toContain(EXAMPLE_REF);
75
+ // the consumer's OWN ref pick survives, and is all that ref holds now
76
+ expect(parsed.briefs.ref).toEqual(['briefs/my-own-deep-variant.md']);
77
+ // the consumer's OWN say pick survives untouched
78
+ expect(parsed.briefs.say).toContain('briefs/my-own-brief.md');
79
+ // it stayed simple mode — the fix created no top-level always: key
80
+ expect(parsed.always).toBeUndefined();
81
+ // the budget cap was findserted into a consumer that predated it
82
+ expect(parsed.budget.tokens).toEqual(5_000);
83
+ // full content, for the reviewer's eye
84
+ expect(after).toMatchSnapshot('boot.yml — after');
85
+ },
86
+ );
87
+ });
88
+
89
+ when('[t2] the fix is applied a second time (idempotency)', () => {
90
+ // once both globs are present, the check passes and the fix is a no-op — the boot must be
91
+ // byte-identical across a re-apply (`rule.require.idempotent-fixes`).
92
+ const passes = useThen(
93
+ 'a second apply over its own output',
94
+ async () => {
95
+ const before = await read(bootPath);
96
+ await applyFix();
97
+ const after = await read(bootPath);
98
+ return { before, after };
99
+ },
100
+ );
101
+
102
+ then('the second apply is a no-op', () => {
103
+ expect(passes.after).toEqual(passes.before);
104
+ });
105
+ });
106
+ });
107
+
108
+ given("[case2] a consumer whose boot.yml already declares a divergent budget", () => {
109
+ const tempDir = genTempDir({
110
+ slug: 'declapract-rhachet-boot-budget-preserved',
111
+ clone:
112
+ './src/practices/rhachet/.test/assets/demo-repo-with-consumer-boot',
113
+ symlink: [{ at: 'declarations', to: 'src' }],
114
+ });
115
+
116
+ const bootPath = '.agent/repo=.this/role=any/boot.yml';
117
+ const bootAbs = path.join(tempDir, bootPath);
118
+
119
+ const applyFix = () =>
120
+ executeApply({
121
+ config: path.join(tempDir, 'declapract.use.yml'),
122
+ practice: 'rhachet',
123
+ file: bootPath,
124
+ });
125
+
126
+ // seed the writable clone with a budget the consumer chose on purpose — a value the findsert
127
+ // must NOT revert (findsert, never upsert). this proves the present-value-preserved branch
128
+ // through the real pipeline, no extra fixture needed.
129
+ when('[t0] the consumer set its own budget of 9000', () => {
130
+ useThen('write a divergent budget into the cloned boot', async () => {
131
+ const before = await fs.readFile(bootAbs, 'utf-8');
132
+ await fs.writeFile(bootAbs, `${before}budget:\n tokens: 9000\n`, 'utf-8');
133
+ });
134
+
135
+ then('the seed carries the consumer budget', async () => {
136
+ expect(yaml.parse(await fs.readFile(bootAbs, 'utf-8')).budget.tokens).toEqual(9000);
137
+ });
138
+ });
139
+
140
+ when('[t1] the findsert fix is applied', () => {
141
+ useThen('apply the fix over the consumer-chosen budget', async () => applyFix());
142
+
143
+ then("the consumer's budget survives untouched (findsert, never upsert)", async () => {
144
+ const parsed = yaml.parse(await fs.readFile(bootAbs, 'utf-8'));
145
+ expect(parsed.budget.tokens).toEqual(9000);
146
+ });
147
+ });
148
+ });
149
+ });
@@ -0,0 +1,105 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'node:path';
3
+
4
+ import { executeApply } from 'declapract';
5
+ // eslint-disable-next-line import/no-extraneous-dependencies
6
+ import yaml from 'yaml';
7
+ import { genTempDir, given, then, useBeforeAll, when } from 'test-fns';
8
+
9
+ // executeApply evaluates the whole usecase, so widen the jest budget
10
+ jest.setTimeout(180_000);
11
+
12
+ /**
13
+ * .what = pipeline test for the usecase-aware keyrack.yml findsert (#491, #487)
14
+ * .why = the unit grain proves check/fix in memory; only executeApply proves declapract matches
15
+ * `.agent/keyrack.yml`, feeds the aws practice into context.projectPractices, and writes the
16
+ * upgrade into a real repo file — and that a second apply is a no-op
17
+ * .note = filter by `file` only, never `practice`: a practice filter narrows projectPractices and
18
+ * would silence the aws branch
19
+ */
20
+ describe('rhachet — keyrack.yml AWS_PROFILE findsert', () => {
21
+ const keyrackPath = '.agent/keyrack.yml';
22
+ const DECLARED = {
23
+ key: 'AWS_PROFILE',
24
+ 'is-optional-if-has': 'AWS_ACCESS_KEY_ID',
25
+ };
26
+
27
+ given('[case1] an aws repo whose keyrack.yml holds a bare AWS_PROFILE', () => {
28
+ const tempDir = genTempDir({
29
+ slug: 'rhachet-keyrack-aws',
30
+ clone: './src/practices/rhachet/.test/assets/repo-keyrack-extant',
31
+ symlink: [
32
+ { at: 'declarations', to: './src/.test/assets/rhachet/declarations' },
33
+ { at: 'node_modules', to: 'node_modules' },
34
+ ],
35
+ });
36
+
37
+ const state = useBeforeAll(async () => {
38
+ const config = path.join(tempDir, 'declapract.use.yml');
39
+ const read = () => fs.readFile(path.join(tempDir, keyrackPath), 'utf-8');
40
+ const before = await read();
41
+ await executeApply({ config, file: keyrackPath });
42
+ const after1 = await read();
43
+ await executeApply({ config, file: keyrackPath });
44
+ const after2 = await read();
45
+ return { before, after1, after2 };
46
+ }, 170_000);
47
+
48
+ when('[t0] the rhachet practice is applied', () => {
49
+ then('the bare AWS_PROFILE is upgraded in place to is-optional-if-has', () => {
50
+ const parsed = yaml.parse(state.after1);
51
+ expect(parsed['env.test']).toEqual([DECLARED]);
52
+ expect(parsed['env.all']).toBeUndefined();
53
+ });
54
+
55
+ then("the repo's own keys, extends, and comment survive", () => {
56
+ const parsed = yaml.parse(state.after1);
57
+ expect(parsed['env.prep']).toEqual(['OPENROUTER_API_KEY']);
58
+ expect(parsed.extends).toEqual([
59
+ '.agent/repo=ehmpathy/role=mechanic/keyrack.yml',
60
+ ]);
61
+ expect(state.after1).toContain(
62
+ '# the local aws login, from before is-optional-if-has',
63
+ );
64
+ });
65
+
66
+ then('the before + after contents match snapshot', () => {
67
+ expect(state.before).toMatchSnapshot('keyrack.yml — before');
68
+ expect(state.after1).toMatchSnapshot('keyrack.yml — after');
69
+ });
70
+ });
71
+
72
+ when('[t1] the practice is applied a second time', () => {
73
+ then('the second apply is a no-op', () => {
74
+ expect(state.after2).toEqual(state.after1);
75
+ });
76
+ });
77
+ });
78
+
79
+ given('[case2] the same repo with no aws practice in its usecase', () => {
80
+ const tempDir = genTempDir({
81
+ slug: 'rhachet-keyrack-node',
82
+ clone: './src/practices/rhachet/.test/assets/repo-keyrack-extant',
83
+ symlink: [
84
+ { at: 'declarations', to: './src/.test/assets/rhachet/declarations' },
85
+ { at: 'node_modules', to: 'node_modules' },
86
+ ],
87
+ });
88
+
89
+ const state = useBeforeAll(async () => {
90
+ const read = () => fs.readFile(path.join(tempDir, keyrackPath), 'utf-8');
91
+ const before = await read();
92
+ await executeApply({
93
+ config: path.join(tempDir, 'declapract.use.node.yml'),
94
+ file: keyrackPath,
95
+ });
96
+ return { before, after: await read() };
97
+ }, 170_000);
98
+
99
+ when('[t0] the rhachet practice is applied', () => {
100
+ then('the keyrack.yml is left byte for byte', () => {
101
+ expect(state.after).toEqual(state.before);
102
+ });
103
+ });
104
+ });
105
+ });
@@ -0,0 +1,88 @@
1
+ import fs from 'fs/promises';
2
+ import path from 'node:path';
3
+
4
+ import { executeApply } from 'declapract';
5
+ import { genTempDir, given, then, useBeforeAll, when } from 'test-fns';
6
+
7
+ // executeApply evaluates the whole usecase, so widen the jest budget
8
+ jest.setTimeout(180_000);
9
+
10
+ /**
11
+ * .what = pipeline test for the rhachet package.json build order in a self-linked repo (#520)
12
+ * .why = a `link:.` repo boots its own roles, whose hooks load from `dist/`, so `prepare:rhachet`
13
+ * must build before `rhachet init`. the CONTAINS fix used to strip a hand-added build; now
14
+ * the contents fn reads the repo's own package.json and declares the build for a self-link
15
+ * .note = declapract's CONTAINS fix writes a dep the repo lacks as its raw `@declapract{…}` marker,
16
+ * and only the next apply resolves it (ehmpathy/declapract; dream
17
+ * `v2026_10_14.reseed.declapract-contains-json-adds-raw-minversion-markers`). so the second
18
+ * apply resolves the marker, and the third proves the fixed point. [t0] asserts the marker,
19
+ * so the day declapract resolves it in one apply, [t0] reddens and this note retires
20
+ */
21
+ describe('rhachet — prepare:rhachet builds first in a self-linked repo', () => {
22
+ given('[case1] a rhachet roles package with a link:. self-dep and no build before init', () => {
23
+ const tempDir = genTempDir({
24
+ slug: 'rhachet-self-linked',
25
+ clone: './src/practices/rhachet/.test/assets/repo-self-linked',
26
+ symlink: [
27
+ { at: 'declarations', to: './src/.test/assets/rhachet/declarations' },
28
+ { at: 'node_modules', to: 'node_modules' },
29
+ ],
30
+ });
31
+
32
+ const state = useBeforeAll(async () => {
33
+ const config = path.join(tempDir, 'declapract.use.yml');
34
+ const read = () =>
35
+ fs.readFile(path.join(tempDir, 'package.json'), 'utf-8');
36
+ const before = await read();
37
+ await executeApply({ config, file: 'package.json' });
38
+ const after1 = await read();
39
+ await executeApply({ config, file: 'package.json' });
40
+ const after2 = await read();
41
+ await executeApply({ config, file: 'package.json' });
42
+ const after3 = await read();
43
+ return { before, after1, after2, after3 };
44
+ }, 170_000);
45
+
46
+ when('[t0] the rhachet practice is applied', () => {
47
+ then('prepare:rhachet runs npm run build before rhachet init', () => {
48
+ const commands = JSON.parse(state.after1).scripts;
49
+ expect(commands['prepare:rhachet']).toMatch(
50
+ /^npm run build && rhachet init --keys --hooks --roles /,
51
+ );
52
+ });
53
+
54
+ then('the self-dep and the build command survive', () => {
55
+ const parsed = JSON.parse(state.after1);
56
+ expect(parsed.devDependencies['rhachet-roles-demo']).toEqual('link:.');
57
+ expect(parsed.scripts.build).toEqual('tsc -p ./tsconfig.build.json');
58
+ });
59
+
60
+ then('a dep the repo lacked lands as its raw declapract marker (upstream defect)', () => {
61
+ expect(JSON.parse(state.after1).devDependencies['rhachet-brains-openrouter']).toMatch(
62
+ /^@declapract\{check\.minVersion\('[\d.]+'\)\}$/,
63
+ );
64
+ });
65
+
66
+ then('the before + after contents match snapshot', () => {
67
+ expect(state.before).toMatchSnapshot('package.json — before');
68
+ expect(state.after1).toMatchSnapshot('package.json — after');
69
+ });
70
+ });
71
+
72
+ when('[t1] the practice is applied a second time', () => {
73
+ then('every raw marker resolves to a version, and the build step is kept', () => {
74
+ expect(state.after2).not.toContain('@declapract{');
75
+ expect(JSON.parse(state.after2).scripts['prepare:rhachet']).toMatch(
76
+ /^npm run build && rhachet init /,
77
+ );
78
+ expect(state.after2).toMatchSnapshot('package.json — after the second apply');
79
+ });
80
+ });
81
+
82
+ when('[t2] the practice is applied a third time', () => {
83
+ then('the third apply is a no-op', () => {
84
+ expect(state.after3).toEqual(state.after2);
85
+ });
86
+ });
87
+ });
88
+ });
@@ -0,0 +1,23 @@
1
+ import { SNSEventRecord, SNSMessage, SNSEvent } from 'aws-lambda';
2
+
3
+ import { exampleEmailClickEvent } from '../../src/.test/assets/exampleEmailClickEvent';
4
+ import { invokeLambda } from '../_utils/invokeLambda';
5
+
6
+ describe('consumeSESEmailEventFromSNS', () => {
7
+ it('should be possible to invoke the lambda', async () => {
8
+ const exampleSnsEvent: SNSEvent = {
9
+ Records: [
10
+ {
11
+ Sns: {
12
+ Message: JSON.stringify(exampleEmailClickEvent),
13
+ } as SNSMessage,
14
+ } as SNSEventRecord,
15
+ ],
16
+ };
17
+ const response = await invokeLambda({
18
+ name: 'consumeSESEmailEventFromSNS',
19
+ data: exampleSnsEvent,
20
+ });
21
+ expect(response).toBeDefined();
22
+ });
23
+ });
@@ -0,0 +1,9 @@
1
+ # .note = declarations dir is symlinked by the test to src/.test/assets/tests-any-only/declarations
2
+ # the variables stay: the fix reads projectName from this file for the `which` it emits
3
+ declarations: 'declarations/declapract.declare.yml'
4
+ useCase: tests-any-only
5
+ variables:
6
+ organizationName: 'test-org'
7
+ projectName: 'svc-notifications'
8
+ reviewers:
9
+ users: ['user1']
@@ -0,0 +1,19 @@
1
+ import { invokeLambdaForTesting } from 'simple-lambda-testing-methods';
2
+
3
+ import { locally } from '../__test_utils__/environment';
4
+
5
+ describe('addDecoratedImage', () => {
6
+ it('it should be possible to add a decorated image', async () => {
7
+ const response = await invokeLambdaForTesting({
8
+ service: 'svc-images',
9
+ function: 'addDecoratedImage',
10
+ locally,
11
+ event: {
12
+ url: 'https://some.url',
13
+ description: 'bo vine at his gig, moooooin the lawn',
14
+ focalArea: null,
15
+ },
16
+ });
17
+ expect(response.image).toHaveProperty('uuid');
18
+ });
19
+ });