Repository: doc-detective/resolver
Pull request #1: Fix formatting for batched regex matches
Author: login: hawkeyexl
Created: 2025-05-22T16:51:01Z | Merged: 2025-05-22T17:09:49Z

Bump the package version to 3.0.1, update the posthog-node dependency, and change the join character in the parseContent function to make sure lines are kept separate.

<!-- This is an auto-generated comment: release notes by coderabbit.ai -->

## Summary by CodeRabbit

- **New Features**
	- Enhanced support for processing Markdown files containing embedded Python code blocks, enabling automatic detection and execution of Python code within documentation.
- **Bug Fixes**
	- Improved handling of multi-line code block matches to ensure proper formatting using OS-specific line endings.
- **Chores**
	- Updated configuration to expand automated review triggers to both "main" and "rc" branches.
	- Upgraded the "posthog-node" dependency and incremented the package version.
- **Documentation**
	- Added comprehensive JSDoc comments to clarify internal function behavior.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->


Diff:
diff --git a/.coderabbit.yaml b/.coderabbit.yaml
index 24d8af3..2b782d2 100644
--- a/.coderabbit.yaml
+++ b/.coderabbit.yaml
@@ -24,7 +24,7 @@ reviews:
     ignore_title_keywords: []
     labels: []
     drafts: false
-    base_branches: ["rc"]
+    base_branches: ["main","rc"]
   tools:
     shellcheck:
       enabled: true
diff --git a/dev/index.js b/dev/index.js
index bba9a47..ea8a80f 100644
--- a/dev/index.js
+++ b/dev/index.js
@@ -5,17 +5,61 @@ const path = require("path");
 
 main();
 
