poop-detector 1.0.0__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 (490) hide show
  1. poop_detector-1.0.0/.dockerignore +10 -0
  2. poop_detector-1.0.0/.env.example +27 -0
  3. poop_detector-1.0.0/.github/ISSUE_TEMPLATE/bug_report.yml +67 -0
  4. poop_detector-1.0.0/.github/ISSUE_TEMPLATE/config.yml +11 -0
  5. poop_detector-1.0.0/.github/ISSUE_TEMPLATE/feature_request.yml +35 -0
  6. poop_detector-1.0.0/.github/dependabot.yml +28 -0
  7. poop_detector-1.0.0/.github/pull_request_template.md +25 -0
  8. poop_detector-1.0.0/.github/workflows/ci.yml +120 -0
  9. poop_detector-1.0.0/.github/workflows/macos-preview.yml +41 -0
  10. poop_detector-1.0.0/.github/workflows/release.yml +89 -0
  11. poop_detector-1.0.0/.gitignore +21 -0
  12. poop_detector-1.0.0/.python-version +1 -0
  13. poop_detector-1.0.0/AGENTS.md +43 -0
  14. poop_detector-1.0.0/CHANGELOG.md +96 -0
  15. poop_detector-1.0.0/CLAUDE.md +32 -0
  16. poop_detector-1.0.0/CODE_OF_CONDUCT.md +49 -0
  17. poop_detector-1.0.0/CONTRIBUTING.md +93 -0
  18. poop_detector-1.0.0/Dockerfile +13 -0
  19. poop_detector-1.0.0/LICENSE +21 -0
  20. poop_detector-1.0.0/PKG-INFO +243 -0
  21. poop_detector-1.0.0/README.md +196 -0
  22. poop_detector-1.0.0/SECURITY.md +44 -0
  23. poop_detector-1.0.0/config/config.example.yaml +186 -0
  24. poop_detector-1.0.0/docs/README.md +35 -0
  25. poop_detector-1.0.0/docs/architecture.md +313 -0
  26. poop_detector-1.0.0/docs/data-collection.md +116 -0
  27. poop_detector-1.0.0/docs/detection.md +92 -0
  28. poop_detector-1.0.0/docs/docker.md +66 -0
  29. poop_detector-1.0.0/docs/dog-model-validation.json +73 -0
  30. poop_detector-1.0.0/docs/dog.md +204 -0
  31. poop_detector-1.0.0/docs/images/clip-list-labels.png +0 -0
  32. poop_detector-1.0.0/docs/images/compact-status-clips.png +0 -0
  33. poop_detector-1.0.0/docs/images/compact-status-review.png +0 -0
  34. poop_detector-1.0.0/docs/images/fediaf-feeding-advice.png +0 -0
  35. poop_detector-1.0.0/docs/images/feeding-plans.png +0 -0
  36. poop_detector-1.0.0/docs/images/home-last-care.png +0 -0
  37. poop_detector-1.0.0/docs/images/label-gui-activity.png +0 -0
  38. poop_detector-1.0.0/docs/images/label-gui-benchmark-answers.jpg +0 -0
  39. poop_detector-1.0.0/docs/images/label-gui-benchmark-candidate.jpg +0 -0
  40. poop_detector-1.0.0/docs/images/label-gui-benchmark-datasets.jpg +0 -0
  41. poop_detector-1.0.0/docs/images/label-gui-care.png +0 -0
  42. poop_detector-1.0.0/docs/images/label-gui-clips.jpg +0 -0
  43. poop_detector-1.0.0/docs/images/label-gui-export-summary.jpg +0 -0
  44. poop_detector-1.0.0/docs/images/label-gui-export.jpg +0 -0
  45. poop_detector-1.0.0/docs/images/label-gui-home-mobile.png +0 -0
  46. poop_detector-1.0.0/docs/images/label-gui-judge-tokens.jpg +0 -0
  47. poop_detector-1.0.0/docs/images/label-gui-judge-usage.jpg +0 -0
  48. poop_detector-1.0.0/docs/images/label-gui-management.png +0 -0
  49. poop_detector-1.0.0/docs/images/label-gui-models.jpg +0 -0
  50. poop_detector-1.0.0/docs/images/label-gui-outages.jpg +0 -0
  51. poop_detector-1.0.0/docs/images/label-gui-records.png +0 -0
  52. poop_detector-1.0.0/docs/images/label-gui-review-status.jpg +0 -0
  53. poop_detector-1.0.0/docs/images/label-gui-review.png +0 -0
  54. poop_detector-1.0.0/docs/images/label-gui-setup.png +0 -0
  55. poop_detector-1.0.0/docs/images/label-gui-sleep.jpg +0 -0
  56. poop_detector-1.0.0/docs/images/label-gui-top.jpg +0 -0
  57. poop_detector-1.0.0/docs/images/label-gui-weight.png +0 -0
  58. poop_detector-1.0.0/docs/images/mac-first-record.png +0 -0
  59. poop_detector-1.0.0/docs/images/management-restart.jpg +0 -0
  60. poop_detector-1.0.0/docs/images/mobile-clip-review.png +0 -0
  61. poop_detector-1.0.0/docs/images/mobile-event-review.png +0 -0
  62. poop_detector-1.0.0/docs/images/record-new-manual.png +0 -0
  63. poop_detector-1.0.0/docs/images/record-new-mobile.png +0 -0
  64. poop_detector-1.0.0/docs/images/reentry-clip.png +0 -0
  65. poop_detector-1.0.0/docs/images/review-stay-filter.png +0 -0
  66. poop_detector-1.0.0/docs/images/treat-feeding-budget.png +0 -0
  67. poop_detector-1.0.0/docs/licenses.md +92 -0
  68. poop_detector-1.0.0/docs/notifications.md +100 -0
  69. poop_detector-1.0.0/docs/privacy.md +85 -0
  70. poop_detector-1.0.0/docs/records.md +253 -0
  71. poop_detector-1.0.0/docs/reentry.md +82 -0
  72. poop_detector-1.0.0/docs/releasing.md +42 -0
  73. poop_detector-1.0.0/docs/remote-access.md +79 -0
  74. poop_detector-1.0.0/docs/screens.md +271 -0
  75. poop_detector-1.0.0/docs/setup.md +211 -0
  76. poop_detector-1.0.0/docs/superpowers/plans/2026-11-20-sleep-heatmap.md +314 -0
  77. poop_detector-1.0.0/docs/superpowers/plans/2026-11-21-feeding-advisor.md +668 -0
  78. poop_detector-1.0.0/docs/superpowers/specs/2026-11-20-sleep-heatmap-design.md +99 -0
  79. poop_detector-1.0.0/docs/superpowers/specs/2026-11-21-feeding-advisor-design.md +192 -0
  80. poop_detector-1.0.0/docs/validation.json +12 -0
  81. poop_detector-1.0.0/docs/video.md +191 -0
  82. poop_detector-1.0.0/docs/vocal-model-survey.md +61 -0
  83. poop_detector-1.0.0/docs/vocal.md +59 -0
  84. poop_detector-1.0.0/pyproject.toml +141 -0
  85. poop_detector-1.0.0/scripts/export-dotenv.py +78 -0
  86. poop_detector-1.0.0/scripts/make-app-icons.py +64 -0
  87. poop_detector-1.0.0/scripts/smoke-check.py +104 -0
  88. poop_detector-1.0.0/src/poop_detector/__init__.py +13 -0
  89. poop_detector-1.0.0/src/poop_detector/atomic_file.py +18 -0
  90. poop_detector-1.0.0/src/poop_detector/capture/__init__.py +1 -0
  91. poop_detector-1.0.0/src/poop_detector/capture/camera.py +154 -0
  92. poop_detector-1.0.0/src/poop_detector/capture/live_preview.py +130 -0
  93. poop_detector-1.0.0/src/poop_detector/commands/__init__.py +1 -0
  94. poop_detector-1.0.0/src/poop_detector/commands/backup.py +64 -0
  95. poop_detector-1.0.0/src/poop_detector/commands/benchmark.py +234 -0
  96. poop_detector-1.0.0/src/poop_detector/commands/circling.py +118 -0
  97. poop_detector-1.0.0/src/poop_detector/commands/context.py +342 -0
  98. poop_detector-1.0.0/src/poop_detector/commands/datasets.py +202 -0
  99. poop_detector-1.0.0/src/poop_detector/commands/diagnose.py +131 -0
  100. poop_detector-1.0.0/src/poop_detector/commands/dog_model.py +61 -0
  101. poop_detector-1.0.0/src/poop_detector/commands/notify.py +20 -0
  102. poop_detector-1.0.0/src/poop_detector/commands/records.py +109 -0
  103. poop_detector-1.0.0/src/poop_detector/commands/reentry.py +229 -0
  104. poop_detector-1.0.0/src/poop_detector/commands/registration.py +23 -0
  105. poop_detector-1.0.0/src/poop_detector/commands/review.py +205 -0
  106. poop_detector-1.0.0/src/poop_detector/commands/run.py +416 -0
  107. poop_detector-1.0.0/src/poop_detector/commands/setup.py +151 -0
  108. poop_detector-1.0.0/src/poop_detector/commands/show_config.py +16 -0
  109. poop_detector-1.0.0/src/poop_detector/commands/users.py +149 -0
  110. poop_detector-1.0.0/src/poop_detector/config.py +962 -0
  111. poop_detector-1.0.0/src/poop_detector/detection/__init__.py +1 -0
  112. poop_detector-1.0.0/src/poop_detector/detection/difference.py +180 -0
  113. poop_detector-1.0.0/src/poop_detector/detection/monitoring.py +369 -0
  114. poop_detector-1.0.0/src/poop_detector/detection/roi.py +307 -0
  115. poop_detector-1.0.0/src/poop_detector/detection/scene.py +69 -0
  116. poop_detector-1.0.0/src/poop_detector/detection/state_machine.py +50 -0
  117. poop_detector-1.0.0/src/poop_detector/errors.py +34 -0
  118. poop_detector-1.0.0/src/poop_detector/experimental/__init__.py +1 -0
  119. poop_detector-1.0.0/src/poop_detector/experimental/circling.py +171 -0
  120. poop_detector-1.0.0/src/poop_detector/experimental/circling_compare.py +160 -0
  121. poop_detector-1.0.0/src/poop_detector/experimental/floor_objects.py +278 -0
  122. poop_detector-1.0.0/src/poop_detector/experimental/outside.py +55 -0
  123. poop_detector-1.0.0/src/poop_detector/experimental/screening.py +174 -0
  124. poop_detector-1.0.0/src/poop_detector/experimental/trajectory.py +75 -0
  125. poop_detector-1.0.0/src/poop_detector/experimental/vocal.py +373 -0
  126. poop_detector-1.0.0/src/poop_detector/experimental/vocal_model.py +108 -0
  127. poop_detector-1.0.0/src/poop_detector/features/__init__.py +1 -0
  128. poop_detector-1.0.0/src/poop_detector/features/activity_map.py +232 -0
  129. poop_detector-1.0.0/src/poop_detector/features/advice/__init__.py +1 -0
  130. poop_detector-1.0.0/src/poop_detector/features/advice/context.py +122 -0
  131. poop_detector-1.0.0/src/poop_detector/features/advice/jobs.py +182 -0
  132. poop_detector-1.0.0/src/poop_detector/features/advice/prompts.py +204 -0
  133. poop_detector-1.0.0/src/poop_detector/features/advice/worker.py +176 -0
  134. poop_detector-1.0.0/src/poop_detector/features/away_reminder.py +35 -0
  135. poop_detector-1.0.0/src/poop_detector/features/daily_trends.py +204 -0
  136. poop_detector-1.0.0/src/poop_detector/features/digest.py +165 -0
  137. poop_detector-1.0.0/src/poop_detector/features/digest_summary.py +196 -0
  138. poop_detector-1.0.0/src/poop_detector/features/digest_timeline.py +120 -0
  139. poop_detector-1.0.0/src/poop_detector/features/dog.py +211 -0
  140. poop_detector-1.0.0/src/poop_detector/features/dog_status.py +117 -0
  141. poop_detector-1.0.0/src/poop_detector/features/early_alert.py +114 -0
  142. poop_detector-1.0.0/src/poop_detector/features/floor_judge.py +169 -0
  143. poop_detector-1.0.0/src/poop_detector/features/monitoring.py +400 -0
  144. poop_detector-1.0.0/src/poop_detector/features/night.py +186 -0
  145. poop_detector-1.0.0/src/poop_detector/features/outages.py +185 -0
  146. poop_detector-1.0.0/src/poop_detector/features/presence.py +140 -0
  147. poop_detector-1.0.0/src/poop_detector/features/reentry.py +481 -0
  148. poop_detector-1.0.0/src/poop_detector/features/reentry_extension.py +268 -0
  149. poop_detector-1.0.0/src/poop_detector/features/sheet_wear.py +50 -0
  150. poop_detector-1.0.0/src/poop_detector/features/sleep.py +237 -0
  151. poop_detector-1.0.0/src/poop_detector/features/sleep_motion.py +378 -0
  152. poop_detector-1.0.0/src/poop_detector/features/sleep_store.py +81 -0
  153. poop_detector-1.0.0/src/poop_detector/features/tray_registration.py +176 -0
  154. poop_detector-1.0.0/src/poop_detector/features/tray_tracking.py +262 -0
  155. poop_detector-1.0.0/src/poop_detector/features/watchdog.py +129 -0
  156. poop_detector-1.0.0/src/poop_detector/frames.py +13 -0
  157. poop_detector-1.0.0/src/poop_detector/gui/__init__.py +1 -0
  158. poop_detector-1.0.0/src/poop_detector/gui/access.py +40 -0
  159. poop_detector-1.0.0/src/poop_detector/gui/account_routes.py +351 -0
  160. poop_detector-1.0.0/src/poop_detector/gui/accounts.py +657 -0
  161. poop_detector-1.0.0/src/poop_detector/gui/activity_page.py +89 -0
  162. poop_detector-1.0.0/src/poop_detector/gui/advice_page.py +186 -0
  163. poop_detector-1.0.0/src/poop_detector/gui/advice_routes.py +425 -0
  164. poop_detector-1.0.0/src/poop_detector/gui/advice_worker.py +115 -0
  165. poop_detector-1.0.0/src/poop_detector/gui/areas_routes.py +269 -0
  166. poop_detector-1.0.0/src/poop_detector/gui/asgi.py +407 -0
  167. poop_detector-1.0.0/src/poop_detector/gui/assets.py +60 -0
  168. poop_detector-1.0.0/src/poop_detector/gui/audit.py +103 -0
  169. poop_detector-1.0.0/src/poop_detector/gui/auth_api.py +115 -0
  170. poop_detector-1.0.0/src/poop_detector/gui/care_routes.py +266 -0
  171. poop_detector-1.0.0/src/poop_detector/gui/checks_routes.py +145 -0
  172. poop_detector-1.0.0/src/poop_detector/gui/clip_pages.py +647 -0
  173. poop_detector-1.0.0/src/poop_detector/gui/clip_routes.py +172 -0
  174. poop_detector-1.0.0/src/poop_detector/gui/digest_page.py +69 -0
  175. poop_detector-1.0.0/src/poop_detector/gui/digest_routes.py +80 -0
  176. poop_detector-1.0.0/src/poop_detector/gui/digest_summary_routes.py +43 -0
  177. poop_detector-1.0.0/src/poop_detector/gui/exchange.py +59 -0
  178. poop_detector-1.0.0/src/poop_detector/gui/export_routes.py +182 -0
  179. poop_detector-1.0.0/src/poop_detector/gui/feeding_notifications.py +51 -0
  180. poop_detector-1.0.0/src/poop_detector/gui/floor_routes.py +86 -0
  181. poop_detector-1.0.0/src/poop_detector/gui/icons.py +33 -0
  182. poop_detector-1.0.0/src/poop_detector/gui/invitation_mail.py +143 -0
  183. poop_detector-1.0.0/src/poop_detector/gui/list_time.py +74 -0
  184. poop_detector-1.0.0/src/poop_detector/gui/live_stream.py +80 -0
  185. poop_detector-1.0.0/src/poop_detector/gui/markdown_text.py +113 -0
  186. poop_detector-1.0.0/src/poop_detector/gui/models_routes.py +452 -0
  187. poop_detector-1.0.0/src/poop_detector/gui/navigation.py +219 -0
  188. poop_detector-1.0.0/src/poop_detector/gui/night_routes.py +124 -0
  189. poop_detector-1.0.0/src/poop_detector/gui/pages.py +498 -0
  190. poop_detector-1.0.0/src/poop_detector/gui/passkeys.py +283 -0
  191. poop_detector-1.0.0/src/poop_detector/gui/presence_routes.py +97 -0
  192. poop_detector-1.0.0/src/poop_detector/gui/push_routes.py +145 -0
  193. poop_detector-1.0.0/src/poop_detector/gui/rate_limit.py +62 -0
  194. poop_detector-1.0.0/src/poop_detector/gui/restart.py +27 -0
  195. poop_detector-1.0.0/src/poop_detector/gui/review_queue.py +232 -0
  196. poop_detector-1.0.0/src/poop_detector/gui/review_routes.py +192 -0
  197. poop_detector-1.0.0/src/poop_detector/gui/routes.py +724 -0
  198. poop_detector-1.0.0/src/poop_detector/gui/server.py +350 -0
  199. poop_detector-1.0.0/src/poop_detector/gui/sessions.py +117 -0
  200. poop_detector-1.0.0/src/poop_detector/gui/settings_routes.py +227 -0
  201. poop_detector-1.0.0/src/poop_detector/gui/sheet_page.py +30 -0
  202. poop_detector-1.0.0/src/poop_detector/gui/sleep_page.py +271 -0
  203. poop_detector-1.0.0/src/poop_detector/gui/snapshots.py +55 -0
  204. poop_detector-1.0.0/src/poop_detector/gui/static/advice.js +36 -0
  205. poop_detector-1.0.0/src/poop_detector/gui/static/apple-touch-icon.png +0 -0
  206. poop_detector-1.0.0/src/poop_detector/gui/static/areas.js +156 -0
  207. poop_detector-1.0.0/src/poop_detector/gui/static/busy.js +74 -0
  208. poop_detector-1.0.0/src/poop_detector/gui/static/care.js +25 -0
  209. poop_detector-1.0.0/src/poop_detector/gui/static/clip_status.js +76 -0
  210. poop_detector-1.0.0/src/poop_detector/gui/static/clip_storage.js +36 -0
  211. poop_detector-1.0.0/src/poop_detector/gui/static/clips.js +93 -0
  212. poop_detector-1.0.0/src/poop_detector/gui/static/dog.svg +1 -0
  213. poop_detector-1.0.0/src/poop_detector/gui/static/icon-192.png +0 -0
  214. poop_detector-1.0.0/src/poop_detector/gui/static/icon-512.png +0 -0
  215. poop_detector-1.0.0/src/poop_detector/gui/static/judge_models.js +56 -0
  216. poop_detector-1.0.0/src/poop_detector/gui/static/live.js +278 -0
  217. poop_detector-1.0.0/src/poop_detector/gui/static/management.js +119 -0
  218. poop_detector-1.0.0/src/poop_detector/gui/static/menu.js +31 -0
  219. poop_detector-1.0.0/src/poop_detector/gui/static/notification_target.js +47 -0
  220. poop_detector-1.0.0/src/poop_detector/gui/static/passkey.js +135 -0
  221. poop_detector-1.0.0/src/poop_detector/gui/static/paw.svg +1 -0
  222. poop_detector-1.0.0/src/poop_detector/gui/static/push.js +80 -0
  223. poop_detector-1.0.0/src/poop_detector/gui/static/restart.js +56 -0
  224. poop_detector-1.0.0/src/poop_detector/gui/static/sw.js +67 -0
  225. poop_detector-1.0.0/src/poop_detector/gui/static/weight_chart.js +20 -0
  226. poop_detector-1.0.0/src/poop_detector/gui/templates/_benchmark_candidate.html +25 -0
  227. poop_detector-1.0.0/src/poop_detector/gui/templates/_confirmation.html +13 -0
  228. poop_detector-1.0.0/src/poop_detector/gui/templates/_live_panel.html +31 -0
  229. poop_detector-1.0.0/src/poop_detector/gui/templates/_macros.html +79 -0
  230. poop_detector-1.0.0/src/poop_detector/gui/templates/_review_bar.html +2 -0
  231. poop_detector-1.0.0/src/poop_detector/gui/templates/_weight_chart.html +47 -0
  232. poop_detector-1.0.0/src/poop_detector/gui/templates/account.html +64 -0
  233. poop_detector-1.0.0/src/poop_detector/gui/templates/activity.html +27 -0
  234. poop_detector-1.0.0/src/poop_detector/gui/templates/advice.html +58 -0
  235. poop_detector-1.0.0/src/poop_detector/gui/templates/advice_foods.html +53 -0
  236. poop_detector-1.0.0/src/poop_detector/gui/templates/advice_thread.html +35 -0
  237. poop_detector-1.0.0/src/poop_detector/gui/templates/areas.html +51 -0
  238. poop_detector-1.0.0/src/poop_detector/gui/templates/audit.html +13 -0
  239. poop_detector-1.0.0/src/poop_detector/gui/templates/base.html +29 -0
  240. poop_detector-1.0.0/src/poop_detector/gui/templates/capacity.html +3 -0
  241. poop_detector-1.0.0/src/poop_detector/gui/templates/care.html +95 -0
  242. poop_detector-1.0.0/src/poop_detector/gui/templates/checks.html +20 -0
  243. poop_detector-1.0.0/src/poop_detector/gui/templates/clips.html +111 -0
  244. poop_detector-1.0.0/src/poop_detector/gui/templates/digest.html +30 -0
  245. poop_detector-1.0.0/src/poop_detector/gui/templates/digest_list.html +13 -0
  246. poop_detector-1.0.0/src/poop_detector/gui/templates/email_confirm.html +14 -0
  247. poop_detector-1.0.0/src/poop_detector/gui/templates/enroll.html +14 -0
  248. poop_detector-1.0.0/src/poop_detector/gui/templates/events.html +41 -0
  249. poop_detector-1.0.0/src/poop_detector/gui/templates/export.html +29 -0
  250. poop_detector-1.0.0/src/poop_detector/gui/templates/export_summary.html +42 -0
  251. poop_detector-1.0.0/src/poop_detector/gui/templates/first_setup.html +42 -0
  252. poop_detector-1.0.0/src/poop_detector/gui/templates/floor.html +25 -0
  253. poop_detector-1.0.0/src/poop_detector/gui/templates/home.html +82 -0
  254. poop_detector-1.0.0/src/poop_detector/gui/templates/invite.html +21 -0
  255. poop_detector-1.0.0/src/poop_detector/gui/templates/login.html +13 -0
  256. poop_detector-1.0.0/src/poop_detector/gui/templates/logout.html +9 -0
  257. poop_detector-1.0.0/src/poop_detector/gui/templates/management.html +52 -0
  258. poop_detector-1.0.0/src/poop_detector/gui/templates/message.html +8 -0
  259. poop_detector-1.0.0/src/poop_detector/gui/templates/models.html +161 -0
  260. poop_detector-1.0.0/src/poop_detector/gui/templates/night.html +23 -0
  261. poop_detector-1.0.0/src/poop_detector/gui/templates/night_list.html +18 -0
  262. poop_detector-1.0.0/src/poop_detector/gui/templates/presence.html +28 -0
  263. poop_detector-1.0.0/src/poop_detector/gui/templates/record_new.html +30 -0
  264. poop_detector-1.0.0/src/poop_detector/gui/templates/records.html +81 -0
  265. poop_detector-1.0.0/src/poop_detector/gui/templates/review.html +40 -0
  266. poop_detector-1.0.0/src/poop_detector/gui/templates/review_dismiss.html +12 -0
  267. poop_detector-1.0.0/src/poop_detector/gui/templates/settings.html +50 -0
  268. poop_detector-1.0.0/src/poop_detector/gui/templates/sleep.html +45 -0
  269. poop_detector-1.0.0/src/poop_detector/gui/templates/storage.html +21 -0
  270. poop_detector-1.0.0/src/poop_detector/gui/templates/style.css +282 -0
  271. poop_detector-1.0.0/src/poop_detector/gui/templates/tray.html +49 -0
  272. poop_detector-1.0.0/src/poop_detector/gui/templates/trends.html +22 -0
  273. poop_detector-1.0.0/src/poop_detector/gui/templates/users.html +42 -0
  274. poop_detector-1.0.0/src/poop_detector/gui/templates/vocal.html +42 -0
  275. poop_detector-1.0.0/src/poop_detector/gui/templates/weights.html +35 -0
  276. poop_detector-1.0.0/src/poop_detector/gui/templating.py +46 -0
  277. poop_detector-1.0.0/src/poop_detector/gui/themes.py +21 -0
  278. poop_detector-1.0.0/src/poop_detector/gui/trends_page.py +58 -0
  279. poop_detector-1.0.0/src/poop_detector/gui/trends_routes.py +38 -0
  280. poop_detector-1.0.0/src/poop_detector/gui/vocal_routes.py +125 -0
  281. poop_detector-1.0.0/src/poop_detector/gui/weight_chart.py +82 -0
  282. poop_detector-1.0.0/src/poop_detector/gui/weight_routes.py +88 -0
  283. poop_detector-1.0.0/src/poop_detector/mac_app.py +96 -0
  284. poop_detector-1.0.0/src/poop_detector/main.py +445 -0
  285. poop_detector-1.0.0/src/poop_detector/notifications.py +425 -0
  286. poop_detector-1.0.0/src/poop_detector/platform_support.py +27 -0
  287. poop_detector-1.0.0/src/poop_detector/records/__init__.py +1 -0
  288. poop_detector-1.0.0/src/poop_detector/records/absences.py +124 -0
  289. poop_detector-1.0.0/src/poop_detector/records/advice.py +251 -0
  290. poop_detector-1.0.0/src/poop_detector/records/away_periods.py +87 -0
  291. poop_detector-1.0.0/src/poop_detector/records/backup.py +304 -0
  292. poop_detector-1.0.0/src/poop_detector/records/breeds.py +81 -0
  293. poop_detector-1.0.0/src/poop_detector/records/care.py +289 -0
  294. poop_detector-1.0.0/src/poop_detector/records/database.py +1028 -0
  295. poop_detector-1.0.0/src/poop_detector/records/digest_summaries.py +115 -0
  296. poop_detector-1.0.0/src/poop_detector/records/events.py +399 -0
  297. poop_detector-1.0.0/src/poop_detector/records/export.py +197 -0
  298. poop_detector-1.0.0/src/poop_detector/records/feeding_advice.py +240 -0
  299. poop_detector-1.0.0/src/poop_detector/records/feeding_plans.py +125 -0
  300. poop_detector-1.0.0/src/poop_detector/records/floor_objects.py +181 -0
  301. poop_detector-1.0.0/src/poop_detector/records/foods.py +202 -0
  302. poop_detector-1.0.0/src/poop_detector/records/profile.py +86 -0
  303. poop_detector-1.0.0/src/poop_detector/records/record_stats.py +29 -0
  304. poop_detector-1.0.0/src/poop_detector/records/sheet_wear.py +105 -0
  305. poop_detector-1.0.0/src/poop_detector/records/vocal_episodes.py +153 -0
  306. poop_detector-1.0.0/src/poop_detector/records/weights.py +88 -0
  307. poop_detector-1.0.0/src/poop_detector/redaction.py +51 -0
  308. poop_detector-1.0.0/src/poop_detector/settings_file.py +188 -0
  309. poop_detector-1.0.0/src/poop_detector/timezones.py +34 -0
  310. poop_detector-1.0.0/src/poop_detector/video/__init__.py +1 -0
  311. poop_detector-1.0.0/src/poop_detector/video/agy_workspace.py +52 -0
  312. poop_detector-1.0.0/src/poop_detector/video/benchmark.py +284 -0
  313. poop_detector-1.0.0/src/poop_detector/video/benchmark_candidates.py +107 -0
  314. poop_detector-1.0.0/src/poop_detector/video/benchmark_results.py +214 -0
  315. poop_detector-1.0.0/src/poop_detector/video/benchmark_sets.py +579 -0
  316. poop_detector-1.0.0/src/poop_detector/video/cli_versions.py +42 -0
  317. poop_detector-1.0.0/src/poop_detector/video/clip_labels.py +254 -0
  318. poop_detector-1.0.0/src/poop_detector/video/clip_reviews.py +436 -0
  319. poop_detector-1.0.0/src/poop_detector/video/clip_screenings.py +81 -0
  320. poop_detector-1.0.0/src/poop_detector/video/clip_storage.py +215 -0
  321. poop_detector-1.0.0/src/poop_detector/video/clips.py +289 -0
  322. poop_detector-1.0.0/src/poop_detector/video/codex_cli.py +173 -0
  323. poop_detector-1.0.0/src/poop_detector/video/gemini_api.py +186 -0
  324. poop_detector-1.0.0/src/poop_detector/video/gemini_credits.py +179 -0
  325. poop_detector-1.0.0/src/poop_detector/video/judge_failures.py +95 -0
  326. poop_detector-1.0.0/src/poop_detector/video/judge_models.py +112 -0
  327. poop_detector-1.0.0/src/poop_detector/video/judge_readiness.py +45 -0
  328. poop_detector-1.0.0/src/poop_detector/video/judge_runs.py +270 -0
  329. poop_detector-1.0.0/src/poop_detector/video/judge_source.py +183 -0
  330. poop_detector-1.0.0/src/poop_detector/video/plan_usage.py +298 -0
  331. poop_detector-1.0.0/src/poop_detector/video/providers.py +469 -0
  332. poop_detector-1.0.0/src/poop_detector/video/recording.py +478 -0
  333. poop_detector-1.0.0/src/poop_detector/video/review.py +983 -0
  334. poop_detector-1.0.0/src/poop_detector/video/review_dismissals.py +46 -0
  335. poop_detector-1.0.0/src/poop_detector/video/review_status.py +58 -0
  336. poop_detector-1.0.0/src/poop_detector/video/thumbnails.py +78 -0
  337. poop_detector-1.0.0/src/poop_detector/video/token_usage.py +97 -0
  338. poop_detector-1.0.0/src/poop_detector/web_address.py +148 -0
  339. poop_detector-1.0.0/src/poop_detector/web_push.py +342 -0
  340. poop_detector-1.0.0/tests/conftest.py +63 -0
  341. poop_detector-1.0.0/tests/passkey_client.py +61 -0
  342. poop_detector-1.0.0/tests/soft_authenticator.py +105 -0
  343. poop_detector-1.0.0/tests/support.py +238 -0
  344. poop_detector-1.0.0/tests/test_accounts.py +433 -0
  345. poop_detector-1.0.0/tests/test_activity_map.py +161 -0
  346. poop_detector-1.0.0/tests/test_advice_jobs.py +185 -0
  347. poop_detector-1.0.0/tests/test_advice_prompts.py +242 -0
  348. poop_detector-1.0.0/tests/test_advice_store.py +197 -0
  349. poop_detector-1.0.0/tests/test_advice_worker.py +310 -0
  350. poop_detector-1.0.0/tests/test_app_icons.py +68 -0
  351. poop_detector-1.0.0/tests/test_atomic_file.py +34 -0
  352. poop_detector-1.0.0/tests/test_away_digest.py +267 -0
  353. poop_detector-1.0.0/tests/test_backup.py +219 -0
  354. poop_detector-1.0.0/tests/test_backup_cli.py +81 -0
  355. poop_detector-1.0.0/tests/test_benchmark_candidates.py +230 -0
  356. poop_detector-1.0.0/tests/test_benchmark_sets.py +403 -0
  357. poop_detector-1.0.0/tests/test_benchmark_variants.py +140 -0
  358. poop_detector-1.0.0/tests/test_camera.py +101 -0
  359. poop_detector-1.0.0/tests/test_circling.py +101 -0
  360. poop_detector-1.0.0/tests/test_circling_compare.py +283 -0
  361. poop_detector-1.0.0/tests/test_cli.py +962 -0
  362. poop_detector-1.0.0/tests/test_clip_filter_kept.py +75 -0
  363. poop_detector-1.0.0/tests/test_clip_gui.py +327 -0
  364. poop_detector-1.0.0/tests/test_clip_page_top.py +182 -0
  365. poop_detector-1.0.0/tests/test_clip_playback.py +53 -0
  366. poop_detector-1.0.0/tests/test_clip_storage.py +466 -0
  367. poop_detector-1.0.0/tests/test_clip_thumbnails.py +140 -0
  368. poop_detector-1.0.0/tests/test_clip_video_cache.py +62 -0
  369. poop_detector-1.0.0/tests/test_clips.py +283 -0
  370. poop_detector-1.0.0/tests/test_commands.py +154 -0
  371. poop_detector-1.0.0/tests/test_config.py +174 -0
  372. poop_detector-1.0.0/tests/test_connection_settings.py +50 -0
  373. poop_detector-1.0.0/tests/test_customization.py +275 -0
  374. poop_detector-1.0.0/tests/test_daily_trends.py +261 -0
  375. poop_detector-1.0.0/tests/test_database.py +966 -0
  376. poop_detector-1.0.0/tests/test_detection.py +28 -0
  377. poop_detector-1.0.0/tests/test_detection_incremental.py +127 -0
  378. poop_detector-1.0.0/tests/test_detection_occlusion.py +51 -0
  379. poop_detector-1.0.0/tests/test_diagnose.py +119 -0
  380. poop_detector-1.0.0/tests/test_digest_summary.py +248 -0
  381. poop_detector-1.0.0/tests/test_dog.py +254 -0
  382. poop_detector-1.0.0/tests/test_early_alert.py +155 -0
  383. poop_detector-1.0.0/tests/test_endpoint_change.py +103 -0
  384. poop_detector-1.0.0/tests/test_errors.py +166 -0
  385. poop_detector-1.0.0/tests/test_event_detail.py +94 -0
  386. poop_detector-1.0.0/tests/test_event_quick_confirm.py +83 -0
  387. poop_detector-1.0.0/tests/test_events.py +31 -0
  388. poop_detector-1.0.0/tests/test_excretion_records.py +70 -0
  389. poop_detector-1.0.0/tests/test_export_dotenv.py +51 -0
  390. poop_detector-1.0.0/tests/test_feeding_advice.py +317 -0
  391. poop_detector-1.0.0/tests/test_feeding_plans.py +277 -0
  392. poop_detector-1.0.0/tests/test_floor_judge.py +251 -0
  393. poop_detector-1.0.0/tests/test_floor_objects.py +339 -0
  394. poop_detector-1.0.0/tests/test_foods.py +137 -0
  395. poop_detector-1.0.0/tests/test_form_field_styles.py +57 -0
  396. poop_detector-1.0.0/tests/test_gemini_api.py +222 -0
  397. poop_detector-1.0.0/tests/test_gemini_credits.py +100 -0
  398. poop_detector-1.0.0/tests/test_gui_account.py +299 -0
  399. poop_detector-1.0.0/tests/test_gui_advice.py +525 -0
  400. poop_detector-1.0.0/tests/test_gui_areas.py +384 -0
  401. poop_detector-1.0.0/tests/test_gui_asgi.py +105 -0
  402. poop_detector-1.0.0/tests/test_gui_audit.py +149 -0
  403. poop_detector-1.0.0/tests/test_gui_busy.py +60 -0
  404. poop_detector-1.0.0/tests/test_gui_cache.py +129 -0
  405. poop_detector-1.0.0/tests/test_gui_care.py +388 -0
  406. poop_detector-1.0.0/tests/test_gui_checks.py +181 -0
  407. poop_detector-1.0.0/tests/test_gui_compression.py +67 -0
  408. poop_detector-1.0.0/tests/test_gui_escaping.py +136 -0
  409. poop_detector-1.0.0/tests/test_gui_export.py +128 -0
  410. poop_detector-1.0.0/tests/test_gui_first_setup.py +73 -0
  411. poop_detector-1.0.0/tests/test_gui_home.py +412 -0
  412. poop_detector-1.0.0/tests/test_gui_manual_mode.py +55 -0
  413. poop_detector-1.0.0/tests/test_gui_models.py +634 -0
  414. poop_detector-1.0.0/tests/test_gui_navigation.py +375 -0
  415. poop_detector-1.0.0/tests/test_gui_passkeys.py +253 -0
  416. poop_detector-1.0.0/tests/test_gui_public.py +110 -0
  417. poop_detector-1.0.0/tests/test_gui_push.py +191 -0
  418. poop_detector-1.0.0/tests/test_gui_records.py +170 -0
  419. poop_detector-1.0.0/tests/test_gui_restart.py +60 -0
  420. poop_detector-1.0.0/tests/test_gui_review.py +341 -0
  421. poop_detector-1.0.0/tests/test_gui_roles.py +151 -0
  422. poop_detector-1.0.0/tests/test_gui_routes.py +103 -0
  423. poop_detector-1.0.0/tests/test_gui_sessions.py +247 -0
  424. poop_detector-1.0.0/tests/test_gui_settings.py +194 -0
  425. poop_detector-1.0.0/tests/test_gui_weights.py +121 -0
  426. poop_detector-1.0.0/tests/test_home_notice.py +233 -0
  427. poop_detector-1.0.0/tests/test_hourly_chart.py +97 -0
  428. poop_detector-1.0.0/tests/test_invitation_mail.py +64 -0
  429. poop_detector-1.0.0/tests/test_judge_failures.py +65 -0
  430. poop_detector-1.0.0/tests/test_judge_fallback.py +123 -0
  431. poop_detector-1.0.0/tests/test_judge_models.py +70 -0
  432. poop_detector-1.0.0/tests/test_judge_readiness.py +22 -0
  433. poop_detector-1.0.0/tests/test_judge_runs.py +195 -0
  434. poop_detector-1.0.0/tests/test_label_gui.py +286 -0
  435. poop_detector-1.0.0/tests/test_list_time.py +112 -0
  436. poop_detector-1.0.0/tests/test_live_bandwidth.py +95 -0
  437. poop_detector-1.0.0/tests/test_live_gui.py +189 -0
  438. poop_detector-1.0.0/tests/test_mac_app.py +88 -0
  439. poop_detector-1.0.0/tests/test_mac_notifier.py +21 -0
  440. poop_detector-1.0.0/tests/test_management_gui.py +131 -0
  441. poop_detector-1.0.0/tests/test_markdown_text.py +91 -0
  442. poop_detector-1.0.0/tests/test_masked_roi.py +106 -0
  443. poop_detector-1.0.0/tests/test_mobile_clip_review.py +118 -0
  444. poop_detector-1.0.0/tests/test_model_status.py +181 -0
  445. poop_detector-1.0.0/tests/test_monitor.py +74 -0
  446. poop_detector-1.0.0/tests/test_monitor_resets.py +149 -0
  447. poop_detector-1.0.0/tests/test_monitor_stages.py +389 -0
  448. poop_detector-1.0.0/tests/test_night_digest.py +269 -0
  449. poop_detector-1.0.0/tests/test_ntfy.py +127 -0
  450. poop_detector-1.0.0/tests/test_outside_scope.py +38 -0
  451. poop_detector-1.0.0/tests/test_outside_stay.py +282 -0
  452. poop_detector-1.0.0/tests/test_pipeline.py +84 -0
  453. poop_detector-1.0.0/tests/test_plan_usage.py +290 -0
  454. poop_detector-1.0.0/tests/test_platform_support.py +108 -0
  455. poop_detector-1.0.0/tests/test_polygon_roi.py +118 -0
  456. poop_detector-1.0.0/tests/test_presence.py +296 -0
  457. poop_detector-1.0.0/tests/test_profile.py +108 -0
  458. poop_detector-1.0.0/tests/test_record_new_quick.py +129 -0
  459. poop_detector-1.0.0/tests/test_records_between.py +113 -0
  460. poop_detector-1.0.0/tests/test_records_export.py +117 -0
  461. poop_detector-1.0.0/tests/test_reentry.py +622 -0
  462. poop_detector-1.0.0/tests/test_review_benchmark.py +180 -0
  463. poop_detector-1.0.0/tests/test_review_dismissals.py +107 -0
  464. poop_detector-1.0.0/tests/test_review_providers.py +407 -0
  465. poop_detector-1.0.0/tests/test_review_queue.py +150 -0
  466. poop_detector-1.0.0/tests/test_review_status.py +96 -0
  467. poop_detector-1.0.0/tests/test_roi.py +28 -0
  468. poop_detector-1.0.0/tests/test_screening.py +339 -0
  469. poop_detector-1.0.0/tests/test_settings_file.py +161 -0
  470. poop_detector-1.0.0/tests/test_sheet_wear.py +293 -0
  471. poop_detector-1.0.0/tests/test_sleep.py +429 -0
  472. poop_detector-1.0.0/tests/test_sleep_motion.py +516 -0
  473. poop_detector-1.0.0/tests/test_sleep_page.py +300 -0
  474. poop_detector-1.0.0/tests/test_sleep_store.py +42 -0
  475. poop_detector-1.0.0/tests/test_state_machine.py +31 -0
  476. poop_detector-1.0.0/tests/test_stool_condition.py +181 -0
  477. poop_detector-1.0.0/tests/test_stool_condition_label.py +78 -0
  478. poop_detector-1.0.0/tests/test_themes.py +289 -0
  479. poop_detector-1.0.0/tests/test_time_fields.py +22 -0
  480. poop_detector-1.0.0/tests/test_token_usage.py +141 -0
  481. poop_detector-1.0.0/tests/test_tray_registration.py +90 -0
  482. poop_detector-1.0.0/tests/test_tray_tracking.py +368 -0
  483. poop_detector-1.0.0/tests/test_video_review.py +1025 -0
  484. poop_detector-1.0.0/tests/test_vocal.py +309 -0
  485. poop_detector-1.0.0/tests/test_vocal_model.py +323 -0
  486. poop_detector-1.0.0/tests/test_watchdog.py +377 -0
  487. poop_detector-1.0.0/tests/test_web_address.py +125 -0
  488. poop_detector-1.0.0/tests/test_web_push.py +284 -0
  489. poop_detector-1.0.0/tests/test_wording.py +67 -0
  490. poop_detector-1.0.0/uv.lock +1846 -0
