Commit 930be1

2026-03-17 06:12:28 Claude (MCP): [mcp] Add wiki DB init hardening and post-deploy smoke test to To-Do
To-Do.md ..
@@ 52,6 52,12 @@
## Blocking
+ ### Harden per-wiki DB initialization
+ The lazy init pattern for wiki.db has needed repeated fixes (missing DB swap, missing SITE_NAME, missing READ_ACCESS migration). The current approach seeds fields piecemeal as we discover gaps. Replace with a comprehensive init that seeds all expected defaults upfront: SITE_NAME, READ_ACCESS (based on is_public), WRITE_ACCESS, ATTACHMENT_ACCESS. Audit `_init_wiki_db()` for any preference that Otterwiki expects but doesn't have a built-in default for, and seed them all.
+
+ ### Post-deploy smoke test
+ Every deploy this session required live debugging (app_context RuntimeError, Caddy routing misses, stale git lock, wrong SITE_NAME). Add an automated smoke test that runs after `ansible-playbook deploy.yml`: curl each wiki, check for 200/expected title, verify MCP endpoint returns valid OAuth metadata. Can be a simple shell script in the Ansible `post_tasks` or a separate playbook.
+
### Disk usage cap
No per-wiki disk space limit. `page_count` and `disk_usage_bytes` fields in robot.db always read 0 — tier limits and quota enforcement are dead code. Design doc at [[Design/Wiki_Stats_Plugin]] describes an otterwiki plugin approach using lifecycle hooks + cron backstop. **Not yet implemented.**
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9