solokit 0.1.1__py3-none-any.whl

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 (323) hide show
  1. solokit/__init__.py +10 -0
  2. solokit/__version__.py +3 -0
  3. solokit/cli.py +374 -0
  4. solokit/core/__init__.py +1 -0
  5. solokit/core/cache.py +102 -0
  6. solokit/core/command_runner.py +278 -0
  7. solokit/core/config.py +453 -0
  8. solokit/core/config_validator.py +204 -0
  9. solokit/core/constants.py +291 -0
  10. solokit/core/error_formatter.py +279 -0
  11. solokit/core/error_handlers.py +346 -0
  12. solokit/core/exceptions.py +1567 -0
  13. solokit/core/file_ops.py +309 -0
  14. solokit/core/logging_config.py +166 -0
  15. solokit/core/output.py +99 -0
  16. solokit/core/performance.py +57 -0
  17. solokit/core/protocols.py +141 -0
  18. solokit/core/types.py +312 -0
  19. solokit/deployment/__init__.py +1 -0
  20. solokit/deployment/executor.py +411 -0
  21. solokit/git/__init__.py +1 -0
  22. solokit/git/integration.py +619 -0
  23. solokit/init/__init__.py +41 -0
  24. solokit/init/claude_commands_installer.py +87 -0
  25. solokit/init/dependency_installer.py +313 -0
  26. solokit/init/docs_structure.py +90 -0
  27. solokit/init/env_generator.py +160 -0
  28. solokit/init/environment_validator.py +334 -0
  29. solokit/init/git_hooks_installer.py +71 -0
  30. solokit/init/git_setup.py +188 -0
  31. solokit/init/gitignore_updater.py +195 -0
  32. solokit/init/initial_commit.py +145 -0
  33. solokit/init/initial_scans.py +109 -0
  34. solokit/init/orchestrator.py +246 -0
  35. solokit/init/readme_generator.py +207 -0
  36. solokit/init/session_structure.py +239 -0
  37. solokit/init/template_installer.py +424 -0
  38. solokit/learning/__init__.py +1 -0
  39. solokit/learning/archiver.py +115 -0
  40. solokit/learning/categorizer.py +126 -0
  41. solokit/learning/curator.py +428 -0
  42. solokit/learning/extractor.py +352 -0
  43. solokit/learning/reporter.py +351 -0
  44. solokit/learning/repository.py +254 -0
  45. solokit/learning/similarity.py +342 -0
  46. solokit/learning/validator.py +144 -0
  47. solokit/project/__init__.py +1 -0
  48. solokit/project/init.py +1162 -0
  49. solokit/project/stack.py +436 -0
  50. solokit/project/sync_plugin.py +438 -0
  51. solokit/project/tree.py +375 -0
  52. solokit/quality/__init__.py +1 -0
  53. solokit/quality/api_validator.py +424 -0
  54. solokit/quality/checkers/__init__.py +25 -0
  55. solokit/quality/checkers/base.py +114 -0
  56. solokit/quality/checkers/context7.py +221 -0
  57. solokit/quality/checkers/custom.py +162 -0
  58. solokit/quality/checkers/deployment.py +323 -0
  59. solokit/quality/checkers/documentation.py +179 -0
  60. solokit/quality/checkers/formatting.py +161 -0
  61. solokit/quality/checkers/integration.py +394 -0
  62. solokit/quality/checkers/linting.py +159 -0
  63. solokit/quality/checkers/security.py +261 -0
  64. solokit/quality/checkers/spec_completeness.py +127 -0
  65. solokit/quality/checkers/tests.py +184 -0
  66. solokit/quality/env_validator.py +306 -0
  67. solokit/quality/gates.py +655 -0
  68. solokit/quality/reporters/__init__.py +10 -0
  69. solokit/quality/reporters/base.py +25 -0
  70. solokit/quality/reporters/console.py +98 -0
  71. solokit/quality/reporters/json_reporter.py +34 -0
  72. solokit/quality/results.py +98 -0
  73. solokit/session/__init__.py +1 -0
  74. solokit/session/briefing/__init__.py +245 -0
  75. solokit/session/briefing/documentation_loader.py +53 -0
  76. solokit/session/briefing/formatter.py +476 -0
  77. solokit/session/briefing/git_context.py +282 -0
  78. solokit/session/briefing/learning_loader.py +212 -0
  79. solokit/session/briefing/milestone_builder.py +78 -0
  80. solokit/session/briefing/orchestrator.py +137 -0
  81. solokit/session/briefing/stack_detector.py +51 -0
  82. solokit/session/briefing/tree_generator.py +52 -0
  83. solokit/session/briefing/work_item_loader.py +209 -0
  84. solokit/session/briefing.py +353 -0
  85. solokit/session/complete.py +1188 -0
  86. solokit/session/status.py +246 -0
  87. solokit/session/validate.py +452 -0
  88. solokit/templates/.claude/commands/end.md +109 -0
  89. solokit/templates/.claude/commands/init.md +159 -0
  90. solokit/templates/.claude/commands/learn-curate.md +88 -0
  91. solokit/templates/.claude/commands/learn-search.md +62 -0
  92. solokit/templates/.claude/commands/learn-show.md +69 -0
  93. solokit/templates/.claude/commands/learn.md +136 -0
  94. solokit/templates/.claude/commands/start.md +114 -0
  95. solokit/templates/.claude/commands/status.md +22 -0
  96. solokit/templates/.claude/commands/validate.md +27 -0
  97. solokit/templates/.claude/commands/work-delete.md +119 -0
  98. solokit/templates/.claude/commands/work-graph.md +139 -0
  99. solokit/templates/.claude/commands/work-list.md +26 -0
  100. solokit/templates/.claude/commands/work-new.md +114 -0
  101. solokit/templates/.claude/commands/work-next.md +25 -0
  102. solokit/templates/.claude/commands/work-show.md +24 -0
  103. solokit/templates/.claude/commands/work-update.md +141 -0
  104. solokit/templates/CHANGELOG.md +17 -0
  105. solokit/templates/WORK_ITEM_TYPES.md +141 -0
  106. solokit/templates/__init__.py +1 -0
  107. solokit/templates/bug_spec.md +217 -0
  108. solokit/templates/config.schema.json +150 -0
  109. solokit/templates/dashboard_refine/base/.gitignore +36 -0
  110. solokit/templates/dashboard_refine/base/app/(dashboard)/layout.tsx +22 -0
  111. solokit/templates/dashboard_refine/base/app/(dashboard)/page.tsx +68 -0
  112. solokit/templates/dashboard_refine/base/app/(dashboard)/users/page.tsx +77 -0
  113. solokit/templates/dashboard_refine/base/app/globals.css +60 -0
  114. solokit/templates/dashboard_refine/base/app/layout.tsx +23 -0
  115. solokit/templates/dashboard_refine/base/app/page.tsx +9 -0
  116. solokit/templates/dashboard_refine/base/components/client-refine-wrapper.tsx +21 -0
  117. solokit/templates/dashboard_refine/base/components/layout/header.tsx +44 -0
  118. solokit/templates/dashboard_refine/base/components/layout/sidebar.tsx +82 -0
  119. solokit/templates/dashboard_refine/base/components/ui/button.tsx +53 -0
  120. solokit/templates/dashboard_refine/base/components/ui/card.tsx +78 -0
  121. solokit/templates/dashboard_refine/base/components/ui/table.tsx +116 -0
  122. solokit/templates/dashboard_refine/base/components.json +16 -0
  123. solokit/templates/dashboard_refine/base/lib/refine.tsx +65 -0
  124. solokit/templates/dashboard_refine/base/lib/utils.ts +13 -0
  125. solokit/templates/dashboard_refine/base/next.config.ts +10 -0
  126. solokit/templates/dashboard_refine/base/package.json.template +40 -0
  127. solokit/templates/dashboard_refine/base/postcss.config.mjs +8 -0
  128. solokit/templates/dashboard_refine/base/providers/refine-provider.tsx +26 -0
  129. solokit/templates/dashboard_refine/base/tailwind.config.ts +57 -0
  130. solokit/templates/dashboard_refine/base/tsconfig.json +27 -0
  131. solokit/templates/dashboard_refine/docker/Dockerfile +57 -0
  132. solokit/templates/dashboard_refine/docker/docker-compose.prod.yml +31 -0
  133. solokit/templates/dashboard_refine/docker/docker-compose.yml +21 -0
  134. solokit/templates/dashboard_refine/tier-1-essential/.eslintrc.json +7 -0
  135. solokit/templates/dashboard_refine/tier-1-essential/jest.config.ts +17 -0
  136. solokit/templates/dashboard_refine/tier-1-essential/jest.setup.ts +1 -0
  137. solokit/templates/dashboard_refine/tier-1-essential/package.json.tier1.template +57 -0
  138. solokit/templates/dashboard_refine/tier-1-essential/tests/setup.ts +26 -0
  139. solokit/templates/dashboard_refine/tier-1-essential/tests/unit/example.test.tsx +73 -0
  140. solokit/templates/dashboard_refine/tier-2-standard/package.json.tier2.template +62 -0
  141. solokit/templates/dashboard_refine/tier-3-comprehensive/eslint.config.mjs +22 -0
  142. solokit/templates/dashboard_refine/tier-3-comprehensive/package.json.tier3.template +79 -0
  143. solokit/templates/dashboard_refine/tier-3-comprehensive/playwright.config.ts +66 -0
  144. solokit/templates/dashboard_refine/tier-3-comprehensive/stryker.conf.json +38 -0
  145. solokit/templates/dashboard_refine/tier-3-comprehensive/tests/e2e/dashboard.spec.ts +88 -0
  146. solokit/templates/dashboard_refine/tier-3-comprehensive/tests/e2e/user-management.spec.ts +102 -0
  147. solokit/templates/dashboard_refine/tier-3-comprehensive/tests/integration/dashboard.test.tsx +90 -0
  148. solokit/templates/dashboard_refine/tier-3-comprehensive/type-coverage.json +16 -0
  149. solokit/templates/dashboard_refine/tier-4-production/instrumentation.ts +9 -0
  150. solokit/templates/dashboard_refine/tier-4-production/k6/dashboard-load-test.js +70 -0
  151. solokit/templates/dashboard_refine/tier-4-production/next.config.ts +46 -0
  152. solokit/templates/dashboard_refine/tier-4-production/package.json.tier4.template +89 -0
  153. solokit/templates/dashboard_refine/tier-4-production/sentry.client.config.ts +26 -0
  154. solokit/templates/dashboard_refine/tier-4-production/sentry.edge.config.ts +11 -0
  155. solokit/templates/dashboard_refine/tier-4-production/sentry.server.config.ts +11 -0
  156. solokit/templates/deployment_spec.md +500 -0
  157. solokit/templates/feature_spec.md +248 -0
  158. solokit/templates/fullstack_nextjs/base/.gitignore +36 -0
  159. solokit/templates/fullstack_nextjs/base/app/api/example/route.ts +65 -0
  160. solokit/templates/fullstack_nextjs/base/app/globals.css +27 -0
  161. solokit/templates/fullstack_nextjs/base/app/layout.tsx +20 -0
  162. solokit/templates/fullstack_nextjs/base/app/page.tsx +32 -0
  163. solokit/templates/fullstack_nextjs/base/components/example-component.tsx +20 -0
  164. solokit/templates/fullstack_nextjs/base/lib/prisma.ts +17 -0
  165. solokit/templates/fullstack_nextjs/base/lib/utils.ts +13 -0
  166. solokit/templates/fullstack_nextjs/base/lib/validations.ts +20 -0
  167. solokit/templates/fullstack_nextjs/base/next.config.ts +7 -0
  168. solokit/templates/fullstack_nextjs/base/package.json.template +32 -0
  169. solokit/templates/fullstack_nextjs/base/postcss.config.mjs +8 -0
  170. solokit/templates/fullstack_nextjs/base/prisma/schema.prisma +21 -0
  171. solokit/templates/fullstack_nextjs/base/tailwind.config.ts +19 -0
  172. solokit/templates/fullstack_nextjs/base/tsconfig.json +27 -0
  173. solokit/templates/fullstack_nextjs/docker/Dockerfile +60 -0
  174. solokit/templates/fullstack_nextjs/docker/docker-compose.prod.yml +57 -0
  175. solokit/templates/fullstack_nextjs/docker/docker-compose.yml +47 -0
  176. solokit/templates/fullstack_nextjs/tier-1-essential/.eslintrc.json +7 -0
  177. solokit/templates/fullstack_nextjs/tier-1-essential/jest.config.ts +17 -0
  178. solokit/templates/fullstack_nextjs/tier-1-essential/jest.setup.ts +1 -0
  179. solokit/templates/fullstack_nextjs/tier-1-essential/package.json.tier1.template +48 -0
  180. solokit/templates/fullstack_nextjs/tier-1-essential/tests/api/example.test.ts +88 -0
  181. solokit/templates/fullstack_nextjs/tier-1-essential/tests/setup.ts +22 -0
  182. solokit/templates/fullstack_nextjs/tier-1-essential/tests/unit/example.test.tsx +22 -0
  183. solokit/templates/fullstack_nextjs/tier-2-standard/package.json.tier2.template +52 -0
  184. solokit/templates/fullstack_nextjs/tier-3-comprehensive/eslint.config.mjs +39 -0
  185. solokit/templates/fullstack_nextjs/tier-3-comprehensive/package.json.tier3.template +68 -0
  186. solokit/templates/fullstack_nextjs/tier-3-comprehensive/playwright.config.ts +66 -0
  187. solokit/templates/fullstack_nextjs/tier-3-comprehensive/stryker.conf.json +33 -0
  188. solokit/templates/fullstack_nextjs/tier-3-comprehensive/tests/e2e/flow.spec.ts +59 -0
  189. solokit/templates/fullstack_nextjs/tier-3-comprehensive/tests/integration/api.test.ts +165 -0
  190. solokit/templates/fullstack_nextjs/tier-3-comprehensive/type-coverage.json +12 -0
  191. solokit/templates/fullstack_nextjs/tier-4-production/instrumentation.ts +9 -0
  192. solokit/templates/fullstack_nextjs/tier-4-production/k6/load-test.js +45 -0
  193. solokit/templates/fullstack_nextjs/tier-4-production/next.config.ts +46 -0
  194. solokit/templates/fullstack_nextjs/tier-4-production/package.json.tier4.template +77 -0
  195. solokit/templates/fullstack_nextjs/tier-4-production/sentry.client.config.ts +26 -0
  196. solokit/templates/fullstack_nextjs/tier-4-production/sentry.edge.config.ts +11 -0
  197. solokit/templates/fullstack_nextjs/tier-4-production/sentry.server.config.ts +11 -0
  198. solokit/templates/git-hooks/prepare-commit-msg +24 -0
  199. solokit/templates/integration_test_spec.md +363 -0
  200. solokit/templates/learnings.json +15 -0
  201. solokit/templates/ml_ai_fastapi/base/.gitignore +104 -0
  202. solokit/templates/ml_ai_fastapi/base/alembic/env.py +96 -0
  203. solokit/templates/ml_ai_fastapi/base/alembic.ini +114 -0
  204. solokit/templates/ml_ai_fastapi/base/pyproject.toml.template +91 -0
  205. solokit/templates/ml_ai_fastapi/base/requirements.txt.template +28 -0
  206. solokit/templates/ml_ai_fastapi/base/src/__init__.py +5 -0
  207. solokit/templates/ml_ai_fastapi/base/src/api/__init__.py +3 -0
  208. solokit/templates/ml_ai_fastapi/base/src/api/dependencies.py +20 -0
  209. solokit/templates/ml_ai_fastapi/base/src/api/routes/__init__.py +3 -0
  210. solokit/templates/ml_ai_fastapi/base/src/api/routes/example.py +134 -0
  211. solokit/templates/ml_ai_fastapi/base/src/api/routes/health.py +66 -0
  212. solokit/templates/ml_ai_fastapi/base/src/core/__init__.py +3 -0
  213. solokit/templates/ml_ai_fastapi/base/src/core/config.py +64 -0
  214. solokit/templates/ml_ai_fastapi/base/src/core/database.py +50 -0
  215. solokit/templates/ml_ai_fastapi/base/src/main.py +64 -0
  216. solokit/templates/ml_ai_fastapi/base/src/models/__init__.py +7 -0
  217. solokit/templates/ml_ai_fastapi/base/src/models/example.py +61 -0
  218. solokit/templates/ml_ai_fastapi/base/src/services/__init__.py +3 -0
  219. solokit/templates/ml_ai_fastapi/base/src/services/example.py +115 -0
  220. solokit/templates/ml_ai_fastapi/docker/Dockerfile +59 -0
  221. solokit/templates/ml_ai_fastapi/docker/docker-compose.prod.yml +112 -0
  222. solokit/templates/ml_ai_fastapi/docker/docker-compose.yml +77 -0
  223. solokit/templates/ml_ai_fastapi/tier-1-essential/pyproject.toml.tier1.template +112 -0
  224. solokit/templates/ml_ai_fastapi/tier-1-essential/pyrightconfig.json +41 -0
  225. solokit/templates/ml_ai_fastapi/tier-1-essential/pytest.ini +69 -0
  226. solokit/templates/ml_ai_fastapi/tier-1-essential/requirements-dev.txt +17 -0
  227. solokit/templates/ml_ai_fastapi/tier-1-essential/ruff.toml +81 -0
  228. solokit/templates/ml_ai_fastapi/tier-1-essential/tests/__init__.py +3 -0
  229. solokit/templates/ml_ai_fastapi/tier-1-essential/tests/conftest.py +72 -0
  230. solokit/templates/ml_ai_fastapi/tier-1-essential/tests/test_main.py +49 -0
  231. solokit/templates/ml_ai_fastapi/tier-1-essential/tests/unit/__init__.py +3 -0
  232. solokit/templates/ml_ai_fastapi/tier-1-essential/tests/unit/test_example.py +113 -0
  233. solokit/templates/ml_ai_fastapi/tier-2-standard/pyproject.toml.tier2.template +130 -0
  234. solokit/templates/ml_ai_fastapi/tier-3-comprehensive/locustfile.py +99 -0
  235. solokit/templates/ml_ai_fastapi/tier-3-comprehensive/mutmut_config.py +53 -0
  236. solokit/templates/ml_ai_fastapi/tier-3-comprehensive/pyproject.toml.tier3.template +150 -0
  237. solokit/templates/ml_ai_fastapi/tier-3-comprehensive/tests/integration/__init__.py +3 -0
  238. solokit/templates/ml_ai_fastapi/tier-3-comprehensive/tests/integration/conftest.py +74 -0
  239. solokit/templates/ml_ai_fastapi/tier-3-comprehensive/tests/integration/test_api.py +131 -0
  240. solokit/templates/ml_ai_fastapi/tier-4-production/pyproject.toml.tier4.template +162 -0
  241. solokit/templates/ml_ai_fastapi/tier-4-production/requirements-prod.txt +25 -0
  242. solokit/templates/ml_ai_fastapi/tier-4-production/src/api/routes/metrics.py +19 -0
  243. solokit/templates/ml_ai_fastapi/tier-4-production/src/core/logging.py +74 -0
  244. solokit/templates/ml_ai_fastapi/tier-4-production/src/core/monitoring.py +68 -0
  245. solokit/templates/ml_ai_fastapi/tier-4-production/src/core/sentry.py +66 -0
  246. solokit/templates/ml_ai_fastapi/tier-4-production/src/middleware/__init__.py +3 -0
  247. solokit/templates/ml_ai_fastapi/tier-4-production/src/middleware/logging.py +79 -0
  248. solokit/templates/ml_ai_fastapi/tier-4-production/src/middleware/tracing.py +60 -0
  249. solokit/templates/refactor_spec.md +287 -0
  250. solokit/templates/saas_t3/base/.gitignore +36 -0
  251. solokit/templates/saas_t3/base/app/api/trpc/[trpc]/route.ts +33 -0
  252. solokit/templates/saas_t3/base/app/globals.css +27 -0
  253. solokit/templates/saas_t3/base/app/layout.tsx +23 -0
  254. solokit/templates/saas_t3/base/app/page.tsx +31 -0
  255. solokit/templates/saas_t3/base/lib/api.tsx +77 -0
  256. solokit/templates/saas_t3/base/lib/utils.ts +13 -0
  257. solokit/templates/saas_t3/base/next.config.ts +7 -0
  258. solokit/templates/saas_t3/base/package.json.template +38 -0
  259. solokit/templates/saas_t3/base/postcss.config.mjs +8 -0
  260. solokit/templates/saas_t3/base/prisma/schema.prisma +20 -0
  261. solokit/templates/saas_t3/base/server/api/root.ts +19 -0
  262. solokit/templates/saas_t3/base/server/api/routers/example.ts +28 -0
  263. solokit/templates/saas_t3/base/server/api/trpc.ts +52 -0
  264. solokit/templates/saas_t3/base/server/db.ts +17 -0
  265. solokit/templates/saas_t3/base/tailwind.config.ts +19 -0
  266. solokit/templates/saas_t3/base/tsconfig.json +27 -0
  267. solokit/templates/saas_t3/docker/Dockerfile +60 -0
  268. solokit/templates/saas_t3/docker/docker-compose.prod.yml +59 -0
  269. solokit/templates/saas_t3/docker/docker-compose.yml +49 -0
  270. solokit/templates/saas_t3/tier-1-essential/.eslintrc.json +7 -0
  271. solokit/templates/saas_t3/tier-1-essential/jest.config.ts +17 -0
  272. solokit/templates/saas_t3/tier-1-essential/jest.setup.ts +1 -0
  273. solokit/templates/saas_t3/tier-1-essential/package.json.tier1.template +54 -0
  274. solokit/templates/saas_t3/tier-1-essential/tests/setup.ts +22 -0
  275. solokit/templates/saas_t3/tier-1-essential/tests/unit/example.test.tsx +24 -0
  276. solokit/templates/saas_t3/tier-2-standard/package.json.tier2.template +58 -0
  277. solokit/templates/saas_t3/tier-3-comprehensive/eslint.config.mjs +39 -0
  278. solokit/templates/saas_t3/tier-3-comprehensive/package.json.tier3.template +74 -0
  279. solokit/templates/saas_t3/tier-3-comprehensive/playwright.config.ts +66 -0
  280. solokit/templates/saas_t3/tier-3-comprehensive/stryker.conf.json +34 -0
  281. solokit/templates/saas_t3/tier-3-comprehensive/tests/e2e/home.spec.ts +41 -0
  282. solokit/templates/saas_t3/tier-3-comprehensive/tests/integration/api.test.ts +44 -0
  283. solokit/templates/saas_t3/tier-3-comprehensive/type-coverage.json +12 -0
  284. solokit/templates/saas_t3/tier-4-production/instrumentation.ts +9 -0
  285. solokit/templates/saas_t3/tier-4-production/k6/load-test.js +51 -0
  286. solokit/templates/saas_t3/tier-4-production/next.config.ts +46 -0
  287. solokit/templates/saas_t3/tier-4-production/package.json.tier4.template +83 -0
  288. solokit/templates/saas_t3/tier-4-production/sentry.client.config.ts +26 -0
  289. solokit/templates/saas_t3/tier-4-production/sentry.edge.config.ts +11 -0
  290. solokit/templates/saas_t3/tier-4-production/sentry.server.config.ts +11 -0
  291. solokit/templates/saas_t3/tier-4-production/vercel.json +37 -0
  292. solokit/templates/security_spec.md +287 -0
  293. solokit/templates/stack-versions.yaml +617 -0
  294. solokit/templates/status_update.json +6 -0
  295. solokit/templates/template-registry.json +257 -0
  296. solokit/templates/work_items.json +11 -0
  297. solokit/testing/__init__.py +1 -0
  298. solokit/testing/integration_runner.py +550 -0
  299. solokit/testing/performance.py +637 -0
  300. solokit/visualization/__init__.py +1 -0
  301. solokit/visualization/dependency_graph.py +788 -0
  302. solokit/work_items/__init__.py +1 -0
  303. solokit/work_items/creator.py +217 -0
  304. solokit/work_items/delete.py +264 -0
  305. solokit/work_items/get_dependencies.py +185 -0
  306. solokit/work_items/get_dependents.py +113 -0
  307. solokit/work_items/get_metadata.py +121 -0
  308. solokit/work_items/get_next_recommendations.py +133 -0
  309. solokit/work_items/manager.py +235 -0
  310. solokit/work_items/milestones.py +137 -0
  311. solokit/work_items/query.py +376 -0
  312. solokit/work_items/repository.py +267 -0
  313. solokit/work_items/scheduler.py +184 -0
  314. solokit/work_items/spec_parser.py +838 -0
  315. solokit/work_items/spec_validator.py +493 -0
  316. solokit/work_items/updater.py +157 -0
  317. solokit/work_items/validator.py +205 -0
  318. solokit-0.1.1.dist-info/METADATA +640 -0
  319. solokit-0.1.1.dist-info/RECORD +323 -0
  320. solokit-0.1.1.dist-info/WHEEL +5 -0
  321. solokit-0.1.1.dist-info/entry_points.txt +2 -0
  322. solokit-0.1.1.dist-info/licenses/LICENSE +21 -0
  323. solokit-0.1.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,89 @@
