nene2-python 1.8.3__tar.gz → 1.8.5__tar.gz

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 (231) hide show
  1. {nene2_python-1.8.3 → nene2_python-1.8.5}/CHANGELOG.md +26 -0
  2. {nene2_python-1.8.3 → nene2_python-1.8.5}/PKG-INFO +1 -1
  3. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-33.md +111 -0
  4. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-34.md +119 -0
  5. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-35.md +90 -0
  6. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-36.md +92 -0
  7. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-37.md +77 -0
  8. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-38.md +85 -0
  9. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-39.md +95 -0
  10. nene2_python-1.8.5/docs/field-trials/2026-05-field-trial-40.md +87 -0
  11. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/how-to/configure-auth.md +49 -2
  12. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/how-to/run-tests.md +17 -0
  13. nene2_python-1.8.5/docs/how-to/validation.md +101 -0
  14. {nene2_python-1.8.3 → nene2_python-1.8.5}/pyproject.toml +1 -1
  15. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/http/__init__.py +9 -1
  16. nene2_python-1.8.5/src/nene2/http/health.py +106 -0
  17. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/request_size_limit.py +25 -9
  18. nene2_python-1.8.5/tests/nene2/http/test_health.py +139 -0
  19. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/test_request_size_limit.py +39 -0
  20. {nene2_python-1.8.3 → nene2_python-1.8.5}/uv.lock +1 -1
  21. nene2_python-1.8.3/src/nene2/http/health.py +0 -52
  22. nene2_python-1.8.3/tests/nene2/http/test_health.py +0 -66
  23. {nene2_python-1.8.3 → nene2_python-1.8.5}/.env.example +0 -0
  24. {nene2_python-1.8.3 → nene2_python-1.8.5}/.github/workflows/ci.yml +0 -0
  25. {nene2_python-1.8.3 → nene2_python-1.8.5}/.github/workflows/docs.yml +0 -0
  26. {nene2_python-1.8.3 → nene2_python-1.8.5}/.github/workflows/publish.yml +0 -0
  27. {nene2_python-1.8.3 → nene2_python-1.8.5}/.gitignore +0 -0
  28. {nene2_python-1.8.3 → nene2_python-1.8.5}/.vitepress/config.mts +0 -0
  29. {nene2_python-1.8.3 → nene2_python-1.8.5}/.vitepress/theme/custom.css +0 -0
  30. {nene2_python-1.8.3 → nene2_python-1.8.5}/.vitepress/theme/index.ts +0 -0
  31. {nene2_python-1.8.3 → nene2_python-1.8.5}/AGENTS.md +0 -0
  32. {nene2_python-1.8.3 → nene2_python-1.8.5}/CLAUDE.md +0 -0
  33. {nene2_python-1.8.3 → nene2_python-1.8.5}/Dockerfile +0 -0
  34. {nene2_python-1.8.3 → nene2_python-1.8.5}/LICENSE +0 -0
  35. {nene2_python-1.8.3 → nene2_python-1.8.5}/README.md +0 -0
  36. {nene2_python-1.8.3 → nene2_python-1.8.5}/alembic/README +0 -0
  37. {nene2_python-1.8.3 → nene2_python-1.8.5}/alembic/env.py +0 -0
  38. {nene2_python-1.8.3 → nene2_python-1.8.5}/alembic/script.py.mako +0 -0
  39. {nene2_python-1.8.3 → nene2_python-1.8.5}/alembic/versions/001_create_notes_and_tags_tables.py +0 -0
  40. {nene2_python-1.8.3 → nene2_python-1.8.5}/alembic.ini +0 -0
  41. {nene2_python-1.8.3 → nene2_python-1.8.5}/compose.yaml +0 -0
  42. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0001-toolchain.md +0 -0
  43. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0002-clean-architecture.md +0 -0
  44. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0003-security-first.md +0 -0
  45. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0004-ai-first-design.md +0 -0
  46. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0005-logging.md +0 -0
  47. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0006-rate-limiting.md +0 -0
  48. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0009-mcp-design.md +0 -0
  49. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0010-async-use-case.md +0 -0
  50. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/adr/0011-mcp-as-core-dependency.md +0 -0
  51. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/de/index.md +0 -0
  52. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/de/tutorials/getting-started.md +0 -0
  53. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/explanation/architecture.md +0 -0
  54. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/explanation/design-philosophy.md +0 -0
  55. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-1.md +0 -0
  56. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-10.md +0 -0
  57. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-11.md +0 -0
  58. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-12.md +0 -0
  59. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-13.md +0 -0
  60. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-14.md +0 -0
  61. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-15.md +0 -0
  62. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-16.md +0 -0
  63. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-17.md +0 -0
  64. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-18.md +0 -0
  65. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-19.md +0 -0
  66. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-2.md +0 -0
  67. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-20.md +0 -0
  68. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-21.md +0 -0
  69. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-22.md +0 -0
  70. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-23.md +0 -0
  71. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-24.md +0 -0
  72. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-25.md +0 -0
  73. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-26.md +0 -0
  74. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-27.md +0 -0
  75. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-28.md +0 -0
  76. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-29.md +0 -0
  77. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-3.md +0 -0
  78. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-30.md +0 -0
  79. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-31.md +0 -0
  80. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-32.md +0 -0
  81. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-4.md +0 -0
  82. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-5.md +0 -0
  83. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-6.md +0 -0
  84. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-7.md +0 -0
  85. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-8.md +0 -0
  86. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/field-trials/2026-05-field-trial-9.md +0 -0
  87. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/fr/index.md +0 -0
  88. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/fr/tutorials/getting-started.md +0 -0
  89. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/how-to/add-new-domain.md +0 -0
  90. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/how-to/async-use-case.md +0 -0
  91. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/how-to/new-project.md +0 -0
  92. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/how-to/problem-details.md +0 -0
  93. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/how-to/sqlalchemy-repository.md +0 -0
  94. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/howto/mcp-setup.md +0 -0
  95. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/index.md +0 -0
  96. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/explanation/architecture.md +0 -0
  97. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/explanation/design-philosophy.md +0 -0
  98. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/how-to/add-new-domain.md +0 -0
  99. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/how-to/configure-auth.md +0 -0
  100. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/how-to/new-project.md +0 -0
  101. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/how-to/run-tests.md +0 -0
  102. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/how-to/sqlalchemy-repository.md +0 -0
  103. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/howto/mcp-setup.md +0 -0
  104. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/index.md +0 -0
  105. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/reference/api.md +0 -0
  106. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/reference/configuration.md +0 -0
  107. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/reference/framework-modules.md +0 -0
  108. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/tutorials/first-domain.md +0 -0
  109. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/ja/tutorials/getting-started.md +0 -0
  110. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/pt-br/index.md +0 -0
  111. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/pt-br/tutorials/getting-started.md +0 -0
  112. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/reference/api.md +0 -0
  113. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/reference/configuration.md +0 -0
  114. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/reference/framework-modules.md +0 -0
  115. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/roadmap.md +0 -0
  116. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/todo/current.md +0 -0
  117. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/tutorials/first-domain.md +0 -0
  118. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/tutorials/getting-started.md +0 -0
  119. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/zh/index.md +0 -0
  120. {nene2_python-1.8.3 → nene2_python-1.8.5}/docs/zh/tutorials/getting-started.md +0 -0
  121. {nene2_python-1.8.3 → nene2_python-1.8.5}/package-lock.json +0 -0
  122. {nene2_python-1.8.3 → nene2_python-1.8.5}/package.json +0 -0
  123. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/__init__.py +0 -0
  124. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/__main__.py +0 -0
  125. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/app.py +0 -0
  126. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/comment/__init__.py +0 -0
  127. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/comment/entity.py +0 -0
  128. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/comment/exceptions.py +0 -0
  129. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/comment/handler.py +0 -0
  130. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/comment/repository.py +0 -0
  131. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/comment/sqlalchemy_repository.py +0 -0
  132. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/comment/use_case.py +0 -0
  133. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/mcp.py +0 -0
  134. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/__init__.py +0 -0
  135. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/async_use_case.py +0 -0
  136. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/entity.py +0 -0
  137. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/exceptions.py +0 -0
  138. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/handler.py +0 -0
  139. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/repository.py +0 -0
  140. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/sqlalchemy_repository.py +0 -0
  141. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/note/use_case.py +0 -0
  142. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/schema.py +0 -0
  143. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/tag/__init__.py +0 -0
  144. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/tag/entity.py +0 -0
  145. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/tag/exceptions.py +0 -0
  146. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/tag/handler.py +0 -0
  147. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/tag/repository.py +0 -0
  148. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/tag/sqlalchemy_repository.py +0 -0
  149. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/example/tag/use_case.py +0 -0
  150. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/__init__.py +0 -0
  151. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/auth/__init__.py +0 -0
  152. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/auth/api_key.py +0 -0
  153. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/auth/bearer_token.py +0 -0
  154. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/auth/exceptions.py +0 -0
  155. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/auth/interfaces.py +0 -0
  156. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/auth/local_verifier.py +0 -0
  157. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/config/__init__.py +0 -0
  158. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/config/settings.py +0 -0
  159. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/database/__init__.py +0 -0
  160. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/database/exceptions.py +0 -0
  161. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/database/health.py +0 -0
  162. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/database/interfaces.py +0 -0
  163. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/database/sqlalchemy_executor.py +0 -0
  164. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/database/utils.py +0 -0
  165. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/http/pagination.py +0 -0
  166. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/http/problem_details.py +0 -0
  167. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/log/__init__.py +0 -0
  168. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/log/setup.py +0 -0
  169. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/mcp/__init__.py +0 -0
  170. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/mcp/http_client.py +0 -0
  171. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/mcp/server.py +0 -0
  172. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/__init__.py +0 -0
  173. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/domain_exception.py +0 -0
  174. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/error_handler.py +0 -0
  175. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/request_id.py +0 -0
  176. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/request_logging.py +0 -0
  177. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/security_headers.py +0 -0
  178. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/middleware/throttle.py +0 -0
  179. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/py.typed +0 -0
  180. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/use_case/__init__.py +0 -0
  181. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/use_case/protocols.py +0 -0
  182. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/validation/__init__.py +0 -0
  183. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/nene2/validation/exceptions.py +0 -0
  184. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/scripts/__init__.py +0 -0
  185. {nene2_python-1.8.3 → nene2_python-1.8.5}/src/scripts/export_openapi.py +0 -0
  186. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/__init__.py +0 -0
  187. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/__init__.py +0 -0
  188. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/comment/__init__.py +0 -0
  189. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/comment/test_comment_http.py +0 -0
  190. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/comment/test_comment_repository.py +0 -0
  191. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/comment/test_comment_use_case.py +0 -0
  192. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/conftest.py +0 -0
  193. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/note/__init__.py +0 -0
  194. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/note/test_async_note_use_case.py +0 -0
  195. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/note/test_list_notes.py +0 -0
  196. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/note/test_note_repository.py +0 -0
  197. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/tag/__init__.py +0 -0
  198. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/tag/test_tag_repository.py +0 -0
  199. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/tag/test_tags.py +0 -0
  200. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/test_cors.py +0 -0
  201. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/example/test_mcp.py +0 -0
  202. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/__init__.py +0 -0
  203. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/auth/__init__.py +0 -0
  204. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/auth/test_api_key.py +0 -0
  205. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/auth/test_bearer_token.py +0 -0
  206. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/auth/test_token_issuer.py +0 -0
  207. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/config/__init__.py +0 -0
  208. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/config/test_settings.py +0 -0
  209. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/database/__init__.py +0 -0
  210. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/database/test_transaction.py +0 -0
  211. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/database/test_utils.py +0 -0
  212. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/http/__init__.py +0 -0
  213. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/http/test_pagination.py +0 -0
  214. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/http/test_problem_details.py +0 -0
  215. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/log/__init__.py +0 -0
  216. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/log/test_setup.py +0 -0
  217. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/mcp/__init__.py +0 -0
  218. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/mcp/test_http_client.py +0 -0
  219. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/__init__.py +0 -0
  220. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/test_error_handler.py +0 -0
  221. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/test_request_id.py +0 -0
  222. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/test_request_logging.py +0 -0
  223. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/test_security_headers.py +0 -0
  224. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/test_simple_domain_handler.py +0 -0
  225. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/middleware/test_throttle.py +0 -0
  226. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/use_case/__init__.py +0 -0
  227. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/use_case/test_protocols.py +0 -0
  228. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/validation/__init__.py +0 -0
  229. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/nene2/validation/test_exceptions.py +0 -0
  230. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/scripts/__init__.py +0 -0
  231. {nene2_python-1.8.3 → nene2_python-1.8.5}/tests/scripts/test_export_openapi.py +0 -0
