{
  "jira_key": "AN-87",
  "passed": false,
  "cycle": 1,
  "findings": [
    {
      "severity": "high",
      "category": "functional",
      "file": "force-app/main/default/classes/OpportunityContactRoleGuardHandler.cls",
      "line": null,
      "message": "The `WITH USER_MODE` query can fail or return no visible Contact Roles when the acting user lacks read access to OpportunityContactRole records. That can produce a query exception or block an otherwise valid Closed Won update, rather than reliably checking whether a role is associated with the Opportunity. The existence check must work for the required business rule while preserving an explicitly justified and authorized database access mode.",
      "fixable": true
    },
    {
      "severity": "high",
      "category": "functional",
      "file": "force-app/main/default/classes/OpportunityContactRoleGuardHandler.cls",
      "line": null,
      "message": "The exclusion only checks for `AutomatedProcess`; it does not exclude standard system integration users that run under other user types. The acceptance criteria require excluding those users where applicable. Identify the applicable integration-user criteria from verified configuration and implement that exclusion without relying on hardcoded user IDs.",
      "fixable": true
    },
    {
      "severity": "high",
      "category": "testing",
      "file": "force-app/main/default/classes/OpportunityContactRoleGuardTest.cls",
      "line": null,
      "message": "The negative test creates an Opportunity with StageName `Prospect`. `Prospect` is not a standard Opportunity stage value (the standard value is `Prospecting`), so this setup can fail before the behavior under test runs unless the target org has a verified custom stage with that name. Use a verified valid stage value.",
      "fixable": true
    },
    {
      "severity": "high",
      "category": "standards",
      "file": "force-app/main/default/classes/OpportunityContactRoleGuardHandler.cls",
      "line": null,
      "message": "ARCH-02: The handler contains the business rule and production SOQL instead of delegating the rule to a service and encapsulating the query in the repository's established selector or equivalent. Follow the existing architecture, or document why the repository has no applicable equivalent and why a departure is necessary.",
      "fixable": true
    },
    {
      "severity": "medium",
      "category": "standards",
      "file": "force-app/main/default/classes/OpportunityContactRoleGuardHandler.cls",
      "line": null,
      "message": "APEX-09: The public class lacks an ApexDoc comment describing its purpose. Add class-level documentation.",
      "fixable": true
    }
  ],
  "summary": "Review found blocking concerns in Contact Role visibility, integration-user exclusions, and test setup, plus an architecture standards violation.",
  "static_analysis_status": "passed",
  "notes": "Reviewed the generated files and the supplied summary; no repository versions or validation-command results were provided."
}