Domain migration. Depends on D1. Commandments 14–17, 19, 20, 29 and 31.
CreateIssue, UpdateIssue (per-field patch), MoveIssue (status / order / team), ArchiveIssue, RestoreIssue and DeleteIssueBulkUpdateIssues, the backend half of PAR-365AddSubIssue and SetParentIssueError.TasksFacade write methods, @Transactional.IssueApiController moves to tasks/api.TaskMcpTools and BulkMcpTools move to tasks/mcp.discord/TaskInstructionListener calls TasksFacade.create(...).PostgresTaskSystem. If the class is empty afterwards, delete it.issue_event rows inside the transaction. Discord and GitHub notifications for issue changes go through the outbox (PAR-412).EventBatch and TenantContext ThreadLocal usage in these paths. Pass RequestContext instead.router.refresh() paths for issue edits.CreateIssue use case. Prove it with a test per adapter.Merged into rebuild as #54 (99135b8). Create, update, move, archive and bulk changes are use cases behind IssuesFacade. REST, MCP and Discord triage all call the same facade methods, and a test drives all three. Activity is now delivered through the outbox (issue.activity) in the same transaction, and EventBatch is deleted.
Ratchet: ArchUnit store 1283 → 1016 distinct violations (line numbers stripped). ESLint suppressions unchanged at 61.
Accepted exception: about 10 genuinely new cross-domain entries in legacy adapters that now call the new facade:
TaskInstructionListener → TaskSystem.defaultWorkspaceIdTriageService → IssueError / TaskModels.TaskGithubWebhookService → TaskModels.Task.refThese classes are rewritten by PAR-420 (Discord and triage) and PAR-421 (GitHub), and those tickets must remove these entries.
Behaviour changes:
V40__issue_event_outboxed is now taken; PAR-418 renumbers.
Plan (branch par-415-issues-writes from rebuild): add write use cases (Create/Update/Move/Archive/Restore/Delete/BulkUpdate/SetParent) to the issues domain beside the reads, with sealed IssueError and Rollback.onErr on IssuesFacade. Writes persist through JdbcIssueRepository (tenant-scoped); issue_event recording is a small persistence call in the same tx; Discord/GitHub/webhook side effects go via Outbox + handlers. REST write endpoints under /api/public/w/{slug}/issues, MCP write tools in issues/mcp (same names), Discord create/update call the facade. Shrink PostgresTaskSystem and drop ThreadLocal use on these paths. Web: write hooks in domains/issues/data. Ratchet deltas reported in PR.