@@ -5,6 +5,32 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
5
5
 
6
6
  ---
7
7
 
8
+ ## [1.8.5] — 2026-05-20
9
+
10
+ FT37〜FT40 フィールドトライアル — RequestSizeLimitMiddleware パスごとサイズ制限とドキュメント改善。
11
+
12
+ ### Added
13
+ - `RequestSizeLimitMiddleware` に `path_limits: dict[str, int] | None = None` パラメータを追加 — パスごとに異なるリクエストボディサイズ制限を設定可能に (FT39)
14
+ - Field trial reports: `docs/field-trials/2026-05-field-trial-37.md` 〜 `docs/field-trials/2026-05-field-trial-40.md`
15
+
16
+ ---
17
+
18
+ ## [1.8.4] — 2026-05-20
19
+
20
+ FT33〜FT36 フィールドトライアル — バリデーション・DB整合性・混合認証・非同期ヘルスチェック改善。
21
+
22
+ ### Added
23
+ - `AsyncHealthCheckProtocol` — `async def check() -> HealthStatus` の Protocol (FT36)
24
+ - `AsyncCompositeHealthCheck` — 複数の非同期ヘルスチェックを `asyncio.gather` で並列実行して集約するクラス (FT36)
25
+ - `docs/how-to/validation.md` — `ValidationCode(StrEnum)` パターンと複数フィールドバリデーションの how-to ガイドを追加 (FT33)
26
+ - Field trial reports: `docs/field-trials/2026-05-field-trial-33.md` 〜 `docs/field-trials/2026-05-field-trial-36.md`
27
+
28
+ ### Changed
29
+ - `docs/how-to/run-tests.md` — インメモリ SQLite テスト用 `StaticPool` パターンを追記 (FT34)
30
+ - `docs/how-to/configure-auth.md` — AND / OR 条件の違いと `EitherOrAuthMiddleware` パターンを追記 (FT35)
31
+
32
+ ---
33
+
8
34
  ## [1.8.3] — 2026-05-20