@@ -0,0 +1,10 @@
1
+ .git
2
+ .venv
3
+ .env*
4
+ data
5
+ config/config.yaml
6
+ work
7
+ __pycache__
8
+ .pytest_cache
9
+ .ruff_cache
10
+ tests
@@ -0,0 +1,27 @@
1
+ # .env にコピーし、EufyアプリのRTSP URLを入力してください。
2
+ POOP_RTSP_URL=
3
+ # スマートフォンへ ntfy で送る場合のみ、トピック名を設定してください。
4
+ POOP_NTFY_TOPIC=
5
+ # 見守り通知を分ける場合のみ、通常通知と異なるトピック名を設定してください。
6
+ POOP_NTFY_EARLY_TOPIC=
7
+ # 自分で運用する ntfy サーバーを使う場合のみ、URL を設定してください(既定は https://ntfy.sh)。
8
+ POOP_NTFY_SERVER=
9
+
10
+ # 判定器に gemini-api を選ぶ場合のみ、Google AI Studio の API キーを設定します。
11
+ GEMINI_API_KEY=
12
+
13
+ # 管理画面に開発者クレジットを表示する場合のみ、BigQuery の請求エクスポートと付与情報を設定します。
14
+ # テーブルは「プロジェクト.データセット.テーブル」の形式。通貨は JPY、USD などの3文字。
15
+ POOP_GEMINI_BILLING_TABLE=
16
+ POOP_GEMINI_CREDIT_ID=
17
+ POOP_GEMINI_CREDIT_AMOUNT=
18
+ POOP_GEMINI_CREDIT_CURRENCY=
19
+ # Cloud Billing のクレジット開始日(YYYY-MM-DD)。
20
+ POOP_GEMINI_CREDIT_START_DATE=
21
+
22
+ # GUI の招待・アドレス確認・パスキー復旧をメールで送る場合のみ設定します。
23
+ POOP_SMTP_HOST=
24
+ POOP_SMTP_PORT=587
25
+ POOP_SMTP_FROM=
26
+ POOP_SMTP_USERNAME=
27
+ POOP_SMTP_PASSWORD=
@@ -0,0 +1,67 @@
1
+ name: 不具合の報告 / Bug report
2
+ description: 期待どおりに動かないことを報告します。Report something that does not work as expected.
3
+ labels: [bug]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ 日本語でも英語でも書けます。You can write in Japanese or English.
9
+
10
+ **実際のカメラの画像・動画、RTSP の URL、ntfy のトピック名、`.env` や `data/` の中身は貼らないでください。** この Issue は誰でも読めます。
11
+ Do not attach real camera footage, RTSP URLs, ntfy topic names, or the contents of `.env` or `data/`.
12
+ - type: textarea
13
+ id: what-happened
14
+ attributes:
15
+ label: 起きたこと / What happened
16
+ description: 何をしたら、何が起きたか。表示されたエラーメッセージがあれば、認証情報を伏せて貼ってください。
17
+ validations:
18
+ required: true
19
+ - type: textarea
20
+ id: expected
21
+ attributes:
22
+ label: 期待した動作 / Expected behavior
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: steps
27
+ attributes:
28
+ label: 再現手順 / Steps to reproduce
29
+ description: 実行したコマンドとオプション(例:`uv run poop-detector run --dog --track-tray`)。
30
+ placeholder: |
31
+ 1.
32
+ 2.
33
+ 3.
34
+ validations:
35
+ required: true
36
+ - type: textarea
37
+ id: diagnose
38
+ attributes:
39
+ label: 診断情報 / Diagnostics
40
+ description: "`uv run poop-detector diagnose` の出力。URL・トピック名・保存先のパスは含まれません。Output of `uv run poop-detector diagnose` (contains no URLs, topics or paths)."
41
+ render: yaml
42
+ - type: input
43
+ id: os
44
+ attributes:
45
+ label: OS
46
+ placeholder: macOS 15 (Apple Silicon) / Ubuntu 24.04 / Docker
47
+ validations:
48
+ required: true
49
+ - type: input
50
+ id: python
51
+ attributes:
52
+ label: Python のバージョン / Python version
53
+ description: "`uv run python --version` の出力"
54
+ validations:
55
+ required: true
56
+ - type: input
57
+ id: camera
58
+ attributes:
59
+ label: カメラの種類 / Camera
60
+ description: メーカーと型番。URL は書かないでください。
61
+ placeholder: Eufy Indoor Cam 2K
62
+ - type: textarea
63
+ id: config
64
+ attributes:
65
+ label: 設定 / Configuration
66
+ description: "`config/config.yaml` のうち、既定値から変えた項目(任意)。`.env` は貼らないでください。"
67
+ render: yaml
@@ -0,0 +1,11 @@
1
+ blank_issues_enabled: true
2
+ contact_links:
3
+ - name: セキュリティの報告 / Security report
4
+ url: https://github.com/ysakae/poop-detector/blob/main/SECURITY.md
5
+ about: 脆弱性は公開の Issue に書かず、こちらの方法で非公開で報告してください。Report vulnerabilities privately.
6
+ - name: 使い方の説明 / Documentation
7
+ url: https://github.com/ysakae/poop-detector/tree/main/docs
8
+ about: 設定や機能の詳しい説明です。Detailed documentation (in Japanese).
9
+ - name: コントリビューションの手引き / Contributing guide
10
+ url: https://github.com/ysakae/poop-detector/blob/main/CONTRIBUTING.md
11
+ about: Issue とプルリクエストの書き方です。How to report issues and send pull requests.
@@ -0,0 +1,35 @@
1
+ name: 機能の提案 / Feature request
2
+ description: 新しい機能や改善を提案します。Suggest a new feature or an improvement.
3
+ labels: [enhancement]
4
+ body:
5
+ - type: markdown
6
+ attributes:
7
+ value: |
8
+ 日本語でも英語でも書けます。You can write in Japanese or English.
9
+ 個人の実験的なプロジェクトのため、すべての提案には対応できません。大きな変更は、実装する前にここで相談してください。
10
+ - type: textarea
11
+ id: problem
12
+ attributes:
13
+ label: 困っていること / Problem
14
+ description: どんな場面で、何に困っているか。
15
+ validations:
16
+ required: true
17
+ - type: textarea
18
+ id: proposal
19
+ attributes:
20
+ label: 提案 / Proposal
21
+ description: どうなるとよいか。
22
+ validations:
23
+ required: true
24
+ - type: textarea
25
+ id: alternatives
26
+ attributes:
27
+ label: ほかに考えた方法 / Alternatives considered
28
+ - type: dropdown
29
+ id: contribute
30
+ attributes:
31
+ label: 自分で実装しますか / Would you implement it?
32
+ options:
33
+ - まだ分からない / Not sure
34
+ - はい / Yes
35
+ - いいえ / No
@@ -0,0 +1,28 @@
1
+ # 依存関係と GitHub Actions、Docker のベースイメージの更新を週に1回確かめる。
2
+ # 小さな更新はまとめて1つの PR にし、PR の数を抑える。
3
+ version: 2
4
+ updates:
5
+ - package-ecosystem: "uv"
6
+ directory: "/"
7
+ schedule:
8
+ interval: "weekly"
9
+ commit-message:
10
+ prefix: "chore"
11
+ groups:
12
+ python-minor-and-patch:
13
+ update-types: ["minor", "patch"]
14
+ - package-ecosystem: "github-actions"
15
+ directory: "/"
16
+ schedule:
17
+ interval: "weekly"
18
+ commit-message:
19
+ prefix: "ci"
20
+ groups:
21
+ actions:
22
+ patterns: ["*"]
23
+ - package-ecosystem: "docker"
24
+ directory: "/"
25
+ schedule:
26
+ interval: "weekly"
27
+ commit-message:
28
+ prefix: "chore"
@@ -0,0 +1,25 @@
1
+ ## 変更内容 / What changed
2
+
3
+ <!-- 何を変えたか。日本語でも英語でも構いません。 -->
4
+
5
+ ## 変更理由 / Why
6
+
7
+ <!-- なぜ変えたか。関連する Issue があれば `Closes #番号` と書いてください。 -->
8
+
9
+ ## 確認手順と結果 / How it was tested
10
+
11
+ - [ ] `uv run pytest`
12
+ - [ ] `uv run ruff check .`
13
+ - [ ] `uv run ruff format --check .`
14
+ - [ ] テストを先に追加し、変更前に失敗することを確認した / Added tests first and saw them fail
15
+
16
+ <!-- ほかに確認したことがあれば書いてください。 -->
17
+
18
+ ## スクリーンショット / Screenshots
19
+
20
+ <!-- 画面を変えた場合だけ。人工データで撮ってください。実際のカメラ映像は貼らないでください。 -->
21
+
22
+ ## チェック / Checklist
23
+
24
+ - [ ] 実際のカメラ映像、RTSP の URL、ntfy のトピック名、`.env` や `data/` の中身を含めていない
25
+ - [ ] コミットメッセージは Conventional Commits の形式にした
@@ -0,0 +1,120 @@
1
+ # 静的解析、テスト、Docker イメージの確認。カメラや実データは使わず、人工データだけで行う。
2
+ name: CI
3
+
4
+ on:
5
+ push:
6
+ branches: [main]
7
+ pull_request:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ concurrency:
13
+ group: ci-${{ github.ref }}
14
+ cancel-in-progress: true
15
+
16
+ jobs:
17
+ lint:
18
+ name: 静的解析
19
+ runs-on: ubuntu-24.04
20
+ timeout-minutes: 10
21
+ steps:
22
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
23
+ with:
24
+ persist-credentials: false
25
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
26
+ - name: 依存関係を導入
27
+ run: uv sync --frozen
28
+ - name: Ruff の検査
29
+ run: uv run ruff check .
30
+ - name: 書式の確認
31
+ run: uv run ruff format --check .
32
+ - name: 型チェック
33
+ run: uv run mypy
34
+
35
+ package:
36
+ name: パッケージのビルド
37
+ runs-on: ubuntu-24.04
38
+ timeout-minutes: 10
39
+ steps:
40
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41
+ with:
42
+ persist-credentials: false
43
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
44
+ - name: sdist と wheel を作る
45
+ run: uv build
46
+ - name: メタデータを検査
47
+ run: uvx twine check --strict dist/*
48
+ - name: wheel からインストールして起動する
49
+ run: |
50
+ cd "$RUNNER_TEMP"
51
+ uvx --isolated --from "$GITHUB_WORKSPACE"/dist/*.whl poop-detector --help
52
+
53
+ test:
54
+ name: テスト(Python ${{ matrix.python }})
55
+ runs-on: ubuntu-24.04
56
+ # キャッシュがない初回は FFmpeg の取得に時間がかかることがあるので、余裕を持たせる
57
+ timeout-minutes: 25
58
+ strategy:
59
+ fail-fast: false
60
+ matrix:
61
+ # requires-python の下限と、開発に使う .python-version の版
62
+ python: ["3.11", "3.12"]
63
+ env:
64
+ UV_PYTHON: ${{ matrix.python }}
65
+ steps:
66
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
67
+ with:
68
+ persist-credentials: false
69
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
70
+ - name: パッケージの一覧を更新
71
+ id: apt
72
+ run: |
73
+ sudo apt-get update
74
+ # キャッシュの名前に使う FFmpeg の版(7:6.1.1-3ubuntu5 の「:」は使わない)
75
+ version=$(apt-cache policy ffmpeg | awk '/Candidate:/ {print $2}' | tr ':' '-')
76
+ echo "ffmpeg=$version" >> "$GITHUB_OUTPUT"
77
+ # Ubuntu のミラーが遅いと FFmpeg とその依存(約60MB)の取得だけで10分を超え、
78
+ # ジョブの制限時間で打ち切られる。取得した .deb をキャッシュし、次からは取り直さない。
79
+ - name: FFmpeg のパッケージをキャッシュから戻す
80
+ uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
81
+ with:
82
+ path: ~/apt-archives
83
+ key: ffmpeg-debs-${{ runner.os }}-${{ steps.apt.outputs.ffmpeg }}
84
+ - name: FFmpeg を導入
85
+ run: |
86
+ mkdir -p ~/apt-archives/partial
87
+ sudo apt-get install -y --no-install-recommends \
88
+ -o Dir::Cache::Archives="$HOME/apt-archives" \
89
+ -o APT::Keep-Downloaded-Packages=true \
90
+ ffmpeg
91
+ # apt が root で作ったファイルを、キャッシュに保存できる持ち主に戻す。
92
+ sudo rm -f ~/apt-archives/lock
93
+ sudo chown -R "$(id -u):$(id -g)" ~/apt-archives
94
+ - name: 依存関係を導入
95
+ run: uv sync --frozen
96
+ - name: Python の版を確認
97
+ run: uv run python --version
98
+ - name: テストとカバレッジ
99
+ # 下限は pyproject.toml の [tool.coverage.report] fail_under
100
+ run: uv run pytest --cov
101
+ - name: 主要な機能の動作確認
102
+ run: uv run python scripts/smoke-check.py
103
+
104
+ docker:
105
+ name: Docker イメージ
106
+ runs-on: ubuntu-24.04
107
+ timeout-minutes: 20
108
+ steps:
109
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
110
+ with:
111
+ persist-credentials: false
112
+ - name: イメージをビルド
113
+ run: docker build -t poop-detector .
114
+ - name: CLI が起動する
115
+ run: docker run --rm poop-detector --help
116
+ - name: コンテナ内で主要な機能の動作確認
117
+ run: >-
118
+ docker run --rm --entrypoint python
119
+ -v "$PWD/scripts:/scripts:ro"
120
+ poop-detector /scripts/smoke-check.py
@@ -0,0 +1,41 @@
1
+ # Apple Silicon の Finder から起動する試用版を作る。
2
+ name: macOS 試用版
3
+
4
+ on:
5
+ pull_request:
6
+ paths:
7
+ - '.github/workflows/macos-preview.yml'
8
+ - 'src/**'
9
+ - 'pyproject.toml'
10
+ - 'uv.lock'
11
+ workflow_dispatch:
12
+
13
+ permissions:
14
+ contents: read
15
+
16
+ jobs:
17
+ app:
18
+ runs-on: macos-15
19
+ timeout-minutes: 15
20
+ steps:
21
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
22
+ with:
23
+ persist-credentials: false
24
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
25
+ - name: アプリをビルド
26
+ run: |
27
+ uv run --frozen --no-dev --with pyinstaller==6.22.2 pyinstaller \
28
+ --windowed --name 'Poop Detector' \
29
+ --osx-bundle-identifier com.github.ysakae.poop-detector \
30
+ --target-architecture arm64 --collect-data poop_detector \
31
+ --collect-submodules uvicorn --collect-submodules anyio._backends \
32
+ src/poop_detector/mac_app.py
33
+ - name: アプリを検証して圧縮
34
+ run: |
35
+ codesign --verify --deep --strict 'dist/Poop Detector.app'
36
+ ditto -c -k --keepParent 'dist/Poop Detector.app' dist/Poop-Detector-mac-arm64.zip
37
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
38
+ with:
39
+ name: Poop-Detector-mac-arm64
40
+ path: dist/Poop-Detector-mac-arm64.zip
41
+ if-no-files-found: error
@@ -0,0 +1,89 @@
1
+ # GitHub Release を公開したときに、パッケージを作って PyPI に公開する。
2
+ # PyPI 側には Trusted Publishing の設定が必要(docs/releasing.md)。
3
+ name: Release
4
+
5
+ on:
6
+ release:
7
+ types: [published]
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ name: パッケージを作る
15
+ runs-on: ubuntu-24.04
16
+ timeout-minutes: 10
17
+ steps:
18
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
19
+ with:
20
+ persist-credentials: false
21
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
22
+ - name: タグとバージョンが一致するか確認
23
+ env:
24
+ TAG: ${{ github.event.release.tag_name }}
25
+ run: |
26
+ version=$(python3 -c "import tomllib; print(tomllib.load(open('pyproject.toml', 'rb'))['project']['version'])")
27
+ if [ "$TAG" != "v$version" ]; then
28
+ echo "タグ $TAG と pyproject.toml のバージョン $version が一致しません" >&2
29
+ exit 1
30
+ fi
31
+ - name: ビルド
32
+ run: uv build
33
+ - name: メタデータを検査
34
+ run: uvx twine check --strict dist/*
35
+ - name: sdist と wheel から CLI が起動するか確認
36
+ env:
37
+ TAG: ${{ github.event.release.tag_name }}
38
+ run: |
39
+ for archive in dist/*.tar.gz dist/*.whl; do
40
+ actual=$(uv run --isolated --no-project --with "./$archive" poop-detector --version)
41
+ test "$actual" = "${TAG#v}"
42
+ uv run --isolated --no-project --with "./$archive" poop-detector --help
43
+ done
44
+ - uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
45
+ with:
46
+ name: dist
47
+ path: dist/
48
+ if-no-files-found: error
49
+
50
+ publish:
51
+ name: PyPI に公開
52
+ needs: build
53
+ runs-on: ubuntu-24.04
54
+ timeout-minutes: 10
55
+ environment:
56
+ name: pypi
57
+ url: https://pypi.org/project/poop-detector/
58
+ permissions:
59
+ # Trusted Publishing の認証に使う。ほかの権限は与えない。
60
+ id-token: write
61
+ steps:
62
+ - uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
63
+ with:
64
+ name: dist
65
+ path: dist/
66
+ - uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
67
+
68
+ verify:
69
+ name: PyPI からインストールして確認
70
+ needs: publish
71
+ runs-on: ubuntu-24.04
72
+ timeout-minutes: 10
73
+ steps:
74
+ - uses: astral-sh/setup-uv@68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3
75
+ - name: 公開されたバージョンの CLI を起動
76
+ env:
77
+ TAG: ${{ github.event.release.tag_name }}
78
+ run: |
79
+ version=${TAG#v}
80
+ for attempt in 1 2 3 4 5; do
81
+ if actual=$(uv run --isolated --no-project --refresh-package poop-detector \
82
+ --with "poop-detector==$version" poop-detector --version); then
83
+ test "$actual" = "$version"
84
+ uv run --isolated --no-project --with "poop-detector==$version" poop-detector --help
85
+ exit 0
86
+ fi
87
+ sleep 15
88
+ done
89
+ exit 1
@@ -0,0 +1,21 @@
1
+ .venv/
2
+ __pycache__/
3
+ .pytest_cache/
4
+ .ruff_cache/
5
+ .env
6
+ .env.*
7
+ !.env.example
8
+ config/config.yaml
9
+ data/
10
+ *.mp4
11
+ *.avi
12
+ *.mov
13
+ *.sqlite*
14
+ .DS_Store
15
+
16
+ work/
17
+
18
+ # カバレッジの計測結果
19
+ .coverage
20
+ .coverage.*
21
+ htmlcov/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,43 @@
1
+ # Repository Guidelines
2
+
3
+ この文書は AI エージェント(Codex、Claude Code)向けの規約です。人間のコントリビューター向けの手順は `CONTRIBUTING.md` にあります。規約を変えるときは、両方の内容をそろえてください。
4
+
5
+ ## プロジェクト構成
6
+
7
+ - `src/poop_detector/` に Python の実装があります。`main.py` が CLI の入口(引数の解析と振り分け)で、各サブコマンドの処理は `commands/` にあります。実装は機能の成熟度(README の機能表)に合わせたサブパッケージに分かれています。中核は `detection/`(差分検知・状態遷移・監視範囲・監視ループ)、`capture/`(カメラ)、`records/`(記録の台帳と SQLite)、`video/`(動画の保存と自動判定)です。任意の機能は `features/`、実験的な機能は `experimental/` にあります。任意・実験的な機能を監視ループの本体(`detection.monitoring.Monitor`)から直接呼ばず、`MonitorExtension` として差し込んでください。
8
+ - `gui/` が記録・ラベル付け・管理の画面を提供します(`gui/server.py` がサーバーの起動と停止、`gui/asgi.py` が安全対策と振り分け、`gui/routes.py` が URL ごとの処理、`gui/pages.py`・`gui/clip_pages.py`・`gui/activity_page.py` が画面の値、`gui/templates/` が Jinja2 のテンプレート)。HTML はテンプレートで作り、文字列で組み立てないでください。`Markup` でエスケープを外してよいのは、AI の回答の Markdown を表示する `gui/markdown_text.py` だけです(生の HTML を無効にして変換し、nh3 で許したタグ・https のリンクだけに絞る)。ほかの場所で HTML を表示したくなったら、このモジュールを通すか、テンプレートで組み立ててください。ブラウザー用 JavaScript は `src/poop_detector/gui/static/`、テストは `tests/` にあります。設定例は `config/config.example.yaml`、利用手順は `README.md`、設計の概要は `docs/architecture.md` を参照してください。
9
+
10
+ ## 開発・実行コマンド
11
+
12
+ Python 3.11 以上が必要です。開発には `.python-version` の 3.12 を使い、依存関係と実行環境は `uv` で管理してください。
13
+
14
+ - `uv sync --frozen` でロック済みの依存関係を導入します。
15
+ - `uv run poop-detector check-camera` で RTSP 接続を確認します。
16
+ - `uv run poop-detector run` で監視を起動します。先に ROI と基準画像を登録してください。動画保存には FFmpeg の `libx264` が必要です。
17
+ - `uv run poop-detector gui` でローカル GUI を単独で起動します。監視と同時に起動するには `uv run poop-detector run --gui` を使います。
18
+ - `docker build -t poop-detector .` で Linux 用イメージを作成します。
19
+
20
+ ## コード規約とテスト
21
+
22
+ - Python は4スペースで字下げし、変数・関数・モジュールは `snake_case`、クラスは `PascalCase` とします。Ruff の行長設定は100文字です。ユーザーへの説明とコード内のコメントは日本語で書いてください。
23
+ - モジュールと公開クラスには、目的を1行で書いた docstring を付けます(Ruff の `D100`、`D101`)。関数の docstring は、名前と引数だけでは分からない前提や副作用があるときに書き、全関数に機械的に付けることはしません。
24
+ - Ruff で除外したルールと理由は `pyproject.toml` に書いてあります。個別に `# noqa` を付けるときは、安全と判断した理由をすぐ上のコメントに書いてください。
25
+ - コード変更では `tests/test_*.py` に `test_*` を先に追加し、失敗を確認してから最小限の実装とリファクタリングを行います。人工画像や一時ディレクトリを使い、実カメラや運用データに依存させないでください。複数のファイルで使うフィクスチャは `tests/conftest.py`、人工画像や偽のカメラなどの補助は `tests/support.py` に置きます。
26
+ - CI は `uv run pytest --cov` でカバレッジを計測し、`pyproject.toml` の `fail_under` を下回ると失敗します。下限を下げる変更には所有者の承認が必要です。テストを足して実測が上がったら、下限も引き上げてください。
27
+ - `uv run pytest` と併せて `uv run ruff check .`、`uv run ruff format --check .`、`uv run mypy` を実行し、指摘に対処してください。
28
+ - `src/` の関数には、引数と戻り値の型注釈を付けてください(mypy の `disallow_untyped_defs`)。共通の画像の型は `frames.py` にあります。OpenCV の型スタブと合わずに `# type: ignore` を付けるときは、理由をすぐ上のコメントに書いてください。文書のみの変更は `git diff --check` で確認します。
29
+
30
+ ## GitHub Flow
31
+
32
+ Codex と Claude Code は以下の手順に従います。
33
+
34
+ 1. 作業前に `git status` を確認し、既存の変更を保全します。`git fetch origin` で既定ブランチを取得し、最新の `origin/main` から `feat/`、`fix/`、`docs/` などの作業ブランチを作成します。
35
+ 2. 変更を一つの目的に絞り、コミット前に `git status`、`git diff`、`git diff --cached` を確認します。件名は `fix: ROI端の誤通知を抑制` のように Conventional Commits 形式で日本語にします。
36
+ 3. 作業ブランチを push し、`main` 宛てに Pull Request を作成します。変更理由、検証手順と結果、関連 Issue があればそのリンクを記載します。GUI の変更には人工データで撮ったスクリーンショットを添えます。
37
+ 4. レビューと設定済みのチェックを確認します。`main` や `master` への直接コミットと直接 push を禁止します。AI が PR をマージする場合は、ユーザーの明示的な指示を得てください。
38
+
39
+ ## ローカルデータと安全性
40
+
41
+ SQLite のスキーマを変えるときは、`src/poop_detector/database.py` の `MIGRATIONS` の末尾に移行処理を足してください。既存の移行処理は書き換えません。移行処理は、古いスキーマのデータベースを一時ディレクトリに作るテスト(`tests/test_database.py`)で、データが残ることを確かめてください。
42
+
43
+ RTSP URL と通知トピックは `.env` で渡してください。RTSP URL、通知トピック、`.env`、実機設定、室内の画像・動画、`data/` の SQLite などのデータはコミットしないでください。既存データや未コミットの変更を失う恐れがある操作(一括削除、SQLite データの破壊的変更を含む)、Git 履歴の書き換え、リポジトリ外のファイル変更には事前に明示的な承認を得てください。
@@ -0,0 +1,96 @@
1
+ # 変更履歴
2
+
3
+ このプロジェクトの主な変更を記録します。書式は [Keep a Changelog](https://keepachangelog.com/ja/1.1.0/) に、バージョンの付け方は [セマンティック バージョニング](https://semver.org/lang/ja/) に従います。互換性の方針は [リリースの手順](docs/releasing.md) を参照してください。
4
+
5
+ ## [Unreleased]
6
+
7
+ ## [1.0.0] - 2026-11-26
8
+
9
+ 最初の安定版です。
10
+
11
+ ### 追加
12
+
13
+ - 管理画面の稼働状況から、GUI 単独または監視と GUI を再起動し、復帰を確認できるようにする
14
+ - `poop-detector --version` でインストール済みの版を表示する
15
+
16
+ ### 変更
17
+
18
+ - GUI のすべての画面に共通の枠(監視の状態、ログイン中の人、メインメニュー、管理のメニュー)を付け、スマートフォンの幅でも押しやすくする
19
+ - 管理者の画面を `/manage` の下にまとめる(`/manage/storage`・`/manage/users`・`/manage/invite`・`/manage/audit`)。古い URL は新しい URL へ移す
20
+ - 画面の配置と遷移、CLI に残す操作を [画面の構成](docs/screens.md) にまとめる
21
+ - GUI に「確認待ち」を足す。未ラベルの検知と排泄に関わる動画を新しい順に並べ、ラベルを保存すると次の件を開く。動画のある検知は1件にまとめる
22
+ - GUI のホームをダッシュボード(確認待ちの件数、今日の回数、最近の確定記録、ライブ映像)にし、検知の一覧と目視の記録の追加を「記録」の下(`/records/events`)へ移す。古い URL は新しい URL へ移す
23
+ - GUI に「管理 › 設定」を足す。設定の表から入力欄を並べ、差分を確認してから保存する。コメントを残して変えた値だけを書き換え、直前の設定に戻せる。外からの公開に関わる項目と `data_dir` は表示だけ、接続情報は有無だけを出す
24
+ - GUI に「管理 › 確認と診断」を足す。通知のテスト送信、カメラの確認(監視中はカメラに別の接続を開かず監視の状態を示す)、診断情報を画面から行える
25
+ - GUI に「管理 › 範囲の登録」を足す。映像の上に多角形を描いて、監視範囲と基準画像(監視が止まっているとき)・トレー外の範囲・サークルの床面を登録でき、画面のない監視マシンでもブラウザーから登録できる
26
+ - GUI の起動時、外部の URL(`gui.public_url`)を設定していれば、ブラウザーを localhost ではなくその URL で開く(パスキーは登録したドメインでだけ使えるため)
27
+ - GUI にデザインテーマを足す。プロフェッショナル(既定)とワンちゃんの2つで、どちらにもライトとダークがあり、既定は OS の設定に従う。一人ひとりが自分の設定で選び、既定のテーマは管理者が `gui.theme` で決める。色は CSS の変数にまとめ、両テーマのコントラストを WCAG 2.2 AA に合わせる
28
+ - GUI を PWA(ホーム画面に追加できる Web アプリ)にし、購読した端末へ Web Push で通知を送る。受け取る通知(候補・見守り)は一人ひとりが選び、宛先は既知のプッシュサービスに限る。本文は暗号化し、VAPID で署名する
29
+ - GUI に「管理 › 判定器とモデル」を足す。判定器が使える状態か(キーやトークンの値は出さない)と判定の件数・失敗を示し、判定器とモデルを選び直せる。`video-benchmark` の比較の結果と、犬検出モデルのハッシュの確認・`check-dog` の結果も示す
30
+ - `benchmark-dataset` サブコマンドを足す。ラベル付きの録画から評価セットの下書きを作り(同じ出来事の重複を1本にまとめ、調整用と最終評価用を日付で分ける)、種類・条件ごとの件数と録画のない見逃しを数え、録画・ラベル・当時の ROI と基準画像の欠損を確かめてから版を固定し、録画を自動整理から保護する
31
+ - 動画の画面で、ラベル付きの録画を判定器の比較の評価の候補に入れる・除く操作と、撮影の条件のタグ付けを足す。`benchmark-dataset create` が選択とタグを下書きに反映し、`--selected-only` で選んだ録画だけを使える。保存にスキーマ版11(`benchmark_candidates` テーブル)を足す
32
+ - `video-benchmark` が固定した評価セットを読み、録画ごとに撮影時の画角で切り出す。結果に評価セットの版、指定したモデル、CLI の版、抽出時刻、分割別の集計を残す。「管理 › 判定器とモデル」に評価セットの件数と欠損、録画ごとの正解と各判定器の回答を出す
33
+ - `video-benchmark` の `--output` を省けるようにし、既定で `data/benchmarks/` に保存する。`check-dog` は直近の結果を保存する
34
+ - 「管理 › 判定器とモデル」で選び直した判定器とモデルを、監視を起動し直さずに次の動画の判定から使う。新しい判定器を使えないときは前の判定器のまま続け、判定の台帳には実際に使った判定器を記録する
35
+ - GUI に「管理 › 書き出しとバックアップ」を足す。期間を選んで確定記録を CSV(BOM 付き UTF-8、ローカル時刻の ISO 8601)に書き出し、動物病院に見せる印刷用の集計(回数・場所・時間帯・日ごと)を開ける。書き出しとバックアップは管理者だけで、監査ログに残す
36
+ - `backup`・`restore` サブコマンドを足す。記録のデータベース(オンラインバックアップ)と登録情報・検知の画像(選べば動画も)を ZIP にまとめ、セッション・登録用 URL・Web Push の購読と秘密鍵は含めない。復元は監視が止まっていることとハッシュを確かめ、確認してから入れ替え、元のデータは名前を変えて残す
37
+ - 監視の停止とカメラの不調を知らせる見張りを足す(`watchdog.enabled`、既定で有効)。カメラの映像が `watchdog.minutes`(既定5分)届かなければ監視が、監視のハートビートが途絶えれば GUI のサーバーが、通知先と管理者の Web Push に知らせる。同じ停止では1回だけ知らせ、復旧したら止まっていた長さと合わせて知らせる。停止の履歴は「管理 › 稼働状況とトレー」に出す
38
+ - 動画に「排泄なし」のラベルを付けると、ひも付くラベルのない検知を誤検知として記録する
39
+ - 「管理 › 判定器とモデル」に判定器の使用量を出す。判定器の CLI を呼んだ回数を用途(監視・保存済み動画/判定器の比較)ごとに今日・7日・30日・今月・全期間で数え、押したときに各 CLI へサブスクリプションの5時間・週間の消費割合を問い合わせる(モデルは呼ばない)。呼び出しの記録にスキーマ版15(`judge_runs` テーブル)を足す
40
+
41
+ ### 修正
42
+
43
+ - トレー追従で、画面端に接する監視範囲が補正後にわずか(追従用の縮小画像で3ピクセルまで)にはみ出しただけで、監視と保存動画の自動判定を保留していた不具合を直す。画面の外にあたる画素は登録時の映像で埋め、新しい跡として扱わない。保留の理由はログに出す
44
+ - macOS で Claude Code CLI にログインしていても、動画判定が「ログインしてください」と止まる不具合を直す(CLI に `USER`・`LOGNAME` を渡し、キーチェーンのログイン情報を読めるようにする)
45
+
46
+ ### 初回リリースまでに実装した機能
47
+
48
+ #### 検知
49
+
50
+ - 空のトイレの基準画像との明るさ・色の差分から、排便・排尿の候補を検知して通知する
51
+ - 通知済みの跡からの追加の変化だけを評価し、シートを交換しなくても次の排泄を検知する
52
+ - 犬などによる遮蔽、ROI の端から入り込む体、広範囲の明るさの変化では判定を保留する
53
+ - 矩形、四隅、任意の多角形の監視範囲(ROI)
54
+ - トレーの縁を目印にした位置の追従。照明の変化と赤外線映像に対応
55
+ - OpenCV Zoo の YOLOX による犬の存在とトイレへの出入りの検出
56
+ - 録画を待たずにトイレでの滞在を知らせる見守り通知
57
+ - トレー外での滞在をきっかけにした、トレー外の排泄候補の検知
58
+
59
+ #### 記録と動画
60
+
61
+ - ブラウザーで使う GUI(イベント画像と動画へのラベル付け、ライブ映像、直近の判定)
62
+ - GUI は Starlette(ASGI)を uvicorn で動かし、安全対策(Host の検査、セッション、CSRF、CSP などのヘッダー)をすべての応答に1か所で適用する
63
+ - GUI の待ち受けと、外から開くときの URL・信頼するプロキシを設定の `gui` セクションで決める。外部の URL は HTTPS のドメイン名に限り、POST の Origin を確かめ、HTTPS で届いた要求には HSTS と Cookie の `Secure` 属性を付ける
64
+ - GUI のサーバー側のセッション。Cookie にはランダムな ID だけを入れ、データベースにはその SHA-256 だけを保存する。無操作と通算の有効期限(`gui.session_idle_hours`・`gui.session_max_days`)と、ログアウトに対応する
65
+ - GUI の登録用 URL とパスキーの窓口・フォームの送信・すべての要求に、接続元ごとの回数の上限を設ける
66
+ - GUI の CSRF トークンをセッションごとにする(ログイン前の画面にトークンを出さないための準備)
67
+ - GUI のユーザー・パスキー・登録用 URL の台帳と、`users` コマンド(一覧、最初の管理者や家族の登録用 URL、パスキーをなくしたときの復旧、無効化)
68
+ - GUI のパスキー(WebAuthn)での登録とログイン。本人確認を必須にし、パスキーは開いたドメイン(外部の URL か localhost)に結び付く。ログインしていない状態で画面を開くとログインの画面へ移る
69
+ - GUI はパスキーでログインした登録者だけが使える(起動ごとのトークン付き URL は廃止)。自分のパスキーの一覧・追加・削除と、管理者が画面から家族を招待する機能
70
+ - GUI の管理者と一般ユーザーの権限。ルートごとに必要な役割を宣言してサーバーで断り、管理者だけの操作の入口は画面に出さない。役割の変更(GUI と `users set-role`)、最後の管理者を残す確認、管理者の操作の監査ログ
71
+ - 目視で確認した排泄と見逃しの記録、日別・時間帯別の集計、Precision と Recall の集計
72
+ - 検知や犬の出入りの前後の動画を保存し、容量の上限と古い動画の整理に対応
73
+ - 保存した動画の自動判定と、根拠が見えた場合の通知。判定器は差し替えられ、既定は Codex CLI
74
+ - サークル内の滞在時間と通過回数の行動マップ
75
+ - 保存した動画から、排泄の前兆としての旋回候補を分析
76
+
77
+ #### 通知と設定
78
+
79
+ - macOS の通知センターと ntfy への通知。見守り通知を別のトピックに分けられる
80
+ - 接続情報(RTSP URL、ntfy のトピックとサーバー)を `.env` から読み込む
81
+ - 犬の名前(`pet_name`)とタイムゾーン(`timezone`)の設定
82
+ - 機能ごとのセクションに分けた設定ファイル。`features` で動画の自動判定・見守り通知・トレー追従・行動マップ・トレー外検知を有効にでき、起動は `run` だけで済む(フラグは引き続き使える)
83
+ - 設定の誤りを、項目名と許容範囲を示して伝える。有効な設定を表示する `show-config`
84
+ - 見守り通知の滞在の長さと再通知の間隔の設定(`early_alert.stay_seconds`・`cooldown_seconds`)
85
+ - 未登録・基準の不一致・カメラに接続できないなど、よくある失敗の原因と対処を伝える。外部ライブラリの失敗は種類だけを示し、プログラムの誤りは終了コード 1 で区別する
86
+ - 詳細なログとトレースバックを出す `--verbose`。どの出力でも RTSP URL などの認証情報を伏せる
87
+ - 不具合の報告に貼れる診断情報を表示する `diagnose`。接続情報は設定の有無だけを示し、URL・トピック名・保存先のパスは含めない
88
+
89
+ #### 対応環境と公開の準備
90
+
91
+ - macOS と Linux に対応。Windows では理由を示して終了する
92
+ - GitHub Actions で静的解析、Python 3.11・3.12 のテスト、Docker イメージを確認
93
+ - MIT License、コントリビューションの手引き、行動規範、セキュリティポリシー、データの扱いの説明、依存ライブラリのライセンスの一覧
94
+
95
+ [Unreleased]: https://github.com/ysakae/poop-detector/compare/v1.0.0...HEAD
96
+ [1.0.0]: https://github.com/ysakae/poop-detector/releases/tag/v1.0.0