+/**
+ * Detects and resolves test cases in a specified markdown file using configured patterns and actions, then outputs the results to a JSON file.
+ *
+ * The function analyzes the input markdown file for test-related statements and code blocks according to the provided configuration, processes detected tests, and writes the structured results to "output.json" in the current directory.
+ */
 async function main() {
   const json = {
-    input: "/home/hawkeyexl/Workspaces/resolver/dev/dev.spec.json",
-    integrations:{
-      openApi: [
-        {
-          name: "reqres",
-          descriptionPath: "/home/hawkeyexl/Workspaces/resolver/dev/reqres.openapi.json",
-        }
-      ]
-    },
+    input: "/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md",
+    fileTypes: [
+      {
+        name: "markdown",
+        extensions: ["md", "markdown", "mdx"],
+        inlineStatements: {
+          testStart: [
+            "{\\/\\*\\s*test\\s+?([\\s\\S]*?)\\s*\\*\\/}",
+            "<!--\\s*test\\s*([\\s\\S]*?)\\s*-->",
+            "\\[comment\\]:\\s+#\\s+\\(test\\s*(.*?)\\s*\\)",
+            "\\[comment\\]:\\s+#\\s+\\(test start\\s*(.*?)\\s*\\)",
+          ],
+          testEnd: [
+            "{\\/\\*\\s*test end\\s*\\*\\/}",
+            "<!--\\s*test end\\s*([\\s\\S]*?)\\s*-->",
+            "\\[comment\\]:\\s+#\\s+\\(test end\\)",
+          ],
+          ignoreStart: [
+            "{\\/\\*\\s*test ignore start\\s*\\*\\/}",
+            "<!--\\s*test ignore start\\s*-->",
+          ],
+          ignoreEnd: [
+            "{\\/\\*\\s*test ignore end\\s*\\*\\/}",
+            "<!--\\s*test ignore end\\s*-->",
+          ],
+          step: [
+            "{\\/\\*\\s*step\\s+?([\\s\\S]*?)\\s*\\*\\/}",
+            "<!--\\s*step\\s*([\\s\\S]*?)\\s*-->",
+            "\\[comment\\]:\\s+#\\s+\\(step\\s*(.*?)\\s*\\)",
+          ],
+        },
+        markup: [
+          {
+            name: "runPython",
+            regex: ["```(?:python)\\b\\s*\\n(?<code>.*?)(?=\\n```)"],
+            batchMatches: true,
+            actions: [
+              {
+                runCode: {
+                  language: "python",
+                  code: "$1",
+                },
+              },
+            ],
+          },
+        ],
+      },
+    ],
     logLevel: "debug",
   };
   result = await detectAndResolveTests({ config: json });
@@ -25,4 +69,4 @@ async function main() {
   const fs = require("fs");
   fs.writeFileSync(outputPath, JSON.stringify(result, null, 2));
   console.log(`Output written to ${outputPath}`);
-}
\ No newline at end of file
+}
diff --git a/dev/output.json b/dev/output.json
index 84177a6..16bc329 100644
--- a/dev/output.json
+++ b/dev/output.json
@@ -1,302 +1,8 @@
 {
   "config": {
     "input": [
-      "/home/hawkeyexl/Workspaces/resolver/dev/dev.spec.json"
+      "/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md"
     ],
-    "integrations": {
-      "openApi": [
-        {
-          "name": "reqres",
-          "descriptionPath": "/home/hawkeyexl/Workspaces/resolver/dev/reqres.openapi.json",
-          "validateAgainstSchema": "both",
-          "useExample": "none",
-          "exampleKey": "",
-          "definition": {
-            "openapi": "3.0.3",
-            "info": {
-              "title": "Reqres API",
-              "description": "Sample API for testing and prototyping",
-              "version": "0.0.1"
-            },
-            "servers": [
-              {
-                "url": "https://reqres.in/api"
-              }
-            ],
-            "tags": [
-              {
-                "name": "Test",
-                "description": "Test operations"
-              }
-            ],
-            "security": [
-              {}
-            ],
-            "paths": {
-              "/users": {
-                "post": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Add a new user",
-                  "description": "Add a new user",
-                  "operationId": "addUser",
-                  "requestBody": {
-                    "description": "Create a new user",
-                    "content": {
-                      "application/json": {
-                        "schema": {
-                          "type": "object",
-                          "additionalProperties": false,
-                          "properties": {
-                            "name": {
-                              "type": "string"
-                            },
-                            "job": {
-                              "type": "string"
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "required": true
-                  },
-                  "responses": {
-                    "201": {
-                      "description": "Successful operation",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "description": "response payload"
-                          },
-                          "examples": {
-                            "test": {
-                              "value": {
-                                "name": "morpheus",
-                                "job": "leader"
-                              }
-                            },
-                            "foobar": {
-                              "value": {
-                                "name": "neo",
-                                "job": "the-one"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              },
-                              "message": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                },
-                "get": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Return a list of users",
-                  "description": "Return a list of users",
-                  "operationId": "getUsers",
-                  "parameters": [
-                    {
-                      "name": "page",
-                      "in": "query",
-                      "description": "Select the portition of record you want back",
-                      "required": false,
-                      "schema": {
-                        "type": "integer",
-                        "example": 1
-                      }
-                    }
-                  ],
-                  "responses": {
-                    "200": {
-                      "description": "successful operation",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "array",
-                            "items": {
-                              "description": "response payload"
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                }
-              },
-              "/users/{id}": {
-                "put": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Update an existing user",
-                  "description": "Update an existing user by Id",
-                  "operationId": "updateUser",
-                  "parameters": [
-                    {
-                      "name": "id",
-                      "in": "path",
-                      "description": "id of user to delete",
-                      "required": true,
-                      "example": 1,
-                      "schema": {
-                        "type": "integer",
-                        "format": "int64"
-                      }
-                    }
-                  ],
-                  "requestBody": {
-                    "description": "Update an existent pet in the store",
-                    "content": {
-                      "application/json": {
-                        "schema": {
-                          "type": "object",
-                          "additionalProperties": false,
-                          "properties": {
-                            "name": {
-                              "type": "string"
-                            },
-                            "job": {
-                              "type": "string"
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "required": true
-                  },
-                  "responses": {
-                    "200": {
-                      "description": "Successful operation",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "description": "response payload"
-                          }
-                        }
-                      }
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                },
-                "delete": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Deletes a user",
-                  "description": "delete a user",
-                  "operationId": "deleteUser",
-                  "parameters": [
-                    {
-                      "name": "id",
-                      "in": "path",
-                      "description": "id of user to delete",
-                      "required": true,
-                      "example": 1,
-                      "schema": {
-                        "type": "integer",
-                        "format": "int64"
-                      }
-                    }
-                  ],
-                  "responses": {
-                    "204": {
-                      "description": "No content"
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            },
-            "components": {
-              "schemas": {
-                "userResponse": {
-                  "description": "response payload"
-                },
-                "userRequest": {
-                  "type": "object",
-                  "additionalProperties": false,
-                  "properties": {
-                    "name": {
-                      "type": "string"
-                    },
-                    "job": {
-                      "type": "string"
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-      ]
-    },
-    "logLevel": "debug",
-    "output": ".",
-    "recursive": true,
-    "relativePathBase": "file",
-    "detectSteps": true,
     "fileTypes": [
       {
         "name": "markdown",
@@ -333,117 +39,32 @@
         },
         "markup": [
           {
-            "name": "checkHyperlink",
-            "regex": [
-              "(?<!\\!)\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
-            ],
-            "actions": [
-              "checkLink"
-            ]
-          },
-          {
-            "name": "clickOnscreenText",
+            "name": "runPython",
             "regex": [
-              "\\b(?:[Cc]lick|[Tt]ap|[Ll]eft-click|[Cc]hoose|[Ss]elect|[Cc]heck)\\b\\s+\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
+              "```(?:python)\\b\\s*\\n(?<code>.*?)(?=\\n```)"
             ],
+            "batchMatches": true,
             "actions": [
-              "click"
-            ]
-          },
-          {
-            "name": "findOnscreenText",
-            "regex": [
-              "\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
-            ],
-            "actions": [
-              "find"
-            ]
-          },
-          {
-            "name": "goToUrl",
-            "regex": [
-              "\\b(?:[Gg]o\\s+to|[Oo]pen|[Nn]avigate\\s+to|[Vv]isit|[Aa]ccess|[Pp]roceed\\s+to|[Ll]aunch)\\b\\s+\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
-            ],
-            "actions": [
-              "goTo"
-            ]
-          },
-          {
-            "name": "screenshotImage",
-            "regex": [
-              "!\\[[^\\]]*\\]\\(\\s*([^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)\\s*\\{(?=[^}]*\\.screenshot)[^}]*\\}"
-            ],
-            "actions": [
-              "screenshot"
-            ]
-          },
-          {
-            "name": "typeText",
-            "regex": [
-              "\\b(?:press|enter|type)\\b\\s+\"([^\"]+)\""
-            ],
-            "actions": [
-              "type"
+              {
+                "runCode": {
+                  "language": "python",
+                  "code": "print(\"Hello, world!\")\nprint(\"Hello to you too!\")"
+                }
+              }
             ]
           }
         ]
-      },
-      {
-        "name": "asciidoc",
-        "extensions": [
-          "adoc",
-          "asciidoc",
-          "asc"
-        ],
-        "inlineStatements": {
-          "testStart": [
-            "\\/\\/\\s+\\(\\s*test\\s+([\\s\\S]*?)\\s*\\)"
-          ],
-          "testEnd": [
-            "\\/\\/\\s+\\(\\s*test end\\s*\\)"
-          ],
-          "ignoreStart": [
-            "\\/\\/\\s+\\(\\s*test ignore start\\s*\\)"
-          ],
-          "ignoreEnd": [
-            "\\/\\/\\s+\\(\\s*test ignore end\\s*\\)"
-          ],
-          "step": [
-            "\\/\\/\\s+\\(\\s*step\\s+([\\s\\S]*?)\\s*\\)"
-          ]
-        },
-        "markup": []
-      },
-      {
-        "name": "html",
-        "extensions": [
-          "html",
-          "htm"
-        ],
-        "inlineStatements": {
-          "testStart": [
-            "<!--\\s*test\\s+?([\\s\\S]*?)\\s*-->"
-          ],
-          "testEnd": [
-            "<!--\\s*test end\\s*([\\s\\S]*?)\\s*-->"
-          ],
-          "ignoreStart": [
-            "<!--\\s*test ignore start\\s*-->"
-          ],
-          "ignoreEnd": [
-            "<!--\\s*test ignore end\\s*-->"
-          ],
-          "step": [
-            "<!--\\s*step\\s+?([\\s\\S]*?)\\s*-->"
-          ]
-        },
-        "markup": []
       }
     ],
+    "logLevel": "debug",
+    "output": ".",
+    "recursive": true,
+    "relativePathBase": "file",
+    "detectSteps": true,
     "telemetry": {
       "send": true
     },
-    "configId": "343eeb23-6a45-496f-84ef-6210be7e10c7",
+    "configId": "6ffa39d0-4353-42f0-a891-09aae0980197",
     "environment": {
       "arch": "x64",
       "platform": "linux",
@@ -452,606 +73,31 @@
   },
   "specs": [
     {
+      "specId": "b0d003dd-0fe2-4e46-8844-05f7cd0be602",
+      "contentPath": "/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md",
       "tests": [
         {
-          "after": "/home/hawkeyexl/Workspaces/resolver/dev/cleanup.spec.json",
-          "testId": "17e04f88-1c54-447f-ab6b-1d3a38ef1033",
+          "testId": "2374e8d5-8c4b-444a-a321-034455045740",
           "runOn": [],
-          "openApi": [
-            {
-              "name": "reqres",
-              "descriptionPath": "/home/hawkeyexl/Workspaces/resolver/dev/reqres.openapi.json",
-              "validateAgainstSchema": "both",
-              "useExample": "none",
-              "exampleKey": "",
-              "definition": {
-                "openapi": "3.0.3",
-                "info": {
-                  "title": "Reqres API",
-                  "description": "Sample API for testing and prototyping",
-                  "version": "0.0.1"
-                },
-                "servers": [
-                  {
-                    "url": "https://reqres.in/api"
-                  }
-                ],
-                "tags": [
-                  {
-                    "name": "Test",
-                    "description": "Test operations"
-                  }
-                ],
-                "security": [
-                  {}
-                ],
-                "paths": {
-                  "/users": {
-                    "post": {
-                      "tags": [
-                        "Test"
-                      ],
-                      "summary": "Add a new user",
-                      "description": "Add a new user",
-                      "operationId": "addUser",
-                      "requestBody": {
-                        "description": "Create a new user",
-                        "content": {
-                          "application/json": {
-                            "schema": {
-                              "type": "object",
-                              "additionalProperties": false,
-                              "properties": {
-                                "name": {
-                                  "type": "string"
-                                },
-                                "job": {
-                                  "type": "string"
-                                }
-                              }
-                            }
-                          }
-                        },
-                        "required": true
-                      },
-                      "responses": {
-                        "201": {
-                          "description": "Successful operation",
-                          "content": {
-                            "application/json": {
-                              "schema": {
-                                "description": "response payload"
-                              },
-                              "examples": {
-                                "test": {
-                                  "value": {
-                                    "name": "morpheus",
-                                    "job": "leader"
-                                  }
-                                },
-                                "foobar": {
-                                  "value": {
-                                    "name": "neo",
-                                    "job": "the-one"
-                                  }
-                                }
-                              }
-                            }
-                          }
-                        },
-                        "400": {
-                          "description": "Invalid input",
-                          "content": {
-                            "application/json": {
-                              "schema": {
-                                "type": "object",
-                                "properties": {
-                                  "error": {
-                                    "type": "string"
-                                  },
-                                  "message": {
-                                    "type": "string"
-                                  }
-                                }
-                              }
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "get": {
-                      "tags": [
-                        "Test"
-                      ],
-                      "summary": "Return a list of users",
-                      "description": "Return a list of users",
-                      "operationId": "getUsers",
-                      "parameters": [
-                        {
-                          "name": "page",
-                          "in": "query",
-                          "description": "Select the portition of record you want back",
-                          "required": false,
-                          "schema": {
-                            "type": "integer",
-                            "example": 1
-                          }
-                        }
-                      ],
-                      "responses": {
-                        "200": {
-                          "description": "successful operation",
-                          "content": {
-                            "application/json": {
-                              "schema": {
-                                "type": "array",
-                                "items": {
-                                  "description": "response payload"
-                                }
-                              }
-                            }
-                          }
-                        },
-                        "400": {
-                          "description": "Invalid input",
-                          "content": {
-                            "application/json": {
-                              "schema": {
-                                "type": "object",
-                                "properties": {
-                                  "error": {
-                                    "type": "string"
-                                  }
-                                }
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  },
-                  "/users/{id}": {
-                    "put": {
-                      "tags": [
-                        "Test"
-                      ],
-                      "summary": "Update an existing user",
-                      "description": "Update an existing user by Id",
-                      "operationId": "updateUser",
-                      "parameters": [
-                        {
-                          "name": "id",
-                          "in": "path",
-                          "description": "id of user to delete",
-                          "required": true,
-                          "example": 1,
-                          "schema": {
-                            "type": "integer",
-                            "format": "int64"
-                          }
-                        }
-                      ],
-                      "requestBody": {
-                        "description": "Update an existent pet in the store",
-                        "content": {
-                          "application/json": {
-                            "schema": {
-                              "type": "object",
-                              "additionalProperties": false,
-                              "properties": {
-                                "name": {
-                                  "type": "string"
-                                },
-                                "job": {
-                                  "type": "string"
-                                }
-                              }
-                            }
-                          }
-                        },
-                        "required": true
-                      },
-                      "responses": {
-                        "200": {
-                          "description": "Successful operation",
-                          "content": {
-                            "application/json": {
-                              "schema": {
-                                "description": "response payload"
-                              }
-                            }
-                          }
-                        },
-                        "400": {
-                          "description": "Invalid input",
-                          "content": {
-                            "application/json": {
-                              "schema": {
-                                "type": "object",
-                                "properties": {
-                                  "error": {
-                                    "type": "string"
-                                  }
-                                }
-                              }
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "delete": {
-                      "tags": [
-                        "Test"
-                      ],
-                      "summary": "Deletes a user",
-                      "description": "delete a user",
-                      "operationId": "deleteUser",
-                      "parameters": [
-                        {
-                          "name": "id",
-                          "in": "path",
-                          "description": "id of user to delete",
-                          "required": true,
-                          "example": 1,
-                          "schema": {
-                            "type": "integer",
-                            "format": "int64"
-                          }
-                        }
-                      ],
-                      "responses": {
-                        "204": {
-                          "description": "No content"
-                        },
-                        "400": {
-                          "description": "Invalid input",
-                          "content": {
-                            "application/json": {
-                              "schema": {
-                                "type": "object",
-                                "properties": {
-                                  "error": {
-                                    "type": "string"
-                                  }
-                                }
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                },
-                "components": {
-                  "schemas": {
-                    "userResponse": {
-                      "description": "response payload"
-                    },
-                    "userRequest": {
-                      "type": "object",
-                      "additionalProperties": false,
-                      "properties": {
-                        "name": {
-                          "type": "string"
-                        },
-                        "job": {
-                          "type": "string"
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            }
-          ],
+          "openApi": [],
           "contexts": [
             {
               "openApi": [],
               "steps": [
                 {
-                  "goTo": "https://duckduckgo.com"
-                },
-                {
-                  "find": "/Set As.+/"
-                },
-                {
-                  "runShell": "echo cleanup"
+                  "runCode": {
+                    "language": "python",
+                    "code": "print(\"Hello, world!\")\nprint(\"Hello to you too!\")"
+                  }
                 }
               ],
-              "contextId": "e7c3c74c-315a-453e-86c8-537171c1ff72"
+              "contextId": "4eb87d33-034d-49ee-8252-be3981ff92ed"
             }
           ]
         }
       ],
-      "specId": "722226ef-bc40-4e98-8ddf-c7c0da8b377f",
       "runOn": [],
-      "openApi": [
-        {
-          "name": "reqres",
-          "descriptionPath": "/home/hawkeyexl/Workspaces/resolver/dev/reqres.openapi.json",
-          "validateAgainstSchema": "both",
-          "useExample": "none",
-          "exampleKey": "",
-          "definition": {
-            "openapi": "3.0.3",
-            "info": {
-              "title": "Reqres API",
-              "description": "Sample API for testing and prototyping",
-              "version": "0.0.1"
-            },
-            "servers": [
-              {
-                "url": "https://reqres.in/api"
-              }
-            ],
-            "tags": [
-              {
-                "name": "Test",
-                "description": "Test operations"
-              }
-            ],
-            "security": [
-              {}
-            ],
-            "paths": {
-              "/users": {
-                "post": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Add a new user",
-                  "description": "Add a new user",
-                  "operationId": "addUser",
-                  "requestBody": {
-                    "description": "Create a new user",
-                    "content": {
-                      "application/json": {
-                        "schema": {
-                          "type": "object",
-                          "additionalProperties": false,
-                          "properties": {
-                            "name": {
-                              "type": "string"
-                            },
-                            "job": {
-                              "type": "string"
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "required": true
-                  },
-                  "responses": {
-                    "201": {
-                      "description": "Successful operation",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "description": "response payload"
-                          },
-                          "examples": {
-                            "test": {
-                              "value": {
-                                "name": "morpheus",
-                                "job": "leader"
-                              }
-                            },
-                            "foobar": {
-                              "value": {
-                                "name": "neo",
-                                "job": "the-one"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              },
-                              "message": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                },
-                "get": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Return a list of users",
-                  "description": "Return a list of users",
-                  "operationId": "getUsers",
-                  "parameters": [
-                    {
-                      "name": "page",
-                      "in": "query",
-                      "description": "Select the portition of record you want back",
-                      "required": false,
-                      "schema": {
-                        "type": "integer",
-                        "example": 1
-                      }
-                    }
-                  ],
-                  "responses": {
-                    "200": {
-                      "description": "successful operation",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "array",
-                            "items": {
-                              "description": "response payload"
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                }
-              },
-              "/users/{id}": {
-                "put": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Update an existing user",
-                  "description": "Update an existing user by Id",
-                  "operationId": "updateUser",
-                  "parameters": [
-                    {
-                      "name": "id",
-                      "in": "path",
-                      "description": "id of user to delete",
-                      "required": true,
-                      "example": 1,
-                      "schema": {
-                        "type": "integer",
-                        "format": "int64"
-                      }
-                    }
-                  ],
-                  "requestBody": {
-                    "description": "Update an existent pet in the store",
-                    "content": {
-                      "application/json": {
-                        "schema": {
-                          "type": "object",
-                          "additionalProperties": false,
-                          "properties": {
-                            "name": {
-                              "type": "string"
-                            },
-                            "job": {
-                              "type": "string"
-                            }
-                          }
-                        }
-                      }
-                    },
-                    "required": true
-                  },
-                  "responses": {
-                    "200": {
-                      "description": "Successful operation",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "description": "response payload"
-                          }
-                        }
-                      }
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                },
-                "delete": {
-                  "tags": [
-                    "Test"
-                  ],
-                  "summary": "Deletes a user",
-                  "description": "delete a user",
-                  "operationId": "deleteUser",
-                  "parameters": [
-                    {
-                      "name": "id",
-                      "in": "path",
-                      "description": "id of user to delete",
-                      "required": true,
-                      "example": 1,
-                      "schema": {
-                        "type": "integer",
-                        "format": "int64"
-                      }
-                    }
-                  ],
-                  "responses": {
-                    "204": {
-                      "description": "No content"
-                    },
-                    "400": {
-                      "description": "Invalid input",
-                      "content": {
-                        "application/json": {
-                          "schema": {
-                            "type": "object",
-                            "properties": {
-                              "error": {
-                                "type": "string"
-                              }
-                            }
-                          }
-                        }
-                      }
-                    }
-                  }
-                }
-              }
-            },
-            "components": {
-              "schemas": {
-                "userResponse": {
-                  "description": "response payload"
-                },
-                "userRequest": {
-                  "type": "object",
-                  "additionalProperties": false,
-                  "properties": {
-                    "name": {
-                      "type": "string"
-                    },
-                    "job": {
-                      "type": "string"
-                    }
-                  }
-                }
-              }
-            }
-          }
-        }
-      ]
+      "openApi": []
     }
   ]
 }
\ No newline at end of file
diff --git a/package-lock.json b/package-lock.json
index 9502d76..8d2873b 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,12 +1,12 @@
 {
   "name": "doc-detective-resolver",
-  "version": "3.0.0",
+  "version": "3.0.1",
   "lockfileVersion": 3,
   "requires": true,
   "packages": {
     "": {
       "name": "doc-detective-resolver",
-      "version": "3.0.0",
+      "version": "3.0.1",
       "license": "AGPL-3.0-only",
       "dependencies": {
         "@apidevtools/json-schema-ref-parser": "^12.0.2",
@@ -15,7 +15,7 @@
         "doc-detective-common": "^3.0.4",
         "dotenv": "^16.5.0",
         "json-schema-faker": "^0.5.9",
-        "posthog-node": "^4.17.1",
+        "posthog-node": "^4.17.2",
         "uuid": "^11.1.0"
       },
       "devDependencies": {
@@ -1819,9 +1819,9 @@
       "license": "ISC"
     },
     "node_modules/posthog-node": {
-      "version": "4.17.1",
-      "resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-4.17.1.tgz",
-      "integrity": "sha512-cVlQPOwOPjakUnrueKRCQe1m2Ku+XzKaOos7Tn/zDZkkZFeBT/byP7tbNf7LiwhaBRWFBRowZZb/MsTtSRaorg==",
+      "version": "4.17.2",
+      "resolved": "https://registry.npmjs.org/posthog-node/-/posthog-node-4.17.2.tgz",
+      "integrity": "sha512-bFmwOTk4QdYavopeHVXtyFGQ9vyLMVaNWkWocwjix+0n6sQgv7Zq5nYjYulz7ThmK18zsvNJ337ahuMLv3ulow==",
       "license": "MIT",
       "dependencies": {
         "axios": "^1.8.2"
diff --git a/package.json b/package.json
index 0a90e3b..c28ce6b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "doc-detective-resolver",
-  "version": "3.0.0",
+  "version": "3.0.1",
   "description": "Detect and resolve docs into Doc Detective tests.",
   "main": "src/index.js",
   "scripts": {
@@ -30,7 +30,7 @@
     "doc-detective-common": "^3.0.4",
     "dotenv": "^16.5.0",
     "json-schema-faker": "^0.5.9",
-    "posthog-node": "^4.17.1",
+    "posthog-node": "^4.17.2",
     "uuid": "^11.1.0"
   },
   "devDependencies": {
diff --git a/src/utils.js b/src/utils.js
index 35a9902..d73f67a 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -251,6 +251,18 @@ async function isValidSourceFile({ config, files, source }) {
   return true;
 }
 
+/**
+ * Parses raw test content into an array of structured test objects.
+ *
+ * Processes input content using inline statement and markup regex patterns defined by {@link fileType}, extracting test and step definitions. Supports detection of test boundaries, ignored sections, and step definitions, including batch markup matches. Converts and validates extracted objects against the test and step schemas, handling both v2 and v3 formats. Returns an array of validated test objects with their associated steps.
+ *
+ * @param {Object} options - Options for parsing.
+ * @param {Object} options.config - Test configuration object.
+ * @param {string|Object} options.content - Raw file content as a string or object.
+ * @param {string} options.filePath - Path to the file being parsed.
+ * @param {Object} options.fileType - File type definition containing parsing rules.
+ * @returns {Array<Object>} Array of parsed and validated test objects.
+ */
 async function parseContent({ config, content, filePath, fileType }) {
   const statements = [];
   const statementTypes = [
@@ -343,7 +355,7 @@ async function parseContent({ config, content, filePath, fileType }) {
         if (matches.length > 0 && markup.batchMatches) {
           // Combine all matches into a single match
           const combinedMatch = {
-            1: matches.map((match) => match[1] || match[0]).join(""),
+            1: matches.map((match) => match[1] || match[0]).join(os.EOL),
             type: "detectedStep",
             markup: markup,
             sortIndex: Math.min(...matches.map((match) => match.index)),


Reviews:
user: login: copilot-pull-request-reviewer[bot]
body: ## Pull Request Overview

This PR updates the package metadata and adjusts how regex matches are concatenated in `parseContent`.

- Bump package version to 3.0.1 and upgrade `posthog-node` to 4.17.2  
- Change the join character in `parseContent` from `""` to `"\n"` to keep lines separate

### Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

| File           | Description                                       |
| -------------- | ------------------------------------------------- |
| src/utils.js   | Use `"\n"` as the join delimiter for batched matches |
| package.json   | Version bumped to 3.0.1 and `posthog-node` updated to 4.17.2 |




state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T16:53:09Z
user: login: coderabbitai[bot]
body: **Actionable comments posted: 5**

<details>
<summary>♻️ Duplicate comments (1)</summary><blockquote>

<details>
<summary>package.json (1)</summary><blockquote>

`3-3`: **Version bump to 3.0.1 looks good.**

This minor version increment appropriately reflects the formatting fix for batched regex matches mentioned in the PR description.


Don't forget to update the CHANGELOG or release notes to reflect this new version.

</blockquote></details>

</blockquote></details>

<details>
<summary>🧹 Nitpick comments (4)</summary><blockquote>

<details>
<summary>dev/index.js (1)</summary><blockquote>

`15-62`: **Well-structured configuration for markdown processing.**

The configuration has been thoroughly reworked to handle Markdown files with embedded Python code blocks. The regex patterns for detecting test markers and Python code blocks are comprehensive.


I notice the input path is hardcoded to a specific user's directory. Consider making this path relative or configurable:

```diff
-    input: "/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md",
+    input: path.join(__dirname, "doc-content copy.md"),
```

</blockquote></details>
<details>
<summary>dev/output.json (3)</summary><blockquote>

`46-47`: **Validate `batchMatches: true` behavior**  
Batching is critical to process multiple Python fences in one pass. Please add unit tests or sample Markdown fixtures that contain several ```python``` blocks back-to-back to confirm that each snippet is correctly extracted and executed.

---

`82-83`: **Remove empty `openApi` arrays**  
Both the spec-level and context-level `"openApi": []` entries are vestigial. Deleting them will clean up the JSON and reduce noise.

---

`98-100`: **Omit or document the empty `runOn` array**  
An empty `"runOn": []` may confuse future maintainers. If no execution targets are needed, either remove this property or update the schema/docs to explain allowable values and semantics.

</blockquote></details>

</blockquote></details>

<details>
<summary>📜 Review details</summary>

**Configuration used: .coderabbit.yaml**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between 678bef3c24e922a69d2fcf06e58767f0be16dfd9 and c697300b5e3911d82be0aa05df00a4fa6477b5e2.

</details>

<details>
<summary>⛔ Files ignored due to path filters (1)</summary>

* `package-lock.json` is excluded by `!**/package-lock.json`

</details>

<details>
<summary>📒 Files selected for processing (5)</summary>

* `.coderabbit.yaml` (1 hunks)
* `dev/index.js` (2 hunks)
* `dev/output.json` (3 hunks)
* `package.json` (2 hunks)
* `src/utils.js` (2 hunks)

</details>

<details>
<summary>🧰 Additional context used</summary>

<details>
<summary>🧬 Code Graph Analysis (1)</summary>

<details>
<summary>src/utils.js (1)</summary><blockquote>

<details>
<summary>src/config.js (1)</summary>

* `os` (1-1)

</details>

</blockquote></details>

</details>

</details>

<details>
<summary>🔇 Additional comments (5)</summary><blockquote>

<details>
<summary>package.json (1)</summary>

`33-33`: **Dependency update looks good.**

Updating posthog-node from ^4.17.1 to ^4.17.2 is a good practice to incorporate any bug fixes and security patches.

</details>
<details>
<summary>.coderabbit.yaml (1)</summary>

`27-27`: **Expanded branch monitoring improves code quality coverage.**

Adding "main" to the base_branches array ensures that automatic code reviews are triggered for PRs targeting both main and rc branches.

</details>
<details>
<summary>dev/index.js (1)</summary>

`8-12`: **Great documentation added.**

The JSDoc comment clearly explains the function's purpose and behavior, which improves code maintainability.

</details>
<details>
<summary>src/utils.js (2)</summary>

`254-265`: **Excellent documentation added.**

The comprehensive JSDoc comment thoroughly explains the function's purpose, parameters, and return value, which significantly improves code maintainability and discoverability.

---

`358-358`: **Great cross-platform compatibility improvement.**

Using `os.EOL` instead of an empty string ensures that lines remain properly separated when processing batched regex matches across different operating systems.


This change directly addresses the PR objective of fixing formatting for batched regex matches by ensuring line separators are properly maintained.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-05-22T17:07:23Z

Review comments:
diff_hunk: @@ -343,7 +343,7 @@ async function parseContent({ config, content, filePath, fileType }) {
         if (matches.length > 0 && markup.batchMatches) {
           // Combine all matches into a single match
           const combinedMatch = {
-            1: matches.map((match) => match[1] || match[0]).join(""),
+            1: matches.map((match) => match[1] || match[0]).join("\n"),
path: src/utils.js
user: login: Copilot
body: Consider using `os.EOL` (from Node's `os` module) instead of a hardcoded "\n" to ensure cross-platform compatibility.
```suggestion
            1: matches.map((match) => match[1] || match[0]).join(os.EOL),
```
created_at: 2025-05-22T16:53:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,6 +1,6 @@
 {
   "name": "doc-detective-resolver",
-  "version": "3.0.0",
+  "version": "3.0.1",
path: package.json
user: login: Copilot
body: [nitpick] Don't forget to update the CHANGELOG or release notes to reflect this new version.
created_at: 2025-05-22T16:53:08Z
author_association: CONTRIBUTOR
diff_hunk: @@ -333,117 +39,32 @@
         },
         "markup": [
           {
-            "name": "checkHyperlink",
-            "regex": [
-              "(?<!\\!)\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
-            ],
-            "actions": [
-              "checkLink"
-            ]
-          },
-          {
-            "name": "clickOnscreenText",
+            "name": "runPython",
             "regex": [
-              "\\b(?:[Cc]lick|[Tt]ap|[Ll]eft-click|[Cc]hoose|[Ss]elect|[Cc]heck)\\b\\s+\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
+              "```(?:python)\\b\\s*\\n(?<code>.*?)(?=\\n```)"
             ],
+            "batchMatches": true,
             "actions": [
-              "click"
-            ]
-          },
-          {
-            "name": "findOnscreenText",
-            "regex": [
-              "\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
-            ],
-            "actions": [
-              "find"
-            ]
-          },
-          {
-            "name": "goToUrl",
-            "regex": [
-              "\\b(?:[Gg]o\\s+to|[Oo]pen|[Nn]avigate\\s+to|[Vv]isit|[Aa]ccess|[Pp]roceed\\s+to|[Ll]aunch)\\b\\s+\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
-            ],
-            "actions": [
-              "goTo"
-            ]
-          },
-          {
-            "name": "screenshotImage",
-            "regex": [
-              "!\\[[^\\]]*\\]\\(\\s*([^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)\\s*\\{(?=[^}]*\\.screenshot)[^}]*\\}"
-            ],
-            "actions": [
-              "screenshot"
-            ]
-          },
-          {
-            "name": "typeText",
-            "regex": [
-              "\\b(?:press|enter|type)\\b\\s+\"([^\"]+)\""
-            ],
-            "actions": [
-              "type"
+              {
+                "runCode": {
+                  "language": "python",
+                  "code": "print(\"Hello, world!\")\nprint(\"Hello to you too!\")"
+                }
+              }
             ]
           }
         ]
-      },
-      {
-        "name": "asciidoc",
-        "extensions": [
-          "adoc",
-          "asciidoc",
-          "asc"
-        ],
-        "inlineStatements": {
-          "testStart": [
-            "\\/\\/\\s+\\(\\s*test\\s+([\\s\\S]*?)\\s*\\)"
-          ],
-          "testEnd": [
-            "\\/\\/\\s+\\(\\s*test end\\s*\\)"
-          ],
-          "ignoreStart": [
-            "\\/\\/\\s+\\(\\s*test ignore start\\s*\\)"
-          ],
-          "ignoreEnd": [
-            "\\/\\/\\s+\\(\\s*test ignore end\\s*\\)"
-          ],
-          "step": [
-            "\\/\\/\\s+\\(\\s*step\\s+([\\s\\S]*?)\\s*\\)"
-          ]
-        },
-        "markup": []
-      },
-      {
-        "name": "html",
-        "extensions": [
-          "html",
-          "htm"
-        ],
-        "inlineStatements": {
-          "testStart": [
-            "<!--\\s*test\\s+?([\\s\\S]*?)\\s*-->"
-          ],
-          "testEnd": [
-            "<!--\\s*test end\\s*([\\s\\S]*?)\\s*-->"
-          ],
-          "ignoreStart": [
-            "<!--\\s*test ignore start\\s*-->"
-          ],
-          "ignoreEnd": [
-            "<!--\\s*test ignore end\\s*-->"
-          ],
-          "step": [
-            "<!--\\s*step\\s+?([\\s\\S]*?)\\s*-->"
-          ]
-        },
-        "markup": []
       }
     ],
+    "logLevel": "debug",
+    "output": ".",
+    "recursive": true,
+    "relativePathBase": "file",
+    "detectSteps": true,
     "telemetry": {
       "send": true
     },
-    "configId": "343eeb23-6a45-496f-84ef-6210be7e10c7",
+    "configId": "6ffa39d0-4353-42f0-a891-09aae0980197",
path: dev/output.json
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Strip environment-specific metadata from committed config**  
Fields under `"environment"` (arch, platform, workingDirectory) and the generated `"configId"` are local artifacts that shouldn’t be checked into source control. They can expose unnecessary details and will change on each run. Filter them out or generate dynamically at runtime.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In dev/output.json around lines 59 to 67, the committed config includes
environment-specific metadata such as "configId" and fields under "environment"
like arch, platform, and workingDirectory. These should be removed from the
committed file to avoid exposing local details and frequent changes. Modify the
code or build process to exclude these fields from the committed JSON and
instead generate or inject them dynamically at runtime as needed.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-22T17:07:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -452,606 +73,31 @@
   },
   "specs": [
     {
+      "specId": "b0d003dd-0fe2-4e46-8844-05f7cd0be602",
+      "contentPath": "/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md",
       "tests": [
path: dev/output.json
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Use a relative `contentPath` in specs**  
Mirroring the earlier `input` concern, avoid absolute paths in `"specs[0].contentPath"`. Switching to `"dev/doc-content copy.md"` or a templated variable ensures this spec remains machine-agnostic.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In dev/output.json around lines 77 to 78, the contentPath is currently an
absolute path which makes the spec machine-dependent. Change the contentPath
value to a relative path like "dev/doc-content copy.md" or use a templated
variable to ensure the spec is portable and machine-agnostic.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-22T17:07:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,302 +1,8 @@
 {
   "config": {
     "input": [
-      "/home/hawkeyexl/Workspaces/resolver/dev/dev.spec.json"
+      "/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md"
path: dev/output.json
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Avoid absolute paths for input sources**  
Using an absolute path (`/home/hawkeyexl/…/dev/doc-content copy.md`) ties this configuration to a single machine. For better portability and onboarding, switch to a project-relative path (e.g., `dev/doc-content copy.md`) or parameterize it via an environment variable.

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In dev/output.json at line 4, replace the absolute file path
"/home/hawkeyexl/Workspaces/resolver/dev/doc-content copy.md" with a relative
path like "dev/doc-content copy.md" or use an environment variable to specify
the path. This change will make the configuration portable across different
machines and environments.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-22T17:07:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -333,117 +39,32 @@
         },
         "markup": [
           {
-            "name": "checkHyperlink",
-            "regex": [
-              "(?<!\\!)\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
-            ],
-            "actions": [
-              "checkLink"
-            ]
-          },
-          {
-            "name": "clickOnscreenText",
+            "name": "runPython",
             "regex": [
-              "\\b(?:[Cc]lick|[Tt]ap|[Ll]eft-click|[Cc]hoose|[Ss]elect|[Cc]heck)\\b\\s+\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
+              "```(?:python)\\b\\s*\\n(?<code>.*?)(?=\\n```)"
             ],
+            "batchMatches": true,
path: dev/output.json
user: login: coderabbitai[bot]
body: _⚠️ Potential issue_

**Ensure regex supports multiline code block matching**  
The pattern `"```(?:python)\b\s*\n(?<code>.*?)(?=\n```)"` uses `.` to capture code, but in JavaScript the `.` does not match newlines unless the `s` (dotAll) flag is enabled. To reliably capture multiline Python blocks without relying on engine flags, replace `.*?` with `[\s\S]*?` or explicitly enable dotAll in your parser.  
  
Example diff:  
```diff
- "regex": [
-   "```(?:python)\\b\\s*\\n(?<code>.*?)(?=\\n```)"
- ],
+ "regex": [
+   "```(?:python)\\b\\s*\\n(?<code>[\\s\\S]*?)(?=\\n```)"
+ ],
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
"name": "runPython",
            "regex": [
              "
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In dev/output.json around lines 42 to 46, the regex pattern for capturing Python
code blocks uses `.*?` which does not match newlines in JavaScript regex without
the dotAll flag. To fix this, replace `.*?` with `[\s\S]*?` in the regex string
to ensure multiline code blocks are correctly matched without relying on engine
flags.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-22T17:07:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -333,117 +39,32 @@
         },
         "markup": [
           {
-            "name": "checkHyperlink",
-            "regex": [
-              "(?<!\\!)\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
-            ],
-            "actions": [
-              "checkLink"
-            ]
-          },
-          {
-            "name": "clickOnscreenText",
+            "name": "runPython",
             "regex": [
-              "\\b(?:[Cc]lick|[Tt]ap|[Ll]eft-click|[Cc]hoose|[Ss]elect|[Cc]heck)\\b\\s+\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
+              "```(?:python)\\b\\s*\\n(?<code>.*?)(?=\\n```)"
             ],
+            "batchMatches": true,
             "actions": [
-              "click"
-            ]
-          },
-          {
-            "name": "findOnscreenText",
-            "regex": [
-              "\\*\\*((?:(?!\\*\\*).)+)\\*\\*"
-            ],
-            "actions": [
-              "find"
-            ]
-          },
-          {
-            "name": "goToUrl",
-            "regex": [
-              "\\b(?:[Gg]o\\s+to|[Oo]pen|[Nn]avigate\\s+to|[Vv]isit|[Aa]ccess|[Pp]roceed\\s+to|[Ll]aunch)\\b\\s+\\[[^\\]]+\\]\\(\\s*(https?:\\/\\/[^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)"
-            ],
-            "actions": [
-              "goTo"
-            ]
-          },
-          {
-            "name": "screenshotImage",
-            "regex": [
-              "!\\[[^\\]]*\\]\\(\\s*([^\\s)]+)(?:\\s+\"[^\"]*\")?\\s*\\)\\s*\\{(?=[^}]*\\.screenshot)[^}]*\\}"
-            ],
-            "actions": [
-              "screenshot"
-            ]
-          },
-          {
-            "name": "typeText",
-            "regex": [
-              "\\b(?:press|enter|type)\\b\\s+\"([^\"]+)\""
-            ],
-            "actions": [
-              "type"
+              {
+                "runCode": {
+                  "language": "python",
+                  "code": "print(\"Hello, world!\")\nprint(\"Hello to you too!\")"
+                }
+              }
path: dev/output.json
user: login: coderabbitai[bot]
body: _🛠️ Refactor suggestion_

**Replace hardcoded Python snippet with dynamic placeholder**  
Right now, the action always runs the same `"Hello, world!"` code. To actually execute the matched code blocks, the `"code"` field should interpolate the captured content—e.g., `"{{code}}"`—instead of a static string.  
  
Example adjustment:  
```diff
- "actions": [
-   {
-     "runCode": {
-       "language": "python",
-       "code": "print(\"Hello, world!\")\nprint(\"Hello to you too!\")"
-     }
-   }
- ]
+ "actions": [
+   {
+     "runCode": {
+       "language": "python",
+       "code": "{{ code }}"
+     }
+   }
+ ]
```


<!-- suggestion_start -->

<details>
<summary>📝 Committable suggestion</summary>

> ‼️ **IMPORTANT**
> Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

```suggestion
              "actions": [
                {
                  "runCode": {
                    "language": "python",
                    "code": "{{ code }}"
                  }
                }
              ]
```

</details>

<!-- suggestion_end -->

<details>
<summary>🤖 Prompt for AI Agents</summary>

```
In dev/output.json around lines 49 to 53, the "code" field under "runCode"
currently contains a hardcoded Python snippet. Replace this static string with a
dynamic placeholder like "{{code}}" to ensure the action executes the actual
matched code blocks instead of always running the same fixed code.
```

</details>

<!-- This is an auto-generated comment by CodeRabbit -->
created_at: 2025-05-22T17:07:23Z
author_association: CONTRIBUTOR

PR comments:
user: login: coderabbitai[bot]
created_at: 2025-05-22T16:56:23Z
body: <!-- This is an auto-generated comment: summarize by coderabbit.ai -->
<!-- walkthrough_start -->

## Walkthrough

The updates revise configuration and processing logic to focus on handling Markdown files with embedded Python code blocks, removing previous OpenAPI integrations and related test definitions. The main function and utility logic are adjusted to support this new workflow, and documentation is enhanced. Minor dependency and version updates are also included.

## Changes

| File(s)                                   | Change Summary |
|--------------------------------------------|---------------|
| .coderabbit.yaml                          | Expanded `base_branches` for automatic reviews to include both "main" and "rc" branches. |
| dev/index.js                              | Overhauled the `main` function to process Markdown files for test markers and Python code blocks, updating configuration and output behavior. Added explanatory comments. |
| dev/output.json                           | Switched input from JSON spec to Markdown, removed OpenAPI integrations, simplified test steps and markup to focus on running Python code in Markdown code blocks. Updated IDs and removed other file type definitions. |
| package.json                              | Bumped package version from 3.0.0 to 3.0.1 and updated "posthog-node" dependency from ^4.17.1 to ^4.17.2. |
| src/utils.js                              | Added comprehensive JSDoc to `parseContent`. Changed batch markup match concatenation to use OS-specific end-of-line separator. |


## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant User
    participant MainFunction
    participant Utils_parseContent
    participant FileSystem

    User->>MainFunction: Start main()
    MainFunction->>FileSystem: Read Markdown file
    MainFunction->>Utils_parseContent: parseContent({ config, content, ... })
    Utils_parseContent->>Utils_parseContent: Detect test markers & Python code blocks
    Utils_parseContent-->>MainFunction: Return structured test objects
    MainFunction->>FileSystem: Write output.json
    MainFunction->>User: Log result
```

## Poem

> In a world of Markdown, Python now runs,  
> OpenAPI’s gone, but the testing’s not done.  
> With regex and markers, the steps are all neat,  
> Output in JSON—a coder’s small treat.  
> Version ticks upward, the rabbit approves,  
> Hopping through code where the Python groove moves!  
> 🐇✨

<!-- walkthrough_end -->

<!-- announcements_start -->

> [!NOTE]
> <details>
> <summary>⚡️ AI Code Reviews for VS Code, Cursor, Windsurf</summary>
> 
> CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
> Learn more [here](http://coderabbit.ai/ide).
> 
> </details>

---

> [!NOTE]
> <details>
> <summary>⚡️ Faster reviews with caching</summary>
> 
> CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure `Review - Disable Cache` at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the `Data Retention` setting under your Organization Settings.
> Enjoy the performance boost—your workflow just got faster.
> 
> </details>

<!-- announcements_end -->
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAMXgAD0gAM3wKZmpxDCIUtMgBagZYKP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dCIUfIun1xunGKhGN191ZzN3dLmM8Gt3+iWLtx6WpF+weKeJYAZPQtOBGCClGnGFkCeCzN43I2cC+JsM1AxQAG9FEiAN1vjNRLs5Uh8fhBLIgd8qoABfQlAKCUDPHYvYg4/yK4SAWfPpRog0XU8iMEaU6gbRBpPgWYnzQis6F5OQ38PcJcm808U4tLZ4zgPwTEnQ58NoVhd8LcL8XcfsKcJoXATyeBRATycaIZWgTyVaA+b8cyryhgAANgAE58joQ4Q4QBAABWEgaEWKuYOYWgAADgqNmDhDQDQDhBStoGSCSrQByOSDQGipyPyPyNSpIB9N7AMAsuvHUD8toACqCroE8kHH0CAA -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=doc-detective/resolver&utm_content=1):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->
author_association: CONTRIBUTOR
user: login: coderabbitai[bot]
created_at: 2025-05-22T16:57:21Z
body: > [!NOTE]
> Generated docstrings for this pull request at https://github.com/doc-detective/resolver/pull/2
author_association: CONTRIBUTOR