# BAT-011 Implementation ## Plan summary BAT-011 implements the first dcy-011 delivery slice by extracting transactional write paths into narrower application modules while preserving the top-level `service.py` facade, MCP tool contracts, and Streamlit/dashboard call signatures. ## Changed files - `jarca_ledger_mcp/application/accounts_write_services.py` - `jarca_ledger_mcp/application/transactions_write_services.py` - `jarca_ledger_mcp/application/budgets_write_services.py` - `jarca_ledger_mcp/application/category_rules_write_services.py` - `jarca_ledger_mcp/application/__init__.py` - `jarca_ledger_mcp/application/system_services.py` - `jarca_ledger_mcp/application/asset_account_services.py` - `jarca_ledger_mcp/application/transaction_report_services.py` - `jarca_ledger_mcp/application/categorization_services.py` - `jarca_ledger_mcp/service.py` - `docs/discovery/dcy-011_20260703_backend-refactor-phase4-write-import-workflow-adapter-narrowing.md` - `docs/srs/index.md` - `docs/srs/Non-Functional/req-015_transactional-write-service-split-compatibility.md` - `docs/batches/index.md` - `docs/batches/bat-011_20260703_transactional-write-service-split/index.md` - `docs/batches/bat-011_20260703_transactional-write-service-split/planning.md` - `docs/batches/bat-011_20260703_transactional-write-service-split/design.md` - `docs/batches/bat-011_20260703_transactional-write-service-split/implementation.md` - `docs/batches/bat-011_20260703_transactional-write-service-split/verification.md` ## Execution log - 2026-07-03 07:29 KST: dcy-011에서 REQ-015를 생성하고 source Discovery 역참조/SRS index를 갱신했다. - 2026-07-03 07:30 KST: REQ-015를 Approved로 전환하고 BAT-011 standard batch scaffold(index/planning/design/implementation/verification)를 생성했다. - 2026-07-03 07:34 KST: `accounts_write_services.py`, `transactions_write_services.py`, `budgets_write_services.py`, `category_rules_write_services.py`를 추가하고 account/transaction/budget/category rule-category mutation 구현을 새 모듈로 이동했다. - 2026-07-03 07:35 KST: 기존 broad modules(`system_services.py`, `asset_account_services.py`, `transaction_report_services.py`, `categorization_services.py`)를 compatibility re-export/delegation 레이어로 축소했다. - 2026-07-03 07:35 KST: `service.py` proxy module set에 새 write modules를 추가해 helper monkeypatch/export propagation이 계속 동작하도록 정렬했다. - 2026-07-03 07:36 KST: category create path에서 빠진 `infer_cashflow_kind` 정책을 `category_rules_write_services.py`에 보강해 category mutation 회귀를 복구했다. - 2026-07-03 07:39 KST: targeted regression, full pytest, MCP discovery, service export provenance 검증이 모두 PASS하여 REQ-015를 Implemented로 승격했다. ## Validation - `python3 -m py_compile jarca_ledger_mcp/application/*.py jarca_ledger_mcp/service.py` → PASS - `pytest -q tests/test_service.py tests/test_category_rule_filters.py tests/test_ledger_categories.py tests/test_contract_regression.py` → PASS (`19 passed`) - `pytest -q` → PASS (`42 passed, 4 skipped`) - `hermes mcp test jarca-ledger` → PASS (`Connected`, `Tools discovered: 56`) - `python3` provenance check → PASS (`service.create_ledger_account.__module__ == jarca_ledger_mcp.application.accounts_write_services`, transaction/budget/category mutation exports도 각각 새 write module을 가리킴) ## Remaining risks / follow-up notes - `preview_categorization`, `apply_categorization_rules`, uncategorized workbench/read-side helper는 아직 `categorization_services.py`에 남아 있어 Phase 4 후속 또는 Phase 7 adapter narrowing에서 추가 분리가 가능하다. - import preview/import/rollback 및 cross-transfer/reconciliation/advanced workflow 분리는 BAT-011 범위 밖이며 dcy-011 후속 REQ/BAT로 이어져야 한다. - 이번 배치는 contract-preserving extraction이 목적이므로 data model semantics와 response envelope은 의도적으로 변경하지 않았다.