9
35
 
10
36
  FT31〜FT32 フィールドトライアル — HealthCheck・SecurityHeaders 改善。
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nene2-python
3
- Version: 1.8.3
3
+ Version: 1.8.5
4
4
  Summary: NENE2 Python — minimal API framework following NENE2's design philosophy
5
5
  Project-URL: Homepage, https://github.com/hideyukiMORI/nene2-python
6
6
  Project-URL: Repository, https://github.com/hideyukiMORI/nene2-python
@@ -0,0 +1,111 @@
1
+ # Field Trial 33: ValidationException カスタムエラーコード実運用検証
2
+
3
+ **日付**: 2026-05-20
4
+ **バージョン**: v1.8.3 時点
5
+ **テーマ**: `ValidationException` と `ValidationError.code` フィールドを活用した型安全なエラーコードの実運用パターン検証
6
+
7
+ ---
8
+
9
+ ## 概要
10
+
11
+ ユーザー登録 API を題材に、`ValidationCode(StrEnum)` パターンでドメイン固有のバリデーションコードを定義し、
12
+ `ValidationException` / `ValidationError` と組み合わせて複数フィールドの検証エラーをクライアントに返すフローを検証した。
13
+
14
+ ---
15
+
16
+ ## 実装内容
17
+
18
+ `/home/xi/docker/nene2-python-FT/ft33-validation-codes/` に以下を作成:
19
+
20
+ - **`app.py`** — `ValidationCode(StrEnum)` + `ValidationException` によるユーザー登録 API
21
+ - **`test_app.py`** — 正常系・各バリデーションエラー・複数エラー収集の動作テスト (5 件)
22
+ - **`test_friction.py`** — 摩擦点の確認テスト (3 件)
23
+
24
+ ```python
25
+ class ValidationCode(StrEnum):
26
+ REQUIRED = "required"
27
+ INVALID_FORMAT = "invalid_format"
28
+ TOO_SHORT = "too_short"
29
+ TOO_LONG = "too_long"
30
+ ALREADY_EXISTS = "already_exists"
31
+ OUT_OF_RANGE = "out_of_range"
32
+
33
+ def _validate_registration(body: RegisterBody) -> list[ValidationError]:
34
+ errors: list[ValidationError] = []
35
+ if len(body.username) < 3:
36
+ errors.append(ValidationError("username", "3文字以上必要です", ValidationCode.TOO_SHORT))
37
+ if "@" not in body.email:
38
+ errors.append(ValidationError("email", "有効なメールアドレスを入力してください", ValidationCode.INVALID_FORMAT))
39
+ if body.age < 0 or body.age > 150:
40
+ errors.append(ValidationError("age", "年齢は 0〜150 の範囲で入力してください", ValidationCode.OUT_OF_RANGE))
41
+ return errors
42
+ ```
43
+
44
+ **テスト結果**: 8 件全通過 ✅
45
+
46
+ ---
47
+
48
+ ## 摩擦点
49
+
50
+ ### FP33-1: フレームワークが標準エラーコードを定義していない
51
+
52
+ **分類**: 設計通り(摩擦なし)
53
+
54
+ `required` / `invalid_format` / `too_short` / `too_long` 等のよく使うコードを
55
+ フレームワーク側が `ValidationCode` として提供していない。
56
+ 各プロジェクトで自前定義が必要。
57
+
58
+ **判断**: ドメイン固有のコードはプロジェクトで定義するのが適切。フレームワークが網羅的に
59
+ 定義すると過剰な依存・名前衝突・拡張困難になる。`StrEnum` パターンを how-to ドキュメントに
60
+ 追記することで、新規プロジェクトの立ち上がりをサポートする。
61
+
62
+ **対応**: `docs/how-to/validation.md` への `StrEnum` パターン記載(ドキュメントのみ)
63
+
64
+ ---
65
+
66
+ ### FP33-2: `ValidationException.single()` の `code` パラメータにデフォルト値がない
67
+
68
+ **分類**: 既知の設計制約(摩擦なし)
69
+
70
+ `code` パラメータは必須。`"required"` 等よく使うコードでもデフォルト値なし。
71
+
72
+ **判断**: 明示的なコードが可読性・型安全性を高める設計上の意図。
73
+ デフォルト値をつけると「コードなし」での利用が増え、クライアント側でのエラーハンドリングが困難になる。
74
+ これは摩擦ではなく既知の制約として受け入れる。
75
+
76
+ ---
77
+
78
+ ### FP33-3: ネストフィールドのエラーパスに点記法ヘルパーがない
79
+
80
+ **分類**: 軽微な摩擦
81
+
82
+ `body.email` のようなネストパスを `ValidationError.field` に渡す際、正規化ヘルパーがない。
83
+ 任意文字列として渡すのみ。
84
+
85
+ ```python
86
+ error = ValidationError(field="address.city", message="必須です", code="required")
87
+ # 正規化なし — 任意の文字列を受け入れる
88
+ ```
89
+
90
+ **判断**: ネストパスの表現方法(ドット区切り・スラッシュ・配列表記)はプロジェクトにより異なるため、
91
+ フレームワーク側でヘルパーを提供するメリットは小さい。
92
+ ドキュメントでの推奨パターン(ドット区切り)記載で対応。
93
+
94
+ ---
95
+
96
+ ## 所感
97
+
98
+ `ValidationCode(StrEnum)` パターンは極めて自然に機能する。
99
+ `ValidationError` コンストラクタに `StrEnum` 値をそのまま渡せるため、型安全性と
100
+ JSON シリアライズ(文字列として出力)が同時に確保される。複数フィールドのエラー収集も
101
+ リストに積み上げるだけで直感的。
102
+
103
+ フレームワーク側で追加の変更は不要。how-to ドキュメントへの `StrEnum` パターン追記のみ対応する。
104
+
105
+ ---
106
+
107
+ ## 関連
108
+
109
+ - `nene2.validation.ValidationException`
110
+ - `nene2.validation.ValidationError`
111
+ - FT13 (ValidationException実運用, v1.6.0) の後継検証
@@ -0,0 +1,119 @@
1
+ # Field Trial 34: DatabaseIntegrityException + SimpleDomainHandler 実運用検証
2
+
3
+ **日付**: 2026-05-20
4
+ **バージョン**: v1.8.3 時点
5
+ **テーマ**: UNIQUE 制約違反 → `DatabaseIntegrityException` → `SimpleDomainHandler` → 409 Problem Details のパイプライン実運用検証
6
+
7
+ ---
8
+
9
+ ## 概要
10
+
11
+ SQLite UNIQUE 制約を持つ `users` テーブルに `SqlAlchemyQueryExecutor` でアクセスし、
12
+ 重複 username の登録が自動的に `DatabaseIntegrityException` へ変換され、
13
+ `SimpleDomainHandler` が 409 Conflict Problem Details を返す完全なパイプラインを検証した。
14
+
15
+ ---
16
+
17
+ ## 実装内容
18
+
19
+ `/home/xi/docker/nene2-python-FT/ft34-db-integrity/` に以下を作成:
20
+
21
+ - **`app.py`** — SQLite インメモリ DB + `SqlAlchemyQueryExecutor` + `SimpleDomainHandler` による UNIQUE 違反ハンドリング
22
+ - **`test_app.py`** — 正常系・409・Problem Details 構造・バリデーションエラー混在 (6 件)
23
+ - **`test_friction.py`** — 摩擦点の確認テスト (4 件)
24
+
25
+ ```python
26
+ handlers = [
27
+ SimpleDomainHandler(
28
+ DatabaseIntegrityException,
29
+ "username-already-taken",
30
+ "Username Already Taken",
31
+ 409,
32
+ detail="このユーザー名はすでに使用されています",
33
+ ),
34
+ ]
35
+ app.add_middleware(ErrorHandlerMiddleware, domain_handlers=handlers)
36
+ ```
37
+
38
+ **テスト結果**: 10 件全通過 ✅
39
+
40
+ ---
41
+
42
+ ## 摩擦点
43
+
44
+ ### FP34-1: `DatabaseIntegrityException` のメッセージが SQLAlchemy の生テキスト
45
+
46
+ **分類**: 既知の制約(摩擦あり・軽微)
47
+
48
+ ```
49
+ (sqlite3.IntegrityError) UNIQUE constraint failed: users.username
50
+ ```
51
+
52
+ どのフィールドが重複したかを取り出すには文字列パースが必要。
53
+ DB エンジンごとにメッセージ形式が異なる(SQLite / MySQL / PostgreSQL)。
54
+
55
+ **判断**: フレームワーク側でフィールド抽出 API を提供することも可能だが、
56
+ エンジン依存のパースロジックを組み込むと移植性が下がる。
57
+ アプリ側でドメイン固有の例外(`UsernameTakenException` など)に変換するパターンを推奨。
58
+
59
+ ---
60
+
61
+ ### FP34-2: 制約種別を示すサブクラスがない
62
+
63
+ **分類**: 既知の制約(摩擦あり・軽微)
64
+
65
+ `DatabaseIntegrityException` は UNIQUE / FK / CHECK 制約を区別しない。
66
+ 違反種別で異なるレスポンスを返したい場合は文字列パースが必要。
67
+
68
+ **判断**: 制約種別サブクラスの追加は有用だが、DB エンジンごとの判定ロジックが複雑になる。
69
+ 現時点はアプリ側で try/except してドメイン例外に変換する方針を how-to ドキュメントで説明。
70
+
71
+ ---
72
+
73
+ ### FP34-3: テスト用インメモリ SQLite に `StaticPool` が必要
74
+
75
+ **分類**: 摩擦あり → **ドキュメント対応**
76
+
77
+ `SqlAlchemyQueryExecutor` はクエリごとに `engine.begin()` / `engine.connect()` で
78
+ コネクションを開く。`sqlite:///:memory:` はコネクションごとに独立した DB を作成するため、
79
+ `StaticPool` なしではクエリ間でテーブルが見えなくなる場合がある。
80
+
81
+ ```python
82
+ # 推奨パターン
83
+ engine = create_engine(
84
+ "sqlite:///:memory:",
85
+ connect_args={"check_same_thread": False},
86
+ poolclass=StaticPool,
87
+ )
88
+ ```
89
+
90
+ **対応**: `docs/how-to/run-tests.md` に `StaticPool` 使用を明記。
91
+
92
+ ---
93
+
94
+ ### FP34-4: `SimpleDomainHandler` は制約種別を区別できない
95
+
96
+ **分類**: 設計通り(摩擦なし)
97
+
98
+ `SimpleDomainHandler` は例外クラスのみで判定する。
99
+ UNIQUE 違反と FK 違反を別々の HTTP ステータスにマップしたい場合は
100
+ `DomainExceptionHandlerProtocol` を実装する必要がある。
101
+
102
+ **判断**: `SimpleDomainHandler` はシンプルケース専用のヘルパーという設計意図通り。
103
+ 複雑なケースには Protocol 実装を使うのが正しい。
104
+
105
+ ---
106
+
107
+ ## フレームワーク変更
108
+
109
+ - `docs/how-to/run-tests.md` に `StaticPool` パターンを追記 (FP34-3 対応)
110
+
111
+ ---
112
+
113
+ ## 関連
114
+
115
+ - `nene2.database.DatabaseIntegrityException`
116
+ - `nene2.database.SqlAlchemyQueryExecutor`
117
+ - `nene2.middleware.SimpleDomainHandler`
118
+ - FT16 (DatabaseIntegrityException 実装, v1.7.0)
119
+ - FT21 (SimpleDomainHandler 実装, v1.8.0)
@@ -0,0 +1,90 @@
1
+ # Field Trial 35: 混合認証(Bearer Token OR API Key)実運用検証
2
+
3
+ **日付**: 2026-05-20
4
+ **バージョン**: v1.8.3 時点
5
+ **テーマ**: `BearerTokenMiddleware` と `ApiKeyAuthMiddleware` の組み合わせパターン、
6
+ および「いずれか一方で可(OR 条件)」認証の実装コストを確認する
7
+
8
+ ---
9
+
10
+ ## 概要
11
+
12
+ Bearer Token 専用・API Key 専用の各ベースラインを確認した後、
13
+ 2 つのミドルウェアをスタックした場合の挙動と、
14
+ OR 条件認証のカスタム実装を比較した。
15
+
16
+ ---
17
+
18
+ ## 実装内容
19
+
20
+ `/home/xi/docker/nene2-python-FT/ft35-mixed-auth/` に以下を作成:
21
+
22
+ - **`app.py`** — 4 パターンのアプリ(Bearer のみ・API Key のみ・両方スタック・EitherOr カスタム)
23
+ - **`test_app.py`** — 全パターンの動作検証 (13 件)
24
+ - **`test_friction.py`** — 摩擦点の確認テスト (3 件)
25
+
26
+ **テスト結果**: 16 件全通過 ✅
27
+
28
+ ---
29
+
30
+ ## 摩擦点
31
+
32
+ ### FP35-1: ミドルウェアを2つスタックすると AND 条件になる
33
+
34
+ **分類**: 摩擦あり(設計上の制約)
35
+
36
+ `BearerTokenMiddleware` と `ApiKeyAuthMiddleware` を両方 `add_middleware` すると、
37
+ 各ミドルウェアが独立して検証するため「両方必須(AND)」になる。
38
+ Bearer Token のみ・API Key のみの場合どちらも 401。
39
+
40
+ ```python
41
+ # この設定は AND 条件(両方必須)
42
+ app.add_middleware(ApiKeyAuthMiddleware, ...)
43
+ app.add_middleware(BearerTokenMiddleware, ...)
44
+ ```
45
+
46
+ **判断**: Starlette のミドルウェアスタックの仕様通り。
47
+ `configure-auth.md` に明記し、AND と OR の違いを説明する。
48
+
49
+ ---
50
+
51
+ ### FP35-2: OR 条件の認証にはカスタムミドルウェアの実装が必要
52
+
53
+ **分類**: 摩擦あり(実装コスト発生)
54
+
55
+ 「Bearer または API Key のいずれかで可」を実現するには
56
+ `BaseHTTPMiddleware` を継承してカスタム実装する必要がある。
57
+ フレームワークに汎用 OR ミドルウェアはない。
58
+
59
+ ただし、`LocalTokenVerifier` / `TokenVerifierProtocol` は再利用可能なため、
60
+ カスタム実装のコードは約 30 行と軽量。
61
+
62
+ **判断**: OR 条件の仕様はプロジェクトによって多様すぎるため、
63
+ フレームワークが汎用実装を提供するより、パターンをドキュメントで示す方が適切。
64
+
65
+ **対応**: `docs/how-to/configure-auth.md` に `EitherOrAuthMiddleware` パターンを追記。
66
+
67
+ ---
68
+
69
+ ### FP35-3: TokenVerifierProtocol の再利用性が高い(好印象)
70
+
71
+ **分類**: 良い設計の確認
72
+
73
+ `LocalTokenVerifier` はそのままカスタムミドルウェア内で使えるため、
74
+ トークン比較ロジック(`secrets.compare_digest`)を重複実装する必要がない。
75
+ Protocol 分離の設計が効いている。
76
+
77
+ ---
78
+
79
+ ## フレームワーク変更
80
+
81
+ - `docs/how-to/configure-auth.md` に「AND / OR の違い」と `EitherOrAuthMiddleware` パターンを追記 (FP35-1, FP35-2 対応)
82
+
83
+ ---
84
+
85
+ ## 関連
86
+
87
+ - `nene2.auth.BearerTokenMiddleware`
88
+ - `nene2.auth.ApiKeyAuthMiddleware`
89
+ - `nene2.auth.LocalTokenVerifier`
90
+ - FT11 (exclude_paths, LocalTokenVerifier.from_env, v1.4.0)
@@ -0,0 +1,92 @@
1
+ # Field Trial 36: CompositeHealthCheck 実運用検証
2
+
3
+ **日付**: 2026-05-20
4
+ **バージョン**: v1.8.3 時点
5
+ **テーマ**: `CompositeHealthCheck` で複数の依存サービス(DB・外部 API・キャッシュ)の健全性を集約し、`HealthStatus.http_status_code` を使って `/health` エンドポイントを実装するパターン。および非同期ヘルスチェックのギャップを発見・修正。
6
+
7
+ ---
8
+
9
+ ## 概要
10
+
11
+ SQLite DB・外部 API(モック)・キャッシュ(モック)の 3 つの依存を `CompositeHealthCheck` で集約し、
12
+ 部分障害時に個別のチェック名と全体 `"error"` ステータスを返すパターンを検証した。
13
+
14
+ 主な発見: 非同期チェックに対応するプロトコルとクラスがなく、外部 HTTP API を非同期で確認するヘルスチェックが書けない摩擦を発見。`AsyncHealthCheckProtocol` と `AsyncCompositeHealthCheck` を追加して対応。
15
+
16
+ ---
17
+
18
+ ## 実装内容
19
+
20
+ `/home/xi/docker/nene2-python-FT/ft36-composite-health/` に以下を作成:
21
+
22
+ - **`app.py`** — DB / 外部 API / キャッシュの 3 チェックを集約した `/health` エンドポイント
23
+ - **`test_app.py`** — 全正常・DB 障害・部分障害・各チェック名の確認 (5 件)
24
+ - **`test_friction.py`** — 摩擦点の確認テスト (4 件)
25
+
26
+ **テスト結果**: 9 件全通過 ✅
27
+
28
+ ---
29
+
30
+ ## 摩擦点
31
+
32
+ ### FP36-1: 非同期ヘルスチェックに対応するプロトコルがない
33
+
34
+ **分類**: 摩擦あり → **実装で対応**
35
+
36
+ `HealthCheckProtocol.check()` は同期のみ。外部 HTTP API への非同期 `httpx.AsyncClient` 呼び出しや
37
+ 非同期 DB クライアントを使うヘルスチェックを書けない。
38
+
39
+ **対応**: `AsyncHealthCheckProtocol` と `AsyncCompositeHealthCheck` を `nene2.http` に追加 (#254)。
40
+ `asyncio.gather` で全チェックを並列実行するため、レスポンスタイムも最適化される。
41
+
42
+ ```python
43
+ class AsyncApiHealthCheck:
44
+ async def check(self) -> HealthStatus:
45
+ async with httpx.AsyncClient() as client:
46
+ r = await client.get("https://api.example.com/health")
47
+ status = "ok" if r.status_code == 200 else "error"
48
+ return HealthStatus(status=status, checks={"external_api": status})
49
+
50
+ composite = AsyncCompositeHealthCheck([db_check, AsyncApiHealthCheck()])
51
+ ```
52
+
53
+ ---
54
+
55
+ ### FP36-2: チェックの名前を集約時に指定できない
56
+
57
+ **分類**: 設計通り(摩擦なし)
58
+
59
+ チェックの名前は `HealthStatus.checks` の dict キーで決まる(チェック実装側が定義する)。
60
+ 集約側での名前 override はできない。
61
+
62
+ **判断**: チェック実装がその名前を知っているべきという責務分離の観点で正しい設計。
63
+ 集約側での名前指定を可能にすると DRY 違反になりやすい。
64
+
65
+ ---
66
+
67
+ ### FP36-3: 同名キーを持つチェックが複数あると後勝ちになる
68
+
69
+ **分類**: 軽微な摩擦(ドキュメント対応)
70
+
71
+ 2 つのチェックが同じキーを `checks` に返した場合、`dict.update()` で後のチェックが勝つ。
72
+ 衝突検出の仕組みはない。
73
+
74
+ **判断**: 各チェックがユニークな名前を使う規約で対応。
75
+
76
+ ---
77
+
78
+ ## フレームワーク変更
79
+
80
+ - `nene2.http.AsyncHealthCheckProtocol` — `async def check() -> HealthStatus` の Protocol を追加 (FP36-1)
81
+ - `nene2.http.AsyncCompositeHealthCheck` — 並列実行の集約クラスを追加 (FP36-1)
82
+ - テスト 6 件追加
83
+
84
+ ---
85
+
86
+ ## 関連
87
+
88
+ - `nene2.http.CompositeHealthCheck`
89
+ - `nene2.http.HealthStatus`
90
+ - FT22 (CompositeHealthCheck 実装, v1.8.0)
91
+ - FT31 (HealthStatus.http_status_code, v1.8.3)
92
+ - Issue #254
@@ -0,0 +1,77 @@
1
+ # Field Trial 37: PaginationResponse + PaginationQueryParser 実運用検証
2
+
3
+ **日付**: 2026-05-20
4
+ **バージョン**: v1.8.4 時点
5
+ **テーマ**: `PaginationQueryParser` の `Depends()` パターンと `PaginationResponse.to_dict()` を使ったページネーションパイプラインの実運用確認
6
+
7
+ ---
8
+
9
+ ## 概要
10
+
11
+ 50 件の `Product` データを `PaginationQueryParser` で limit/offset 制御し、
12
+ `PaginationResponse.to_dict()` で slotted dataclass を自動シリアライズして `JSONResponse` に変換するパイプラインを検証した。
13
+
14
+ ---
15
+
16
+ ## 実装内容
17
+
18
+ `/home/xi/docker/nene2-python-FT/ft37-pagination/` に以下を作成:
19
+
20
+ - **`app.py`** — `Annotated[PaginationQueryParser, Depends()]` パターンの `/api/products` エンドポイント
21
+ - **`test_app.py`** — デフォルト・カスタム・最終ページ・無効値・Depends 動作確認 (9 件)
22
+ - **`test_friction.py`** — 摩擦点の確認テスト (4 件)
23
+
24
+ **テスト結果**: 13 件全通過 ✅
25
+
26
+ ---
27
+
28
+ ## 摩擦点
29
+
30
+ ### FP37-1: `Annotated[PaginationQueryParser, Depends()]` と書く必要がある
31
+
32
+ **分類**: 軽微な摩擦(FastAPI 標準パターン)
33
+
34
+ `def list(pagination: PaginationQueryParser = Depends())` ではなく
35
+ `def list(pagination: Annotated[PaginationQueryParser, Depends()])` が推奨パターン。
36
+ FastAPI の仕様に従っているが、初見では迷いやすい。
37
+
38
+ **判断**: `docs/how-to/validation.md` および新規作成する how-to への記載で対応。
39
+
40
+ ---
41
+
42
+ ### FP37-2: `to_dict()` は dataclass のみ自動シリアライズ
43
+
44
+ **分類**: 既知の制約(軽微)
45
+
46
+ `PaginationResponse.to_dict()` は `dataclasses.is_dataclass()` で判定する。
47
+ Pydantic モデルの items は `.model_dump()` を個別に呼ぶ必要がある。
48
+ 通常の dict はそのまま通過する。
49
+
50
+ **判断**: dataclass 向け最適化という設計意図通り。
51
+ Pydantic モデルとの混在ユースケースは how-to ドキュメントに記載する。
52
+
53
+ ---
54
+
55
+ ### FP37-3: `total` 省略時に `"total"` キーが消える(設計通り)
56
+
57
+ **分類**: 設計通り(摩擦なし)
58
+
59
+ `PaginationResponse(items=[], limit=10, offset=0)` のように `total` を渡さないと
60
+ `to_dict()` の結果に `"total"` キーが含まれない。
61
+ `total=None` を明示しても同じ結果。
62
+
63
+ **判断**: 全件数を取得しない効率的なページネーションをサポートする意図通り。
64
+
65
+ ---
66
+
67
+ ## フレームワーク変更
68
+
69
+ なし(全て設計通りの挙動)
70
+
71
+ ---
72
+
73
+ ## 関連
74
+
75
+ - `nene2.http.PaginationQueryParser`
76
+ - `nene2.http.PaginationResponse`
77
+ - FT10 (PaginationResponse.to_dict() スロット対応, v1.3.0)
@@ -0,0 +1,85 @@
1
+ # Field Trial 38: SqlAlchemyTransactionManager.transactional() 実運用検証
2
+
3
+ **日付**: 2026-05-20
4
+ **バージョン**: v1.8.4 時点
5
+ **テーマ**: 注文作成(在庫更新 + 注文レコード作成)をトランザクションで包み、途中での例外発生時のロールバック動作を確認する
6
+
7
+ ---
8
+
9
+ ## 概要
10
+
11
+ `SqlAlchemyTransactionManager.transactional(callback)` を使って複数の DB 書き込みを一つのトランザクションに包み、途中で例外が発生した場合のロールバック動作を検証した。
12
+
13
+ ---
14
+
15
+ ## 実装内容
16
+
17
+ `/home/xi/docker/nene2-python-FT/ft38-transactions/` に以下を作成:
18
+
19
+ - **`app.py`** — 在庫チェック + 在庫減少 + 注文作成を `transactional()` で包んだ注文 API
20
+ - **`test_app.py`** — 正常注文・在庫不足・ロールバック確認・連続注文 (6 件)
21
+ - **`test_friction.py`** — 摩擦点の確認テスト (3 件)
22
+
23
+ **テスト結果**: 9 件全通過 ✅
24
+
25
+ ---
26
+
27
+ ## 摩擦点
28
+
29
+ ### FP38-1: コールバック内で型アノテーションに `DatabaseQueryExecutorInterface` が必要
30
+
31
+ **分類**: 軽微な摩擦(mypy --strict 使用時)
32
+
33
+ ```python
34
+ def _do_create(db: object) -> int:
35
+ ...
36
+ ```
37
+
38
+ `db` を `object` 型にするとメソッド呼び出しに mypy エラーが出る。
39
+ `DatabaseQueryExecutorInterface` をインポートして型アノテーションする必要がある。
40
+
41
+ **判断**: mypy --strict の設計上当然の制約。インポートはやや冗長だが許容範囲。
42
+ `db: DatabaseQueryExecutorInterface` が推奨パターンとしてドキュメントに記載されている。
43
+
44
+ ---
45
+
46
+ ### FP38-2: savepoint(ネストトランザクション)はサポートしない
47
+
48
+ **分類**: 既知の制約(設計通り)
49
+
50
+ `DatabaseQueryExecutorInterface` が持つのは `fetch_all` / `fetch_one` / `write` のみ。
51
+ SQLAlchemy の savepoint 機能(`SAVEPOINT` / `ROLLBACK TO SAVEPOINT`)は使えない。
52
+
53
+ **判断**: フレームワークの抽象化レイヤーが Pure SQL テキストベースの設計を採用しているため、
54
+ ORM/Connection 固有の高度な機能は意図的に除外されている。
55
+ savepoint が必要な場合は SQLAlchemy を直接使う Repository を実装するのが正しいパターン。
56
+
57
+ ---
58
+
59
+ ### FP38-3: トランザクション途中の例外はすべてロールバックされる(設計通り)
60
+
61
+ **分類**: 設計通り(摩擦なし)
62
+
63
+ ```python
64
+ def _callback(db: DatabaseQueryExecutorInterface) -> None:
65
+ db.write("INSERT ...") # ← この変更も
66
+ raise ValueError("oops") # ← ここで例外 → 全部ロールバック
67
+ ```
68
+
69
+ 例外の種類に関わらず(`DatabaseIntegrityException` 以外でも)全変更がロールバックされる。
70
+ これは `SqlAlchemyTransactionManager.transactional()` の期待される動作。
71
+
72
+ ---
73
+
74
+ ## フレームワーク変更
75
+
76
+ なし(全て設計通りの挙動)
77
+
78
+ ---
79
+
80
+ ## 関連
81
+
82
+ - `nene2.database.SqlAlchemyTransactionManager`
83
+ - `nene2.database.DatabaseQueryExecutorInterface`
84
+ - FT16 (DatabaseIntegrityException, v1.7.0)
85
+ - FT34 (DatabaseIntegrityException 実運用, v1.8.3)