# BAT-010 Planning ## Scope - Implement REQ-013: application/infrastructure split, SQLite persistence extraction, service/db compatibility facade. - Implement REQ-014: MCP adapter split, Streamlit service gateway, contract-preserving verification. - Update architecture baseline docs to reflect the new layering and remaining Phase 4+ TODOs. - Use synthetic/temp data only for verification evidence. ## Dependencies - dcy-010 confirmed Discovery and approved/implemented REQ-013/REQ-014. - Existing BAT-009 runtime behavior, response contract expectations, and Streamlit dashboard pages. - Additive/idempotent SQLite migration discipline from REQ-002. ## Work plan 1. Split `service.py` implementation into application modules and preserve top-level facade compatibility. 2. Split `db.py` responsibilities into `infrastructure/sqlite` and preserve existing import paths. 3. Introduce MCP adapter package and Streamlit service gateway. 4. Update baseline docs (`docs/project-structure.md`, `docs/runtime-flows.md`). 5. Run py_compile, full pytest, MCP discovery, and browser smoke against synthetic fixture DB. 6. If evidence satisfies ACs, mark BAT-010 release-candidate and REQ-013/REQ-014 Implemented. ## Design Gate - Result: standard batch 유지. - Reason: package boundary 변화, compatibility shim, MCP adapter seam, Streamlit browser verification, baseline docs가 함께 변경되므로 planning/design/verification depth가 필요하다. ## Risks and mitigations - Hidden helper coupling after module split: mitigate by full pytest, monkeypatch compatibility, and targeted smoke on boundary-sensitive flows. - DB initialization drift after infrastructure split: mitigate by preserving init/commit/rollback semantics and verifying schema initialization through tests. - MCP/dashboard contract drift: mitigate by `hermes mcp test jarca-ledger`, Streamlit AppTest/full pytest, and browser smoke on key pages.