1
+ {
2
+ "name": "{project_name}",
3
+ "version": "0.1.0",
4
+ "description": "{project_description}",
5
+ "private": true,
6
+ "type": "module",
7
+ "scripts": {
8
+ "dev": "next dev",
9
+ "build": "next build",
10
+ "start": "next start",
11
+ "lint": "next lint",
12
+ "lint:fix": "next lint --fix",
13
+ "format": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
14
+ "format:check": "prettier --check \"**/*.{ts,tsx,js,jsx,json,css,md}\"",
15
+ "type-check": "tsc --noEmit",
16
+ "test": "jest",
17
+ "test:coverage": "jest --coverage",
18
+ "test:watch": "jest --watch",
19
+ "test:e2e": "playwright test",
20
+ "test:e2e:ui": "playwright test --ui",
21
+ "test:e2e:debug": "playwright test --debug",
22
+ "test:a11y": "playwright test --grep @a11y",
23
+ "test:mutation": "stryker run",
24
+ "check:duplication": "jscpd .",
25
+ "check:types": "type-coverage",
26
+ "check:unused": "ts-prune",
27
+ "prepare": "husky install",
28
+ "audit": "npm audit --audit-level=moderate",
29
+ "analyze": "ANALYZE=true npm run build",
30
+ "lighthouse": "lhci autorun",
31
+ "load:test": "k6 run k6/dashboard-load-test.js",
32
+ "postinstall": "patch-package"
33
+ },
34
+ "dependencies": {
35
+ "next": "16.0.1",
36
+ "react": "19.2.0",
37
+ "react-dom": "19.2.0",
38
+ "@refinedev/cli": "2.16.50",
39
+ "@refinedev/core": "5.0.5",
40
+ "@refinedev/nextjs-router": "7.0.4",
41
+ "@refinedev/react-table": "6.0.1",
42
+ "@refinedev/react-hook-form": "5.0.2",
43
+ "recharts": "3.3.0",
44
+ "react-hook-form": "7.66.0",
45
+ "zod": "4.1.12",
46
+ "@hookform/resolvers": "5.2.2",
47
+ "lucide-react": "0.553.0",
48
+ "class-variance-authority": "0.7.1",
49
+ "clsx": "2.1.1",
50
+ "tailwind-merge": "3.3.1",
51
+ "tailwindcss": "4.1.17",
52
+ "@tailwindcss/postcss": "4.1.17",
53
+ "@sentry/nextjs": "10.23.0",
54
+ "@vercel/analytics": "1.5.0"
55
+ },
56
+ "devDependencies": {
57
+ "typescript": "5.9.3",
58
+ "@types/node": "20.19.24",
59
+ "@types/react": "19.2.2",
60
+ "@types/react-dom": "19.2.2",
61
+ "eslint": "9.39.1",
62
+ "eslint-config-next": "16.0.1",
63
+ "@typescript-eslint/parser": "8.46.3",
64
+ "@typescript-eslint/eslint-plugin": "8.46.3",
65
+ "prettier": "3.6.2",
66
+ "jest": "30.2.0",
67
+ "@types/jest": "30.0.0",
68
+ "ts-jest": "29.4.5",
69
+ "jest-environment-jsdom": "30.2.0",
70
+ "@testing-library/react": "16.3.0",
71
+ "@testing-library/jest-dom": "6.9.1",
72
+ "husky": "9.1.7",
73
+ "lint-staged": "16.2.6",
74
+ "jscpd": "4.0.5",
75
+ "ts-prune": "0.10.3",
76
+ "type-coverage": "2.29.7",
77
+ "@stryker-mutator/core": "9.3.0",
78
+ "@stryker-mutator/jest-runner": "9.3.0",
79
+ "@playwright/test": "1.56.1",
80
+ "playwright": "1.56.1",
81
+ "@axe-core/playwright": "4.11.0",
82
+ "eslint-plugin-jest-dom": "5.5.0",
83
+ "eslint-plugin-testing-library": "7.13.3",
84
+ "patch-package": "8.0.1",
85
+ "@next/bundle-analyzer": "16.0.1",
86
+ "@lhci/cli": "0.15.1",
87
+ "dotenv-cli": "11.0.0"
88
+ }
89
+ }
@@ -0,0 +1,26 @@
1
+ import * as Sentry from "@sentry/nextjs";
2
+
3
+ Sentry.init({
4
+ dsn: process.env.NEXT_PUBLIC_SENTRY_DSN,
5
+
6
+ // Adjust this value in production, or use tracesSampler for greater control
7
+ tracesSampleRate: 1,
8
+
9
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
10
+ debug: false,
11
+
12
+ replaysOnErrorSampleRate: 1.0,
13
+
14
+ // This sets the sample rate to be 10%. You may want this to be 100% while
15
+ // in development and sample at a lower rate in production
16
+ replaysSessionSampleRate: 0.1,
17
+
18
+ // You can remove this option if you're not planning to use the Sentry Session Replay feature:
19
+ integrations: [
20
+ Sentry.replayIntegration({
21
+ // Additional Replay configuration goes in here, for example:
22
+ maskAllText: true,
23
+ blockAllMedia: true,
24
+ }),
25
+ ],
26
+ });
@@ -0,0 +1,11 @@
1
+ import * as Sentry from "@sentry/nextjs";
2
+
3
+ Sentry.init({
4
+ dsn: process.env.SENTRY_DSN,
5
+
6
+ // Adjust this value in production, or use tracesSampler for greater control
7
+ tracesSampleRate: 1,
8
+
9
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
10
+ debug: false,
11
+ });
@@ -0,0 +1,11 @@
1
+ import * as Sentry from "@sentry/nextjs";
2
+
3
+ Sentry.init({
4
+ dsn: process.env.SENTRY_DSN,
5
+
6
+ // Adjust this value in production, or use tracesSampler for greater control
7
+ tracesSampleRate: 1,
8
+
9
+ // Setting this option to true will print useful information to the console while you're setting up Sentry.
10
+ debug: false,
11
+ });
@@ -0,0 +1,500 @@
1
+ # Deployment: [Name]
2
+
3
+ <!--
4
+ TEMPLATE INSTRUCTIONS:
5
+ - Replace [Name] with a descriptive name for this deployment
6
+ - Fill out all deployment procedures with specific commands
7
+ - Include rollback procedures and smoke tests
8
+ - Document all environment configuration
9
+ - Test the deployment in staging before production
10
+ - Remove these instructions before finalizing the spec
11
+ -->
12
+
13
+ ## Deployment Scope
14
+
15
+ <!-- Define what is being deployed and to which environment -->
16
+
17
+ Define what is being deployed and to which environment.
18
+
19
+ **Example:**
20
+ > Deploy the Order Processing API v2.5.0 to production. This release includes performance improvements, bug fixes for payment processing, and new inventory integration features. Zero-downtime deployment using blue-green strategy.
21
+
22
+ **Application/Service:**
23
+ - Name: order-processing-api
24
+ - Version: 2.5.0
25
+ - Repository: https://github.com/company/order-api
26
+ - Branch/Tag: `v2.5.0` (tagged release)
27
+ - Build: `#1234` (CI/CD build number)
28
+ - Docker Image: `order-api:2.5.0-abc123`
29
+
30
+ **Target Environment:**
31
+ - Environment: Production
32
+ - Cloud Provider: AWS
33
+ - Region/Zone: us-east-1 (primary), us-west-2 (replica)
34
+ - Cluster/Namespace: `production/order-api`
35
+ - Load Balancer: ALB `order-api-prod`
36
+ - Deployment Strategy: Blue-Green (zero downtime)
37
+
38
+ **Scope of Changes:**
39
+ - Backend API code changes (15 files modified)
40
+ - Database migration: Add `order_metadata` column
41
+ - Configuration updates: New Stripe API key
42
+ - Infrastructure: No changes (existing resources)
43
+
44
+ ## Deployment Procedure
45
+
46
+ <!-- Detailed step-by-step deployment instructions with specific commands -->
47
+
48
+ ### Pre-Deployment Checklist
49
+
50
+ <!-- All items must be checked before deployment can proceed -->
51
+
52
+ - [ ] All integration tests passed in CI/CD (Build #1234: ✓ PASSED)
53
+ - [ ] Security scans passed (0 critical, 0 high vulnerabilities)
54
+ - [ ] Code review approved by 2+ engineers
55
+ - [ ] Product owner approved release notes
56
+ - [ ] Database migration tested in staging
57
+ - [ ] Rollback procedure documented and tested
58
+ - [ ] Deployment window scheduled (maintenance window if needed)
59
+ - [ ] Team notified via Slack #deployments channel
60
+ - [ ] On-call engineer identified and available
61
+ - [ ] Monitoring dashboards ready (DataDog, Grafana)
62
+ - [ ] Feature flags configured (if applicable)
63
+ - [ ] Backup of current production state completed
64
+
65
+ **Pre-Deployment Commands:**
66
+ ```bash
67
+ # 1. Verify staging deployment successful
68
+ curl https://staging-api.example.com/health
69
+ # Expected: {"status": "healthy", "version": "2.5.0"}
70
+
71
+ # 2. Backup production database
72
+ pg_dump -h prod-db.example.com -U admin -d orders > backup_$(date +%Y%m%d_%H%M%S).sql
73
+
74
+ # 3. Verify backup integrity
75
+ pg_restore --list backup_*.sql | wc -l
76
+ # Expected: > 100 (tables and data)
77
+
78
+ # 4. Tag deployment in monitoring
79
+ curl -X POST https://api.datadoghq.com/api/v1/events \
80
+ -H "DD-API-KEY: ${DD_API_KEY}" \
81
+ -d '{"title":"Deployment Start","text":"v2.5.0 deployment to production starting"}'
82
+ ```
83
+
84
+ ### Deployment Steps
85
+
86
+ <!-- Execute these steps in order during the deployment window -->
87
+
88
+ **Step 1: Prepare New Version (Blue Environment)**
89
+ ```bash
90
+ # Pull latest Docker image
91
+ docker pull order-api:2.5.0-abc123
92
+
93
+ # Verify image integrity
94
+ docker inspect order-api:2.5.0-abc123 | grep Created
95
+ ```
96
+
97
+ **Step 2: Run Database Migrations**
98
+ ```bash
99
+ # Connect to production database (read-write connection)
100
+ psql postgresql://admin:${DB_PASSWORD}@prod-db.example.com:5432/orders
101
+
102
+ # Run migration (idempotent, safe to re-run)
103
+ \i migrations/025_add_order_metadata.sql
104
+
105
+ # Verify migration
106
+ SELECT column_name FROM information_schema.columns
107
+ WHERE table_name = 'orders' AND column_name = 'order_metadata';
108
+ # Expected: order_metadata
109
+
110
+ # Check row count (should not change)
111
+ SELECT COUNT(*) FROM orders;
112
+ # Expected: same as before migration
113
+ ```
114
+
115
+ **Step 3: Deploy to Blue Environment**
116
+ ```bash
117
+ # Update ECS task definition with new image
118
+ aws ecs register-task-definition \
119
+ --cli-input-json file://task-definition-v2.5.0.json
120
+
121
+ # Update service to use new task definition (Blue environment)
122
+ aws ecs update-service \
123
+ --cluster production \
124
+ --service order-api-blue \
125
+ --task-definition order-api:42 \
126
+ --desired-count 3
127
+
128
+ # Wait for deployment to complete (5-10 minutes)
129
+ aws ecs wait services-stable \
130
+ --cluster production \
131
+ --services order-api-blue
132
+ ```
133
+
134
+ **Step 4: Run Smoke Tests on Blue**
135
+ ```bash
136
+ # Execute smoke test suite against blue environment
137
+ npm run smoke-test -- --url https://blue.order-api.internal
138
+
139
+ # Expected output:
140
+ # ✓ Health check passed
141
+ # ✓ Create order endpoint working
142
+ # ✓ Payment processing functional
143
+ # ✓ Database connectivity verified
144
+ # All smoke tests passed (4/4)
145
+ ```
146
+
147
+ **Step 5: Switch Traffic (Blue-Green Cutover)**
148
+ ```bash
149
+ # Update load balancer to route traffic to Blue
150
+ aws elbv2 modify-rule \
151
+ --rule-arn arn:aws:elasticloadbalancing:us-east-1:123456:rule/abc123 \
152
+ --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup/order-api-blue
153
+
154
+ # Monitor traffic switch (gradual if using weighted routing)
155
+ watch -n 5 'aws elbv2 describe-target-health \
156
+ --target-group-arn arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup/order-api-blue'
157
+ ```
158
+
159
+ **Step 6: Monitor New Version**
160
+ ```bash
161
+ # Watch error rate in real-time (should stay < 1%)
162
+ watch -n 10 'curl -s "https://api.datadoghq.com/api/v1/query?query=sum:api.errors{service:order-api}.as_rate()" -H "DD-API-KEY: ${DD_API_KEY}"'
163
+
164
+ # Watch response time (p95 should be < 500ms)
165
+ watch -n 10 'curl -s "https://api.datadoghq.com/api/v1/query?query=p95:api.response_time{service:order-api}" -H "DD-API-KEY: ${DD_API_KEY}"'
166
+
167
+ # Check application logs
168
+ kubectl logs -n production -l app=order-api --tail=100 -f
169
+ ```
170
+
171
+ ### Post-Deployment Steps
172
+
173
+ <!-- Verify deployment success and complete deployment tasks -->
174
+
175
+ - [ ] Smoke tests passed on production (all 4 tests green)
176
+ - [ ] Error rate < 1% for 15 minutes post-deployment
177
+ - [ ] Response time p95 < 500ms (no regression)
178
+ - [ ] Database queries performing well (no slow query alerts)
179
+ - [ ] Critical user flows verified:
180
+ - [ ] Place order and complete payment
181
+ - [ ] View order history
182
+ - [ ] Cancel order
183
+ - [ ] Monitoring dashboards show healthy metrics
184
+ - [ ] No alerts fired in past 15 minutes
185
+ - [ ] Application logs show no errors
186
+ - [ ] Team notified of successful deployment
187
+ - [ ] Deployment documented in changelog
188
+ - [ ] Old version (Green) scaled down after 1 hour soak time
189
+
190
+ **Post-Deployment Commands:**
191
+ ```bash
192
+ # Tag successful deployment in monitoring
193
+ curl -X POST https://api.datadoghq.com/api/v1/events \
194
+ -H "DD-API-KEY: ${DD_API_KEY}" \
195
+ -d '{"title":"Deployment Complete","text":"v2.5.0 deployed successfully to production","tags":["deployment:success","version:2.5.0"]}'
196
+
197
+ # Scale down old version (Green) after soak period
198
+ aws ecs update-service \
199
+ --cluster production \
200
+ --service order-api-green \
201
+ --desired-count 0
202
+ ```
203
+
204
+ ## Environment Configuration
205
+
206
+ <!-- Document all environment variables, secrets, and infrastructure dependencies -->
207
+
208
+ **Required Environment Variables:**
209
+ ```bash
210
+ # Database
211
+ DATABASE_URL=postgresql://app_user:${DB_PASSWORD}@prod-db.example.com:5432/orders
212
+ DATABASE_POOL_SIZE=20
213
+ DATABASE_TIMEOUT=30000
214
+
215
+ # Cache
216
+ REDIS_URL=redis://:${REDIS_PASSWORD}@prod-redis.example.com:6379/0
217
+ REDIS_POOL_SIZE=10
218
+
219
+ # External APIs
220
+ STRIPE_API_KEY=${STRIPE_PROD_API_KEY}
221
+ STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
222
+
223
+ # Application
224
+ NODE_ENV=production
225
+ PORT=8080
226
+ LOG_LEVEL=info
227
+ LOG_FORMAT=json
228
+
229
+ # Feature Flags
230
+ FEATURE_NEW_INVENTORY=true
231
+ FEATURE_PAYMENT_V2=true
232
+
233
+ # Monitoring
234
+ DATADOG_API_KEY=${DD_API_KEY}
235
+ DATADOG_SERVICE_NAME=order-api
236
+ DATADOG_ENV=production
237
+ ```
238
+
239
+ **Required Secrets (stored in AWS Secrets Manager):**
240
+ - `prod/order-api/db-password` - Database password
241
+ - `prod/order-api/redis-password` - Redis password
242
+ - `prod/order-api/stripe-api-key` - Stripe production API key
243
+ - `prod/order-api/stripe-webhook-secret` - Stripe webhook signing secret
244
+ - `prod/order-api/datadog-api-key` - DataDog API key
245
+
246
+ **Secrets Rotation Policy:**
247
+ - Database password: Rotate every 90 days
248
+ - API keys: Rotate every 180 days
249
+ - Webhook secrets: Rotate on compromise only
250
+
251
+ **Infrastructure Dependencies:**
252
+ - Database: PostgreSQL 14.2 (RDS instance: `prod-orders-db.cqx7.us-east-1.rds.amazonaws.com`)
253
+ - Cache: Redis 7.0 (ElastiCache cluster: `prod-orders-cache`)
254
+ - Load Balancer: ALB `order-api-prod` (arn:aws:elasticloadbalancing:...)
255
+ - CDN: CloudFront distribution `E1234ABCD` (for static assets)
256
+ - DNS: Route53 hosted zone `example.com`
257
+ - Monitoring: DataDog agent v7.40+
258
+ - Logging: CloudWatch Logs group `/aws/ecs/order-api`
259
+
260
+ **Resource Limits:**
261
+ - CPU: 2 vCPU per task
262
+ - Memory: 4 GB per task
263
+ - Disk: 20 GB ephemeral storage
264
+ - Network: 1 Gbps
265
+
266
+ ## Rollback Procedure
267
+
268
+ <!-- Detailed procedure for rolling back if deployment fails -->
269
+
270
+ ### Rollback Triggers
271
+
272
+ **Automatic Rollback (if enabled):**
273
+ - Smoke tests fail (any test fails)
274
+ - Error rate exceeds 5% for 5 consecutive minutes
275
+ - Response time p95 > 1000ms for 5 minutes
276
+ - Health check failures > 50% of instances
277
+
278
+ **Manual Rollback Decision:**
279
+ - Critical bug discovered in production
280
+ - Data corruption detected
281
+ - Performance degradation > 50%
282
+ - Security vulnerability discovered
283
+ - Customer-facing feature broken
284
+
285
+ ### Rollback Steps
286
+
287
+ **IMPORTANT: Rollback must be executed within 30 minutes of deployment**
288
+
289
+ **Step 1: Stop New Deployments**
290
+ ```bash
291
+ # Pause auto-scaling to prevent new tasks
292
+ aws application-autoscaling register-scalable-target \
293
+ --service-namespace ecs \
294
+ --resource-id service/production/order-api-blue \
295
+ --scalable-dimension ecs:service:DesiredCount \
296
+ --suspended-state DynamicScalingInSuspended=true,DynamicScalingOutSuspended=true
297
+ ```
298
+
299
+ **Step 2: Switch Traffic Back to Green (Previous Version)**
300
+ ```bash
301
+ # Immediate cutover back to old version
302
+ aws elbv2 modify-rule \
303
+ --rule-arn arn:aws:elasticloadbalancing:us-east-1:123456:rule/abc123 \
304
+ --actions Type=forward,TargetGroupArn=arn:aws:elasticloadbalancing:us-east-1:123456:targetgroup/order-api-green
305
+
306
+ # Verify traffic switched
307
+ curl https://api.example.com/health
308
+ # Expected: {"status": "healthy", "version": "2.4.0"} (old version)
309
+ ```
310
+
311
+ **Step 3: Rollback Database Migration (if needed)**
312
+ ```bash
313
+ # ONLY if migration caused issues
314
+ psql postgresql://admin:${DB_PASSWORD}@prod-db.example.com:5432/orders
315
+
316
+ # Run rollback migration
317
+ \i migrations/025_add_order_metadata_rollback.sql
318
+
319
+ # Verify rollback
320
+ SELECT column_name FROM information_schema.columns
321
+ WHERE table_name = 'orders' AND column_name = 'order_metadata';
322
+ # Expected: (empty) - column removed
323
+ ```
324
+
325
+ **Step 4: Scale Down Failed Version**
326
+ ```bash
327
+ # Stop Blue environment (failed version)
328
+ aws ecs update-service \
329
+ --cluster production \
330
+ --service order-api-blue \
331
+ --desired-count 0
332
+ ```
333
+
334
+ **Step 5: Verify Rollback Success**
335
+ ```bash
336
+ # Run smoke tests against rolled-back version
337
+ npm run smoke-test -- --url https://api.example.com
338
+
339
+ # Check error rate (should drop to normal < 1%)
340
+ # Check response times (should return to baseline)
341
+ # Verify critical user flows working
342
+ ```
343
+
344
+ **Step 6: Post-Rollback Actions**
345
+ - [ ] Notify team of rollback via Slack
346
+ - [ ] Create incident post-mortem
347
+ - [ ] Document root cause
348
+ - [ ] Create bug fix work item
349
+ - [ ] Schedule fix deployment
350
+
351
+ ### Rollback Time Estimate
352
+ - Traffic switch: < 1 minute
353
+ - Full rollback (with DB): < 5 minutes
354
+ - Verification: < 10 minutes
355
+ - **Total rollback time: < 15 minutes**
356
+
357
+ ## Smoke Tests
358
+
359
+ <!-- Critical tests that must pass for deployment to be considered successful -->
360
+
361
+ ### Test 1: Health Check
362
+ ```bash
363
+ curl https://api.example.com/health
364
+ # Expected: {"status": "healthy", "version": "2.5.0", "database": "connected"}
365
+ # Pass criteria: HTTP 200, status = healthy
366
+ ```
367
+
368
+ ### Test 2: Create Order (End-to-End)
369
+ ```bash
370
+ curl -X POST https://api.example.com/api/orders \
371
+ -H "Authorization: Bearer ${TEST_TOKEN}" \
372
+ -H "Content-Type: application/json" \
373
+ -d '{
374
+ "customer_id": "test_customer_123",
375
+ "items": [{"product_id": "prod_456", "quantity": 1}],
376
+ "payment_method": "card",
377
+ "card_token": "tok_visa_test"
378
+ }'
379
+ # Expected: HTTP 201, order_id returned, status = completed
380
+ # Pass criteria: Order created, payment processed, inventory reserved
381
+ ```
382
+
383
+ ### Test 3: Retrieve Order
384
+ ```bash
385
+ curl https://api.example.com/api/orders/test_order_123 \
386
+ -H "Authorization: Bearer ${TEST_TOKEN}"
387
+ # Expected: HTTP 200, order details returned
388
+ # Pass criteria: Order data matches expected structure
389
+ ```
390
+
391
+ ### Test 4: Database Connectivity
392
+ ```bash
393
+ curl https://api.example.com/api/internal/db-check \
394
+ -H "X-Internal-Token: ${INTERNAL_TOKEN}"
395
+ # Expected: {"database": "connected", "latency_ms": < 50}
396
+ # Pass criteria: Database reachable, latency < 100ms
397
+ ```
398
+
399
+ ### Smoke Test Execution
400
+ ```bash
401
+ # Automated smoke test suite
402
+ npm run smoke-test -- \
403
+ --url https://api.example.com \
404
+ --token ${TEST_TOKEN} \
405
+ --timeout 30000 \
406
+ --retries 3
407
+
408
+ # Expected output:
409
+ # ✓ Health check passed (45ms)
410
+ # ✓ Create order passed (234ms)
411
+ # ✓ Retrieve order passed (12ms)
412
+ # ✓ Database connectivity passed (8ms)
413
+ #
414
+ # All smoke tests passed (4/4)
415
+ # Total time: 299ms
416
+ ```
417
+
418
+ ## Monitoring & Alerting
419
+
420
+ <!-- Key metrics to monitor during and after deployment -->
421
+
422
+ **Dashboard:** https://app.datadoghq.com/dashboard/order-api-production
423
+
424
+ **Key Metrics:**
425
+ - Error rate (target: < 1%, alert: > 5%)
426
+ - Response time p95 (target: < 500ms, alert: > 1000ms)
427
+ - Throughput (baseline: 100 req/min, alert: < 50 req/min)
428
+ - Database connection pool (target: < 80%, alert: > 90%)
429
+ - Memory usage (target: < 80%, alert: > 90%)
430
+ - CPU usage (target: < 70%, alert: > 85%)
431
+
432
+ **Alerts:**
433
+ - High error rate: > 5% for 5 minutes → Page on-call
434
+ - Slow responses: p95 > 1000ms for 5 minutes → Slack alert
435
+ - Health check failures: > 50% instances → Page on-call
436
+ - Database connection exhaustion: > 90% → Page on-call
437
+
438
+ **Log Queries:**
439
+ ```bash
440
+ # View recent errors
441
+ aws logs tail /aws/ecs/order-api --follow --filter-pattern "ERROR"
442
+
443
+ # View deployment-related logs
444
+ aws logs tail /aws/ecs/order-api --follow --filter-pattern "deployment" --since 30m
445
+ ```
446
+
447
+ ## Acceptance Criteria
448
+
449
+ <!-- Deployment is considered successful when these criteria are met -->
450
+
451
+ - [ ] All pre-deployment checks passed
452
+ - [ ] Database migration completed successfully (column added)
453
+ - [ ] Blue environment deployed and stable (3 tasks running)
454
+ - [ ] All smoke tests passed (4/4 tests green)
455
+ - [ ] Traffic switched to new version (Blue)
456
+ - [ ] Error rate < 1% for 30 minutes post-deployment
457
+ - [ ] Response time p95 < 500ms (no regression)
458
+ - [ ] No critical alerts fired
459
+ - [ ] Critical user flows verified manually
460
+ - [ ] Old version (Green) scaled down after 1 hour soak period
461
+ - [ ] Deployment documented and team notified
462
+ - [ ] Rollback procedure tested and ready if needed
463
+
464
+ ## Post-Deployment Monitoring Period
465
+
466
+ **Soak Time:** 1 hour (monitor new version before scaling down old)
467
+
468
+ **Monitoring checklist (during soak time):**
469
+ - [ ] 0-15 min: Watch error rate and response time closely
470
+ - [ ] 15-30 min: Verify no alerts, check logs for warnings
471
+ - [ ] 30-45 min: Verify database performance, check slow queries
472
+ - [ ] 45-60 min: Final check of all metrics, prepare to scale down old version
473
+
474
+ **If issues detected during soak time:**
475
+ 1. Evaluate severity (critical vs minor)
476
+ 2. Decide: rollback vs hotfix vs acceptable
477
+ 3. If rollback: execute rollback procedure
478
+ 4. If hotfix: create urgent fix and deploy
479
+ 5. If acceptable: document issue and create follow-up work item
480
+
481
+ ## Dependencies
482
+
483
+ <!-- Other work items or infrastructure that must be in place -->
484
+
485
+ - `feature_payment_v2` (must be completed - provides new Stripe integration)
486
+ - `integration_test_order_flow` (must pass - validates end-to-end flow)
487
+ - Infrastructure: ALB target groups for blue-green deployment (must exist)
488
+ - Database migration 024 (must be applied - adds required indexes)
489
+
490
+ ## Estimated Effort
491
+
492
+ 1 session (includes deployment, monitoring, and verification)
493
+
494
+ <!--
495
+ Breakdown:
496
+ - Pre-deployment prep: 0.25 sessions
497
+ - Deployment execution: 0.25 sessions
498
+ - Smoke testing: 0.25 sessions
499
+ - Post-deployment monitoring (1 hour soak): 0.25 sessions
500
+ -->