{
  "filename": "src/main/java/example/ConfirmOrder.java",
  "rule": "- name: confirmation-transaction-boundary\n  where: \"src/main/java/example/ConfirmOrder.java\"\n  each: method\n  ensure: >-\n    The confirm method is explicitly annotated @Transactional. A confirm method without that annotation does not satisfy this required service transaction boundary.",
  "corrected": "package example;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\n@Service\npublic class ConfirmOrder {\n    private final OrderRepository orders;\n    private final OutboxRepository outbox;\n    public ConfirmOrder(OrderRepository orders, OutboxRepository outbox) {\n        this.orders = orders; this.outbox = outbox;\n    }\n    @Transactional\n    public void confirm(String tenantId, long orderId) {\n        Order order = orders.lockPending(tenantId, orderId)\n            .orElseThrow(() -> new IllegalArgumentException(\"No pending order\"));\n        order.setStatus(\"confirmed\");\n        orders.save(order);\n        outbox.insert(\"confirmed:\" + orderId, tenantId, orderId);\n    }\n}\n",
  "broken": "package example;\nimport org.springframework.stereotype.Service;\nimport org.springframework.transaction.annotation.Transactional;\n\n@Service\npublic class ConfirmOrder {\n    private final OrderRepository orders;\n    private final OutboxRepository outbox;\n    public ConfirmOrder(OrderRepository orders, OutboxRepository outbox) {\n        this.orders = orders; this.outbox = outbox;\n    }\n    public void confirm(String tenantId, long orderId) {\n        Order order = orders.lockPending(tenantId, orderId)\n            .orElseThrow(() -> new IllegalArgumentException(\"No pending order\"));\n        order.setStatus(\"confirmed\");\n        orders.save(order);\n        outbox.insert(\"confirmed:\" + orderId, tenantId, orderId);\n    }\n}\n",
  "regression": [
    "    @Transactional\n",
    ""
  ],
  "test_scenarios": [
    [
      "Both writes succeed",
      "State and event commit together"
    ],
    [
      "Outbox write fails",
      "Order change rolls back"
    ],
    [
      "Service calls its own annotated method",
      "Test exposes bypassed proxy transaction"
    ],
    [
      "Two confirmations",
      "Locked pending lookup permits one transition"
    ]
  ],
  "test_source": null,
  "test_command": "./mvnw test -Dtest=ConfirmOrderIntegrationTest"
}